Merge remote-tracking branch 'origin/master'
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Thu, 6 Oct 2016 16:33:28 +0000 (19:33 +0300)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Thu, 6 Oct 2016 16:33:28 +0000 (19:33 +0300)
791 files changed:
.idea/libraries/Gradle.xml
build/groovy/org/jetbrains/intellij/build/CommunityLibraryLicenses.groovy
build/scripts/download_jre.gant
images/src/org/intellij/images/icons/ImagesFileType.png
images/src/org/intellij/images/icons/ImagesFileType.svg [new file with mode: 0644]
images/src/org/intellij/images/icons/ImagesFileType@2x.png
images/src/org/intellij/images/icons/ImagesFileType@2x.svg [new file with mode: 0644]
java/compiler/impl/src/com/intellij/task/impl/InternalProjectTaskRunner.java
java/compiler/impl/src/com/intellij/task/impl/ModuleBuildTaskImpl.java
java/compiler/impl/src/com/intellij/task/impl/ProjectTaskManagerImpl.java
java/compiler/openapi/src/com/intellij/task/ModuleBuildTask.java
java/compiler/openapi/src/com/intellij/task/ProjectTaskManager.java
java/execution/impl/src/com/intellij/compiler/options/CompileStepBeforeRun.java
java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefClassImpl.java
java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefImplicitConstructorImpl.java
java/java-analysis-impl/src/com/intellij/codeInspection/reference/RefMethodImpl.java
java/java-analysis-impl/src/com/intellij/codeInspection/sameParameterValue/SameParameterValueInspectionBase.java
java/java-analysis-impl/src/com/intellij/refactoring/util/duplicates/DuplicatesFinder.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/MigrateToStreamFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/ReplaceWithCollectFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/ReplaceWithCountFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/ReplaceWithFindFirstFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/ReplaceWithForeachCallFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/ReplaceWithMatchFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/ReplaceWithSumFix.java
java/java-impl/src/com/intellij/codeInspection/streamMigration/StreamApiMigrationInspection.java
java/java-impl/src/com/intellij/javadoc/JavadocHelper.java
java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java
java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSessionContainer.java
java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/PsiGraphInferenceHelper.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/graphInference/ChainedInference.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/ReturnTypeCompatibility.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/InferTypeParametersFromFunctionalInterfaceInputs.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/afterFlatMapForLoop.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/afterForLoop.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/afterForLoopBoxed.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/afterForLoopShortBound.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/afterPrimitiveArray.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeFindFirstUsedInBound.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeFlatMapForLoop.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoop.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoopBoxed.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoopFloatBound.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoopShortBound.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoopUpdated.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoopWrongBound.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoopWrongIncrement.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeForLoopWrongInitializer.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforePrimitiveArray.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforePrimitiveArrayWrongType.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/streamApiMigration/beforeSumAccessOuterFor.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
java/java-tests/testSrc/com/intellij/codeInsight/editorActions/FixDocCommentTest.groovy
platform/analysis-impl/src/com/intellij/codeInspection/reference/RefDirectoryImpl.java
platform/analysis-impl/src/com/intellij/codeInspection/reference/RefElementImpl.java
platform/core-api/src/com/intellij/openapi/editor/colors/TextAttributesKey.java
platform/core-api/src/com/intellij/openapi/editor/markup/TextAttributes.java
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/AbstractColorsScheme.java
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/DefaultColorsScheme.java
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImpl.java
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/TextAttributesReader.java
platform/icons/src/debugger/threads.png
platform/icons/src/debugger/threads.svg [new file with mode: 0644]
platform/icons/src/debugger/threads@2x.png
platform/icons/src/debugger/threads@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/any_type.png
platform/icons/src/fileTypes/any_type.svg [new file with mode: 0644]
platform/icons/src/fileTypes/any_type@2x.png
platform/icons/src/fileTypes/any_type@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/archive.png
platform/icons/src/fileTypes/archive.svg [new file with mode: 0644]
platform/icons/src/fileTypes/archive@2x.png
platform/icons/src/fileTypes/archive@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/as.png
platform/icons/src/fileTypes/as.svg [new file with mode: 0644]
platform/icons/src/fileTypes/as@2x.png
platform/icons/src/fileTypes/as@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/aspectj.png
platform/icons/src/fileTypes/aspectj.svg [new file with mode: 0644]
platform/icons/src/fileTypes/aspectj@2x.png
platform/icons/src/fileTypes/aspectj@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/config.png
platform/icons/src/fileTypes/config.svg [new file with mode: 0644]
platform/icons/src/fileTypes/config@2x.png
platform/icons/src/fileTypes/config@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/css.png
platform/icons/src/fileTypes/css.svg [new file with mode: 0644]
platform/icons/src/fileTypes/css@2x.png
platform/icons/src/fileTypes/css@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/custom.png
platform/icons/src/fileTypes/custom.svg [new file with mode: 0644]
platform/icons/src/fileTypes/custom@2x.png
platform/icons/src/fileTypes/custom@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/diagram.png
platform/icons/src/fileTypes/diagram.svg [new file with mode: 0644]
platform/icons/src/fileTypes/diagram@2x.png
platform/icons/src/fileTypes/diagram@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/dtd.png
platform/icons/src/fileTypes/dtd.svg [new file with mode: 0644]
platform/icons/src/fileTypes/dtd@2x.png
platform/icons/src/fileTypes/dtd@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/facelets.png
platform/icons/src/fileTypes/facelets.svg [new file with mode: 0644]
platform/icons/src/fileTypes/facelets@2x.png
platform/icons/src/fileTypes/facelets@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/facesConfig.png
platform/icons/src/fileTypes/facesConfig.svg [new file with mode: 0644]
platform/icons/src/fileTypes/facesConfig@2x.png
platform/icons/src/fileTypes/facesConfig@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/htaccess.png
platform/icons/src/fileTypes/htaccess.svg [new file with mode: 0644]
platform/icons/src/fileTypes/htaccess@2x.png
platform/icons/src/fileTypes/htaccess@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/html.png
platform/icons/src/fileTypes/html.svg [new file with mode: 0644]
platform/icons/src/fileTypes/html@2x.png
platform/icons/src/fileTypes/html@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/idl.png
platform/icons/src/fileTypes/idl.svg [new file with mode: 0644]
platform/icons/src/fileTypes/idl@2x.png
platform/icons/src/fileTypes/idl@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/java.png
platform/icons/src/fileTypes/java.svg [new file with mode: 0644]
platform/icons/src/fileTypes/java@2x.png
platform/icons/src/fileTypes/java@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/javaClass.png
platform/icons/src/fileTypes/javaClass.svg [new file with mode: 0644]
platform/icons/src/fileTypes/javaClass@2x.png
platform/icons/src/fileTypes/javaClass@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/javaOutsideSource.png
platform/icons/src/fileTypes/javaOutsideSource.svg [new file with mode: 0644]
platform/icons/src/fileTypes/javaOutsideSource@2x.png
platform/icons/src/fileTypes/javaOutsideSource@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/javaScript.png
platform/icons/src/fileTypes/javaScript.svg [new file with mode: 0644]
platform/icons/src/fileTypes/javaScript@2x.png
platform/icons/src/fileTypes/javaScript@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/json.png
platform/icons/src/fileTypes/json.svg [new file with mode: 0644]
platform/icons/src/fileTypes/json@2x.png
platform/icons/src/fileTypes/json@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/jsp.png
platform/icons/src/fileTypes/jsp.svg [new file with mode: 0644]
platform/icons/src/fileTypes/jsp@2x.png
platform/icons/src/fileTypes/jsp@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/jspx.png
platform/icons/src/fileTypes/jspx.svg [new file with mode: 0644]
platform/icons/src/fileTypes/jspx@2x.png
platform/icons/src/fileTypes/jspx@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/manifest.png
platform/icons/src/fileTypes/manifest.svg [new file with mode: 0644]
platform/icons/src/fileTypes/manifest@2x.png
platform/icons/src/fileTypes/manifest@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/properties.png
platform/icons/src/fileTypes/properties.svg [new file with mode: 0644]
platform/icons/src/fileTypes/properties@2x.png
platform/icons/src/fileTypes/properties@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/text.png
platform/icons/src/fileTypes/text.svg [new file with mode: 0644]
platform/icons/src/fileTypes/text@2x.png
platform/icons/src/fileTypes/text@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/typeScript.png
platform/icons/src/fileTypes/typeScript.svg [new file with mode: 0644]
platform/icons/src/fileTypes/typeScript@2x.png
platform/icons/src/fileTypes/typeScript@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/uiForm.png
platform/icons/src/fileTypes/uiForm.svg [new file with mode: 0644]
platform/icons/src/fileTypes/uiForm@2x.png
platform/icons/src/fileTypes/uiForm@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/unknown.png
platform/icons/src/fileTypes/unknown.svg [new file with mode: 0644]
platform/icons/src/fileTypes/unknown@2x.png
platform/icons/src/fileTypes/unknown@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/wsdlFile.png
platform/icons/src/fileTypes/wsdlFile.svg [new file with mode: 0644]
platform/icons/src/fileTypes/wsdlFile@2x.png
platform/icons/src/fileTypes/wsdlFile@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/xhtml.png
platform/icons/src/fileTypes/xhtml.svg [new file with mode: 0644]
platform/icons/src/fileTypes/xhtml@2x.png
platform/icons/src/fileTypes/xhtml@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/xml.png
platform/icons/src/fileTypes/xml.svg [new file with mode: 0644]
platform/icons/src/fileTypes/xml@2x.png
platform/icons/src/fileTypes/xml@2x.svg [new file with mode: 0644]
platform/icons/src/fileTypes/xsdFile.png
platform/icons/src/fileTypes/xsdFile.svg [new file with mode: 0644]
platform/icons/src/fileTypes/xsdFile@2x.png
platform/icons/src/fileTypes/xsdFile@2x.svg [new file with mode: 0644]
platform/icons/src/modules/ResourcesRoot.svg [new file with mode: 0644]
platform/icons/src/modules/ResourcesRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/edit.png
platform/icons/src/modules/edit.svg [new file with mode: 0644]
platform/icons/src/modules/edit@2x.png
platform/icons/src/modules/edit@2x.svg [new file with mode: 0644]
platform/icons/src/modules/editFolder.png
platform/icons/src/modules/editFolder.svg [new file with mode: 0644]
platform/icons/src/modules/editFolder@2x.png
platform/icons/src/modules/editFolder@2x.svg [new file with mode: 0644]
platform/icons/src/modules/excludeRoot.png
platform/icons/src/modules/excludeRoot.svg [new file with mode: 0644]
platform/icons/src/modules/excludeRoot@2x.png
platform/icons/src/modules/excludeRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/excludedGeneratedRoot.png
platform/icons/src/modules/excludedGeneratedRoot.svg [new file with mode: 0644]
platform/icons/src/modules/excludedGeneratedRoot@2x.png
platform/icons/src/modules/excludedGeneratedRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/generatedFolder.png
platform/icons/src/modules/generatedFolder.svg [new file with mode: 0644]
platform/icons/src/modules/generatedFolder@2x.png
platform/icons/src/modules/generatedFolder@2x.svg [new file with mode: 0644]
platform/icons/src/modules/generatedSourceRoot.png
platform/icons/src/modules/generatedSourceRoot.svg [new file with mode: 0644]
platform/icons/src/modules/generatedSourceRoot@2x.png
platform/icons/src/modules/generatedSourceRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/generatedTestRoot.png
platform/icons/src/modules/generatedTestRoot.svg [new file with mode: 0644]
platform/icons/src/modules/generatedTestRoot@2x.png
platform/icons/src/modules/generatedTestRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/library.png
platform/icons/src/modules/library.svg [new file with mode: 0644]
platform/icons/src/modules/library@2x.png
platform/icons/src/modules/library@2x.svg [new file with mode: 0644]
platform/icons/src/modules/modulesNode.png
platform/icons/src/modules/modulesNode.svg [new file with mode: 0644]
platform/icons/src/modules/modulesNode@2x.png
platform/icons/src/modules/modulesNode@2x.svg [new file with mode: 0644]
platform/icons/src/modules/output.png
platform/icons/src/modules/output.svg [new file with mode: 0644]
platform/icons/src/modules/output@2x.png
platform/icons/src/modules/output@2x.svg [new file with mode: 0644]
platform/icons/src/modules/resourcesRoot.png
platform/icons/src/modules/resourcesRoot@2x.png
platform/icons/src/modules/sourceFolder.png
platform/icons/src/modules/sourceFolder.svg [new file with mode: 0644]
platform/icons/src/modules/sourceFolder@2x.png
platform/icons/src/modules/sourceFolder@2x.svg [new file with mode: 0644]
platform/icons/src/modules/sourceRoot.png
platform/icons/src/modules/sourceRoot.svg [new file with mode: 0644]
platform/icons/src/modules/sourceRoot@2x.png
platform/icons/src/modules/sourceRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/sources.png
platform/icons/src/modules/sources.svg [new file with mode: 0644]
platform/icons/src/modules/sources@2x.png
platform/icons/src/modules/sources@2x.svg [new file with mode: 0644]
platform/icons/src/modules/testResourcesRoot.png
platform/icons/src/modules/testResourcesRoot.svg [new file with mode: 0644]
platform/icons/src/modules/testResourcesRoot@2x.png
platform/icons/src/modules/testResourcesRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/testRoot.png
platform/icons/src/modules/testRoot.svg [new file with mode: 0644]
platform/icons/src/modules/testRoot@2x.png
platform/icons/src/modules/testRoot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/testSourceFolder.png
platform/icons/src/modules/testSourceFolder.svg [new file with mode: 0644]
platform/icons/src/modules/testSourceFolder@2x.png
platform/icons/src/modules/testSourceFolder@2x.svg [new file with mode: 0644]
platform/icons/src/modules/unmarkWebroot.png
platform/icons/src/modules/unmarkWebroot.svg [new file with mode: 0644]
platform/icons/src/modules/unmarkWebroot@2x.png
platform/icons/src/modules/unmarkWebroot@2x.svg [new file with mode: 0644]
platform/icons/src/modules/webRoot.png
platform/icons/src/modules/webRoot.svg [new file with mode: 0644]
platform/icons/src/modules/webRoot@2x.png
platform/icons/src/modules/webRoot@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/DataSource.png
platform/icons/src/nodes/DataSource@2x.png
platform/icons/src/nodes/DataTables.png
platform/icons/src/nodes/DataTables@2x.png
platform/icons/src/nodes/Module.png
platform/icons/src/nodes/Module.svg [new file with mode: 0644]
platform/icons/src/nodes/Module@2x.png
platform/icons/src/nodes/Module@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/SecurityRole.png
platform/icons/src/nodes/SecurityRole@2x.png
platform/icons/src/nodes/SecurityRole@2x_dark.png [deleted file]
platform/icons/src/nodes/SecurityRole_dark.png [deleted file]
platform/icons/src/nodes/TreeClosed.png
platform/icons/src/nodes/TreeClosed.svg [new file with mode: 0644]
platform/icons/src/nodes/TreeClosed@2x.png
platform/icons/src/nodes/TreeClosed@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/TreeOpen.png
platform/icons/src/nodes/TreeOpen@2x.png
platform/icons/src/nodes/abstractClass.png
platform/icons/src/nodes/abstractClass.svg [new file with mode: 0644]
platform/icons/src/nodes/abstractClass@2x.png
platform/icons/src/nodes/abstractClass@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/abstractException.png
platform/icons/src/nodes/abstractException.svg [new file with mode: 0644]
platform/icons/src/nodes/abstractException@2x.png
platform/icons/src/nodes/abstractException@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/abstractMethod.png
platform/icons/src/nodes/abstractMethod.svg [new file with mode: 0644]
platform/icons/src/nodes/abstractMethod@2x.png
platform/icons/src/nodes/abstractMethod@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/advice.png
platform/icons/src/nodes/advice@2x.png
platform/icons/src/nodes/advice@2x_dark.png [deleted file]
platform/icons/src/nodes/advice_dark.png [deleted file]
platform/icons/src/nodes/annotationtype.png
platform/icons/src/nodes/annotationtype.svg [new file with mode: 0644]
platform/icons/src/nodes/annotationtype@2x.png
platform/icons/src/nodes/annotationtype@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/anonymousClass.png
platform/icons/src/nodes/anonymousClass.svg [new file with mode: 0644]
platform/icons/src/nodes/anonymousClass@2x.png
platform/icons/src/nodes/anonymousClass@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/artifact.png
platform/icons/src/nodes/artifact@2x.png
platform/icons/src/nodes/aspect.png
platform/icons/src/nodes/aspect@2x.png
platform/icons/src/nodes/c_plocal.png
platform/icons/src/nodes/c_plocal@2x.png
platform/icons/src/nodes/c_private.png
platform/icons/src/nodes/c_private@2x.png
platform/icons/src/nodes/c_protected.png
platform/icons/src/nodes/c_protected@2x.png
platform/icons/src/nodes/c_public.png
platform/icons/src/nodes/c_public@2x.png
platform/icons/src/nodes/class.png
platform/icons/src/nodes/class.svg [new file with mode: 0644]
platform/icons/src/nodes/class@2x.png
platform/icons/src/nodes/class@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/classInitializer.png
platform/icons/src/nodes/classInitializer.svg [new file with mode: 0644]
platform/icons/src/nodes/classInitializer@2x.png
platform/icons/src/nodes/classInitializer@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/compiledClassesFolder.png
platform/icons/src/nodes/compiledClassesFolder@2x.png
platform/icons/src/nodes/compiledClassesFolder@2x_dark.png [deleted file]
platform/icons/src/nodes/compiledClassesFolder_dark.png [deleted file]
platform/icons/src/nodes/copyOfFolder.png
platform/icons/src/nodes/copyOfFolder@2x.png
platform/icons/src/nodes/customRegion.png
platform/icons/src/nodes/customRegion@2x.png
platform/icons/src/nodes/cvs_global.png
platform/icons/src/nodes/cvs_global@2x.png
platform/icons/src/nodes/cvs_roots.png
platform/icons/src/nodes/cvs_roots@2x.png
platform/icons/src/nodes/dataColumn.png
platform/icons/src/nodes/dataColumn@2x.png
platform/icons/src/nodes/dataSchema.png
platform/icons/src/nodes/dataSchema@2x.png
platform/icons/src/nodes/dataSchema@2x_dark.png [deleted file]
platform/icons/src/nodes/dataSchema_dark.png [deleted file]
platform/icons/src/nodes/dataView.png
platform/icons/src/nodes/dataView@2x.png
platform/icons/src/nodes/dataView@2x_dark.png [deleted file]
platform/icons/src/nodes/dataView_dark.png [deleted file]
platform/icons/src/nodes/deploy.png
platform/icons/src/nodes/deploy@2x.png
platform/icons/src/nodes/desktop.png
platform/icons/src/nodes/desktop@2x.png
platform/icons/src/nodes/disabledPointcut.png
platform/icons/src/nodes/disabledPointcut@2x.png
platform/icons/src/nodes/ejb.png
platform/icons/src/nodes/ejb@2x.png
platform/icons/src/nodes/ejbBusinessMethod.png
platform/icons/src/nodes/ejbBusinessMethod@2x.png
platform/icons/src/nodes/ejbCmpField.png
platform/icons/src/nodes/ejbCmpField@2x.png
platform/icons/src/nodes/ejbCmrField.png
platform/icons/src/nodes/ejbCmrField@2x.png
platform/icons/src/nodes/ejbCreateMethod.png
platform/icons/src/nodes/ejbCreateMethod@2x.png
platform/icons/src/nodes/ejbCreateMethod@2x_dark.png [deleted file]
platform/icons/src/nodes/ejbCreateMethod_dark.png [deleted file]
platform/icons/src/nodes/ejbFinderMethod.png
platform/icons/src/nodes/ejbFinderMethod@2x.png
platform/icons/src/nodes/ejbFinderMethod@2x_dark.png [deleted file]
platform/icons/src/nodes/ejbFinderMethod_dark.png [deleted file]
platform/icons/src/nodes/ejbPrimaryKeyClass.png
platform/icons/src/nodes/ejbPrimaryKeyClass@2x.png
platform/icons/src/nodes/ejbPrimaryKeyClass@2x_dark.png [deleted file]
platform/icons/src/nodes/ejbPrimaryKeyClass_dark.png [deleted file]
platform/icons/src/nodes/ejbReference.png
platform/icons/src/nodes/ejbReference@2x.png
platform/icons/src/nodes/entryPoints.png
platform/icons/src/nodes/entryPoints@2x.png
platform/icons/src/nodes/enum.png
platform/icons/src/nodes/enum.svg [new file with mode: 0644]
platform/icons/src/nodes/enum@2x.png
platform/icons/src/nodes/enum@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/errorIntroduction.png
platform/icons/src/nodes/errorIntroduction@2x.png
platform/icons/src/nodes/errorMark.png
platform/icons/src/nodes/errorMark@2x.png
platform/icons/src/nodes/errorMark@2x_dark.png [deleted file]
platform/icons/src/nodes/errorMark_dark.png [deleted file]
platform/icons/src/nodes/exceptionClass.png
platform/icons/src/nodes/exceptionClass.svg [new file with mode: 0644]
platform/icons/src/nodes/exceptionClass@2x.png
platform/icons/src/nodes/exceptionClass@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/excludedFromCompile.png
platform/icons/src/nodes/excludedFromCompile@2x.png
platform/icons/src/nodes/excludedFromCompile@2x_dark.png [deleted file]
platform/icons/src/nodes/excludedFromCompile_dark.png [deleted file]
platform/icons/src/nodes/extractedFolder.png
platform/icons/src/nodes/extractedFolder@2x.png
platform/icons/src/nodes/extractedFolder@2x_dark.png [deleted file]
platform/icons/src/nodes/extractedFolder_dark.png [deleted file]
platform/icons/src/nodes/field.png
platform/icons/src/nodes/field.svg [new file with mode: 0644]
platform/icons/src/nodes/field@2x.png
platform/icons/src/nodes/field@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/fieldPK.png
platform/icons/src/nodes/fieldPK@2x.png
platform/icons/src/nodes/fieldPK@2x_dark.png [deleted file]
platform/icons/src/nodes/fieldPK_dark.png [deleted file]
platform/icons/src/nodes/folder.png
platform/icons/src/nodes/folder.svg [new file with mode: 0644]
platform/icons/src/nodes/folder@2x.png
platform/icons/src/nodes/folder@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/function.png
platform/icons/src/nodes/function.svg [new file with mode: 0644]
platform/icons/src/nodes/function@2x.png
platform/icons/src/nodes/function@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/homeFolder.png
platform/icons/src/nodes/homeFolder@2x.png
platform/icons/src/nodes/ideaModule.png
platform/icons/src/nodes/ideaModule.svg [new file with mode: 0644]
platform/icons/src/nodes/ideaModule@2x.png
platform/icons/src/nodes/ideaModule@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/ideaModule@2x_dark.png [deleted file]
platform/icons/src/nodes/ideaModule_dark.png [deleted file]
platform/icons/src/nodes/ideaProject.png
platform/icons/src/nodes/ideaProject.svg [new file with mode: 0644]
platform/icons/src/nodes/ideaProject@2x.png
platform/icons/src/nodes/ideaProject@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/ideaProject@2x_dark.png [deleted file]
platform/icons/src/nodes/ideaProject_dark.png [deleted file]
platform/icons/src/nodes/inspectionResults.png
platform/icons/src/nodes/inspectionResults@2x.png
platform/icons/src/nodes/interface.png
platform/icons/src/nodes/interface.svg [new file with mode: 0644]
platform/icons/src/nodes/interface@2x.png
platform/icons/src/nodes/interface@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/j2eeParameter.png
platform/icons/src/nodes/j2eeParameter@2x.png
platform/icons/src/nodes/jarDirectory.png
platform/icons/src/nodes/jarDirectory@2x.png
platform/icons/src/nodes/jarDirectory@2x_dark.png [deleted file]
platform/icons/src/nodes/jarDirectory_dark.png [deleted file]
platform/icons/src/nodes/javaDocFolder.png
platform/icons/src/nodes/javaDocFolder@2x.png
platform/icons/src/nodes/javaDocFolder@2x_dark.png [deleted file]
platform/icons/src/nodes/javaDocFolder_dark.png [deleted file]
platform/icons/src/nodes/jsf/component.png
platform/icons/src/nodes/jsf/component@2x.png
platform/icons/src/nodes/jsf/converter.png
platform/icons/src/nodes/jsf/converter@2x.png
platform/icons/src/nodes/jsf/converter@2x_dark.png [deleted file]
platform/icons/src/nodes/jsf/converter_dark.png [deleted file]
platform/icons/src/nodes/jsf/general.png
platform/icons/src/nodes/jsf/general@2x.png
platform/icons/src/nodes/jsf/general@2x_dark.png [deleted file]
platform/icons/src/nodes/jsf/general_dark.png [deleted file]
platform/icons/src/nodes/jsf/genericValue.png
platform/icons/src/nodes/jsf/genericValue@2x.png
platform/icons/src/nodes/jsf/managedBean.png
platform/icons/src/nodes/jsf/managedBean@2x.png
platform/icons/src/nodes/jsf/navigationCase.png
platform/icons/src/nodes/jsf/navigationCase@2x.png
platform/icons/src/nodes/jsf/navigationRule.png
platform/icons/src/nodes/jsf/navigationRule@2x.png
platform/icons/src/nodes/jsf/navigationRule@2x_dark.png [deleted file]
platform/icons/src/nodes/jsf/navigationRule_dark.png [deleted file]
platform/icons/src/nodes/jsf/renderKit.png
platform/icons/src/nodes/jsf/renderKit@2x.png
platform/icons/src/nodes/jsf/renderKit@2x_dark.png [deleted file]
platform/icons/src/nodes/jsf/renderKit_dark.png [deleted file]
platform/icons/src/nodes/jsf/renderer.png
platform/icons/src/nodes/jsf/renderer@2x.png
platform/icons/src/nodes/jsf/renderer@2x_dark.png [deleted file]
platform/icons/src/nodes/jsf/renderer_dark.png [deleted file]
platform/icons/src/nodes/jsf/validator.png
platform/icons/src/nodes/jsf/validator@2x.png
platform/icons/src/nodes/jsr45.png
platform/icons/src/nodes/jsr45@2x.png
platform/icons/src/nodes/jsr45@2x_dark.png [deleted file]
platform/icons/src/nodes/jsr45_dark.png [deleted file]
platform/icons/src/nodes/junitTestMark.png
platform/icons/src/nodes/junitTestMark@2x.png
platform/icons/src/nodes/junitTestMark@2x_dark.png [deleted file]
platform/icons/src/nodes/junitTestMark_dark.png [deleted file]
platform/icons/src/nodes/keymapAnt.png
platform/icons/src/nodes/keymapAnt@2x.png
platform/icons/src/nodes/keymapAnt@2x_dark.png [deleted file]
platform/icons/src/nodes/keymapAnt_dark.png [deleted file]
platform/icons/src/nodes/keymapEditor.png
platform/icons/src/nodes/keymapEditor@2x.png
platform/icons/src/nodes/keymapMainMenu.png
platform/icons/src/nodes/keymapMainMenu@2x.png
platform/icons/src/nodes/keymapOther.png
platform/icons/src/nodes/keymapOther@2x.png
platform/icons/src/nodes/keymapTools.png
platform/icons/src/nodes/keymapTools@2x.png
platform/icons/src/nodes/keymapTools@2x_dark.png [deleted file]
platform/icons/src/nodes/keymapTools_dark.png [deleted file]
platform/icons/src/nodes/locked.png
platform/icons/src/nodes/locked@2x.png
platform/icons/src/nodes/locked@2x_dark.png [deleted file]
platform/icons/src/nodes/locked_dark.png [deleted file]
platform/icons/src/nodes/method.png
platform/icons/src/nodes/method.svg [new file with mode: 0644]
platform/icons/src/nodes/method@2x.png
platform/icons/src/nodes/method@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/methodReference.png
platform/icons/src/nodes/methodReference.svg [new file with mode: 0644]
platform/icons/src/nodes/methodReference@2x.png
platform/icons/src/nodes/methodReference@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/moduleGroup.png
platform/icons/src/nodes/moduleGroup.svg [new file with mode: 0644]
platform/icons/src/nodes/moduleGroup@2x.png
platform/icons/src/nodes/moduleGroup@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/nativeLibrariesFolder.png
platform/icons/src/nodes/nativeLibrariesFolder@2x.png
platform/icons/src/nodes/nativeLibrariesFolder@2x_dark.png [deleted file]
platform/icons/src/nodes/nativeLibrariesFolder_dark.png [deleted file]
platform/icons/src/nodes/newException.png
platform/icons/src/nodes/newException@2x.png
platform/icons/src/nodes/newFolder.png
platform/icons/src/nodes/newFolder.svg [new file with mode: 0644]
platform/icons/src/nodes/newFolder@2x.png
platform/icons/src/nodes/newFolder@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/newParameter.png
platform/icons/src/nodes/newParameter@2x.png
platform/icons/src/nodes/package.png
platform/icons/src/nodes/package.svg [new file with mode: 0644]
platform/icons/src/nodes/package@2x.png
platform/icons/src/nodes/package@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/padlock.png
platform/icons/src/nodes/padlock@2x.png
platform/icons/src/nodes/padlock@2x_dark.png [deleted file]
platform/icons/src/nodes/padlock_dark.png [deleted file]
platform/icons/src/nodes/parameter.png
platform/icons/src/nodes/parameter.svg [new file with mode: 0644]
platform/icons/src/nodes/parameter@2x.png
platform/icons/src/nodes/parameter@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/pinToolWindow.png
platform/icons/src/nodes/pinToolWindow@2x.png
platform/icons/src/nodes/pinToolWindow@2x_dark.png [deleted file]
platform/icons/src/nodes/pinToolWindow_dark.png [deleted file]
platform/icons/src/nodes/plugin.png
platform/icons/src/nodes/plugin@2x.png
platform/icons/src/nodes/plugin@2x_dark.png [deleted file]
platform/icons/src/nodes/pluginJB.png
platform/icons/src/nodes/pluginJB@2x.png
platform/icons/src/nodes/pluginJB@2x_dark.png [deleted file]
platform/icons/src/nodes/pluginJB_dark.png [deleted file]
platform/icons/src/nodes/pluginLogo.png
platform/icons/src/nodes/pluginLogo@2x.png
platform/icons/src/nodes/pluginLogo@2x_dark.png [deleted file]
platform/icons/src/nodes/pluginLogo_dark.png [deleted file]
platform/icons/src/nodes/pluginRestart.png
platform/icons/src/nodes/pluginRestart@2x.png
platform/icons/src/nodes/pluginRestart@2x_dark.png [deleted file]
platform/icons/src/nodes/pluginRestart_dark.png [deleted file]
platform/icons/src/nodes/pluginUpdate.png
platform/icons/src/nodes/pluginUpdate@2x.png
platform/icons/src/nodes/pluginUpdate@2x_dark.png [deleted file]
platform/icons/src/nodes/pluginUpdate_dark.png [deleted file]
platform/icons/src/nodes/plugin_dark.png [deleted file]
platform/icons/src/nodes/pluginnotinstalled.png
platform/icons/src/nodes/pluginnotinstalled@2x.png
platform/icons/src/nodes/pluginnotinstalled@2x_dark.png [deleted file]
platform/icons/src/nodes/pluginnotinstalled_dark.png [deleted file]
platform/icons/src/nodes/pluginobsolete.png
platform/icons/src/nodes/pluginobsolete@2x.png
platform/icons/src/nodes/pluginobsolete@2x_dark.png [deleted file]
platform/icons/src/nodes/pluginobsolete_dark.png [deleted file]
platform/icons/src/nodes/pointcut.png
platform/icons/src/nodes/pointcut.svg [new file with mode: 0644]
platform/icons/src/nodes/pointcut@2x.png
platform/icons/src/nodes/pointcut@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/ppFile.png
platform/icons/src/nodes/ppFile@2x.png
platform/icons/src/nodes/ppInvalid.png
platform/icons/src/nodes/ppInvalid@2x.png
platform/icons/src/nodes/ppJar.png
platform/icons/src/nodes/ppJar.svg [new file with mode: 0644]
platform/icons/src/nodes/ppJar@2x.png
platform/icons/src/nodes/ppJar@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/ppJar@2x_dark.png [deleted file]
platform/icons/src/nodes/ppJar_dark.png [deleted file]
platform/icons/src/nodes/ppJdk.png
platform/icons/src/nodes/ppJdk@2x.png
platform/icons/src/nodes/ppLib.png
platform/icons/src/nodes/ppLib.svg [new file with mode: 0644]
platform/icons/src/nodes/ppLib@2x.png
platform/icons/src/nodes/ppLib@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/ppLibFolder.png
platform/icons/src/nodes/ppLibFolder.svg [new file with mode: 0644]
platform/icons/src/nodes/ppLibFolder@2x.png
platform/icons/src/nodes/ppLibFolder@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/ppWeb.png
platform/icons/src/nodes/ppWeb@2x.png
platform/icons/src/nodes/ppWebLogo.png
platform/icons/src/nodes/ppWebLogo@2x.png
platform/icons/src/nodes/project.png
platform/icons/src/nodes/project@2x.png
platform/icons/src/nodes/project@2x_dark.png [deleted file]
platform/icons/src/nodes/project_dark.png [deleted file]
platform/icons/src/nodes/property.png
platform/icons/src/nodes/property.svg [new file with mode: 0644]
platform/icons/src/nodes/property@2x.png
platform/icons/src/nodes/property@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyRead.png
platform/icons/src/nodes/propertyRead.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyRead@2x.png
platform/icons/src/nodes/propertyRead@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyReadStatic.png
platform/icons/src/nodes/propertyReadStatic.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyReadStatic@2x.png
platform/icons/src/nodes/propertyReadStatic@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyReadWrite.png
platform/icons/src/nodes/propertyReadWrite.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyReadWrite@2x.png
platform/icons/src/nodes/propertyReadWrite@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyReadWriteStatic.png
platform/icons/src/nodes/propertyReadWriteStatic.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyReadWriteStatic@2x.png
platform/icons/src/nodes/propertyReadWriteStatic@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyWrite.png
platform/icons/src/nodes/propertyWrite.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyWrite@2x.png
platform/icons/src/nodes/propertyWrite@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyWriteStatic.png
platform/icons/src/nodes/propertyWriteStatic.svg [new file with mode: 0644]
platform/icons/src/nodes/propertyWriteStatic@2x.png
platform/icons/src/nodes/propertyWriteStatic@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/read-access.png
platform/icons/src/nodes/read-access@2x.png
platform/icons/src/nodes/resourceBundle.png
platform/icons/src/nodes/resourceBundle.svg [new file with mode: 0644]
platform/icons/src/nodes/resourceBundle@2x.png
platform/icons/src/nodes/resourceBundle@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/runnableMark.png
platform/icons/src/nodes/runnableMark@2x.png
platform/icons/src/nodes/runnableMark@2x_dark.png [deleted file]
platform/icons/src/nodes/runnableMark_dark.png [deleted file]
platform/icons/src/nodes/rw-access.png
platform/icons/src/nodes/rw-access@2x.png
platform/icons/src/nodes/rw-access@2x_dark.png [deleted file]
platform/icons/src/nodes/rw-access_dark.png [deleted file]
platform/icons/src/nodes/shared.png
platform/icons/src/nodes/shared@2x.png
platform/icons/src/nodes/shared@2x_dark.png [deleted file]
platform/icons/src/nodes/shared_dark.png [deleted file]
platform/icons/src/nodes/sourceFolder.png
platform/icons/src/nodes/sourceFolder.svg [new file with mode: 0644]
platform/icons/src/nodes/sourceFolder@2x.png
platform/icons/src/nodes/sourceFolder@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/static.png
platform/icons/src/nodes/static.svg [new file with mode: 0644]
platform/icons/src/nodes/static@2x.png
platform/icons/src/nodes/static@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/staticMark.png
platform/icons/src/nodes/staticMark@2x.png
platform/icons/src/nodes/staticMark@2x_dark.png [deleted file]
platform/icons/src/nodes/staticMark_dark.png [deleted file]
platform/icons/src/nodes/symlink.png
platform/icons/src/nodes/symlink@2x.png
platform/icons/src/nodes/symlink@2x_dark.png [deleted file]
platform/icons/src/nodes/symlink_dark.png [deleted file]
platform/icons/src/nodes/tabAlert.png
platform/icons/src/nodes/tabAlert@2x.png
platform/icons/src/nodes/tabAlert@2x_dark.png [deleted file]
platform/icons/src/nodes/tabAlert_dark.png [deleted file]
platform/icons/src/nodes/tabPin.png
platform/icons/src/nodes/tabPin@2x.png
platform/icons/src/nodes/tabPin@2x_dark.png [deleted file]
platform/icons/src/nodes/tabPin_dark.png [deleted file]
platform/icons/src/nodes/testSourceFolder.png
platform/icons/src/nodes/testSourceFolder@2x.png
platform/icons/src/nodes/undeploy.png
platform/icons/src/nodes/undeploy@2x.png
platform/icons/src/nodes/unknownJdk.png
platform/icons/src/nodes/unknownJdk.svg [new file with mode: 0644]
platform/icons/src/nodes/unknownJdk@2x.png
platform/icons/src/nodes/unknownJdk@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/unknownJdk@2x_dark.png [deleted file]
platform/icons/src/nodes/unknownJdk_dark.png [deleted file]
platform/icons/src/nodes/upFolder.png
platform/icons/src/nodes/upFolder.svg [new file with mode: 0644]
platform/icons/src/nodes/upFolder@2x.png
platform/icons/src/nodes/upFolder@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/upLevel.png
platform/icons/src/nodes/upLevel@2x.png
platform/icons/src/nodes/variable.png
platform/icons/src/nodes/variable.svg [new file with mode: 0644]
platform/icons/src/nodes/variable@2x.png
platform/icons/src/nodes/variable@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/warningIntroduction.png
platform/icons/src/nodes/warningIntroduction@2x.png
platform/icons/src/nodes/webFolder.png
platform/icons/src/nodes/webFolder.svg [new file with mode: 0644]
platform/icons/src/nodes/webFolder@2x.png
platform/icons/src/nodes/webFolder@2x.svg [new file with mode: 0644]
platform/icons/src/nodes/weblistener.png
platform/icons/src/nodes/weblistener@2x.png
platform/icons/src/nodes/write-access.png
platform/icons/src/nodes/write-access@2x.png
platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java
platform/lang-impl/src/com/intellij/application/options/colors/TextAttributesDescription.java
platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java
platform/lang-impl/src/com/intellij/codeInspection/ex/SeverityEditorDialog.java
platform/lang-impl/src/com/intellij/codeInspection/ui/DefaultInspectionToolPresentation.java
platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsViewComparator.java
platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkExcludeRootAction.java
platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java
platform/platform-impl/src/com/intellij/ide/actions/ShowFilePathAction.java
platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/EditorColorsManagerImpl.java
platform/platform-impl/src/com/intellij/ui/ComboBoxCompositeEditor.java
platform/platform-resources-en/src/messages/ActionsBundle.properties
platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImplTest.java
platform/platform-tests/testSrc/com/intellij/openapi/editor/colors/impl/TextAttributesReaderTest.java
platform/util/src/com/intellij/util/ui/UIUtil.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dependency/CyclicClassDependencyInspection.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/dependency/DependencyUtils.java
plugins/InspectionGadgets/test/com/siyeh/igtest/dependency/cyclic_class_dependency/expected.xml
plugins/InspectionGadgets/test/com/siyeh/igtest/dependency/cyclic_class_dependency/src/Cyclic.java
plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.after.java
plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/try_identical_catches/TryIdenticalCatches.java
plugins/gradle/lib/gradle-2.14.1-src.zip [moved from plugins/gradle/lib/gradle-2.13-src.zip with 71% similarity]
plugins/gradle/lib/gradle-base-services-2.14.1.jar [moved from plugins/gradle/lib/gradle-base-services-2.13.jar with 52% similarity]
plugins/gradle/lib/gradle-base-services-groovy-2.14.1.jar [moved from plugins/gradle/lib/gradle-base-services-groovy-2.13.jar with 81% similarity]
plugins/gradle/lib/gradle-cli-2.14.1.jar [moved from plugins/gradle/lib/gradle-cli-2.13.jar with 86% similarity]
plugins/gradle/lib/gradle-core-2.14.1.jar [moved from plugins/gradle/lib/gradle-core-2.13.jar with 58% similarity]
plugins/gradle/lib/gradle-logging-2.14.1.jar [new file with mode: 0644]
plugins/gradle/lib/gradle-messaging-2.13.jar [deleted file]
plugins/gradle/lib/gradle-messaging-2.14.1.jar [new file with mode: 0644]
plugins/gradle/lib/gradle-model-core-2.14.1.jar [moved from plugins/gradle/lib/gradle-model-core-2.13.jar with 59% similarity]
plugins/gradle/lib/gradle-model-groovy-2.14.1.jar [moved from plugins/gradle/lib/gradle-model-groovy-2.13.jar with 79% similarity]
plugins/gradle/lib/gradle-native-2.14.1.jar [moved from plugins/gradle/lib/gradle-native-2.13.jar with 74% similarity]
plugins/gradle/lib/gradle-process-services-2.14.1.jar [new file with mode: 0644]
plugins/gradle/lib/gradle-resources-2.14.1.jar [moved from plugins/gradle/lib/gradle-resources-2.13.jar with 66% similarity]
plugins/gradle/lib/gradle-tooling-api-2.14.1.jar [moved from plugins/gradle/lib/gradle-tooling-api-2.13.jar with 50% similarity]
plugins/gradle/lib/gradle-wrapper-2.14.1.jar [moved from plugins/gradle/lib/gradle-wrapper-2.13.jar with 82% similarity]
plugins/gradle/resources/fileTemplates/internal/Gradle Build Script with wrapper.gradle.ft
plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/DistributionFactoryExt.java
plugins/gradle/tooling-extension-api/lib/gradle-build-init-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-build-init-2.13.jar with 63% similarity]
plugins/gradle/tooling-extension-api/lib/gradle-ide-2.13.jar [deleted file]
plugins/gradle/tooling-extension-api/lib/gradle-ide-2.14.1.jar [new file with mode: 0644]
plugins/gradle/tooling-extension-api/lib/gradle-language-java-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-language-java-2.13.jar with 77% similarity]
plugins/gradle/tooling-extension-api/lib/gradle-language-jvm-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-language-jvm-2.13.jar with 63% similarity]
plugins/gradle/tooling-extension-api/lib/gradle-language-scala-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-language-scala-2.13.jar with 62% similarity]
plugins/gradle/tooling-extension-api/lib/gradle-platform-base-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-platform-base-2.13.jar with 66% similarity]
plugins/gradle/tooling-extension-api/lib/gradle-platform-jvm-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-platform-jvm-2.13.jar with 61% similarity]
plugins/gradle/tooling-extension-api/lib/gradle-plugins-2.13.jar [deleted file]
plugins/gradle/tooling-extension-api/lib/gradle-plugins-2.14.1.jar [new file with mode: 0644]
plugins/gradle/tooling-extension-api/lib/gradle-scala-2.13.jar [deleted file]
plugins/gradle/tooling-extension-api/lib/gradle-scala-2.14.1.jar [new file with mode: 0644]
plugins/gradle/tooling-extension-api/lib/gradle-testing-base-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-testing-base-2.13.jar with 65% similarity]
plugins/gradle/tooling-extension-api/lib/gradle-testing-jvm-2.14.1.jar [moved from plugins/gradle/tooling-extension-api/lib/gradle-testing-jvm-2.13.jar with 63% similarity]
plugins/gradle/tooling-extension-impl/gradle-tooling-extension-impl.iml
plugins/gradle/tooling-extension-impl/lib/gradle-ear-2.13.jar [deleted file]
plugins/gradle/tooling-extension-impl/lib/gradle-ear-2.14.1.jar [new file with mode: 0644]
plugins/gradle/tooling-extension-impl/lib/gradle-reporting-2.14.1.jar [moved from plugins/gradle/tooling-extension-impl/lib/gradle-reporting-2.13.jar with 80% similarity]
plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/internal/StubIdeaModule.java [deleted file]
plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.java
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_13x13.png
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_13x13.svg [new file with mode: 0644]
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_13x13@2x.png
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_13x13@2x.svg [new file with mode: 0644]
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_16x16.png
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_16x16.svg [new file with mode: 0644]
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_16x16@2x.png
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_16x16@2x.svg [new file with mode: 0644]
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_32x32.png
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_32x32.svg [new file with mode: 0644]
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_32x32@2x.png
plugins/groovy/groovy-psi/resources/icons/groovy/groovy_32x32@2x.svg [new file with mode: 0644]
plugins/javaFX/common-javaFX-plugin/src/org/jetbrains/plugins/javaFX/packaging/AbstractJavaFxPackager.java
plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFXHighlightingTest.java
plugins/javaFX/testData/highlighting/FxIdUsedInSameNode.java [new file with mode: 0644]
plugins/javaFX/testData/highlighting/fxIdUsedInSameNode.fxml [new file with mode: 0644]
plugins/tasks/tasks-core/src/icons/jira.png
plugins/tasks/tasks-core/src/icons/jira.svg [new file with mode: 0644]
plugins/tasks/tasks-core/src/icons/jira@2x.png
plugins/tasks/tasks-core/src/icons/jira@2x.svg [new file with mode: 0644]
python/helpers/pydev/_pydevd_bundle/pydevd_vars.py
python/ide/src/META-INF/pycharm-core.xml
python/psi-api/resources/icons/com/jetbrains/python/pythonFile.png
python/psi-api/resources/icons/com/jetbrains/python/pythonFile.svg [new file with mode: 0644]
python/psi-api/resources/icons/com/jetbrains/python/pythonFile@2x.png
python/psi-api/resources/icons/com/jetbrains/python/pythonFile@2x.svg [new file with mode: 0644]
python/src/com/jetbrains/python/codeInsight/controlflow/PyTypeAssertionEvaluator.java
python/testSrc/com/jetbrains/python/PyTypeTest.java
resources/src/idea/RichPlatformActions.xml

