Merge remote-tracking branch 'origin/master'
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Mon, 17 Feb 2014 13:14:57 +0000 (14:14 +0100)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Mon, 17 Feb 2014 13:14:57 +0000 (14:14 +0100)
537 files changed:
build/scripts/libLicenses.gant
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/api/index/ClassFilesIndexFeature.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/api/index/ClassFilesIndexFeaturesHolder.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/api/index/ClassFilesIndexReaderBase.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/CachedRelevantStaticMethodSearcher.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/ChainsSearcher.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/MethodsChainLookupRangingHelper.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/ParametersMatcher.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/completion/MethodsChainsCompletionContributor.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/context/ChainCompletionContext.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/context/ContextUtil.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/context/MethodIncompleteSignatureResolver.java
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/context/TargetType.java [new file with mode: 0644]
java/compiler/impl/src/com/intellij/compiler/classFilesIndex/impl/MethodsUsageIndexReader.java
java/idea-ui/src/com/intellij/facet/impl/ui/libraries/EditLibraryDialog.java
java/idea-ui/src/com/intellij/ide/projectWizard/ProjectTypeStep.java
java/idea-ui/src/com/intellij/ide/util/newProjectWizard/impl/FrameworkSupportModelBase.java
java/idea-ui/src/com/intellij/ide/util/projectWizard/SdkSettingsStep.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/JdkComboBox.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/CreateNewLibraryDialog.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/EditExistingLibraryDialog.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightClassUtil.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightNamesUtil.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightVisitorImpl.java
java/java-impl/src/com/intellij/openapi/roots/libraries/LibrariesHelperImpl.java
java/java-impl/src/com/intellij/pom/java/impl/PomJavaAspectImpl.java [deleted file]
java/java-impl/src/com/intellij/psi/impl/file/impl/JavaFileManagerImpl.java
java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java
java/java-impl/src/com/intellij/refactoring/safeDelete/OverridingMethodsDialog.java
java/java-impl/src/com/intellij/slicer/SlicePanel.java
java/java-impl/src/com/intellij/usageView/UsageContextDataflowFromPanel.java
java/java-impl/src/com/intellij/usageView/UsageContextDataflowToPanel.java
java/java-indexing-impl/src/com/intellij/psi/impl/file/impl/JavaFileManagerBase.java
java/java-psi-api/src/com/intellij/psi/JavaPsiFacade.java
java/java-psi-api/src/com/intellij/psi/PsiNameHelper.java
java/java-psi-impl/src/com/intellij/core/CoreJavaFileManager.java
java/java-psi-impl/src/com/intellij/core/JavaCoreProjectEnvironment.java
java/java-psi-impl/src/com/intellij/psi/controlFlow/ControlFlowFactory.java
java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/PsiNameHelperImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/compiled/ClsTypeElementImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/file/impl/JavaFileManager.java
java/java-tests/testData/codeInsight/completion/methodChains/testArrayReturnType/TestCompletion.java [moved from java/openapi/src/com/intellij/pom/java/PomJavaAspect.java with 51% similarity]
java/java-tests/testData/codeInsight/completion/methodChains/testArrayReturnType/TestIndex.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lossyEncoding/InconsistentLineSeparators.txt [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lossyEncoding/Win1251.txt [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/completion/AbstractCompilerAwareTest.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/LossyEncodingTest.java
java/java-tests/testSrc/com/intellij/concurrency/JobUtilTest.java
java/java-tests/testSrc/com/intellij/find/FindManagerTest.java
java/java-tests/testSrc/com/intellij/index/IndexTest.java
java/openapi/src/com/intellij/ide/util/projectWizard/JavaModuleBuilder.java
java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCase.java
java/testFramework/src/com/intellij/compiler/CompilerTestUtil.java
jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/AsmUtil.java
jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/api/ClassFilesIndexStorage.java
jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/api/ClassFilesIndexWriter.java
jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/api/ClassFilesIndicesBuilder.java
jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/impl/MethodIncompleteSignature.java
jps/jps-builders/src/org/jetbrains/jps/classFilesIndex/indexer/impl/MethodsUsageIndexer.java
platform/core-api/src/com/intellij/openapi/util/AsyncResult.java
platform/core-impl/src/com/intellij/concurrency/JobLauncher.java
platform/core-impl/src/com/intellij/ide/plugins/PluginManagerCore.java
platform/editor-ui-api/src/com/intellij/openapi/editor/Caret.java
platform/editor-ui-api/src/com/intellij/openapi/editor/CaretAction.java [new file with mode: 0644]
platform/editor-ui-api/src/com/intellij/openapi/editor/CaretModel.java
platform/editor-ui-api/src/com/intellij/openapi/editor/EditorSettings.java
platform/extensions/src/com/intellij/openapi/extensions/impl/ExtensionPointImpl.java
platform/external-system-impl/external-system-impl.iml
platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy
platform/indexing-impl/src/com/intellij/ide/highlighter/custom/tokens/KeywordParser.java
platform/lang-api/src/com/intellij/execution/RunProfileStarter.java
platform/lang-api/src/com/intellij/execution/configurations/CommandLineState.java
platform/lang-api/src/com/intellij/execution/configurations/MockCommandLineState.java
platform/lang-api/src/com/intellij/execution/configurations/RunProfileState.java
platform/lang-api/src/com/intellij/execution/runners/AsyncGenericProgramRunner.java
platform/lang-api/src/com/intellij/execution/runners/BaseProgramRunner.java
platform/lang-api/src/com/intellij/execution/runners/ExecutionEnvironment.java
platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java
platform/lang-api/src/com/intellij/execution/ui/ConsoleView.java
platform/lang-api/src/com/intellij/ide/util/projectWizard/AbstractModuleBuilder.java
platform/lang-api/src/com/intellij/usageView/UsageViewBundle.java
platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyHandler.java
platform/lang-impl/src/com/intellij/codeInsight/editorActions/CutHandler.java
platform/lang-impl/src/com/intellij/codeInsight/editorActions/PasteHandler.java
platform/lang-impl/src/com/intellij/codeInsight/highlighting/BraceHighlightingHandler.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/BackspaceHandler.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/EndHandler.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/HomeHandler.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java
platform/lang-impl/src/com/intellij/codeInsight/navigation/IncrementalSearchHandler.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/LiveTemplateSettingsEditor.java
platform/lang-impl/src/com/intellij/codeInspection/LossyEncodingInspection.java
platform/lang-impl/src/com/intellij/execution/configuration/EmptyRunProfileState.java
platform/lang-impl/src/com/intellij/execution/console/BaseConsoleExecuteActionHandler.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/console/ConsoleExecuteAction.java [moved from platform/lang-impl/src/com/intellij/execution/runners/ConsoleExecuteAction.java with 86% similarity]
platform/lang-impl/src/com/intellij/execution/console/ConsoleGutterComponent.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/console/ConsoleHistoryController.java
platform/lang-impl/src/com/intellij/execution/console/FoldLinesLikeThis.java
platform/lang-impl/src/com/intellij/execution/console/GutterContentProvider.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleBuilder.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java
platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java
platform/lang-impl/src/com/intellij/execution/impl/RunnerAndConfigurationSettingsImpl.java
platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java
platform/lang-impl/src/com/intellij/execution/runners/BaseConsoleExecuteActionHandler.java
platform/lang-impl/src/com/intellij/execution/runners/ConsoleExecuteActionHandler.java
platform/lang-impl/src/com/intellij/execution/runners/LanguageConsoleBuilder.java [deleted file]
platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
platform/lang-impl/src/com/intellij/ide/actions/ApplyIntentionAction.java
platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java
platform/lang-impl/src/com/intellij/ide/todo/TodoPanel.java
platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNameBase.java
platform/lang-impl/src/com/intellij/injected/editor/CaretModelWindow.java
platform/lang-impl/src/com/intellij/openapi/projectRoots/impl/SdkConfigurationUtil.java
platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/ClassMapCachingNulls.java
platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/InjectedLanguageUtil.java
platform/lang-impl/src/com/intellij/refactoring/rename/AutomaticRenamingDialog.java
platform/lang-impl/src/com/intellij/refactoring/ui/AbstractMemberSelectionTable.java
platform/lang-impl/src/com/intellij/usageView/impl/UsageContextCallHierarchyPanel.java
platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
platform/lang-impl/src/com/intellij/util/indexing/IndexingStamp.java
platform/lang-impl/src/com/intellij/util/indexing/ValueContainerImpl.java
platform/lang-impl/src/com/intellij/webcore/packaging/InstalledPackagesPanel.java
platform/platform-api/src/com/intellij/openapi/editor/EditorModificationUtil.java
platform/platform-api/src/com/intellij/openapi/editor/actionSystem/EditorAction.java
platform/platform-api/src/com/intellij/openapi/editor/actionSystem/EditorActionHandler.java
platform/platform-api/src/com/intellij/openapi/editor/actionSystem/EditorWriteActionHandler.java
platform/platform-api/src/com/intellij/openapi/editor/actionSystem/TypedAction.java
platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java
platform/platform-impl/src/com/intellij/concurrency/JobLauncherImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/CloneCaretAbove.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/CloneCaretBelow.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/ContentChooser.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/CopyAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/CutAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/EscapeAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/MoveCaretDownWithSelectionAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/MoveCaretUpWithSelectionAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/PageDownWithSelectionAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/PageUpWithSelectionAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/StartNewLineBeforeAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/TextEndWithSelectionAction.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/TextStartWithSelectionAction.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/SelectionModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/SettingsImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentCaret.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentCaretModel.java
platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentEditor.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorProvider.java
platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressIndicatorUtils.java
platform/platform-impl/src/com/intellij/openapi/vfs/ex/dummy/DummyCachingFileSystem.java
platform/platform-impl/src/com/intellij/platform/PlatformProjectOpenProcessor.java
platform/platform-impl/src/com/intellij/ui/AppUIUtil.java
platform/platform-impl/src/com/intellij/ui/messages/SheetController.java
platform/platform-impl/src/com/intellij/ui/messages/SheetMessage.java
platform/platform-impl/src/com/intellij/util/graph/impl/KShortestPathsFinder.java
platform/platform-impl/src/org/jetbrains/ide/BuiltInServerManagerImpl.java
platform/platform-resources-en/src/messages/DiffBundle.properties
platform/platform-resources-en/src/messages/DomBundle.properties
platform/platform-resources-en/src/messages/FindBundle.properties
platform/platform-resources-en/src/messages/IdeBundle.properties
platform/platform-resources-en/src/messages/UsageView.properties
platform/platform-tests/testData/editor/multiCaret/EditorBackSpace-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorBackSpace-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockEnd-after.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockEnd-before.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockEndWithSelection-after.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockEndWithSelection-before.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockStart-after.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockStart-before.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockStartWithSelection-after.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorCodeBlockStartWithSelection-before.java [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDelete-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDelete-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteLine-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteLine-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordEnd-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordEnd-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordEndInDifferentHumpsMode-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordEndInDifferentHumpsMode-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordStart-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordStart-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordStartInDifferentHumpsMode-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDeleteToWordStartInDifferentHumpsMode-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDown-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDown-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDownWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDownWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDuplicate-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDuplicate-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDuplicateLines-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorDuplicateLines-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorEnter-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorEnter-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorEscape-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorEscape-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorIndentLineOrSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorIndentLineOrSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorIndentSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorIndentSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorJoinLines-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorJoinLines-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLeft-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLeft-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLeftWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLeftWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineEnd-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineEnd-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineEndWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineEndWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineStart-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineStart-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineStartWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorLineStartWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorMatchBrace-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorMatchBrace-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWord-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWord-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWordInDifferentHumpsMode-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWordInDifferentHumpsMode-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWordInDifferentHumpsModeWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWordInDifferentHumpsModeWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWordWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorNextWordWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageDown-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageDown-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageDownWithSelection-1-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageDownWithSelection-1-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageDownWithSelection-2-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageDownWithSelection-2-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageUp-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageUp-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageUpWithSelection-1-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageUpWithSelection-1-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageUpWithSelection-2-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPageUpWithSelection-2-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWord-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWord-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWordInDifferentHumpsMode-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWordInDifferentHumpsMode-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWordInDifferentHumpsModeWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWordInDifferentHumpsModeWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWordWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorPreviousWordWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorRight-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorRight-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorRightWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorRightWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorSelectWord-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorSelectWord-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorStartNewLine-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorStartNewLine-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorStartNewLineBefore-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorStartNewLineBefore-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorSwapSelectionBoundaries-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorSwapSelectionBoundaries-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTab-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTab-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextEnd-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextEnd-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextEndWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextEndWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextStart-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextStart-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextStartWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorTextStartWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorToggleCase-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorToggleCase-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUnSelectWord-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUnSelectWord-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUnindentSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUnindentSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUp-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUp-before.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUpWithSelection-after.txt [new file with mode: 0644]
platform/platform-tests/testData/editor/multiCaret/EditorUpWithSelection-before.txt [new file with mode: 0644]
platform/platform-tests/testSrc/com/intellij/ide/highlighter/custom/CustomFileTypeLexerTest.groovy
platform/platform-tests/testSrc/com/intellij/openapi/editor/EditorMultiCaretTest.java
platform/platform-tests/testSrc/com/intellij/openapi/editor/actions/EditorMultiCaretActionTest.java [new file with mode: 0644]
platform/platform-tests/testSrc/com/intellij/openapi/vfs/impl/VirtualFilePointerTest.java
platform/platform-tests/testSrc/com/intellij/util/graph/KShortestPathsFinderTest.java
platform/remote-servers/api/src/com/intellij/remoteServer/runtime/log/LoggingHandler.java
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/log/LoggingHandlerImpl.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudDeploymentRuntime.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudNotifier.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudSupportConfigurableBase.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/PublicSshKeyDialog.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/PublicSshKeyFilePanel.form [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/PublicSshKeyFilePanel.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/PublicSshKeyPanel.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/PublicSshKeyTextPanel.form [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/PublicSshKeyTextPanel.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/SshKeyAwareServerRuntime.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/util/ssh/SshKeyChecker.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerConsoleView.java
platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java
platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java
platform/testFramework/src/com/intellij/testFramework/fixtures/EditorScrollingFixture.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
platform/testRunner/src/com/intellij/execution/testframework/ui/BaseTestsOutputConsoleView.java
platform/usageView/src/com/intellij/usages/FindUsagesProcessPresentation.java
platform/usageView/src/com/intellij/usages/UsageLimitUtil.java
platform/usageView/src/com/intellij/usages/impl/PreviewUsageAction.java
platform/usageView/src/com/intellij/usages/impl/UsageContextPanelBase.java
platform/usageView/src/com/intellij/usages/impl/UsagePreviewPanel.java
platform/usageView/src/com/intellij/usages/impl/UsageViewImpl.java
platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java
platform/usageView/src/com/intellij/usages/impl/rules/UsageType.java
platform/usageView/src/com/intellij/usages/impl/rules/UsageTypeGroupingRule.java
platform/util-rt/src/com/intellij/util/NullableConsumer.java
platform/util/src/com/intellij/util/LineSeparator.java
platform/util/src/com/intellij/util/containers/ConcurrentList.java [moved from java/openapi/src/com/intellij/pom/java/events/PomJavaAspectChangeSet.java with 51% similarity]
platform/util/src/com/intellij/util/containers/ContainerUtil.java
platform/util/src/com/intellij/util/containers/LockFreeCopyOnWriteArrayList.java
platform/util/src/com/intellij/util/containers/OrderedSet.java
platform/util/src/com/intellij/util/io/EnumeratorStringDescriptor.java
platform/vcs-api/src/com/intellij/openapi/vcs/AbstractVcs.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateActionGroup.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AnnotateToggleAction.java
plugins/IntelliLang/src/META-INF/plugin.xml
plugins/IntelliLang/src/org/intellij/plugins/intelliLang/inject/InjectLanguageAction.java
plugins/devkit/src/references/IconsReferencesContributor.java
plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy
plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/wizard/GradleModuleBuilder.java
plugins/gradle/tooling-extension-v1.11/src/org/jetbrains/plugins/gradle/tooling/v1_11/builder/ModelDependenciesBuilderImpl.java
plugins/gradle/tooling-extension-v1.11/src/org/jetbrains/plugins/gradle/tooling/v1_11/internal/InternalDependencyVersionId.java [new file with mode: 0644]
plugins/gradle/tooling-extension-v1.11/src/org/jetbrains/plugins/gradle/tooling/v1_11/internal/ModelDependenciesBuilderImplHelper.java
plugins/gradle/tooling-extension-v1.12/src/org/jetbrains/plugins/gradle/tooling/v1_12/builder/ModelDependenciesBuilderImpl.java
plugins/gradle/tooling-extension-v1.12/src/org/jetbrains/plugins/gradle/tooling/v1_12/internal/DependencyVersionId.java [deleted file]
plugins/gradle/tooling-extension-v1.12/src/org/jetbrains/plugins/gradle/tooling/v1_12/internal/InternalDependencyVersionId.java [new file with mode: 0644]
plugins/gradle/tooling-extension-v1.12/src/org/jetbrains/plugins/gradle/tooling/v1_12/internal/ModelDependenciesBuilderImplHelper.java
plugins/gradle/tooling-extension-v1.9/src/org/jetbrains/plugins/gradle/tooling/v1_9/builder/ModelDependenciesBuilderImpl.java
plugins/gradle/tooling-extension-v1.9/src/org/jetbrains/plugins/gradle/tooling/v1_9/internal/DependencyVersionId.java [deleted file]
plugins/gradle/tooling-extension-v1.9/src/org/jetbrains/plugins/gradle/tooling/v1_9/internal/InternalDependencyVersionId.java [new file with mode: 0644]
plugins/gradle/tooling-extension-v1.9/src/org/jetbrains/plugins/gradle/tooling/v1_9/internal/ModelDependenciesBuilderImplHelper.java
plugins/gradle/tooling-extension/src/org/jetbrains/plugins/gradle/tooling/internal/DependencyVersionId.java [moved from plugins/gradle/tooling-extension-v1.11/src/org/jetbrains/plugins/gradle/tooling/v1_11/internal/DependencyVersionId.java with 82% similarity]
plugins/groovy/src/org/jetbrains/plugins/groovy/console/GroovyShellActionBase.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgStatusCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryImpl.java
plugins/hg4idea/src/org/zmlx/hg4idea/repo/HgRepositoryReader.java
plugins/hg4idea/src/org/zmlx/hg4idea/util/HgVersion.java
plugins/hg4idea/testSrc/hg4idea/test/repo/HgRealRepositoryReaderTest.java
plugins/hg4idea/testSrc/hg4idea/test/repo/HgRepositoryReaderTest.java
plugins/maven/artifact-resolver-m3/maven-artifact-resolver-m3.iml
plugins/maven/artifact-resolver-m31/maven-artifact-resolver-m31.iml
plugins/maven/maven3-server-impl/lib-src/apache-maven-3.0.3-src.zip [deleted file]
plugins/maven/maven3-server-impl/lib-src/maven-dependency-tree-1.2-sources.jar [deleted file]
plugins/maven/maven3-server-impl/lib-src/nexus-indexer-3.0.4-sources.jar [deleted file]
plugins/maven/maven3-server-impl/lib-src/wagon-1.0-beta-7-source-release.zip [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/bin/m2.conf
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-api-1.11.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-api-1.13.1.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-connector-wagon-1.11.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-connector-wagon-1.13.1.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-impl-1.11.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-impl-1.13.1.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-spi-1.11.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-spi-1.13.1.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-util-1.11.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/aether-util-1.13.1.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-aether-provider-3.0.3.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-aether-provider-3.0.5.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-artifact-3.0.3.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-artifact-3.0.5.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-compat-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-compat-3.0.3.jar with 64% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-core-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-core-3.0.3.jar with 64% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-embedder-3.0.3.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-embedder-3.0.5.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-model-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-model-3.0.3.jar with 74% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-model-builder-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-model-builder-3.0.3.jar with 52% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-plugin-api-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-plugin-api-3.0.3.jar with 82% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-repository-metadata-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-repository-metadata-3.0.3.jar with 85% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-settings-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-settings-3.0.3.jar with 79% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/maven-settings-builder-3.0.5.jar [moved from plugins/maven/maven3-server-impl/lib/maven3/lib/maven-settings-builder-3.0.3.jar with 62% similarity]
plugins/maven/maven3-server-impl/lib/maven3/lib/plexus-cipher-1.4.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/plexus-cipher-1.7.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/sisu-guava-0.9.9.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/sisu-guice-2.9.4-no_aop.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/sisu-guice-3.1.0-no_aop.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/sisu-inject-bean-2.1.1.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/sisu-inject-bean-2.3.0.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/sisu-inject-plexus-2.1.1.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/sisu-inject-plexus-2.3.0.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/wagon-file-1.0-beta-7.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/wagon-file-2.4.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/wagon-http-2.4-shaded.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/lib/maven3/lib/wagon-http-lightweight-1.0-beta-7.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/wagon-http-shared-1.0-beta-7.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/wagon-provider-api-1.0-beta-7.jar [deleted file]
plugins/maven/maven3-server-impl/lib/maven3/lib/wagon-provider-api-2.4.jar [new file with mode: 0644]
plugins/maven/maven3-server-impl/maven3-server-impl.iml
plugins/maven/maven3-server-impl/src/org/jetbrains/idea/maven/server/Maven3ServerEmbedderImpl.java
plugins/maven/maven3-server-impl/src/org/jetbrains/idea/maven/server/embedder/CustomMaven3ModelInterpolator2.java [new file with mode: 0644]
plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenJUnitPatcher.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenModuleBuilder.java
plugins/properties/src/com/intellij/lang/properties/psi/impl/PropertyImplEscaper.java
plugins/ui-designer/src/messages/UIDesignerBundle.properties
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathEvalAction.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/FindByXPathAction.java
python/helpers/pydev/pydev_monkey.py
python/ide/src/com/jetbrains/python/PyIdeCommonOptionsForm.java
python/ide/src/com/jetbrains/python/PythonSdkChooserCombo.java
python/ide/src/com/jetbrains/python/configuration/AddVEnvOptionsDialog.form
python/ide/src/com/jetbrains/python/configuration/AddVEnvOptionsDialog.java
python/ide/src/com/jetbrains/python/configuration/PyActiveSdkConfigurable.form [deleted file]
python/ide/src/com/jetbrains/python/configuration/PyActiveSdkConfigurable.java
python/ide/src/com/jetbrains/python/configuration/PyActiveSdkModuleConfigurable.java
python/ide/src/com/jetbrains/python/configuration/PyConfigurableInterpreterList.java
python/ide/src/com/jetbrains/python/configuration/PyConfigureInterpretersLinkPanel.java
python/ide/src/com/jetbrains/python/configuration/PythonSdkConfigurable.form [deleted file]
python/ide/src/com/jetbrains/python/configuration/PythonSdkDetailsDialog.java [moved from python/ide/src/com/jetbrains/python/configuration/PythonSdkConfigurable.java with 52% similarity]
python/ide/src/com/jetbrains/python/configuration/VirtualEnvProjectFilter.java
python/ide/src/com/jetbrains/python/newProject/PythonNewDirectoryProjectAction.java
python/ide/src/com/jetbrains/python/newProject/PythonNewDirectoryProjectDialog.java
python/psi-api/src/com/jetbrains/python/psi/PyArgumentList.java
python/psi-api/src/com/jetbrains/python/psi/PyCallExpression.java
python/psi-api/src/com/jetbrains/python/psi/PyClass.java
python/psi-api/src/com/jetbrains/python/psi/PyElementGenerator.java
python/resources/icon-robots.txt
python/resources/icons/com/jetbrains/python/interpreterGear.png [new file with mode: 0644]
python/resources/icons/com/jetbrains/python/interpreterGear@2x.png [new file with mode: 0644]
python/resources/icons/com/jetbrains/python/interpreterGear@2x_dark.png [new file with mode: 0644]
python/resources/icons/com/jetbrains/python/interpreterGear_dark.png [new file with mode: 0644]
python/resources/icons/com/jetbrains/python/skeleton.png [new file with mode: 0644]
python/resources/icons/com/jetbrains/python/skeleton@2x.png [new file with mode: 0644]
python/src/META-INF/pycharm-core.xml
python/src/META-INF/python-core.xml
python/src/com/jetbrains/python/codeInsight/imports/AddImportHelper.java
python/src/com/jetbrains/python/console/PydevConsoleExecuteActionHandler.java
python/src/com/jetbrains/python/console/PythonConsoleView.java
python/src/com/jetbrains/python/console/PythonDebugLanguageConsoleView.java
python/src/com/jetbrains/python/debugger/PyDebugRunner.java
python/src/com/jetbrains/python/inspections/quickfix/AddMethodQuickFix.java
python/src/com/jetbrains/python/psi/PyUtil.java
python/src/com/jetbrains/python/psi/impl/PyArgumentListImpl.java
python/src/com/jetbrains/python/psi/impl/PyCallExpressionHelper.java
python/src/com/jetbrains/python/psi/impl/PyElementGeneratorImpl.java
python/src/com/jetbrains/python/psi/impl/PyFunctionBuilder.java
python/src/com/jetbrains/python/refactoring/classes/PyClassMembersRefactoringSupport.java
python/src/com/jetbrains/python/refactoring/classes/PyClassRefactoringUtil.java
python/src/com/jetbrains/python/refactoring/classes/PyMemberInfoStorage.java
python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassHelper.java
python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassInfoModel.java
python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassInitializationInfo.java
python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassPresenterImpl.java
python/src/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassViewSwingImpl.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/FieldsManager.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/InstanceFieldsManager.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/MembersManager.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/MethodsManager.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/PyMemberInfo.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/PyMembersRefactoringBaseProcessor.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/SuperClassesManager.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/TypeSafeMovingStrategy.java [new file with mode: 0644]
python/src/com/jetbrains/python/refactoring/classes/membersManager/vp/MembersBasedView.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/vp/MembersBasedViewSwingImpl.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/vp/MembersViewInitializationInfo.java
python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpConflictsUtil.java
python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpPresenterImpl.java
python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpProcessor.java
python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpViewInitializationInfo.java
python/src/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpViewSwingImpl.java
python/src/com/jetbrains/python/refactoring/classes/pushDown/PyPushDownConflicts.java
python/src/com/jetbrains/python/refactoring/classes/pushDown/PyPushDownPresenterImpl.java
python/src/com/jetbrains/python/refactoring/classes/pushDown/PyPushDownProcessor.java
python/src/com/jetbrains/python/refactoring/classes/pushDown/PyPushDownViewSwingImpl.java
python/src/com/jetbrains/python/refactoring/classes/ui/PyMemberSelectionPanel.java
python/src/com/jetbrains/python/refactoring/classes/ui/PyMemberSelectionTable.java
python/src/com/jetbrains/python/refactoring/extractmethod/PyExtractMethodUtil.java
python/src/com/jetbrains/python/sdk/CreateVirtualEnvDialog.form
python/src/com/jetbrains/python/sdk/CreateVirtualEnvDialog.java
python/src/com/jetbrains/python/sdk/PreferredSdkComparator.java
python/src/com/jetbrains/python/sdk/PyDetectedSdk.java [new file with mode: 0644]
python/src/com/jetbrains/python/sdk/PySdkListCellRenderer.java
python/src/com/jetbrains/python/sdk/PythonSdkDetailsStep.java [moved from python/src/com/jetbrains/python/sdk/InterpreterPathChooser.java with 50% similarity]
python/src/com/jetbrains/python/sdk/PythonSdkType.java
python/src/com/jetbrains/python/sdk/flavors/MacPythonSdkFlavor.java
python/src/com/jetbrains/python/sdk/flavors/PythonSdkFlavor.java
python/src/com/jetbrains/python/sdk/flavors/UnixPythonSdkFlavor.java
python/src/com/jetbrains/python/sdk/flavors/VirtualEnvSdkFlavor.java
python/src/icons/PythonIcons.java
python/testData/refactoring/argumentList/addKeyArgument/addArgumentFile.after.py [new file with mode: 0644]
python/testData/refactoring/argumentList/addKeyArgument/addArgumentFile.py [new file with mode: 0644]
python/testData/refactoring/argumentList/addKeyArgument/stub.py [new file with mode: 0644]
python/testData/refactoring/argumentList/addParam/addArgumentFile.after.py [new file with mode: 0644]
python/testData/refactoring/argumentList/addParam/addArgumentFile.py [new file with mode: 0644]
python/testData/refactoring/argumentList/addParam/stub.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/abc.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/dest_module.after.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/dest_module.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/shared_module.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/source_module.after.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/source_module.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstractImportExistsPy3/abc.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstractImportExistsPy3/dest_module.after.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstractImportExistsPy3/dest_module.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstractImportExistsPy3/shared_module.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstractImportExistsPy3/source_module.after.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/moveAndMakeAbstractImportExistsPy3/source_module.py [new file with mode: 0644]
python/testData/refactoring/extractsuperclass/presenter/file.py
python/testData/refactoring/pullup/abstractMethodHasMeta/Class.after.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodHasMeta/Class.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodHasMeta/SuperClass.after.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodHasMeta/SuperClass.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodHasMeta/abc.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy2AddMeta/Class.after.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy2AddMeta/Class.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy2AddMeta/SuperClass.after.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy2AddMeta/SuperClass.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy2AddMeta/abc.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy3AddMeta/Class.after.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy3AddMeta/Class.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy3AddMeta/SuperClass.after.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy3AddMeta/SuperClass.py [new file with mode: 0644]
python/testData/refactoring/pullup/abstractMethodPy3AddMeta/abc.py [new file with mode: 0644]
python/testData/refactoring/pullup/presenter/file.py
python/testSrc/com/jetbrains/python/psi/impl/PyArgumentListImplTest.java [new file with mode: 0644]
python/testSrc/com/jetbrains/python/refactoring/classes/NameAndStatusTransformer.java
python/testSrc/com/jetbrains/python/refactoring/classes/PyClassRefactoringTest.java
python/testSrc/com/jetbrains/python/refactoring/classes/PyPresenterTestMemberEntry.java
python/testSrc/com/jetbrains/python/refactoring/classes/PyRefactoringPresenterTestCase.java
python/testSrc/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassPresenterTest.java
python/testSrc/com/jetbrains/python/refactoring/classes/extractSuperclass/PyExtractSuperclassTest.java
python/testSrc/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpPresenterTest.java
python/testSrc/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpTest.java
python/testSrc/com/jetbrains/python/refactoring/classes/pushDown/PyPushDownTest.java
resources/src/META-INF/IdeaPlugin.xml
updater/src/com/intellij/updater/DeleteAction.java
updater/src/com/intellij/updater/Patch.java
updater/testSrc/com/intellij/updater/UpdaterTestCase.java
xml/dom-tests/tests/com/intellij/util/xml/DomIncludesTest.java

index 66a2888dd6a4a280821fdf8226fef3c43385ed42..5b9240f121af4df46fe8c9ad6ff750eaf462292c 100644 (file)
@@ -209,13 +209,13 @@ libraryLicense(name: "Log4j", libraryName: "Log4J", version: "1.2.17", license:
 libraryLicense(name: "markdownj", libraryName: "markdownj", version: "0.4.2", license: "New BSD", url: "https://code.google.com/p/markdownj/", licenseUrl: "http://opensource.org/licenses/BSD-3-Clause")
 libraryLicense(name: "Maven", version: "2.2.1", license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
 libraryLicense(name: "plexus-util", version: "2.0.6", license: "Apache 2.0", url: "http://maven.apache.org/", libraryNames:['plexus-utils-2.0.6.jar'], licenseUrl: "http://apache.org/licenses/LICENSE-2.0")
-libraryLicense(name: "aether-api", version: "1.11", libraryNames: ["aether-api-1.11.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
+libraryLicense(name: "aether-api", version: "1.13.1", libraryNames: ["aether-api-1.13.1.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
 libraryLicense(name: "aether-api-0.9.0.M2.jar", version: "0.9.0.M2", libraryNames: ["aether-api-0.9.0.M2.jar"], license: "Eclipse Public License v1.0", url: "http://nexus.sonatype.org/", licenseUrl: "http://www.eclipse.org/org/documents/epl-v10.html")
 libraryLicense(name: "maven-2.2.1-uber", version: "2.2.1", libraryNames: ["maven-2.2.1-uber.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
-libraryLicense(name: "maven-artifact", version: "3.0.3", libraryNames: ["maven-artifact-3.0.3.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
-libraryLicense(name: "maven-core", version: "3.0.3", libraryNames: ["maven-core-3.0.3.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
+libraryLicense(name: "maven-artifact", version: "3.0.5", libraryNames: ["maven-artifact-3.0.5.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
+libraryLicense(name: "maven-core", version: "3.0.5", libraryNames: ["maven-core-3.0.5.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
 libraryLicense(name: "plexus-component-annotations", version: "1.5.5", libraryNames: ["plexus-component-annotations-1.5.5.jar"], license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
-libraryLicense(name: "Maven3", libraryNames: ["Maven3", "maven-dependency-tree-1.2.jar", "archetype-catalog-2.2.jar", "archetype-common-2.2.jar"], version: "3.0.3", license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
+libraryLicense(name: "Maven3", libraryNames: ["Maven3", "maven-dependency-tree-1.2.jar", "archetype-catalog-2.2.jar", "archetype-common-2.2.jar"], version: "3.0.5", license: "Apache 2.0", url: "http://maven.apache.org/", licenseUrl: "http://maven.apache.org/license.html")
 libraryLicense(name: "Gradle", version: "1.9", license: "Apache 2.0", url: "http://gradle.org/", licenseUrl: "http://gradle.org/license")
 libraryLicense(name: "GradleJnaPosix", version: "1.0.3", license: "LGPL 2.1", url: "http://www.jruby.org/", licenseUrl: "http://www.gnu.org/licenses/lgpl-2.1.txt")
 libraryLicense(name: "Slf4j", version: "1.7.2", license: "MIT License", url: "http://slf4j.org/", licenseUrl: "http://slf4j.org/license.html")
index 139f487936ba9f26fa17893a2f9be418fdeaa883..52f77b199f047f63096a1e0ce80952f54bb10442 100644 (file)
@@ -33,16 +33,16 @@ public enum ClassFilesIndexFeature {
   @NotNull
   private final String myKey;
   @NotNull
-  private final Collection<? extends MethodsUsageIndexConfigure> myRequiredIndicesConfigures;
+  private final Collection<? extends ClassFilesIndexConfigure> myRequiredIndicesConfigures;
 
   ClassFilesIndexFeature(@NotNull final String key,
-                         @NotNull final Collection<? extends MethodsUsageIndexConfigure> requiredIndicesConfigures) {
+                         @NotNull final Collection<? extends ClassFilesIndexConfigure> requiredIndicesConfigures) {
     myKey = key;
     myRequiredIndicesConfigures = requiredIndicesConfigures;
   }
 
-  ClassFilesIndexFeature(@NotNull final String key, @NotNull final MethodsUsageIndexConfigure requiredConfigure) {
-    this(key, Collections.<MethodsUsageIndexConfigure>singleton(requiredConfigure));
+  ClassFilesIndexFeature(@NotNull final String key, @NotNull final ClassFilesIndexConfigure requiredConfigure) {
+    this(key, Collections.<ClassFilesIndexConfigure>singleton(requiredConfigure));
   }
 
   public RegistryValue getRegistryValue() {
@@ -70,7 +70,7 @@ public enum ClassFilesIndexFeature {
   }
 
   @NotNull
-  public Collection<? extends MethodsUsageIndexConfigure> getRequiredIndicesConfigures() {
+  public Collection<? extends ClassFilesIndexConfigure> getRequiredIndicesConfigures() {
     return myRequiredIndicesConfigures;
   }
 }
index 1b17eaaf1423f7585ef6271119046becd595e34d..eee027c2c1e9ce97079e1d3b66135b6620d89822 100644 (file)
@@ -86,7 +86,7 @@ public class ClassFilesIndexFeaturesHolder extends AbstractProjectComponent {
     }
     for (final ClassFilesIndexFeature feature : ClassFilesIndexFeature.values()) {
       if (feature.isEnabled() && !myEnabledFeatures.containsKey(feature)) {
-        for (final MethodsUsageIndexConfigure configure : feature.getRequiredIndicesConfigures()) {
+        for (final ClassFilesIndexConfigure configure : feature.getRequiredIndicesConfigures()) {
           if (!myEnabledIndexReaders.containsKey(configure)) {
             notAvailableConfiguresVisitor.process(configure);
           }
@@ -96,7 +96,7 @@ public class ClassFilesIndexFeaturesHolder extends AbstractProjectComponent {
   }
 
   private synchronized void disposeFeature(final ClassFilesIndexFeature featureToRemove) {
-    for (final MethodsUsageIndexConfigure requiredConfigure : featureToRemove.getRequiredIndicesConfigures()) {
+    for (final ClassFilesIndexConfigure requiredConfigure : featureToRemove.getRequiredIndicesConfigures()) {
       boolean needClose = true;
       for (final ClassFilesIndexFeature enabledFeature : myEnabledFeatures.keySet()) {
         if (!enabledFeature.equals(featureToRemove) && enabledFeature.getRequiredIndicesConfigures().contains(requiredConfigure)) {
@@ -116,10 +116,10 @@ public class ClassFilesIndexFeaturesHolder extends AbstractProjectComponent {
     if (myEnabledFeatures.containsKey(feature)) {
       throw new IllegalStateException(String.format("feature %s already contains", feature.getKey()));
     }
-    final Map<MethodsUsageIndexConfigure, ClassFilesIndexReaderBase> newIndices =
-      new HashMap<MethodsUsageIndexConfigure, ClassFilesIndexReaderBase>();
+    final Map<ClassFilesIndexConfigure, ClassFilesIndexReaderBase> newIndices =
+      new HashMap<ClassFilesIndexConfigure, ClassFilesIndexReaderBase>();
     FeatureState newFeatureState = FeatureState.AVAILABLE;
-    for (final MethodsUsageIndexConfigure requiredConfigure : feature.getRequiredIndicesConfigures()) {
+    for (final ClassFilesIndexConfigure requiredConfigure : feature.getRequiredIndicesConfigures()) {
       boolean isIndexAlreadyLoaded = false;
       for (final ClassFilesIndexFeature enabledFeature : myEnabledFeatures.keySet()) {
         if (enabledFeature.getRequiredIndicesConfigures().contains(requiredConfigure)) {
index 0cb2dd4d839cd488ea9dd68fe758c3f192adb910..8f6a7ebc7eb6143c1d6d1e26376c8d1d1832add5 100644 (file)
@@ -55,9 +55,6 @@ public abstract class ClassFilesIndexReaderBase<K, V> {
     }
   }
 
-  /**
-   * All inheritors MUST have constructor with only one parameter - Project
-   */
   @SuppressWarnings("ConstantConditions")
   protected ClassFilesIndexReaderBase(final KeyDescriptor<K> keyDescriptor,
                                       final DataExternalizer<V> valueExternalizer,
@@ -149,5 +146,4 @@ public abstract class ClassFilesIndexReaderBase<K, V> {
       return true;
     }
   }
-
 }
index ac6df7346449ebc08d98cab06365515648ea2540..da119b1049652ddeb312047811b48d03286e80b5 100644 (file)
@@ -52,7 +52,7 @@ public class CachedRelevantStaticMethodSearcher {
                                                                     final ChainCompletionContext completionContext) {
     if (resultQualifiedClassName == null ||
         ChainCompletionStringUtil.isPrimitiveOrArrayOfPrimitives(resultQualifiedClassName) ||
-        completionContext.getTargetQName().equals(resultQualifiedClassName)) {
+        completionContext.getTarget().equals(resultQualifiedClassName)) {
       return Collections.emptyList();
     }
     final TreeSet<UsageIndexValue> indexValues = myIndexReader.getMethods(resultQualifiedClassName);
@@ -68,7 +68,7 @@ public class CachedRelevantStaticMethodSearcher {
         else {
           final PsiMethod[] methods = completionContext.resolveNotDeprecated(methodInvocation);
           method = MethodChainsSearchUtil
-            .getMethodWithMinNotPrimitiveParameters(methods, Collections.singleton(completionContext.getTargetQName()));
+            .getMethodWithMinNotPrimitiveParameters(methods, Collections.singleton(completionContext.getTarget().getClassQName()));
           myCachedResolveResults.put(methodInvocation, method);
           if (method == null) {
             return Collections.emptyList();
index 339428525e7ef1373847e9acbc0b6a8b2db0ee05..c040e96e1217448887ede6efdd198f22e08e2e1d 100644 (file)
 package com.intellij.compiler.classFilesIndex.chainsSearch;
 
 import com.intellij.compiler.classFilesIndex.chainsSearch.context.ChainCompletionContext;
+import com.intellij.compiler.classFilesIndex.chainsSearch.context.TargetType;
 import com.intellij.compiler.classFilesIndex.impl.MethodsUsageIndexReader;
 import com.intellij.compiler.classFilesIndex.impl.UsageIndexValue;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.util.Pair;
-import com.intellij.psi.PsiClass;
-import com.intellij.psi.PsiManager;
-import com.intellij.psi.PsiMethod;
-import com.intellij.psi.PsiModifier;
+import com.intellij.psi.*;
 import com.intellij.util.Function;
 import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.jetbrains.jps.classFilesIndex.indexer.impl.MethodIncompleteSignature;
+import org.jetbrains.jps.incremental.storage.BuildDataManager;
 
 import java.util.*;
 
@@ -42,21 +42,36 @@ public final class ChainsSearcher {
   private static final Logger LOG = Logger.getInstance(ChainsSearcher.class);
   private static final double NEXT_METHOD_IN_CHAIN_RATIO = 1.5;
 
-  public static List<MethodsChain> search(final MethodsUsageIndexReader indexReader,
-                                          final String targetQName,
+  public static List<MethodsChain> search(final int pathMaximalLength,
+                                          final TargetType targetType,
                                           final Set<String> contextQNames,
                                           final int maxResultSize,
-                                          final int pathMaximalLength,
-                                          final ChainCompletionContext context) {
-    final SearchInitializer initializer = createInitializer(targetQName, indexReader, context.getExcludedQNames(), context);
-    return search(indexReader, initializer, contextQNames, pathMaximalLength, maxResultSize, targetQName, context);
+                                          final ChainCompletionContext context,
+                                          final MethodsUsageIndexReader methodsUsageIndexReader) {
+    final SearchInitializer initializer =
+      createInitializer(targetType,
+                        context.getExcludedQNames(),
+                        methodsUsageIndexReader,
+                        context);
+    if (initializer == null) {
+      return Collections.emptyList();
+    }
+    return search(methodsUsageIndexReader,
+                  initializer,
+                  contextQNames,
+                  pathMaximalLength,
+                  maxResultSize,
+                  targetType.getClassQName(),
+                  context);
   }
 
-  private static SearchInitializer createInitializer(final String targetQName,
-                                                     final MethodsUsageIndexReader indexReader,
+  @Nullable
+  private static SearchInitializer createInitializer(final TargetType target,
                                                      final Set<String> excludedParamsTypesQNames,
+                                                     final MethodsUsageIndexReader methodsUsageIndexReader,
                                                      final ChainCompletionContext context) {
-    return new SearchInitializer(indexReader.getMethods(targetQName), targetQName, excludedParamsTypesQNames, context);
+    final TreeSet<UsageIndexValue> methods = methodsUsageIndexReader.getMethods(target.getClassQName());
+    return new SearchInitializer(methods, target.getClassQName(), excludedParamsTypesQNames, context);
   }
 
   @NotNull
@@ -80,22 +95,20 @@ public final class ChainsSearcher {
                                                                                                      @Override
                                                                                                      public WeightAware<Pair<MethodIncompleteSignature, MethodsChain>> fun(
                                                                                                        final WeightAware<MethodIncompleteSignature> methodIncompleteSignatureWeightAware) {
-                                                                                                       final MethodIncompleteSignature
-                                                                                                         underlying =
-                                                                                                         methodIncompleteSignatureWeightAware
-                                                                                                           .getUnderlying();
+                                                                                                       final MethodIncompleteSignature underlying = methodIncompleteSignatureWeightAware.getUnderlying();
                                                                                                        return new WeightAware<Pair<MethodIncompleteSignature, MethodsChain>>(
                                                                                                          new Pair<MethodIncompleteSignature, MethodsChain>(
-                                                                                                           underlying, new MethodsChain(
-                                                                                                           context.resolveNotDeprecated(
-                                                                                                             underlying),
-                                                                                                           methodIncompleteSignatureWeightAware
-                                                                                                             .getWeight(),
-                                                                                                           underlying.getOwner())),
-                                                                                                         methodIncompleteSignatureWeightAware
-                                                                                                           .getWeight());
+                                                                                                           underlying,
+                                                                                                           new MethodsChain(context.resolveNotDeprecated(underlying),
+                                                                                                                            methodIncompleteSignatureWeightAware.getWeight(),
+                                                                                                                            underlying.getOwner()
+                                                                                                           )
+                                                                                                         ),
+                                                                                                         methodIncompleteSignatureWeightAware.getWeight()
+                                                                                                       );
                                                                                                      }
-                                                                                                   }));
+                                                                                                   }
+      ));
 
     int maxWeight = 0;
     for (final MethodsChain methodsChain : knownDistance.values()) {
@@ -118,7 +131,8 @@ public final class ChainsSearcher {
         result.add(currentVertex.getUnderlying().getSecond());
         continue;
       }
-      final SortedSet<UsageIndexValue> nextMethods = indexReader.getMethods(currentVertexUnderlying.getFirst().getOwner());
+      final String currentReturnType = currentVertexUnderlying.getFirst().getOwner();
+      final SortedSet<UsageIndexValue> nextMethods = indexReader.getMethods(currentReturnType);
       final MaxSizeTreeSet<WeightAware<MethodIncompleteSignature>> currentSignatures =
         new MaxSizeTreeSet<WeightAware<MethodIncompleteSignature>>(maxResultSize);
       for (final UsageIndexValue indexValue : nextMethods) {
@@ -133,8 +147,10 @@ public final class ChainsSearcher {
                 final MethodIncompleteSignature methodInvocation = indexValue.getMethodIncompleteSignature();
                 final PsiMethod[] psiMethods = context.resolveNotDeprecated(methodInvocation);
                 if (psiMethods.length != 0 && MethodChainsSearchUtil.checkParametersForTypesQNames(psiMethods, allExcludedNames)) {
-                  final MethodsChain newBestMethodsChain = currentVertexMethodsChain.addEdge(psiMethods, indexValue.getMethodIncompleteSignature().getOwner(), vertexDistance);
-                  currentSignatures.add(new WeightAware<MethodIncompleteSignature>(indexValue.getMethodIncompleteSignature(), vertexDistance));
+                  final MethodsChain newBestMethodsChain =
+                    currentVertexMethodsChain.addEdge(psiMethods, indexValue.getMethodIncompleteSignature().getOwner(), vertexDistance);
+                  currentSignatures
+                    .add(new WeightAware<MethodIncompleteSignature>(indexValue.getMethodIncompleteSignature(), vertexDistance));
                   knownDistance.put(vertex, newBestMethodsChain);
                 }
               }
@@ -302,4 +318,4 @@ public final class ChainsSearcher {
       return resultHolder.getRawResult();
     }
   }
-}
+}
\ No newline at end of file
index 46724834d765d26c3ba3e8f67499700d8ee701c0..00a0dcd725970696691a55655cb3ea73477df432 100644 (file)
@@ -60,8 +60,7 @@ public class MethodsChainLookupRangingHelper {
 
   @SuppressWarnings("ConstantConditions")
   @Nullable
-  private static WeightableChainLookupElement chainToWeightableLookupElement(final MethodsChain chain,
-                                                                             final ChainCompletionContext context) {
+  private static LookupElement chainToWeightableLookupElement(final MethodsChain chain, final ChainCompletionContext context) {
     final int chainSize = chain.size();
     assert chainSize != 0;
     final int lastMethodWeight = chain.getChainWeight();
@@ -76,7 +75,7 @@ public class MethodsChainLookupRangingHelper {
 
     for (final PsiMethod[] psiMethods : chain.getPath()) {
       final PsiMethod method =
-        MethodChainsSearchUtil.getMethodWithMinNotPrimitiveParameters(psiMethods, Collections.singleton(context.getTargetQName()));
+        MethodChainsSearchUtil.getMethodWithMinNotPrimitiveParameters(psiMethods, Collections.singleton(context.getTarget().getClassQName()));
       if (method == null) {
         return null;
       }
@@ -141,52 +140,49 @@ public class MethodsChainLookupRangingHelper {
     for (int i = 0; i < parameters.length; i++) {
       final PsiParameter parameter = parameters[i];
       final String typeQName = parameter.getType().getCanonicalText();
-      if (typeQName != null) {
-        if (JAVA_LANG_STRING.equals(typeQName)) {
-          final PsiVariable relevantStringVar = context.findRelevantStringInContext(parameter.getName());
-          if (relevantStringVar == null) {
-            notMatchedStringVars++;
-          }
-          else {
-            parametersMap.put(i, new VariableSubLookupElement(relevantStringVar));
-          }
+      if (JAVA_LANG_STRING.equals(typeQName)) {
+        final PsiVariable relevantStringVar = context.findRelevantStringInContext(parameter.getName());
+        if (relevantStringVar == null) {
+          notMatchedStringVars++;
         }
-        else if (!ChainCompletionStringUtil.isPrimitiveOrArrayOfPrimitives(typeQName)) {
-          final Collection<PsiVariable> contextVariables = context.getVariables(typeQName);
-          final PsiVariable contextVariable = ContainerUtil.getFirstItem(contextVariables, null);
-          if (contextVariable != null) {
-            if (contextVariables.size() == 1) parametersMap.put(i, new VariableSubLookupElement(contextVariable));
-            matchedParametersInContext++;
-            continue;
-          }
-          final Collection<ContextRelevantVariableGetter> relevantVariablesGetters = context.getRelevantVariablesGetters(typeQName);
-          final ContextRelevantVariableGetter contextVariableGetter = ContainerUtil.getFirstItem(relevantVariablesGetters, null);
-          if (contextVariableGetter != null) {
-            if (relevantVariablesGetters.size() == 1) parametersMap.put(i, contextVariableGetter.createSubLookupElement());
-            matchedParametersInContext++;
-            continue;
-          }
-          final Collection<PsiMethod> containingClassMethods = context.getContainingClassMethods(typeQName);
-          final PsiMethod contextRelevantGetter = ContainerUtil.getFirstItem(containingClassMethods, null);
-          if (contextRelevantGetter != null) {
-            if (containingClassMethods.size() == 1) parametersMap.put(i, new GetterLookupSubLookupElement(method.getName()));
-            matchedParametersInContext++;
-            continue;
-          }
-          //todo
-          final ContextRelevantStaticMethod contextRelevantStaticMethod =
-            ContainerUtil.getFirstItem(context.getRelevantStaticMethods(typeQName, weight), null);
-          if (contextRelevantStaticMethod != null) {
-            //
-            // In most cases it is not really relevant
-            //
-            //parametersMap.put(i, contextRelevantStaticMethod.createLookupElement());
-            matchedParametersInContext++;
-            continue;
-          }
-          if (!nullableNotNullManager.isNullable(parameter, true)) {
-            unreachableParametersCount++;
-          }
+        else {
+          parametersMap.put(i, new VariableSubLookupElement(relevantStringVar));
+        }
+      }
+      else if (!ChainCompletionStringUtil.isPrimitiveOrArrayOfPrimitives(typeQName)) {
+        final Collection<PsiVariable> contextVariables = context.getVariables(typeQName);
+        final PsiVariable contextVariable = ContainerUtil.getFirstItem(contextVariables, null);
+        if (contextVariable != null) {
+          if (contextVariables.size() == 1) parametersMap.put(i, new VariableSubLookupElement(contextVariable));
+          matchedParametersInContext++;
+          continue;
+        }
+        final Collection<ContextRelevantVariableGetter> relevantVariablesGetters = context.getRelevantVariablesGetters(typeQName);
+        final ContextRelevantVariableGetter contextVariableGetter = ContainerUtil.getFirstItem(relevantVariablesGetters, null);
+        if (contextVariableGetter != null) {
+          if (relevantVariablesGetters.size() == 1) parametersMap.put(i, contextVariableGetter.createSubLookupElement());
+          matchedParametersInContext++;
+          continue;
+        }
+        final Collection<PsiMethod> containingClassMethods = context.getContainingClassMethods(typeQName);
+        final PsiMethod contextRelevantGetter = ContainerUtil.getFirstItem(containingClassMethods, null);
+        if (contextRelevantGetter != null) {
+          if (containingClassMethods.size() == 1) parametersMap.put(i, new GetterLookupSubLookupElement(method.getName()));
+          matchedParametersInContext++;
+          continue;
+        }
+        final ContextRelevantStaticMethod contextRelevantStaticMethod =
+          ContainerUtil.getFirstItem(context.getRelevantStaticMethods(typeQName, weight), null);
+        if (contextRelevantStaticMethod != null) {
+          //
+          // In most cases it is not really relevant
+          //
+          //parametersMap.put(i, contextRelevantStaticMethod.createLookupElement());
+          matchedParametersInContext++;
+          continue;
+        }
+        if (!nullableNotNullManager.isNullable(parameter, true)) {
+          unreachableParametersCount++;
         }
       }
     }
index 3cdc760c5ff351d019f5f82a111734e0f3dcaaff..68c252907b8e3118a0f37bc43054bdcfb798157d 100644 (file)
@@ -59,7 +59,7 @@ public final class ParametersMatcher {
       else {
         unMatched++;
       }
-      if (context.getTargetQName().equals(canonicalText) || additionalExcludedNames.contains(canonicalText)) {
+      if (context.getTarget().getClassQName().equals(canonicalText) || additionalExcludedNames.contains(canonicalText)) {
         hasTarget = true;
       }
     }
index 609f560749e3b753b9a5afc1f6468962bbc3fecf..85ee710c8df49685a18d82e3e22991bae36575e5 100644 (file)
@@ -1,41 +1,23 @@
-/*
- * 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.compiler.classFilesIndex.chainsSearch.completion;
 
 import com.intellij.codeInsight.completion.*;
+import com.intellij.codeInsight.lookup.LookupElement;
 import com.intellij.compiler.classFilesIndex.api.index.ClassFilesIndexFeature;
 import com.intellij.compiler.classFilesIndex.api.index.ClassFilesIndexFeaturesHolder;
-import com.intellij.compiler.classFilesIndex.chainsSearch.ChainCompletionStringUtil;
-import com.intellij.compiler.classFilesIndex.chainsSearch.ChainsSearcher;
-import com.intellij.compiler.classFilesIndex.chainsSearch.MethodsChain;
-import com.intellij.compiler.classFilesIndex.chainsSearch.MethodsChainLookupRangingHelper;
+import com.intellij.compiler.classFilesIndex.chainsSearch.*;
 import com.intellij.compiler.classFilesIndex.chainsSearch.context.ChainCompletionContext;
 import com.intellij.compiler.classFilesIndex.chainsSearch.context.ContextUtil;
-import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.compiler.classFilesIndex.chainsSearch.context.TargetType;
 import com.intellij.compiler.classFilesIndex.impl.MethodsUsageIndexReader;
 import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.project.Project;
 import com.intellij.patterns.ElementPattern;
 import com.intellij.psi.*;
-import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.impl.source.PsiImmediateClassType;
 import com.intellij.psi.search.searches.DirectClassInheritorsSearch;
 import com.intellij.psi.util.PsiTreeUtil;
-import com.intellij.util.ProcessingContext;
-import com.intellij.util.Processor;
-import com.intellij.util.SmartList;
+import com.intellij.util.*;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -47,7 +29,10 @@ import static com.intellij.patterns.PsiJavaPatterns.or;
  * @author Dmitry Batkovich
  */
 public class MethodsChainsCompletionContributor extends CompletionContributor {
-  public static final int INVOCATIONS_THRESHOLD = 3;
+  private final static boolean IS_UNIT_TEST_MODE = ApplicationManager.getApplication().isUnitTestMode();
+
+  public static final int INVOCATIONS_THRESHOLD = 2;
+  public static final CompletionType COMPLETION_TYPE = IS_UNIT_TEST_MODE ? CompletionType.BASIC : CompletionType.SMART;
 
   private final static int MAX_SEARCH_RESULT_SIZE = 5;
   private final static int MAX_CHAIN_SIZE = 4;
@@ -55,13 +40,10 @@ public class MethodsChainsCompletionContributor extends CompletionContributor {
 
   @Override
   public void fillCompletionVariants(final CompletionParameters parameters, final CompletionResultSet result) {
-    if (parameters.getInvocationCount() >= INVOCATIONS_THRESHOLD
-        && ClassFilesIndexFeaturesHolder.getInstance(parameters.getPosition().getProject())
+    if (parameters.getInvocationCount() >= INVOCATIONS_THRESHOLD &&
+        ClassFilesIndexFeaturesHolder.getInstance(parameters.getPosition().getProject())
           .enableFeatureIfNeed(ClassFilesIndexFeature.METHOD_CHAINS_COMPLETION)) {
       super.fillCompletionVariants(parameters, result);
-      if (ApplicationManager.getApplication().isUnitTestMode()) {
-        result.stopHere();
-      }
     }
   }
 
@@ -69,7 +51,7 @@ public class MethodsChainsCompletionContributor extends CompletionContributor {
   public MethodsChainsCompletionContributor() {
     final ElementPattern<PsiElement> pattern =
       or(CompletionContributorPatternUtil.patternForMethodParameter(), CompletionContributorPatternUtil.patternForVariableAssignment());
-    extend(CompletionType.BASIC, pattern, new CompletionProvider<CompletionParameters>() {
+    extend(COMPLETION_TYPE, pattern, new CompletionProvider<CompletionParameters>() {
       @Override
       protected void addCompletions(final @NotNull CompletionParameters parameters,
                                     final ProcessingContext context,
@@ -77,7 +59,6 @@ public class MethodsChainsCompletionContributor extends CompletionContributor {
         final ChainCompletionContext completionContext = extractContext(parameters);
         if (completionContext == null) return;
 
-        final String targetClassQName = completionContext.getTargetQName();
         final Set<String> contextTypesKeysSet = completionContext.getContextTypes();
         final Set<String> contextRelevantTypes = new HashSet<String>(contextTypesKeysSet.size() + 1);
         for (final String type : contextTypesKeysSet) {
@@ -85,48 +66,73 @@ public class MethodsChainsCompletionContributor extends CompletionContributor {
             contextRelevantTypes.add(type);
           }
         }
-        contextRelevantTypes.remove(targetClassQName);
-
-        final List<LookupElement> foundElements = searchForLookups(targetClassQName, contextRelevantTypes, completionContext);
-        result.addAllElements(foundElements);
+        final TargetType target = completionContext.getTarget();
+        contextRelevantTypes.remove(target.getClassQName());
+        final List<LookupElement> elementsFoundByMethodsChainsSearch = searchForLookups(target, contextRelevantTypes, completionContext);
+        if (!IS_UNIT_TEST_MODE) {
+          result.runRemainingContributors(parameters, new Consumer<CompletionResult>() {
+            @Override
+            public void consume(final CompletionResult completionResult) {
+              final LookupElement lookupElement = completionResult.getLookupElement();
+              final PsiElement lookupElementPsi = lookupElement.getPsiElement();
+              if (lookupElementPsi != null) {
+                for (final LookupElement element : elementsFoundByMethodsChainsSearch) {
+                  if (lookupElementPsi.isEquivalentTo(element.getPsiElement())) {
+                    elementsFoundByMethodsChainsSearch.remove(element);
+                    break;
+                  }
+                }
+              }
+              result.passResult(completionResult);
+            }
+          });
+        } else {
+          result.stopHere();
+        }
+        result.addAllElements(elementsFoundByMethodsChainsSearch);
       }
     });
   }
 
-  private static List<LookupElement> searchForLookups(final String targetClassQName,
+  private static List<LookupElement> searchForLookups(final TargetType target,
                                                       final Set<String> contextRelevantTypes,
                                                       final ChainCompletionContext completionContext) {
-    final MethodsUsageIndexReader methodsUsageIndexReader = MethodsUsageIndexReader.getInstance(completionContext.getProject());
+    final Project project = completionContext.getProject();
+    final MethodsUsageIndexReader methodsUsageIndexReader = MethodsUsageIndexReader.getInstance(project);
     final List<MethodsChain> searchResult =
-      searchChains(targetClassQName, contextRelevantTypes, MAX_SEARCH_RESULT_SIZE, MAX_CHAIN_SIZE, completionContext, methodsUsageIndexReader);
+      searchChains(target, contextRelevantTypes, MAX_SEARCH_RESULT_SIZE, MAX_CHAIN_SIZE, completionContext, methodsUsageIndexReader);
     if (searchResult.size() < MAX_SEARCH_RESULT_SIZE) {
-      final PsiClass aClass = JavaPsiFacade.getInstance(completionContext.getProject())
-        .findClass(targetClassQName, GlobalSearchScope.allScope(completionContext.getProject()));
-      if (aClass != null) {
-        DirectClassInheritorsSearch.search(aClass).forEach(new Processor<PsiClass>() {
+      if (!target.isArray()) {
+        final List<MethodsChain> inheritorFilteredSearchResult = new SmartList<MethodsChain>();
+        final Processor<TargetType> consumer = new Processor<TargetType>() {
           @Override
-          public boolean process(final PsiClass psiClass) {
-            final String inheritorQName = psiClass.getQualifiedName();
-            if (!StringUtil.isEmpty(inheritorQName)) {
-              final List<MethodsChain> inheritorFilteredSearchResult = new SmartList<MethodsChain>();
-              //noinspection ConstantConditions
-              for (final MethodsChain chain : searchChains(inheritorQName, contextRelevantTypes, MAX_SEARCH_RESULT_SIZE, MAX_CHAIN_SIZE,
-                                                           completionContext, methodsUsageIndexReader)) {
-                boolean insert = true;
-                for (final MethodsChain baseChain : searchResult) {
-                  final MethodsChain.CompareResult r = MethodsChain.compare(baseChain, chain, completionContext.getPsiManager());
-                  if (r != MethodsChain.CompareResult.NOT_EQUAL) {
-                    insert = false;
-                    break;
-                  }
-                }
-                if (insert) {
-                  inheritorFilteredSearchResult.add(chain);
+          public boolean process(final TargetType targetType) {
+            for (final MethodsChain chain : searchChains(targetType, contextRelevantTypes, MAX_SEARCH_RESULT_SIZE, MAX_CHAIN_SIZE,
+                                                         completionContext, methodsUsageIndexReader)) {
+              boolean insert = true;
+              for (final MethodsChain baseChain : searchResult) {
+                final MethodsChain.CompareResult r = MethodsChain.compare(baseChain, chain, completionContext.getPsiManager());
+                if (r != MethodsChain.CompareResult.NOT_EQUAL) {
+                  insert = false;
+                  break;
                 }
               }
-              searchResult.addAll(inheritorFilteredSearchResult);
+              if (insert) {
+                inheritorFilteredSearchResult.add(chain);
+              }
+            }
+            searchResult.addAll(inheritorFilteredSearchResult);
+            return searchResult.size() < MAX_SEARCH_RESULT_SIZE;
+          }
+        };
+        DirectClassInheritorsSearch.search(((PsiClassType)target.getPsiType()).resolve()).forEach(new Processor<PsiClass>() {
+          @Override
+          public boolean process(final PsiClass psiClass) {
+            final String inheritorQName = psiClass.getQualifiedName();
+            if (inheritorQName == null) {
+              return true;
             }
-            return true;
+            return consumer.process(new TargetType(inheritorQName, false, new PsiImmediateClassType(psiClass, PsiSubstitutor.EMPTY)));
           }
         });
       }
@@ -206,12 +212,12 @@ public class MethodsChainsCompletionContributor extends CompletionContributor {
     return filteredResult;
   }
 
-  private static List<MethodsChain> searchChains(final String targetQName,
+  private static List<MethodsChain> searchChains(final TargetType target,
                                                  final Set<String> contextVarsQNames,
                                                  final int maxResultSize,
                                                  final int maxChainSize,
                                                  final ChainCompletionContext context,
                                                  final MethodsUsageIndexReader methodsUsageIndexReader) {
-    return ChainsSearcher.search(methodsUsageIndexReader, targetQName, contextVarsQNames, maxResultSize, maxChainSize, context);
+    return ChainsSearcher.search(maxChainSize, target, contextVarsQNames, maxResultSize, context, methodsUsageIndexReader);
   }
-}
+}
\ No newline at end of file
index ea49f3c2cee84a0295593c8ad6000a19c88362f1..7d25398e549d9a9c48e975468185689e17a668af 100644 (file)
@@ -19,10 +19,7 @@ import com.intellij.compiler.classFilesIndex.chainsSearch.CachedRelevantStaticMe
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.NotNullLazyValue;
 import com.intellij.openapi.util.UserDataHolder;
-import com.intellij.psi.JavaPsiFacade;
-import com.intellij.psi.PsiManager;
-import com.intellij.psi.PsiMethod;
-import com.intellij.psi.PsiVariable;
+import com.intellij.psi.*;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.util.containers.FactoryMap;
 import com.intellij.util.containers.MultiMap;
@@ -44,7 +41,7 @@ public class ChainCompletionContext {
     }
   };
   private final PsiMethod myContextMethod;
-  private final String myTargetQName;
+  private final TargetType myTarget;
   private final Set<String> myContainingClassQNames;
   private final MultiMap<String, PsiVariable> myContextVars;
   private final MultiMap<String, PsiMethod> myContainingClassGetters;
@@ -72,7 +69,7 @@ public class ChainCompletionContext {
   }
 
   ChainCompletionContext(final PsiMethod contextMethod,
-                         final String targetQName,
+                         final TargetType target,
                          final Set<String> containingClassQNames,
                          final MultiMap<String, PsiVariable> contextVars,
                          final MultiMap<String, PsiMethod> containingClassGetters,
@@ -82,7 +79,7 @@ public class ChainCompletionContext {
                          final Project project,
                          final GlobalSearchScope resolveScope) {
     myContextMethod = contextMethod;
-    myTargetQName = targetQName;
+    myTarget = target;
     myContainingClassQNames = containingClassQNames;
     myContextVars = contextVars;
     myContainingClassGetters = containingClassGetters;
@@ -104,8 +101,8 @@ public class ChainCompletionContext {
     return myContextMethodName.getValue();
   }
 
-  public String getTargetQName() {
-    return myTargetQName;
+  public TargetType getTarget() {
+    return myTarget;
   }
 
   @Nullable
index 1ea1bf49ebbadd6b3ba074cda797ba087ba4bb44..7b79ef711b62cd3e317c8924672603a7b69c04f1 100644 (file)
@@ -38,20 +38,18 @@ public final class ContextUtil {
     if (variableType == null || containingElement == null) {
       return null;
     }
+
+    final TargetType target;
     if (variableType instanceof PsiClassType) {
-      final PsiClass aClass = ((PsiClassType)variableType).resolve();
-      if (aClass != null) {
-        if (aClass.hasTypeParameters()) {
-          return null;
-        }
-      }
-      else {
-        return null;
-      }
+      target = TargetType.create((PsiClassType)variableType);
     }
-
-    final String targetQName = variableType.getCanonicalText();
-    if (targetQName == null || targetQName.endsWith("[]")) {
+    else if (variableType instanceof PsiArrayType) {
+      target = TargetType.create((PsiArrayType)variableType);
+    }
+    else {
+      return null;
+    }
+    if (target == null) {
       return null;
     }
 
@@ -121,7 +119,7 @@ public final class ContextUtil {
       }
     }
 
-    return create(method, targetQName, contextVars, contextMethods, containingClassQNames, containingElement.getProject(),
+    return create(method, target, contextVars, contextMethods, containingClassQNames, containingElement.getProject(),
                   containingElement.getResolveScope(), excludedQNames);
   }
 
@@ -177,7 +175,7 @@ public final class ContextUtil {
 
   @Nullable
   private static ChainCompletionContext create(final PsiMethod contextMethod,
-                                               final String targetQName,
+                                               final TargetType target,
                                                final List<PsiVariable> contextVars,
                                                final List<PsiMethod> contextMethods,
                                                final Set<String> containingClassQNames,
@@ -190,12 +188,10 @@ public final class ContextUtil {
     final Map<String, PsiVariable> stringVars = new HashMap<String, PsiVariable>();
 
     for (final PsiMethod method : contextMethods) {
-      PsiType returnType = method.getReturnType();
+      final PsiType returnType = method.getReturnType();
       if (returnType != null) {
         final String returnTypeQName = returnType.getCanonicalText();
-        if (returnTypeQName != null) {
-          containingClassGetters.putValue(returnTypeQName, method);
-        }
+        containingClassGetters.putValue(returnTypeQName, method);
       }
     }
 
@@ -214,13 +210,14 @@ public final class ContextUtil {
         final PsiClass aClass = ((PsiClassType)type).resolve();
         if (aClass != null) {
           final String classQName = type.getCanonicalText();
-          if (!targetQName.equals(classQName)) {
+          if (!target.getClassQName().equals(classQName)) {
             classQNames.add(classQName);
             classQNames.addAll(resolveSupersNamesRecursively(aClass));
             for (final PsiMethod method : aClass.getAllMethods()) {
               if (method.getParameterList().getParametersCount() == 0 && method.getName().startsWith("get")) {
-                final String getterReturnTypeQName = method.getReturnType().getCanonicalText();
-                if (getterReturnTypeQName != null) {
+                final PsiType returnType = method.getReturnType();
+                if (returnType != null) {
+                  final String getterReturnTypeQName = returnType.getCanonicalText();
                   contextVarsGetters.putValue(getterReturnTypeQName, new ContextRelevantVariableGetter(var, method));
                 }
               }
@@ -230,15 +227,13 @@ public final class ContextUtil {
       }
       else {
         final String classQName = type.getCanonicalText();
-        if (classQName != null) {
-          classQNames.add(classQName);
-        }
+        classQNames.add(classQName);
       }
       for (final String qName : classQNames) {
         classQNameToVariable.putValue(qName, var);
       }
     }
-    return new ChainCompletionContext(contextMethod, targetQName, containingClassQNames, classQNameToVariable, containingClassGetters,
+    return new ChainCompletionContext(contextMethod, target, containingClassQNames, classQNameToVariable, containingClassGetters,
                                       contextVarsGetters, stringVars, excludedQNames, project, resolveScope);
   }
 
index e48f07272457c4006ad982b3334f142ad7833924..5a9c257b78ab7bfaee734d5908b1518e3f84f217 100644 (file)
@@ -57,8 +57,22 @@ final class MethodIncompleteSignatureResolver {
     for (final PsiMethod method : methods) {
       if (method.hasModifierProperty(PsiModifier.STATIC) == signature.isStatic()) {
         final PsiType returnType = method.getReturnType();
-        if (returnType != null && returnType.equalsToText(signature.getReturnType())) {
-          filtered.add(method);
+        if (returnType != null) {
+          if (returnType instanceof PsiClassType) {
+            final PsiClass resolved = ((PsiClassType)returnType).resolve();
+            if (resolved == null) {
+              continue;
+            }
+            final String qualifiedName = resolved.getQualifiedName();
+            if (qualifiedName == null) {
+              continue;
+            }
+            if (qualifiedName.equals(signature.getReturnType())) {
+              filtered.add(method);
+            }
+          } else if (returnType.equalsToText(signature.getReturnType())) {
+            filtered.add(method);
+          }
         }
       }
     }
diff --git a/java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/context/TargetType.java b/java/compiler/impl/src/com/intellij/compiler/classFilesIndex/chainsSearch/context/TargetType.java
new file mode 100644 (file)
index 0000000..2d983f1
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2000-2014 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.compiler.classFilesIndex.chainsSearch.context;
+
+import com.intellij.psi.*;
+import com.intellij.util.containers.ContainerUtil;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author Dmitry Batkovich
+ */
+public class TargetType {
+
+  private final String myClassQName;
+  private final boolean myArray;
+  private final PsiType myPsiType;
+
+  public TargetType(final String classQName,
+                    final boolean isArray,
+                    final PsiType targetType) {
+    myClassQName = classQName;
+    myArray = isArray;
+    myPsiType = targetType;
+  }
+
+  public String getClassQName() {
+    return myClassQName;
+  }
+
+  public boolean isArray() {
+    return myArray;
+  }
+
+  public PsiType getPsiType() {
+    return myPsiType;
+  }
+
+  @Nullable
+  public static TargetType create(final PsiArrayType arrayType) {
+    PsiType currentComponentType = arrayType.getComponentType();
+    while (currentComponentType instanceof PsiArrayType) {
+      currentComponentType = ((PsiArrayType)currentComponentType).getComponentType();
+    }
+    if (!(currentComponentType instanceof PsiClassType)) {
+      return null;
+    }
+    final String targetQName = arrayType.getCanonicalText();
+    return new TargetType(targetQName, true, arrayType);
+  }
+
+  @Nullable
+  public static TargetType create(final PsiClassType classType) {
+    final PsiClassType.ClassResolveResult resolvedGenerics = classType.resolveGenerics();
+    final PsiClass resolvedClass = resolvedGenerics.getElement();
+    if (resolvedClass == null) {
+      return null;
+    }
+    final String classQName = resolvedClass.getQualifiedName();
+    if (classQName == null) {
+      return null;
+    }
+    if (resolvedClass.hasTypeParameters()) {
+      return null;
+    }
+    return new TargetType(classQName, false, classType);
+  }
+}
index bfcaefeb55ae77791675230ecc619eb71f3b2e75..3b3adcdb8a5d5fc81da7cf3fba22524a3c2f279d 100644 (file)
@@ -78,5 +78,4 @@ public class MethodsUsageIndexReader extends ClassFilesIndexReaderBase<String, T
     });
     return values;
   }
-
 }
index a205e452b28a67fea4cc9f49faf87695ca4db6a8..dd9079ebf8722b27bfe1db003b4c8e3ca93eb570 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.roots.ui.configuration.libraryEditor.NewLibraryEdito
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.util.Disposer;
 import com.intellij.util.ui.FormBuilder;
+import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import java.awt.*;
@@ -74,4 +75,10 @@ public class EditLibraryDialog extends DialogWrapper {
     }
     super.doOKAction();
   }
+
+  @Nullable
+  @Override
+  protected String getHelpId() {
+    return "Edit_Library_dialog";
+  }
 }
index d14d36523658a74a11388d1fc5179a60896e4f55..cde7955f619ba620273797d7d1abadfc66651101 100644 (file)
@@ -397,7 +397,7 @@ public class ProjectTypeStep extends ModuleWizardStep implements Disposable {
   private boolean showCustomOptions(@NotNull ModuleBuilder builder) {
     String card = builder.getBuilderId();
     if (!myCustomSteps.containsKey(card)) {
-      ModuleWizardStep step = builder.getCustomOptionsStep(this);
+      ModuleWizardStep step = builder.getCustomOptionsStep(myContext, this);
       if (step == null) return false;
       step.updateStep();
       myCustomSteps.put(card, step);
index 5046be673abbf08e5757b3408367484fc3339697..b975ae43371d4aa3f3de0294d4d4aec8bd526b81 100644 (file)
@@ -180,17 +180,12 @@ public abstract class FrameworkSupportModelBase extends UserDataHolderBase imple
   }
 
   public void onFrameworkSelectionChanged(FrameworkSupportNode node) {
-    final FrameworkSupportModelListener multicaster = myDispatcher.getMulticaster();
     final FrameworkSupportInModuleProvider provider = node.getUserObject();
     //todo[nik]
+    boolean checked = node.isChecked();
     if (provider instanceof OldFrameworkSupportProviderWrapper) {
       final FrameworkSupportProvider oldProvider = ((OldFrameworkSupportProviderWrapper) provider).getProvider();
-      if (node.isChecked()) {
-        multicaster.frameworkSelected(oldProvider);
-      }
-      else {
-        multicaster.frameworkUnselected(oldProvider);
-      }
+      selectFramework(oldProvider, checked);
     }
     for (FrameworkSupportInModuleProvider.FrameworkDependency dependency : provider.getDependenciesFrameworkIds()) {
       if (!dependency.isOptional()) {
@@ -200,6 +195,16 @@ public abstract class FrameworkSupportModelBase extends UserDataHolderBase imple
     }
   }
 
+  public void selectFramework(FrameworkSupportProvider provider, boolean checked) {
+    final FrameworkSupportModelListener multicaster = myDispatcher.getMulticaster();
+    if (checked) {
+      multicaster.frameworkSelected(provider);
+    }
+    else {
+      multicaster.frameworkUnselected(provider);
+    }
+  }
+
   public void fireWizardStepUpdated() {
     myDispatcher.getMulticaster().wizardStepUpdated();
   }
index 4db93153f581807fd98d89429abf2175a04fc565..4e42026647e202a814532b9b2d022e99f721a8ad 100644 (file)
@@ -17,12 +17,8 @@ package com.intellij.ide.util.projectWizard;
 
 import com.intellij.CommonBundle;
 import com.intellij.ide.IdeBundle;
-import com.intellij.ide.util.PropertiesComponent;
-import com.intellij.openapi.module.ModuleType;
 import com.intellij.openapi.options.ConfigurationException;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.project.ProjectManager;
-import com.intellij.openapi.projectRoots.ProjectJdkTable;
 import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.openapi.projectRoots.SdkTypeId;
 import com.intellij.openapi.roots.ProjectRootManager;
@@ -35,8 +31,6 @@ import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 /**
  * @author Dmitry Avdeev
@@ -47,64 +41,29 @@ public class SdkSettingsStep extends ModuleWizardStep {
   protected final WizardContext myWizardContext;
   protected final ProjectSdksModel myModel;
   private final ModuleBuilder myModuleBuilder;
+  private final JPanel myJdkPanel;
 
-  public SdkSettingsStep(@NotNull SettingsStep settingsStep, @NotNull ModuleBuilder moduleBuilder, @NotNull Condition<SdkTypeId> sdkFilter) {
+  public SdkSettingsStep(SettingsStep settingsStep, @NotNull ModuleBuilder moduleBuilder,
+                           @NotNull Condition<SdkTypeId> sdkFilter) {
+
+    this(settingsStep.getContext(), moduleBuilder, sdkFilter);
+    settingsStep.addSettingsField(getSdkFieldLabel(settingsStep.getContext().getProject()), myJdkPanel);
+  }
+
+  public SdkSettingsStep(WizardContext context,
+                         @NotNull ModuleBuilder moduleBuilder,
+                         @NotNull Condition<SdkTypeId> sdkFilter) {
     myModuleBuilder = moduleBuilder;
 
-    myWizardContext = settingsStep.getContext();
+    myWizardContext = context;
     myModel = new ProjectSdksModel();
     Project project = myWizardContext.getProject();
     myModel.reset(project);
 
-    myJdkComboBox = new JdkComboBox(myModel, sdkFilter);
-
-    final PropertiesComponent component = project == null ? PropertiesComponent.getInstance() : PropertiesComponent.getInstance(project);
-    ModuleType moduleType = moduleBuilder.getModuleType();
-    final String selectedJdkProperty = "jdk.selected." + (moduleType == null ? "" : moduleType.getId());
-    myJdkComboBox.addActionListener(new ActionListener() {
-      @Override
-      public void actionPerformed(ActionEvent e) {
-        Sdk jdk = myJdkComboBox.getSelectedJdk();
-        if (jdk != null) {
-          component.setValue(selectedJdkProperty, jdk.getName());
-        }
-      }
-    });
-
-    if (project != null) {
-      Sdk sdk = ProjectRootManager.getInstance(project).getProjectSdk();
-      if (sdk != null && moduleBuilder.isSuitableSdkType(sdk.getSdkType())) {
-        // use project SDK
-        return;
-      }
-    }
-    else  {
-      // set default project SDK
-      Project defaultProject = ProjectManager.getInstance().getDefaultProject();
-      Sdk sdk = ProjectRootManager.getInstance(defaultProject).getProjectSdk();
-      if (sdk != null && sdkFilter.value(sdk.getSdkType())) {
-        myJdkComboBox.setSelectedJdk(sdk);
-      }
-    }
-
-    String value = component.getValue(selectedJdkProperty);
-    if (value != null) {
-      Sdk jdk = ProjectJdkTable.getInstance().findJdk(value);
-      if (jdk != null) {
-        myJdkComboBox.setSelectedJdk(jdk);
-      }
-    }
-
-    JButton button = new JButton("Ne\u001Bw...");
-    myJdkComboBox.setSetupButton(button, project, myModel,
-                                 project == null ? new JdkComboBox.NoneJdkComboBoxItem() : new JdkComboBox.ProjectJdkComboBoxItem(),
-                                 null,
-                                 false);
-    JPanel jdkPanel = new JPanel(new BorderLayout(4, 0));
-    jdkPanel.add(myJdkComboBox);
-    jdkPanel.add(button, BorderLayout.EAST);
-    settingsStep.addSettingsField(getSdkFieldLabel(project), jdkPanel);
-
+    myJdkComboBox = JdkComboBox.createSdkComboBox(moduleBuilder, sdkFilter, project, myModel);
+    myJdkPanel = new JPanel(new BorderLayout(4, 0));
+    myJdkPanel.add(myJdkComboBox);
+    myJdkPanel.add(myJdkComboBox.getSetUpButton(), BorderLayout.EAST);
   }
 
   @NotNull
@@ -112,9 +71,13 @@ public class SdkSettingsStep extends ModuleWizardStep {
     return (project == null ? "Project" : "Module") + " \u001BSDK:";
   }
 
+  public JdkComboBox getJdkComboBox() {
+    return myJdkComboBox;
+  }
+
   @Override
   public JComponent getComponent() {
-    return null;
+    return myJdkPanel;
   }
 
   @Override
index f81f8406458344f5d19b2e0d04ffb32ebf20b69d..8a8a55461cb9f29e87047841cb420ec9d5a9e5d6 100644 (file)
 package com.intellij.openapi.roots.ui.configuration;
 
 import com.intellij.ide.DataManager;
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.ide.util.projectWizard.ModuleBuilder;
 import com.intellij.ide.util.projectWizard.ProjectJdkListRenderer;
 import com.intellij.openapi.actionSystem.*;
+import com.intellij.openapi.module.ModuleType;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.ProjectBundle;
+import com.intellij.openapi.project.ProjectManager;
+import com.intellij.openapi.projectRoots.ProjectJdkTable;
 import com.intellij.openapi.projectRoots.Sdk;
 import com.intellij.openapi.projectRoots.SdkType;
 import com.intellij.openapi.projectRoots.SdkTypeId;
+import com.intellij.openapi.roots.ProjectRootManager;
 import com.intellij.openapi.roots.ui.configuration.projectRoot.JdkListConfigurable;
 import com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel;
 import com.intellij.openapi.ui.ComboBoxWithWidePopup;
@@ -57,6 +63,7 @@ public class JdkComboBox extends ComboBoxWithWidePopup {
   private final Condition<SdkTypeId> myFilter;
   @Nullable
   private final Condition<SdkTypeId> myCreationFilter;
+  private JButton mySetUpButton;
 
   public JdkComboBox(@NotNull final ProjectSdksModel jdkModel) {
     this(jdkModel, null);
@@ -103,6 +110,57 @@ public class JdkComboBox extends ComboBoxWithWidePopup {
     });
   }
 
+  public static JdkComboBox createSdkComboBox(ModuleBuilder moduleBuilder,
+                                              Condition<SdkTypeId> sdkFilter,
+                                              Project project,
+                                              ProjectSdksModel model) {
+    final JdkComboBox comboBox = new JdkComboBox(model, sdkFilter);
+
+    final PropertiesComponent component = project == null ? PropertiesComponent.getInstance() : PropertiesComponent.getInstance(project);
+    ModuleType moduleType = moduleBuilder.getModuleType();
+    final String selectedJdkProperty = "jdk.selected." + (moduleType == null ? "" : moduleType.getId());
+    comboBox.addActionListener(new ActionListener() {
+      @Override
+      public void actionPerformed(ActionEvent e) {
+        Sdk jdk = comboBox.getSelectedJdk();
+        if (jdk != null) {
+          component.setValue(selectedJdkProperty, jdk.getName());
+        }
+      }
+    });
+
+    if (project != null) {
+      Sdk sdk = ProjectRootManager.getInstance(project).getProjectSdk();
+      if (sdk != null && moduleBuilder.isSuitableSdkType(sdk.getSdkType())) {
+        // use project SDK
+        return null;
+      }
+    }
+    else  {
+      // set default project SDK
+      Project defaultProject = ProjectManager.getInstance().getDefaultProject();
+      Sdk sdk = ProjectRootManager.getInstance(defaultProject).getProjectSdk();
+      if (sdk != null && sdkFilter.value(sdk.getSdkType())) {
+        comboBox.setSelectedJdk(sdk);
+      }
+    }
+
+    String value = component.getValue(selectedJdkProperty);
+    if (value != null) {
+      Sdk jdk = ProjectJdkTable.getInstance().findJdk(value);
+      if (jdk != null) {
+        comboBox.setSelectedJdk(jdk);
+      }
+    }
+
+    JButton button = new JButton("Ne\u001Bw...");
+    comboBox.setSetupButton(button, project, model,
+                                 project == null ? new NoneJdkComboBoxItem() : new ProjectJdkComboBoxItem(),
+                                 null,
+                                 false);
+    return comboBox;
+  }
+
   @Override
   public Dimension getPreferredSize() {
     final Rectangle rec = ScreenUtil.getScreenRectangle(0, 0);
@@ -140,7 +198,9 @@ public class JdkComboBox extends ComboBoxWithWidePopup {
                                 final JdkComboBoxItem firstItem,
                                 @Nullable final Condition<Sdk> additionalSetup,
                                 final String actionGroupTitle) {
-    setUpButton.addActionListener(new ActionListener() {
+
+    mySetUpButton = setUpButton;
+    mySetUpButton.addActionListener(new ActionListener() {
       @Override
       public void actionPerformed(ActionEvent e) {
         DefaultActionGroup group = new DefaultActionGroup();
@@ -199,6 +259,10 @@ public class JdkComboBox extends ComboBoxWithWidePopup {
     });
   }
 
+  public JButton getSetUpButton() {
+    return mySetUpButton;
+  }
+
   @Override
   public JdkComboBoxItem getSelectedItem() {
     return (JdkComboBoxItem)super.getSelectedItem();
index c7d85704b95d5c1716e044adedeb7dd8843793a8..33445bdda9bc83bea285920ecedf809c943d2dbd 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigur
 import com.intellij.openapi.ui.ComboBox;
 import com.intellij.util.ui.FormBuilder;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import java.util.List;
@@ -92,4 +93,10 @@ public class CreateNewLibraryDialog extends LibraryEditorDialogBase {
   protected boolean shouldCheckName(String newName) {
     return true;
   }
+
+  @Nullable
+  @Override
+  protected String getHelpId() {
+    return "Create_Library_dialog";
+  }
 }
index 57239382c2103994c92217af2152dff6ffadc65f..040ad01f562d84648343c8e3aa593493506ffe90 100644 (file)
@@ -98,6 +98,12 @@ public class EditExistingLibraryDialog extends LibraryEditorDialogBase {
     return myTableModifiableModel;
   }
 
+  @Nullable
+  @Override
+  protected String getHelpId() {
+    return "Configure_Library_Dialog";
+  }
+
   @Override
   protected boolean shouldCheckName(String newName) {
     return !Comparing.equal(newName, getLibraryRootsComponent().getLibraryEditor().getName());
index 052a1176dfddf26c149d33e406299cf62aa10b7e..163ca42881323172a3b8bbf19872619dacb5c32a 100644 (file)
@@ -228,21 +228,13 @@ public class HighlightClassUtil {
   }
 
   @Nullable
-  static HighlightInfo checkPublicClassInRightFile(PsiKeyword keyword, PsiModifierList psiModifierList) {
-    // most test case classes are located in wrong files
+  static HighlightInfo checkPublicClassInRightFile(PsiClass aClass) {
+        // most test case classes are located in wrong files
     if (ApplicationManager.getApplication().isUnitTestMode()) return null;
 
-    if (new PsiMatcherImpl(keyword)
-      .dot(PsiMatchers.hasText(PsiModifier.PUBLIC))
-      .parent(PsiMatchers.hasClass(PsiModifierList.class))
-      .parent(PsiMatchers.hasClass(PsiClass.class))
-      .parent(PsiMatchers.hasClass(PsiJavaFile.class))
-      .getElement() == null) {
-      return null;
-    }
-
-    PsiClass aClass = (PsiClass)keyword.getParent().getParent();
-    PsiJavaFile file = (PsiJavaFile)aClass.getContainingFile();
+    PsiFile containingFile = aClass.getContainingFile();
+    if (aClass.getParent() != containingFile || !aClass.hasModifierProperty(PsiModifier.PUBLIC) || !(containingFile instanceof PsiJavaFile)) return null;
+    PsiJavaFile file = (PsiJavaFile)containingFile;
     VirtualFile virtualFile = file.getVirtualFile();
     HighlightInfo errorResult = null;
     if (virtualFile != null && !aClass.getName().equals(virtualFile.getNameWithoutExtension())) {
@@ -251,6 +243,7 @@ public class HighlightClassUtil {
       errorResult = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).
         range(aClass, range.getStartOffset(), range.getEndOffset()).
         descriptionAndTooltip(message).create();
+      PsiModifierList psiModifierList = aClass.getModifierList();
       QuickFixAction.registerQuickFixAction(errorResult,
                                             QUICK_FIX_FACTORY.createModifierListFix(psiModifierList, PsiModifier.PUBLIC, false, false));
       PsiClass[] classes = file.getClasses();
index 6f2af69a8f4cbb1c67b63e6a224fff4742545c2d..b6b13653003228ce330e72f6851aca3e84aab0be 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -248,6 +248,7 @@ public class HighlightNamesUtil {
     return result;
   }
 
+  @NotNull
   public static TextRange getMethodDeclarationTextRange(@NotNull PsiMethod method) {
     if (method instanceof SyntheticElement) return TextRange.EMPTY_RANGE;
     int start = stripAnnotationsFromModifierList(method.getModifierList());
@@ -257,12 +258,14 @@ public class HighlightNamesUtil {
     return new TextRange(start, end);
   }
 
+  @NotNull
   public static TextRange getFieldDeclarationTextRange(@NotNull PsiField field) {
     int start = stripAnnotationsFromModifierList(field.getModifierList());
     int end = field.getNameIdentifier().getTextRange().getEndOffset();
     return new TextRange(start, end);
   }
 
+  @NotNull
   public static TextRange getClassDeclarationTextRange(@NotNull PsiClass aClass) {
     if (aClass instanceof PsiEnumConstantInitializer) {
       return ((PsiEnumConstantInitializer)aClass).getEnumConstant().getNameIdentifier().getTextRange();
index c6282959300d8dac38ddab7d4034ce1a05b37bee..bf9f3e085ef517724e95b5e1dd0479d28b21a8be 100644 (file)
@@ -394,6 +394,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
     if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkEnumMustNotBeLocal(aClass));
     if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkImplicitThisReferenceBeforeSuper(aClass, myJavaSdkVersion));
     if (!myHolder.hasErrorResults()) myHolder.add(HighlightClassUtil.checkClassAndPackageConflict(aClass));
+    if (!myHolder.hasErrorResults()) myHolder.add(HighlightClassUtil.checkPublicClassInRightFile(aClass));
   }
 
   @Override
@@ -713,7 +714,6 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
       PsiModifierList psiModifierList = (PsiModifierList)parent;
       if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkNotAllowedModifier(keyword, psiModifierList));
       if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkIllegalModifierCombination(keyword, psiModifierList));
-      if (!myHolder.hasErrorResults()) myHolder.add(HighlightClassUtil.checkPublicClassInRightFile(keyword, psiModifierList));
       if (PsiModifier.ABSTRACT.equals(text) && psiModifierList.getParent() instanceof PsiMethod) {
         if (!myHolder.hasErrorResults()) {
           myHolder.add(HighlightMethodUtil.checkAbstractMethodInConcreteClass((PsiMethod)psiModifierList.getParent(), keyword));
index ca84c57baf8214f94ba7182301d6eaeff43aad37..6fa0e1e62416f3f989e7043f81609dbf16e576c1 100644 (file)
@@ -57,7 +57,7 @@ public class LibrariesHelperImpl extends LibrariesHelper {
       VirtualFile file = VirtualFileManager.getInstance().findFileByUrl(url);
       if (file == null) continue;
       if (!(file.getFileSystem() instanceof JarFileSystem) && !file.isDirectory()) {
-        file = JarFileSystem.getInstance().findFileByPath(file.getPath() + JarFileSystem.JAR_SEPARATOR);
+        file = JarFileSystem.getInstance().getJarRootForLocalFile(file);
       }
       if (file == null) continue;
       if (findInFile(file, new StringTokenizer(fqn, "."))) return true;
diff --git a/java/java-impl/src/com/intellij/pom/java/impl/PomJavaAspectImpl.java b/java/java-impl/src/com/intellij/pom/java/impl/PomJavaAspectImpl.java
deleted file mode 100644 (file)
index 6d1c807..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2000-2009 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.pom.java.impl;
-
-import com.intellij.lang.java.JavaLanguage;
-import com.intellij.openapi.roots.LanguageLevelProjectExtension;
-import com.intellij.pom.PomModel;
-import com.intellij.pom.PomModelAspect;
-import com.intellij.pom.event.PomModelEvent;
-import com.intellij.pom.java.LanguageLevel;
-import com.intellij.pom.java.PomJavaAspect;
-import com.intellij.pom.java.events.PomJavaAspectChangeSet;
-import com.intellij.pom.tree.TreeAspect;
-import com.intellij.pom.tree.events.TreeChangeEvent;
-import com.intellij.psi.PsiFile;
-import com.intellij.psi.PsiManager;
-
-import java.util.Collections;
-
-public class PomJavaAspectImpl extends PomJavaAspect {
-  private final PsiManager myPsiManager;
-  private final PomModel myPomModel;
-
-  public PomJavaAspectImpl(PsiManager psiManager, TreeAspect treeAspect, PomModel pomModel) {
-    myPsiManager = psiManager;
-    myPomModel = pomModel;
-    pomModel.registerAspect(PomJavaAspect.class, this, Collections.singleton((PomModelAspect)treeAspect));
-  }
-
-  public LanguageLevel getLanguageLevel() {
-    return LanguageLevelProjectExtension.getInstance(myPsiManager.getProject()).getLanguageLevel();
-  }
-
-  public void update(PomModelEvent event) {
-    final TreeChangeEvent changeSet = (TreeChangeEvent)event.getChangeSet(myPomModel.getModelAspect(TreeAspect.class));
-    if(changeSet == null) return;
-    final PsiFile containingFile = changeSet.getRootElement().getPsi().getContainingFile();
-    if(!(containingFile.getLanguage() instanceof JavaLanguage)) return;
-    final PomJavaAspectChangeSet set = new PomJavaAspectChangeSet(myPomModel);
-    event.registerChangeSet(this, set);
-  }
-}
index ef151963c2f79275e539d7909d3594fa1d8d05ce..ca9d77d0f6b0b2108e7f49933db9744a85c5c498 100644 (file)
 
 package com.intellij.psi.impl.file.impl;
 
-import com.intellij.AppTopics;
-import com.intellij.openapi.fileEditor.FileDocumentManagerAdapter;
-import com.intellij.openapi.roots.*;
+import com.intellij.ide.startup.StartupManagerEx;
+import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.roots.ProjectRootManager;
 import com.intellij.openapi.startup.StartupManager;
-import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.impl.PsiManagerEx;
 import com.intellij.util.messages.MessageBus;
-import org.jetbrains.annotations.NotNull;
 
 /**
  * @author max
  */
 public class JavaFileManagerImpl extends JavaFileManagerBase {
 
-
   public JavaFileManagerImpl(final PsiManagerEx manager, final ProjectRootManager projectRootManager, MessageBus bus,
                              final StartupManager startupManager) {
     super(manager, projectRootManager, bus);
 
-    myConnection.subscribe(AppTopics.FILE_DOCUMENT_SYNC, new FileDocumentManagerAdapter() {
-      @Override
-      public void fileWithNoDocumentChanged(@NotNull final VirtualFile file) {
-        clearNonRepositoryMaps();
-      }
-    });
-    
-
-
-    startupManager.registerStartupActivity(
-      new Runnable() {
-        @Override
-        public void run() {
-          initialize();
-        }
-      }
-    );
-
+    if (!((StartupManagerEx)startupManager).startupActivityPassed() && 
+        !ApplicationManager.getApplication().isUnitTestMode() && 
+        !manager.getProject().isDefault()) {
+      Logger.getInstance("#com.intellij.psi.impl.file.impl.JavaFileManagerImpl")
+        .error("Access to psi files should be performed only after startup activity");
+    }
   }
 }
index e5e7741f3d7253a4633588d0c4b60d3257beffe7..10d4584be81d2e84f8a85d0013784d56c3ed64a7 100644 (file)
@@ -1005,7 +1005,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
   }
 
   private boolean isIdentifier(String name) {
-    return JavaPsiFacade.getInstance(myProject).getNameHelper().isIdentifier(name, LanguageLevel.HIGHEST);
+    return PsiNameHelper.getInstance(myProject).isIdentifier(name, LanguageLevel.HIGHEST);
   }
 
   private CodeStyleSettings getSettings() {
index 8bdcddbc44ad66df158f4ca1a86a872a27c34236..427e669d06d2c9de13c63812f92a4122d8bed17c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -23,6 +23,7 @@ import com.intellij.openapi.ui.Splitter;
 import com.intellij.openapi.util.Disposer;
 import com.intellij.psi.PsiSubstitutor;
 import com.intellij.psi.util.PsiFormatUtil;
+import com.intellij.psi.util.PsiFormatUtilBase;
 import com.intellij.refactoring.HelpID;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteOverridingMethodUsageInfo;
@@ -30,6 +31,7 @@ import com.intellij.ui.BooleanTableCellRenderer;
 import com.intellij.ui.ScrollPaneFactory;
 import com.intellij.ui.TableUtil;
 import com.intellij.usageView.UsageInfo;
+import com.intellij.usages.UsageViewPresentation;
 import com.intellij.usages.impl.UsagePreviewPanel;
 import com.intellij.util.ui.Table;
 import org.jetbrains.annotations.NonNls;
@@ -72,12 +74,12 @@ class OverridingMethodsDialog extends DialogWrapper {
     for (int i = 0; i < myMethodText.length; i++) {
       myMethodText[i] = PsiFormatUtil.formatMethod(
               ((SafeDeleteOverridingMethodUsageInfo) myOverridingMethods.get(i)).getOverridingMethod(),
-              PsiSubstitutor.EMPTY, PsiFormatUtil.SHOW_CONTAINING_CLASS
-                                    | PsiFormatUtil.SHOW_NAME | PsiFormatUtil.SHOW_PARAMETERS | PsiFormatUtil.SHOW_TYPE,
-              PsiFormatUtil.SHOW_TYPE
+              PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_CONTAINING_CLASS
+                                    | PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS | PsiFormatUtilBase.SHOW_TYPE,
+              PsiFormatUtilBase.SHOW_TYPE
       );
     }
-    myUsagePreviewPanel = new UsagePreviewPanel(project);
+    myUsagePreviewPanel = new UsagePreviewPanel(project, new UsageViewPresentation());
     setTitle(RefactoringBundle.message("unused.overriding.methods.title"));
     init();
   }
index 09f90e409d24adbc3a576dbb77844bb8454bdb7c..4c7866edd361a9834c301eac73a02228a36faad5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -37,6 +37,7 @@ import com.intellij.ui.treeStructure.Tree;
 import com.intellij.usageView.UsageInfo;
 import com.intellij.usageView.UsageViewBundle;
 import com.intellij.usages.Usage;
+import com.intellij.usages.UsageViewPresentation;
 import com.intellij.usages.UsageViewSettings;
 import com.intellij.usages.impl.UsagePreviewPanel;
 import com.intellij.util.EditSourceOnDoubleClickHandler;
@@ -156,7 +157,7 @@ public abstract class SlicePanel extends JPanel implements TypeSafeDataProvider,
       boolean vertical = myToolWindow.getAnchor() == ToolWindowAnchor.LEFT || myToolWindow.getAnchor() == ToolWindowAnchor.RIGHT;
       Splitter splitter = new Splitter(vertical, UsageViewSettings.getInstance().PREVIEW_USAGES_SPLITTER_PROPORTIONS);
       splitter.setFirstComponent(pane);
-      myUsagePreviewPanel = new UsagePreviewPanel(myProject);
+      myUsagePreviewPanel = new UsagePreviewPanel(myProject, new UsageViewPresentation());
       myUsagePreviewPanel.setBorder(IdeBorderFactory.createBorder(SideBorder.LEFT));
 
       Disposer.register(this, myUsagePreviewPanel);
index 1896243bc6e81ef44b335995cbdf8ad51abdc7a1..bce3bf4e9f1c5b50e68f10d961ac06fe7f18c97e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -19,6 +19,7 @@ package com.intellij.usageView;
 import com.intellij.openapi.project.Project;
 import com.intellij.usages.UsageContextPanel;
 import com.intellij.usages.UsageView;
+import com.intellij.usages.UsageViewPresentation;
 import com.intellij.usages.impl.UsageViewImpl;
 import org.jetbrains.annotations.NotNull;
 
@@ -27,7 +28,7 @@ public class UsageContextDataflowFromPanel extends UsageContextDataflowToPanel {
     @NotNull
     @Override
     public UsageContextPanel create(@NotNull UsageView usageView) {
-      return new UsageContextDataflowFromPanel(((UsageViewImpl)usageView).getProject());
+      return new UsageContextDataflowFromPanel(((UsageViewImpl)usageView).getProject(), usageView.getPresentation());
     }
 
     @NotNull
@@ -37,8 +38,8 @@ public class UsageContextDataflowFromPanel extends UsageContextDataflowToPanel {
     }
   }
 
-  public UsageContextDataflowFromPanel(@NotNull Project project) {
-    super(project);
+  public UsageContextDataflowFromPanel(@NotNull Project project, @NotNull UsageViewPresentation presentation) {
+    super(project, presentation);
   }
 
 
index de31282b0ccac4f92138979133311068a7c491f0..38804dda305162e4164abfd7a98fd15a9e51a361 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -28,10 +28,7 @@ import com.intellij.psi.PsiFile;
 import com.intellij.psi.PsiJavaFile;
 import com.intellij.psi.PsiVariable;
 import com.intellij.slicer.*;
-import com.intellij.usages.PsiElementUsageTarget;
-import com.intellij.usages.UsageContextPanel;
-import com.intellij.usages.UsageTarget;
-import com.intellij.usages.UsageView;
+import com.intellij.usages.*;
 import com.intellij.usages.impl.UsageContextPanelBase;
 import com.intellij.usages.impl.UsageViewImpl;
 import org.jetbrains.annotations.NotNull;
@@ -42,13 +39,14 @@ import java.awt.*;
 import java.util.List;
 
 public class UsageContextDataflowToPanel extends UsageContextPanelBase {
+  @NotNull private final UsageViewPresentation myPresentation;
   private JComponent myPanel;
 
   public static class Provider implements UsageContextPanel.Provider {
     @NotNull
     @Override
     public UsageContextPanel create(@NotNull UsageView usageView) {
-      return new UsageContextDataflowToPanel(((UsageViewImpl)usageView).getProject());
+      return new UsageContextDataflowToPanel(((UsageViewImpl)usageView).getProject(), usageView.getPresentation());
     }
 
     @Override
@@ -70,8 +68,9 @@ public class UsageContextDataflowToPanel extends UsageContextPanelBase {
     }
   }
 
-  public UsageContextDataflowToPanel(@NotNull Project project) {
-    super(project);
+  public UsageContextDataflowToPanel(@NotNull Project project, @NotNull UsageViewPresentation presentation) {
+    super(project, presentation);
+    myPresentation = presentation;
   }
 
   @Override
@@ -84,7 +83,7 @@ public class UsageContextDataflowToPanel extends UsageContextPanelBase {
   public void updateLayoutLater(@Nullable final List<UsageInfo> infos) {
     if (infos == null) {
       removeAll();
-      JComponent titleComp = new JLabel(UsageViewBundle.message("select.the.usage.to.preview"), SwingConstants.CENTER);
+      JComponent titleComp = new JLabel(UsageViewBundle.message("select.the.usage.to.preview", myPresentation.getUsagesWord()), SwingConstants.CENTER);
       add(titleComp, BorderLayout.CENTER);
       revalidate();
     }
index 1637d2b825a33f9e4be29fb1832e68add019eb52..b41b36311a2acb30023556e6d017523d6db008f4 100644 (file)
@@ -21,12 +21,8 @@ import com.intellij.openapi.Disposable;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.roots.*;
 import com.intellij.openapi.util.Comparing;
-import com.intellij.openapi.util.Disposer;
 import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.openapi.vfs.VirtualFileManager;
 import com.intellij.openapi.vfs.VirtualFileWithId;
-import com.intellij.openapi.vfs.newvfs.BulkFileListener;
-import com.intellij.openapi.vfs.newvfs.events.VFileEvent;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.PsiManagerEx;
 import com.intellij.psi.impl.file.PsiPackageImpl;
@@ -38,7 +34,6 @@ import com.intellij.util.containers.ConcurrentHashMap;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.messages.MessageBus;
 import com.intellij.util.messages.MessageBusConnection;
-import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.jps.model.java.JavaModuleSourceRootTypes;
@@ -50,16 +45,10 @@ import java.util.*;
  */
 public abstract class JavaFileManagerBase implements JavaFileManager, Disposable {
   private static final Logger LOG = Logger.getInstance("#com.intellij.psi.impl.file.impl.JavaFileManagerImpl");
-  @NonNls private static final String JAVA_EXTENSION = ".java";
-  @NonNls private static final String CLASS_EXTENSION = ".class";
   private final ConcurrentHashMap<GlobalSearchScope, PsiClass> myCachedObjectClassMap = new ConcurrentHashMap<GlobalSearchScope, PsiClass>();
-  private final Map<String,PsiClass> myNameToClassMap = new ConcurrentHashMap<String, PsiClass>(); // used only in mode without repository
   private final PsiManagerEx myManager;
   private final ProjectRootManager myProjectRootManager;
-  private final FileManager myFileManager;
-  private final boolean myUseRepository;
-  private Set<String> myNontrivialPackagePrefixes = null;
-  private boolean myInitialized = false;
+  private volatile Set<String> myNontrivialPackagePrefixes = null;
   private boolean myDisposed = false;
   private final PackageIndex myPackageIndex;
   protected final MessageBusConnection myConnection;
@@ -68,28 +57,13 @@ public abstract class JavaFileManagerBase implements JavaFileManager, Disposable
     final PsiManagerEx manager, final ProjectRootManager projectRootManager,
     final MessageBus bus) {
     myManager = manager;
-    myFileManager = manager.getFileManager();
     myProjectRootManager = projectRootManager;
-    myUseRepository = true;
     myPackageIndex = PackageIndex.getInstance(myManager.getProject());
     myConnection = bus.connect();
     myConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
       @Override
       public void rootsChanged(final ModuleRootEvent event) {
         myNontrivialPackagePrefixes = null;
-        clearNonRepositoryMaps();
-      }
-    });
-
-    myConnection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() {
-      @Override
-      public void before(@NotNull final List<? extends VFileEvent> events) {
-        clearNonRepositoryMaps();
-      }
-
-      @Override
-      public void after(@NotNull final List<? extends VFileEvent> events) {
-        clearNonRepositoryMaps();
       }
     });
 
@@ -99,13 +73,6 @@ public abstract class JavaFileManagerBase implements JavaFileManager, Disposable
         myCachedObjectClassMap.clear();
       }
     });
-
-    Disposer.register(myManager.getProject(), this);
-  }
-
-  @Override
-  public void initialize() {
-    myInitialized = true;
   }
 
   @Override
@@ -114,12 +81,6 @@ public abstract class JavaFileManagerBase implements JavaFileManager, Disposable
     myCachedObjectClassMap.clear();
   }
 
-  protected void clearNonRepositoryMaps() {
-    if (!myUseRepository) {
-      myNameToClassMap.clear();
-    }
-  }
-
   @Override
   @Nullable
   public PsiPackage findPackage(@NotNull String packageName) {
@@ -169,14 +130,6 @@ public abstract class JavaFileManagerBase implements JavaFileManager, Disposable
   @Override
   @Nullable
   public PsiClass findClass(@NotNull String qName, @NotNull GlobalSearchScope scope) {
-    if (!myUseRepository) {
-      return findClassWithoutRepository(qName);
-    }
-
-    if (!myInitialized) {
-      LOG.error("Access to psi files should be performed only after startup activity");
-      return null;
-    }
     LOG.assertTrue(!myDisposed);
 
     if (CommonClassNames.JAVA_LANG_OBJECT.equals(qName)) { // optimization
@@ -194,89 +147,6 @@ public abstract class JavaFileManagerBase implements JavaFileManager, Disposable
     return findClassInIndex(qName, scope);
   }
 
-  @Nullable
-  private PsiClass findClassWithoutRepository(String qName) {
-    PsiClass aClass = myNameToClassMap.get(qName);
-    if (aClass != null) {
-      return aClass;
-    }
-
-    aClass = _findClassWithoutRepository(qName);
-    myNameToClassMap.put(qName, aClass);
-    return aClass;
-  }
-
-  @Nullable
-  private PsiClass _findClassWithoutRepository(String qName) {
-    VirtualFile[] sourcePath = myProjectRootManager.orderEntries().sources().usingCache().getRoots();
-    VirtualFile[] classPath = myProjectRootManager.orderEntries().withoutModuleSourceEntries().classes().usingCache().getRoots();
-
-    int index = 0;
-    while (index < qName.length()) {
-      int index1 = qName.indexOf('.', index);
-      if (index1 < 0) {
-        index1 = qName.length();
-      }
-      String name = qName.substring(index, index1);
-
-      final int sourceType = 0;
-      //final int compiledType = 1;
-
-      for (int type = 0; type < 2; type++) {
-        VirtualFile[] vDirs = type == sourceType ? sourcePath : classPath;
-        for (VirtualFile vDir : vDirs) {
-          if (vDir != null) {
-            VirtualFile vChild = type == sourceType
-                                 ? vDir.findChild(name + JAVA_EXTENSION)
-                                 : vDir.findChild(name + CLASS_EXTENSION);
-            if (vChild != null) {
-              PsiFile file = myFileManager.findFile(vChild);
-              if (file instanceof PsiJavaFile) {
-                PsiClass aClass = findClassByName((PsiJavaFile)file, name);
-                if (aClass != null) {
-                  index = index1 + 1;
-                  while (index < qName.length()) {
-                    index1 = qName.indexOf('.', index);
-                    if (index1 < 0) {
-                      index1 = qName.length();
-                    }
-                    name = qName.substring(index, index1);
-                    aClass = findClassByName(aClass, name);
-                    if (aClass == null) return null;
-                    index = index1 + 1;
-                  }
-                  return aClass;
-                }
-              }
-            }
-          }
-        }
-      }
-
-      boolean existsDir = false;
-      for (int type = 0; type < 2; type++) {
-        VirtualFile[] vDirs = type == sourceType ? sourcePath : classPath;
-        for (int i = 0; i < vDirs.length; i++) {
-          if (vDirs[i] != null) {
-            VirtualFile vDirChild = vDirs[i].findChild(name);
-            if (vDirChild != null) {
-              PsiDirectory dir = myFileManager.findDirectory(vDirChild);
-              if (dir != null) {
-                vDirs[i] = vDirChild;
-                existsDir = true;
-                continue;
-              }
-            }
-            vDirs[i] = null;
-          }
-        }
-      }
-      if (!existsDir) return null;
-      index = index1 + 1;
-    }
-    return null;
-  }
-
   @Nullable
   private PsiClass findClassInIndex(String qName, GlobalSearchScope scope) {
     VirtualFile bestFile = null;
@@ -347,25 +217,4 @@ public abstract class JavaFileManagerBase implements JavaFileManager, Disposable
     return myNontrivialPackagePrefixes;
   }
 
-  @Nullable
-  private static PsiClass findClassByName(PsiJavaFile scope, String name) {
-    PsiClass[] classes = scope.getClasses();
-    for (PsiClass aClass : classes) {
-      if (name.equals(aClass.getName())) {
-        return aClass;
-      }
-    }
-    return null;
-  }
-
-  @Nullable
-  private static PsiClass findClassByName(PsiClass scope, String name) {
-    PsiClass[] classes = scope.getInnerClasses();
-    for (PsiClass aClass : classes) {
-      if (name.equals(aClass.getName())) {
-        return aClass;
-      }
-    }
-    return null;
-  }
 }
index 3b4f9a2147035c234e5213c7f59affe7510ddeb0..72e37a2e254a93bcbe69d3e58294b24ca7903e54 100644 (file)
@@ -101,6 +101,7 @@ public abstract class JavaPsiFacade {
    * Returns the name helper for the project, which can be used to validate
    * and parse Java identifiers.
    *
+   * @deprecated use {@link com.intellij.psi.PsiNameHelper#getInstance(com.intellij.openapi.project.Project)}
    * @return the name helper instance.
    */
   @NotNull
index 4291ee79d432329d470c48dbcbf52976f00b4691..6ae0fa6a081fe79d4311f5a49df869f107b4d88a 100644 (file)
@@ -15,6 +15,8 @@
  */
 package com.intellij.psi;
 
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
 import com.intellij.pom.java.LanguageLevel;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.ArrayUtil;
@@ -31,6 +33,11 @@ import static com.intellij.util.ObjectUtils.notNull;
  * @see com.intellij.psi.JavaPsiFacade#getNameHelper()
  */
 public abstract class PsiNameHelper {
+
+  public static PsiNameHelper getInstance(Project project) {
+    return ServiceManager.getService(project, PsiNameHelper.class);
+  }
+  
   /**
    * Checks if the specified text is a Java identifier, using the language level of the project
    * with which the name helper is associated to filter out keywords.
index f769a60876cad1bd13f76dc62287111e01b3effc..a012988edf084f274e0f8608c5c6dda003ff71dc 100644 (file)
@@ -198,10 +198,6 @@ public class CoreJavaFileManager implements JavaFileManager {
     return Collections.emptyList();
   }
 
-  @Override
-  public void initialize() {
-  }
-
   public void addToClasspath(VirtualFile root) {
     myClasspath.add(root);
   }
index 6f83e69baa5e531d82705edcd53f62fae7f742db..bc55d334f0ab7c482cc873f47f1de1d35fdbef14 100644 (file)
@@ -59,7 +59,6 @@ public class JavaCoreProjectEnvironment  extends CoreProjectEnvironment {
     myProject.registerService(JavaFileManager.class, myFileManager);
 
     JavaPsiFacadeImpl javaPsiFacade = new JavaPsiFacadeImpl(myProject, myPsiManager, myFileManager, myMessageBus);
-    registerProjectComponent(JavaPsiFacade.class, javaPsiFacade);
     myProject.registerService(JavaPsiFacade.class, javaPsiFacade);
   }
 
index 904ae5fb9aec034ec1dcbc14449ce9a7af4ae54a..2ba1906c422c9e0d6c754a01a26d0a219e9edd07 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -29,6 +29,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.NotNullLazyKey;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.impl.PsiManagerEx;
+import com.intellij.util.containers.ConcurrentList;
 import com.intellij.util.containers.ConcurrentWeakHashMap;
 import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
@@ -36,11 +37,10 @@ import org.jetbrains.annotations.NotNull;
 import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 import java.util.concurrent.ConcurrentMap;
-import java.util.concurrent.CopyOnWriteArrayList;
 
 public class ControlFlowFactory {
   // psiElements hold weakly, controlFlows softly
-  private final ConcurrentMap<PsiElement, Reference<CopyOnWriteArrayList<ControlFlowContext>>> cachedFlows = new ConcurrentWeakHashMap<PsiElement, Reference<CopyOnWriteArrayList<ControlFlowContext>>>();
+  private final ConcurrentMap<PsiElement, Reference<ConcurrentList<ControlFlowContext>>> cachedFlows = new ConcurrentWeakHashMap<PsiElement, Reference<ConcurrentList<ControlFlowContext>>>();
 
   private static final NotNullLazyKey<ControlFlowFactory, Project> INSTANCE_KEY = ServiceManager.createLazyKey(ControlFlowFactory.class);
 
@@ -127,7 +127,7 @@ public class ControlFlowFactory {
                                     boolean enableShortCircuit,
                                     boolean evaluateConstantIfCondition) throws AnalysisCanceledException {
     final long modificationCount = element.getManager().getModificationTracker().getModificationCount();
-    CopyOnWriteArrayList<ControlFlowContext> cached = getOrCreateCachedFlowsForElement(element);
+    ConcurrentList<ControlFlowContext> cached = getOrCreateCachedFlowsForElement(element);
     for (ControlFlowContext context : cached) {
       if (context.isFor(policy, evaluateConstantIfCondition,modificationCount)) return context.controlFlow;
     }
@@ -152,17 +152,17 @@ public class ControlFlowFactory {
     final long modificationCount = element.getManager().getModificationTracker().getModificationCount();
     ControlFlowContext controlFlowContext = createContext(evaluateConstantIfCondition, policy, flow, modificationCount);
 
-    CopyOnWriteArrayList<ControlFlowContext> cached = getOrCreateCachedFlowsForElement(element);
+    ConcurrentList<ControlFlowContext> cached = getOrCreateCachedFlowsForElement(element);
     cached.addIfAbsent(controlFlowContext);
   }
 
   @NotNull
-  private CopyOnWriteArrayList<ControlFlowContext> getOrCreateCachedFlowsForElement(@NotNull PsiElement element) {
-    Reference<CopyOnWriteArrayList<ControlFlowContext>> cachedRef = cachedFlows.get(element);
-    CopyOnWriteArrayList<ControlFlowContext> cached = com.intellij.reference.SoftReference.dereference(cachedRef);
+  private ConcurrentList<ControlFlowContext> getOrCreateCachedFlowsForElement(@NotNull PsiElement element) {
+    Reference<ConcurrentList<ControlFlowContext>> cachedRef = cachedFlows.get(element);
+    ConcurrentList<ControlFlowContext> cached = com.intellij.reference.SoftReference.dereference(cachedRef);
     if (cached == null) {
-      cached = ContainerUtil.createEmptyCOWList();
-      cachedFlows.put(element, new SoftReference<CopyOnWriteArrayList<ControlFlowContext>>(cached));
+      cached = ContainerUtil.createConcurrentList();
+      cachedFlows.put(element, new SoftReference<ConcurrentList<ControlFlowContext>>(cached));
     }
     return cached;
   }
index fc5ab3b02fd1d2d2e51519cf82ac02a9b84f7d2e..13ca6288f4a5d43c24cf49cd897d660861653d44 100644 (file)
@@ -58,7 +58,6 @@ import java.util.concurrent.ConcurrentMap;
  */
 public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
   private volatile PsiElementFinder[] myElementFinders;
-  private final PsiNameHelper myNameHelper;
   private final PsiConstantEvaluationHelper myConstantEvaluationHelper;
   private volatile SoftReference<ConcurrentMap<String, PsiPackage>> myPackageCache;
   private final Project myProject;
@@ -70,7 +69,6 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
                            MessageBus bus) {
     myProject = project;
     myFileManager = javaFileManager;
-    myNameHelper = new PsiNameHelperImpl(this);
     myConstantEvaluationHelper = new PsiConstantEvaluationHelperImpl();
 
     final PsiModificationTracker modificationTracker = psiManager.getModificationTracker();
@@ -223,7 +221,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
   @Override
   @NotNull
   public PsiNameHelper getNameHelper() {
-    return myNameHelper;
+    return PsiNameHelper.getInstance(myProject);
   }
 
   @NotNull
index 5d931e6b6d174290bc839757dc5fa605272ac4b0..702ed8e36e2087f825f09e66fac1722241519f67 100644 (file)
 package com.intellij.psi.impl;
 
 import com.intellij.lang.java.lexer.JavaLexer;
+import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.LanguageLevelProjectExtension;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.pom.java.LanguageLevel;
-import com.intellij.psi.JavaPsiFacade;
 import com.intellij.psi.PsiNameHelper;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -27,8 +27,8 @@ import org.jetbrains.annotations.Nullable;
 public class PsiNameHelperImpl extends PsiNameHelper {
   private final LanguageLevelProjectExtension myLanguageLevelExtension;
 
-  public PsiNameHelperImpl(JavaPsiFacade manager) {
-    myLanguageLevelExtension = LanguageLevelProjectExtension.getInstance(manager.getProject());
+  public PsiNameHelperImpl(Project project) {
+    myLanguageLevelExtension = LanguageLevelProjectExtension.getInstance(project);
   }
 
   @Override
index 7cab653e796be65be03e14c05d7abb4ce41969ea..599f756adbc1d5e8ecb32c897997cd66a615bdcb 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.openapi.util.NullableLazyValue;
 import com.intellij.openapi.util.VolatileNullableLazyValue;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.PsiImplUtil;
+import com.intellij.psi.impl.PsiJavaParserFacadeImpl;
 import com.intellij.psi.impl.cache.TypeInfo;
 import com.intellij.psi.impl.source.PsiClassReferenceType;
 import com.intellij.psi.impl.source.tree.JavaElementType;
@@ -136,7 +137,7 @@ public class ClsTypeElementImpl extends ClsElementImpl implements PsiTypeElement
   }
 
   private ClsElementImpl calculateChild() {
-    if (JavaPsiFacade.getInstance(getProject()).getElementFactory().createPrimitiveType(myTypeText) != null) {
+    if (PsiJavaParserFacadeImpl.getPrimitiveType(myTypeText) != null) {
       return null;
     }
     else if (isArray()) {
@@ -153,7 +154,7 @@ public class ClsTypeElementImpl extends ClsElementImpl implements PsiTypeElement
   }
 
   private PsiType calculateType() {
-    PsiType result = JavaPsiFacade.getInstance(getProject()).getElementFactory().createPrimitiveType(myTypeText);
+    PsiType result = PsiJavaParserFacadeImpl.getPrimitiveType(myTypeText);
     if (result != null) return result;
 
     ClsElementImpl childElement = myChild.getValue();
index 059fa741960c734019ead161bbc6e537404d0f96..fc883fe34b56ed3c1a9377e6d6ec09e29015f9ab 100644 (file)
@@ -38,5 +38,4 @@ public interface JavaFileManager {
 
   Collection<String> getNonTrivialPackagePrefixes();
 
-  void initialize();
 }
\ No newline at end of file
similarity index 51%
rename from java/openapi/src/com/intellij/pom/java/PomJavaAspect.java
rename to java/java-tests/testData/codeInsight/completion/methodChains/testArrayReturnType/TestCompletion.java
index 36e5eaf551de8595b6cc28698fced7162396ff23..40aae5d67b4e559dab1124f61eeb22e639d1f4cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.intellij.pom.java;
+import java.jang.String;
 
-import com.intellij.openapi.project.Project;
-import com.intellij.pom.PomModel;
-import com.intellij.pom.PomModelAspect;
+class PsiMethod {
+}
 
-public abstract class PomJavaAspect implements PomModelAspect {
-  public static PomJavaAspect getInstance(Project project) {
-    return project.getComponent(PomJavaAspect.class);
-  }
+interface PsiClass {
+  PsiMethod[] getMethods();
+}
 
-  public static PomJavaAspect getInstance(PomModel model) {
-    return model.getModelAspect(PomJavaAspect.class);
-  }
+public class TestCompletion {
 
-  public abstract LanguageLevel getLanguageLevel();
-}
\ No newline at end of file
+  PsiClass c;
+
+  public void method() {
+    PsiMethod[] m = <caret>
+  }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/methodChains/testArrayReturnType/TestIndex.java b/java/java-tests/testData/codeInsight/completion/methodChains/testArrayReturnType/TestIndex.java
new file mode 100644 (file)
index 0000000..9f9ce1a
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2000-2014 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.
+ */
+public class TestIndex {
+
+  public void statMethod(PsiClass c) {
+    c.getMethods();
+    c.getMethods();
+    c.getMethods();
+    c.getMethods();
+    c.getMethods();
+    c.getMethods();
+    c.getMethods();
+    c.getMethods();
+  }
+}
+
+class PsiMethod {
+}
+
+interface PsiClass {
+  PsiMethod[] getMethods();
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lossyEncoding/InconsistentLineSeparators.txt b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lossyEncoding/InconsistentLineSeparators.txt
new file mode 100644 (file)
index 0000000..1da43ef
--- /dev/null
@@ -0,0 +1,7 @@
+package temp.04
+
+class Book {
+
+    static constraints = {
+    }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lossyEncoding/Win1251.txt b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lossyEncoding/Win1251.txt
new file mode 100644 (file)
index 0000000..95c0901
--- /dev/null
@@ -0,0 +1 @@
+ÆÎÏ
index a733b8aba822acfb485fa7104acc76ce33ee7c3f..2a925bf18cd04c997600be642f7669ba58bfa7b9 100644 (file)
@@ -19,15 +19,16 @@ import com.intellij.openapi.compiler.CompilerMessage;
 import com.intellij.openapi.compiler.CompilerMessageCategory;
 import com.intellij.openapi.util.io.FileUtil;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiManager;
 import com.intellij.testFramework.CompilerTester;
 import com.intellij.testFramework.fixtures.JavaCodeInsightFixtureTestCase;
 import com.intellij.util.Function;
 import com.intellij.util.containers.ContainerUtil;
-import gnu.trove.TObjectIntHashMap;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.List;
 
 /**
  * @author Dmitry Batkovich
@@ -48,21 +49,16 @@ public abstract class AbstractCompilerAwareTest extends JavaCodeInsightFixtureTe
   }
 
   protected final void compileAndIndexData(final String... fileNames) {
-    final VirtualFile[] filesToCompile =
-      ContainerUtil.map2Array(ContainerUtil.list(fileNames), new VirtualFile[fileNames.length], new Function<String, VirtualFile>() {
-        @Override
-        public VirtualFile fun(final String fileName) {
-          try {
-            return myFixture.addFileToProject(fileName, FileUtil.loadFile(new File(getTestDataPath() + getName() + "/" + fileName)))
-              .getVirtualFile();
-          }
-          catch (final IOException e) {
-            throw new RuntimeException(e);
-          }
-        }
-      });
+    try {
+      for (String fileName : fileNames) {
+        myFixture.addFileToProject(fileName, FileUtil.loadFile(new File(getTestDataPath() + getName() + "/" + fileName))).getVirtualFile();
+      }
+    }
+    catch (IOException e) {
+      throw new RuntimeException(e);
+    }
     for (final CompilerMessage compilerMessage : myCompilerTester.rebuild()) {
-      assertNotSame(CompilerMessageCategory.ERROR, compilerMessage.getCategory());
+      assertNotSame(compilerMessage.getMessage(), CompilerMessageCategory.ERROR, compilerMessage.getCategory());
     }
   }
 }
index ad65d8b2a348e2b8a104565d752be54af4f260c4..903905eb5c3a4aef5b695e8cf172283c931ece7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -28,7 +28,11 @@ import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerEx;
 import com.intellij.codeInsight.daemon.impl.HighlightInfo;
 import com.intellij.codeInspection.LocalInspectionTool;
 import com.intellij.codeInspection.LossyEncodingInspection;
+import com.intellij.openapi.command.WriteCommandAction;
+import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
+import com.intellij.openapi.fileTypes.FileTypes;
+import com.intellij.openapi.fileTypes.StdFileTypes;
 import com.intellij.openapi.vfs.CharsetToolkit;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.vfs.encoding.EncodingManager;
@@ -41,7 +45,7 @@ import java.nio.charset.Charset;
 import java.util.Collection;
 import java.util.List;
 
-public class LossyEncodingTest extends LightDaemonAnalyzerTestCase {
+public class LossyEncodingTest extends DaemonAnalyzerTestCase {
   @NonNls private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/lossyEncoding";
 
   @NotNull
@@ -53,6 +57,7 @@ public class LossyEncodingTest extends LightDaemonAnalyzerTestCase {
   public void testText() throws Exception {
     doTest("Text.txt");
     Charset ascii = CharsetToolkit.forName("US-ASCII");
+    VirtualFile myVFile = myFile.getVirtualFile();
     EncodingManager.getInstance().setEncoding(myVFile, ascii);
     assertEquals(ascii, myVFile.getCharset());
     int start = myEditor.getCaretModel().getOffset();
@@ -68,11 +73,12 @@ public class LossyEncodingTest extends LightDaemonAnalyzerTestCase {
 
     backspace();
     backspace();
-    doTestConfiguredFile(true, false, null);
+
+    doDoTest(true, false);
   }
 
   public void testNativeConversion() throws Exception {
-    configureFromFileText("x.properties","a=<caret>v");
+    configureByText(StdFileTypes.PROPERTIES, "a=<caret>v");
     EncodingProjectManager.getInstance(getProject()).setNative2AsciiForPropertiesFiles(null, true);
     UIUtil.dispatchAllInvocationEvents();  //reload files
 
@@ -104,7 +110,7 @@ public class LossyEncodingTest extends LightDaemonAnalyzerTestCase {
     configureByFile(BASE_PATH + "/" + "MultipleRanges.xml");
     type("US-ASCII");
 
-    doTestConfiguredFile(true, false, null);
+    doDoTest(true, false);
   }
 
   private void doTest(@NonNls String filePath) throws Exception {
@@ -115,17 +121,28 @@ public class LossyEncodingTest extends LightDaemonAnalyzerTestCase {
     EncodingManager.getInstance().setNative2AsciiForPropertiesFiles(null, true);
     configureByFile(BASE_PATH + "/" + "NativeEncoding.properties");
 
-    doTestConfiguredFile(true, false, null);
+    doDoTest(true, false);
   }
 
-  public void testDetectWrongEncoding() throws Exception {
+  public void testDetectWrongEncoding0() throws Exception {
     String threeNotoriousRussianLetters = "\u0416\u041e\u041f";
-    configureFromFileText("Win1251.txt", threeNotoriousRussianLetters);
+    configureByText(FileTypes.PLAIN_TEXT, threeNotoriousRussianLetters);
     VirtualFile virtualFile = getFile().getVirtualFile();
+    final Document document = FileDocumentManager.getInstance().getDocument(virtualFile);
+    WriteCommandAction.runWriteCommandAction(getProject(), new Runnable() {
+      @Override
+      public void run() {
+        document.insertString(0, " ");
+        document.deleteString(0, 1);
+      }
+    });
+
+
+    assertTrue(FileDocumentManager.getInstance().isDocumentUnsaved(document));
     assertEquals(CharsetToolkit.UTF8_CHARSET, virtualFile.getCharset());
     Charset WINDOWS_1251 = Charset.forName("windows-1251");
     virtualFile.setCharset(WINDOWS_1251);
-    FileDocumentManager.getInstance().saveAllDocuments();
+    FileDocumentManager.getInstance().saveAllDocuments();  // save in wrong encoding
     assertEquals(WINDOWS_1251, virtualFile.getCharset());
     assertEquals(threeNotoriousRussianLetters, new String(virtualFile.contentsToByteArray(), WINDOWS_1251));
     virtualFile.setCharset(CharsetToolkit.UTF8_CHARSET);
@@ -135,4 +152,30 @@ public class LossyEncodingTest extends LightDaemonAnalyzerTestCase {
     HighlightInfo info = assertOneElement(infos);
     assertEquals("File was loaded in the wrong encoding: 'UTF-8'", info.getDescription());
   }
+
+  public void testDetectWrongEncoding() throws Exception {
+    VirtualFile virtualFile = getVirtualFile(BASE_PATH + "/" + "Win1251.txt");
+    virtualFile.setCharset(CharsetToolkit.UTF8_CHARSET);
+    configureByExistingFile(virtualFile);
+    final Document document = FileDocumentManager.getInstance().getDocument(virtualFile);
+
+    assertFalse(FileDocumentManager.getInstance().isDocumentUnsaved(document));
+    assertEquals(CharsetToolkit.UTF8_CHARSET, virtualFile.getCharset());
+
+    doHighlighting();
+    List<HighlightInfo> infos = DaemonCodeAnalyzerEx.getInstanceEx(getProject()).getFileLevelHighlights(getProject(), getFile());
+    HighlightInfo info = assertOneElement(infos);
+    assertEquals("File was loaded in the wrong encoding: 'UTF-8'", info.getDescription());
+  }
+
+  public void testInconsistentLineSeparators() throws Exception {
+    VirtualFile virtualFile = getVirtualFile(BASE_PATH + "/" + getTestName(false) + ".txt");
+    configureByExistingFile(virtualFile);
+    FileDocumentManager.getInstance().saveAllDocuments();
+    final Document document = FileDocumentManager.getInstance().getDocument(virtualFile);
+    assertFalse(FileDocumentManager.getInstance().isDocumentUnsaved(document));
+    doHighlighting();
+    List<HighlightInfo> infos = DaemonCodeAnalyzerEx.getInstanceEx(getProject()).getFileLevelHighlights(getProject(), getFile());
+    assertEmpty(infos);
+  }
 }
index fd68abd89066bab8d58780e005d9db4eea685b31..d0ab59b598d1e94ef5dad7ee8e83cf46bcb256b6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -30,6 +30,8 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.concurrent.atomic.AtomicReference;
@@ -73,7 +75,7 @@ public class JobUtilTest extends PlatformTestCase {
     return COUNT.incrementAndGet();
   }
 
-  public void testJobUtilFinishes() throws Exception {
+  public void testJobUtilCorrectlySplitsUpHugeWorkAndFinishes() throws Exception {
     COUNT.set(0);
     int N = 100000;
     List<String> list = Collections.nCopies(N, null);
@@ -259,7 +261,7 @@ public class JobUtilTest extends PlatformTestCase {
   public void testJobUtilRecursiveCancel() throws Exception {
     final List<String> list = Collections.nCopies(100, "");
     final List<Integer> ilist = Collections.nCopies(100, 0);
-    for (int i=0; i<1/*0*/; i++) {
+    for (int i=0; i<10; i++) {
       COUNT.set(0);
       long start = System.currentTimeMillis();
       boolean success = false;
@@ -277,7 +279,7 @@ public class JobUtilTest extends PlatformTestCase {
                 return true;
               }
             });
-            System.out.println("nestedSuccess = " + nestedSuccess);
+            //System.out.println("nestedSuccess = " + nestedSuccess);
             return true;
           }
         });
@@ -294,4 +296,35 @@ public class JobUtilTest extends PlatformTestCase {
       assertFalse(success);
     }
   }
+
+  public void testSaturation() throws InterruptedException {
+    final CountDownLatch latch = new CountDownLatch(1);
+    for (int i=0; i<100; i++) {
+      JobLauncher.getInstance().submitToJobThread(0, new Runnable() {
+        @Override
+        public void run() {
+          try {
+            latch.await();
+          }
+          catch (InterruptedException e) {
+            throw new RuntimeException(e);
+          }
+        }
+      });
+    }
+    JobLauncher.getInstance().submitToJobThread(0, new Runnable() {
+      @Override
+      public void run() {
+        latch.countDown();
+      }
+    });
+
+    try {
+      boolean scheduled = latch.await(3, TimeUnit.SECONDS);
+      assertFalse(scheduled); // pool saturated, no thread can be scheduled
+    }
+    finally {
+      latch.countDown();
+    }
+  }
 }
index 166652f4b08198424f96b6fd348ab96f2b24d756..1b116032002a0f6457d3293609b1a3d5a0f1a370 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 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.
@@ -21,7 +21,6 @@ import com.intellij.find.impl.FindInProjectUtil;
 import com.intellij.find.replaceInProject.ReplaceInProjectManager;
 import com.intellij.lang.properties.IProperty;
 import com.intellij.lang.properties.psi.PropertiesFile;
-import com.intellij.openapi.Disposable;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.application.ex.PathManagerEx;
 import com.intellij.openapi.command.CommandProcessor;
@@ -49,6 +48,7 @@ import com.intellij.util.ArrayUtil;
 import com.intellij.util.CommonProcessors;
 import com.intellij.util.ThrowableRunnable;
 import com.intellij.util.WaitFor;
+import org.jetbrains.annotations.NotNull;
 
 import java.io.File;
 import java.util.ArrayList;
@@ -185,11 +185,11 @@ public class FindManagerTest extends DaemonAnalyzerTestCase {
     assertEquals(expectedResults, usages.size());
   }
 
-  private List<UsageInfo> findUsages(final FindModel findModel) {
+  private List<UsageInfo> findUsages(@NotNull FindModel findModel) {
     PsiDirectory psiDirectory = FindInProjectUtil.getPsiDirectory(findModel, myProject);
     List<UsageInfo> result = new ArrayList<UsageInfo>();
     final CommonProcessors.CollectProcessor<UsageInfo> collector = new CommonProcessors.CollectProcessor<UsageInfo>(result);
-    FindInProjectUtil.findUsages(findModel, psiDirectory, myProject, true, collector, new FindUsagesProcessPresentation());
+    FindInProjectUtil.findUsages(findModel, psiDirectory, myProject, true, collector, new FindUsagesProcessPresentation(FindInProjectUtil.setupViewPresentation(true, findModel)));
     return result;
   }
 
index 29def05d4378ac1395b2ce6609181a9c5418cd18..7cbe2f678c98fdba65dd8c1c0052f34803a44190 100644 (file)
@@ -267,7 +267,7 @@ public class IndexTest extends IdeaTestCase {
     });
   }
 
-  public void _testSkipUnknownFileTypes() throws IOException {
+  public void testSkipUnknownFileTypes() throws IOException {
     VirtualFile dir = getVirtualFile(createTempDirectory());
     PsiTestUtil.addSourceContentToRoots(myModule, dir);
 
index 3184488e0a3380fbb1c72658d002e0ed2bd22846..655dc956c399d9af7eae682c1a1fa54e88f06f2a 100644 (file)
@@ -27,7 +27,6 @@ import com.intellij.openapi.roots.ModifiableRootModel;
 import com.intellij.openapi.roots.OrderRootType;
 import com.intellij.openapi.roots.libraries.Library;
 import com.intellij.openapi.roots.libraries.LibraryTable;
-import com.intellij.openapi.roots.ui.configuration.ModulesProvider;
 import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.util.io.FileUtil;
 import com.intellij.openapi.vfs.LocalFileSystem;
@@ -90,11 +89,6 @@ public class JavaModuleBuilder extends ModuleBuilder implements SourcePathsBuild
     return StdModuleTypes.JAVA.modifySettingsStep(settingsStep, this);
   }
 
-  @Override
-  public ModuleWizardStep[] createWizardSteps(@NotNull WizardContext wizardContext, @NotNull ModulesProvider modulesProvider) {
-    return getModuleType().createWizardSteps(wizardContext, this, modulesProvider);
-  }
-
   public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
     final CompilerModuleExtension compilerModuleExtension = rootModel.getModuleExtension(CompilerModuleExtension.class);
     compilerModuleExtension.setExcludeOutput(true);
index 9ea259faa7ff0e1176297b51f5e33079892ef916..aecd3d604678681ac325e679656485e416769d39 100644 (file)
@@ -42,10 +42,7 @@ import com.intellij.openapi.roots.ModuleRootManager;
 import com.intellij.openapi.util.Segment;
 import com.intellij.openapi.util.io.FileUtil;
 import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.LocalFileSystem;
-import com.intellij.openapi.vfs.VfsUtil;
-import com.intellij.openapi.vfs.VfsUtilCore;
-import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.openapi.vfs.*;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiFile;
@@ -155,6 +152,7 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
       }
       final VirtualFile vFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(tempFile);
       assert vFile != null;
+      vFile.setCharset(CharsetToolkit.UTF8_CHARSET);
       VfsUtil.saveText(vFile, text);
 
       final VirtualFile vdir = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(dir);
@@ -539,18 +537,12 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
         assertEquals("Text mismatch in file " + filePath, newFileText1, text);
 
         CaretModel caretModel = myEditor.getCaretModel();
-        List<Caret> allCarets = caretModel.supportsMultipleCarets() ? new ArrayList<Caret>(caretModel.getAllCarets()) : null;
-        assertEquals("Unexpected number of carets", caretState.carets.size(), caretModel.supportsMultipleCarets() ? allCarets.size() : 1);
+        List<Caret> allCarets = new ArrayList<Caret>(caretModel.getAllCarets());
+        assertEquals("Unexpected number of carets", caretState.carets.size(), allCarets.size());
         for (int i = 0; i < caretState.carets.size(); i++) {
-          String caretDescription = caretState.carets.size() == 1 ? "" : "caret " + i + "/" + caretState.carets.size() + " ";
-          Caret currentCaret = caretModel.supportsMultipleCarets() ? allCarets.get(i) : null;
-          LogicalPosition actualCaretPosition;
-          if (caretModel.supportsMultipleCarets()) {
-            actualCaretPosition = currentCaret.getLogicalPosition();
-          }
-          else {
-            actualCaretPosition = caretModel.getLogicalPosition();
-          }
+          String caretDescription = caretState.carets.size() == 1 ? "" : "caret " + (i + 1) + "/" + caretState.carets.size() + " ";
+          Caret currentCaret = allCarets.get(i);
+          LogicalPosition actualCaretPosition = currentCaret.getLogicalPosition();
           EditorTestUtil.Caret expected = caretState.carets.get(i);
           if (expected.offset != null) {
             int caretLine = StringUtil.offsetToLineNumber(newFileText, expected.offset);
@@ -559,8 +551,8 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
             assertEquals(caretDescription + "caretLine", caretLine + 1, actualCaretPosition.line + 1);
             assertEquals(caretDescription + "caretColumn", caretCol + 1, actualCaretPosition.column + 1);
           }
-          int actualSelectionStart = caretModel.supportsMultipleCarets() ? currentCaret.getSelectionStart() : myEditor.getSelectionModel().getSelectionStart();
-          int actualSelectionEnd = caretModel.supportsMultipleCarets() ? currentCaret.getSelectionEnd() : myEditor.getSelectionModel().getSelectionEnd();
+          int actualSelectionStart = currentCaret.getSelectionStart();
+          int actualSelectionEnd = currentCaret.getSelectionEnd();
           if (expected.selection != null) {
             int selStartLine = StringUtil.offsetToLineNumber(newFileText, expected.selection.getStartOffset());
             int selStartCol = expected.selection.getStartOffset() - StringUtil.lineColToOffset(newFileText, selStartLine, 0);
@@ -582,7 +574,7 @@ public abstract class CodeInsightTestCase extends PsiTestCase {
           }
           else {
             assertFalse(caretDescription + "should has no selection, but was: (" + actualSelectionStart + ", " + actualSelectionEnd + ")",
-                        caretModel.supportsMultipleCarets() ? currentCaret.hasSelection() : myEditor.getSelectionModel().hasSelection());
+                        currentCaret.hasSelection());
           }
         }
       }
index 348a1afadae3d009d92ccd5af2f98b8f209a8cd2..15b858fea0ece23b41444f00bd6e064943e71c0d 100644 (file)
@@ -2,6 +2,7 @@ package com.intellij.compiler;
 
 import com.intellij.compiler.impl.TranslatingCompilerFilesMonitor;
 import com.intellij.compiler.impl.javaCompiler.javac.JavacConfiguration;
+import com.intellij.compiler.options.ExternalBuildOptionListener;
 import com.intellij.compiler.server.BuildManager;
 import com.intellij.openapi.application.PathManager;
 import com.intellij.openapi.application.Result;
@@ -81,6 +82,7 @@ public class CompilerTestUtil {
     new WriteAction() {
       protected void run(final Result result) {
         CompilerWorkspaceConfiguration.getInstance(project).USE_OUT_OF_PROCESS_BUILD = true;
+        project.getMessageBus().syncPublisher(ExternalBuildOptionListener.TOPIC).externalBuildOptionChanged(true);
         ApplicationManagerEx.getApplicationEx().doNotSave(false);
         JavaAwareProjectJdkTableImpl table = JavaAwareProjectJdkTableImpl.getInstanceEx();
         table.addJdk(table.getInternalJdk());
@@ -92,6 +94,7 @@ public class CompilerTestUtil {
     new WriteAction() {
       protected void run(final Result result) {
         CompilerWorkspaceConfiguration.getInstance(project).USE_OUT_OF_PROCESS_BUILD = false;
+        project.getMessageBus().syncPublisher(ExternalBuildOptionListener.TOPIC).externalBuildOptionChanged(false);
         ApplicationManagerEx.getApplicationEx().doNotSave(true);
         JavaAwareProjectJdkTableImpl table = JavaAwareProjectJdkTableImpl.getInstanceEx();
         table.removeJdk(table.getInternalJdk());
index dd74d665e3624d996c56a8b996cd634c309d431a..4082d95426987fab2068715309280a719d5debbd 100644 (file)
@@ -46,10 +46,12 @@ public class AsmUtil {
   private static final Set<String> ASM_PRIMITIVE_TYPES = ContainerUtil
     .newHashSet("C", "D", "F", "I", "J", "S", "Z", "B", "V", "Ljava/lang/Object;", "Ljava/lang/String;", "Ljava/lang/Class;");
 
-  public static boolean isPrimitiveOrArray(final String asmType) {
-    if (asmType.startsWith("[")) {
-      return true;
+  public static boolean isPrimitiveOrArrayOfPrimitives(final String asmType) {
+    for (int i = 0; i < asmType.length(); i++) {
+      if (asmType.charAt(i) != '[') {
+        return ASM_PRIMITIVE_TYPES.contains(asmType.substring(i));
+      }
     }
-    return ASM_PRIMITIVE_TYPES.contains(asmType);
+    throw new AssertionError("Illegal string: " + asmType);
   }
 }
index 115a3605384ebce335e7db3dcb45ae1c98452784..3ded5f2d6aa21fa3bcbf3af7224c83c8182c1cd4 100644 (file)
@@ -15,6 +15,8 @@
  */
 package org.jetbrains.jps.classFilesIndex.indexer.api;
 
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.util.Processor;
 import com.intellij.util.containers.SLRUCache;
 import com.intellij.util.io.DataExternalizer;
 import com.intellij.util.io.EnumeratorStringDescriptor;
@@ -27,6 +29,7 @@ import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.locks.Lock;
index aded5389500040d31f6181638e1c96c0ed397823..7609feeb37d2f36e16429e7fd5a6bdf4252225a5 100644 (file)
@@ -15,6 +15,8 @@
  */
 package org.jetbrains.jps.classFilesIndex.indexer.api;
 
+import com.intellij.openapi.diagnostic.Log;
+import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.io.PersistentHashMap;
 import org.jetbrains.asm4.ClassReader;
@@ -30,6 +32,8 @@ import java.util.Set;
  * @author Dmitry Batkovich
  */
 public class ClassFilesIndexWriter<K, V> {
+  private static final Logger LOG = Logger.getInstance(ClassFilesIndexWriter.class);
+
   private final ClassFileIndexer<K, V> myIndexer;
   private final boolean myEmpty;
   protected final ClassFilesIndexStorage<K, V> myIndex;
@@ -43,6 +47,7 @@ public class ClassFilesIndexWriter<K, V> {
     }
     ClassFilesIndexStorage<K, V> index = null;
     IOException exception = null;
+    LOG.debug("start open... " + indexer.getIndexCanonicalName());
     for (int attempt = 0; attempt < 2; attempt++) {
       try {
         index = new ClassFilesIndexStorage<K, V>(storageDir, myIndexer.getKeyDescriptor(), myIndexer.getDataExternalizer());
@@ -53,6 +58,7 @@ public class ClassFilesIndexWriter<K, V> {
         PersistentHashMap.deleteFilesStartingWith(ClassFilesIndexStorage.getIndexFile(storageDir));
       }
     }
+    LOG.debug("opened " + indexer.getIndexCanonicalName());
     if (index == null) {
       throw new RuntimeException(exception);
     }
index 088e9a8b1e5eef44885d7130822389e99f7a6507..e3a95e9e57d786ec6222facdb999c78444b8d1e8 100644 (file)
@@ -36,6 +36,8 @@ import org.jetbrains.jps.service.JpsServiceManager;
 
 import java.io.File;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
 
 /**
  * @author Dmitry Batkovich
@@ -46,6 +48,8 @@ public class ClassFilesIndicesBuilder extends BaseInstrumentingBuilder {
   private static final String PROGRESS_MESSAGE = "Indexing class-files...";
   public static final String PROPERTY_NAME = "intellij.compiler.output.index";
 
+  private final AtomicLong myMs = new AtomicLong(0);
+  private final AtomicInteger myFilesCount = new AtomicInteger(0);
   private final Collection<ClassFilesIndexWriter> myIndexWriters = new ArrayList<ClassFilesIndexWriter>();
 
   @Override
@@ -89,11 +93,13 @@ public class ClassFilesIndicesBuilder extends BaseInstrumentingBuilder {
     if (!isEnabled()) {
       return;
     }
+    final long ms = System.currentTimeMillis();
     for (final ClassFilesIndexWriter index : myIndexWriters) {
       index.close(context);
     }
     myIndexWriters.clear();
-    LOG.info("class files indexing finished");
+    myMs.addAndGet(System.currentTimeMillis() - ms);
+    LOG.info("class files indexing finished for " + myFilesCount.get() + " files in " + myMs.get() + "ms");
   }
 
   @Nullable
@@ -103,9 +109,12 @@ public class ClassFilesIndicesBuilder extends BaseInstrumentingBuilder {
                                      final ClassReader reader,
                                      final ClassWriter writer,
                                      final InstrumentationClassFinder finder) {
+    final long ms = System.currentTimeMillis();
     for (final ClassFilesIndexWriter index : myIndexWriters) {
       index.update(compiled.getOutputFile().getPath(), reader);
     }
+    myMs.addAndGet(System.currentTimeMillis() - ms);
+    myFilesCount.incrementAndGet();
     return null;
   }
 
index 0aac2186f984665e05d1a5a7e32a54405b828d7b..98844bf9862cb75b5a3c039022624a1a4fe7cfca 100644 (file)
@@ -17,6 +17,7 @@ package org.jetbrains.jps.classFilesIndex.indexer.impl;
 
 import com.intellij.util.io.DataExternalizer;
 import com.intellij.util.io.EnumeratorStringDescriptor;
+import com.intellij.util.io.KeyDescriptor;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.jps.classFilesIndex.AsmUtil;
 
@@ -79,6 +80,16 @@ public class MethodIncompleteSignature {
     return myStatic;
   }
 
+  @Override
+  public String toString() {
+    return "MethodIncompleteSignature{" +
+           "myOwner='" + myOwner + '\'' +
+           ", myReturnType='" + myReturnType + '\'' +
+           ", myName='" + myName + '\'' +
+           ", myStatic=" + myStatic +
+           '}';
+  }
+
   public final static Comparator<MethodIncompleteSignature> COMPARATOR = new Comparator<MethodIncompleteSignature>() {
     @Override
     public int compare(final MethodIncompleteSignature o1, final MethodIncompleteSignature o2) {
index 60c0707cba242d911037868e1ec407dd17fb5ab3..e4eac05f93d78fb4e037dd4ce2038dddd53af28e 100644 (file)
  */
 package org.jetbrains.jps.classFilesIndex.indexer.impl;
 
-import com.intellij.util.containers.FactoryMap;
 import com.intellij.util.io.DataExternalizer;
 import com.intellij.util.io.EnumeratorStringDescriptor;
 import com.intellij.util.io.KeyDescriptor;
 import gnu.trove.TObjectIntHashMap;
 import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
 import org.jetbrains.asm4.*;
 import org.jetbrains.jps.classFilesIndex.AsmUtil;
 import org.jetbrains.jps.classFilesIndex.TObjectIntHashMapExternalizer;
 import org.jetbrains.jps.classFilesIndex.indexer.api.ClassFileIndexer;
-import org.jetbrains.jps.classFilesIndex.indexer.api.ClassFilesIndicesBuilder;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -44,12 +41,14 @@ public class MethodsUsageIndexer extends ClassFileIndexer<String, TObjectIntHash
   @NotNull
   @Override
   public Map<String, TObjectIntHashMap<MethodIncompleteSignature>> map(final ClassReader inputData) {
-    final Map<String, TObjectIntHashMap<MethodIncompleteSignature>> map = new HashMap<String, TObjectIntHashMap<MethodIncompleteSignature>>();
+    final Map<String, TObjectIntHashMap<MethodIncompleteSignature>> map =
+      new HashMap<String, TObjectIntHashMap<MethodIncompleteSignature>>();
     final MethodVisitor methodVisitor = new MethodVisitor(Opcodes.ASM4) {
       @Override
       public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc) {
         final Type returnType = Type.getReturnType(desc);
-        if (MethodIncompleteSignature.CONSTRUCTOR_METHOD_NAME.equals(name) || AsmUtil.isPrimitiveOrArray(returnType.getDescriptor())) {