summaryrefslogtreecommitdiff
path: root/java/java-psi-impl/src/com
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2013-09-11 15:53:32 -0700
committerTor Norbye <tnorbye@google.com>2013-09-11 15:53:37 -0700
commita28de544d7f6bae0c637a1f8175ea613a976c52e (patch)
tree0b506efac9439f5a06d00e4aef4597c6d49bba3c /java/java-psi-impl/src/com
parentc7f983b5dcd0499fc68aacaba043874648932b6b (diff)
downloadidea-a28de544d7f6bae0c637a1f8175ea613a976c52e.tar.gz
Snapshot b7cfcd5072e521a95c49cdd58405fa262075116e from idea/132.197 of git://git.jetbrains.org/idea/community.git
b7cfcd5: 2013-09-10 Alexey Kudravtsev - cleanup 98e9b07: 2013-09-10 Alexey Kudravtsev - optimisation: almost always one element set/map 06b1744: 2013-09-10 Alexey Kudravtsev - cleanup static final constants c2f6153: 2013-09-10 Alexey Kudravtsev - cleanup df9d3ff: 2013-09-10 Alexey Kudravtsev - IDEA-113331 c502feb: 2013-09-10 Alexey Kudravtsev - cleanup 4790327: 2013-09-09 Alexey Kudravtsev - cleanup 734f361: 2013-09-09 Alexey Kudravtsev - cleanup 4fa0b86: 2013-09-11 Dmitry Avdeev - action moved from platform to IDEA cade1ac: 2013-09-11 Bas Leijdekkers - don't make quickfix available when it does nothing e25c86f: 2013-09-11 nik - fixed copying items from 'Dependencies' panel (IDEA-108071) ba416aa: 2013-09-11 nik - IDEA-108213: ZipException on attempt to extract non-existent jar when building artifact e55712a: 2013-09-11 nik - show path to incorrect zip-file in error message (IDEA-113123), improved 68d131a: 2013-09-11 Vladislav.Soroka - Gradle: gradle build file can be used to resolve project info instead of gradle project dir 09cdde1: 2013-09-11 nik - JPS bootstrap build libs updated 6e4c9f0: 2013-09-10 nik - xdebugger: mark new properties appeared after step in debugger trees (WI-3066) 7aa6d26: 2013-09-10 nik - jps model: added method to process annotation roots from module and its dependencies de4cbc7: 2013-09-10 nik - IDEA-112009: Library selection dialog is too small ba3c923: 2013-09-10 Bas Leijdekkers - IDEA-93530 (bad code green: cannot assign a value to final variable) ae1a4ca: 2013-09-11 Vassiliy Kudryashov - Lense mode "internal" preview 296e85f: 2013-09-10 Dmitry Jemerov - Merge branch 'master' of git://github.com/asedunov/intellij-community into pull97 816cc8a: 2013-09-10 Bas Leijdekkers - IDEA-93515 (Good code red: variable might not have been initialized) f3a5bef: 2013-09-10 Gregory.Shrago - IDEA-113281 Ctrl+E for Console History shadows hotkey for Recent 00c7cc6: 2013-09-10 Anna Kozlova - EA-49751 - NPE: TestsOutputConsolePrinter.isRoot c848db6: 2013-09-10 Anna Kozlova - Poly Expressions 9f5e9d5: 2013-09-10 Vladimir Krivosheev - correct fix WEB-8151 8534bf1: 2013-09-10 peter - cache the default dfaVar type 2ee4c95: 2013-09-10 peter - merge DfaNotNullValue into DfaTypeValue 650794d: 2013-09-10 peter - some findusageability in dfa a75c57d: 2013-09-10 Alexey Sedunov - Refactor method search classes for better reusability 049514a: 2013-09-10 Vladislav.Soroka - IDEA-50450 Gradle code insight; tasks dsl resolving (incomplete) 8bb28e2: 2013-09-10 Denis Fokin - Cocoa does not like activities while transition in full screen is happening. This fix prevents simultaneous entering in the full screen mode. c837b30: 2013-09-10 Sergey Evdokimov - IDEA-109771 Incorrent Maven dependency resolution with war classes dependency eede608: 2013-09-10 Dmitry Avdeev - no icons in wizards a18ab7c: 2013-09-10 Dmitry Avdeev - cleanup 204e83b: 2013-09-10 Dmitry Avdeev - cleanup 33d61c5: 2013-09-10 Dmitry Avdeev - fixed layout in absence of icons 70a172a: 2013-09-10 Bas Leijdekkers - IDEA-91960 (Type parameter extends final class inspection warns on cases when can not be removed) f0e77a8: 2013-09-10 Rustam Vishnyakov - Allow to move a standard code style option to another group [CR-IC-2192] (cherry picked from commit 81c4f16) 3748154: 2013-09-10 Max Medvedev - IDEA-113299 Imports removed when writing javadoc 1a6ca29: 2013-09-10 Max Medvedev - IDEA-52424 language injection for GStrings and binary expressions 83237e6: 2013-07-07 Max Medvedev - IDEA-99638 completion in @Language("<caret>") 075e763: 2013-09-10 Aleksey Pivovarov - @NotNull 836e1af: 2013-09-10 Aleksey Pivovarov - Github: Ref -> AtomicReference 2c384d0: 2013-09-10 Aleksey Pivovarov - Github: remove duplication 1d09e47: 2013-09-10 Aleksey Pivovarov - Github: fetch a single branch for diff 3361c53: 2013-09-10 Aleksey Pivovarov - Github: use BorderFactory 0c1a982: 2013-09-10 Aleksey Pivovarov - Github: Nullable 403902b: 2013-09-07 Aleksey Pivovarov - Github: project-level settings 911bea9: 2013-09-10 Vladislav.Soroka - IDEA-113403 Gradle: disable wrapper verification by default and add check for default wrapper files 7434b38: 2013-09-10 Dmitry Avdeev - preferred focused component for wizards ecf3594: 2013-09-10 peter - static CachedValueManager.getCachedValue(PsiElement, CachedValueProvider) for less verbose cached value storage in psi user data 7d3f4f25: 2013-09-10 peter - some dfa simplifications not affecting tests 9d04224: 2013-09-09 peter - remove unused DelegatingInstructionVisitor dff5e27: 2013-09-10 Denis Fokin - Windows long paths issue has been fixed, the com.intellij.ui.win.Task was moved from RecentTasks class because of some problems with JNI invocations. Class path now is enclosed by double quotes. a1e5a9d: 2013-09-10 Ekaterina Tuzova - Merge remote-tracking branch 'origin/master' dcb78a4: 2013-09-10 Ekaterina Tuzova - Merge remote-tracking branch 'origin/master' 7840bbe: 2013-09-10 Anna Kozlova - deprecate to be able to be used in PsiClass etc 401e730: 2013-09-10 Ekaterina Tuzova - Merge remote-tracking branch 'origin/master' 2fb38cf: 2013-09-10 Anna Kozlova - Merge remote-tracking branch 'origin/master' 6bae9e1: 2013-09-10 Anna Kozlova - optimization a5ebbff: 2013-09-10 Anna Kozlova - cleanup lambda specifics a44e101: 2013-09-10 Anna Kozlova - EA-49734 - IAE: GenericsHighlightUtil.checkReferenceTypeArgumentList 73bc4cb: 2013-09-10 Vladimir Krivosheev - auth works now, continue "sync now" button f590909: 2013-09-10 Dmitry Jemerov - Merge branch 'master' of git://github.com/bashor/intellij-community into pull96 769fd94: 2013-09-10 Ekaterina Tuzova - fixed PY-10714 Reformat of string creates error da07f0e: 2013-09-10 Konstantin Kolosovsky - Merge branch 'svn1_8_new' 08f3baf: 2013-09-10 Konstantin Kolosovsky - IDEA-112179 PropertiesComponent refactored - duplication removed cdfb7ae: 2013-09-10 Konstantin Kolosovsky - IDEA-112179 Add/Edit/Delete svn properties 0a36021: 2013-09-10 nik - IDEA-112941: Throwable at com.intellij.openapi.roots.ui.configuration.classpath.ChangeLibraryLevelActionBase$1.run da397a1: 2013-09-10 peter - add a note on adverse groovy-hotswap effects on serialization (IDEA-61884) adf5bb7: 2013-09-10 nik - fixed building CE by 64-bit JDK (IDEA-112953) 1b396ef: 2013-09-10 nik - jps build: memory usage optimization 921a2f3: 2013-09-10 Konstantin Bulenkov - mem leak fixed 276c402: 2013-09-10 Dmitry Avdeev - new project wizard b07de54: 2013-09-10 nik - show path to incorrect zip-file in error message (IDEA-113123) ab4e6c6: 2013-09-10 nik - remote servers: allow to show additional logs for deployments in 'Servers View' - 2 eb65d57: 2013-09-09 nik - remote servers: allow to show additional logs for deployments in 'Servers View' faff6c2: 2013-07-07 Max Medvedev - duplicated test fe0569b: 2013-07-07 Max Medvedev - fix broken jar in test-data a840eb2: 2013-07-07 Max Medvedev - Groovy shell: support commands bb2ff42: 2013-07-07 Max Medvedev - Groovy Shell: support classes a7658c1: 2013-07-07 Max Medvedev - Complete imported classes in GroovyCodeFragment e53f7be: 2013-07-07 Max Medvedev - NN/Nu edd7e1e: 2013-07-07 Max Medvedev - support imports in GroovyShell f203ff2: 2013-07-07 Max Medvedev - support imports in GroovyShell d45e9cd: 2013-07-07 Max Medvedev - Groovy element factory: create import from statement 59f6256: 2013-07-07 Max Medvedev - IDEA-110179 fix control flow building for if-statement c9f45b6: 2013-07-07 Max Medvedev - fix GroovyIntentionsBundle 02bf9a6: 2013-07-07 Max Medvedev - IDEA-110178 'convert concatenation to GString' intention supports regexes 8f4f1ac: 2013-07-06 Max Medvedev - fix GroovyEnterHandler f5bb52d: 2013-07-06 Max Medvedev - IDEA-110178 upper letters 711f61e: 2013-07-06 Max Medvedev - IDEA-110178 'convert string literal to dollar-slashy string' intention 9462203: 2013-07-06 Max Medvedev - IDEA-110178 'convert string literal to regex' intention should convert dollar-slashy regexes c53a519: 2013-07-06 Max Medvedev - cleanup GrStringUtil 7134b63: 2013-07-06 Max Medvedev - IDEA-110178 'convert string literal to regex' intention 60b2f0a: 2013-07-06 Max Medvedev - IDEA-109053 Convert to single-line string fixed 1dea12c: 2013-09-10 Vladimir Krivosheev - fix fetch initial "sync now" button 3cc0794: 2013-09-09 Vladimir Krivosheev - add note about SkipDefaultValuesSerializationFilters 67ecfc0: 2013-09-09 Vladimir Krivosheev - ApplicationImpl — cleanup getExtensions ics — commit under progress 4cae157: 2013-09-09 Anna Kozlova - more specific: lambda extended initial fix (IDEA-113357) 0195034: 2013-09-09 Anna Kozlova - lambda -> method ref: reject unresolved lambdas f1b399b: 2013-09-09 Alexander Lobas - RenderServer 4252a50: 2013-09-09 Vladimir Krivosheev - SingleAlarm — should use ModalityState.NON_MODAL a5ca071: 2013-09-09 Konstantin Kolosovsky - IDEA-112179 "Set property" action implemented 2fa6ff6: 2013-09-09 Bas Leijdekkers - test for IDEA-53184 b57f5e1: 2013-09-09 Konstantin Bulenkov - WI-19949 Parent class methods aren't shown after second Command-F12 a2beba8: 2013-09-09 Zalim Bashorov - When we don't have any dependency(after f4a27e8) we should use ModificationTracker.NEVER_CHANGED instead empty array. 5154748: 2013-09-09 Konstantin Kolosovsky - IDEA-112181 Handling readonly files with or without "svn:needs-lock" property 55a5f4c: 2013-09-09 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' e6f6c94: 2013-09-09 Vladimir Krivosheev - WEB-6780 JS Debugger / Variables: "Jump to Source" not working: This action should be available only for object or functions. cd02963: 2013-09-09 Konstantin Kolosovsky - IDEA-112181 Lock data parsing for "svn info" command 66b72f8: 2013-09-09 Bas Leijdekkers - fix test and add test for IOE bb9b1f5: 2013-09-09 peter - IDEA-113391 Edit Method Contract intention for library methods b77731d: 2013-09-09 Konstantin Kolosovsky - IDEA-112181 Lock/Unlock actions implemented bc8cb84: 2013-09-09 Konstantin Kolosovsky - IDEA-94942 Utility methods to parse svn command line warnings b45114d: 2013-09-09 Dmitry Trofimov - Possibility to select Maya.app on Mac in add interpreter dialog. 631b361: 2013-09-09 Sergey Evdokimov - Completion of dependency should honor <dependencyManagement> section 0fcbc91: 2013-09-09 Roman Shevchenko - platform: correct formatting in the missing framework library validator 660731f: 2013-09-09 Bas Leijdekkers - use TypeConversionUtil.erasure() instead of reinventing the wheel badly 0fcec29: 2013-09-09 Bas Leijdekkers - prevent IOE on array initializer without array type (e.g. Map<String, String> m = {}) 5d70c64: 2013-09-09 Fedor Korotkov - Reverted 482c517 ea4b4f2: 2013-09-09 Vladimir Krivosheev - continue WEB-1171 javascript live console: execution enabled condition 54872b0: 2013-09-09 Anna Kozlova - accept interfaces as main classes for java 8 (IDEA-113340) c9fc494: 2013-09-09 Anna Kozlova - pull up: ensure that default won't be inserted for ll < 1.8 (IDEA-113323) c51363b: 2013-09-09 Vladimir Krivosheev - we should not call execute action if completion variant not focused 7c5f486: 2013-09-09 Dmitry Trofimov - Disposable parent can be null. 1e9a0d8: 2013-09-09 nik - xdebugger: simplified calling old deprecated method & javadocs added 2e3c259: 2013-09-09 nik - notnullification 0aa3d9d: 2013-09-09 Vladimir Krivosheev - continue WEB-1171 javascript live console: add history actions ac12238: 2013-09-09 Vladimir Krivosheev - add Copyright c7d7080: 2013-09-08 Alex Ruiz - Minor changes to NewProjectCheckoutListener to reuse its code. 8d29e4f: 2013-09-09 Sergey Simonchik - XDebugProcess method rename: createLayouter -> createTabLayouter f58251b: 2013-09-09 Sergey Simonchik - XDebugProcess.registerAdditionalContent method restored to keep compatibility with IDEA 12 API 286cdc3: 2013-09-09 Anna Kozlova - anonym -> lambda: unique param names (IDEA-113338) 238e311: 2013-09-09 Vladimir Krivosheev - prefer to use interface LanguageConsoleView instead of impl class d75838a: 2013-09-06 Vladimir Krivosheev - continue WEB-1171 javascript live console — works now, but UI is ugly 9f054b0: 2013-09-09 Sergey Simonchik - XDebug layout API improvement: XDebugProcess.registerAdditionalContent moved to XDebugLayouter 7cc0d20: 2013-09-08 Vladimir Krivosheev - schedule commit&push 4d9e998: 2013-09-08 Vladimir Krivosheev - move SingleAlarm to platform-impl 4d840cf: 2013-09-08 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 134a7fa: 2013-09-08 Fedor Korotkov - WEB-8731 HTML parser breaks with unquoted complex attributes 482c517: 2013-09-08 Fedor Korotkov - WEB-8397 Incorrect "element is not allowed here" inspection 3bbc3f7: 2013-09-08 Dmitry Trofimov - Implement get variable for console variables view. 12e32a8: 2013-09-08 Bas Leijdekkers - IDEA-96419 ("Externalizable class without public no-arg constructor" inspection options) 2d25b3b: 2013-09-08 Bas Leijdekkers - DRY 8941cf8: 2013-09-08 Bas Leijdekkers - IDEA-113298 (replace assertTrue with assertFalse removes message) 72c972f: 2013-09-07 Max Medvedev - auto inject RegExp lang to reg-exp operator argeuments e7fa284: 2013-09-07 Max Medvedev - IDEA-113346 False negative in groovy withStream closure 0b795be: 2013-09-07 Bas Leijdekkers - IDEA-85224 (Inspection "non thread-safe static field access" gives false +ve for static initializers) 28a1e72: 2013-09-07 Bas Leijdekkers - cleanup 8bc5fbf: 2013-06-12 Max Medvedev - IDEA-111780 Extract method from static closure should create static method bc4b2d7: 2013-06-12 Max Medvedev - IDEA-112878 Groovy code completion doesn't obey 'before parentheses -> method parentheses' settings. 1afc036: 2013-09-07 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 80cd221: 2013-09-07 Aleksey Pivovarov - Github: simplify 80a15fc: 2013-09-07 Aleksey Pivovarov - Github: simplify mapping user -> fork repository ef91648: 2013-09-07 Aleksey Pivovarov - Github: fix remote branch ref 307f921: 2013-09-07 Bas Leijdekkers - IDEA-53184 (False positive unused field inspection for serialVersionUID fields) c1545b5: 2013-09-06 Vassiliy Kudryashov - Lense mode "internal" preview 5a2c378: 2013-09-06 Roman Shevchenko - platform: correct formatting in downloadable library version chooser 4ffa7ea: 2013-09-06 Konstantin Kolosovsky - IDEA-112802 Fixed parameters for "checkout completed" event e8a4550: 2013-09-06 peter - there are no constructor field initializers in compiled psi cee022e: 2013-09-06 peter - IDEA-113013 When insert selected variant is enabled the "generated" code comply with code style 762a0ca: 2013-09-06 peter - empty for loop condition means "true" (IDEA-113242) 75c1cd6: 2013-09-06 peter - IDEA-113149 Constructor parameters completion is not available in case of classes with generics 243adf0: 2013-09-06 peter - IDEA-113028 Complete statement doesn't complete class declaration 9dfa286: 2013-09-06 Anna Kozlova - Merge remote-tracking branch 'origin/master' d901cc2: 2013-09-06 Anna Kozlova - drop old external annotations format a0d17e6: 2013-09-06 nik - xdebugger: restored custom presentation for keywords and numbers, changed values are highlighted by coloring their names 65dc74c: 2013-09-06 Sergey Evdokimov - Refactoring: use PsiImplUtil.isLeafElementOfType() instead of org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil.isLeafElementOfType() 5d1dddc: 2013-09-06 peter - fail-fast DfaMemoryStateImpl.equals 59734e3: 2013-09-06 peter - calculate constructor initialization for all fields at once, and cache (needed for dfa and nullable-stuff inspections) 2bad29c: 2013-09-06 peter - 2x faster implicit field nullability detection 1952eee: 2013-09-06 peter - IDEA-112567 Don't show any completion variants after method reference and dot 6b3d77c: 2013-09-06 peter - IDEA-112968 Show "Value is always" warning only for null/true/false ae94260: 2013-09-06 peter - revert meaningless: use actual (maybe unsaved) psi text for find usages (EA-49575) 4275fcb: 2013-09-06 Anna Kozlova - drop old external annotations format d34fcc5: 2013-09-06 Anna Kozlova - move: take into account usages which won't be changed textually but could affect possible conflicts (IDEA-113280) f1b0f11: 2013-09-06 Sergey Simonchik - xdebug api improvement 1a1eacf: 2013-09-06 Konstantin Kolosovsky - IDEA-112802 Initial checkout implementation (with svn command line client) b7e7f12: 2013-09-06 Sergey Evdokimov - Bug fix: hint "(, )" is shown beside any goal in maven tool window 953771d: 2013-09-06 Sergey Evdokimov - Run completion automatically after inserting of <dependency> 14e7fec: 2013-09-06 Nadya Zabrodina - fix for windows (template need not to be quoted because GeneralCommandline is smart) f1a9f68: 2013-09-06 Bas Leijdekkers - IDEA-89557 (Inspection `RawUseOfParameterizedType` is redundant on inspection of parameterized type object arrays with the trailing `class` keyword) 80de1ec: 2013-09-06 Bas Leijdekkers - clarify that the "Raw use of parameterized type" inspection mirrors javac's rawtypes warning (IDEA-99892) 6942d1c: 2013-09-06 Bas Leijdekkers - IDEA-99829 (Problem with inspection "Raw use of parameterized class" option "Ignore where a type parameter would not compile.) b5c1f0e: 2013-09-06 nik - set default dependency scope for framework libraries added to a module 9683169: 2013-09-06 Eugene Zhuravlev - not-null + manager-thread assertions 86f4be9: 2013-09-06 Anna Kozlova - plugins: do not warn about disabled optional dependencies fb5e6e7: 2013-09-06 Anna Kozlova - plugins downloading: enable dependencies: make suggester answer Yes/No ac38433: 2013-09-06 Anna Kozlova - optimization: retrieve PsiElement when problem occurs only 9cd0458: 2013-09-06 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 683ece5: 2013-09-06 nik - xdebugger: 'jump to type source' action added 1448c7d: 2013-09-06 nik - cleanup 4c471d2: 2013-09-06 Vladislav.Soroka - IDEA-102653 tooltip with description added to external project task tree 499cd73: 2013-09-06 Bas Leijdekkers - no generic array creation 6a2d6f4: 2013-09-06 Konstantin Bulenkov - the fix of IDEA-26026 doesn't make sense nowadays. Dialog should be modal IDEA-105611 Invalid focus when invoking find in files 13d56b2: 2013-09-06 Konstantin Kolosovsky - IDEA-94942 Support nullable handler for update commands 9d07f2e: 2013-09-06 Konstantin Kolosovsky - IDEA-94942 Refactored merge, update implementation to use common command listener 8bd8e93: 2013-09-06 Denis Fokin - IDEA-113303 Headless Exception when using inspect.sh on OS X 599c49b: 2013-09-06 Vladimir Krivosheev - init WEB-1171 javascript live console 04b3c6b: 2013-09-06 Konstantin Kolosovsky - IDEA-94942 Force SVNKit implementation for 1.6 working copies bb8daac: 2013-09-06 Vladimir Krivosheev - investigate: java.lang.IllegalArgumentException: void return types for handler methods not supported f9f74a5: 2013-09-06 Vladimir Krivosheev - don't hide original exception: java.lang.Exception: java.lang.IllegalStateException: AES/CBC/NoPadding is not available 8df26d7: 2013-09-06 Mikhail Golubev - Merge remote-tracking branch 'origin/master' 87b1100: 2013-09-06 nik - xdebugger api: support grouping values in debugger trees c1e214a: 2013-09-06 Vladislav.Soroka - IDEA-50450 Gradle code insight f63250d: 2013-09-04 Alex Ruiz - Disabled "Use embedded Gradle" option for importing project. 517c614: 2013-09-06 Konstantin Bulenkov - remove refs to Project asap 636ac6d: 2013-09-06 Konstantin Bulenkov - IDEA-99897 When "block caret" mode is on, after deleting a character at the end of a line, the character deleted appears in inverse 021d4a5: 2013-06-12 Max Medvedev - Groovy formatter: blank lines in declarations 706feca: 2013-06-12 Max Medvedev - IDEA-113124 Groovy files in the navigation bar 81ba9a5: 2013-09-05 Vladimir Krivosheev - cleanup 198c147: 2013-06-12 Max Medvedev - IDEA-107520 Groovy Shell: support commands in groovy shell cd1aa72: 2013-06-12 Max Medvedev - IDEA-69673 Generate toString() template Groovy GString style should be added 5e1454a: 2013-06-12 Max Medvedev - generateToString: shorten class references not only for java files 2509702: 2013-06-12 Max Medvedev - don't manually replace toString() if it exists; generate the new one in the appropriate place instead 2e72f08: 2013-06-09 Max Medvedev - Groovy: smart complete type definition body c8ab923: 2013-06-09 Max Medvedev - Groovy: In-place introduce parameter: delegate 98ae7ed: 2013-09-04 Bas Leijdekkers - Fix all known "Field may be final" inspection problems 2 (IDEA-75321, IDEA-80439, IDEA-84561, IDEA-84614, IDEA-87373,IDEA-89711, IDEA-91969, IDEA-111396) 24184340: 2013-09-05 peter - update FixAllQuickfixTest test data, so that it identifies the quick fix unambiguously 082a0f9: 2013-09-05 Konstantin Bulenkov - make search everywhere available in current context 4eaae16: 2013-09-05 Konstantin Bulenkov - remove dead code dde304f: 2013-09-05 Konstantin Bulenkov - refactor to make autoSelectOnMouseMove available in ListUtil 150d337: 2013-09-05 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 1790f99: 2013-09-05 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' 981c3f6: 2013-09-05 Sergey Evdokimov - Rename class 06eb88d: 2013-09-05 Sergey Evdokimov - Add test for inserting maven dependency by smart completion dc54349: 2013-09-05 Konstantin Kolosovsky - Merge branch 'svn1_8_new' a742e91: 2013-09-05 Dmitry Trofimov - Take correct setting for console background color (PY-10737). c55ba74: 2013-09-05 Nadya Zabrodina - ShellCommandLine changed to GeneralCommandline to provide shell variables to ide bb3ff5f: 2013-09-05 Sergey Evdokimov - IDEA-112939 Smart dependency completion for pom.xml d1daa65: 2013-09-05 Anna Kozlova - fix ranges 5ac8d00: 2013-09-05 Anna Kozlova - accept narrowing conversion from byte[] to T< extends Serializable> (IDEA-113225) 5e7db4f: 2013-09-05 Konstantin Kolosovsky - IDEA-112060 Notification added when working copy format and client version do not correspond to each other 804db7e: 2013-09-05 Konstantin Kolosovsky - IDEA-112060 Force validate executable if project is svn 1.8 working copy cdc6f6b: 2013-09-05 Konstantin Kolosovsky - IDEA-112071 Refresh svn working copies/statuses if "use command line" option or path to executable changed 613144f: 2013-09-05 Konstantin Kolosovsky - Make equal SvnConfigurable and SvnVcs display names (to "show settings" work correctly) 002eadb: 2013-09-05 Serega Vasiliev - javaee libs,project structure, etc. 559ab96: 2013-09-05 peter - no matter if there are other variables having that constant value, it's still constant bec4757: 2013-09-04 Mikhail Golubev - * Add error message when template variable used isn't defined * Template variables values are urlencoded during their substitution in URLs c01b85b: 2013-09-04 Mikhail Golubev - Add sprint.ly integration 68d131b: 2013-09-05 peter - use actual (maybe unsaved) psi text for find usages (EA-49575) b138d05: 2013-09-05 peter - rely less on mutable state in ChooseByNameBase.getNames (IDEA-112779) f0dc4b1: 2013-09-05 Anna Kozlova - optimization: skip external usages processing when scope already contains everything bfb94e0: 2013-09-05 Alexey Kudravtsev - renamed module editor-ui-impl to editor-ui-ex d711697: 2013-09-05 peter - really focus existing project frame when opening already opened project (related to IDEA-113158) 57d5690: 2013-09-05 Anna Kozlova - logging for EA-49553 - assert: SingleInspectionProfilePanel.copyUsedSeveritiesIfUndefined ed2cc9b: 2013-09-05 Anna Kozlova - logging for EA-49541 - assert: FileReference.rename 5a3cc7c: 2013-09-05 Roman Shevchenko - test framework: commit or dispose model 0735047: 2013-09-05 Anna Kozlova - scopes: escape dot as it is not a separator in file pattern (IDEA-113148) 6ae3bf7: 2013-09-05 Anna Kozlova - inference graph nodes: merge value/dependencies f02d237: 2013-09-05 Konstantin Bulenkov - fix test data 830b9c1: 2013-09-05 Konstantin Bulenkov - better english 400062d: 2013-09-05 Sergey Evdokimov - Make GrailsRunConfiguration singleton by default. 8caf8af: 2013-09-05 Vladimir Krivosheev - add javadoc 32394f0: 2013-09-05 Vladimir Krivosheev - WEB-7511 "Evaluate Expression" window does not build correct path to currently selected object node d59afd6: 2013-09-05 nik - xdebugger: removed duplicated 'Collecting data' text value node 32d3038: 2013-09-05 nik - unused class deleted 42255de: 2013-09-05 nik - xdebugger api streamlined: reworked the way node presentation is customized 36d908c: 2013-09-05 Sergey Evdokimov - IDEA-113188 Go to related files works incorrectly for Model and Controller in Groovy 55a5b28: 2013-09-05 Dmitry Avdeev - final methods in task api cd0f640: 2013-09-04 Dmitry Avdeev - running tests without ModuleTypeManager a41a8dc: 2013-09-05 Svetlana.Zemlyanskaya - Arrangement: make tokens aware of their type (author=Roman.Shein) 20bfe63: 2013-06-09 Max Medvedev - IDEA-71176 Encapsulate Java fields should update Groovy usages 30889b4: 2013-06-08 Max Medvedev - pluggable EncapsulateFields refactoring a3ed6bd: 2013-06-08 Max Medvedev - refactor EncapsulateFieldProcessor b7103d5: 2013-09-04 Max Medvedev - IDEA-113176 Groovy: place caret inside parentheses when compliting constructors b44e415: 2013-09-04 Vladimir Krivosheev - NotNull, StreamProvider.listSubFiles accept roaming type 89f6078: 2013-09-04 Vladimir Krivosheev - init WEB-7511 "Evaluate Expression" window does not build correct path to currently selected object node Now only hint show correct evaluated expression faaea11: 2013-09-04 Vladimir Krivosheev - remove deprecated method 98d4f5e: 2013-09-04 Vladimir Krivosheev - cleanup, remove deprecated method f4a27e8: 2013-09-04 peter - CachedValueProvider.Result: force non-empty list of not-null dependencies 19df6f4: 2013-09-04 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' b12d474: 2013-09-04 Andrey Vlasovskikh - Merge branch 'python-fixes' 824377b: 2013-09-04 Andrey Vlasovskikh - Use new serializer for Python shadowing inspection 9bc2733: 2013-09-04 peter - single-pass control flow building 257d23a: 2013-09-04 peter - IDEA-112474 Expression might evaluate to null and not @Nullable annotated inspection is not aware of @Contract e586777: 2013-09-04 peter - a more descriptive DupInstruction.toString 9c9e366: 2013-09-04 peter - dfa: pop all the contract-unchecked arguments from stack (IDEA-112500) 6c2ead1: 2013-09-04 jgindin - Branch view in RepositoryTab 616f50f: 2013-09-04 Konstantin Kolosovsky - Merge branch 'svn1_8_new' 631a6ae: 2013-09-04 Konstantin Bulenkov - IDEA-113217 Check spelling and grammar in Community Bundles 45009eb: 2013-09-04 Konstantin Bulenkov - IDEA-113216 Darcula: Equal sign is too bright in properties files 711b2f5: 2013-09-04 Konstantin Kolosovsky - IDEA-94942 Force separate SVNKit client for each info request (to prevent multithreaded issues) 9ea7a68: 2013-09-04 Konstantin Bulenkov - IDEA-113215 GSP looks weird under Darcula 76f2e32: 2013-09-04 Konstantin Kolosovsky - IDEA-94942 Removed unused JavaHL code 3a8a697: 2013-09-04 Vladimir Krivosheev - fix possible NPE 1dd1635: 2013-09-04 Vladimir Krivosheev - We must not use variable if it is not yet set — we must set channel in "init" handler, but not in "connected" handler. Issue is actual under windows (I don't know why). 4860142: 2013-09-04 Mikhail Golubev - Change TaskBuilder constructor: repository field is mandatory ccb5502: 2013-09-04 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' d43513f: 2013-09-03 Dmitry Trofimov - Variable view in Python Console. dd251c7: 2013-09-03 Dmitry Trofimov - Merge remote-tracking branch 'origin/master' dc83844: 2013-09-03 Dmitry Trofimov - Prevent CCE. Change-Id: I9ce8f336e5ab08b9a26d806a3faa8db7e0d9813f
Diffstat (limited to 'java/java-psi-impl/src/com')
-rw-r--r--java/java-psi-impl/src/com/intellij/codeInsight/BaseExternalAnnotationsManager.java41
-rw-r--r--java/java-psi-impl/src/com/intellij/core/CorePsiPackageImplementationHelper.java8
-rw-r--r--java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java5
-rw-r--r--java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java2
-rw-r--r--java/java-psi-impl/src/com/intellij/psi/impl/PsiImplUtil.java15
-rw-r--r--java/java-psi-impl/src/com/intellij/psi/impl/PsiSuperMethodImplUtil.java2
-rw-r--r--java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/InferenceGraphNode.java69
-rw-r--r--java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiPolyExpressionUtil.java146
-rw-r--r--java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java167
9 files changed, 391 insertions, 64 deletions
diff --git a/java/java-psi-impl/src/com/intellij/codeInsight/BaseExternalAnnotationsManager.java b/java/java-psi-impl/src/com/intellij/codeInsight/BaseExternalAnnotationsManager.java
index e3e2511a08d1..cfd59f5e0a02 100644
--- a/java/java-psi-impl/src/com/intellij/codeInsight/BaseExternalAnnotationsManager.java
+++ b/java/java-psi-impl/src/com/intellij/codeInsight/BaseExternalAnnotationsManager.java
@@ -80,43 +80,6 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
return StringUtil.getQualifiedName(packageName, virtualFile.getNameWithoutExtension());
}
- @Nullable
- protected static String getNormalizedExternalName(@NotNull PsiModifierListOwner owner) {
- String externalName = getExternalName(owner, true);
- if (externalName == null) {
- return null;
- }
- if (owner instanceof PsiParameter && owner.getParent() instanceof PsiParameterList) {
- final PsiMethod method = PsiTreeUtil.getParentOfType(owner, PsiMethod.class);
- if (method != null) {
- externalName =
- externalName.substring(0, externalName.lastIndexOf(' ') + 1) + method.getParameterList().getParameterIndex((PsiParameter)owner);
- }
- }
- final int idx = externalName.indexOf('(');
- if (idx == -1) return externalName;
- StringBuilder buf = new StringBuilder(externalName.length());
- int rightIdx = externalName.indexOf(')');
- String[] params = externalName.substring(idx + 1, rightIdx).split(",");
- buf.append(externalName, 0, idx + 1);
- for (String param : params) {
- param = param.trim();
- int spaceIdx = param.indexOf(' ');
- if (spaceIdx > -1) {
- buf.append(param, 0, spaceIdx);
- }
- else {
- buf.append(param);
- }
- buf.append(", ");
- }
- if (StringUtil.endsWith(buf, ", ")) {
- buf.delete(buf.length() - ", ".length(), buf.length());
- }
- buf.append(externalName, rightIdx, externalName.length());
- return buf.toString();
- }
-
protected abstract boolean hasAnyAnnotationsRoots();
@Override
@@ -242,7 +205,6 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
SmartList<AnnotationData> result = new SmartList<AnnotationData>();
String externalName = getExternalName(listOwner, false);
if (externalName == null) return NO_DATA;
- String oldExternalName = getNormalizedExternalName(listOwner);
for (PsiFile file : files) {
if (!file.isValid()) continue;
@@ -251,9 +213,6 @@ public abstract class BaseExternalAnnotationsManager extends ExternalAnnotations
MostlySingularMultiMap<String, AnnotationData> fileData = getDataFromFile(file);
ContainerUtil.addAll(result, fileData.get(externalName));
- if (oldExternalName != null && !externalName.equals(oldExternalName)) {
- ContainerUtil.addAll(result, fileData.get(oldExternalName));
- }
}
if (result.isEmpty()) {
return NO_DATA;
diff --git a/java/java-psi-impl/src/com/intellij/core/CorePsiPackageImplementationHelper.java b/java/java-psi-impl/src/com/intellij/core/CorePsiPackageImplementationHelper.java
index 752b1660d121..5a97f596d983 100644
--- a/java/java-psi-impl/src/com/intellij/core/CorePsiPackageImplementationHelper.java
+++ b/java/java-psi-impl/src/com/intellij/core/CorePsiPackageImplementationHelper.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,16 +15,18 @@
*/
package com.intellij.core;
+import com.intellij.openapi.util.ModificationTracker;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiPackage;
import com.intellij.psi.impl.file.PsiPackageImplementationHelper;
import com.intellij.psi.search.GlobalSearchScope;
-import com.intellij.util.ArrayUtil;
/**
* @author yole
*/
public class CorePsiPackageImplementationHelper extends PsiPackageImplementationHelper {
+ private static final ModificationTracker[] EMPTY_DEPENDENCY = {ModificationTracker.NEVER_CHANGED};
+
@Override
public GlobalSearchScope adjustAllScope(PsiPackage psiPackage, GlobalSearchScope globalSearchScope) {
return globalSearchScope;
@@ -50,6 +52,6 @@ public class CorePsiPackageImplementationHelper extends PsiPackageImplementation
@Override
public Object[] getDirectoryCachedValueDependencies(PsiPackage cachedValueProvider) {
- return ArrayUtil.EMPTY_OBJECT_ARRAY;
+ return EMPTY_DEPENDENCY;
}
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java b/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java
index 4fea2e0d7998..c2675894986d 100644
--- a/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java
+++ b/java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowAnalyzer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@ import com.intellij.openapi.util.Comparing;
import com.intellij.psi.*;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.PsiUtil;
import com.intellij.util.containers.Stack;
import gnu.trove.THashMap;
import gnu.trove.TIntArrayList;
@@ -1266,7 +1267,7 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
rExpr.accept(this);
}
- PsiExpression lExpr = expression.getLExpression();
+ PsiExpression lExpr = PsiUtil.skipParenthesizedExprDown(expression.getLExpression());
if (lExpr instanceof PsiReferenceExpression) {
final PsiReferenceExpression referenceExpression = (PsiReferenceExpression)lExpr;
if (!referenceExpression.isQualified()
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java
index e9596f8dd96b..d890a42ab4b5 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/InheritanceImplUtil.java
@@ -42,7 +42,7 @@ public class InheritanceImplUtil {
if (CommonClassNames.JAVA_LANG_OBJECT.equals(candidateClass.getQualifiedName())) return false;
if (CommonClassNames.JAVA_LANG_OBJECT.equals(baseClass.getQualifiedName())) return true;
- Map<PsiClass, Boolean> map = CachedValuesManager.getManager(candidateClass.getProject()).
+ Map<PsiClass, Boolean> map = CachedValuesManager.
getCachedValue(candidateClass, new CachedValueProvider<Map<PsiClass, Boolean>>() {
@Nullable
@Override
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/PsiImplUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/PsiImplUtil.java
index 13040f2eaae7..48c9d63aa059 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/PsiImplUtil.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/PsiImplUtil.java
@@ -26,10 +26,7 @@ import com.intellij.psi.filters.ElementFilter;
import com.intellij.psi.impl.light.LightClassReference;
import com.intellij.psi.impl.source.PsiClassReferenceType;
import com.intellij.psi.impl.source.PsiImmediateClassType;
-import com.intellij.psi.impl.source.tree.CompositeElement;
-import com.intellij.psi.impl.source.tree.CompositePsiElement;
-import com.intellij.psi.impl.source.tree.JavaDocElementType;
-import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.impl.source.tree.*;
import com.intellij.psi.javadoc.PsiDocComment;
import com.intellij.psi.scope.ElementClassHint;
import com.intellij.psi.scope.PsiScopeProcessor;
@@ -39,6 +36,7 @@ import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.psi.search.LocalSearchScope;
import com.intellij.psi.search.PackageScope;
import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.tree.IElementType;
import com.intellij.psi.tree.TokenSet;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.psi.util.PsiUtil;
@@ -748,4 +746,13 @@ public class PsiImplUtil {
return result;
}
+
+ public static boolean isLeafElementOfType(@Nullable PsiElement element, IElementType type) {
+ return element instanceof LeafElement && ((LeafElement)element).getElementType() == type;
+ }
+
+ public static boolean isLeafElementOfType(PsiElement element, TokenSet tokenSet) {
+ return element instanceof LeafElement && tokenSet.contains(((LeafElement)element).getElementType());
+ }
+
}
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/PsiSuperMethodImplUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/PsiSuperMethodImplUtil.java
index c41e94049a96..80fca2271ee0 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/PsiSuperMethodImplUtil.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/PsiSuperMethodImplUtil.java
@@ -332,7 +332,7 @@ public class PsiSuperMethodImplUtil {
@NotNull
public static HierarchicalMethodSignature getHierarchicalMethodSignature(final PsiMethod method) {
- return CachedValuesManager.getManager(method.getProject())
+ return CachedValuesManager
.getCachedValue(method, new CachedValueProvider<HierarchicalMethodSignature>() {
@Nullable
@Override
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/InferenceGraphNode.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/InferenceGraphNode.java
index 221f48238c8e..d127d4037a28 100644
--- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/InferenceGraphNode.java
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/InferenceGraphNode.java
@@ -15,33 +15,28 @@
*/
package com.intellij.psi.impl.source.resolve;
-import com.intellij.psi.PsiTypeParameter;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Stack;
+import java.util.*;
/**
* User: anna
* Date: 7/4/13
*/
public class InferenceGraphNode<T> {
- private final T myValue;
- private final List<InferenceGraphNode<T>> myDependencies = new ArrayList<InferenceGraphNode<T>>();
+ private final List<T> myValue = new ArrayList<T>();
+ private Set<InferenceGraphNode<T>> myDependencies = new HashSet<InferenceGraphNode<T>>();
private int index = -1;
private int lowlink;
public InferenceGraphNode(T value) {
- myValue = value;
+ myValue.add(value);
}
- public T getValue() {
+ public List<T> getValue() {
return myValue;
}
- public List<InferenceGraphNode<T>> getDependencies() {
+ public Set<InferenceGraphNode<T>> getDependencies() {
return myDependencies;
}
@@ -61,6 +56,58 @@ public class InferenceGraphNode<T> {
return result;
}
+ public static <T> ArrayList<InferenceGraphNode<T>> initNodes(Collection<InferenceGraphNode<T>> allNodes) {
+ final List<List<InferenceGraphNode<T>>> nodes = tarjan(allNodes);
+ final ArrayList<InferenceGraphNode<T>> acyclicNodes = new ArrayList<InferenceGraphNode<T>>();
+ for (List<InferenceGraphNode<T>> cycle : nodes) {
+ acyclicNodes.add(merge(cycle, allNodes));
+ }
+ return acyclicNodes;
+ }
+
+ private static <T> InferenceGraphNode<T> merge(final List<InferenceGraphNode<T>> cycle,
+ final Collection<InferenceGraphNode<T>> allNodes) {
+ assert !cycle.isEmpty();
+ final InferenceGraphNode<T> root = cycle.get(0);
+ if (cycle.size() > 1) {
+ for (int i = 1; i < cycle.size(); i++) {
+ final InferenceGraphNode<T> cycleNode = cycle.get(i);
+
+ root.copyFrom(cycleNode);
+ root.filterInterCycleDependencies();
+
+ for (InferenceGraphNode<T> node : allNodes) {
+ if (node.myDependencies.remove(cycleNode)) {
+ node.myDependencies.add(root);
+ }
+ }
+ }
+ }
+ return root;
+ }
+
+ private void filterInterCycleDependencies() {
+ boolean includeSelfDependency = false;
+ for (Iterator<InferenceGraphNode<T>> iterator = myDependencies.iterator(); iterator.hasNext(); ) {
+ InferenceGraphNode<T> d = iterator.next();
+ assert d.myValue.size() >= 1;
+ final T initialNodeValue = d.myValue.get(0);
+ if (myValue.contains(initialNodeValue)) {
+ includeSelfDependency = true;
+ iterator.remove();
+ }
+ }
+
+ if (includeSelfDependency) {
+ myDependencies.add(this);
+ }
+ }
+
+ private void copyFrom(final InferenceGraphNode<T> cycleNode) {
+ myValue.addAll(cycleNode.myValue);
+ myDependencies.addAll(cycleNode.myDependencies);
+ }
+
private static <T> int strongConnect(InferenceGraphNode<T> currentNode,
int index,
Stack<InferenceGraphNode<T>> currentStack,
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiPolyExpressionUtil.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiPolyExpressionUtil.java
new file mode 100644
index 000000000000..f3611e939bc4
--- /dev/null
+++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiPolyExpressionUtil.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright 2000-2013 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.psi.impl.source.resolve.graphInference;
+
+import com.intellij.psi.*;
+import com.intellij.psi.util.TypeConversionUtil;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * User: anna
+ */
+public class PsiPolyExpressionUtil {
+ public static boolean hasStandaloneForm(PsiExpression expression) {
+ if (expression instanceof PsiLambdaExpression ||
+ expression instanceof PsiMethodReferenceExpression ||
+ expression instanceof PsiParenthesizedExpression ||
+ expression instanceof PsiConditionalExpression ||
+ expression instanceof PsiCallExpression) {
+ return false;
+ }
+ return true;
+ }
+
+ public static boolean isPolyExpression(PsiExpression expression) {
+ if (expression instanceof PsiLambdaExpression || expression instanceof PsiMethodReferenceExpression) {
+ return true;
+ }
+ else if (expression instanceof PsiParenthesizedExpression) {
+ return isPolyExpression(((PsiParenthesizedExpression)expression).getExpression());
+ }
+ else if (expression instanceof PsiNewExpression) {
+ final PsiJavaCodeReferenceElement classReference = ((PsiNewExpression)expression).getClassReference();
+ if (classReference != null) {
+ final PsiReferenceParameterList parameterList = classReference.getParameterList();
+ if (parameterList != null) {
+ final PsiTypeElement[] typeElements = parameterList.getTypeParameterElements();
+ if (typeElements.length == 1 && typeElements[0].getType() instanceof PsiDiamondType) {
+ return isAssignmentOrInvocationContext(expression.getParent());
+ }
+ }
+ }
+ } else if (expression instanceof PsiMethodCallExpression) {
+ if (isAssignmentOrInvocationContext(expression.getParent()) && ((PsiMethodCallExpression)expression).getTypeArguments().length == 0) {
+ final PsiMethod method = ((PsiMethodCallExpression)expression).resolveMethod();
+ if (method != null) {
+ final Set<PsiTypeParameter> typeParameters = new HashSet<PsiTypeParameter>(Arrays.asList(method.getTypeParameters()));
+ if (typeParameters.size() > 0) {
+ final PsiType returnType = method.getReturnType();
+ if (returnType != null) {
+ return returnTypeMentionsTypeParameters(typeParameters, returnType);
+ }
+ }
+ }
+ }
+ }
+ else if (expression instanceof PsiConditionalExpression) {
+ final ConditionalKind conditionalKind = isBooleanOrNumeric(expression);
+ if (conditionalKind == null) {
+ return isAssignmentOrInvocationContext(expression.getParent());
+ }
+ }
+ return false;
+ }
+
+ private static Boolean returnTypeMentionsTypeParameters(final Set<PsiTypeParameter> typeParameters, PsiType returnType) {
+ return returnType.accept(new PsiTypeVisitor<Boolean>() {
+ @Nullable
+ @Override
+ public Boolean visitType(PsiType type) {
+ return false;
+ }
+
+ @Nullable
+ @Override
+ public Boolean visitClassType(PsiClassType classType) {
+ for (PsiType type : classType.getParameters()) {
+ if (type.accept(this)) return true;
+ }
+ final PsiClass psiClass = classType.resolve();
+ return psiClass instanceof PsiTypeParameter && typeParameters.contains(psiClass);
+ }
+
+ @Nullable
+ @Override
+ public Boolean visitArrayType(PsiArrayType arrayType) {
+ return arrayType.getComponentType().accept(this);
+ }
+ });
+ }
+
+ private static boolean isAssignmentOrInvocationContext(PsiElement context) {
+ return context instanceof PsiExpressionList || isAssignmentContext(context);
+ }
+
+ private static boolean isAssignmentContext(PsiElement context) {
+ return context instanceof PsiReturnStatement ||
+ context instanceof PsiAssignmentExpression ||
+ context instanceof PsiVariable;
+ }
+
+ private enum ConditionalKind {
+ BOOLEAN, NUMERIC
+ }
+
+ private static ConditionalKind isBooleanOrNumeric(PsiExpression expr) {
+ if (expr instanceof PsiParenthesizedExpression) {
+ return isBooleanOrNumeric(((PsiParenthesizedExpression)expr).getExpression());
+ }
+ PsiType type = null;
+ if (expr instanceof PsiNewExpression || hasStandaloneForm(expr)) {
+ type = expr.getType();
+ } else if (expr instanceof PsiMethodCallExpression) {
+ final PsiMethod method = ((PsiMethodCallExpression)expr).resolveMethod();
+ if (method != null) {
+ type = method.getReturnType();
+ }
+ }
+ if (TypeConversionUtil.isNumericType(type)) return ConditionalKind.NUMERIC;
+ if (TypeConversionUtil.isBooleanType(type)) return ConditionalKind.BOOLEAN;
+ if (expr instanceof PsiConditionalExpression) {
+ final PsiExpression thenExpression = ((PsiConditionalExpression)expr).getThenExpression();
+ final PsiExpression elseExpression = ((PsiConditionalExpression)expr).getElseExpression();
+ final ConditionalKind thenKind = isBooleanOrNumeric(thenExpression);
+ final ConditionalKind elseKind = isBooleanOrNumeric(elseExpression);
+ if (thenKind == elseKind) return thenKind;
+ }
+ return null;
+ }
+}
diff --git a/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java b/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java
index 71a1e4eee37d..2ac053285b78 100644
--- a/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java
+++ b/java/java-psi-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java
@@ -33,6 +33,7 @@ import gnu.trove.THashMap;
import gnu.trove.THashSet;
import gnu.trove.TIntArrayList;
import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
import java.util.Iterator;
import java.util.List;
@@ -140,7 +141,7 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
}
}
}
- LambdaUtil.checkMoreSpecificReturnType(conflicts, myActualParameterTypes);
+ checkMoreSpecificReturnType(conflicts, myActualParameterTypes, languageLevel);
}
public void checkSpecifics(@NotNull List<CandidateInfo> conflicts,
@@ -647,4 +648,168 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
}
}
}
+
+ enum TypeKind {
+ PRIMITIVE, REFERENCE, NONE_DETERMINED
+ }
+
+ public void checkMoreSpecificReturnType(List<CandidateInfo> conflicts, PsiType[] actualParameterTypes, LanguageLevel languageLevel) {
+ final CandidateInfo[] newConflictsArray = conflicts.toArray(new CandidateInfo[conflicts.size()]);
+ next:
+ for (int i = 1; i < newConflictsArray.length; i++) {
+ final CandidateInfo method = newConflictsArray[i];
+ for (int j = 0; j < i; j++) {
+ final CandidateInfo conflict = newConflictsArray[j];
+ assert conflict != method;
+ switch (isMoreSpecific(method, conflict, actualParameterTypes, languageLevel)) {
+ case FIRST:
+ conflicts.remove(conflict);
+ break;
+ case SECOND:
+ conflicts.remove(method);
+ continue next;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ private static Specifics isMoreSpecific(CandidateInfo method,
+ CandidateInfo conflict,
+ PsiType[] actualParameterTypes,
+ LanguageLevel languageLevel) {
+ Specifics moreSpecific = Specifics.NEITHER;
+ final PsiMethod methodElement = (PsiMethod)method.getElement();
+ final PsiMethod conflictElement = (PsiMethod)conflict.getElement();
+ if (methodElement != null &&
+ conflictElement != null &&
+ methodElement.isVarArgs() == conflictElement.isVarArgs() &&
+ methodElement.getParameterList().getParametersCount() <= actualParameterTypes.length &&
+ conflictElement.getParameterList().getParametersCount() <= actualParameterTypes.length) {
+ for (int functionalInterfaceIdx = 0; functionalInterfaceIdx < actualParameterTypes.length; functionalInterfaceIdx++) {
+ final PsiType interfaceReturnType = getReturnType(functionalInterfaceIdx, method);
+ final PsiType interfaceReturnType1 = getReturnType(functionalInterfaceIdx, conflict);
+ if (actualParameterTypes[functionalInterfaceIdx] instanceof PsiLambdaExpressionType || actualParameterTypes[functionalInterfaceIdx] instanceof PsiMethodReferenceType) {
+ if (interfaceReturnType != null && interfaceReturnType1 != null && !Comparing.equal(interfaceReturnType, interfaceReturnType1)) {
+ Specifics moreSpecific1 = comparePrimitives(actualParameterTypes[functionalInterfaceIdx], interfaceReturnType, interfaceReturnType1);
+ if (moreSpecific1 == Specifics.NEITHER && (interfaceReturnType != PsiType.VOID && interfaceReturnType1 != PsiType.VOID)) {
+ moreSpecific1 = compareConflicts((MethodCandidateInfo)method, (MethodCandidateInfo)conflict,
+ methodElement, conflictElement,
+ interfaceReturnType, interfaceReturnType1, languageLevel);
+ }
+
+ if (moreSpecific != Specifics.NEITHER && moreSpecific != moreSpecific1) {
+ return Specifics.NEITHER;
+ }
+
+ moreSpecific = moreSpecific1;
+ }
+ } else if (interfaceReturnType != null && interfaceReturnType1 != null) {
+ return Specifics.NEITHER;
+ }
+ }
+ }
+ return moreSpecific;
+ }
+
+ private static Specifics compareConflicts(MethodCandidateInfo method,
+ MethodCandidateInfo conflict,
+ PsiMethod methodElement,
+ PsiMethod conflictElement,
+ PsiType interfaceReturnType,
+ PsiType interfaceReturnType1,
+ LanguageLevel languageLevel) {
+ final PsiSubstitutor siteSubstitutor1 = method.getSiteSubstitutor();
+ final PsiSubstitutor siteSubstitutor2 = conflict.getSiteSubstitutor();
+
+ final PsiTypeParameter[] typeParameters1 = methodElement.getTypeParameters();
+ final PsiTypeParameter[] typeParameters2 = conflictElement.getTypeParameters();
+
+ final PsiType[] types1AtSite = {interfaceReturnType1};
+ final PsiType[] types2AtSite = {interfaceReturnType};
+
+ final PsiSubstitutor methodSubstitutor1 = calculateMethodSubstitutor(typeParameters1, methodElement, siteSubstitutor1, types2AtSite, types1AtSite, languageLevel);
+ final PsiSubstitutor methodSubstitutor2 = calculateMethodSubstitutor(typeParameters2, conflictElement, siteSubstitutor2, types1AtSite, types2AtSite,languageLevel);
+
+ final boolean applicable12 = TypeConversionUtil.isAssignable(interfaceReturnType1, methodSubstitutor1.substitute(interfaceReturnType));
+ final boolean applicable21 = TypeConversionUtil.isAssignable(interfaceReturnType, methodSubstitutor2.substitute(interfaceReturnType1));
+
+
+ if (applicable12 || applicable21) {
+ if (!applicable21) {
+ return Specifics.FIRST;
+ }
+
+ if (!applicable12) {
+ return Specifics.SECOND;
+ }
+ }
+ return Specifics.NEITHER;
+ }
+
+ private static Specifics comparePrimitives(PsiType type,
+ PsiType interfaceReturnType,
+ PsiType interfaceReturnType1) {
+ final TypeKind typeKind = getKind(type);
+ Specifics moreSpecific1 = Specifics.NEITHER;
+ if (typeKind != TypeKind.NONE_DETERMINED) {
+ final boolean isPrimitive = typeKind == TypeKind.PRIMITIVE;
+ if (interfaceReturnType instanceof PsiPrimitiveType) {
+ if (interfaceReturnType1 instanceof PsiPrimitiveType &&
+ TypeConversionUtil.isAssignable(interfaceReturnType, interfaceReturnType1)) {
+ moreSpecific1 = isPrimitive ? Specifics.SECOND : Specifics.FIRST;
+ } else {
+ moreSpecific1 = isPrimitive ? Specifics.FIRST : Specifics.SECOND;
+ }
+ } else if (interfaceReturnType1 instanceof PsiPrimitiveType) {
+ moreSpecific1 = isPrimitive ? Specifics.SECOND : Specifics.FIRST;
+ }
+ }
+ return moreSpecific1;
+ }
+
+ @Nullable
+ private static PsiType getReturnType(int functionalTypeIdx, CandidateInfo method) {
+ final PsiParameter[] methodParameters = ((PsiMethod)method.getElement()).getParameterList().getParameters();
+ if (methodParameters.length == 0) return null;
+ final PsiParameter param = functionalTypeIdx < methodParameters.length ? methodParameters[functionalTypeIdx] : methodParameters[methodParameters.length - 1];
+ final PsiType functionalInterfaceType = ((MethodCandidateInfo)method).getSiteSubstitutor().substitute(param.getType());
+ return LambdaUtil.getFunctionalInterfaceReturnType(functionalInterfaceType);
+ }
+
+ private static TypeKind getKind(PsiType lambdaType) {
+ TypeKind typeKind = TypeKind.PRIMITIVE;
+ if (lambdaType instanceof PsiLambdaExpressionType) {
+ typeKind = areLambdaReturnExpressionsPrimitive((PsiLambdaExpressionType)lambdaType);
+ } else if (lambdaType instanceof PsiMethodReferenceType) {
+ final PsiElement referencedElement = ((PsiMethodReferenceType)lambdaType).getExpression().resolve();
+ if (referencedElement instanceof PsiMethod && !(((PsiMethod)referencedElement).getReturnType() instanceof PsiPrimitiveType)) {
+ typeKind = TypeKind.REFERENCE;
+ }
+ }
+ return typeKind;
+ }
+
+ private static TypeKind areLambdaReturnExpressionsPrimitive(PsiLambdaExpressionType lambdaType) {
+ final List<PsiExpression> returnExpressions = LambdaUtil.getReturnExpressions(lambdaType.getExpression());
+ TypeKind typeKind = TypeKind.NONE_DETERMINED;
+ for (PsiExpression expression : returnExpressions) {
+ final PsiType returnExprType = expression.getType();
+ if (returnExprType instanceof PsiPrimitiveType) {
+ if (typeKind == TypeKind.REFERENCE) {
+ typeKind = TypeKind.NONE_DETERMINED;
+ break;
+ }
+ typeKind = TypeKind.PRIMITIVE;
+ } else {
+ if (typeKind == TypeKind.PRIMITIVE) {
+ typeKind = TypeKind.NONE_DETERMINED;
+ break;
+ }
+ typeKind = TypeKind.REFERENCE;
+ }
+ }
+ return typeKind;
+ }
}