Merge branch 'mskr/webstorm-js-bugs'
authorMaxim Kropotov <maxim.kropotov@jetbrains.com>
Thu, 10 Nov 2016 13:48:16 +0000 (16:48 +0300)
committerMaxim Kropotov <maxim.kropotov@jetbrains.com>
Thu, 10 Nov 2016 13:48:16 +0000 (16:48 +0300)
599 files changed:
RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java
RegExpSupport/testData/RETest.xml
build/conf/nsis/customInstallActions.nsi
build/conf/nsis/idea.nsi
build/order.txt
build/scripts/layouts.gant
java/compiler/impl/src/com/intellij/compiler/CompilerManagerImpl.java
java/compiler/impl/src/com/intellij/compiler/backwardRefs/CompilerReferenceServiceImpl.java
java/compiler/impl/src/com/intellij/compiler/backwardRefs/DirtyModulesHolder.java
java/compiler/impl/src/com/intellij/compiler/impl/JavaModuleIndexBuildTask.kt
java/compiler/openapi/src/com/intellij/openapi/compiler/ex/CompilerPathsEx.java
java/debugger/impl/src/com/intellij/debugger/actions/JavaSmartStepIntoHandler.java
java/debugger/impl/src/com/intellij/debugger/actions/JumpToObjectAction.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/BoxingEvaluator.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/LiteralEvaluator.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/UnBoxingEvaluator.java
java/debugger/impl/src/com/intellij/debugger/jdi/LocalVariablesUtil.java
java/debugger/impl/src/com/intellij/debugger/jdi/MethodBytecodeUtil.java
java/debugger/impl/src/com/intellij/debugger/jdi/VirtualMachineProxyImpl.java
java/debugger/impl/src/com/intellij/debugger/settings/RendererConfiguration.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointManager.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpoint.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointPropertiesPanel.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/ValueDescriptorImpl.java
java/debugger/impl/src/com/intellij/debugger/ui/tree/render/CustomFieldInplaceEditor.java
java/debugger/impl/src/com/intellij/debugger/ui/tree/render/EnumerationChildrenRenderer.java
java/debugger/impl/src/com/intellij/debugger/ui/tree/render/ToStringRenderer.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/java-analysis-impl/src/com/intellij/codeInspection/SimplifyStreamApiCallChainsInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIndex.java
java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ClassDataIndexer.java
java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/KeyedMethodVisitor.java [new file with mode: 0644]
java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/ProjectBytecodeAnalysis.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/MethodDataExternalizer.kt
java/java-analysis-impl/src/com/intellij/codeInspection/deadCode/UnusedDeclarationInspectionBase.java
java/java-analysis-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerBase.java
java/java-analysis-impl/src/com/intellij/codeInspection/java18api/Java8ReplaceMapGetInspection.java
java/java-analysis-impl/src/com/intellij/codeInspection/unneededThrows/RedundantThrows.java
java/java-analysis-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtilBase.java
java/java-impl/src/com/intellij/codeInsight/ExpectedTypesProvider.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/MarkerType.java
java/java-impl/src/com/intellij/codeInsight/editorActions/JavaLineIndentProvider.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/BindFieldsFromParametersAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/config/QuickFixFactoryImpl.java
java/java-impl/src/com/intellij/codeInspection/CollectionAddAllCanBeReplacedWithConstructorInspection.java
java/java-impl/src/com/intellij/codeInspection/OptionalIsPresentInspection.java
java/java-impl/src/com/intellij/codeInspection/intermediaryVariable/ReturnSeparatedFromComputationInspection.java
java/java-impl/src/com/intellij/codeInspection/javaDoc/JavaDocLocalInspection.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/MigrateToStreamFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/ReplaceWithFindFirstFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/StreamApiMigrationInspection.java
java/java-impl/src/com/intellij/codeInspection/unusedReturnValue/UnusedReturnValueLocalInspection.java
java/java-impl/src/com/intellij/codeInspection/util/OptionalUtil.java
java/java-impl/src/com/intellij/ide/hierarchy/method/MethodHierarchyBrowser.java
java/java-impl/src/com/intellij/ide/hierarchy/type/TypeHierarchyBrowser.java
java/java-impl/src/com/intellij/openapi/options/colors/pages/JavaColorSettingsPage.java
java/java-impl/src/com/intellij/refactoring/changeSignature/DetectedJavaChangeInfo.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureDetector.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureHandler.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaParameterTableModel.java
java/java-impl/src/com/intellij/refactoring/copy/CopyClassesHandler.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesUtil.java
java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodProcessor.java
java/java-impl/src/com/intellij/refactoring/turnRefsToSuper/TurnRefsToSuperProcessorBase.java
java/java-impl/src/com/intellij/testIntegration/createTest/CreateTestAction.java
java/java-impl/src/com/intellij/testIntegration/createTest/CreateTestDialog.java
java/java-psi-api/src/com/intellij/codeInsight/daemon/impl/analysis/JavaGenericsUtil.java
java/java-psi-impl/src/com/intellij/codeInsight/ExceptionUtil.java
java/java-psi-impl/src/com/intellij/psi/impl/PsiDiamondTypeUtil.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/ReifiableTypeWithLocalClasses.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeIfIncomplete.java [new file with mode: 0644]
java/java-tests/testData/inspection/dataFlow/fixture/OptionalOfNullable.java
java/java-tests/testData/inspection/java8MapGet/beforeComputeIfAbsentAdditionalStatement.java [new file with mode: 0644]
java/java-tests/testData/inspection/java8MapGet/beforeComputeIfAbsentIncomplete.java [new file with mode: 0644]
java/java-tests/testData/refactoring/changeSignatureGesture/DeleteParamInSuperUsed.java
java/java-tests/testData/refactoring/changeSignatureGesture/Modifier.java
java/java-tests/testData/refactoring/changeSignatureGesture/Modifier_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/changeSignatureGesture/NoUsages_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/changeSignatureGesture/Simple_after.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/impl/DaemonRespondToChangesTest.java
java/java-tests/testSrc/com/intellij/codeInspection/SingleInspectionProfilePanelTest.kt
java/java-tests/testSrc/com/intellij/codeInspection/ex/InspectionProfileTest.java
java/java-tests/testSrc/com/intellij/codeInspection/ex/ProjectInspectionManagerTest.kt
java/java-tests/testSrc/com/intellij/index/IndexTest.groovy
java/java-tests/testSrc/com/intellij/refactoring/ChangeSignatureGestureTest.java
java/jdkAnnotations/java/lang/annotations.xml
java/manifest/src/org/jetbrains/lang/manifest/highlighting/MisspelledHeaderInspection.java
java/structuralsearch-java/src/com/intellij/structuralsearch/JavaStructuralSearchProfile.java
java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/JavaMatchingVisitor.java
java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java
java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/filters/JavaLexicalNodesFilter.java
java/testFramework/src/com/intellij/codeInsight/CodeInsightTestCase.java
java/testFramework/src/com/intellij/codeInsight/daemon/DaemonAnalyzerTestCase.java
java/testFramework/src/com/siyeh/ig/LightInspectionTestCase.java
java/typeMigration/src/com/intellij/refactoring/typeMigration/inspections/MigrateAssertToMatcherAssertInspection.java
java/typeMigration/src/com/intellij/refactoring/typeMigration/rules/guava/GuavaTypeConversionDescriptor.java
java/typeMigration/testData/inspections/migrateAssertsToAssertThat/all.java
java/typeMigration/testData/inspections/migrateAssertsToAssertThat/all_after.java
jps/jps-builders/jps-builders.iml
jps/jps-builders/proto/javac_remote_proto.proto
jps/jps-builders/src/META-INF/services/org.jetbrains.jps.javac.JavaCompilerToolExtension [new file with mode: 0644]
jps/jps-builders/src/org/jetbrains/jps/backwardRefs/BackwardReferenceIndexWriter.java
jps/jps-builders/src/org/jetbrains/jps/builders/impl/java/JavacCompilerTool.java
jps/jps-builders/src/org/jetbrains/jps/builders/java/JavaCompilingTool.java
jps/jps-builders/src/org/jetbrains/jps/cmdline/BuildSession.java
jps/jps-builders/src/org/jetbrains/jps/cmdline/ClasspathBootstrap.java
jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java
jps/jps-builders/src/org/jetbrains/jps/javac/DiagnosticOutputConsumer.java
jps/jps-builders/src/org/jetbrains/jps/javac/ExternalJavacMessageHandler.java
jps/jps-builders/src/org/jetbrains/jps/javac/ExternalJavacProcess.java
jps/jps-builders/src/org/jetbrains/jps/javac/JavaCompilerToolExtension.java [new file with mode: 0644]
jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java
jps/jps-builders/src/org/jetbrains/jps/javac/JavacProtoUtil.java
jps/jps-builders/src/org/jetbrains/jps/javac/JavacRemoteProto.java
jps/jps-builders/src/org/jetbrains/jps/javac/ast/JavacReferenceCollectorListener.java
jps/jps-builders/src/org/jetbrains/jps/javac/ast/RefCollectorCompilerToolExtension.java [new file with mode: 0644]
jps/jps-builders/src/org/jetbrains/jps/javac/ast/api/JavacRefSymbol.java
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate/afterSecondMakeIndex.txt
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate2/Bar.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate2/Foo.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate2/Foo_2.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate2/after1MakeIndex.txt [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate2/after2MakeIndex.txt [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate2/initialIndex.txt [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate3/Bar.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate3/Foo.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate3/Foo_2.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate3/after1MakeIndex.txt [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/incrementalIndexUpdate3/initialIndex.txt [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/multiFileMultiUnitCompilation/Bar.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/multiFileMultiUnitCompilation/Boo.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/multiFileMultiUnitCompilation/Foo.java [new file with mode: 0644]
jps/jps-builders/testData/referencesIndex/multiFileMultiUnitCompilation/initialIndex.txt [new file with mode: 0644]
jps/jps-builders/testSrc/org/jetbrains/references/ReferenceIndexTest.kt
json/gen/com/intellij/json/JsonElementTypes.java
json/gen/com/intellij/json/JsonParser.java
json/gen/com/intellij/json/_JsonLexer.java
json/gen/com/intellij/json/psi/JsonReferenceExpression.java
json/gen/com/intellij/json/psi/impl/JsonReferenceExpressionImpl.java
json/json.bnf
json/src/com/intellij/json/_JsonLexer.flex
json/src/com/intellij/json/findUsages/JsonWordScanner.java
json/src/com/intellij/json/highlighting/JsonSyntaxHighlighterFactory.java
json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaObjectAnnotator.java
json/src/com/jetbrains/jsonSchema/impl/JsonSchemaWalker.java
json/tests/test/com/jetbrains/jsonSchema/JsonSchemaHighlightingTest.java
json/tests/test/com/jetbrains/jsonSchema/impl/JsonBySchemaCompletionTest.java
json/tests/testData/psi/NonStandardPropertyKeys.txt
json/tests/testData/psi/NumberLiterals.txt
native/breakgen/CMakeLists.txt
platform/analysis-api/src/com/intellij/analysis/AnalysisScope.java
platform/analysis-api/src/com/intellij/codeInspection/ModifiableModel.java
platform/analysis-api/src/com/intellij/psi/search/GlobalSearchScopesCore.java
platform/analysis-impl/src/com/intellij/codeHighlighting/RainbowHighlighter.java
platform/analysis-impl/src/com/intellij/codeInsight/daemon/InspectionProfileConvertor.java
platform/analysis-impl/src/com/intellij/codeInspection/InspectionManagerBase.java
platform/analysis-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextBase.java
platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
platform/analysis-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java
platform/analysis-impl/src/com/intellij/profile/codeInspection/BaseInspectionProfileManager.kt
platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java
platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProjectProfileManager.java
platform/analysis-impl/src/com/intellij/profile/codeInspection/ProjectInspectionProfileManager.kt
platform/configuration-store-impl/src/FileBasedStorage.kt
platform/configuration-store-impl/src/SchemeManagerImpl.kt
platform/core-api/src/com/intellij/openapi/components/ComponentManager.java
platform/core-api/src/com/intellij/openapi/progress/ProgressManager.java
platform/core-api/src/com/intellij/openapi/vfs/VirtualFileManager.java
platform/core-impl/src/com/intellij/codeInsight/daemon/impl/CollectHighlightsUtil.java
platform/core-impl/src/com/intellij/mock/MockComponentManager.java
platform/core-impl/src/com/intellij/mock/MockProject.java
platform/core-impl/src/com/intellij/openapi/components/impl/ComponentManagerImpl.java
platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java
platform/core-impl/src/com/intellij/openapi/vfs/impl/VirtualFileManagerImpl.java
platform/core-impl/src/org/jetbrains/ide/script/Jsr223IdeScriptEngineManagerImpl.java
platform/diff-impl/src/com/intellij/diff/impl/DiffRequestProcessor.java
platform/diff-impl/src/com/intellij/diff/merge/MergeRequestProcessor.java
platform/diff-impl/src/com/intellij/diff/merge/TextMergeViewer.java
platform/dvcs-impl/src/com/intellij/dvcs/push/ui/PushLog.java
platform/editor-ui-api/src/com/intellij/openapi/editor/ScrollingModel.java
platform/indexing-api/src/com/intellij/util/gist/PsiFileGist.java
platform/indexing-api/src/com/intellij/util/gist/VirtualFileGist.java
platform/indexing-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java
platform/lang-api/src/com/intellij/execution/runners/AsyncGenericProgramRunner.java
platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java
platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java
platform/lang-impl/src/com/intellij/application/options/colors/RainbowDescriptionPanel.form
platform/lang-impl/src/com/intellij/application/options/colors/SimpleEditorPreview.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/DaemonListeners.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/EditCleanupProfileIntentionAction.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HectorComponent.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/PsiElementListNavigator.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/WholeFileLocalInspectionsPassFactory.java
platform/lang-impl/src/com/intellij/codeInsight/intention/impl/ShowIntentionActionsHandler.java
platform/lang-impl/src/com/intellij/codeInsight/navigation/BackgroundUpdaterTask.java
platform/lang-impl/src/com/intellij/codeInsight/navigation/GotoImplementationHandler.java
platform/lang-impl/src/com/intellij/codeInsight/navigation/GotoTargetHandler.java
platform/lang-impl/src/com/intellij/codeInsight/navigation/ImplementationSearcher.java
platform/lang-impl/src/com/intellij/codeInspection/LossyEncodingInspection.java
platform/lang-impl/src/com/intellij/codeInspection/actions/CodeInspectionAction.java
platform/lang-impl/src/com/intellij/codeInspection/ex/ApplicationInspectionProfileManager.java
platform/lang-impl/src/com/intellij/codeInspection/ex/DisableInspectionToolAction.java
platform/lang-impl/src/com/intellij/codeInspection/ex/EditInspectionToolsSettingsAction.java
platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java
platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java
platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java
platform/lang-impl/src/com/intellij/codeInspection/ui/actions/KeyAwareInspectionViewAction.java
platform/lang-impl/src/com/intellij/execution/console/RunIdeConsoleAction.java
platform/lang-impl/src/com/intellij/execution/lineMarker/ExecutorAction.java [deleted file]
platform/lang-impl/src/com/intellij/execution/lineMarker/ExecutorAction.kt [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/runners/BasicProgramRunner.java
platform/lang-impl/src/com/intellij/execution/runners/DebuggableRunProfileState.java [moved from platform/vcs-api/src/com/intellij/util/continuation/TaskData.java with 61% similarity]
platform/lang-impl/src/com/intellij/execution/runners/DefaultProgramRunner.java [deleted file]
platform/lang-impl/src/com/intellij/execution/runners/DefaultProgramRunner.kt [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/runners/DefaultRunProgramRunner.kt [new file with mode: 0644]
platform/lang-impl/src/com/intellij/formatting/CoreFormatterUtil.java
platform/lang-impl/src/com/intellij/formatting/FormattingMode.java
platform/lang-impl/src/com/intellij/ide/actions/QuickChangeInspectionProfileAction.java
platform/lang-impl/src/com/intellij/ide/hierarchy/CallHierarchyBrowserBase.java
platform/lang-impl/src/com/intellij/ide/hierarchy/HierarchyBrowserBase.java
platform/lang-impl/src/com/intellij/ide/hierarchy/HierarchyBrowserBaseEx.java
platform/lang-impl/src/com/intellij/ide/hierarchy/HierarchyBrowserManager.java
platform/lang-impl/src/com/intellij/ide/projectView/BaseProjectTreeBuilder.java
platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java
platform/lang-impl/src/com/intellij/ide/scratch/ScratchFileActions.java
platform/lang-impl/src/com/intellij/ide/script/IdeConsoleScriptBindings.java [moved from platform/lang-impl/src/com/intellij/ide/script/IdeScriptBindings.java with 95% similarity]
platform/lang-impl/src/com/intellij/ide/script/IdeStartupScripts.java
platform/lang-impl/src/com/intellij/ide/ui/search/TraverseUIStarter.java
platform/lang-impl/src/com/intellij/openapi/options/colors/pages/DefaultLanguageColorsPage.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/PushedFilePropertiesUpdaterImpl.java
platform/lang-impl/src/com/intellij/platform/PlatformInspectionProfileConfigurator.java
platform/lang-impl/src/com/intellij/profile/codeInspection/ui/SingleInspectionProfilePanel.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleSchemeImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/lineIndent/FormatterBasedIndentAdjuster.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/lineIndent/JavaLikeLangLineIndentProvider.java
platform/lang-impl/src/com/intellij/refactoring/actions/BaseRefactoringAction.java
platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDetectorAction.java [deleted file]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureGestureDetector.java [deleted file]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/DismissNewSignatureIntentionAction.java [deleted file]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/MoveParameterAction.java [deleted file]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/ApplyChangeSignatureAction.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/ChangeSignaturePassFactory.java [moved from platform/lang-impl/src/com/intellij/refactoring/changeSignature/ChangeSignaturePassFactory.java with 72% similarity]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/EscapeHandler.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/InplaceChangeSignature.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/LanguageChangeSignatureDetector.java [moved from platform/lang-impl/src/com/intellij/refactoring/changeSignature/LanguageChangeSignatureDetector.java with 50% similarity]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/LanguageChangeSignatureDetectors.java [moved from platform/lang-impl/src/com/intellij/refactoring/changeSignature/LanguageChangeSignatureDetectors.java with 75% similarity]
platform/lang-impl/src/com/intellij/refactoring/changeSignature/inplace/RenameChangeInfo.java [moved from platform/lang-impl/src/com/intellij/refactoring/changeSignature/RenameChangeInfo.java with 89% similarity]
platform/lang-impl/src/com/intellij/refactoring/move/moveFilesOrDirectories/MoveFilesOrDirectoriesUtil.java
platform/lang-impl/src/com/intellij/tools/ToolProgramRunner.java [deleted file]
platform/lang-impl/src/com/intellij/ui/ColorLineMarkerProvider.java
platform/lang-impl/src/com/intellij/util/gist/PsiFileGistImpl.java
platform/lang-impl/src/com/intellij/util/gist/VirtualFileGistImpl.java
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryImpl.java
platform/lvcs-impl/src/com/intellij/history/integration/ValidateHistoryAction.kt [new file with mode: 0644]
platform/platform-api/src/com/intellij/openapi/MnemonicWrapper.java
platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java
platform/platform-api/src/com/intellij/openapi/fileEditor/OpenFileDescriptor.java
platform/platform-api/src/com/intellij/openapi/fileEditor/PsiElementNavigatable.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ClipboardSynchronizer.java
platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/DarculaLaf.java
platform/platform-impl/src/com/intellij/ide/ui/search/SearchUtil.java
platform/platform-impl/src/com/intellij/openapi/command/impl/DummyProject.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java
platform/platform-impl/src/com/intellij/openapi/diagnostic/logger.kt
platform/platform-impl/src/com/intellij/openapi/editor/ex/util/CaretVisualPositionKeeper.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/ScrollingModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentScrollingModel.java
platform/platform-impl/src/com/intellij/openapi/fileChooser/impl/FileChooserFactoryImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ActionsTree.java
platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressIndicatorUtils.java
platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/vfs/encoding/EncodingUtil.java
platform/platform-impl/src/com/intellij/openapi/vfs/encoding/IncompatibleEncodingDialog.java
platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/status/EncodingPanel.java
platform/platform-impl/src/com/intellij/ui/Splash.java
platform/platform-impl/src/com/intellij/ui/mac/MacFileSaverDialog.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ui/popup/PopupDispatcher.java
platform/platform-resources-en/src/messages/ActionsBundle.properties
platform/platform-resources-en/src/messages/ApplicationBundle.properties
platform/platform-resources-en/src/messages/EditorBundle.properties
platform/platform-resources-en/src/messages/UIBundle.properties
platform/platform-resources-en/src/messages/VcsBundle.properties
platform/platform-resources/src/DefaultColorSchemesManager.xml
platform/platform-resources/src/META-INF/LangExtensionPoints.xml
platform/platform-resources/src/META-INF/LangExtensions.xml
platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml
platform/platform-resources/src/META-INF/PlatformLangPlugin.xml
platform/platform-resources/src/componentSets/Lang.xml
platform/platform-resources/src/componentSets/Profiles.xml
platform/platform-resources/src/idea/PlatformActions.xml
platform/platform-resources/src/idea/VcsActions.xml
platform/platform-tests/testSrc/com/intellij/concurrency/JobUtilTest.java
platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java
platform/projectModel-api/src/org/jetbrains/concurrency/AsyncPromise.kt
platform/projectModel-impl/projectModel-impl.iml
platform/projectModel-impl/src/com/intellij/openapi/options/EmptySchemesManager.java
platform/projectModel-impl/src/com/intellij/openapi/options/SchemeManager.java
platform/projectModel-impl/src/com/intellij/util/jdom.kt
platform/script-debugger/backend/src/org/jetbrains/debugger/ObjectProperty.java [deleted file]
platform/script-debugger/backend/src/org/jetbrains/debugger/ObjectProperty.kt [new file with mode: 0644]
platform/script-debugger/backend/src/org/jetbrains/debugger/ObjectPropertyImpl.java [deleted file]
platform/script-debugger/backend/src/org/jetbrains/debugger/ObjectPropertyImpl.kt [new file with mode: 0644]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/FunctionValue.java [deleted file]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/FunctionValue.kt [new file with mode: 0644]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/IndexedVariablesConsumer.java [deleted file]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/IndexedVariablesConsumer.kt [new file with mode: 0644]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/PrimitiveValue.java [deleted file]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/PrimitiveValue.kt [new file with mode: 0644]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueType.java [deleted file]
platform/script-debugger/backend/src/org/jetbrains/debugger/values/ValueType.kt [new file with mode: 0644]
platform/script-debugger/debugger-ui/src/VariableView.kt
platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/CustomPropertiesValuePresentation.java
platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/DebuggableRunConfiguration.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertor.java
platform/structuralsearch/source/com/intellij/structuralsearch/plugin/replace/impl/ReplacementBuilder.java
platform/structuralsearch/source/messages/SSRBundle.properties
platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java
platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
platform/testFramework/src/com/intellij/mock/MockModule.java
platform/testFramework/src/com/intellij/testFramework/LightPlatformCodeInsightTestCase.java
platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
platform/testFramework/src/com/intellij/testFramework/inspections.kt
platform/util/resources/misc/registry.properties
platform/util/src/com/intellij/openapi/util/JDOMUtil.java
platform/util/src/com/intellij/openapi/util/VolatileNotNullLazyValue.java
platform/util/src/com/intellij/util/io/DataInputOutputUtil.java
platform/util/src/com/intellij/util/text/CharArrayExternalizable.java
platform/util/src/com/intellij/util/text/CharArrayUtil.java
platform/util/src/com/intellij/util/text/CharSequenceBackedByArray.java
platform/util/src/com/intellij/util/text/ImmutableCharSequence.java
platform/util/src/com/intellij/util/text/TextRangeUtil.java
platform/util/src/com/intellij/util/text/TextRanges.java
platform/util/src/com/intellij/util/text/UnsyncCharArrayReader.java
platform/util/src/com/intellij/util/ui/FontInfo.java
platform/util/src/com/intellij/util/ui/UIUtil.java
platform/util/util.iml
platform/vcs-api/src/com/intellij/openapi/vcs/QuantitySelection.java
platform/vcs-api/src/com/intellij/openapi/vcs/SelectionManipulation.java [deleted file]
platform/vcs-api/src/com/intellij/openapi/vcs/SelectionState.java [deleted file]
platform/vcs-api/src/com/intellij/openapi/vcs/versionBrowser/ChangeBrowserSettings.java
platform/vcs-api/src/com/intellij/util/continuation/ContinuationContext.java [deleted file]
platform/vcs-api/src/com/intellij/util/continuation/TaskDescriptor.java [deleted file]
platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/BackgroundTaskGroup.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/BrowseChangesAction.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/NewEditChangelistPanel.java
platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/impl/VcsInitialization.java
platform/vcs-impl/src/com/intellij/util/continuation/GeneralRunner.java [deleted file]
platform/vcs-impl/src/com/intellij/util/continuation/SeparatePiecesRunner.java [deleted file]
platform/vcs-log/impl/src/com/intellij/vcs/log/ui/filter/VcsLogClassicFilterUi.java
platform/vcs-log/impl/src/com/intellij/vcs/log/ui/frame/GraphTableController.java
platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/GraphCommitCellRenderer.java
platform/vcs-log/impl/src/com/intellij/vcs/log/ui/render/SimpleColoredComponentLinkMouseListener.java [new file with mode: 0644]
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebugSessionImpl.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebuggerExpressionEditor.java
plugins/ByteCodeViewer/src/com/intellij/byteCodeViewer/ByteCodeViewerManager.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/junit/JUnit3StyleTestMethodInJUnit4ClassInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/maturity/ObsoleteCollectionInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpectedTypeUtils.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ExpressionUtils.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/MethodCallUtils.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/ParenthesesUtils.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/TypeUtils.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/psiutils/WeakestTypeFinder.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/testFrameworks/AssertHint.java
plugins/InspectionGadgets/src/com/siyeh/ig/junit/JUnit5AssertionsConverterInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/junit/JUnit5ConverterInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/maturity/SuppressionAnnotationInspection.java
plugins/InspectionGadgets/src/inspectionDescriptions/JUnit3StyleTestMethodInJUnit4Class.html
plugins/InspectionGadgets/test/com/siyeh/igfixes/junit/junit5_assertions_converter/AssertNotEqualsWithDelta.java [moved from plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/GrClassSubstitution.java with 73% similarity]
plugins/InspectionGadgets/test/com/siyeh/igtest/junit/junit3_style_test_method_in_junit4_class/SimpleJUnit5.java [moved from platform/vcs-api/src/com/intellij/util/continuation/Where.java with 79% similarity]
plugins/InspectionGadgets/test/com/siyeh/igtest/junit/junit_asserts_without_messages/FailWithMessage.java [moved from platform/vcs-api/src/com/intellij/openapi/vcs/SelectionResult.java with 72% similarity]
plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/junit/Junit5AssertionsConverterFixTest.java
plugins/InspectionGadgets/testsrc/com/siyeh/ig/junit/JUnit3StyleTestMethodInJUnit4ClassInspectionTest.java
plugins/InspectionGadgets/testsrc/com/siyeh/ig/junit/JUnitAssertsWithoutMessagesInspectionTest.java [new file with mode: 0644]
plugins/IntentionPowerPak/src/com/siyeh/ipp/trivialif/ReplaceIfWithConditionalIntention.java
plugins/devkit/resources/META-INF/plugin.xml
plugins/devkit/resources/fileTemplates/j2ee/plugin.xml.ft
plugins/devkit/resources/inspectionDescriptions/ExtensionPointBeanClass.html [deleted file]
plugins/devkit/src/dom/ExtensionPoint.java
plugins/devkit/src/dom/IdeaPlugin.java
plugins/devkit/src/dom/impl/ExtensionPointImpl.java
plugins/devkit/src/dom/impl/LanguageResolvingUtil.java
plugins/devkit/src/dom/impl/PluginXmlDomFileDescription.java
plugins/devkit/src/dom/impl/PropertyKeyReferenceProvider.java
plugins/devkit/src/inspections/ExtensionPointBeanClassInspection.java [deleted file]
plugins/devkit/src/inspections/InspectionMappingConsistencyInspection.java
plugins/devkit/src/inspections/PluginXmlDomInspection.java
plugins/devkit/src/inspections/quickfix/AddWithTagFix.java
plugins/devkit/src/testAssistant/TestDataGuessByExistingFilesUtil.java
plugins/devkit/testData/codeInsight/LoadForDefaultProject.xml
plugins/devkit/testData/codeInsight/deprecatedAttributes.xml
plugins/devkit/testData/codeInsight/pluginWithModules.xml
plugins/devkit/testData/codeInsight/pluginWithXInclude.xml
plugins/devkit/testSources/codeInsight/CreateClassFixTest.java
plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java
plugins/devkit/testSources/codeInsight/PluginXmlFunctionalTest.groovy
plugins/devkit/testSources/inspections/PsiElementConcatenationInspectionTest.java
plugins/devkit/testSources/navigation/DescriptionTypeRelatedItemLineMarkerProviderTest.java
plugins/devkit/testSources/testAssistant/TestDataPathCompletionTest.java
plugins/devkit/testSources/testAssistant/TestDataPathResolvingTest.java
plugins/groovy/groovy-psi/resources/inspectionDescriptions/GroovySingletonAnnotation.html [deleted file]
plugins/groovy/groovy-psi/resources/inspectionDescriptions/SingletonConstructor.html [new file with mode: 0644]
plugins/groovy/groovy-psi/resources/standardDsls/defaultMethods.gdsl
plugins/groovy/groovy-psi/resources/standardDsls/extensions.gdsl [deleted file]
plugins/groovy/groovy-psi/resources/standardDsls/listenerList.gdsl [deleted file]
plugins/groovy/groovy-psi/resources/standardDsls/singletonTransform.gdsl [deleted file]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/GroovyBundle.properties
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/annotator/inspections/GroovySingletonAnnotationInspection.java [deleted file]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/GroovyInspectionBundle.properties
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/bugs/NewInstanceOfSingletonInspection.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/codeInspection/fixes/RemoveElementQuickFix.java [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/dgm/DGMMemberContributor.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/dgm/DGMUtil.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/dgm/GroovyExtensionProvider.java [deleted file]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/dgm/GroovyExtensionVetoSPI.java [moved from platform/lang-impl/src/com/intellij/refactoring/changeSignature/MoveParameterLeftAction.java with 64% similarity]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/GroovyCoreEnvironment.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/psi/impl/GrDocCommentImpl.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/impl/grAnnotationUtil.kt [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/stubs/GrStubUtils.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/util/GroovyCommonClassNames.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/GroovyTransformationsBundle.kt [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/GroovyTransformationsBundle.properties [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/TransformationContext.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/TransformationContextImpl.java
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/TransformationUtil.kt
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/dsl/MemberBuilder.kt
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/impl/autoClone/AutoCloneTransformationSupport.kt
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/listenerList/ListenerListAnnotationChecker.kt [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/listenerList/ListenerListTransformationSupport.kt [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/listenerList/impl.kt [moved from platform/lang-impl/src/com/intellij/refactoring/changeSignature/MoveParameterRightAction.java with 52% similarity]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/singleton/MakeNonStrictQuickFix.kt [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/singleton/SingletonConstructorInspection.kt [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/singleton/SingletonTransformationSupport.kt [new file with mode: 0644]
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/transformations/singleton/impl.kt [new file with mode: 0644]
plugins/groovy/src/META-INF/plugin.xml
plugins/groovy/src/org/jetbrains/plugins/groovy/dgm/DGMFileTypeFactory.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/inline/GroovyInlineHandler.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/move/MoveGroovyClassHandler.java
plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyLightProjectDescriptor.groovy
plugins/groovy/test/org/jetbrains/plugins/groovy/dsl/GroovyTransformationsTest.groovy
plugins/groovy/test/org/jetbrains/plugins/groovy/transformations/listenerList/ListenerListTest.groovy [new file with mode: 0644]
plugins/groovy/test/org/jetbrains/plugins/groovy/transformations/singleton/SingletonConstructorInspectionTest.groovy [new file with mode: 0644]
plugins/groovy/test/org/jetbrains/plugins/groovy/transformations/singleton/SingletonNewInstanceInspectionTest.groovy [new file with mode: 0644]
plugins/groovy/test/org/jetbrains/plugins/groovy/transformations/singleton/SingletonTransformationSupportTest.groovy [new file with mode: 0644]
plugins/groovy/testdata/groovy/dsl/transform/SingletonTransform.groovy [deleted file]
plugins/groovy/testdata/groovy/dsl/transform/SingletonTransform_after.groovy [deleted file]
plugins/java-decompiler/plugin/src/messages/Decompiler.properties
plugins/java-decompiler/plugin/src/org/jetbrains/java/decompiler/IdeaDecompiler.kt
plugins/javaFX/javaFX-CE/javaFX-CE.iml
plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyNoArtifactTest.java [new file with mode: 0644]
plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/JavaFxFieldToPropertyTest.java [new file with mode: 0644]
plugins/javaFX/javaFX.iml
plugins/javaFX/resources/intentionDescriptions/JavaFxFieldToPropertyIntention/after.java.template [new file with mode: 0644]
plugins/javaFX/resources/intentionDescriptions/JavaFxFieldToPropertyIntention/before.java.template [new file with mode: 0644]
plugins/javaFX/resources/intentionDescriptions/JavaFxFieldToPropertyIntention/description.html [new file with mode: 0644]
plugins/javaFX/src/META-INF/common-javaFX-plugin.xml
plugins/javaFX/src/org/jetbrains/plugins/javaFX/JavaFxEntryPoint.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/codeInsight/JavaFxFieldToPropertyIntention.java [new file with mode: 0644]
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxCommonNames.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxFileTypeFactory.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxModuleUtil.java [new file with mode: 0644]
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/JavaFxPsiUtil.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/codeInsight/JavaFxRelatedItemLineMarkerProvider.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/codeInsight/inspections/JavaFxEventHandlerInspection.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/codeInsight/inspections/JavaFxRedundantPropertyValueInspection.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/codeInsight/inspections/JavaFxUnresolvedFxIdReferenceInspection.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/codeInsight/intentions/JavaFxCollapseSubTagToAttributeIntention.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/codeInsight/intentions/JavaFxExpandAttributeIntention.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/codeInsight/intentions/JavaFxInjectPageLanguageIntention.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxControllerFieldSearcher.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/refs/JavaFxFileReferenceProvider.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/indexing/JavaFxControllerClassIndex.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/indexing/JavaFxCustomComponentsIndex.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/JavaFxApplicationClassBrowser.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/packaging/JavaFxArtifactProperties.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/resources/JavaFxResourcePropertyReferenceProvider.java
plugins/javaFX/src/org/jetbrains/plugins/javaFX/sceneBuilder/SceneBuilderEditor.java
plugins/javaFX/testData/intentions/fieldToProperty/AddRemoveFxmlFile.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/ArtifactPresenceFieldToProperty.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/ArtifactPresenceFieldToProperty_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/BoxedFloatFieldToProperty.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/BoxedFloatFieldToProperty_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/FxmlPresenceFieldToProperty.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/FxmlPresenceFieldToProperty_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/IntFieldToProperty.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/IntFieldToProperty_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/ListFieldToProperty.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/ListFieldToProperty_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/StringFieldToProperty.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/StringFieldToProperty_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/TwoFilesFieldToProperty.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/TwoFilesFieldToPropertySecondFile.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/TwoFilesFieldToPropertySecondFile_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/TwoFilesFieldToProperty_after.java [new file with mode: 0644]
plugins/javaFX/testData/intentions/fieldToProperty/sample.fxml [new file with mode: 0644]
plugins/junit/src/com/intellij/execution/junit2/inspection/JUnitEntryPoint.java
plugins/junit5_rt_tests/test/com/intellij/junit4/JUnit4IntegrationTest.java
plugins/junit_rt/src/com/intellij/junit4/JUnit45ClassesRequestBuilder.java
plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java
plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java
plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/BasePageEngine.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/IntersectingLocalChangesPanel.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PageEngine.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/PagedListWithActions.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnChangeList.java
plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnCommittedChangesProvider.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/BaseMergeTask.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ChangeListsMergerFactory.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/CheckRepositorySupportsMergeInfoTask.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/Intersection.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/LoadRecentBranchRevisions.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/LocalChangesPromptTask.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/LookForBranchOriginTask.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeAllOrSelectedChooserTask.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeAllWithBranchCopyPointTask.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeCalculatorTask.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeContext.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeInitChecksTask.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/MergeTask.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/QuickMerge.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/QuickMergeInteraction.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/QuickMergeInteractionImpl.java
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/SelectMergeItemsResult.java [new file with mode: 0644]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ShelveLocalChangesTask.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ShowRecentInDialogTask.java [deleted file]
plugins/svn4idea/src/org/jetbrains/idea/svn/integrate/ToBeMergedDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/OneShotMergeInfoHelper.java
plugins/svn4idea/testSource/org/jetbrains/idea/svn/QuickMergeTestInteraction.java
plugins/svn4idea/testSource/org/jetbrains/idea/svn/SvnQuickMergeTest.java
plugins/terminal/resources/.zshrc
plugins/terminal/src/org/jetbrains/plugins/terminal/LocalTerminalDirectRunner.java
plugins/terminal/tests/org/jetbrains/plugins/terminal/TerminalShellCommandTest.java
plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunner.java
plugins/xslt-debugger/src/org/intellij/plugins/xsltDebugger/XsltDebuggerRunner.java
python/educational-core/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCChangeCourseInfo.java
python/helpers/pydev/_pydev_bundle/pydev_ipython_console.py
python/helpers/pydev/_pydev_bundle/pydev_ipython_console_011.py
python/helpers/pydev/_pydev_bundle/pydev_monkey.py
python/helpers/pydev/pydev_run_in_console.py
python/helpers/pydev/pydevconsole.py
python/helpers/pydev/pydevd.py
python/helpers/python-skeletons/__builtin__.py
python/helpers/python-skeletons/builtins.py
python/pydevSrc/com/jetbrains/python/debugger/pydev/transport/BaseDebuggerReader.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/transport/ClientModeDebuggerTransport.java
python/python-rest/src/com/jetbrains/rest/quickfixes/AddIgnoredRoleFix.java
python/python-terminal/src/com/jetbrains/python/sdk/PyVirtualEnvTerminalCustomizer.kt
python/src/com/jetbrains/python/codeInsight/intentions/PyConvertToFStringIntention.java
python/src/com/jetbrains/python/console/PydevConsoleRunner.java
python/src/com/jetbrains/python/console/PydevConsoleRunnerFactory.java
python/src/com/jetbrains/python/console/PydevConsoleRunnerImpl.java
python/src/com/jetbrains/python/inspections/PyNewStyleStringFormatParser.java
python/src/com/jetbrains/python/inspections/PyPackageRequirementsInspection.java
python/src/com/jetbrains/python/psi/impl/PyFileImpl.java
python/src/com/jetbrains/python/run/PythonCommandLineState.java
python/src/com/jetbrains/python/run/PythonRunner.java
python/testData/inspections/PyTypeCheckerInspection/MapArgumentsInOppositeOrder.py [new file with mode: 0644]
python/testData/inspections/PyTypeCheckerInspection/MapReturnElementType.py
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodIndexContainsAlternativeQuoteOfMultilineHost.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodIndexContainsAlternativeQuoteOfMultilineHost_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodIndexContainsBothTypesOfQuotesInsideMultilineHost.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodIndexContainsBothTypesOfQuotesInsideMultilineHost_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodIndexContainsQuoteOfMultilineHost.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodIndexContainsQuoteOfMultilineHost_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodNestedFields3.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodNestedFields3_after.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/formatMethodParentFieldUnresolved.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/percentOperatorFallbackResolveResultForNamedChunk.py [new file with mode: 0644]
python/testData/intentions/PyConvertToFStringIntentionTest/percentOperatorFallbackResolveResultForPositionalChunk.py [new file with mode: 0644]
python/testSrc/com/jetbrains/python/Py3TypeTest.java
python/testSrc/com/jetbrains/python/PyStringFormatParserTest.java
python/testSrc/com/jetbrains/python/inspections/Py3TypeCheckerInspectionTest.java
python/testSrc/com/jetbrains/python/inspections/PyTypeCheckerInspectionTest.java
python/testSrc/com/jetbrains/python/intentions/PyConvertToFStringIntentionTest.java
resources-en/src/messages/DebuggerBundle.properties
resources-en/src/search/searchableOptions.xml
resources/src/componentSets/IdeaComponents.xml
resources/src/idea/RichPlatformActions.xml
resources/src/idea/RichPlatformPlugin.xml
spellchecker/src/com/intellij/spellchecker/english.dic
spellchecker/src/com/intellij/spellchecker/jetbrains.dic
xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementAnnotationsManagerImpl.java
xml/tests/src/com/intellij/codeInsight/daemon/XmlHighlightingTest.java
xml/tests/testData/xml/BillionLaughs.xml [new file with mode: 0644]
xml/xml-psi-impl/src/com/intellij/xml/actions/validate/ValidateXmlActionHandler.java
xml/xml-psi-impl/src/com/intellij/xml/util/XmlPsiUtil.java

index 242dae54255b28445ad4a3abbc31e62c562a10ca..9c6b6502d02a2bcdff7598a0edd7575fe9f0016d 100644 (file)
@@ -156,7 +156,7 @@ public class CheckRegExpForm {
       myMessage.setText(correct == null ? "Pattern is too complex" : correct ? "Matches!" : "No match");
       myRootPanel.revalidate();
       Balloon balloon = JBPopupFactory.getInstance().getParentBalloonFor(myRootPanel);
-      if (balloon != null) balloon.revalidate();
+      if (balloon != null && !balloon.isDisposed()) balloon.revalidate();
     });
   }
 
index 3e1819f8ace21c3d307c42bebf88cc5150733bea..28836f4fb234abdd479c588c391a2891d6029639 100644 (file)
       <pattern><![CDATA[\k<<error descr="Unresolved named group reference">adsf</error>>]]></pattern>
       <expected>OK</expected>
     </test>
-    <test host="com.intellij.psi.impl.JavaRegExpHost" varify="false">
-      <pattern>(?&lt;important_value1&gt;\d\d)</pattern>
+    <test host="com.intellij.psi.impl.JavaRegExpHost">
+      <pattern>(?&lt;<error descr="Invalid group name">important_value1</error>&gt;\d\d)</pattern>
       <expected>ERR</expected>
     </test>
-    <test host="com.intellij.psi.impl.JavaRegExpHost" varify="false">
+    <test host="com.intellij.psi.impl.JavaRegExpHost">
       <pattern>(?&lt;importantValue1&gt;\d\d)</pattern>
       <expected>OK</expected>
     </test>
index cf24367e4e2a2d3d62665e5c5dc45376791f4313..9f6948e6abd1fc073189ad4b1c8dee8a55c8e7fc 100644 (file)
@@ -40,15 +40,15 @@ Function ConfirmDesktopShortcut
       ${If} $3 != ""
         !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 3" "Type" "checkbox"
         !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 3" "Text" $R1
+      ${EndIf}
+      ${If} ${RunningX64}
         ; if 64-bit Win OS and jre64 for the build is available then add checkbox to Installation Options dialog
-        ${If} ${RunningX64}
-          StrCmp "${LINK_TO_JRE64}" "null" association 0
-          inetc::head /SILENT /TOSTACK ${LINK_TO_JRE64} "" /END
-          Pop $0
-          ${If} $0 == "OK"
-            !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 4" "Type" "checkbox"
-            !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 4" "Text" "Download and install 64-bit JRE by JetBrains (will be used with 64-bit launcher)"
-          ${EndIf}
+        StrCmp "${LINK_TO_JRE64}" "null" association 0
+        inetc::head /SILENT /TOSTACK ${LINK_TO_JRE64} "" /END
+        Pop $0
+        ${If} $0 == "OK"
+          !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 4" "Type" "checkbox"
+          !insertmacro INSTALLOPTIONS_WRITE "Desktop.ini" "Field 4" "Text" "Download and install 64-bit JRE by JetBrains (will be used with 64-bit launcher)"
         ${EndIf}
       ${EndIf}
     ${EndIf}
index 97aa7d75c7f46b9ab9a1329fe1ca45fd857d2d9c..ce78f3050ca0fc9e27f8f6ba806046b854d25800 100644 (file)
@@ -747,8 +747,6 @@ done:
 
   ;registration application to be presented in Open With list
   call ProductRegistration
-  ;reset icon cache
-  System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
 ; $STARTMENU_FOLDER stores name of IDEA folder in Start Menu,
 ; save it name in the "MenuFolder" RegValue
@@ -844,6 +842,9 @@ skip_properties:
     AccessControl::GrantOnFile \
       "$INSTDIR\bin\$0" "(S-1-5-32-545)" "GenericRead + GenericWrite"
   ${EndIf}
+
+  ;reset icon cache
+  System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v (0x08000000, 0, 0, 0)'
 SectionEnd
 
 ;------------------------------------------------------------------------------
index 65bd2e4078e4126f30d1135459394e40eba4e4de..8e437272bce90778dcaeed859d00ee28cafbde55 100644 (file)
@@ -2527,7 +2527,6 @@ com/intellij/openapi/ui/popup/ListPopupStep.class:/lib/openapi.jar
 com/intellij/openapi/ui/popup/PopupStep.class:/lib/openapi.jar
 com/intellij/execution/ExecutionException.class:/lib/openapi.jar
 com/intellij/execution/runners/Runner.class:/lib/openapi.jar
-com/intellij/tools/ToolProgramRunner.class:/lib/idea.jar
 com/intellij/execution/runners/DefaultProgramRunner.class:/lib/idea.jar
 com/intellij/execution/runners/GenericProgramRunner.class:/lib/openapi.jar
 com/intellij/execution/impl/DefaultJavaProgramRunner.class:/lib/idea.jar
index c21cd738319a0348ad89778e1d4e578c49d7a496..7a545785b89c00dfafe4583a855b51baa8ca645f 100644 (file)
@@ -90,6 +90,7 @@ def layoutJps(String home, String targetDir, String buildNumber, Closure additio
         include(name: "ecj*.jar")
         include(name: "netty-all-*.jar")
         include(name: "snappy-in-java-*.jar")
+        include(name: "xercesImpl.jar")
       }
       fileset(dir: "$home/jps/lib") {
         include(name: "optimizedFileManager.jar")
index 9ec8475173f0988eeb0c7ddf38a91949168a7b25..1876f91ab744874f3f32211e2e1081816f44d0f1 100644 (file)
@@ -506,6 +506,9 @@ public class CompilerManagerImpl extends CompilerManager {
       // ignore
     }
 
+    public void customOutputData(String pluginId, String dataName, byte[] data) {
+    }
+
     public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
       myDiagnostics.add(diagnostic);
     }
index 8a5095086a08cb6e867f7bcb167e32719a7485d2..bba107fcd03f26a2adfd7768d9ec0d8b5eb5ed6b 100644 (file)
@@ -23,9 +23,11 @@ import com.intellij.lang.injection.InjectedLanguageManager;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.application.ReadAction;
 import com.intellij.openapi.compiler.*;
+import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.fileTypes.FileType;
 import com.intellij.openapi.module.Module;
+import com.intellij.openapi.progress.ProcessCanceledException;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.ProjectFileIndex;
 import com.intellij.openapi.roots.ProjectRootManager;
@@ -62,6 +64,8 @@ import static com.intellij.psi.search.GlobalSearchScope.getScopeRestrictedByFile
 import static com.intellij.psi.search.GlobalSearchScope.notScope;
 
 public class CompilerReferenceServiceImpl extends CompilerReferenceService implements ModificationTracker {
+  private final static Logger LOG = Logger.getInstance(CompilerReferenceServiceImpl.class);
+
   private final Set<FileType> myFileTypes;
   private final DirtyModulesHolder myDirtyModulesHolder;
   private final ProjectFileIndex myProjectFileIndex;
@@ -105,7 +109,11 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple
 
         private void compilationFinished(int errors, CompileContext context) {
           Runnable compilationFinished = () -> {
-            final Module[] compilationModules = context.getCompileScope().getAffectedModules();
+            final Module[] compilationModules = ReadAction.compute(() -> {
+              if (myProject.isDisposed()) return null;
+              return context.getCompileScope().getAffectedModules();
+            });
+            if (compilationModules == null) return;
             Set<Module> modulesWithErrors;
             if (errors != 0) {
               modulesWithErrors = Stream.of(context.getMessages(CompilerMessageCategory.ERROR))
@@ -136,13 +144,18 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple
         CompileScope projectCompileScope = compilerManager.createProjectCompileScope(myProject);
         boolean isUpToDate = compilerManager.isUpToDate(projectCompileScope);
         executeOnBuildThread(() -> {
+          Module[] modules = ReadAction.compute(() -> {
+            if (myProject.isDisposed()) return null;
+            return projectCompileScope.getAffectedModules();
+          });
+          if (modules == null) return;
           if (isUpToDate) {
-            myDirtyModulesHolder.compilerActivityFinished(projectCompileScope.getAffectedModules(), Module.EMPTY_ARRAY);
+            myDirtyModulesHolder.compilerActivityFinished(modules, Module.EMPTY_ARRAY);
             myCompilationCount.increment();
             openReaderIfNeed();
           }
           else {
-            myDirtyModulesHolder.compilerActivityFinished(Module.EMPTY_ARRAY, projectCompileScope.getAffectedModules());
+            myDirtyModulesHolder.compilerActivityFinished(Module.EMPTY_ARRAY, modules);
           }
         });
       });
@@ -159,10 +172,16 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple
   public GlobalSearchScope getScopeWithoutCodeReferences(@NotNull PsiElement element) {
     if (!isServiceEnabledFor(element)) return null;
 
-    return CachedValuesManager.getCachedValue(element,
-                                              () -> CachedValueProvider.Result.create(calculateScopeWithoutReferences(element),
-                                                                                      PsiModificationTracker.MODIFICATION_COUNT,
-                                                                                      this));
+    try {
+      return CachedValuesManager.getCachedValue(element,
+                                                () -> CachedValueProvider.Result.create(calculateScopeWithoutReferences(element),
+                                                                                        PsiModificationTracker.MODIFICATION_COUNT,
+                                                                                        this));
+    }
+    catch (Exception e) {
+      LOG.error("an exception during scope without code references calculation", e);
+      return null;
+    }
   }
 
   @Nullable
@@ -191,24 +210,34 @@ public class CompilerReferenceServiceImpl extends CompilerReferenceService imple
                                                      @NotNull CompilerHierarchySearchType searchType) {
     if (!isServiceEnabledFor(aClass) || searchScope == LibraryScopeCache.getInstance(myProject).getLibrariesOnlyScope()) return null;
 
-    Map<VirtualFile, Object[]> candidatesPerFile = ReadAction.compute(() -> CachedValuesManager.getCachedValue(aClass, () -> CachedValueProvider.Result.create(
-      new ConcurrentFactoryMap<HierarchySearchKey, Map<VirtualFile, Object[]>>() {
-        @Nullable
-        @Override
-        protected Map<VirtualFile, Object[]> create(HierarchySearchKey key) {
-          return calculateDirectInheritors(aClass,
-                                           useScope,
-                                           key.mySearchFileType,
-                                           key.mySearchType);
-        }
-      }, PsiModificationTracker.MODIFICATION_COUNT, this)).get(new HierarchySearchKey(searchType, searchFileType)));
+    try {
+
+      Map<VirtualFile, Object[]> candidatesPerFile = ReadAction.compute(() -> {
+        if (myProject.isDisposed()) throw new ProcessCanceledException();
+        return CachedValuesManager.getCachedValue(aClass, () -> CachedValueProvider.Result.create(
+          new ConcurrentFactoryMap<HierarchySearchKey, Map<VirtualFile, Object[]>>() {
+            @Nullable
+            @Override
+            protected Map<VirtualFile, Object[]> create(HierarchySearchKey key) {
+              return calculateDirectInheritors(aClass,
+                                               useScope,
+                                               key.mySearchFileType,
+                                               key.mySearchType);
+            }
+          }, PsiModificationTracker.MODIFICATION_COUNT, this)).get(new HierarchySearchKey(searchType, searchFileType));
+      });
 
-    if (candidatesPerFile == null) return null;
-    GlobalSearchScope dirtyScope = myDirtyModulesHolder.getDirtyScope();
-    if (ElementPlace.LIB == ReadAction.compute(() -> ElementPlace.get(aClass.getContainingFile().getVirtualFile(), myProjectFileIndex))) {
-      dirtyScope = dirtyScope.union(LibraryScopeCache.getInstance(myProject).getLibrariesOnlyScope());
+      if (candidatesPerFile == null) return null;
+      GlobalSearchScope dirtyScope = myDirtyModulesHolder.getDirtyScope();
+      if (ElementPlace.LIB == ReadAction.compute(() -> ElementPlace.get(aClass.getContainingFile().getVirtualFile(), myProjectFileIndex))) {
+        dirtyScope = dirtyScope.union(LibraryScopeCache.getInstance(myProject).getLibrariesOnlyScope());
+      }
+      return new CompilerHierarchyInfoImpl(candidatesPerFile, aClass, dirtyScope, searchScope, myProject, searchFileType, searchType);
+    }
+    catch (Exception e) {
+      LOG.error("an exception during hierarchy calculation", e);
+      return null;
     }
-    return new CompilerHierarchyInfoImpl(candidatesPerFile, aClass, dirtyScope, searchScope, myProject, searchFileType, searchType);
   }
 
   private boolean isServiceEnabledFor(PsiElement element) {
index 85ee4332c3bd25894c8d5fdddbd397a32911bdc0..f9c1fb95c3a7d6d778ba0a6cbf6d0a1d2f699182 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.application.ReadAction;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.module.Module;
+import com.intellij.openapi.progress.ProcessCanceledException;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.UserDataHolderBase;
 import com.intellij.openapi.vfs.*;
@@ -77,8 +78,11 @@ public class DirtyModulesHolder extends UserDataHolderBase {
       if (myCompilationPhase) {
         return GlobalSearchScope.allScope(project);
       }
-      return ReadAction.compute(() -> CachedValuesManager.getManager(project).getCachedValue(this, () ->
-        CachedValueProvider.Result.create(calculateDirtyModules(), PsiModificationTracker.MODIFICATION_COUNT, VirtualFileManager.getInstance(), myService)));
+      return ReadAction.compute(() -> {
+        if (project.isDisposed()) throw new ProcessCanceledException();
+        return CachedValuesManager.getManager(project).getCachedValue(this, () ->
+          CachedValueProvider.Result.create(calculateDirtyModules(), PsiModificationTracker.MODIFICATION_COUNT, VirtualFileManager.getInstance(), myService));
+      });
     }
   }
 
index 6d2715b2950811eddda0f588819bd747337a4fd8..2515626152bb9f094bcf45c8cf0149a0e74de459 100644 (file)
@@ -48,10 +48,10 @@ class JavaModuleIndexBuildTask : CompileTask {
     } ?: return false
 
     try {
-      val systemDir = BuildManager.getInstance().getProjectSystemDirectory(project)!!
+      val systemDir = BuildManager.getInstance().getProjectSystemDirectory(project) ?: error("No system directory for project: ${project}")
       JavaModuleIndexImpl.store(BuildDataPathsImpl(systemDir).dataStorageRoot, map)
     }
-    catch(e: Exception) {
+    catch(e: Throwable) {
       Logger.getInstance(JavaModuleIndexBuildTask::class.java).error(e)
       context.addMessage(CompilerMessageCategory.ERROR, "Failed to save module index file: ${e.message}", null, 0, 0)
       return false
index 10d8b5d9481e94b21730f44675eedf236af430c2..adcf39da3d8bce9ff6ae47614bb51d20cf1330bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2016 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.
  */
 package com.intellij.openapi.compiler.ex;
 
+import com.intellij.ide.util.JavaAnonymousClassesHelper;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.compiler.CompilerPaths;
 import com.intellij.openapi.module.Module;
+import com.intellij.openapi.module.ModuleUtilCore;
 import com.intellij.openapi.progress.ProgressManager;
-import com.intellij.openapi.roots.CompilerModuleExtension;
-import com.intellij.openapi.roots.ModuleRootManager;
-import com.intellij.openapi.roots.OrderEnumerationHandler;
-import com.intellij.openapi.roots.OrderRootType;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.*;
+import com.intellij.openapi.util.io.FileUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.vfs.VirtualFileManager;
+import com.intellij.psi.JavaPsiFacade;
+import com.intellij.psi.PsiAnonymousClass;
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiFile;
+import com.intellij.psi.util.ClassUtil;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.PsiUtil;
+import com.intellij.psi.util.PsiUtilCore;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.SmartList;
 import com.intellij.util.StringBuilderSpinAllocator;
 import com.intellij.util.containers.OrderedSet;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.Collection;
 import java.util.List;
 import java.util.Set;
@@ -109,4 +121,101 @@ public class CompilerPathsEx extends CompilerPaths {
     }
     return ArrayUtil.toStringArray(outputPaths);
   }
+
+  /**
+   * Presents .class file in form of {@link File} for files inside output directories or {@link VirtualFile} inside jars for library classes.
+   * Building virtual files for output directories is not feasible for the task and io.File won't work inside jars.
+   */
+  public interface ClassFileDescriptor {
+    /**
+     * Loads content of the class file
+     */
+    byte[] loadFileBytes() throws IOException;
+
+    /**
+     * Returns system independent path to the class file
+     */
+    String getPath();
+  }
+
+  @Nullable
+  public static ClassFileDescriptor findClassFileInOutput(@NotNull PsiClass sourceClass) {
+    String classVMName = getClassVMName(sourceClass);
+    if (classVMName == null) {
+      return null;
+    }
+    Module module = ModuleUtilCore.findModuleForPsiElement(sourceClass);
+    if (module == null){
+      final Project project = sourceClass.getProject();
+      final PsiClass topLevelClass = PsiUtil.getTopLevelClass(sourceClass);
+      final String qualifiedName = topLevelClass != null ? topLevelClass.getQualifiedName() : null;
+      final PsiClass aClass = qualifiedName != null
+                              ? JavaPsiFacade.getInstance(project).findClass(qualifiedName, sourceClass.getResolveScope())
+                              : null;
+      if (aClass != null) {
+        final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(aClass);
+        final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
+        if (virtualFile != null && fileIndex.isInLibraryClasses(virtualFile)) {
+          return new ClassFileDescriptor() {
+            @Override
+            public byte[] loadFileBytes() throws IOException {
+              return virtualFile.contentsToByteArray();
+            }
+
+            @Override
+            public String getPath() {
+              return virtualFile.getPath();
+            }
+          };
+        }
+      }
+      return null;
+    }
+
+    final PsiFile containingFile = sourceClass.getContainingFile();
+    final VirtualFile virtualFile = containingFile.getVirtualFile();
+    if (virtualFile == null) return null;
+    final CompilerModuleExtension moduleExtension = CompilerModuleExtension.getInstance(module);
+    if (moduleExtension == null) return null;
+    VirtualFile classRoot;
+    if (ProjectRootManager.getInstance(module.getProject()).getFileIndex().isInTestSourceContent(virtualFile)) {
+      classRoot = moduleExtension.getCompilerOutputPathForTests();
+    }
+    else {
+      classRoot = moduleExtension.getCompilerOutputPath();
+    }
+    if (classRoot == null) return null;
+
+    String classFilePath = classRoot.getPath() + "/" + classVMName.replace('.', '/') + ".class";
+
+    final File classFile = new File(classFilePath);
+    if (!classFile.exists()) {
+      return null;
+    }
+    return new ClassFileDescriptor() {
+      @Override
+      public byte[] loadFileBytes() throws IOException {
+        return FileUtil.loadFileBytes(classFile);
+      }
+
+      @Override
+      public String getPath() {
+        return FileUtil.toSystemIndependentName(classFile.getPath());
+      }
+    };
+  }
+
+  @Nullable
+  private static String getClassVMName(PsiClass containingClass) {
+    if (containingClass instanceof PsiAnonymousClass) {
+      final PsiClass containingClassOfAnonymous = PsiTreeUtil.getParentOfType(containingClass, PsiClass.class);
+      if (containingClassOfAnonymous == null) {
+        return null;
+      }
+      return getClassVMName(containingClassOfAnonymous) +
+             JavaAnonymousClassesHelper.getName((PsiAnonymousClass)containingClass);
+    }
+    return ClassUtil.getJVMClassName(containingClass);
+  }
+
 }
index 521fa468950167ef72d6a273190c0fb3276c5444..a6f570cbbf7843f0da0e5ce588e247b9170b060d 100644 (file)
@@ -344,7 +344,7 @@ public class JavaSmartStepIntoHandler extends JvmSmartStepIntoHandler {
                   });
                 }
               }
-            });
+            }, true);
           }
           catch (Exception e) {
             LOG.info(e);
index cac1fd7a0adda9e475626b2310ded36f9d2b993c..85f164ec4e0ea73d5f1c22c537a9d4b9943cc5eb 100644 (file)
@@ -99,7 +99,7 @@ public class JumpToObjectAction extends DebuggerAction{
       if (type instanceof ClassType) {
         ClassType clsType = (ClassType)type;
 
-        Method lambdaMethod = MethodBytecodeUtil.getLambdaMethod(clsType);
+        Method lambdaMethod = MethodBytecodeUtil.getLambdaMethod(clsType, debugProcess.getVirtualMachineProxy());
         Location location = lambdaMethod != null ? ContainerUtil.getFirstItem(DebuggerUtilsEx.allLineLocations(lambdaMethod)) : null;
 
         if (location == null) {
index c5eb7951615e6bba03027d6cfa07e9342065cce6..7b4a6f97c8123cebaab0aaba0237cc9b0b2c19e8 100644 (file)
@@ -24,7 +24,6 @@ import com.intellij.psi.impl.PsiJavaParserFacadeImpl;
 import com.sun.jdi.*;
 
 import java.util.Collections;
-import java.util.List;
 
 /**
  * @author Eugene Zhuravlev
@@ -59,14 +58,14 @@ public class BoxingEvaluator implements Evaluator{
     final ClassType wrapperClass = (ClassType)process.findClass(context, wrapperTypeName, null);
     final String methodSignature = "(" + JVMNameUtil.getPrimitiveSignature(value.type().name()) + ")L" + wrapperTypeName.replace('.', '/') + ";";
 
-    List<Method> methods = wrapperClass.methodsByName("valueOf", methodSignature);
-    if (methods.size() == 0) { // older JDK version
-      methods = wrapperClass.methodsByName(JVMNameUtil.CONSTRUCTOR_NAME, methodSignature);
+    Method method = wrapperClass.concreteMethodByName("valueOf", methodSignature);
+    if (method == null) { // older JDK version
+      method = wrapperClass.concreteMethodByName(JVMNameUtil.CONSTRUCTOR_NAME, methodSignature);
     }
-    if (methods.size() == 0) {
+    if (method == null) {
       throw new EvaluateException("Cannot construct wrapper object for value of type " + value.type() + ": Unable to find either valueOf() or constructor method");
     }
 
-    return process.invokeMethod(context, wrapperClass, methods.get(0), Collections.singletonList(value));
+    return process.invokeMethod(context, wrapperClass, method, Collections.singletonList(value));
   }
 }
index 1d949dd7bbcae797d25073d780a6935c0dc664eb..0754fc7c9d3461964af701d1b9b478411a118035 100644 (file)
@@ -26,6 +26,11 @@ import com.intellij.debugger.engine.evaluation.EvaluateExceptionUtil;
 import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
 import com.intellij.debugger.impl.DebuggerUtilsEx;
 import com.intellij.debugger.jdi.VirtualMachineProxyImpl;
+import com.sun.jdi.ClassType;
+import com.sun.jdi.Method;
+import com.sun.jdi.StringReference;
+
+import java.util.Collections;
 
 class LiteralEvaluator implements Evaluator {
   private final Object myValue;
@@ -57,7 +62,15 @@ class LiteralEvaluator implements Evaluator {
       return DebuggerUtilsEx.createValue(vm, myExpectedType, ((Number)myValue).longValue());
     }
     if (myValue instanceof String) {
-      return vm.mirrorOf((String)myValue);
+      StringReference str = vm.mirrorOf((String)myValue);
+      // intern starting from jdk 7
+      if (vm.versionHigher("1.7")) {
+        Method internMethod = ((ClassType)str.referenceType()).concreteMethodByName("intern", "()Ljava/lang/String;");
+        if (internMethod != null) {
+          return context.getDebugProcess().invokeMethod(context, str, internMethod, Collections.emptyList());
+        }
+      }
+      return str;
     }
     throw EvaluateExceptionUtil
       .createEvaluateException(DebuggerBundle.message("evaluation.error.unknown.expression.type", myExpectedType));
index 1fc91c33179c18079080c6365eb31b5a60f51f29..7dce81bf675cb06ede7ed61f0ac94677d79548c8 100644 (file)
@@ -29,7 +29,6 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 
 /**
@@ -80,12 +79,12 @@ public class UnBoxingEvaluator implements Evaluator{
                                           String conversionMethodSignature) throws EvaluateException {
     final DebugProcessImpl process = context.getDebugProcess();
     final ClassType wrapperClass = (ClassType)value.referenceType();
-    final List<Method> methods = wrapperClass.methodsByName(conversionMethodName, conversionMethodSignature);
-    if (methods.size() == 0) { 
+    Method method = wrapperClass.concreteMethodByName(conversionMethodName, conversionMethodSignature);
+    if (method == null) {
       throw new EvaluateException("Cannot convert to primitive value of type " + value.type() + ": Unable to find method " +
                                   conversionMethodName + conversionMethodSignature);
     }
 
-    return process.invokeMethod(context, value, methods.get(0), Collections.emptyList());
+    return process.invokeMethod(context, value, method, Collections.emptyList());
   }
 }
\ No newline at end of file
index 9a708e761ff97a4f98f0a1b94ba212b9f9f42133..9c22e2a6b1604e7342c59d19712573810f408ab6 100644 (file)
@@ -301,7 +301,7 @@ public class LocalVariablesUtil {
                }
              }
            }
-          });
+          }, false);
         if (usedVars.isEmpty()) {
           return Collections.emptyList();
         }
index d490f072182fa5ef006987a3abdb69259a4b2096..f8b06bfd24bcc2a909f2c1d8a2718a13afcd15c4 100644 (file)
 package com.intellij.debugger.jdi;
 
 import com.intellij.Patches;
+import com.intellij.debugger.engine.DebuggerUtils;
+import com.intellij.debugger.engine.jdi.VirtualMachineProxy;
 import com.intellij.debugger.impl.DebuggerUtilsEx;
 import com.intellij.openapi.util.Ref;
 import com.intellij.util.ReflectionUtil;
 import com.intellij.util.ThrowableConsumer;
 import com.intellij.util.containers.ContainerUtil;
 import com.sun.jdi.*;
-import one.util.streamex.StreamEx;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.org.objectweb.asm.*;
@@ -31,6 +32,7 @@ import org.jetbrains.org.objectweb.asm.Type;
 import java.io.ByteArrayOutputStream;
 import java.io.DataOutputStream;
 import java.io.IOException;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -45,16 +47,16 @@ public class MethodBytecodeUtil {
   /**
    * Allows to use ASM MethodVisitor with jdi method bytecode
    */
-  public static void visit(Method method, MethodVisitor methodVisitor) {
-    visit(method, method.bytecodes(), methodVisitor);
+  public static void visit(Method method, MethodVisitor methodVisitor, boolean withLineNumbers) {
+    visit(method, method.bytecodes(), methodVisitor, withLineNumbers);
   }
 
-  public static void visit(Method method, long maxOffset, MethodVisitor methodVisitor) {
+  public static void visit(Method method, long maxOffset, MethodVisitor methodVisitor, boolean withLineNumbers) {
     // need to keep the size, otherwise labels array will not be initialized correctly
     byte[] originalBytecodes = method.bytecodes();
     byte[] bytecodes = new byte[originalBytecodes.length];
     System.arraycopy(originalBytecodes, 0, bytecodes, 0, (int)maxOffset);
-    visit(method, bytecodes, methodVisitor);
+    visit(method, bytecodes, methodVisitor, withLineNumbers);
   }
 
   public static byte[] getConstantPool(ReferenceType type) {
@@ -72,7 +74,7 @@ public class MethodBytecodeUtil {
     }
   }
 
-  private static void visit(Method method, byte[] bytecodes, MethodVisitor methodVisitor) {
+  private static void visit(Method method, byte[] bytecodes, MethodVisitor methodVisitor, boolean withLineNumbers) {
     ReferenceType type = method.declaringType();
     try {
       try (ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream dos = new DataOutputStream(bos)) {
@@ -110,7 +112,7 @@ public class MethodBytecodeUtil {
         }
 
         MethodVisitor mv = writer.visitMethod(Opcodes.ACC_PUBLIC, method.name(), method.signature(), method.signature(), null);
-        mv.visitAttribute(createCode(writer, method, bytecodes));
+        mv.visitAttribute(createCode(writer, method, bytecodes, withLineNumbers));
 
         new ClassReader(writer.toByteArray()).accept(new ClassVisitor(Opcodes.API_VERSION) {
           @Override
@@ -183,14 +185,14 @@ public class MethodBytecodeUtil {
   }
 
   @NotNull
-  private static Attribute createCode(ClassWriter cw, Method method, byte[] bytecodes) throws IOException {
+  private static Attribute createCode(ClassWriter cw, Method method, byte[] bytecodes, boolean withLineNumbers) throws IOException {
     return createAttribute("Code", dos -> {
       dos.writeShort(0); // max_stack
       dos.writeShort(0); // max_locals
       dos.writeInt(bytecodes.length);  // code_length
       dos.write(bytecodes); // code
       dos.writeShort(0); // exception_table_length
-      List<Location> locations = DebuggerUtilsEx.allLineLocations(method);
+      List<Location> locations = withLineNumbers ? DebuggerUtilsEx.allLineLocations(method) : Collections.emptyList();
       if (!locations.isEmpty()) {
         dos.writeShort(1); // attributes_count
         dos.writeShort(cw.newUTF8("LineNumberTable"));
@@ -232,7 +234,7 @@ public class MethodBytecodeUtil {
   }
 
   @Nullable
-  public static Method getLambdaMethod(ReferenceType clsType) {
+  public static Method getLambdaMethod(ReferenceType clsType, VirtualMachineProxy vm) {
     Ref<Method> methodRef = Ref.create();
     if (DebuggerUtilsEx.isLambdaClassName(clsType.name())) {
       List<Method> applicableMethods = ContainerUtil.filter(clsType.methods(), m -> m.isPublic() && !m.isBridge());
@@ -240,30 +242,44 @@ public class MethodBytecodeUtil {
         visit(applicableMethods.get(0), new MethodVisitor(Opcodes.API_VERSION) {
           @Override
           public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
-            ReferenceType cls = ContainerUtil.getFirstItem(clsType.virtualMachine().classesByName(owner));
+            ReferenceType cls = ContainerUtil.getFirstItem(vm.classesByName(owner.replace("/", ".")));
             if (cls != null) {
-              cls.methodsByName(name).stream().findFirst().ifPresent(methodRef::set);
+              Method method = DebuggerUtils.findMethod(cls, name, desc);
+              if (method != null) {
+                methodRef.setIfNull(method);
+              }
             }
           }
-        });
+        }, false);
       }
     }
     return methodRef.get();
   }
 
   @Nullable
-  public static Method getBridgeTargetMethod(Method method) {
+  public static Method getBridgeTargetMethod(Method method, VirtualMachineProxy vm) {
     Ref<Method> methodRef = Ref.create();
     if (method.isBridge()) {
       visit(method, new MethodVisitor(Opcodes.API_VERSION) {
         @Override
         public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) {
-          ReferenceType cls = ContainerUtil.getFirstItem(method.virtualMachine().classesByName(owner));
+          ReferenceType declaringType = method.declaringType();
+          ReferenceType cls = null;
+          owner = owner.replace("/", ".");
+          if (declaringType.name().equals(owner)) {
+            cls = declaringType;
+          }
+          else if (!"java.lang.AbstractMethodError".equals(owner)) {
+            cls = ContainerUtil.getFirstItem(vm.classesByName(owner));
+          }
           if (cls != null) {
-            StreamEx.of(cls.methodsByName(name)).without(method).findFirst().ifPresent(methodRef::set);
+            Method method = DebuggerUtils.findMethod(cls, name, desc);
+            if (method != null) {
+              methodRef.setIfNull(method);
+            }
           }
         }
-      });
+      }, false);
     }
     return methodRef.get();
   }
index 5b80d55143718066950882f7e1f6ecbde711d14b..ec48c6c5b860ba21d08aacf94bc793e68cb305f4 100644 (file)
@@ -30,6 +30,7 @@ import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.util.ReflectionUtil;
 import com.intellij.util.ThreeState;
 import com.intellij.util.containers.HashMap;
+import com.intellij.util.containers.MultiMap;
 import com.sun.jdi.*;
 import com.sun.jdi.event.EventQueue;
 import com.sun.jdi.request.EventRequestManager;
@@ -56,6 +57,7 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
   private final Map<ThreadGroupReference, ThreadGroupReferenceProxyImpl> myThreadGroups = new HashMap<>();
   private boolean myAllThreadsDirty = true;
   private List<ReferenceType> myAllClasses;
+  private MultiMap<String, ReferenceType> myAllClassesByName;
   private Map<ReferenceType, List<ReferenceType>> myNestedClassesCache = new HashMap<>();
 
   public final Throwable mySuspendLogger = new Throwable();
@@ -96,7 +98,11 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
   }
 
   public List<ReferenceType> classesByName(String s) {
-    return myVirtualMachine.classesByName(s);
+    if (myAllClassesByName == null) {
+      myAllClassesByName = new MultiMap<>();
+      allClasses().forEach(t -> myAllClassesByName.putValue(t.name(), t));
+    }
+    return (List<ReferenceType>)myAllClassesByName.get(s);
   }
 
   public List<ReferenceType> nestedTypes(ReferenceType refType) {
@@ -641,6 +647,8 @@ public class VirtualMachineProxyImpl implements JdiTimer, VirtualMachineProxy {
     LOG.debug("VM cleared");
 
     myAllClasses = null;
+    myAllClassesByName = null;
+
     if (!myNestedClassesCache.isEmpty()) {
       myNestedClassesCache = new HashMap<>(myNestedClassesCache.size());
     }
index 5821bd92ed2c2aa51a49f486864a000e95558177..034017a49c224a47185680773ed61f39c743f3d5 100644 (file)
@@ -129,4 +129,8 @@ public class RendererConfiguration implements Cloneable, JDOMExternalizable {
   public int getRendererCount() {
     return myRepresentationNodes.size();
   }
+
+  public boolean contains(NodeRenderer renderer) {
+    return myRepresentationNodes.contains(renderer);
+  }
 }
index 85a86a1ac04ed4536ec98605a794355e9b5e6d3f..092538a3d789bef5771bce6bae557bdc8eb241ff 100644 (file)
@@ -60,7 +60,9 @@ import com.intellij.xdebugger.impl.breakpoints.XDependentBreakpointManager;
 import com.intellij.xdebugger.impl.breakpoints.XLineBreakpointImpl;
 import com.sun.jdi.InternalException;
 import com.sun.jdi.ThreadReference;
-import com.sun.jdi.request.*;
+import com.sun.jdi.request.EventRequest;
+import com.sun.jdi.request.EventRequestManager;
+import com.sun.jdi.request.InvalidRequestStateException;
 import gnu.trove.THashMap;
 import org.jdom.Element;
 import org.jetbrains.annotations.NonNls;
@@ -72,6 +74,7 @@ import javax.swing.*;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.function.Consumer;
 
 public class BreakpointManager {
   private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.breakpoints.BreakpointManager");
@@ -555,52 +558,29 @@ public class BreakpointManager {
     else {
       // important! need to add filter to _existing_ requests, otherwise Requestor->Request mapping will be lost
       // and debugger trees will not be restored to original state
-      abstract class FilterSetter <T extends EventRequest> {
-         void applyFilter(@NotNull final List<T> requests, final ThreadReference thread) {
-          for (T request : requests) {
-            try {
-              final boolean wasEnabled = request.isEnabled();
-              if (wasEnabled) {
-                request.disable();
-              }
-              addFilter(request, thread);
-              if (wasEnabled) {
-                request.enable();
-              }
-            }
-            catch (InternalException e) {
-              LOG.info(e);
-            }
-            catch (InvalidRequestStateException e) {
-              LOG.info(e);
-            }
-          }
-        }
-        protected abstract void addFilter(final T request, final ThreadReference thread);
-      }
-
-      final EventRequestManager eventRequestManager = requestManager.getVMRequestManager();
+      EventRequestManager eventRequestManager = requestManager.getVMRequestManager();
       if (eventRequestManager != null) {
-        new FilterSetter<BreakpointRequest>() {
-          @Override
-          protected void addFilter(@NotNull final BreakpointRequest request, final ThreadReference thread) {
-            request.addThreadFilter(thread);
-          }
-        }.applyFilter(eventRequestManager.breakpointRequests(), newFilterThread);
-
-        new FilterSetter<MethodEntryRequest>() {
-          @Override
-          protected void addFilter(@NotNull final MethodEntryRequest request, final ThreadReference thread) {
-            request.addThreadFilter(thread);
-          }
-        }.applyFilter(eventRequestManager.methodEntryRequests(), newFilterThread);
+        applyFilter(eventRequestManager.breakpointRequests(), request -> request.addThreadFilter(newFilterThread));
+        applyFilter(eventRequestManager.methodEntryRequests(), request -> request.addThreadFilter(newFilterThread));
+        applyFilter(eventRequestManager.methodExitRequests(), request -> request.addThreadFilter(newFilterThread));
+      }
+    }
+  }
 
-        new FilterSetter<MethodExitRequest>() {
-          @Override
-          protected void addFilter(@NotNull final MethodExitRequest request, final ThreadReference thread) {
-            request.addThreadFilter(thread);
-          }
-        }.applyFilter(eventRequestManager.methodExitRequests(), newFilterThread);
+  private static <T extends EventRequest> void applyFilter(@NotNull List<T> requests, Consumer<T> setter) {
+    for (T request : requests) {
+      try {
+        boolean wasEnabled = request.isEnabled();
+        if (wasEnabled) {
+          request.disable();
+        }
+        setter.accept(request);
+        if (wasEnabled) {
+          request.enable();
+        }
+      }
+      catch (InternalException | InvalidRequestStateException e) {
+        LOG.info(e);
       }
     }
   }
@@ -620,12 +600,6 @@ public class BreakpointManager {
     breakpoint.updateUI();
   }
 
-  public void setBreakpointEnabled(@NotNull final Breakpoint breakpoint, final boolean enabled) {
-    if (breakpoint.isEnabled() != enabled) {
-      breakpoint.setEnabled(enabled);
-    }
-  }
-
   @Nullable
   public Breakpoint findMasterBreakpoint(@NotNull Breakpoint dependentBreakpoint) {
     XDependentBreakpointManager dependentBreakpointManager = ((XBreakpointManagerImpl)getXBreakpointManager()).getDependentBreakpointManager();
index a25fd2775cfa16cd614192f3f5a21faab78b7292..491529c1c3119272f0b947d15587cb84a29b4628 100644 (file)
@@ -38,6 +38,9 @@ import com.intellij.icons.AllIcons;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.progress.ProgressIndicator;
+import com.intellij.openapi.progress.ProgressManager;
+import com.intellij.openapi.progress.util.ProgressWindowWithNotification;
 import com.intellij.openapi.project.IndexNotReadyException;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Computable;
@@ -71,6 +74,7 @@ import org.jetbrains.org.objectweb.asm.Opcodes;
 
 import javax.swing.*;
 import java.util.List;
+import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Consumer;
 import java.util.stream.Stream;
 
@@ -145,7 +149,16 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
       request.enable();
     }
 
-    processSubTypes(baseType, subType -> createRequestForPreparedClassEmulated(debugProcess, subType, false));
+    AtomicReference<ProgressIndicator> indicatorRef = new AtomicReference<>();
+    ApplicationManager.getApplication().invokeAndWait(() -> indicatorRef.set(new ProgressWindowWithNotification(true, myProject)));
+    ProgressIndicator indicator = indicatorRef.get();
+    ProgressManager.getInstance().executeProcessUnderProgress(
+      () -> processSubTypes(baseType, subType -> createRequestForPreparedClassEmulated(debugProcess, subType, false), indicator),
+      indicator);
+    if (indicator.isCanceled()) {
+      ApplicationManager.getApplication().invokeLater(
+        () -> DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().removeBreakpoint(this));
+    }
   }
 
   private void createRequestForPreparedClassEmulated(@NotNull DebugProcessImpl debugProcess, @NotNull ReferenceType classType, boolean base) {
@@ -153,7 +166,7 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
       return;
     }
     try {
-      Method method = MethodBytecodeUtil.getLambdaMethod(classType);
+      Method method = MethodBytecodeUtil.getLambdaMethod(classType, debugProcess.getVirtualMachineProxy());
       if (method == null) {
         for (Method m : classType.methods()) {
           if (!base && m.isAbstract()) {
@@ -166,7 +179,14 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
         }
       }
       if (method != null) {
-        Method target = MethodBytecodeUtil.getBridgeTargetMethod(method);
+        if (base && method.isNative()) {
+          ApplicationManager.getApplication().invokeLater(() -> {
+            getProperties().EMULATED = false;
+            fireBreakpointChanged();
+          });
+          return;
+        }
+        Method target = MethodBytecodeUtil.getBridgeTargetMethod(method, debugProcess.getVirtualMachineProxy());
         if (target != null && !DebuggerUtilsEx.allLineLocations(target).isEmpty()) {
           method = target;
         }
@@ -199,7 +219,7 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
                       .findFirst().ifPresent(location -> createLocationBreakpointRequest(location, debugProcess));
                 }
               }
-            });
+            }, true);
           }
         }
         if (base) {
@@ -519,18 +539,39 @@ public class MethodBreakpoint extends BreakpointWithHighlighter<JavaMethodBreakp
     return StreamEx.empty();
   }
 
-  private static void processSubTypes(ReferenceType classType, Consumer<ReferenceType> consumer) {
+  private static void processSubTypes(ReferenceType classType, Consumer<ReferenceType> consumer, ProgressIndicator progressIndicator) {
     long start = 0;
     if (LOG.isDebugEnabled()) {
       start = System.currentTimeMillis();
     }
+    progressIndicator.start();
+    progressIndicator.setText(DebuggerBundle.message("label.method.breakpoints.processing.classes"));
+    try {
+      progressIndicator.setIndeterminate(true);
 
-    MultiMap<ReferenceType, ReferenceType> inheritance = new MultiMap<>();
-    classType.virtualMachine().allClasses().forEach(type -> supertypes(type).forEach(st -> inheritance.putValue(st, type)));
-    StreamEx.ofTree(classType, t -> StreamEx.of(inheritance.get(t))).skip(1).forEach(consumer);
+      MultiMap<ReferenceType, ReferenceType> inheritance = new MultiMap<>();
+      classType.virtualMachine().allClasses().stream()
+        .filter(ReferenceType::isPrepared)
+        .forEach(type -> supertypes(type).forEach(st -> inheritance.putValue(st, type)));
+      List<ReferenceType> types = StreamEx.ofTree(classType, t -> StreamEx.of(inheritance.get(t))).skip(1).toList();
 
-    if (LOG.isDebugEnabled()) {
-      LOG.debug("Processing all classes took: " + String.valueOf(System.currentTimeMillis() - start) + "ms");
+      progressIndicator.setIndeterminate(false);
+      for (int i = 0; i < types.size(); i++) {
+        if (progressIndicator.isCanceled()) {
+          break;
+        }
+        consumer.accept(types.get(i));
+
+        progressIndicator.setText2(i + "/" + types.size());
+        progressIndicator.setFraction((double)i / types.size());
+      }
+
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Processed " + types.size() + " classes in " + String.valueOf(System.currentTimeMillis() - start) + "ms");
+      }
+    }
+    finally {
+      progressIndicator.stop();
     }
   }
 }
index 6d6e30e1c8f45c990ba929060baa1fc8361d3b4b..eac2694d42eb6dd0e84d2fde6d9e716e6a27fa93 100644 (file)
@@ -47,7 +47,7 @@ public class MethodBreakpointPropertiesPanel extends XBreakpointCustomProperties
   public JComponent getComponent() {
     JPanel _panel, _panel0;
 
-    myEmulatedCheckBox = new JCheckBox("Emulated");
+    myEmulatedCheckBox = new JCheckBox(DebuggerBundle.message("label.method.breakpoint.properties.panel.emulated"));
     myWatchEntryCheckBox = new JCheckBox(DebuggerBundle.message("label.method.breakpoint.properties.panel.method.entry"));
     myWatchExitCheckBox = new JCheckBox(DebuggerBundle.message("label.method.breakpoint.properties.panel.method.exit"));
     DialogUtil.registerMnemonic(myWatchEntryCheckBox);
index 98158cdbb9f0fda0b93de10fbf3585bc786d250c..874c0f7a4bdd1a56908c21b39b1bded837ff2cd6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 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.
@@ -47,7 +47,6 @@ import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import java.util.Collections;
-import java.util.List;
 import java.util.Map;
 
 public abstract class ValueDescriptorImpl extends NodeDescriptorImpl implements ValueDescriptor{
@@ -235,11 +234,11 @@ public abstract class ValueDescriptorImpl extends NodeDescriptorImpl implements
     final ObjectReference exceptionObj = ex.getExceptionFromTargetVM();
     if (exceptionObj != null && evaluationContext != null) {
       try {
-        final ReferenceType refType = exceptionObj.referenceType();
-        final List<Method> methods = refType.methodsByName("getStackTrace", "()[Ljava/lang/StackTraceElement;");
-        if (methods.size() > 0) {
+        ClassType refType = (ClassType)exceptionObj.referenceType();
+        Method method = refType.concreteMethodByName("getStackTrace", "()[Ljava/lang/StackTraceElement;");
+        if (method != null) {
           final DebugProcessImpl process = evaluationContext.getDebugProcess();
-          process.invokeMethod(evaluationContext, exceptionObj, methods.get(0), Collections.emptyList());
+          process.invokeMethod(evaluationContext, exceptionObj, method, Collections.emptyList());
           
           // print to console as well
           
@@ -260,9 +259,7 @@ public abstract class ValueDescriptorImpl extends NodeDescriptorImpl implements
           }
         }
       }
-      catch (EvaluateException ignored) {
-      }
-      catch (ClassNotLoadedException ignored) {
+      catch (EvaluateException | ClassNotLoadedException ignored) {
       }
       catch (Throwable e) {
         LOG.info(e); // catch all exceptions to ensure the method returns gracefully
index 7ecebbcb3f33705c0f4168d4f1e4db4507d98d75..757df14603832eb31f7f2fc5721ad0336dcf43ec 100644 (file)
@@ -86,6 +86,7 @@ public class CustomFieldInplaceEditor extends XDebuggerTreeInplaceEditor {
 
         Renderer lastRenderer = descriptor.getLastRenderer();
         if (lastRenderer instanceof CompoundNodeRenderer &&
+            NodeRendererSettings.getInstance().getCustomRenderers().contains((NodeRenderer)lastRenderer) &&
             !(((CompoundNodeRenderer)lastRenderer).getChildrenRenderer() instanceof ExpressionChildrenRenderer)) {
             ((CompoundNodeRenderer)lastRenderer).setChildrenRenderer(enumerationChildrenRenderer);
         }
index c2f606d7daa7c0f23f7d272300f7b7e21fe452cb..ca75cbbbd69f1ec789821fe694021d8708221b83 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.debugger.engine.evaluation.EvaluateException;
 import com.intellij.debugger.engine.evaluation.EvaluationContext;
 import com.intellij.debugger.engine.evaluation.TextWithImports;
 import com.intellij.debugger.impl.descriptors.data.UserExpressionData;
+import com.intellij.debugger.settings.NodeRendererSettings;
 import com.intellij.debugger.ui.impl.watch.ValueDescriptorImpl;
 import com.intellij.debugger.ui.tree.*;
 import com.intellij.openapi.util.InvalidDataException;
@@ -149,7 +150,8 @@ public final class EnumerationChildrenRenderer extends TypeRenderer implements C
   @Nullable
   public static EnumerationChildrenRenderer getCurrent(ValueDescriptorImpl valueDescriptor) {
     Renderer renderer = valueDescriptor.getLastRenderer();
-    if (renderer instanceof CompoundNodeRenderer) {
+    if (renderer instanceof CompoundNodeRenderer &&
+        NodeRendererSettings.getInstance().getCustomRenderers().contains((NodeRenderer)renderer)) {
       ChildrenRenderer childrenRenderer = ((CompoundNodeRenderer)renderer).getChildrenRenderer();
       if (childrenRenderer instanceof EnumerationChildrenRenderer) {
         return (EnumerationChildrenRenderer)childrenRenderer;
index 2864c656b6e8f5060efa6e8ba0451786278e1ad7..609154b284405116b01677452830fb30a53ce380 100644 (file)
@@ -133,8 +133,8 @@ public class ToStringRenderer extends NodeRendererImpl {
   @SuppressWarnings({"HardCodedStringLiteral"})
   private static boolean overridesToString(Type type) {
     if (type instanceof ClassType) {
-      return ((ClassType)type).methodsByName("toString", "()Ljava/lang/String;").stream()
-        .anyMatch(method -> !CommonClassNames.JAVA_LANG_OBJECT.equals(method.declaringType().name()));
+      return !CommonClassNames.JAVA_LANG_OBJECT
+        .equals(((ClassType)type).concreteMethodByName("toString", "()Ljava/lang/String;").declaringType().name());
     }
     return false;
   }
index 32bd2da67a760edc784493bb6d3d86bc29eb5cb9..890b9cee68053715b74671560c1d83a20c2b11c8 100644 (file)
@@ -41,6 +41,7 @@ import javax.swing.*;
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.util.Comparator;
 
 import static java.awt.GridBagConstraints.*;
 
@@ -57,14 +58,15 @@ public class SdkSettingsStep extends ModuleWizardStep {
 
   public SdkSettingsStep(SettingsStep settingsStep, @NotNull ModuleBuilder moduleBuilder,
                          @NotNull Condition<SdkTypeId> sdkTypeIdFilter) {
-
-    this(settingsStep, moduleBuilder, sdkTypeIdFilter, null);
+    this(settingsStep, moduleBuilder, sdkTypeIdFilter, null, null);
   }
 
-  public SdkSettingsStep(SettingsStep settingsStep, @NotNull ModuleBuilder moduleBuilder,
-                           @NotNull Condition<SdkTypeId> sdkTypeIdFilter, @Nullable Condition<Sdk> sdkFilter) {
-
-    this(settingsStep.getContext(), moduleBuilder, sdkTypeIdFilter, sdkFilter);
+  public SdkSettingsStep(SettingsStep settingsStep,
+                         @NotNull ModuleBuilder moduleBuilder,
+                         @NotNull Condition<SdkTypeId> sdkTypeIdFilter,
+                         @Nullable Condition<Sdk> sdkFilter,
+                         @Nullable Comparator<Sdk> sdkComparator) {
+    this(settingsStep.getContext(), moduleBuilder, sdkTypeIdFilter, sdkFilter, sdkComparator);
     if (!isEmpty()) {
       settingsStep.addSettingsField(getSdkFieldLabel(settingsStep.getContext().getProject()), myJdkPanel);
     }
@@ -73,7 +75,8 @@ public class SdkSettingsStep extends ModuleWizardStep {
   public SdkSettingsStep(WizardContext context,
                          @NotNull ModuleBuilder moduleBuilder,
                          @NotNull Condition<SdkTypeId> sdkTypeIdFilter,
-                         @Nullable Condition<Sdk> sdkFilter) {
+                         @Nullable Condition<Sdk> sdkFilter,
+                         @Nullable Comparator<Sdk> mySdkComparator) {
     myModuleBuilder = moduleBuilder;
 
     myWizardContext = context;
@@ -85,7 +88,7 @@ public class SdkSettingsStep extends ModuleWizardStep {
       sdkFilter = JdkComboBox.getSdkFilter(sdkTypeIdFilter);
     }
 
-    myJdkComboBox = new JdkComboBox(myModel, sdkTypeIdFilter, sdkFilter, sdkTypeIdFilter, true);
+    myJdkComboBox = new JdkComboBox(myModel, sdkTypeIdFilter, sdkFilter, sdkTypeIdFilter, mySdkComparator, true);
     myJdkPanel = new JPanel(new GridBagLayout());
 
     final PropertiesComponent component = project == null ? PropertiesComponent.getInstance() : PropertiesComponent.getInstance(project);
index 2080eea2d3f64b444af0fc877583737cd09c7a5e..23f9069bf5b0c96cb9a92563e2222076a7707fa4 100644 (file)
@@ -42,10 +42,8 @@ import javax.swing.*;
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
+import java.util.Comparator;
 
 /**
  * @author Eugene Zhuravlev
@@ -60,6 +58,7 @@ public class JdkComboBox extends ComboBoxWithWidePopup {
   @Nullable
   private final Condition<SdkTypeId> myCreationFilter;
   private JButton mySetUpButton;
+  private Condition<SdkTypeId> mySdkTypeFilter;
 
   public JdkComboBox(@NotNull final ProjectSdksModel jdkModel) {
     this(jdkModel, null);
@@ -75,8 +74,18 @@ public class JdkComboBox extends ComboBoxWithWidePopup {
                      @Nullable Condition<Sdk> filter,
                      @Nullable Condition<SdkTypeId> creationFilter,
                      boolean addSuggestedItems) {
-    super(new JdkComboBoxModel(jdkModel, sdkTypeFilter, filter, addSuggestedItems));
+    this(jdkModel, sdkTypeFilter, filter, creationFilter, null, addSuggestedItems);
+  }
+
+  public JdkComboBox(@NotNull final ProjectSdksModel jdkModel,
+                     @Nullable Condition<SdkTypeId> sdkTypeFilter,
+                     @Nullable Condition<Sdk> filter,
+                     @Nullable Condition<SdkTypeId> creationFilter,
+                     @Nullable Comparator<Sdk> mySdkComparator,
+                     boolean addSuggestedItems) {
+    super(new JdkComboBoxModel(jdkModel, sdkTypeFilter, filter, addSuggestedItems, mySdkComparator));
     myFilter = filter;
+    mySdkTypeFilter = sdkTypeFilter;
     myCreationFilter = creationFilter;
     setRenderer(new ProjectJdkListRenderer() {
       @Override
@@ -272,29 +281,34 @@ public class JdkComboBox extends ComboBoxWithWidePopup {
   }
 
   public void reloadModel(JdkComboBoxItem firstItem, @Nullable Project project) {
-    final DefaultComboBoxModel model = ((DefaultComboBoxModel)getModel());
+    final JdkComboBoxModel model = (JdkComboBoxModel)getModel();
     if (project == null) {
       model.addElement(firstItem);
       return;
     }
-    model.removeAllElements();
-    model.addElement(firstItem);
-    final ProjectSdksModel projectJdksModel = ProjectStructureConfigurable.getInstance(project).getProjectJdksModel();
-    List<Sdk> projectJdks = new ArrayList<>(projectJdksModel.getProjectSdks().values());
-    if (myFilter != null) {
-      projectJdks = ContainerUtil.filter(projectJdks, myFilter);
-    }
-    Collections.sort(projectJdks, (o1, o2) -> o1.getName().compareToIgnoreCase(o2.getName()));
-    for (Sdk projectJdk : projectJdks) {
-      model.addElement(new ActualJdkComboBoxItem(projectJdk));
-    }
+    model.reload(firstItem, ProjectStructureConfigurable.getInstance(project).getProjectJdksModel(), mySdkTypeFilter, myFilter, false);
   }
 
   private static class JdkComboBoxModel extends DefaultComboBoxModel {
-    public JdkComboBoxModel(final ProjectSdksModel jdksModel, @Nullable Condition<SdkTypeId> sdkTypeFilter,
-                            @Nullable Condition<Sdk> sdkFilter, boolean addSuggested) {
+    @NotNull
+    private final Comparator<Sdk> mySdkComparator;
+
+    public JdkComboBoxModel(@NotNull final ProjectSdksModel jdksModel, @Nullable Condition<SdkTypeId> sdkTypeFilter,
+                            @Nullable Condition<Sdk> sdkFilter, boolean addSuggested, @Nullable Comparator<Sdk> sdkComparator) {
+      mySdkComparator = sdkComparator != null ? sdkComparator : (s1, s2) -> s1.getName().compareToIgnoreCase(s2.getName());
+      reload(null, jdksModel, sdkTypeFilter, sdkFilter, addSuggested);
+    }
+
+    void reload(@Nullable final JdkComboBoxItem firstItem,
+                @NotNull final ProjectSdksModel jdksModel,
+                @Nullable Condition<SdkTypeId> sdkTypeFilter,
+                @Nullable Condition<Sdk> sdkFilter,
+                boolean addSuggested) {
+      removeAllElements();
+      if (firstItem != null) addElement(firstItem);
+
       Sdk[] jdks = jdksModel.getSdks();
-      Arrays.sort(jdks, (s1, s2) -> s1.getName().compareToIgnoreCase(s2.getName()));
+      Arrays.sort(jdks, mySdkComparator);
       for (Sdk jdk : jdks) {
         if (sdkFilter == null || sdkFilter.value(jdk)) {
           addElement(new ActualJdkComboBoxItem(jdk));
index ea1cd373486b67e5515f99ed59be1e39e8436c9c..e24dd96672ee68d5d97c3f349a7a84c0bfff2da1 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.codeStyle.JavaCodeStyleManager;
 import com.intellij.psi.impl.PsiDiamondTypeUtil;
 import com.intellij.psi.util.*;
 import com.siyeh.ig.psiutils.BoolUtils;
+import com.siyeh.ig.psiutils.ExpressionUtils;
 import com.siyeh.ig.psiutils.StreamApiUtil;
 import org.jetbrains.annotations.Contract;
 import org.jetbrains.annotations.Nls;
@@ -178,14 +179,14 @@ public class SimplifyStreamApiCallChainsInspection extends BaseJavaBatchLocalIns
           PsiParameter parameter = parameters[0];
           PsiExpression expression = PsiUtil.skipParenthesizedExprDown(LambdaUtil.extractSingleExpressionFromBody(lambda.getBody()));
           // x -> x
-          if(expression instanceof PsiReferenceExpression && ((PsiReferenceExpression)expression).isReferenceTo(parameter)) {
+          if(ExpressionUtils.isReferenceTo(expression, parameter)) {
             return true;
           }
           if(expression instanceof PsiCallExpression) {
             PsiExpressionList list = ((PsiCallExpression)expression).getArgumentList();
             if(list == null) return false;
             PsiExpression[] args = list.getExpressions();
-            if(args.length != 1 || !(args[0] instanceof PsiReferenceExpression) || !(((PsiReferenceExpression)args[0]).isReferenceTo(parameter))) {
+            if(args.length != 1 || !ExpressionUtils.isReferenceTo(args[0], parameter)) {
               return false;
             }
             // x -> new Integer(x)
index 82d1402bb6d31c18979be9fbf8eed16368b533b4..8991ed837e4c18f5d5ee2108520c65a3a31d3bc1 100644 (file)
 package com.intellij.codeInspection.bytecodeAnalysis;
 
 import com.intellij.ide.highlighter.JavaClassFileType;
-import com.intellij.openapi.vfs.VirtualFile;
-import com.intellij.util.SystemProperties;
+import com.intellij.openapi.progress.ProcessCanceledException;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectManager;
+import com.intellij.openapi.util.Pair;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.gist.GistManager;
+import com.intellij.util.gist.VirtualFileGist;
 import com.intellij.util.indexing.*;
 import com.intellij.util.io.DataExternalizer;
 import com.intellij.util.io.DataInputOutputUtil;
 import com.intellij.util.io.DifferentSerializableBytesImplyNonEqualityPolicy;
 import com.intellij.util.io.KeyDescriptor;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.org.objectweb.asm.ClassReader;
+import org.jetbrains.org.objectweb.asm.MethodVisitor;
+import org.jetbrains.org.objectweb.asm.tree.MethodNode;
 
 import java.io.DataInput;
 import java.io.DataOutput;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis.LOG;
 
 /**
  * @author lambdamix
  */
-public class BytecodeAnalysisIndex extends FileBasedIndexExtension<Bytes, HEquations> {
-  public static final ID<Bytes, HEquations> NAME = ID.create("bytecodeAnalysis");
-  private final HEquationsExternalizer myExternalizer = new HEquationsExternalizer();
-  private static final ClassDataIndexer INDEXER = new ClassDataIndexer();
+public class BytecodeAnalysisIndex extends ScalarIndexExtension<Bytes> {
+  private static final ID<Bytes, Void> NAME = ID.create("bytecodeAnalysis");
   private static final HKeyDescriptor KEY_DESCRIPTOR = new HKeyDescriptor();
-
-  private static final int ourInternalVersion = 9;
-  private static final boolean ourEnabled = SystemProperties.getBooleanProperty("idea.enable.bytecode.contract.inference", true);
+  private static final VirtualFileGist<Map<Bytes, HEquations>> ourGist = GistManager.getInstance().newVirtualFileGist(
+    "BytecodeAnalysisIndex", 0, new HEquationsExternalizer(), new ClassDataIndexer());
 
   @NotNull
   @Override
-  public ID<Bytes, HEquations> getName() {
+  public ID<Bytes, Void> getName() {
     return NAME;
   }
 
   @NotNull
   @Override
-  public DataIndexer<Bytes, HEquations, FileContent> getIndexer() {
-    return INDEXER;
+  public DataIndexer<Bytes, Void, FileContent> getIndexer() {
+    return inputData -> {
+      try {
+        return collectKeys(inputData.getContent());
+      }
+      catch (ProcessCanceledException e) {
+        throw e;
+      }
+      catch (Throwable e) {
+        // incorrect bytecode may result in Runtime exceptions during analysis
+        // so here we suppose that exception is due to incorrect bytecode
+        LOG.debug("Unexpected Error during indexing of bytecode", e);
+        return Collections.emptyMap();
+      }
+    };
   }
 
   @NotNull
-  @Override
-  public KeyDescriptor<Bytes> getKeyDescriptor() {
-    return KEY_DESCRIPTOR;
+  private static Map<Bytes, Void> collectKeys(byte[] content) throws NoSuchAlgorithmException {
+    HashMap<Bytes, Void> map = new HashMap<>();
+    MessageDigest md = BytecodeAnalysisConverter.getMessageDigest();
+    new ClassReader(content).accept(new KeyedMethodVisitor() {
+      @Nullable
+      @Override
+      MethodVisitor visitMethod(MethodNode node, Key key) {
+        map.put(ClassDataIndexer.compressKey(md, key), null);
+        return null;
+      }
+    }, ClassReader.SKIP_DEBUG | ClassReader.SKIP_FRAMES);
+    return map;
   }
 
   @NotNull
   @Override
-  public DataExternalizer<HEquations> getValueExternalizer() {
-    return myExternalizer;
+  public KeyDescriptor<Bytes> getKeyDescriptor() {
+    return KEY_DESCRIPTOR;
   }
 
   @Override
@@ -77,12 +108,7 @@ public class BytecodeAnalysisIndex extends FileBasedIndexExtension<Bytes, HEquat
   @NotNull
   @Override
   public FileBasedIndex.InputFilter getInputFilter() {
-    return new DefaultFileTypeSpecificInputFilter(JavaClassFileType.INSTANCE) {
-      @Override
-      public boolean acceptInput(@NotNull VirtualFile file) {
-        return ourEnabled && super.acceptInput(file);
-      }
-    };
+    return new DefaultFileTypeSpecificInputFilter(JavaClassFileType.INSTANCE);
   }
 
   @Override
@@ -92,7 +118,14 @@ public class BytecodeAnalysisIndex extends FileBasedIndexExtension<Bytes, HEquat
 
   @Override
   public int getVersion() {
-    return ourInternalVersion + (ourEnabled ? 0xFF : 0);
+    return 10;
+  }
+
+  @NotNull
+  static List<HEquations> getEquations(GlobalSearchScope scope, Bytes key) {
+    Project project = ProjectManager.getInstance().getDefaultProject(); // the data is project-independent
+    return ContainerUtil.mapNotNull(FileBasedIndex.getInstance().getContainingFiles(NAME, key, scope),
+                                    file -> ourGist.getFileData(project, file).get(key));
   }
 
   /**
@@ -126,9 +159,22 @@ public class BytecodeAnalysisIndex extends FileBasedIndexExtension<Bytes, HEquat
   /**
    * Externalizer for compressed equations.
    */
-  public static class HEquationsExternalizer implements DataExternalizer<HEquations> {
+  public static class HEquationsExternalizer implements DataExternalizer<Map<Bytes, HEquations>> {
     @Override
-    public void save(@NotNull DataOutput out, HEquations eqs) throws IOException {
+    public void save(@NotNull DataOutput out, Map<Bytes, HEquations> value) throws IOException {
+      DataInputOutputUtil.writeSeq(out, value.entrySet(), entry -> {
+        KEY_DESCRIPTOR.save(out, entry.getKey());
+        saveEquations(out, entry.getValue());
+      });
+    }
+
+    @Override
+    public Map<Bytes, HEquations> read(@NotNull DataInput in) throws IOException {
+      return DataInputOutputUtil.readSeq(in, () -> Pair.create(KEY_DESCRIPTOR.read(in), readEquations(in))).
+        stream().collect(Collectors.toMap(p -> p.getFirst(), p -> p.getSecond()));
+    }
+
+    private static void saveEquations(@NotNull DataOutput out, HEquations eqs) throws IOException {
       out.writeBoolean(eqs.stable);
       DataInputOutputUtil.writeINT(out, eqs.results.size());
       for (DirectionResultPair pair : eqs.results) {
@@ -203,8 +249,7 @@ public class BytecodeAnalysisIndex extends FileBasedIndexExtension<Bytes, HEquat
       }
     }
 
-    @Override
-    public HEquations read(@NotNull DataInput in) throws IOException {
+    private static HEquations readEquations(@NotNull DataInput in) throws IOException {
       boolean stable = in.readBoolean();
       int size = DataInputOutputUtil.readINT(in);
       ArrayList<DirectionResultPair> results = new ArrayList<>(size);
index c8bc75671412e19794999d01e71b73c77801354c..dc6f90404f269862b57f0efb7ca718d10fd5f034 100644 (file)
@@ -18,16 +18,22 @@ package com.intellij.codeInspection.bytecodeAnalysis;
 import com.intellij.codeInspection.bytecodeAnalysis.asm.*;
 import com.intellij.openapi.progress.ProcessCanceledException;
 import com.intellij.openapi.progress.ProgressManager;
-import com.intellij.openapi.util.Pair;
-import com.intellij.util.indexing.DataIndexer;
-import com.intellij.util.indexing.FileContent;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.gist.VirtualFileGist;
+import gnu.trove.THashMap;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.jetbrains.org.objectweb.asm.*;
 import org.jetbrains.org.objectweb.asm.tree.MethodNode;
 import org.jetbrains.org.objectweb.asm.tree.analysis.AnalyzerException;
 
 import java.security.MessageDigest;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import static com.intellij.codeInspection.bytecodeAnalysis.Direction.*;
 import static com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalysis.LOG;
@@ -40,33 +46,23 @@ import static com.intellij.codeInspection.bytecodeAnalysis.ProjectBytecodeAnalys
  *
  * @author lambdamix
  */
-public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileContent> {
+public class ClassDataIndexer implements VirtualFileGist.GistCalculator<Map<Bytes, HEquations>> {
 
-  private static final int STABLE_FLAGS = Opcodes.ACC_FINAL | Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC;
   public static final Final FINAL_TOP = new Final(Value.Top);
   public static final Final FINAL_BOT = new Final(Value.Bot);
   public static final Final FINAL_NOT_NULL = new Final(Value.NotNull);
   public static final Final FINAL_NULL = new Final(Value.Null);
 
-  @NotNull
+  @Nullable
   @Override
-  public Map<Bytes, HEquations> map(@NotNull FileContent inputData) {
+  public Map<Bytes, HEquations> calcData(@NotNull Project project, @NotNull VirtualFile file) {
     HashMap<Bytes, HEquations> map = new HashMap<>();
     try {
       MessageDigest md = BytecodeAnalysisConverter.getMessageDigest();
-      Map<Key, List<Equation>> allEquations = processClass(new ClassReader(inputData.getContent()), inputData.getFile().getPresentableUrl());
+      Map<Key, List<Equation>> allEquations = processClass(new ClassReader(file.contentsToByteArray()), file.getPresentableUrl());
       for (Map.Entry<Key, List<Equation>> entry: allEquations.entrySet()) {
-
         Key methodKey = entry.getKey();
-        // method equations with raw (not-compressed keys)
-        List<Equation> rawMethodEquations = entry.getValue();
-        //
-        List<DirectionResultPair> compressedMethodEquations =
-          new ArrayList<>(rawMethodEquations.size());
-        for (Equation equation : rawMethodEquations) {
-          compressedMethodEquations.add(BytecodeAnalysisConverter.convert(equation, md));
-        }
-        map.put(new Bytes(BytecodeAnalysisConverter.asmKey(methodKey, md).key), new HEquations(compressedMethodEquations, methodKey.stable));
+        map.put(compressKey(md, methodKey), convertEquations(md, methodKey, entry.getValue()));
       }
     }
     catch (ProcessCanceledException e) {
@@ -80,6 +76,18 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
     return map;
   }
 
+  @NotNull
+  static Bytes compressKey(MessageDigest md, Key methodKey) {
+    return new Bytes(BytecodeAnalysisConverter.asmKey(methodKey, md).key);
+  }
+
+  @NotNull
+  private static HEquations convertEquations(MessageDigest md, Key methodKey, List<Equation> rawMethodEquations) {
+    List<DirectionResultPair> compressedMethodEquations =
+      ContainerUtil.map(rawMethodEquations, equation -> BytecodeAnalysisConverter.convert(equation, md));
+    return new HEquations(compressedMethodEquations, methodKey.stable);
+  }
+
   public static Map<Key, List<Equation>> processClass(final ClassReader classReader, final String presentableUrl) {
 
     // It is OK to share pending states, actions and results for analyses.
@@ -91,20 +99,9 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
     final PResults.PResult[] sharedResults = new PResults.PResult[Analysis.STEPS_LIMIT];
     final Map<Key, List<Equation>> equations = new HashMap<>();
 
-    classReader.accept(new ClassVisitor(Opcodes.API_VERSION) {
-      private String className;
-      private boolean stableClass;
-
-      @Override
-      public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
-        className = name;
-        stableClass = (access & Opcodes.ACC_FINAL) != 0;
-        super.visit(version, access, name, signature, superName, interfaces);
-      }
+    classReader.accept(new KeyedMethodVisitor() {
 
-      @Override
-      public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
-        final MethodNode node = new MethodNode(Opcodes.API_VERSION, access, name, desc, signature, exceptions);
+      protected MethodVisitor visitMethod(final MethodNode node, final Key key) {
         return new MethodVisitor(Opcodes.API_VERSION, node) {
           private boolean jsr;
 
@@ -119,8 +116,7 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
           @Override
           public void visitEnd() {
             super.visitEnd();
-            Pair<Key, List<Equation>> methodEquations = processMethod(node, jsr);
-            equations.put(methodEquations.first, methodEquations.second);
+            equations.put(key, processMethod(node, jsr, key.method, key.stable));
           }
         };
       }
@@ -130,9 +126,8 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
        *
        * @param methodNode asm node for method
        * @param jsr whether a method has jsr instruction
-       * @return pair of (primaryKey, equations)
        */
-      private Pair<Key, List<Equation>> processMethod(final MethodNode methodNode, boolean jsr) {
+      private List<Equation> processMethod(final MethodNode methodNode, boolean jsr, Method method, boolean stable) {
         ProgressManager.checkCanceled();
         final Type[] argumentTypes = Type.getArgumentTypes(methodNode.desc);
         final Type resultType = Type.getReturnType(methodNode.desc);
@@ -140,11 +135,6 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
         final boolean isBooleanResult = ASMUtils.isBooleanType(resultType);
         final boolean isInterestingResult = isReferenceResult || isBooleanResult;
 
-        final Method method = new Method(className, methodNode.name, methodNode.desc);
-        final boolean stable = stableClass || (methodNode.access & STABLE_FLAGS) != 0 || "<init>".equals(methodNode.name);
-
-        Key primaryKey = new Key(method, Out, stable);
-
         // 4*n: for each reference parameter: @NotNull IN, @Nullable, null -> ... contract, !null -> contract
         // 3: @NotNull OUT, @Nullable OUT, purity analysis
         List<Equation> equations = new ArrayList<>(argumentTypes.length * 4 + 3);
@@ -152,7 +142,7 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
 
         if (argumentTypes.length == 0 && !isInterestingResult) {
           // no need to continue analysis
-          return Pair.create(primaryKey, equations);
+          return equations;
         }
 
         try {
@@ -173,17 +163,17 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
               if (richControlFlow.reducible()) {
                 NegationAnalysis negated = tryNegation(method, argumentTypes, graph, isBooleanResult, dfs, jsr);
                 processBranchingMethod(method, methodNode, richControlFlow, argumentTypes, isReferenceResult, isBooleanResult, stable, jsr, equations, negated);
-                return Pair.create(primaryKey, equations);
+                return equations;
               }
               LOG.debug(method + ": CFG is not reducible");
             }
             // simple
             else {
               processNonBranchingMethod(method, argumentTypes, graph, isReferenceResult, isBooleanResult, stable, equations);
-              return Pair.create(primaryKey, equations);
+              return equations;
             }
           }
-          return Pair.create(primaryKey, topEquations(method, argumentTypes, isReferenceResult, isInterestingResult, stable));
+          return topEquations(method, argumentTypes, isReferenceResult, isInterestingResult, stable);
         }
         catch (ProcessCanceledException e) {
           throw e;
@@ -192,7 +182,7 @@ public class ClassDataIndexer implements DataIndexer<Bytes, HEquations, FileCont
           // incorrect bytecode may result in Runtime exceptions during analysis
           // so here we suppose that exception is due to incorrect bytecode
           LOG.debug("Unexpected Error during processing of " + method + " in " + presentableUrl, e);
-          return Pair.create(primaryKey, topEquations(method, argumentTypes, isReferenceResult, isInterestingResult, stable));
+          return topEquations(method, argumentTypes, isReferenceResult, isInterestingResult, stable);
         }
       }
 
diff --git a/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/KeyedMethodVisitor.java b/java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/KeyedMethodVisitor.java
new file mode 100644 (file)
index 0000000..d90d0eb
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright 2000-2016 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.codeInspection.bytecodeAnalysis;
+
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.org.objectweb.asm.ClassVisitor;
+import org.jetbrains.org.objectweb.asm.MethodVisitor;
+import org.jetbrains.org.objectweb.asm.Opcodes;
+import org.jetbrains.org.objectweb.asm.tree.MethodNode;
+
+import static com.intellij.codeInspection.bytecodeAnalysis.Direction.Out;
+
+/**
+ * @author peter
+ */
+abstract class KeyedMethodVisitor extends ClassVisitor {
+  private static final int STABLE_FLAGS = Opcodes.ACC_FINAL | Opcodes.ACC_PRIVATE | Opcodes.ACC_STATIC;
+
+  KeyedMethodVisitor() {
+    super(Opcodes.API_VERSION);
+  }
+
+  String className;
+  private boolean stableClass;
+
+  @Override
+  public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) {
+    className = name;
+    stableClass = (access & Opcodes.ACC_FINAL) != 0;
+    super.visit(version, access, name, signature, superName, interfaces);
+  }
+
+  @Override
+  public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
+    MethodNode node = new MethodNode(Opcodes.API_VERSION, access, name, desc, signature, exceptions);
+    Method method = new Method(className, node.name, node.desc);
+    boolean stable = stableClass || (node.access & STABLE_FLAGS) != 0 || "<init>".equals(node.name);
+
+    return visitMethod(node, new Key(method, Out, stable));
+  }
+
+  @Nullable
+  abstract MethodVisitor visitMethod(final MethodNode node, final Key key);
+}
index c0f23760f896f64f1c54d476930fa09678f46525..d7353d9e2896b2640378a93151ce80d7053deb4f 100644 (file)
@@ -26,16 +26,16 @@ import com.intellij.openapi.util.ModificationTracker;
 import com.intellij.openapi.util.registry.Registry;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.*;
-import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.ProjectScope;
 import com.intellij.psi.util.CachedValueProvider;
 import com.intellij.psi.util.CachedValuesManager;
 import com.intellij.psi.util.PsiFormatUtil;
+import com.intellij.psi.util.PsiModificationTracker;
 import com.intellij.testFramework.LightVirtualFile;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.containers.ConcurrentFactoryMap;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.Stack;
-import com.intellij.util.indexing.FileBasedIndex;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -57,6 +57,7 @@ public class ProjectBytecodeAnalysis {
   private final Project myProject;
   private final boolean nullableMethod;
   private final boolean nullableMethodTransitivity;
+  private final Map<Bytes, List<HEquations>> myEquationCache = ContainerUtil.createConcurrentSoftValueMap();
 
   public static ProjectBytecodeAnalysis getInstance(@NotNull Project project) {
     return ServiceManager.getService(project, ProjectBytecodeAnalysis.class);
@@ -66,6 +67,7 @@ public class ProjectBytecodeAnalysis {
     myProject = project;
     nullableMethod = Registry.is(NULLABLE_METHOD);
     nullableMethodTransitivity = Registry.is(NULLABLE_METHOD_TRANSITIVITY);
+    myProject.getMessageBus().connect().subscribe(PsiModificationTracker.TOPIC, () -> myEquationCache.clear());
   }
 
   @Nullable
@@ -270,10 +272,8 @@ public class ProjectBytecodeAnalysis {
   private ParameterAnnotations loadParameterAnnotations(@NotNull HKey notNullKey)
     throws EquationsLimitException {
 
-    Map<Bytes, List<HEquations>> equationsCache = new HashMap<>();
-
     final Solver notNullSolver = new Solver(new ELattice<>(Value.NotNull, Value.Top), Value.Top);
-    collectEquations(Collections.singletonList(notNullKey), notNullSolver, equationsCache);
+    collectEquations(Collections.singletonList(notNullKey), notNullSolver);
 
     Map<HKey, Value> notNullSolutions = notNullSolver.solve();
     // subtle point
@@ -282,7 +282,7 @@ public class ProjectBytecodeAnalysis {
 
     final Solver nullableSolver = new Solver(new ELattice<>(Value.Null, Value.Top), Value.Top);
     final HKey nullableKey = new HKey(notNullKey.key, notNullKey.dirKey + 1, true, false);
-    collectEquations(Collections.singletonList(nullableKey), nullableSolver, equationsCache);
+    collectEquations(Collections.singletonList(nullableKey), nullableSolver);
     Map<HKey, Value> nullableSolutions = nullableSolver.solve();
     // subtle point
     boolean nullable =
@@ -293,12 +293,11 @@ public class ProjectBytecodeAnalysis {
   private MethodAnnotations loadMethodAnnotations(@NotNull PsiMethod owner, @NotNull HKey key, ArrayList<HKey> allKeys)
     throws EquationsLimitException {
     MethodAnnotations result = new MethodAnnotations();
-    Map<Bytes, List<HEquations>> equationsCache = new HashMap<>();
 
     final Solver outSolver = new Solver(new ELattice<>(Value.Bot, Value.Top), Value.Top);
     final PuritySolver puritySolver = new PuritySolver();
-    collectEquations(allKeys, outSolver, equationsCache);
-    collectPurityEquations(key.updateDirection(BytecodeAnalysisConverter.mkDirectionKey(Pure)), puritySolver, equationsCache);
+    collectEquations(allKeys, outSolver);
+    collectPurityEquations(key.updateDirection(BytecodeAnalysisConverter.mkDirectionKey(Pure)), puritySolver);
 
     Map<HKey, Value> solutions = outSolver.solve();
     Map<HKey, Set<HEffectQuantum>> puritySolutions = puritySolver.solve();
@@ -312,10 +311,10 @@ public class ProjectBytecodeAnalysis {
       final Solver nullableMethodSolver = new Solver(new ELattice<>(Value.Bot, Value.Null), Value.Bot);
       HKey nullableKey = key.updateDirection(BytecodeAnalysisConverter.mkDirectionKey(NullableOut));
       if (nullableMethodTransitivity) {
-        collectEquations(Collections.singletonList(nullableKey), nullableMethodSolver, equationsCache);
+        collectEquations(Collections.singletonList(nullableKey), nullableMethodSolver);
       }
       else {
-        collectSingleEquation(nullableKey, nullableMethodSolver, equationsCache);
+        collectSingleEquation(nullableKey, nullableMethodSolver);
       }
       Map<HKey, Value> nullableSolutions = nullableMethodSolver.solve();
       if (nullableSolutions.get(nullableKey) == Value.Null || nullableSolutions.get(nullableKey.invertStability()) == Value.Null) {
@@ -325,17 +324,22 @@ public class ProjectBytecodeAnalysis {
     return result;
   }
 
-  private void collectPurityEquations(HKey key, PuritySolver puritySolver, Map<Bytes, List<HEquations>> cache)
+  private List<HEquations> getEquations(Bytes key) {
+    List<HEquations> result = myEquationCache.get(key);
+    if (result == null) {
+      myEquationCache.put(key, result = BytecodeAnalysisIndex.getEquations(ProjectScope.getLibrariesScope(myProject), key));
+    }
+    return result;
+  }
+
+  private void collectPurityEquations(HKey key, PuritySolver puritySolver)
     throws EquationsLimitException {
-    GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);
     HashSet<HKey> queued = new HashSet<>();
     Stack<HKey> queue = new Stack<>();
 
     queue.push(key);
     queued.add(key);
 
-    FileBasedIndex index = FileBasedIndex.getInstance();
-
     while (!queue.empty()) {
       if (queued.size() > EQUATIONS_LIMIT) {
         throw new EquationsLimitException();
@@ -344,13 +348,7 @@ public class ProjectBytecodeAnalysis {
       HKey hKey = queue.pop();
       Bytes bytes = new Bytes(hKey.key);
 
-      List<HEquations> hEquationss = cache.get(bytes);
-      if (hEquationss == null) {
-        hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
-        cache.put(bytes, hEquationss);
-      }
-
-      for (HEquations hEquations : hEquationss) {
+      for (HEquations hEquations : getEquations(bytes)) {
         boolean stable = hEquations.stable;
         for (DirectionResultPair pair : hEquations.results) {
           int dirKey = pair.directionKey;
@@ -372,9 +370,7 @@ public class ProjectBytecodeAnalysis {
     }
   }
 
-  private void collectEquations(List<HKey> keys, Solver solver, @NotNull Map<Bytes, List<HEquations>> cache) throws EquationsLimitException {
-
-    GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);
+  private void collectEquations(List<HKey> keys, Solver solver) throws EquationsLimitException {
     HashSet<HKey> queued = new HashSet<>();
     Stack<HKey> queue = new Stack<>();
 
@@ -383,8 +379,6 @@ public class ProjectBytecodeAnalysis {
       queued.add(key);
     }
 
-    FileBasedIndex index = FileBasedIndex.getInstance();
-
     while (!queue.empty()) {
       if (queued.size() > EQUATIONS_LIMIT) {
         throw new EquationsLimitException();
@@ -393,13 +387,7 @@ public class ProjectBytecodeAnalysis {
       HKey hKey = queue.pop();
       Bytes bytes = new Bytes(hKey.key);
 
-      List<HEquations> hEquationss = cache.get(bytes);
-      if (hEquationss == null) {
-        hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
-        cache.put(bytes, hEquationss);
-      }
-
-      for (HEquations hEquations : hEquationss) {
+      for (HEquations hEquations : getEquations(bytes)) {
         boolean stable = hEquations.stable;
         for (DirectionResultPair pair : hEquations.results) {
           int dirKey = pair.directionKey;
@@ -424,21 +412,11 @@ public class ProjectBytecodeAnalysis {
     }
   }
 
-  private void collectSingleEquation(HKey hKey, Solver solver, @NotNull Map<Bytes, List<HEquations>> cache) throws EquationsLimitException {
-    GlobalSearchScope librariesScope = ProjectScope.getLibrariesScope(myProject);
-
-    FileBasedIndex index = FileBasedIndex.getInstance();
-
+  private void collectSingleEquation(HKey hKey, Solver solver) throws EquationsLimitException {
     ProgressManager.checkCanceled();
     Bytes bytes = new Bytes(hKey.key);
 
-    List<HEquations> hEquationss = cache.get(bytes);
-    if (hEquationss == null) {
-      hEquationss = index.getValues(BytecodeAnalysisIndex.NAME, bytes, librariesScope);
-      cache.put(bytes, hEquationss);
-    }
-
-    for (HEquations hEquations : hEquationss) {
+    for (HEquations hEquations : getEquations(bytes)) {
       boolean stable = hEquations.stable;
       for (DirectionResultPair pair : hEquations.results) {
         int dirKey = pair.directionKey;
index 2013268331ec18a3ea1b39931400cec038d5312f..c23def894c6523e265d8b910aa00d7ad27a577ea 100644 (file)
@@ -1252,7 +1252,8 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
     }
 
     PsiExpression[] expressions = expression.getArgumentList().getExpressions();
-    PsiElement method = methodExpression.resolve();
+    JavaResolveResult result = methodExpression.advancedResolve(false);
+    PsiElement method = result.getElement();
     PsiParameter[] parameters = method instanceof PsiMethod ? ((PsiMethod)method).getParameterList().getParameters() : null;
     boolean isEqualsCall = expressions.length == 1 && method instanceof PsiMethod &&
                            "equals".equals(((PsiMethod)method).getName()) && parameters.length == 1 &&
@@ -1263,7 +1264,7 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
       PsiExpression paramExpr = expressions[i];
       paramExpr.accept(this);
       if (parameters != null && i < parameters.length) {
-        generateBoxingUnboxingInstructionFor(paramExpr, parameters[i].getType());
+        generateBoxingUnboxingInstructionFor(paramExpr, result.getSubstitutor().substitute(parameters[i].getType()));
       }
       if (i == 0 && isEqualsCall) {
         // stack: .., qualifier, arg1
index 621d0234c0c3b9676f4fc6390848ddb177a3b4a6..039bf87a9236cd0759f163560277dcb009d9cd2b 100644 (file)
@@ -16,7 +16,7 @@
 package com.intellij.codeInspection.dataFlow
 
 import com.intellij.util.io.DataExternalizer
-import com.intellij.util.io.DataInputOutputUtil
+import com.intellij.util.io.DataInputOutputUtil.*
 import java.io.DataInput
 import java.io.DataOutput
 
@@ -26,24 +26,24 @@ import java.io.DataOutput
 internal object MethodDataExternalizer : DataExternalizer<Map<Int, MethodData>> {
 
   override fun save(out: DataOutput, value: Map<Int, MethodData>?) {
-    writeList(out, value!!.toList()) { DataInputOutputUtil.writeINT(out, it.first); writeMethod(out, it.second) }
+    writeSeq(out, value!!.toList()) { writeINT(out, it.first); writeMethod(out, it.second) }
   }
 
-  override fun read(input: DataInput) = readList(input) { DataInputOutputUtil.readINT(input) to readMethod(input) }.toMap()
+  override fun read(input: DataInput) = readSeq(input) { readINT(input) to readMethod(input) }.toMap()
 
   private fun writeMethod(out: DataOutput, data: MethodData) {
     writeNullable(out, data.nullity) { writeNullity(out, it) }
     writeNullable(out, data.purity) { writePurity(out, it) }
-    writeList(out, data.contracts) { writeContract(out, it) }
-    DataInputOutputUtil.writeINT(out, data.bodyStart)
-    DataInputOutputUtil.writeINT(out, data.bodyEnd)
+    writeSeq(out, data.contracts) { writeContract(out, it) }
+    writeINT(out, data.bodyStart)
+    writeINT(out, data.bodyEnd)
   }
 
   private fun readMethod(input: DataInput): MethodData {
     val nullity = readNullable(input) { readNullity(input) }
     val purity = readNullable(input) { readPurity(input) }
-    val contracts = readList(input) { readContract(input) }
-    return MethodData(nullity, purity, contracts, DataInputOutputUtil.readINT(input), DataInputOutputUtil.readINT(input))
+    val contracts = readSeq(input) { readContract(input) }
+    return MethodData(nullity, purity, contracts, readINT(input), readINT(input))
   }
 
   private fun writeNullity(out: DataOutput, nullity: NullityInferenceResult) = when (nullity) {
@@ -56,14 +56,14 @@ internal object MethodDataExternalizer : DataExternalizer<Map<Int, MethodData>>
     else -> NullityInferenceResult.FromDelegate(readRanges(input))
   }
 
-  private fun writeRanges(out: DataOutput, ranges: List<ExpressionRange>) = writeList(out, ranges) { writeRange(out, it) }
-  private fun readRanges(input: DataInput) = readList(input) { readRange(input) }
+  private fun writeRanges(out: DataOutput, ranges: List<ExpressionRange>) = writeSeq(out, ranges) { writeRange(out, it) }
+  private fun readRanges(input: DataInput) = readSeq(input) { readRange(input) }
 
   private fun writeRange(out: DataOutput, range: ExpressionRange) {
-    DataInputOutputUtil.writeINT(out, range.startOffset)
-    DataInputOutputUtil.writeINT(out, range.endOffset)
+    writeINT(out, range.startOffset)
+    writeINT(out, range.endOffset)
   }
-  private fun readRange(input: DataInput) = ExpressionRange(DataInputOutputUtil.readINT(input), DataInputOutputUtil.readINT(input))
+  private fun readRange(input: DataInput) = ExpressionRange(readINT(input), readINT(input))
 
   private fun writePurity(out: DataOutput, purity: PurityInferenceResult) {
     writeRanges(out, purity.mutatedRefs)
@@ -73,47 +73,33 @@ internal object MethodDataExternalizer : DataExternalizer<Map<Int, MethodData>>
 
   private fun writeContract(out: DataOutput, contract: PreContract): Unit = when (contract) {
     is DelegationContract -> { out.writeByte(0); writeRange(out, contract.expression); out.writeBoolean(contract.negated) }
-    is KnownContract -> { out.writeByte(1);
+    is KnownContract -> { out.writeByte(1)
       writeContractArguments(out, contract.contract.arguments.toList())
       out.writeByte(contract.contract.returnValue.ordinal)
     }
-    is MethodCallContract -> { out.writeByte(2);
-      writeRange(out, contract.call);
-      writeList(out, contract.states) { writeContractArguments(out, it) }
+    is MethodCallContract -> { out.writeByte(2)
+      writeRange(out, contract.call)
+      writeSeq(out, contract.states) { writeContractArguments(out, it) }
     }
     is NegatingContract -> { out.writeByte(3); writeContract(out, contract.negated) }
-    is SideEffectFilter -> { out.writeByte(4);
+    is SideEffectFilter -> { out.writeByte(4)
       writeRanges(out, contract.expressionsToCheck)
-      writeList(out, contract.contracts) { writeContract(out, it) }
+      writeSeq(out, contract.contracts) { writeContract(out, it) }
     }
     else -> throw IllegalArgumentException(contract.toString())
   }
   private fun readContract(input: DataInput): PreContract = when (input.readByte().toInt()) {
     0 -> DelegationContract(readRange(input), input.readBoolean())
     1 -> KnownContract(MethodContract(readContractArguments(input).toTypedArray(), readValueConstraint(input)))
-    2 -> MethodCallContract(readRange(input), readList(input) { readContractArguments(input) })
+    2 -> MethodCallContract(readRange(input), readSeq(input) { readContractArguments(input) })
     3 -> NegatingContract(readContract(input))
-    else -> SideEffectFilter(readRanges(input), readList(input) { readContract(input) })
+    else -> SideEffectFilter(readRanges(input), readSeq(input) { readContract(input) })
   }
 
   private fun writeContractArguments(out: DataOutput, arguments: List<MethodContract.ValueConstraint>) =
-      writeList(out, arguments) { out.writeByte(it.ordinal) }
-  private fun readContractArguments(input: DataInput) = readList(input, { readValueConstraint(input) })
+      writeSeq(out, arguments) { out.writeByte(it.ordinal) }
+  private fun readContractArguments(input: DataInput) = readSeq(input, { readValueConstraint(input) })
 
   private fun readValueConstraint(input: DataInput) = MethodContract.ValueConstraint.values()[input.readByte().toInt()]
 
 }
-
-// utils
-
-private fun <T> writeNullable(out: DataOutput, value: T?, writeItem: (T) -> Unit) = when (value) {
-  null -> out.writeBoolean(false)
-  else -> { out.writeBoolean(true); writeItem(value) }
-}
-private fun <T> readNullable(input: DataInput, readEach: () -> T): T? = if (input.readBoolean()) readEach() else null
-
-private fun <T> writeList(out: DataOutput, list: List<T>, writeEach: (T) -> Unit) {
-  DataInputOutputUtil.writeINT(out, list.size)
-  list.forEach(writeEach)
-}
-private fun <T> readList(input: DataInput, readEach: () -> T) = (0 until DataInputOutputUtil.readINT(input)).map { readEach() }
index d92bb6da70f2b9691705665a844bdbcbcd850b5c..3ed5933928636775affdf296be92d2132c1a4e58 100644 (file)
@@ -31,9 +31,7 @@ import com.intellij.ide.highlighter.JavaFileType;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.ExtensionPoint;
-import com.intellij.openapi.extensions.ExtensionPointListener;
 import com.intellij.openapi.extensions.Extensions;
-import com.intellij.openapi.extensions.PluginDescriptor;
 import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.InvalidDataException;
@@ -453,6 +451,7 @@ public class UnusedDeclarationInspectionBase extends GlobalInspectionTool {
     final RefFilter filter = myPhase == 1 ? new StrictUnreferencedFilter(this, globalContext) :
                              new RefUnreachableFilter(this, globalContext);
     final boolean[] requestAdded = {false};
+    LOG.assertTrue(myProcessedSuspicious != null, "phase: " + myPhase);
 
     globalContext.getRefManager().iterate(new RefJavaVisitor() {
       @Override
@@ -726,26 +725,6 @@ public class UnusedDeclarationInspectionBase extends GlobalInspectionTool {
   @Override
   public void initialize(@NotNull GlobalInspectionContext context) {
     super.initialize(context);
-    ExtensionPoint<EntryPoint> point = Extensions.getRootArea().getExtensionPoint(ToolExtensionPoints.DEAD_CODE_TOOL);
-    point.addExtensionPointListener(new ExtensionPointListener<EntryPoint>() {
-      @Override
-      public void extensionAdded(@NotNull final EntryPoint extension, @Nullable PluginDescriptor pluginDescriptor) {
-        boolean alreadyAdded = ContainerUtil.find(myExtensions, point1 -> point1.getClass().equals(extension.getClass())) != null;
-        if (!alreadyAdded) {
-          try {
-            myExtensions.add(extension.clone());
-          }
-          catch (CloneNotSupportedException e) {
-            LOG.error(e);
-          }
-        }
-      }
-
-      @Override
-      public void extensionRemoved(@NotNull final EntryPoint extension, @Nullable PluginDescriptor pluginDescriptor) {
-        ContainerUtil.retainAll(myExtensions, point12 -> !point12.getClass().equals(extension.getClass()));
-      }
-    }, getEntryPointsManager(context));
   }
 
   @TestOnly
index c56feb5040bd33b7287d7e5718b09cf516b2ecdf..c7fce35cb72e448323f9202c30e2482b76232d3d 100644 (file)
@@ -31,20 +31,20 @@ import com.intellij.openapi.extensions.impl.ExtensionPointImpl;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.JDOMExternalizableStringList;
-import com.intellij.profile.codeInspection.InspectionProfileManager;
+import com.intellij.profile.codeInspection.ProjectInspectionProfileManager;
 import com.intellij.psi.*;
-import com.intellij.util.containers.*;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.UIUtil;
 import com.intellij.util.xmlb.SkipDefaultsSerializationFilter;
 import com.intellij.util.xmlb.XmlSerializer;
-import com.intellij.util.xmlb.annotations.*;
+import com.intellij.util.xmlb.annotations.Attribute;
+import com.intellij.util.xmlb.annotations.Tag;
 import org.jdom.Element;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
-import java.util.HashSet;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
@@ -103,7 +103,7 @@ public abstract class EntryPointsManagerBase extends EntryPointsManager implemen
           ADDITIONAL_ANNOS = null;
           UIUtil.invokeLaterIfNeeded(() -> {
             if (!ApplicationManager.getApplication().isDisposed()) {
-              InspectionProfileManager.getInstance().fireProfileChanged(null);
+              ProjectInspectionProfileManager.getInstance(project).fireProfileChanged();
             }
           });
         }
index 6bb987846c29624d19ca729ef36867a42d73ca95..4d09928024c5ce29e34cb69821dffd6b53434af3 100644 (file)
@@ -132,6 +132,7 @@ public class Java8ReplaceMapGetInspection extends BaseJavaBatchLocalInspectionTo
       if (!(statement instanceof PsiBlockStatement)) return null;
       // like val = new ArrayList<>(); map.put(key, val);
       PsiStatement[] statements = ((PsiBlockStatement)statement).getCodeBlock().getStatements();
+      if (statements.length != 2) return null;
       putCall = extractPutCall(statements[1]);
       if (putCall == null) return null;
       PsiExpression[] putArguments = putCall.getArgumentList().getExpressions();
index 4cb330bb8315df5addf6ef7db08e8fb9556dd4d7..8e06e1a2e2d39b1ecacd27a36ecc0c8c4faa3e42 100644 (file)
@@ -30,9 +30,7 @@ import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.searches.AllOverridingMethodsSearch;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.IncorrectOperationException;
-import com.intellij.util.Processor;
 import com.intellij.util.Query;
-import com.intellij.util.containers.BidirectionalMap;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -46,7 +44,6 @@ import java.util.List;
 public class RedundantThrows extends GlobalJavaBatchInspectionTool {
   private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.unneededThrows.RedundantThrows");
   private static final String DISPLAY_NAME = InspectionsBundle.message("inspection.redundant.throws.display.name");
-  private final BidirectionalMap<String, QuickFix> myQuickFixes = new BidirectionalMap<>();
   @NonNls private static final String SHORT_NAME = "RedundantThrows";
 
   @Override
@@ -87,17 +84,17 @@ public class RedundantThrows extends GlobalJavaBatchInspectionTool {
 
             if (refMethod.isAbstract() || refMethod.getOwnerClass().isInterface()) {
               problems.add(manager.createProblemDescriptor(throwsRef, InspectionsBundle.message(
-                "inspection.redundant.throws.problem.descriptor", "<code>#ref</code>"), getFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL,
+                "inspection.redundant.throws.problem.descriptor", "<code>#ref</code>"), new MyQuickFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL,
                                                            false));
             }
             else if (!refMethod.getDerivedMethods().isEmpty()) {
               problems.add(manager.createProblemDescriptor(throwsRef, InspectionsBundle.message(
-                "inspection.redundant.throws.problem.descriptor1", "<code>#ref</code>"), getFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL,
+                "inspection.redundant.throws.problem.descriptor1", "<code>#ref</code>"), new MyQuickFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL,
                                                            false));
             }
             else {
               problems.add(manager.createProblemDescriptor(throwsRef, InspectionsBundle.message(
-                "inspection.redundant.throws.problem.descriptor2", "<code>#ref</code>"), getFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL,
+                "inspection.redundant.throws.problem.descriptor2", "<code>#ref</code>"), new MyQuickFix(processor, throwsClassName), ProblemHighlightType.LIKE_UNUSED_SYMBOL,
                                                            false));
             }
           }
@@ -164,30 +161,16 @@ public class RedundantThrows extends GlobalJavaBatchInspectionTool {
     return SHORT_NAME;
   }
 
-  private LocalQuickFix getFix(final ProblemDescriptionsProcessor processor, final String hint) {
-    QuickFix fix = myQuickFixes.get(hint);
-    if (fix == null) {
-      fix = new MyQuickFix(processor, hint);
-      if (hint != null) {
-        myQuickFixes.put(hint, fix);
-      }
-    }
-    return (LocalQuickFix)fix;
-  }
-
-
   @Override
   @Nullable
   public QuickFix getQuickFix(String hint) {
-    return getFix(null, hint);
+    return new MyQuickFix(null, hint);
   }
 
   @Override
   @Nullable
   public String getHint(@NotNull final QuickFix fix) {
-    final List<String> hints = myQuickFixes.getKeysByValue(fix);
-    LOG.assertTrue(hints != null && hints.size() == 1);
-    return hints.get(0);
+    return fix instanceof MyQuickFix ? ((MyQuickFix)fix).myHint : null;
   }
 
   private static class MyQuickFix implements LocalQuickFix {
index dff7bdb91b7dd20fa57178ff0fee37db7ca401ec..78130a783c0fc6430e356333a6699defd09f26f2 100644 (file)
 package com.intellij.codeInspection.util;
 
 import com.intellij.codeInsight.AnnotationUtil;
-import com.intellij.codeInspection.InspectionProfile;
 import com.intellij.codeInspection.LocalQuickFix;
 import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.profile.codeInspection.InspectionProfileManager;
-import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
+import com.intellij.profile.codeInspection.ProjectInspectionProfileManager;
 import com.intellij.psi.PsiAnnotation;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiModifierList;
@@ -63,11 +61,10 @@ public class SpecialAnnotationsUtilBase {
   static void doQuickFixInternal(@NotNull Project project, @NotNull List<String> targetList, @NotNull String qualifiedName) {
     targetList.add(qualifiedName);
     Collections.sort(targetList);
-    final InspectionProfile inspectionProfile = InspectionProjectProfileManager.getInstance(project).getCurrentProfile();
     //correct save settings
 
     //TODO lesya
-    InspectionProfileManager.getInstance().fireProfileChanged(inspectionProfile);
+    ProjectInspectionProfileManager.getInstance(project).fireProfileChanged();
     /*
     try {
       inspectionProfile.save();
index 78ecffc5436b6718d5f245851df16189e60fd45a..b90f0b42fb067290aa5e36cb7939d859bdc76631 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 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.
@@ -33,13 +33,10 @@ import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.PsiShortNamesCache;
 import com.intellij.psi.search.searches.DeepestSuperMethodsSearch;
 import com.intellij.psi.tree.IElementType;
-import com.intellij.psi.util.PropertyUtil;
-import com.intellij.psi.util.PsiTreeUtil;
-import com.intellij.psi.util.PsiUtil;
-import com.intellij.psi.util.TypeConversionUtil;
+import com.intellij.psi.util.*;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.NullableFunction;
-import com.intellij.util.containers.*;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.containers.HashSet;
 import com.intellij.util.containers.Stack;
@@ -1226,13 +1223,14 @@ public class ExpectedTypesProvider {
 
     @NotNull
     private ExpectedTypeInfo[] findClassesWithDeclaredMethod(@NotNull final PsiMethodCallExpression methodCallExpr, final boolean forCompletion) {
+      PsiUtilCore.ensureValid(methodCallExpr);
       final PsiReferenceExpression reference = methodCallExpr.getMethodExpression();
       if (reference.getQualifierExpression() instanceof PsiClassObjectAccessExpression) {
         return ExpectedTypeInfo.EMPTY_ARRAY;
       }
       final PsiManager manager = methodCallExpr.getManager();
       final JavaPsiFacade facade = JavaPsiFacade.getInstance(manager.getProject());
-      final PsiMethod[] methods = myClassProvider.findDeclaredMethods(reference.getManager(), reference.getReferenceName());
+      final PsiMethod[] methods = myClassProvider.findDeclaredMethods(manager, reference.getReferenceName());
       Set<ExpectedTypeInfo> types = new THashSet<>();
       for (PsiMethod method : methods) {
         final PsiClass aClass = method.getContainingClass();
index 5233e6748ab74b06a795e9112949c06f7025a708..169961edeb29f50256e0126ddd2138503dfed8d5 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.actionSystem.ActionManager;
 import com.intellij.openapi.actionSystem.IdeActions;
 import com.intellij.openapi.actionSystem.Shortcut;
 import com.intellij.openapi.application.ApplicationManager;
+import com.intellij.openapi.application.ReadAction;
 import com.intellij.openapi.keymap.KeymapUtil;
 import com.intellij.openapi.progress.ProgressIndicator;
 import com.intellij.openapi.progress.ProgressManager;
@@ -267,12 +268,7 @@ public class MarkerType {
     if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
       OverridingMethodsSearch.search(method).forEach(new PsiElementProcessorAdapter<>(collectProcessor));
       if (isAbstract && collectProcessor.getCollection().size() < 2) {
-        final PsiClass aClass = ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() {
-          @Override
-          public PsiClass compute() {
-            return method.getContainingClass();
-          }
-        });
+        final PsiClass aClass = ReadAction.compute(() -> method.getContainingClass());
         if (aClass != null) {
           FunctionalExpressionSearch.search(aClass).forEach(new PsiElementProcessorAdapter<>(collectExprProcessor));
         }
@@ -350,14 +346,11 @@ public class MarkerType {
       return;
     }
 
-    final PsiElementProcessor.CollectElementsWithLimit<PsiClass> collectProcessor = new PsiElementProcessor.CollectElementsWithLimit<>(2,
-                                                                                                                                       new THashSet<>());
-    final PsiElementProcessor.CollectElementsWithLimit<PsiFunctionalExpression> collectExprProcessor =
-      new PsiElementProcessor.CollectElementsWithLimit<>(2,
-                                                         new THashSet<>());
+    final PsiElementProcessor.FindElement<PsiClass> collectProcessor = new PsiElementProcessor.FindElement<>();
+    final PsiElementProcessor.FindElement<PsiFunctionalExpression> collectExprProcessor = new PsiElementProcessor.FindElement<>();
     if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
       ClassInheritorsSearch.search(aClass).forEach(new PsiElementProcessorAdapter<>(collectProcessor));
-      if (collectProcessor.getCollection().size() < 2) {
+      if (collectProcessor.getFoundElement() == null) {
         FunctionalExpressionSearch.search(aClass).forEach(new PsiElementProcessorAdapter<>(collectExprProcessor));
       }
     }, SEARCHING_FOR_OVERRIDDEN_METHODS, true, aClass.getProject(), (JComponent)e.getComponent())) {
@@ -365,8 +358,8 @@ public class MarkerType {
     }
 
     final List<NavigatablePsiElement> inheritors = new ArrayList<>();
-    inheritors.addAll(collectProcessor.getCollection());
-    inheritors.addAll(collectExprProcessor.getCollection());
+    ContainerUtil.addIfNotNull(inheritors, collectProcessor.getFoundElement());
+    ContainerUtil.addIfNotNull(inheritors, collectExprProcessor.getFoundElement());
     if (inheritors.isEmpty()) return;
     final PsiClassOrFunctionalExpressionListCellRenderer renderer = new PsiClassOrFunctionalExpressionListCellRenderer();
     final SubclassUpdater subclassUpdater = new SubclassUpdater(aClass, renderer);
@@ -392,6 +385,16 @@ public class MarkerType {
              : DaemonBundle.message("navigation.title.subclass", myClass.getName(), size, suffix);
     }
 
+    @Override
+    public void onFinished() {
+      super.onFinished();
+      PsiElement oneElement = getTheOnlyOneElement();
+      if (oneElement instanceof NavigatablePsiElement) {
+        ((NavigatablePsiElement)oneElement).navigate(true);
+        myPopup.cancel();
+      }
+    }
+
     @Override
     public void run(@NotNull final ProgressIndicator indicator) {
       super.run(indicator);
@@ -441,6 +444,16 @@ public class MarkerType {
              DaemonBundle.message("navigation.title.overrider.method", myMethod.getName(), size);
     }
 
+    @Override
+    public void onFinished() {
+      super.onFinished();
+      PsiElement oneElement = getTheOnlyOneElement();
+      if (oneElement instanceof NavigatablePsiElement) {
+        ((NavigatablePsiElement)oneElement).navigate(true);
+        myPopup.cancel();
+      }
+    }
+
     @Override
     public void run(@NotNull final ProgressIndicator indicator) {
       super.run(indicator);
index 7c064707da63074c9c4d6a5767157892058168bf..3502dd3986c142a9a3e32680536410f1a33bd998 100644 (file)
@@ -43,6 +43,7 @@ public class JavaLineIndentProvider extends JavaLikeLangLineIndentProvider {
     SYNTAX_MAP.put(JavaTokenType.LBRACE, BlockOpeningBrace);
     SYNTAX_MAP.put(JavaTokenType.RBRACE, BlockClosingBrace);
     SYNTAX_MAP.put(JavaTokenType.LBRACKET, ArrayOpeningBracket);
+    SYNTAX_MAP.put(JavaTokenType.RBRACKET, ArrayClosingBracket);
     SYNTAX_MAP.put(JavaTokenType.RPARENTH, RightParenthesis);
     SYNTAX_MAP.put(JavaTokenType.LPARENTH, LeftParenthesis);
     SYNTAX_MAP.put(JavaTokenType.COLON, Colon);
@@ -51,6 +52,7 @@ public class JavaLineIndentProvider extends JavaLikeLangLineIndentProvider {
     SYNTAX_MAP.put(JavaTokenType.IF_KEYWORD, IfKeyword);
     SYNTAX_MAP.put(JavaTokenType.ELSE_KEYWORD, ElseKeyword);
     SYNTAX_MAP.put(JavaTokenType.FOR_KEYWORD, ForKeyword);
+    SYNTAX_MAP.put(JavaTokenType.DO_KEYWORD, DoKeyword);
     SYNTAX_MAP.put(JavaTokenType.C_STYLE_COMMENT, BlockComment);
     SYNTAX_MAP.put(JavaDocTokenType.DOC_COMMENT_START, DocBlockStart);
     SYNTAX_MAP.put(JavaDocTokenType.DOC_COMMENT_END, DocBlockEnd);
index 9b7c38453c68cbe1a2ab6006b97ca53c29529c30..0c0e6bde9a653c2b021bbc53ef5530f8fd986999 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2016 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.codeInsight.intention.HighPriorityAction;
 import com.intellij.ide.util.MemberChooser;
 import com.intellij.lang.java.JavaLanguage;
 import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.application.TransactionGuard;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.fileEditor.ex.IdeDocumentHistory;
@@ -158,27 +157,25 @@ public class BindFieldsFromParametersAction extends BaseIntentionAction implemen
   private static void invoke(final Project project, Editor editor, PsiFile file, boolean isInteractive) {
     PsiParameter psiParameter = FieldFromParameterUtils.findParameterAtCursor(file, editor);
     if (!FileModificationService.getInstance().prepareFileForWrite(file)) return;
-    TransactionGuard.getInstance().submitTransactionAndWait(() -> {
-      final PsiMethod method = psiParameter != null ? (PsiMethod)psiParameter.getDeclarationScope() : PsiTreeUtil.getParentOfType(file.findElementAt(editor.getCaretModel().getOffset()), PsiMethod.class);
-      LOG.assertTrue(method != null);
-
-      final HashSet<String> usedNames = new HashSet<>();
-      final Iterable<PsiParameter> parameters = selectParameters(project, method, copyUnboundedParamsAndClearOriginal(method), isInteractive);
-      final MultiMap<PsiType, PsiParameter> types = new MultiMap<>();
-      for (PsiParameter parameter : parameters) {
-        types.putValue(parameter.getType(), parameter);
-      }
-      final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
-      final boolean preferLongerNames = settings.PREFER_LONGER_NAMES;
-      for (PsiParameter selected : parameters) {
-        try {
-          settings.PREFER_LONGER_NAMES = preferLongerNames || types.get(selected.getType()).size() > 1;
-          processParameter(project, selected, usedNames);
-        } finally {
-          settings.PREFER_LONGER_NAMES = preferLongerNames;
-        }
+    final PsiMethod method = psiParameter != null ? (PsiMethod)psiParameter.getDeclarationScope() : PsiTreeUtil.getParentOfType(file.findElementAt(editor.getCaretModel().getOffset()), PsiMethod.class);
+    LOG.assertTrue(method != null);
+
+    final HashSet<String> usedNames = new HashSet<>();
+    final Iterable<PsiParameter> parameters = selectParameters(project, method, copyUnboundedParamsAndClearOriginal(method), isInteractive);
+    final MultiMap<PsiType, PsiParameter> types = new MultiMap<>();
+    for (PsiParameter parameter : parameters) {
+      types.putValue(parameter.getType(), parameter);
+    }
+    final CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(project);
+    final boolean preferLongerNames = settings.PREFER_LONGER_NAMES;
+    for (PsiParameter selected : parameters) {
+      try {
+        settings.PREFER_LONGER_NAMES = preferLongerNames || types.get(selected.getType()).size() > 1;
+        processParameter(project, selected, usedNames);
+      } finally {
+        settings.PREFER_LONGER_NAMES = preferLongerNames;
       }
-    });
+    }
   }
 
   @NotNull
index 58293d42b45ec5de0d8e8b081a3975df9df5adbc..0eeeba2474de3b58eb2891d495edc68691cb0bff 100644 (file)
@@ -54,7 +54,6 @@ import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.util.ClassKind;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.PropertyMemberType;
-import com.intellij.refactoring.changeSignature.ChangeSignatureGestureDetector;
 import com.intellij.util.DocumentUtil;
 import com.intellij.util.IncorrectOperationException;
 import org.jetbrains.annotations.NotNull;
@@ -703,14 +702,6 @@ public class QuickFixFactoryImpl extends QuickFixFactory {
   @NotNull
   @Override
   public IntentionAction createSafeDeleteFix(@NotNull PsiElement element) {
-    if (element instanceof PsiMethod) {
-      PsiMethod method = (PsiMethod)element;
-      PsiClass containingClass = method.getContainingClass();
-      if (method.getReturnType() != null || containingClass != null && Comparing.strEqual(containingClass.getName(), method.getName())) {
-        //ignore methods with deleted return types as they are always marked as unused without any reason
-        ChangeSignatureGestureDetector.getInstance(method.getProject()).dismissForElement(method);
-      }
-    }
     return new SafeDeleteFix(element);
   }
 
index 27c4e6958bf55b6b160b40507e01bafa9970ed0d..78c931856ce26f045132d77cec9762f011819ca4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2015 JetBrains s.r.o.
+ * Copyright 2000-2016 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.
@@ -20,17 +20,19 @@ import com.intellij.codeInsight.FileModificationService;
 import com.intellij.codeInsight.daemon.QuickFixBundle;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.*;
+import com.intellij.openapi.util.InvalidDataException;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.WriteExternalException;
 import com.intellij.psi.*;
 import com.intellij.psi.search.LocalSearchScope;
-import com.intellij.psi.search.SearchScope;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.NullableFunction;
 import com.intellij.util.containers.ContainerUtil;
 import com.siyeh.ig.performance.CollectionsListSettings;
+import com.siyeh.ig.psiutils.ExpressionUtils;
 import org.jdom.Element;
-import org.jetbrains.annotations.Nls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -196,8 +198,7 @@ public class CollectionAddAllCanBeReplacedWithConstructorInspection extends Base
         return Pair.create(true, null);
       }
       for (PsiAssignmentExpression expression