index 5edf4faa43f1cf26cc182c2ea29c8201b441c51d..35d2714326368e12efd70fa5b7634ea6bef58ae8 100644 (file)
@@ -1,31 +1,35 @@
 <component name="libraryTable">
   <library name="Gradle">
     <CLASSES>
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-tooling-api-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-core-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-messaging-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-model-core-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-model-groovy-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-wrapper-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-base-services-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-base-services-groovy-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-native-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-resources-2.13.jar!/" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-cli-2.13.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-tooling-api-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-core-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-messaging-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-model-core-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-model-groovy-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-wrapper-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-base-services-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-base-services-groovy-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-process-services-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-native-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-resources-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-cli-2.14.1.jar!/" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-logging-2.14.1.jar!/" />
     </CLASSES>
     <JAVADOC />
     <SOURCES>
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/tooling-api/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/core/src/main/groovy" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/model-core/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/model-groovy/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/messaging/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/wrapper/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/base-services/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/base-services-groovy/src/main/groovy" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/native/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/resources/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.13-src.zip!/gradle-2.13/subprojects/cli/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/tooling-api/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/core/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/model-core/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/model-groovy/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/messaging/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/wrapper/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/base-services/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/base-services-groovy/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/process-services/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/native/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/resources/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/cli/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/plugins/gradle/lib/gradle-2.14.1-src.zip!/gradle-2.14.1/subprojects/logging/src/main/java" />
     </SOURCES>
   </library>
 </component>
\ No newline at end of file
index c3f3e7d6b00b86460b0ae0a2a64673e01fa2af49..f160c9cdab996b46b496dd3db4afcb770ab2c3ec 100644 (file)
@@ -125,9 +125,9 @@ class CommunityLibraryLicenses {
     new LibraryLicense(name: "Gherkin", libraryName: "Gherkin", version: "2.12.2", license: "MIT",
                        licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.txt", url: "https://github.com/cucumber/gherkin"),
     new LibraryLicense(name: "Google Feedback", libraryName: "GoogleFeedback.jar", version: "", license: "TBD"),
-    new LibraryLicense(name: "gradle-tooling-api-2.13.jar", version: "2.13", license: "Apache 2.0", url: "http://gradle.org/",
+    new LibraryLicense(name: "gradle-tooling-api-2.14.1.jar", version: "2.14.1", license: "Apache 2.0", url: "http://gradle.org/",
                        licenseUrl: "http://gradle.org/license"),
-    new LibraryLicense(name: "Gradle", version: "2.13", license: "Apache 2.0", url: "http://gradle.org/",
+    new LibraryLicense(name: "Gradle", version: "2.14.1", license: "Apache 2.0", url: "http://gradle.org/",
                        licenseUrl: "http://gradle.org/license"),
     new LibraryLicense(name: "GradleGuava", version: "14.0.1", license: "Apache 2.0", url: "http://code.google.com/p/guava-libraries/",
                        licenseUrl: "http://apache.org/licenses/LICENSE-2.0"),
index 227963c90c4ee4eaeb2c099c00c33907bd92029f..b3b58bb65d601554d2f6e7a47221a2f4adf03325 100644 (file)
@@ -24,6 +24,10 @@ target('default': 'Downloads custom JRE build from Teamcity server') {
     echo "Unsupported platform, JRE download skipped"
     return
   }
+  if (jreArchitecture == "disable") {
+    echo "JRE update disabled"
+    return
+  }
   if (!(jreArchitecture == "64" || jreArchitecture == "32" && platform == "win")) {
     echo "Acceptable architecture (32 or 64 bit) is not defined, JRE download skipped"
     return
index 23d5bf71d79bbb545761ff3910a8a3aed8859967..d11fc7b8f1ddbffe3b1977d437aaae832fab0192 100644 (file)
Binary files a/images/src/org/intellij/images/icons/ImagesFileType.png and b/images/src/org/intellij/images/icons/ImagesFileType.png differ
diff --git a/images/src/org/intellij/images/icons/ImagesFileType.svg b/images/src/org/intellij/images/icons/ImagesFileType.svg
new file mode 100644 (file)
index 0000000..b87954c
--- /dev/null
@@ -0,0 +1,9 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
+  <title>ImagesFileType</title>
+  <g>
+    <polygon points="6 0 2 4 6 4 6 0" fill="#9aa7b0" opacity="0.7" style="isolation: isolate"/>
+    <path d="M7,0V5H2V15H13V0H7Zm5,14H3V6h9v8Z" fill="#9aa7b0" opacity="0.7" style="isolation: isolate"/>
+    <path d="M11,13H4V11s2.06361-1.89568,3-1a9.5647,9.5647,0,0,0,4,2v1Z" fill="#62b543" opacity="0.8"/>
+    <path d="M4,7v3S6.06348,8.10449,7,9a9.56218,9.56218,0,0,0,4,2V7H4ZM9.5,9A0.5,0.5,0,1,1,10,8.5,0.49987,0.49987,0,0,1,9.5,9Z" fill="#40b6e0" opacity="0.8"/>
+  </g>
+</svg>
index 31eea0cfd6a44744ee95e2bae162eb40141b0841..d9ffaaf4d7f4cbf60e893a8bc0cc52c0855d9427 100644 (file)
Binary files a/images/src/org/intellij/images/icons/ImagesFileType@2x.png and b/images/src/org/intellij/images/icons/ImagesFileType@2x.png differ
diff --git a/images/src/org/intellij/images/icons/ImagesFileType@2x.svg b/images/src/org/intellij/images/icons/ImagesFileType@2x.svg
new file mode 100644 (file)
index 0000000..485b919
--- /dev/null
@@ -0,0 +1,9 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
+  <title>ImagesFileType@2x</title>
+  <g>
+    <polygon points="12 0 4 8 12 8 12 0" fill="#9aa7b0" opacity="0.7" style="isolation: isolate"/>
+    <path d="M14,0V10H4V30H26V0H14ZM24,28H6V12H24V28Z" fill="#9aa7b0" opacity="0.7" style="isolation: isolate"/>
+    <path d="M22,26H8V22s4.12722-3.79136,6-2c3.06667,2.93333,8,4,8,4v2Z" fill="#62b543" opacity="0.8"/>
+    <path d="M8,14v6s4.127-3.791,6-2c3.06641,2.93359,8,4,8,4V14H8Zm11,4a1,1,0,1,1,1-1A0.99974,0.99974,0,0,1,19,18Z" fill="#40b6e0" opacity="0.8"/>
+  </g>
+</svg>
index 646594e2d4f8675050bcbcc27a6dae9349271260..5aa4c074f6d2567ed75d8875bc3520a3460a0d56 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.execution.runners.ExecutionEnvironment;
 import com.intellij.openapi.compiler.CompileScope;
 import com.intellij.openapi.compiler.CompileStatusNotification;
 import com.intellij.openapi.compiler.CompilerManager;
+import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.vfs.VirtualFile;
@@ -45,6 +46,8 @@ import java.util.stream.Stream;
  * @since 5/11/2016
  */
 public class InternalProjectTaskRunner extends ProjectTaskRunner {
+  private static final Logger LOG = Logger.getInstance(InternalProjectTaskRunner.class);
+
   @Override
   public void run(@NotNull Project project,
                   @NotNull ProjectTaskContext context,
@@ -89,39 +92,60 @@ public class InternalProjectTaskRunner extends ProjectTaskRunner {
 
 
     if (!ContainerUtil.isEmpty(buildTasks)) {
-      List<Module> toMake = new SmartList<>();
-      List<Module> toCompile = new SmartList<>();
+      List<Module> modules = new SmartList<>();
+
+      Boolean isIncrementalBuild = null;
+      Boolean includeDependentModules = null;
+      Boolean includeRuntimeDependencies = null;
 
       for (ProjectTask buildProjectTask : buildTasks) {
         ModuleBuildTask moduleBuildTask = (ModuleBuildTask)buildProjectTask;
-
-        if (moduleBuildTask.isIncrementalBuild()) {
-          toMake.add(moduleBuildTask.getModule());
+        assertModuleBuildSettings(moduleBuildTask, isIncrementalBuild, includeDependentModules, includeRuntimeDependencies);
+        modules.add(moduleBuildTask.getModule());
+        if (!moduleBuildTask.isIncrementalBuild()) {
+          isIncrementalBuild = false;
         }
-        else {
-          toCompile.add(moduleBuildTask.getModule());
+        if (moduleBuildTask.isIncludeDependentModules()) {
+          includeDependentModules = true;
+        }
+        if (moduleBuildTask.isIncludeRuntimeDependencies()) {
+          includeRuntimeDependencies = true;
         }
       }
       CompilerManager compilerManager = CompilerManager.getInstance(project);
-      if (!toMake.isEmpty()) {
-        CompileScope scope = createScope(project, compilerManager, context, toMake);
-        // TODO handle multiple notifications
+      CompileScope scope = createScope(
+        compilerManager, context, modules, includeDependentModules != null, includeRuntimeDependencies != null);
+      if (isIncrementalBuild == null) {
         compilerManager.make(scope, compileNotification);
       }
-      if (!toCompile.isEmpty()) {
-        CompileScope scope = createScope(project, compilerManager, context, toCompile);
-        // TODO handle multiple notifications
+      else {
         compilerManager.compile(scope, compileNotification);
       }
     }
   }
 
+  private static void assertModuleBuildSettings(ModuleBuildTask moduleBuildTask,
+                                                Boolean isIncrementalBuild,
+                                                Boolean includeDependentModules,
+                                                Boolean includeRuntimeDependencies) {
+    if (isIncrementalBuild != null && moduleBuildTask.isIncrementalBuild()) {
+      LOG.warn("Incremental build setting for the module '" + moduleBuildTask.getModule().getName() + "' will be ignored");
+    }
+    if (includeDependentModules != null && !moduleBuildTask.isIncludeDependentModules()) {
+      LOG.warn("'Module '" + moduleBuildTask.getModule().getName() + "' will be built along with dependent modules");
+    }
+    if (includeRuntimeDependencies != null && !moduleBuildTask.isIncludeRuntimeDependencies()) {
+      LOG.warn("'Module '" + moduleBuildTask.getModule().getName() + "' will be built along with runtime dependencies");
+    }
+  }
 
-  private static CompileScope createScope(Project project,
-                                          CompilerManager compilerManager,
+  private static CompileScope createScope(CompilerManager compilerManager,
                                           ProjectTaskContext context,
-                                          Collection<Module> modules) {
-    CompileScope scope = compilerManager.createModuleGroupCompileScope(project, modules.toArray(new Module[modules.size()]), true);
+                                          Collection<Module> modules,
+                                          boolean includeDependentModules,
+                                          boolean includeRuntimeDependencies) {
+    CompileScope scope = compilerManager.createModulesCompileScope(
+      modules.toArray(new Module[modules.size()]), includeDependentModules, includeRuntimeDependencies);
     RunConfiguration configuration = context.getRunConfiguration();
     if (configuration != null) {
       scope.putUserData(CompilerManager.RUN_CONFIGURATION_KEY, configuration);
index 6ae30a5512ef2b1e2c0d2a16a9c9fc91ee6ebd62..49132691e61cd88f58807578a2c1b0353f19626c 100644 (file)
@@ -26,10 +26,21 @@ import org.jetbrains.annotations.NotNull;
 public class ModuleBuildTaskImpl extends AbstractBuildTask implements ModuleBuildTask {
   @NotNull
   private final Module myModule;
+  private final boolean myIncludeDependentModules;
+  private final boolean myIncludeRuntimeDependencies;
 
   public ModuleBuildTaskImpl(@NotNull Module module, boolean isIncrementalBuild) {
+    this(module, isIncrementalBuild, false, false);
+  }
+
+  public ModuleBuildTaskImpl(@NotNull Module module,
+                             boolean isIncrementalBuild,
+                             boolean includeDependentModules,
+                             boolean includeRuntimeDependencies) {
     super(isIncrementalBuild);
     myModule = module;
+    myIncludeDependentModules = includeDependentModules;
+    myIncludeRuntimeDependencies = includeRuntimeDependencies;
   }
 
   @NotNull
@@ -38,6 +49,16 @@ public class ModuleBuildTaskImpl extends AbstractBuildTask implements ModuleBuil
     return myModule;
   }
 
+  @Override
+  public boolean isIncludeDependentModules() {
+    return myIncludeDependentModules;
+  }
+
+  @Override
+  public boolean isIncludeRuntimeDependencies() {
+    return myIncludeRuntimeDependencies;
+  }
+
   @NotNull
   @Override
   public String getPresentableName() {
index 21eff5a8ff5935fdb03bbc81488688220f335a05..b370a4d228510bfc2b5819d42841b6069640f616 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.packaging.artifacts.Artifact;
 import com.intellij.task.*;
 import com.intellij.util.Consumer;
 import com.intellij.util.SmartList;
+import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -50,12 +51,12 @@ public class ProjectTaskManagerImpl extends ProjectTaskManager {
 
   @Override
   public void build(@NotNull Module[] modules, @Nullable ProjectTaskNotification callback) {
-    run(createModulesBuildTask(true, modules), callback);
+    run(createModulesBuildTask(modules, true, true, false), callback);
   }
 
   @Override
   public void rebuild(@NotNull Module[] modules, @Nullable ProjectTaskNotification callback) {
-    run(createModulesBuildTask(false, modules), callback);
+    run(createModulesBuildTask(modules, false, false, false), callback);
   }
 
   @Override
@@ -91,14 +92,26 @@ public class ProjectTaskManagerImpl extends ProjectTaskManager {
 
   @Override
   public ProjectTask createAllModulesBuildTask(boolean isIncrementalBuild, Project project) {
-    return createModulesBuildTask(isIncrementalBuild, ModuleManager.getInstance(project).getModules());
+    return createModulesBuildTask(ModuleManager.getInstance(project).getModules(), isIncrementalBuild, false, false);
   }
 
   @Override
-  public ProjectTask createModulesBuildTask(boolean isIncrementalBuild, Module... modules) {
+  public ProjectTask createModulesBuildTask(Module module,
+                                            boolean isIncrementalBuild,
+                                            boolean includeDependentModules,
+                                            boolean includeRuntimeDependencies) {
+    return createModulesBuildTask(ContainerUtil.ar(module), isIncrementalBuild, includeDependentModules, includeRuntimeDependencies);
+  }
+
+  @Override
+  public ProjectTask createModulesBuildTask(Module[] modules,
+                                            boolean isIncrementalBuild,
+                                            boolean includeDependentModules,
+                                            boolean includeRuntimeDependencies) {
     return modules.length == 1
-           ? new ModuleBuildTaskImpl(modules[0], isIncrementalBuild)
-           : new ProjectTaskList(map(list(modules), module -> new ModuleBuildTaskImpl(module, isIncrementalBuild)));
+           ? new ModuleBuildTaskImpl(modules[0], isIncrementalBuild, includeDependentModules, includeRuntimeDependencies)
+           : new ProjectTaskList(map(list(modules), module ->
+             new ModuleBuildTaskImpl(module, isIncrementalBuild, includeDependentModules, includeRuntimeDependencies)));
   }
 
   @Override
index ad08c7d474f1c7e01a458206a320b4508e74c594..c0e74d10454d266909e070048ad1524dd66cebe4 100644 (file)
@@ -25,4 +25,8 @@ import org.jetbrains.annotations.NotNull;
 public interface ModuleBuildTask extends BuildTask {
   @NotNull
   Module getModule();
+
+  boolean isIncludeDependentModules();
+
+  boolean isIncludeRuntimeDependencies();
 }
index fe3d8474f1289ad2143d0fb3ee59921ca3ba2cc8..46570c3911de569b1c9f13a8fd925b0f45b1ee84 100644 (file)
@@ -91,7 +91,15 @@ public abstract class ProjectTaskManager {
 
   public abstract ProjectTask createAllModulesBuildTask(boolean isIncrementalBuild, Project project);
 
-  public abstract ProjectTask createModulesBuildTask(boolean isIncrementalBuild, Module... modules);
+  public abstract ProjectTask createModulesBuildTask(Module module,
+                                                     boolean isIncrementalBuild,
+                                                     boolean includeDependentModules,
+                                                     boolean includeRuntimeDependencies);
+
+  public abstract ProjectTask createModulesBuildTask(Module[] modules,
+                                                     boolean isIncrementalBuild,
+                                                     boolean includeDependentModules,
+                                                     boolean includeRuntimeDependencies);
 
   public abstract ProjectTask createArtifactsBuildTask(boolean isIncrementalBuild, Artifact... artifacts);
 
index 6aaf886ef996adf9e5334ffd5f1a5066e9c505cc..96d42d2aaf750cd4355981e6a49179145434e6ee 100644 (file)
@@ -164,7 +164,7 @@ public class CompileStepBeforeRun extends BeforeRunTaskProvider<CompileStepBefor
                           runConfiguration.getClass().getName());
               }
             }
-            projectTask = projectTaskManager.createModulesBuildTask(true, modules);
+            projectTask = projectTaskManager.createModulesBuildTask(modules, true, true, true);
           }
           else {
             projectTask = projectTaskManager.createAllModulesBuildTask(true, myProject);
index 6aec0ae9fcad312c76cb9e9c9b6354cbf9ddef8a..a0e3b1d389e43c5cde1466b2527ad366a0e0f2e2 100644 (file)
@@ -65,9 +65,11 @@ public class RefClassImpl extends RefJavaElementImpl implements RefClass {
   private Set<RefElement> myInTypeReferences;
   private Set<RefElement> myInstanceReferences;
   private List<RefJavaElement> myClassExporters;
+  private RefModule myRefModule;
 
   RefClassImpl(PsiClass psiClass, RefManager manager) {
     super(psiClass, manager);
+    myRefModule = manager.getRefModule(ModuleUtilCore.findModuleForPsiElement(psiClass));
   }
 
   @Override
@@ -226,6 +228,12 @@ public class RefClassImpl extends RefJavaElementImpl implements RefClass {
     return (PsiClass)super.getElement();
   }
 
+  @Nullable
+  @Override
+  public RefModule getModule() {
+    return myRefModule;
+  }
+
   private static boolean isSelfInheritor(PsiClass psiClass, ArrayList<PsiClass> visited) {
     if (visited.contains(psiClass)) return true;
 
index 1783d36d0a0bc7b92b35a773a525816cfa205bb8..80af5c532a9a714457cb60158e9a9aecaa2fd1f0 100644 (file)
@@ -34,8 +34,10 @@ import org.jetbrains.annotations.Nullable;
 
 public class RefImplicitConstructorImpl extends RefMethodImpl implements RefImplicitConstructor {
 
+  private final RefClass myOwnerClass;
   RefImplicitConstructorImpl(@NotNull RefClass ownerClass) {
     super(InspectionsBundle.message("inspection.reference.implicit.constructor.name", ownerClass.getName()), ownerClass);
+    myOwnerClass = ownerClass;
   }
 
   @Override
index 701f97358019a10919b2f0d54d61c94b65034789..88e3a763927b5a54e92b6575b147afca5209778a 100644 (file)
@@ -57,24 +57,20 @@ public class RefMethodImpl extends RefJavaElementImpl implements RefMethod {
 
   private RefParameter[] myParameters;
   private String myReturnValueTemplate;
-  protected final RefClass myOwnerClass;
 
   RefMethodImpl(@NotNull RefClass ownerClass, PsiMethod method, RefManager manager) {
     super(method, manager);
 
     ((RefClassImpl)ownerClass).add(this);
-
-    myOwnerClass = ownerClass;
   }
 
   // To be used only from RefImplicitConstructor.
   protected RefMethodImpl(@NotNull String name, @NotNull RefClass ownerClass) {
     super(name, ownerClass);
-    myOwnerClass = ownerClass;
     ((RefClassImpl)ownerClass).add(this);
 
-    addOutReference(getOwnerClass());
-    ((RefClassImpl)getOwnerClass()).addInReference(this);
+    addOutReference(ownerClass);
+    ((RefClassImpl)ownerClass).addInReference(this);
 
     setConstructor(true);
   }
index f5a46f1734a0a243f2c3cf1ccf6e9c2d967f721b..7a0ade4c627a6f10e3994b4fd1d1fc1c651cb76b 100644 (file)
@@ -24,6 +24,7 @@ import com.intellij.codeInspection.reference.*;
 import com.intellij.openapi.progress.EmptyProgressIndicator;
 import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
 import com.intellij.psi.*;
+import com.intellij.util.ObjectUtils;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -246,7 +247,7 @@ public class SameParameterValueInspectionBase extends GlobalJavaBatchInspectionT
                                             PsiParameter parameter,
                                             String value) {
     final String name = parameter.getName();
-    return manager.createProblemDescriptor(parameter,
+    return manager.createProblemDescriptor(ObjectUtils.notNull(parameter.getNameIdentifier(), parameter),
                                            InspectionsBundle.message("inspection.same.parameter.problem.descriptor",
                                                                      "<code>" + name + "</code>",
                                                                      "<code>" + value + "</code>"),
index 539075b5fd12fc271192e71659584fc44c357ebe..ded7d252ae48c2486cbd90b43994ac6c0dc6068f 100644 (file)
@@ -401,12 +401,10 @@ public class DuplicatesFinder {
       final PsiType type1 = ((PsiNewExpression)pattern).getType();
       final PsiType type2 = ((PsiNewExpression)candidate).getType();
       if (type1 == null || type2 == null) return false;
-      final PsiJavaCodeReferenceElement classReference1 = ((PsiNewExpression)pattern).getClassReference();
-      final PsiJavaCodeReferenceElement classReference2 = ((PsiNewExpression)candidate).getClassReference();
-      if (classReference1 != null && classReference2 != null) {
-        final PsiElement resolved1 = classReference1.resolve();
-        final PsiElement resolved2 = classReference2.resolve();
-        if (!pattern.getManager().areElementsEquivalent(resolved1, resolved2)) return false;
+      final PsiMethod constructor1 = ((PsiNewExpression)pattern).resolveConstructor();
+      final PsiMethod constructor2 = ((PsiNewExpression)candidate).resolveConstructor();
+      if (constructor1 != null && constructor2 != null) {
+        if (!pattern.getManager().areElementsEquivalent(constructor1, constructor2)) return false;
       }
       else {
         if (!canTypesBeEquivalent(type1, type2)) return false;
index aeb404a75230a029d4d1563b30ff748132d9ca51..5a1a4c2d058356aff77acb14d608863774d34aff 100644 (file)
@@ -19,9 +19,7 @@ import com.intellij.codeInsight.FileModificationService;
 import com.intellij.codeInspection.LambdaCanBeMethodReferenceInspection;
 import com.intellij.codeInspection.LocalQuickFix;
 import com.intellij.codeInspection.ProblemDescriptor;
-import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.InitializerUsageStatus;
-import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.Operation;
-import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.TerminalBlock;
+import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.*;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
 import com.intellij.psi.codeStyle.CodeStyleManager;
@@ -30,7 +28,6 @@ import com.intellij.psi.util.PsiTreeUtil;
 import com.siyeh.ig.psiutils.ExpressionUtils;
 import one.util.streamex.StreamEx;
 import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
 
 import java.util.List;
 import java.util.ListIterator;
@@ -49,65 +46,61 @@ abstract class MigrateToStreamFix implements LocalQuickFix {
   @Override
   public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
     PsiElement element = descriptor.getPsiElement();
-    if (element instanceof PsiForeachStatement) {
-      PsiForeachStatement foreachStatement = (PsiForeachStatement)element;
-      PsiStatement body = foreachStatement.getBody();
-      final PsiExpression iteratedValue = foreachStatement.getIteratedValue();
-      if (body != null && iteratedValue != null) {
-        final PsiParameter parameter = foreachStatement.getIterationParameter();
-        TerminalBlock tb = TerminalBlock.from(parameter, body);
-        if (!FileModificationService.getInstance().preparePsiElementForWrite(foreachStatement)) return;
-        PsiElement result = migrate(project, descriptor, foreachStatement, iteratedValue, body, tb);
-        if(result != null) {
-          simplifyAndFormat(project, result);
-        }
+    if (element instanceof PsiLoopStatement) {
+      PsiLoopStatement loopStatement = (PsiLoopStatement)element;
+      StreamSource source = StreamSource.tryCreate(loopStatement);
+      PsiStatement body = loopStatement.getBody();
+      if(body == null || source == null) return;
+      TerminalBlock tb = TerminalBlock.from(source, body);
+      if (!FileModificationService.getInstance().preparePsiElementForWrite(loopStatement)) return;
+      PsiElement result = migrate(project, loopStatement, body, tb);
+      if(result != null) {
+        simplifyAndFormat(project, result);
       }
     }
   }
 
   abstract PsiElement migrate(@NotNull Project project,
-                        @NotNull ProblemDescriptor descriptor,
-                        @NotNull PsiForeachStatement foreachStatement,
-                        @NotNull PsiExpression iteratedValue,
-                        @NotNull PsiStatement body,
-                        @NotNull TerminalBlock tb);
+                              @NotNull PsiLoopStatement loopStatement,
+                              @NotNull PsiStatement body,
+                              @NotNull TerminalBlock tb);
 
   static PsiElement replaceWithNumericAddition(@NotNull Project project,
-                                               PsiForeachStatement foreachStatement,
+                                               PsiLoopStatement loopStatement,
                                                PsiVariable var,
                                                StringBuilder builder,
                                                PsiType expressionType) {
     PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
-    restoreComments(foreachStatement, foreachStatement.getBody());
-    InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(var, foreachStatement);
+    restoreComments(loopStatement, loopStatement.getBody());
+    InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(var, loopStatement);
     if (status != InitializerUsageStatus.UNKNOWN) {
       PsiExpression initializer = var.getInitializer();
       if (ExpressionUtils.isZero(initializer)) {
         PsiType type = var.getType();
         String replacement = (type.equals(expressionType) ? "" : "(" + type.getCanonicalText() + ") ") + builder;
-        return replaceInitializer(foreachStatement, var, initializer, replacement, status);
+        return replaceInitializer(loopStatement, var, initializer, replacement, status);
       }
     }
-    return foreachStatement.replace(elementFactory.createStatementFromText(var.getName() + "+=" + builder + ";", foreachStatement));
+    return loopStatement.replace(elementFactory.createStatementFromText(var.getName() + "+=" + builder + ";", loopStatement));
   }
 
-  static PsiElement replaceInitializer(PsiForeachStatement foreachStatement,
+  static PsiElement replaceInitializer(PsiLoopStatement loopStatement,
                                  PsiVariable var,
                                  PsiExpression initializer,
                                  String replacement,
                                  InitializerUsageStatus status) {
-    Project project = foreachStatement.getProject();
+    Project project = loopStatement.getProject();
     PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
     if(status == InitializerUsageStatus.DECLARED_JUST_BEFORE) {
-      initializer.replace(elementFactory.createExpressionFromText(replacement, foreachStatement));
-      removeLoop(foreachStatement);
+      initializer.replace(elementFactory.createExpressionFromText(replacement, loopStatement));
+      removeLoop(loopStatement);
       return var;
     } else {
       if(status == InitializerUsageStatus.AT_WANTED_PLACE_ONLY) {
         initializer.delete();
       }
       return
-        foreachStatement.replace(elementFactory.createStatementFromText(var.getName() + " = " + replacement + ";", foreachStatement));
+        loopStatement.replace(elementFactory.createStatementFromText(var.getName() + " = " + replacement + ";", loopStatement));
     }
   }
 
@@ -117,34 +110,26 @@ abstract class MigrateToStreamFix implements LocalQuickFix {
     CodeStyleManager.getInstance(project).reformat(JavaCodeStyleManager.getInstance(project).shortenClassReferences(result));
   }
 
-  static void restoreComments(PsiForeachStatement foreachStatement, PsiStatement body) {
-    final PsiElement parent = foreachStatement.getParent();
+  static void restoreComments(PsiLoopStatement loopStatement, PsiStatement body) {
+    final PsiElement parent = loopStatement.getParent();
     for (PsiElement comment : PsiTreeUtil.findChildrenOfType(body, PsiComment.class)) {
-      parent.addBefore(comment, foreachStatement);
+      parent.addBefore(comment, loopStatement);
     }
   }
 
   @NotNull
-  static StringBuilder generateStream(PsiExpression iteratedValue, @Nullable Operation lastOperation) {
-    return generateStream(iteratedValue, lastOperation, false);
+  static StringBuilder generateStream(@NotNull Operation lastOperation) {
+    return generateStream(lastOperation, false);
   }
 
   @NotNull
-  static StringBuilder generateStream(PsiExpression iteratedValue, @Nullable Operation lastOperation, boolean noStreamForEmpty) {
+  static StringBuilder generateStream(@NotNull Operation lastOperation, boolean noStreamForEmpty) {
     StringBuilder buffer = new StringBuilder();
-    final PsiType iteratedValueType = iteratedValue.getType();
-    if (iteratedValueType instanceof PsiArrayType) {
-      buffer.append("java.util.Arrays.stream(").append(iteratedValue.getText()).append(")");
+    if(noStreamForEmpty && lastOperation instanceof CollectionStream) {
+      return buffer.append(lastOperation.getExpression().getText());
     }
-    else {
-      buffer.append(getIteratedValueText(iteratedValue));
-      if (!noStreamForEmpty || lastOperation != null) {
-        buffer.append(".stream()");
-      }
-    }
-    PsiElementFactory factory = JavaPsiFacade.getElementFactory(iteratedValue.getProject());
     List<String> replacements =
-      StreamEx.iterate(lastOperation, Objects::nonNull, Operation::getPreviousOp).map(op -> op.createReplacement(factory)).toList();
+      StreamEx.iterate(lastOperation, Objects::nonNull, Operation::getPreviousOp).map(Operation::createReplacement).toList();
     for(ListIterator<String> it = replacements.listIterator(replacements.size()); it.hasPrevious(); ) {
       buffer.append(it.previous());
     }
@@ -158,7 +143,7 @@ abstract class MigrateToStreamFix implements LocalQuickFix {
            iteratedValue instanceof PsiParenthesizedExpression ? iteratedValue.getText() : "(" + iteratedValue.getText() + ")";
   }
 
-  static void removeLoop(@NotNull PsiForeachStatement statement) {
+  static void removeLoop(@NotNull PsiLoopStatement statement) {
     PsiElement parent = statement.getParent();
     if (parent instanceof PsiLabeledStatement) {
       parent.delete();
index 4dd8e7c06070ce5fc49e368d2227602ff45aa2b2..74c85641b70145cebb8c81d4d2365ba0999d955c 100644 (file)
@@ -15,8 +15,8 @@
  */
 package com.intellij.codeInspection.streamMigration;
 
-import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.InitializerUsageStatus;
+import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.MapOp;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.text.StringUtil;
@@ -58,42 +58,41 @@ class ReplaceWithCollectFix extends MigrateToStreamFix {
 
   @Override
   PsiElement migrate(@NotNull Project project,
-               @NotNull ProblemDescriptor descriptor,
-               @NotNull PsiForeachStatement foreachStatement,
-               @NotNull PsiExpression iteratedValue,
-               @NotNull PsiStatement body,
-               @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
+                     @NotNull PsiLoopStatement loopStatement,
+                     @NotNull PsiStatement body,
+                     @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
     final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
-    final PsiType iteratedValueType = iteratedValue.getType();
     final PsiMethodCallExpression methodCallExpression = tb.getSingleMethodCall();
 
     if (methodCallExpression == null) return null;
 
-    restoreComments(foreachStatement, body);
-    if (!tb.hasOperations() && StreamApiMigrationInspection.isAddAllCall(tb)) {
+    restoreComments(loopStatement, body);
+    if (!tb.hasOperations() && StreamApiMigrationInspection.isAddAllCall(tb) && loopStatement instanceof PsiForeachStatement) {
+      PsiExpression iteratedValue = ((PsiForeachStatement)loopStatement).getIteratedValue();
+      if (iteratedValue == null) return null;
+      final PsiType iteratedValueType = iteratedValue.getType();
       final PsiExpression qualifierExpression = methodCallExpression.getMethodExpression().getQualifierExpression();
       final String qualifierText = qualifierExpression != null ? qualifierExpression.getText() : "";
       final String collectionText =
         iteratedValueType instanceof PsiArrayType ? "java.util.Arrays.asList(" + iteratedValue.getText() + ")" :
         getIteratedValueText(iteratedValue);
       final String callText = StringUtil.getQualifiedName(qualifierText, "addAll(" + collectionText + ");");
-      return foreachStatement.replace(elementFactory.createStatementFromText(callText, foreachStatement));
+      return loopStatement.replace(elementFactory.createStatementFromText(callText, loopStatement));
     }
     PsiExpression itemToAdd = methodCallExpression.getArgumentList().getExpressions()[0];
     PsiType addedType = getAddedElementType(methodCallExpression);
     if (addedType == null) addedType = itemToAdd.getType();
-    final StringBuilder builder =
-      generateStream(iteratedValue, new StreamApiMigrationInspection.MapOp(tb.getLastOperation(), itemToAdd, tb.getVariable(), addedType));
+    StringBuilder builder = generateStream(new MapOp(tb.getLastOperation(), itemToAdd, tb.getVariable(), addedType));
 
     final PsiExpression qualifierExpression = methodCallExpression.getMethodExpression().getQualifierExpression();
     final PsiLocalVariable variable = StreamApiMigrationInspection.extractCollectionVariable(qualifierExpression);
     if (variable != null) {
-      InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(variable, foreachStatement);
+      InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(variable, loopStatement);
       if(status != InitializerUsageStatus.UNKNOWN) {
         PsiExpression initializer = variable.getInitializer();
         LOG.assertTrue(initializer != null);
         PsiMethodCallExpression toArrayExpression =
-          StreamApiMigrationInspection.extractToArrayExpression(foreachStatement, methodCallExpression);
+          StreamApiMigrationInspection.extractToArrayExpression(loopStatement, methodCallExpression);
         if(toArrayExpression != null) {
           PsiType type = initializer.getType();
           if(type instanceof PsiClassType) {
@@ -113,7 +112,7 @@ class ReplaceWithCollectFix extends MigrateToStreamFix {
               }
               PsiElement result =
                 toArrayExpression.replace(elementFactory.createExpressionFromText(builder.toString(), toArrayExpression));
-              removeLoop(foreachStatement);
+              removeLoop(loopStatement);
               if(status != InitializerUsageStatus.AT_WANTED_PLACE) {
                 variable.delete();
               }
@@ -121,7 +120,7 @@ class ReplaceWithCollectFix extends MigrateToStreamFix {
             }
           }
         }
-        PsiElement nextStatement = PsiTreeUtil.skipSiblingsForward(foreachStatement, PsiComment.class, PsiWhiteSpace.class);
+        PsiElement nextStatement = PsiTreeUtil.skipSiblingsForward(loopStatement, PsiComment.class, PsiWhiteSpace.class);
         String comparatorText = StreamApiMigrationInspection.tryExtractSortComparatorText(nextStatement, variable);
         if(comparatorText != null) {
           builder.append(".sorted(").append(comparatorText).append(")");
@@ -130,7 +129,7 @@ class ReplaceWithCollectFix extends MigrateToStreamFix {
         String callText = builder.append(".collect(java.util.stream.Collectors.")
           .append(createInitializerReplacementText(qualifierExpression.getType(), initializer))
           .append(")").toString();
-        return replaceInitializer(foreachStatement, variable, initializer, callText, status);
+        return replaceInitializer(loopStatement, variable, initializer, callText, status);
       }
     }
     final String qualifierText = qualifierExpression != null ? qualifierExpression.getText() + "." : "";
@@ -147,7 +146,7 @@ class ReplaceWithCollectFix extends MigrateToStreamFix {
       elementFactory.createExpressionFromText(qualifierText + "add(" + varName + ")", qualifierExpression);
     final String callText =
       builder.append(".forEach(").append(varName).append("->").append(forEachBody.getText()).append(");").toString();
-    return foreachStatement.replace(elementFactory.createStatementFromText(callText, foreachStatement));
+    return loopStatement.replace(elementFactory.createStatementFromText(callText, loopStatement));
   }
 
   private static String createInitializerReplacementText(PsiType varType, PsiExpression initializer) {
index 836aa8b629b872136d8a450679b87adcc02b7b43..137630e080dead5def657b7c966d273b9c869dfb 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.codeInspection.streamMigration;
 
-import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
 import org.jetbrains.annotations.NotNull;
@@ -33,18 +32,15 @@ class ReplaceWithCountFix extends MigrateToStreamFix {
 
   @Override
   PsiElement migrate(@NotNull Project project,
-               @NotNull ProblemDescriptor descriptor,
-               @NotNull PsiForeachStatement foreachStatement,
-               @NotNull PsiExpression iteratedValue,
-               @NotNull PsiStatement body,
-               @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
+                     @NotNull PsiLoopStatement loopStatement,
+                     @NotNull PsiStatement body,
+                     @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
     PsiExpression operand = StreamApiMigrationInspection.extractIncrementedLValue(tb.getSingleExpression(PsiExpression.class));
     if (!(operand instanceof PsiReferenceExpression)) return null;
     PsiElement element = ((PsiReferenceExpression)operand).resolve();
     if (!(element instanceof PsiLocalVariable)) return null;
     PsiLocalVariable var = (PsiLocalVariable)element;
-    final StringBuilder builder = generateStream(iteratedValue, tb.getLastOperation());
-    builder.append(".count()");
-    return replaceWithNumericAddition(project, foreachStatement, var, builder, PsiType.LONG);
+    StringBuilder builder = generateStream(tb.getLastOperation()).append(".count()");
+    return replaceWithNumericAddition(project, loopStatement, var, builder, PsiType.LONG);
   }
 }
index 68fcfca7a55693b26415dc2f946a0426d172de36..ff9b77733dfeaeac4d8b035bbe40513978745991 100644 (file)
@@ -16,7 +16,6 @@
 package com.intellij.codeInspection.streamMigration;
 
 import com.intellij.codeInsight.PsiEquivalenceUtil;
-import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.InitializerUsageStatus;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
@@ -36,28 +35,27 @@ class ReplaceWithFindFirstFix extends MigrateToStreamFix {
 
   @Override
   PsiElement migrate(@NotNull Project project,
-               @NotNull ProblemDescriptor descriptor,
-               @NotNull PsiForeachStatement foreachStatement,
-               @NotNull PsiExpression iteratedValue,
-               @NotNull PsiStatement body,
-               @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
+                     @NotNull PsiLoopStatement loopStatement,
+                     @NotNull PsiStatement body,
+                     @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
     PsiStatement statement = tb.getSingleStatement();
     PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
-    String stream = generateStream(iteratedValue, tb.getLastOperation()).append(".findFirst()").toString();
+    StringBuilder builder = generateStream(tb.getLastOperation());
+    String stream = builder.append(".findFirst()").toString();
     if (statement instanceof PsiReturnStatement) {
       PsiReturnStatement returnStatement = (PsiReturnStatement)statement;
       PsiExpression value = returnStatement.getReturnValue();
       if (value == null) return null;
-      PsiReturnStatement nextReturnStatement = StreamApiMigrationInspection.getNextReturnStatement(foreachStatement);
+      PsiReturnStatement nextReturnStatement = StreamApiMigrationInspection.getNextReturnStatement(loopStatement);
       if (nextReturnStatement == null) return null;
       PsiExpression orElseExpression = nextReturnStatement.getReturnValue();
       if (!ExpressionUtils.isSimpleExpression(orElseExpression)) return null;
       stream = generateOptionalUnwrap(stream, tb, value, orElseExpression, null);
-      restoreComments(foreachStatement, body);
-      if (nextReturnStatement.getParent() == foreachStatement.getParent()) {
+      restoreComments(loopStatement, body);
+      if (nextReturnStatement.getParent() == loopStatement.getParent()) {
         nextReturnStatement.delete();
       }
-      return foreachStatement.replace(elementFactory.createStatementFromText("return " + stream + ";", foreachStatement));
+      return loopStatement.replace(elementFactory.createStatementFromText("return " + stream + ";", loopStatement));
     }
     else {
       PsiStatement[] statements = tb.getStatements();
@@ -66,9 +64,9 @@ class ReplaceWithFindFirstFix extends MigrateToStreamFix {
       if (assignment == null) {
         if(!(statements[0] instanceof PsiExpressionStatement)) return null;
         PsiExpression expression = ((PsiExpressionStatement)statements[0]).getExpression();
-        restoreComments(foreachStatement, body);
-        return foreachStatement.replace(elementFactory.createStatementFromText(
-          stream + ".ifPresent(" + LambdaUtil.createLambda(tb.getVariable(), expression) + ");", foreachStatement));
+        restoreComments(loopStatement, body);
+        return loopStatement.replace(elementFactory.createStatementFromText(
+          stream + ".ifPresent(" + LambdaUtil.createLambda(tb.getVariable(), expression) + ");", loopStatement));
       }
       PsiExpression lValue = assignment.getLExpression();
       if (!(lValue instanceof PsiReferenceExpression)) return null;
@@ -77,17 +75,17 @@ class ReplaceWithFindFirstFix extends MigrateToStreamFix {
       PsiVariable var = (PsiVariable)element;
       PsiExpression value = assignment.getRExpression();
       if (value == null) return null;
-      restoreComments(foreachStatement, body);
-      InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(var, foreachStatement);
+      restoreComments(loopStatement, body);
+      InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(var, loopStatement);
       if (status != InitializerUsageStatus.UNKNOWN) {
         PsiExpression initializer = var.getInitializer();
         if (initializer != null) {
           String replacementText = generateOptionalUnwrap(stream, tb, value, initializer, var.getType());
-          return replaceInitializer(foreachStatement, var, initializer, replacementText, status);
+          return replaceInitializer(loopStatement, var, initializer, replacementText, status);
         }
       }
-      return foreachStatement.replace(elementFactory.createStatementFromText(
-        var.getName() + " = " + generateOptionalUnwrap(stream, tb, value, lValue, var.getType()) + ";", foreachStatement));
+      return loopStatement.replace(elementFactory.createStatementFromText(
+        var.getName() + " = " + generateOptionalUnwrap(stream, tb, value, lValue, var.getType()) + ";", loopStatement));
     }
   }
 
index 6abacc64aa3ee9b1da3c2cc1e6b252a3b14642ea..becd6fd93e5783296462c1d94b9220ad2a49784f 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.codeInspection.streamMigration;
 
-import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
@@ -41,24 +40,22 @@ class ReplaceWithForeachCallFix extends MigrateToStreamFix {
 
   @Override
   PsiElement migrate(@NotNull Project project,
-               @NotNull ProblemDescriptor descriptor,
-               @NotNull PsiForeachStatement foreachStatement,
-               @NotNull PsiExpression iteratedValue,
-               @NotNull PsiStatement body,
-               @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
-    restoreComments(foreachStatement, body);
+                     @NotNull PsiLoopStatement loopStatement,
+                     @NotNull PsiStatement body,
+                     @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
+    restoreComments(loopStatement, body);
 
     final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
 
-    StringBuilder buffer = generateStream(iteratedValue, tb.getLastOperation(), true);
+    StringBuilder buffer = generateStream(tb.getLastOperation(), true);
     PsiElement block = tb.convertToElement(elementFactory);
 
     buffer.append(".").append(myForEachMethodName).append("(");
 
     final String functionalExpressionText = tb.getVariable().getName() + " -> " + wrapInBlock(block);
     PsiExpressionStatement callStatement = (PsiExpressionStatement)elementFactory
-      .createStatementFromText(buffer.toString() + functionalExpressionText + ");", foreachStatement);
-    callStatement = (PsiExpressionStatement)foreachStatement.replace(callStatement);
+      .createStatementFromText(buffer.toString() + functionalExpressionText + ");", loopStatement);
+    callStatement = (PsiExpressionStatement)loopStatement.replace(callStatement);
 
     final PsiExpressionList argumentList = ((PsiCallExpression)callStatement.getExpression()).getArgumentList();
     LOG.assertTrue(argumentList != null, callStatement.getText());
index d2a482e781905ffff3a72ae564949a1507e31e3a..1053a306f89c0fcba6eccad511f158218ddb1df5 100644 (file)
@@ -15,7 +15,6 @@
  */
 package com.intellij.codeInspection.streamMigration;
 
-import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.InitializerUsageStatus;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
@@ -46,43 +45,40 @@ class ReplaceWithMatchFix extends MigrateToStreamFix {
 
   @Override
   PsiElement migrate(@NotNull Project project,
-               @NotNull ProblemDescriptor descriptor,
-               @NotNull PsiForeachStatement foreachStatement,
-               @NotNull PsiExpression iteratedValue,
-               @NotNull PsiStatement body,
-               @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
+                     @NotNull PsiLoopStatement loopStatement,
+                     @NotNull PsiStatement body,
+                     @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
     PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(project);
+    StringBuilder builder = generateStream(tb.getLastOperation());
     if(tb.getSingleStatement() instanceof PsiReturnStatement) {
       PsiReturnStatement returnStatement = (PsiReturnStatement)tb.getSingleStatement();
       PsiExpression value = returnStatement.getReturnValue();
       if (ExpressionUtils.isLiteral(value, Boolean.TRUE) || ExpressionUtils.isLiteral(value, Boolean.FALSE)) {
         boolean foundResult = (boolean)((PsiLiteralExpression)value).getValue();
-        PsiReturnStatement nextReturnStatement = StreamApiMigrationInspection.getNextReturnStatement(foreachStatement);
+        PsiReturnStatement nextReturnStatement = StreamApiMigrationInspection.getNextReturnStatement(loopStatement);
         if (nextReturnStatement != null) {
           PsiExpression returnValue = nextReturnStatement.getReturnValue();
           if(returnValue == null) return null;
           String methodName = foundResult ? "anyMatch" : "noneMatch";
-          String streamText = generateStream(iteratedValue, tb.getLastOperation()).toString();
-          streamText = addTerminalOperation(streamText, methodName, foreachStatement, tb);
-          restoreComments(foreachStatement, body);
-          if (nextReturnStatement.getParent() == foreachStatement.getParent()) {
+          String streamText = addTerminalOperation(builder.toString(), methodName, loopStatement, tb);
+          restoreComments(loopStatement, body);
+          if (nextReturnStatement.getParent() == loopStatement.getParent()) {
             if(!ExpressionUtils.isLiteral(returnValue, !foundResult)) {
               streamText+= (foundResult ? "||" : "&&") + ParenthesesUtils.getText(returnValue, ParenthesesUtils.AND_PRECEDENCE);
             }
-            removeLoop(foreachStatement);
+            removeLoop(loopStatement);
             return returnValue.replace(elementFactory.createExpressionFromText(streamText, nextReturnStatement));
           }
-          return foreachStatement.replace(elementFactory.createStatementFromText("return " + streamText + ";", foreachStatement));
+          return loopStatement.replace(elementFactory.createStatementFromText("return " + streamText + ";", loopStatement));
         }
       }
     }
     PsiStatement[] statements = tb.getStatements();
-    if (!(statements.length == 1 || (statements.length == 2 && ControlFlowUtils.statementBreaksLoop(statements[1], foreachStatement)))) {
+    if (!(statements.length == 1 || (statements.length == 2 && ControlFlowUtils.statementBreaksLoop(statements[1], loopStatement)))) {
       return null;
     }
-    restoreComments(foreachStatement, body);
-    String streamText = generateStream(iteratedValue, tb.getLastOperation()).toString();
-    streamText = addTerminalOperation(streamText, "anyMatch", foreachStatement, tb);
+    restoreComments(loopStatement, body);
+    String streamText = addTerminalOperation(builder.toString(), "anyMatch", loopStatement, tb);
     PsiStatement statement = statements[0];
     PsiAssignmentExpression assignment = ExpressionUtils.getAssignment(statement);
     if(assignment != null) {
@@ -96,7 +92,7 @@ class ReplaceWithMatchFix extends MigrateToStreamFix {
         // for(....) if(...) {flag = true; break;}
         PsiVariable var = (PsiVariable)maybeVar;
         PsiExpression initializer = var.getInitializer();
-        InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(var, foreachStatement);
+        InitializerUsageStatus status = StreamApiMigrationInspection.getInitializerUsageStatus(var, loopStatement);
         if(initializer != null && status != InitializerUsageStatus.UNKNOWN) {
           String replacement;
           if(ExpressionUtils.isLiteral(initializer, Boolean.FALSE) &&
@@ -108,12 +104,12 @@ class ReplaceWithMatchFix extends MigrateToStreamFix {
           } else {
             replacement = streamText + "?" + rValue.getText() + ":" + initializer.getText();
           }
-          return replaceInitializer(foreachStatement, var, initializer, replacement, status);
+          return replaceInitializer(loopStatement, var, initializer, replacement, status);
         }
       }
     }
     String replacement = "if(" + streamText + "){" + statement.getText() + "}";
-    return foreachStatement.replace(elementFactory.createStatementFromText(replacement, foreachStatement));
+    return loopStatement.replace(elementFactory.createStatementFromText(replacement, loopStatement));
   }
 
   private static String addTerminalOperation(String origStream, String methodName, @NotNull PsiElement contextElement,
index 6c83570b1f2cdcb150af820dcef46b506dc356f6..63cf08b98b1133acc8ade5332038033c64740ea5 100644 (file)
@@ -15,7 +15,7 @@
  */
 package com.intellij.codeInspection.streamMigration;
 
-import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.codeInspection.streamMigration.StreamApiMigrationInspection.MapOp;
 import com.intellij.openapi.project.Project;
 import com.intellij.psi.*;
 import org.jetbrains.annotations.NotNull;
@@ -33,11 +33,9 @@ class ReplaceWithSumFix extends MigrateToStreamFix {
 
   @Override
   PsiElement migrate(@NotNull Project project,
-               @NotNull ProblemDescriptor descriptor,
-               @NotNull PsiForeachStatement foreachStatement,
-               @NotNull PsiExpression iteratedValue,
-               @NotNull PsiStatement body,
-               @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
+                     @NotNull PsiLoopStatement loopStatement,
+                     @NotNull PsiStatement body,
+                     @NotNull StreamApiMigrationInspection.TerminalBlock tb) {
     PsiAssignmentExpression assignment = tb.getSingleExpression(PsiAssignmentExpression.class);
     if (assignment == null) return null;
     PsiVariable var = StreamApiMigrationInspection.extractAccumulator(assignment);
@@ -50,9 +48,8 @@ class ReplaceWithSumFix extends MigrateToStreamFix {
     if (!type.equals(PsiType.DOUBLE) && !type.equals(PsiType.LONG)) {
       type = PsiType.INT;
     }
-    final StringBuilder builder =
-      generateStream(iteratedValue, new StreamApiMigrationInspection.MapOp(tb.getLastOperation(), addend, tb.getVariable(), type));
+    StringBuilder builder = generateStream(new MapOp(tb.getLastOperation(), addend, tb.getVariable(), type));
     builder.append(".sum()");
-    return replaceWithNumericAddition(project, foreachStatement, var, builder, type);
+    return replaceWithNumericAddition(project, loopStatement, var, builder, type);
   }
 }
index f4fb53ad8339494b6d371279f88a88bc0f4274ee..d84181e062025561a0b700d381c70e859080479a 100644 (file)
@@ -32,6 +32,7 @@ import com.intellij.psi.controlFlow.*;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.LocalSearchScope;
 import com.intellij.psi.search.searches.ReferencesSearch;
+import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
@@ -43,6 +44,7 @@ import com.intellij.util.containers.IntArrayList;
 import com.siyeh.ig.psiutils.BoolUtils;
 import com.siyeh.ig.psiutils.ControlFlowUtils;
 import com.siyeh.ig.psiutils.ExpressionUtils;
+import com.siyeh.ig.psiutils.ParenthesesUtils;
 import one.util.streamex.EntryStream;
 import one.util.streamex.StreamEx;
 import org.jetbrains.annotations.Contract;
@@ -123,7 +125,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
   }
 
   static boolean isReferencedInOperations(PsiElement element, TerminalBlock tb) {
-    return ReferencesSearch.search(element, new LocalSearchScope(tb.intermediateExpressions().toArray(PsiElement[]::new)))
+    return ReferencesSearch.search(element, new LocalSearchScope(tb.intermediateAndSourceExpressions().toArray(PsiElement[]::new)))
              .findFirst() != null;
   }
 
@@ -350,7 +352,10 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     return dependsOnCollection[0];
   }
 
-  private static boolean isTrivial(PsiStatement body, PsiParameter parameter) {
+  @Contract("_, null -> false")
+  private static boolean isTrivial(PsiStatement body, PsiLoopStatement loopStatement) {
+    if(!(loopStatement instanceof PsiForeachStatement)) return false;
+    PsiParameter parameter = ((PsiForeachStatement)loopStatement).getIterationParameter();
     //method reference
     final PsiExpression candidate = new LambdaCanBeMethodReferenceInspection()
       .canBeMethodReferenceProblem(body instanceof PsiBlockStatement ? ((PsiBlockStatement)body).getCodeBlock() : body,
@@ -385,6 +390,27 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     return consumerClass != null ? psiFacade.getElementFactory().createType(consumerClass, variable.getType()) : null;
   }
 
+  static boolean isVariableSuitableForStream(PsiVariable variable, PsiStatement statement) {
+    PsiElement declaration = variable.getParent();
+    // For-loop initializer is not effectively final, but suitable for stream conversion
+    if(declaration instanceof PsiDeclarationStatement) {
+      PsiElement grandParent = declaration.getParent();
+      if (grandParent instanceof PsiForStatement) {
+        PsiForStatement forStatement = (PsiForStatement)grandParent;
+        if (forStatement.getInitialization() == declaration) {
+          PsiStatement body = forStatement.getBody();
+          if(body != null && PsiTreeUtil.isAncestor(statement, body, false)) {
+            return ReferencesSearch.search(variable, new LocalSearchScope(body)).forEach(ref -> {
+              PsiElement element = ref.getElement();
+              return !(element instanceof PsiExpression) || !PsiUtil.isAccessedForWriting((PsiExpression)element);
+            });
+          }
+        }
+      }
+    }
+    return HighlightControlFlowUtil.isEffectivelyFinal(variable, statement, null);
+  }
+
   @Contract("null -> null")
   static PsiLocalVariable extractCollectionVariable(PsiExpression qualifierExpression) {
     if (qualifierExpression instanceof PsiReferenceExpression) {
@@ -465,26 +491,22 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     @Override
     public void visitForeachStatement(PsiForeachStatement statement) {
       super.visitForeachStatement(statement);
-      final PsiExpression iteratedValue = statement.getIteratedValue();
+      processLoop(statement);
+    }
+
+    @Override
+    public void visitForStatement(PsiForStatement statement) {
+      super.visitForStatement(statement);
+      processLoop(statement);
+    }
+
+    void processLoop(PsiLoopStatement statement) {
       final PsiStatement body = statement.getBody();
-      if (iteratedValue == null || body == null) return;
-
-      final PsiType iteratedValueType = iteratedValue.getType();
-      final PsiClass iteratorClass = PsiUtil.resolveClassInClassTypeOnly(iteratedValueType);
-      PsiClass collectionClass = null;
-      final boolean isArray;
-      if(iteratedValueType instanceof PsiArrayType) {
-        if(!isSupported(((PsiArrayType)iteratedValueType).getComponentType())) return;
-        isArray = true;
-      } else {
-        collectionClass = JavaPsiFacade.getInstance(body.getProject()).findClass(CommonClassNames.JAVA_UTIL_COLLECTION, statement.getResolveScope());
-        if (collectionClass != null && InheritanceUtil.isInheritorOrSelf(iteratorClass, collectionClass, true)) {
-          isArray = false;
-        } else return;
-      }
+      if(body == null) return;
+      StreamSource source = StreamSource.tryCreate(statement);
+      if(source == null) return;
       if (!ExceptionUtil.getThrownCheckedExceptions(body).isEmpty()) return;
-
-      TerminalBlock tb = TerminalBlock.from(statement.getIterationParameter(), body);
+      TerminalBlock tb = TerminalBlock.from(source, body);
       if(tb.isEmpty()) return;
 
       final ControlFlow controlFlow;
@@ -502,7 +524,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
       int startOffset = controlFlow.getStartOffset(body);
       int endOffset = controlFlow.getEndOffset(body);
       final List<PsiVariable> nonFinalVariables = StreamEx.of(ControlFlowUtil.getUsedVariables(controlFlow, startOffset, endOffset))
-        .remove(variable -> HighlightControlFlowUtil.isEffectivelyFinal(variable, body, null)).toList();
+        .remove(variable -> isVariableSuitableForStream(variable, statement)).toList();
 
       if (exitPoints.isEmpty()) {
         if(getIncrementedVariable(tb, nonFinalVariables) != null) {
@@ -514,8 +536,8 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
         if(!nonFinalVariables.isEmpty()) {
           return;
         }
-        if ((isArray || !isRawSubstitution(iteratedValueType, collectionClass)) && isCollectCall(tb)) {
-          boolean addAll = !tb.hasOperations() && isAddAllCall(tb);
+        if (isCollectCall(tb)) {
+          boolean addAll = statement instanceof PsiForeachStatement && !tb.hasOperations() && isAddAllCall(tb);
           String methodName;
           if(addAll) {
             methodName = "addAll";
@@ -535,7 +557,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
         }
         // do not replace for(T e : arr) {} with Arrays.stream(arr).forEach(e -> {}) even if flag is set
         else if (SUGGEST_FOREACH &&
-                 (tb.hasOperations() || (!isArray && (REPLACE_TRIVIAL_FOREACH || !isTrivial(body, statement.getIterationParameter()))))) {
+                 (tb.hasOperations() || (!(source instanceof ArrayStream) && (REPLACE_TRIVIAL_FOREACH || !isTrivial(body, statement))))) {
           ReplaceWithForeachCallFix forEachFix = new ReplaceWithForeachCallFix("forEach");
           LocalQuickFix[] fixes = {forEachFix};
           if (tb.hasOperations()) { //for .stream()
@@ -548,8 +570,8 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
         if (nonFinalVariables.isEmpty() && tb.getSingleStatement() instanceof PsiReturnStatement) {
           handleSingleReturn(statement, tb);
         }
-        // Intermediate ops should not refer to non-final variables
-        if (tb.intermediateExpressions()
+        // Source and intermediate ops should not refer to non-final variables
+        if (tb.intermediateAndSourceExpressions()
           .flatCollection(expr -> PsiTreeUtil.collectElementsOfType(expr, PsiReferenceExpression.class))
           .map(PsiReferenceExpression::resolve).anyMatch(nonFinalVariables::contains)) {
           return;
@@ -561,7 +583,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
             return;
           }
           if (ReferencesSearch.search(tb.getVariable(), new LocalSearchScope(statements)).findFirst() == null
-            && exitPoints.size() == 1 && exitPoints.contains(breakStatement)) {
+              && exitPoints.size() == 1 && exitPoints.contains(breakStatement)) {
             registerProblem(statement, "anyMatch", new ReplaceWithMatchFix("anyMatch"));
             return;
           }
@@ -583,14 +605,14 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
       }
     }
 
-    boolean canCollect(PsiForeachStatement statement, PsiMethodCallExpression methodCallExpression) {
+    boolean canCollect(PsiLoopStatement statement, PsiMethodCallExpression methodCallExpression) {
       if(methodCallExpression == null) return false;
       PsiLocalVariable variable = extractCollectionVariable(methodCallExpression.getMethodExpression().getQualifierExpression());
       if(variable == null) return false;
       return getInitializerUsageStatus(variable, statement) != UNKNOWN;
     }
 
-    void handleSingleReturn(PsiForeachStatement statement, TerminalBlock tb) {
+    void handleSingleReturn(PsiLoopStatement statement, TerminalBlock tb) {
       PsiReturnStatement returnStatement = (PsiReturnStatement)tb.getSingleStatement();
       PsiExpression value = returnStatement.getReturnValue();
       PsiReturnStatement nextReturnStatement = getNextReturnStatement(statement);
@@ -616,7 +638,10 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
       }
       if (!isVariableReferenced(tb.getVariable(), value)) {
         Operation lastOp = tb.getLastOperation();
-        if(!REPLACE_TRIVIAL_FOREACH && lastOp == null || (lastOp instanceof FilterOp && lastOp.getPreviousOp() == null)) return;
+        if (!REPLACE_TRIVIAL_FOREACH && lastOp instanceof StreamSource ||
+            (lastOp instanceof FilterOp && lastOp.getPreviousOp() instanceof StreamSource)) {
+          return;
+        }
         registerProblem(statement, "anyMatch", new ReplaceWithMatchFix("anyMatch"));
       }
       if(nextReturnStatement != null && ExpressionUtils.isSimpleExpression(nextReturnStatement.getReturnValue())
@@ -625,13 +650,8 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
       }
     }
 
-    private boolean isRawSubstitution(PsiType iteratedValueType, PsiClass collectionClass) {
-      return iteratedValueType instanceof PsiClassType && PsiUtil
-        .isRawSubstitutor(collectionClass, TypeConversionUtil.getSuperClassSubstitutor(collectionClass, (PsiClassType)iteratedValueType));
-    }
-
     @NotNull
-    private TextRange getRange(PsiForeachStatement statement) {
+    private TextRange getRange(PsiLoopStatement statement) {
       boolean wholeStatement = false;
       if(myIsOnTheFly) {
         if (myKey == null) {
@@ -643,18 +663,28 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
           wholeStatement = HighlightDisplayLevel.DO_NOT_SHOW.equals(level);
         }
       }
-      PsiExpression iteratedValue = statement.getIteratedValue();
-      LOG.assertTrue(iteratedValue != null);
-      PsiJavaToken rParenth = statement.getRParenth();
-      if(wholeStatement && rParenth != null) {
-        return new TextRange(statement.getTextOffset(), rParenth.getTextOffset() + 1);
+      if(statement instanceof PsiForeachStatement) {
+        PsiJavaToken rParenth = ((PsiForeachStatement)statement).getRParenth();
+        if (wholeStatement && rParenth != null) {
+          return new TextRange(statement.getTextOffset(), rParenth.getTextOffset() + 1);
+        }
+        PsiExpression iteratedValue = ((PsiForeachStatement)statement).getIteratedValue();
+        LOG.assertTrue(iteratedValue != null);
+        return iteratedValue.getTextRange();
+      } else if(statement instanceof PsiForStatement) {
+        PsiJavaToken rParenth = ((PsiForStatement)statement).getRParenth();
+        if (wholeStatement && rParenth != null) {
+          return new TextRange(statement.getTextOffset(), rParenth.getTextOffset() + 1);
+        }
+        PsiStatement initialization = ((PsiForStatement)statement).getInitialization();
+        LOG.assertTrue(initialization != null);
+        return initialization.getTextRange();
+      } else {
+        throw new IllegalStateException("Unexpected statement type: "+statement);
       }
-      return iteratedValue.getTextRange();
     }
 
-    private void registerProblem(PsiForeachStatement statement, String methodName, LocalQuickFix... fixes) {
-      PsiExpression iteratedValue = statement.getIteratedValue();
-      LOG.assertTrue(iteratedValue != null);
+    private void registerProblem(PsiLoopStatement statement, String methodName, LocalQuickFix... fixes) {
       myHolder.registerProblem(statement, getRange(statement).shiftRight(-statement.getTextOffset()),
                                "Can be replaced with '" + methodName + "' call", fixes);
     }
@@ -700,7 +730,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
   }
 
   @Nullable
-  static PsiMethodCallExpression extractToArrayExpression(PsiForeachStatement statement, PsiMethodCallExpression expression) {
+  static PsiMethodCallExpression extractToArrayExpression(PsiLoopStatement statement, PsiMethodCallExpression expression) {
     // return collection.toArray() or collection.toArray(new Type[0]) or collection.toArray(new Type[collection.size()]);
     PsiElement nextElement = PsiTreeUtil.skipSiblingsForward(statement, PsiComment.class, PsiWhiteSpace.class);
     PsiExpression toArrayCandidate;
@@ -799,7 +829,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
       return StreamEx.of(myExpression);
     }
 
-    abstract String createReplacement(PsiElementFactory factory);
+    abstract String createReplacement();
   }
 
   static class FilterOp extends Operation {
@@ -815,7 +845,8 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     }
 
     @Override
-    public String createReplacement(PsiElementFactory factory) {
+    public String createReplacement() {
+      PsiElementFactory factory = JavaPsiFacade.getElementFactory(myExpression.getProject());
       PsiExpression intermediate = makeIntermediateExpression(factory);
       PsiExpression expression =
         myNegated ? factory.createExpressionFromText(BoolUtils.getNegatedExpressionText(intermediate), myExpression) : intermediate;
@@ -858,7 +889,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     }
 
     @Override
-    public String createReplacement(PsiElementFactory factory) {
+    public String createReplacement() {
       if (isIdentityMapping(myVariable, myExpression)) {
         if (!(myType instanceof PsiPrimitiveType)) {
           return myVariable.getType() instanceof PsiPrimitiveType ? ".boxed()" : "";
@@ -894,20 +925,33 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
 
   static class FlatMapOp extends Operation {
     private final PsiLoopStatement myLoop;
+    private final StreamSource mySource;
 
-    FlatMapOp(@Nullable Operation previousOp, PsiExpression expression, PsiVariable variable, PsiLoopStatement loop) {
-      super(previousOp, expression, variable);
+    FlatMapOp(@Nullable Operation previousOp, StreamSource source, PsiVariable variable, PsiLoopStatement loop) {
+      super(previousOp, source.getExpression(), variable);
       myLoop = loop;
+      mySource = source;
     }
 
     @Override
-    public String createReplacement(PsiElementFactory factory) {
-      return ".flatMap(" + myVariable.getName() + " -> " + getStreamExpression() + ")";
+    public String createReplacement() {
+      String operation = "flatMap";
+      PsiType type = mySource.getVariable().getType();
+      if(type instanceof PsiPrimitiveType && !type.equals(myVariable.getType())) {
+        if(type.equals(PsiType.INT)) {
+          operation = "flatMapToInt";
+        } else if(type.equals(PsiType.LONG)) {
+          operation = "flatMapToLong";
+        } else if(type.equals(PsiType.DOUBLE)) {
+          operation = "flatMapToDouble";
+        }
+      }
+      return "." + operation + "(" + myVariable.getName() + " -> " + getStreamExpression() + ")";
     }
 
     @NotNull
     String getStreamExpression() {
-      return myExpression.getText() + ".stream()";
+      return mySource.createReplacement();
     }
 
     boolean breaksMe(PsiBreakStatement statement) {
@@ -915,35 +959,155 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     }
   }
 
-  static class ArrayFlatMapOp extends FlatMapOp {
-    ArrayFlatMapOp(@Nullable Operation previousOp, PsiExpression expression, PsiVariable variable, PsiLoopStatement loop) {
-      super(previousOp, expression, variable, loop);
+  abstract static class StreamSource extends Operation {
+    protected StreamSource(PsiVariable variable, PsiExpression expression) {
+      super(null, expression, variable);
     }
 
-    @Override
-    public String createReplacement(PsiElementFactory factory) {
-      String operation = "flatMap";
-      PsiType type = myExpression.getType();
-      if(type instanceof PsiArrayType) {
-        PsiType componentType = ((PsiArrayType)type).getComponentType();
-        if(componentType instanceof PsiPrimitiveType) {
-          if(componentType.equals(PsiType.INT)) {
-            operation = "flatMapToInt";
-          } else if(componentType.equals(PsiType.LONG)) {
-            operation = "flatMapToLong";
-          } else if(componentType.equals(PsiType.DOUBLE)) {
-            operation = "flatMapToDouble";
-          }
-        }
+    @Contract("null -> null")
+    static StreamSource tryCreate(PsiLoopStatement statement) {
+      if(statement instanceof PsiForStatement) {
+        return CountingLoop.from((PsiForStatement)statement);
       }
-      return "." + operation + "(" + myVariable.getName() + " -> " + getStreamExpression() + ")";
+      if(statement instanceof PsiForeachStatement) {
+        ArrayStream source = ArrayStream.from((PsiForeachStatement)statement);
+        return source == null ? CollectionStream.from((PsiForeachStatement)statement) : source;
+      }
+      return null;
+    }
+  }
+
+  static class ArrayStream extends StreamSource {
+    private ArrayStream(PsiVariable variable, PsiExpression expression) {
+      super(variable, expression);
     }
 
     @Override
-    @NotNull
-    String getStreamExpression() {
+    String createReplacement() {
       return "java.util.Arrays.stream("+myExpression.getText() + ")";
     }
+
+    @Nullable
+    public static ArrayStream from(PsiForeachStatement statement) {
+      PsiExpression iteratedValue = statement.getIteratedValue();
+      if (iteratedValue == null) return null;
+
+      PsiType iteratedValueType = iteratedValue.getType();
+      PsiParameter parameter = statement.getIterationParameter();
+
+      if (!(iteratedValueType instanceof PsiArrayType) ||
+          !isSupported(((PsiArrayType)iteratedValueType).getComponentType()) ||
+          ((parameter.getType() instanceof PsiPrimitiveType) &&
+           !parameter.getType().equals(((PsiArrayType)iteratedValueType).getComponentType()))) {
+        return null;
+      }
+
+      return new ArrayStream(parameter, iteratedValue);
+    }
+  }
+
+  static class CollectionStream extends StreamSource {
+
+    private CollectionStream(PsiVariable variable, PsiExpression expression) {
+      super(variable, expression);
+    }
+
+    @Override
+    String createReplacement() {
+      return ParenthesesUtils.getText(myExpression, ParenthesesUtils.POSTFIX_PRECEDENCE) + ".stream()";
+    }
+
+    @Contract("null, _ -> false")
+    static boolean isRawSubstitution(PsiType iteratedValueType, PsiClass collectionClass) {
+      return iteratedValueType instanceof PsiClassType && PsiUtil
+        .isRawSubstitutor(collectionClass, TypeConversionUtil.getSuperClassSubstitutor(collectionClass, (PsiClassType)iteratedValueType));
+    }
+
+    @Nullable
+    public static CollectionStream from(PsiForeachStatement statement) {
+      PsiExpression iteratedValue = statement.getIteratedValue();
+      if (iteratedValue == null) return null;
+
+      PsiType iteratedValueType = iteratedValue.getType();
+      PsiClass collectionClass =
+        JavaPsiFacade.getInstance(statement.getProject()).findClass(CommonClassNames.JAVA_UTIL_COLLECTION, statement.getResolveScope());
+      PsiClass iteratorClass = PsiUtil.resolveClassInClassTypeOnly(iteratedValueType);
+      if (collectionClass == null ||
+          !InheritanceUtil.isInheritorOrSelf(iteratorClass, collectionClass, true) ||
+          isRawSubstitution(iteratedValueType, collectionClass)) {
+        return null;
+      }
+      return new CollectionStream(statement.getIterationParameter(), iteratedValue);
+    }
+  }
+
+  static class CountingLoop extends StreamSource {
+    final PsiExpression myBound;
+    final boolean myIncluding;
+
+    private CountingLoop(PsiLocalVariable counter, PsiExpression initializer, PsiExpression bound, boolean including) {
+      super(counter, initializer);
+      myBound = bound;
+      myIncluding = including;
+    }
+
+    @Override
+    StreamEx<PsiExpression> expressions() {
+      return StreamEx.of(myExpression, myBound);
+    }
+
+    @Override
+    public String createReplacement() {
+      String className = myVariable.getType().equals(PsiType.LONG) ? "java.util.stream.LongStream" : "java.util.stream.IntStream";
+      String methodName = myIncluding ? "rangeClosed" : "range";
+      return className+"."+methodName+"("+myExpression.getText()+", "+myBound.getText()+")";
+    }
+
+    @Nullable
+    public static CountingLoop from(PsiForStatement forStatement) {
+      // check that initialization is for(int/long i = <initial_value>;...;...)
+      if(!(forStatement.getInitialization() instanceof PsiDeclarationStatement)) return null;
+      PsiDeclarationStatement initialization = (PsiDeclarationStatement)forStatement.getInitialization();
+      if(initialization.getDeclaredElements().length != 1) return null;
+      PsiElement declaration = initialization.getDeclaredElements()[0];
+      if(!(declaration instanceof PsiLocalVariable)) return null;
+      PsiLocalVariable counter = (PsiLocalVariable)declaration;
+      if(!counter.getType().equals(PsiType.INT) && !counter.getType().equals(PsiType.LONG)) return null;
+
+      PsiExpression initializer = counter.getInitializer();
+      if(initializer == null) return null;
+
+      // check that increment is like for(...;...;i++)
+      if(!(forStatement.getUpdate() instanceof PsiExpressionStatement)) return null;
+      PsiExpression lValue = extractIncrementedLValue(((PsiExpressionStatement)forStatement.getUpdate()).getExpression());
+      if(!(lValue instanceof PsiReferenceExpression) || ((PsiReferenceExpression)lValue).resolve() != counter) return null;
+
+      // check that condition is like for(...;i<bound;...) or for(...;i<=bound;...)
+      if(!(forStatement.getCondition() instanceof PsiBinaryExpression)) return null;
+      PsiBinaryExpression condition = (PsiBinaryExpression)forStatement.getCondition();
+      IElementType type = condition.getOperationTokenType();
+      boolean closed = false;
+      PsiExpression bound;
+      PsiExpression ref;
+      if(type.equals(JavaTokenType.LE)) {
+        bound = condition.getROperand();
+        ref = condition.getLOperand();
+        closed = true;
+      } else if(type.equals(JavaTokenType.LT)) {
+        bound = condition.getROperand();
+        ref = condition.getLOperand();
+      } else if(type.equals(JavaTokenType.GE)) {
+        bound = condition.getLOperand();
+        ref = condition.getROperand();
+        closed = true;
+      } else if(type.equals(JavaTokenType.GT)) {
+        bound = condition.getLOperand();
+        ref = condition.getROperand();
+      } else return null;
+      if(bound == null || !(ref instanceof PsiReferenceExpression) || ((PsiReferenceExpression)ref).resolve() != counter) return null;
+      if(!TypeConversionUtil.areTypesAssignmentCompatible(counter.getType(), bound)) return null;
+      return new CountingLoop(counter, initializer, bound, closed);
+    }
   }
 
   /**
@@ -952,11 +1116,12 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
    * some intermediate operations extracted.
    */
   static class TerminalBlock {
-    private final @Nullable Operation myPreviousOp;
+    private final @NotNull Operation myPreviousOp;
     private final @NotNull PsiVariable myVariable;
     private final @NotNull PsiStatement[] myStatements;
 
-    private TerminalBlock(@Nullable Operation previousOp, @NotNull PsiVariable variable, @NotNull PsiStatement... statements) {
+    // At least one previous operation is present (stream source)
+    private TerminalBlock(@NotNull Operation previousOp, @NotNull PsiVariable variable, @NotNull PsiStatement... statements) {
       myVariable = variable;
       while(true) {
         if(statements.length == 1 && statements[0] instanceof PsiBlockStatement) {
@@ -1052,46 +1217,32 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
       TerminalBlock withFilter = extractFilter();
       if(withFilter != null) return withFilter;
       // extract flatMap
-      if(getSingleStatement() instanceof PsiForeachStatement) {
-        // flatMapping of primitive variable is not supported yet
-        if(myVariable.getType() instanceof PsiPrimitiveType) return null;
-        PsiForeachStatement foreachStatement = (PsiForeachStatement)getSingleStatement();
-        final PsiExpression iteratedValue = foreachStatement.getIteratedValue();
-        final PsiStatement body = foreachStatement.getBody();
-        if (iteratedValue != null && body != null) {
-          final PsiType iteratedValueType = iteratedValue.getType();
-          FlatMapOp op = null;
-          if(iteratedValueType instanceof PsiArrayType) {
-            if (!isSupported(((PsiArrayType)iteratedValueType).getComponentType())) return null;
-            op = new ArrayFlatMapOp(myPreviousOp, iteratedValue, myVariable, foreachStatement);
-          } else {
-            final PsiClass iteratorClass = PsiUtil.resolveClassInClassTypeOnly(iteratedValueType);
-            final PsiClass collectionClass =
-              JavaPsiFacade.getInstance(body.getProject())
-                .findClass(CommonClassNames.JAVA_UTIL_COLLECTION, foreachStatement.getResolveScope());
-            if (collectionClass != null && InheritanceUtil.isInheritorOrSelf(iteratorClass, collectionClass, true)) {
-              op = new FlatMapOp(myPreviousOp, iteratedValue, myVariable, foreachStatement);
-            }
-          }
-          if(op != null) {
-            TerminalBlock withFlatMap = new TerminalBlock(op, foreachStatement.getIterationParameter(), body);
-            if(ReferencesSearch.search(myVariable, new LocalSearchScope(body)).findFirst() == null) {
-              return withFlatMap;
-            } else {
-              // Try extract nested filter like this:
-              // for(List subList : list) for(T t : subList) if(condition.test(t)) { ...; break; }
-              // if t is not used in "...", then this could be converted to
-              // list.stream().filter(subList -> subList.stream().anyMatch(condition)).forEach(subList -> ...)
-              TerminalBlock withFlatMapFilter = withFlatMap.extractFilter();
-              if(withFlatMapFilter != null && !withFlatMapFilter.isEmpty()) {
-                PsiStatement[] statements = withFlatMapFilter.getStatements();
-                PsiStatement lastStatement = statements[statements.length-1];
-                if (lastStatement instanceof PsiBreakStatement && op.breaksMe((PsiBreakStatement)lastStatement) &&
-                    ReferencesSearch.search(withFlatMapFilter.getVariable(), new LocalSearchScope(statements)).findFirst() == null) {
-                  return new TerminalBlock(new CompoundFilterOp((FilterOp)withFlatMapFilter.getLastOperation(), op),
-                                           myVariable, Arrays.copyOfRange(statements, 0, statements.length-1));
-                }
-              }
+      if(getSingleStatement() instanceof PsiLoopStatement) {
+        PsiLoopStatement loopStatement = (PsiLoopStatement)getSingleStatement();
+        StreamSource source = StreamSource.tryCreate(loopStatement);
+        final PsiStatement body = loopStatement.getBody();
+        if(source == null || body == null) return null;
+        // flatMap from primitive to primitive is supported only if primitive types match
+        // otherwise it would be necessary to create bogus step like
+        // .mapToObj(var -> blahblah.stream()).flatMap(Function.identity())
+        if(myVariable.getType() instanceof PsiPrimitiveType && !myVariable.getType().equals(source.getVariable().getType())) return null;
+        FlatMapOp op = new FlatMapOp(myPreviousOp, source, myVariable, loopStatement);
+        TerminalBlock withFlatMap = new TerminalBlock(op, source.getVariable(), body);
+        if(ReferencesSearch.search(myVariable, new LocalSearchScope(body)).findFirst() == null) {
+          return withFlatMap;
+        } else {
+          // Try extract nested filter like this:
+          // for(List subList : list) for(T t : subList) if(condition.test(t)) { ...; break; }
+          // if t is not used in "...", then this could be converted to
+          // list.stream().filter(subList -> subList.stream().anyMatch(condition)).forEach(subList -> ...)
+          TerminalBlock withFlatMapFilter = withFlatMap.extractFilter();
+          if(withFlatMapFilter != null && !withFlatMapFilter.isEmpty()) {
+            PsiStatement[] statements = withFlatMapFilter.getStatements();
+            PsiStatement lastStatement = statements[statements.length-1];
+            if (lastStatement instanceof PsiBreakStatement && op.breaksMe((PsiBreakStatement)lastStatement) &&
+                ReferencesSearch.search(withFlatMapFilter.getVariable(), new LocalSearchScope(statements)).findFirst() == null) {
+              return new TerminalBlock(new CompoundFilterOp((FilterOp)withFlatMapFilter.getLastOperation(), op),
+                                       myVariable, Arrays.copyOfRange(statements, 0, statements.length-1));
             }
           }
         }
@@ -1121,7 +1272,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
       return null;
     }
 
-    @Nullable
+    @NotNull
     public Operation getLastOperation() {
       return myPreviousOp;
     }
@@ -1141,7 +1292,7 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     }
 
     public boolean hasOperations() {
-      return myPreviousOp != null;
+      return !(myPreviousOp instanceof StreamSource);
     }
 
     public boolean isEmpty() {
@@ -1163,6 +1314,13 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
      * @return stream of physical expressions used in intermediate operations in arbitrary order
      */
     public StreamEx<PsiExpression> intermediateExpressions() {
+      return operations().remove(StreamSource.class::isInstance).flatMap(Operation::expressions);
+    }
+
+    /**
+     * @return stream of physical expressions used in stream source and intermediate operations in arbitrary order
+     */
+    public StreamEx<PsiExpression> intermediateAndSourceExpressions() {
       return operations().flatMap(Operation::expressions);
     }
 
@@ -1184,8 +1342,8 @@ public class StreamApiMigrationInspection extends BaseJavaBatchLocalInspectionTo
     }
 
     @NotNull
-    public static TerminalBlock from(PsiVariable variable, PsiStatement statement) {
-      return new TerminalBlock(null, variable, statement).extractOperations();
+    public static TerminalBlock from(StreamSource source, PsiStatement body) {
+      return new TerminalBlock(source, source.myVariable, body).extractOperations();
     }
   }
 }
index 9d192a1fecb4caa3d8938d4da81e5b6f3ce0f1c0..b96d77cac98f6e83cd5c1bc17a34565c0323072e 100644 (file)
@@ -107,16 +107,15 @@ public class JavadocHelper {
     }
 
     final CodeStyleSettings codeStyleSettings = CodeStyleSettingsManager.getInstance(psiFile.getProject()).getCurrentSettings();
-    final int indentSize = codeStyleSettings.getIndentSize(psiFile.getFileType());
     int column;
     if (codeStyleSettings.JD_ALIGN_PARAM_COMMENTS) {
       column = Math.max(descriptionStartColumn, parameterNameEndColumn);
       if (column <= parameterNameEndColumn) {
-        column = parameterNameEndColumn + indentSize;
+        column = parameterNameEndColumn + 1;
       }
     }
     else {
-      column = anchor.parameterNameEndPosition.column + indentSize;
+      column = anchor.parameterNameEndPosition.column + 1;
     }
     return new LogicalPosition(anchor.parameterNameEndPosition.line, column);
   }
index 55843bf91337f98ec40ccdb7be5a597ef2bcacaf..702d88c7a3453e7cc6026ff9fb9904de30280955 100644 (file)
@@ -169,9 +169,9 @@ public class InferenceSession {
     return elementFactory.createType(parameter);
   }
 
-  public void initExpressionConstraints(PsiParameter[] parameters, PsiExpression[] args, PsiElement parent, PsiMethod method) {
+  public void initExpressionConstraints(PsiParameter[] parameters, PsiExpression[] args, PsiElement parent) {
     final MethodCandidateInfo.CurrentCandidateProperties currentProperties = getCurrentProperties(parent);
-    initExpressionConstraints(parameters, args, parent, method, currentProperties != null && currentProperties.isVarargs());
+    initExpressionConstraints(parameters, args, parent, null, currentProperties != null && currentProperties.isVarargs());
   }
 
   public void initExpressionConstraints(PsiParameter[] parameters,
@@ -382,7 +382,6 @@ public class InferenceSession {
           final Ref<String> errorMessage = new Ref<String>();
           final PsiType targetType = getTargetTypeFromParent(parent, errorMessage, false);
           if (targetType == null && errorMessage.get() != null) {
-            registerIncompatibleErrorMessage(errorMessage.get());
             return;
           }
 
@@ -393,6 +392,7 @@ public class InferenceSession {
       }
 
       if (!repeatInferencePhases()) {
+        resolveBounds(getInputInferenceVariablesFromTopLevelFunctionalExpressions(args, properties), initialSubstitutor);
         return;
       }
 
@@ -405,34 +405,37 @@ public class InferenceSession {
         }
 
         if (!additionalConstraints.isEmpty() && !proceedWithAdditionalConstraints(additionalConstraints, ignoredConstraints)) {
+          resolveBounds(getInputInferenceVariablesFromTopLevelFunctionalExpressions(args, properties), initialSubstitutor);
           return;
         }
       }
     }
 
-    final PsiSubstitutor substitutor = resolveBounds(myInferenceVariables, initialSubstitutor);
-    if (substitutor != null) {
-      if (myContext != null) {
-        myContext.putUserData(ERASED, myErased);
-      }
-      final Map<PsiTypeParameter, PsiType> map = substitutor.getSubstitutionMap();
-      for (PsiTypeParameter parameter : map.keySet()) {
-        final PsiType mapping = map.get(parameter);
-        PsiTypeParameter param;
-        if (parameter instanceof InferenceVariable) {
-          ((InferenceVariable)parameter).setInstantiation(mapping);
-          if (((InferenceVariable)parameter).getCallContext() != myContext) {
-            //don't include in result substitutor foreign inference variables
-            continue;
+    resolveBounds(myInferenceVariables, initialSubstitutor);
+  }
+
+  private Collection<InferenceVariable> getInputInferenceVariablesFromTopLevelFunctionalExpressions(PsiExpression[] args, MethodCandidateInfo.CurrentCandidateProperties properties) {
+    if (args == null) return Collections.emptyList();
+    final PsiMethod method = properties.getMethod();
+    final PsiParameter[] parameters = method.getParameterList().getParameters();
+    final HashSet<InferenceVariable> dependencies = new HashSet<InferenceVariable>();
+    for (int i = 0; i < args.length; i++) {
+      PsiExpression arg = args[i];
+      if (arg instanceof PsiLambdaExpression && !((PsiLambdaExpression)arg).hasFormalParameterTypes() ||
+          arg instanceof PsiMethodReferenceExpression && !((PsiMethodReferenceExpression)arg).isExact()) {
+        final PsiSubstitutor nestedSubstitutor = myInferenceSessionContainer.findNestedSubstitutor(arg, myInferenceSubstitution);
+        final PsiType parameterType = nestedSubstitutor.substitute(getParameterType(parameters, i, mySiteSubstitutor, properties.isVarargs()));
+        final PsiClassType.ClassResolveResult result = PsiUtil.resolveGenericsClassInType(parameterType);
+        final PsiMethod interfaceMethod = LambdaUtil.getFunctionalInterfaceMethod(result);
+        if (interfaceMethod != null) {
+          final PsiSubstitutor substitutor = LambdaUtil.getSubstitutor(interfaceMethod, result);
+          for (PsiParameter parameter : interfaceMethod.getParameterList().getParameters()) {
+            collectDependencies(substitutor.substitute(parameter.getType()), dependencies);
           }
-          param = ((InferenceVariable)parameter).getParameter();
         }
-        else {
-          param = parameter;
-        }
-        mySiteSubstitutor = mySiteSubstitutor.put(param, mapping);
       }
     }
+    return dependencies;
   }
 
   private boolean isOverloadCheck() {
@@ -1106,8 +1109,8 @@ public class InferenceSession {
     return false;
   }
 
-  private PsiSubstitutor resolveBounds(final Collection<InferenceVariable> inferenceVariables,
-                                       PsiSubstitutor substitutor) {
+  private void resolveBounds(final Collection<InferenceVariable> inferenceVariables,
+                             @NotNull PsiSubstitutor substitutor) {
     final Collection<InferenceVariable> allVars = new ArrayList<InferenceVariable>(inferenceVariables);
     while (!allVars.isEmpty()) {
       final List<InferenceVariable> vars = InferenceVariablesOrder.resolveOrder(allVars, this);
@@ -1132,15 +1135,36 @@ public class InferenceSession {
       }
 
       if (!initFreshVariables(substitutor, unresolved)) {
-        return null;
+        return;
       }
 
       myIncorporationPhase.forgetCaptures(vars);
       if (!repeatInferencePhases()) {
-        return null;
+        return;
       }
     }
-    return substitutor;
+
+    if (myContext != null) {
+      myContext.putUserData(ERASED, myErased);
+    }
+
+    final Map<PsiTypeParameter, PsiType> map = substitutor.getSubstitutionMap();
+    for (PsiTypeParameter parameter : map.keySet()) {
+      final PsiType mapping = map.get(parameter);
+      PsiTypeParameter param;
+      if (parameter instanceof InferenceVariable) {
+        ((InferenceVariable)parameter).setInstantiation(mapping);
+        if (((InferenceVariable)parameter).getCallContext() != myContext) {
+          //don't include in result substitutor foreign inference variables
+          continue;
+        }
+        param = ((InferenceVariable)parameter).getParameter();
+      }
+      else {
+        param = parameter;
+      }
+      mySiteSubstitutor = mySiteSubstitutor.put(param, mapping);
+    }
   }
 
   private boolean initFreshVariables(PsiSubstitutor substitutor, List<InferenceVariable> vars) {
index 801b0791796d1ab500af5ea7aa68d235cf15998a..fcf4496e1e17595a08fedab49cc1da09d139d7e2 100644 (file)
@@ -138,7 +138,7 @@ public class InferenceSessionContainer {
     }
 
     final InferenceSession inferenceSession = new InferenceSession(typeParameters, partialSubstitutor, parent.getManager(), parent, policy);
-    inferenceSession.initExpressionConstraints(parameters, arguments, parent, null);
+    inferenceSession.initExpressionConstraints(parameters, arguments, parent);
     return inferenceSession.infer(parameters, arguments, parent);
   }
   
index eab17977301b21bd589fd6063b21a9f350fb3544..a97a3e5cf47491bb321e506b4c410f4fb7973a80 100644 (file)
@@ -51,7 +51,7 @@ public class PsiGraphInferenceHelper implements PsiInferenceHelper {
     }
     else {
       final InferenceSession inferenceSession = new InferenceSession(new PsiTypeParameter[]{typeParameter}, partialSubstitutor, myManager, null);
-      inferenceSession.initExpressionConstraints(parameters, arguments, null, null);
+      inferenceSession.initExpressionConstraints(parameters, arguments, null);
       substitutor = inferenceSession.infer();
     }
     return substitutor.substitute(typeParameter);
index 4525426bf58e51b13f0a632ea589262bb23f62d9..49c813e2a87827657aae6b85823c71d892e86c57 100644 (file)
@@ -3,8 +3,8 @@ import java.util.*;
 class Main {
 
     void foo(List<Integer> list) {
-        bar(list, i -> <error descr="Bad return type in lambda expression: int cannot be converted to S_OUT">i.intValue()</error>, i -> i.<error descr="Cannot resolve method 'unknown()'">unknown</error>());
-        bar1(list, i -> <error descr="Bad return type in lambda expression: int cannot be converted to S_OUT">i.intValue()</error>, i -> i.<error descr="Cannot resolve method 'unknown()'">unknown</error>());
+        bar(list, i -> i.intValue(), i -> i.<error descr="Cannot resolve method 'unknown()'">unknown</error>());
+        bar1(list, i -> i.intValue(), i -> i.<error descr="Cannot resolve method 'unknown()'">unknown</error>());
     }
 
     <U, S_IN, S_OUT, R> R bar(List<S_IN> list,
index 0c75ae1d7d6e0f610bf1a21dd54d3bc9f7e94cf9..6ee3add7c1fe33ca3bc047c60df35d73ffa13636 100644 (file)
@@ -57,7 +57,7 @@ class ReturnTypeCompatibility {
     }
 
     public static void main(String[] args) {
-        <error descr="Ambiguous method call: both 'ReturnTypeCompatibility.call(I1<Number>)' and 'ReturnTypeCompatibility.call(I2<P>)' match">call</error>(i-> {return i;});
+        <error descr="Ambiguous method call: both 'ReturnTypeCompatibility.call(I1<Number>)' and 'ReturnTypeCompatibility.call(I2<String>)' match">call</error>(i-> {return i;});
     }
 }
 
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/InferTypeParametersFromFunctionalInterfaceInputs.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/InferTypeParametersFromFunctionalInterfaceInputs.java
new file mode 100644 (file)
index 0000000..7df4595