Merge remote-tracking branch 'origin/master'
authorIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Tue, 23 Jun 2015 14:24:09 +0000 (17:24 +0300)
committerIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Tue, 23 Jun 2015 14:24:09 +0000 (17:24 +0300)
537 files changed:
build/scripts/dist.gant
build/scripts/utils.gant
java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java
java/compiler/impl/src/com/intellij/compiler/options/TargetOptionsComponent.java
java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java
java/compiler/openapi/src/com/intellij/compiler/CompilerWorkspaceConfiguration.java
java/debugger/impl/debugger-impl.iml
java/debugger/impl/src/com/intellij/debugger/actions/JvmSmartStepIntoHandler.java
java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java
java/debugger/impl/src/com/intellij/debugger/engine/PositionManagerImpl.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/FieldEvaluator.java
java/debugger/impl/src/com/intellij/debugger/impl/DebuggerUtilsEx.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/StepIntoBreakpoint.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluator.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/CompilingEvaluatorImpl.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTreeNodeExpression.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/EvaluationDescriptor.java
java/debugger/impl/src/org/jetbrains/java/debugger/breakpoints/properties/JavaLineBreakpointProperties.java
java/execution/impl/src/com/intellij/execution/JavaTestFrameworkRunnableState.java
java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AbstractProjectWizard.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ModuleEditor.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/ClasspathPanelImpl.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/InlineModuleDependencyAction.java [new file with mode: 0644]
java/idea-ui/src/com/intellij/platform/templates/ManageProjectTemplatesDialog.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightMethodUtil.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightUtil.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightVisitorImpl.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/AddExceptionToCatchFix.java
java/java-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/DeclarationMover.java
java/java-impl/src/com/intellij/codeInsight/generation/equalsHelper.vm
java/java-impl/src/com/intellij/codeInsight/generation/guavaEquals.vm
java/java-impl/src/com/intellij/codeInsight/generation/objectsEquals.vm
java/java-impl/src/com/intellij/codeInsight/intention/impl/IntroduceVariableIntentionAction.java
java/java-impl/src/com/intellij/codeInsight/intention/impl/SurroundAutoCloseableAction.java
java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocExternalFilter.java
java/java-impl/src/com/intellij/codeInsight/template/impl/JavaDefaultLiveTemplatesProvider.java
java/java-impl/src/com/intellij/codeInsight/template/macro/ExpressionTypeMacro.java [new file with mode: 0644]
java/java-impl/src/com/intellij/codeInspection/ex/GlobalJavaInspectionContextImpl.java
java/java-impl/src/com/intellij/ide/actions/JavaQualifiedNameProvider.java
java/java-impl/src/com/intellij/psi/impl/source/codeStyle/JavaCodeStyleManagerImpl.java
java/java-impl/src/com/intellij/refactoring/actions/RenameFileAction.java
java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java
java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java
java/java-impl/src/com/intellij/refactoring/introduceVariable/JavaVariableInplaceIntroducer.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/DestinationFolderComboBox.java
java/java-impl/src/com/intellij/refactoring/safeDelete/JavaSafeDeleteProcessor.java
java/java-psi-api/src/com/intellij/codeInsight/TestFrameworks.java
java/java-psi-api/src/com/intellij/psi/codeStyle/JavaCodeStyleManager.java
java/java-psi-impl/src/com/intellij/core/CoreJavaCodeStyleManager.java
java/java-psi-impl/src/com/intellij/lang/java/parser/ExpressionParser.java
java/java-psi-impl/src/com/intellij/psi/impl/PsiImplUtil.java
java/java-psi-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceExpressionImpl.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AmbiguityRawGenerics.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AmbiguityReturnValueResolution.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AmbiguityReturnValueResolution1.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AmbiguityReturnValueResolution2.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AmbiguityReturnValueResolution3.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AmbiguitySpecificReturn.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/AmbiguityVarargs.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/ReturnTypeCompatibility.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/highlighting/ReturnTypeCompatibility1.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/interfaceMethods/IDEA123839.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/interfaceMethods/InheritUnrelatedDefaults.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/interfaceMethods/NotInheritFromUnrelatedDefault.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/DifferentParamsLength.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/IncompleteMethodInInterface.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/JDK8034223.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/RelatedSAMErasures.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/mostSpecific/TargetTypeParameter.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/OverloadResolutionSAM.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/DetectPolyExpressionInReturnsOfExplicitlyTypedLambdaWhenPrimitiveCouldWin.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/IDEA102800.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/PertinentToApplicabilityOfExplicitlyTypedLambda.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/VoidValueCompatibilityOfImplicitlyTypedLambda.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/params/MethodApplicability.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/introduceVariable/afterInsideRunnable.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/introduceVariable/beforeInsideRunnable.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/documentation/ReferenceStyleDoesntMatchBytecodeVersion.html
java/java-tests/testData/codeInsight/documentation/library-javadoc.jar
java/java-tests/testData/codeInsight/generateEquals/afterDifferentTypesSuperEqualsAndHashCodeGuava.java
java/java-tests/testData/codeInsight/generation/surroundWith/java/LocalClasses.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/generation/surroundWith/java/NoParenthesisSurrounderForLambdaParameter.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/surroundAutoCloseable/SplitVar.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/surroundAutoCloseable/SplitVar_after.java [new file with mode: 0644]
java/java-tests/testData/psi/autodetect/bigFile.java [new file with mode: 0644]
java/java-tests/testData/psi/parser-full/expressionParsing/QualifiedSuperMethodCall1.txt
java/java-tests/testData/psi/parser-partial/expressions/QualifiedSuperMethodCall1.txt
java/java-tests/testData/psi/parser-partial/expressions/QualifiedSuperMethodCall3.txt [new file with mode: 0644]
java/java-tests/testData/refactoring/inplaceIntroduceVariable/conflictWithField.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inplaceIntroduceVariable/conflictWithField_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/safeDelete/classWithInnerStaticImport/after/empty.txt [new file with mode: 0644]
java/java-tests/testData/refactoring/safeDelete/classWithInnerStaticImport/before/ClassWithInnerStaticImport.java [new file with mode: 0644]
java/java-tests/testData/refactoring/safeDelete/classWithInnerStaticImport/before/empty.txt [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/daemon/HighlightStressTest.java
java/java-tests/testSrc/com/intellij/codeInsight/generation/surroundWith/JavaSurroundWithTest.java
java/java-tests/testSrc/com/intellij/codeInsight/intention/IntroduceVariableQuickFixTest.java
java/java-tests/testSrc/com/intellij/codeInsight/intention/SurroundAutoCloseableActionTest.java
java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
java/java-tests/testSrc/com/intellij/codeInsight/template/SurroundWithTemplateTest.groovy [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/lang/java/parser/partial/ExpressionParserTest.java
java/java-tests/testSrc/com/intellij/navigation/GotoImplementationTest.java
java/java-tests/testSrc/com/intellij/psi/codeStyle/autodetect/AbstractNewLineBlocksIteratorTest.java [moved from java/java-tests/testSrc/com/intellij/psi/autodetect/AbstractNewLineBlocksIteratorTest.java with 98% similarity]
java/java-tests/testSrc/com/intellij/psi/codeStyle/autodetect/DetectIndentAndTypeTest.java
java/java-tests/testSrc/com/intellij/psi/codeStyle/autodetect/DetectedIndentNotificationTest.java [moved from platform/lang-impl/testSources/com/intellij/psi/codeStyle/autodetect/DetectedIndentNotificationTest.java with 100% similarity]
java/java-tests/testSrc/com/intellij/psi/codeStyle/autodetect/JavaAutoDetectIndentPerformanceTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/psi/codeStyle/autodetect/JavaAutoDetectIndentTest.java [moved from java/java-tests/testSrc/com/intellij/psi/autodetect/JavaAutoDetectIndentTest.java with 97% similarity]
java/java-tests/testSrc/com/intellij/psi/codeStyle/autodetect/NewLineBlocksIteratorTest.java [moved from java/java-tests/testSrc/com/intellij/psi/autodetect/NewLineBlocksIteratorTest.java with 96% similarity]
java/java-tests/testSrc/com/intellij/refactoring/InplaceIntroduceVariableTest.java
java/java-tests/testSrc/com/intellij/refactoring/SafeDeleteTest.java
java/java-tests/testSrc/com/intellij/roots/RootsChangedTest.java
java/java-tests/testSrc/com/intellij/unscramble/UnscrambleDialogTest.java
java/openapi/src/com/intellij/codeInsight/generation/surroundWith/JavaExpressionSurrounder.java
java/testFramework/src/com/intellij/JavaTestUtil.java [moved from java/java-tests/testSrc/com/intellij/JavaTestUtil.java with 83% similarity]
java/testFramework/src/com/intellij/debugger/DebuggerTestCase.java
java/testFramework/src/com/intellij/debugger/ExecutionWithDebuggerToolsTestCase.java
java/testFramework/src/com/intellij/debugger/impl/OutputChecker.java
jps/jps-builders/src/org/jetbrains/jps/incremental/java/JavaBuilder.java
jps/jps-builders/src/org/jetbrains/jps/javac/ExternalJavacManager.java
jps/jps-builders/testSrc/org/jetbrains/jps/builders/java/dependencyView/ObjectObjectPersistentMultiMapletTest.java
jps/model-api/src/org/jetbrains/jps/service/SharedThreadPool.java
platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
platform/built-in-server/src/org/jetbrains/builtInWebServer/DefaultWebServerRootsProvider.java
platform/built-in-server/src/org/jetbrains/ide/BuiltInServerManagerImpl.java
platform/built-in-server/src/org/jetbrains/io/SubServer.java
platform/core-api/src/com/intellij/openapi/options/ExternalInfo.java
platform/core-api/src/com/intellij/openapi/options/ExternalizableScheme.java
platform/core-api/src/com/intellij/openapi/options/ExternalizableSchemeAdapter.java [new file with mode: 0644]
platform/core-api/src/com/intellij/openapi/options/SchemesManager.java
platform/core-api/src/com/intellij/openapi/options/SchemesManagerFactory.java
platform/core-api/src/com/intellij/psi/util/CachedValuesManager.java
platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java
platform/core-api/src/com/intellij/psi/util/QualifiedName.java
platform/core-impl/src/com/intellij/core/CoreProjectEnvironment.java
platform/core-impl/src/com/intellij/core/CorePsiDocumentManager.java
platform/core-impl/src/com/intellij/openapi/application/ex/ApplicationInfoEx.java
platform/core-impl/src/com/intellij/openapi/application/impl/ApplicationInfoImpl.java
platform/core-impl/src/com/intellij/openapi/options/AbstractSchemesManager.java [deleted file]
platform/core-impl/src/com/intellij/psi/impl/PsiDocumentManagerBase.java
platform/core-impl/src/com/intellij/psi/impl/source/tree/LeafPsiElement.java
platform/core-impl/src/org/jetbrains/ide/PooledThreadExecutor.java
platform/diff-api/src/com/intellij/diff/util/LineCol.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/LineCol.java with 94% similarity]
platform/diff-api/src/com/intellij/diff/util/Side.java
platform/diff-impl/src/com/intellij/diff/DiffManagerImpl.java
platform/diff-impl/src/com/intellij/diff/comparison/ComparisonMergeUtil.java [moved from platform/diff-impl/src/com/intellij/diff/comparison/MergeUtil.java with 99% similarity]
platform/diff-impl/src/com/intellij/diff/tools/binary/BinaryDiffTool.java
platform/diff-impl/src/com/intellij/diff/tools/binary/BinaryDiffViewer.java [deleted file]
platform/diff-impl/src/com/intellij/diff/tools/binary/OnesideBinaryDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/binary/ThreesideBinaryDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/binary/TwosideBinaryDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/ChangedBlock.java
platform/diff-impl/src/com/intellij/diff/tools/fragmented/HighlightRange.java
platform/diff-impl/src/com/intellij/diff/tools/fragmented/LineNumberConvertor.java
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedContentPanel.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideContentPanel.java with 92% similarity]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedDiffChange.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideDiffChange.java with 90% similarity]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedDiffPanel.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideDiffPanel.java with 91% similarity]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedDiffTool.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideDiffTool.java with 65% similarity]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedDiffViewer.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideDiffViewer.java with 73% similarity]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedEditorHighlighter.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideEditorHighlighter.java with 97% similarity]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedEditorRangeHighlighter.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideEditorRangeHighlighter.java with 96% similarity]
platform/diff-impl/src/com/intellij/diff/tools/fragmented/UnifiedFragmentBuilder.java [moved from platform/diff-impl/src/com/intellij/diff/tools/fragmented/OnesideFragmentBuilder.java with 97% similarity]
platform/diff-impl/src/com/intellij/diff/tools/holders/BinaryEditorHolder.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/holders/EditorHolder.java [moved from platform/diff-impl/src/com/intellij/diff/tools/util/twoside/TwosideTextContentPanel.java with 55% similarity]
platform/diff-impl/src/com/intellij/diff/tools/holders/EditorHolderFactory.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/holders/TextEditorHolder.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/simple/SimpleDiffChange.java
platform/diff-impl/src/com/intellij/diff/tools/simple/SimpleDiffTool.java
platform/diff-impl/src/com/intellij/diff/tools/simple/SimpleDiffViewer.java
platform/diff-impl/src/com/intellij/diff/tools/simple/SimpleOnesideDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/simple/SimpleThreesideDiffChange.java
platform/diff-impl/src/com/intellij/diff/tools/simple/SimpleThreesideDiffViewer.java
platform/diff-impl/src/com/intellij/diff/tools/util/FocusTrackerSupport.java
platform/diff-impl/src/com/intellij/diff/tools/util/KeyboardModifierListener.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/PrevNextDifferenceIterableBase.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/StatusPanel.java
platform/diff-impl/src/com/intellij/diff/tools/util/SyncScrollSupport.java
platform/diff-impl/src/com/intellij/diff/tools/util/base/DiffViewerBase.java
platform/diff-impl/src/com/intellij/diff/tools/util/base/TextDiffViewerUtil.java [moved from platform/diff-impl/src/com/intellij/diff/tools/util/base/TextDiffViewerBase.java with 62% similarity]
platform/diff-impl/src/com/intellij/diff/tools/util/side/HolderPanel.java [moved from platform/diff-impl/src/com/intellij/diff/tools/binary/BinaryContentPanel.java with 52% similarity]
platform/diff-impl/src/com/intellij/diff/tools/util/side/OnesideContentPanel.java [moved from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StoresFactory.java with 54% similarity]
platform/diff-impl/src/com/intellij/diff/tools/util/side/OnesideDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/side/OnesideTextDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/side/ThreesideContentPanel.java [moved from platform/diff-impl/src/com/intellij/diff/tools/util/threeside/ThreesideContentPanel.java with 58% similarity]
platform/diff-impl/src/com/intellij/diff/tools/util/side/ThreesideDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/side/ThreesideTextDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/side/TwosideContentPanel.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/side/TwosideDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/side/TwosideTextDiffViewer.java [new file with mode: 0644]
platform/diff-impl/src/com/intellij/diff/tools/util/threeside/ThreesideTextContentPanel.java [deleted file]
platform/diff-impl/src/com/intellij/diff/tools/util/threeside/ThreesideTextDiffViewer.java [deleted file]
platform/diff-impl/src/com/intellij/diff/tools/util/twoside/TwosideContentPanel.java [deleted file]
platform/diff-impl/src/com/intellij/diff/tools/util/twoside/TwosideTextDiffViewer.java [deleted file]
platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java
platform/diff-impl/tests/com/intellij/diff/tools/fragmented/UnifiedFragmentBuilderAutoTest.java [moved from platform/diff-impl/tests/com/intellij/diff/tools/fragmented/OnesideFragmentBuilderAutoTest.java with 98% similarity]
platform/diff-impl/tests/com/intellij/diff/tools/fragmented/UnifiedFragmentBuilderTest.java [moved from platform/diff-impl/tests/com/intellij/diff/tools/fragmented/OnesideFragmentBuilderTest.java with 93% similarity]
platform/editor-ui-api/src/com/intellij/openapi/actionSystem/Presentation.java
platform/editor-ui-api/src/com/intellij/openapi/editor/colors/EditorColorsManager.java
platform/editor-ui-ex/src/com/intellij/openapi/editor/colors/impl/EditorColorsSchemeImpl.java
platform/indexing-impl/src/com/intellij/psi/impl/search/CachesBasedRefSearcher.java
platform/lang-api/src/com/intellij/codeInsight/lookup/LookupElement.java
platform/lang-api/src/com/intellij/codeInsight/template/Expression.java
platform/lang-api/src/com/intellij/codeInsight/template/TemplateBuilder.java
platform/lang-api/src/com/intellij/execution/configurations/UnknownRunConfiguration.java
platform/lang-api/src/com/intellij/ide/util/projectWizard/WizardContext.java
platform/lang-api/src/com/intellij/lang/surroundWith/SurroundDescriptor.java
platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSchemes.java
platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleSchemesModel.java
platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/EditorTracker.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/SmartPointerEditorTracker.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/MoverWrapper.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupCellRenderer.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSettings.java
platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileManagerImpl.java
platform/lang-impl/src/com/intellij/execution/actions/EditRunConfigurationsAction.java
platform/lang-impl/src/com/intellij/execution/actions/StopAction.java
platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleBuilder.java
platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java
platform/lang-impl/src/com/intellij/execution/impl/ExecutionManagerImpl.java
platform/lang-impl/src/com/intellij/execution/lineMarker/RunLineMarkerInfo.java
platform/lang-impl/src/com/intellij/find/impl/FindManagerImpl.java
platform/lang-impl/src/com/intellij/formatting/contextConfiguration/ConfigureCodeStyleOnSelectedFragment.java
platform/lang-impl/src/com/intellij/ide/extensionResources/ExtensionsRootType.java
platform/lang-impl/src/com/intellij/ide/navigationToolbar/DefaultNavBarExtension.java
platform/lang-impl/src/com/intellij/openapi/file/exclude/EnforcedPlainTextFileTypeManager.java
platform/lang-impl/src/com/intellij/openapi/fileEditor/impl/TestEditorManagerImpl.java
platform/lang-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeConfigurable.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/OrderEntryUtil.java
platform/lang-impl/src/com/intellij/psi/codeStyle/autodetect/DetectableIndentOptionsProvider.java
platform/lang-impl/src/com/intellij/psi/codeStyle/autodetect/IndentOptionsDetectorImpl.java
platform/lang-impl/src/com/intellij/psi/impl/PsiDocumentManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleSchemeImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleSchemesImpl.java
platform/lang-impl/src/com/intellij/refactoring/actions/IntroduceVariableAction.java
platform/lang-impl/src/com/intellij/refactoring/introduce/inplace/AbstractInplaceIntroducer.java
platform/lang-impl/src/com/intellij/tools/BaseToolManager.java
platform/lang-impl/src/com/intellij/tools/BaseToolsPanel.java
platform/lang-impl/src/com/intellij/tools/ToolConfigurable.java
platform/lang-impl/src/com/intellij/tools/ToolSelectDialog.java
platform/lang-impl/src/com/intellij/ui/tabs/FileColorSettingsTable.java
platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexImpl.java
platform/lang-impl/src/com/intellij/util/ui/UpDownHandler.java
platform/lang-impl/src/com/intellij/util/ui/tree/AbstractFileTreeTable.java
platform/lang-impl/src/com/intellij/util/ui/tree/ProjectContentFileFilter.java [moved from platform/lang-impl/src/com/intellij/util/ui/tree/NonContentFileFilter.java with 89% similarity]
platform/platform-api/src/com/intellij/openapi/fileTypes/UserFileType.java
platform/platform-api/src/com/intellij/openapi/options/CompoundScheme.java
platform/platform-api/src/com/intellij/openapi/options/ConfigurableBase.java
platform/platform-api/src/com/intellij/openapi/options/ConfigurableUi.java
platform/platform-api/src/com/intellij/openapi/ui/DialogWrapper.java
platform/platform-api/src/com/intellij/ui/CollectionListModel.java
platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java
platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafe.java
platform/platform-impl/src/com/intellij/ide/plugins/InstalledPluginsTableModel.java
platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/ui/DarculaTextFieldUI.java
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedButtonLeft.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedButtonLeft@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedButtonMiddle.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedButtonMiddle@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedButtonRight.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedButtonRight@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedHelpButton.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedHelpButton@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedSelectedButtonLeft.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedSelectedButtonLeft@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedSelectedButtonMiddle.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedSelectedButtonMiddle@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedSelectedButtonRight.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/focusedSelectedButtonRight@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/helpButton.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/helpButton@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderBottom.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderBottom@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderBottomLeft.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderBottomLeft@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderBottomRight.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderBottomRight@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderLeft.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderLeft@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderRight.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderRight@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderTop.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderTop@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderTopLeft.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderTopLeft@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderTopRight.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macBorderTopRight@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macEditorBorderMiddle@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/icons/macEditorBorderRight@2x.png [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJBorder.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJBorderPainter.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJButtonBorder.java
platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJButtonUI.java
platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJComboBoxUI.java
platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJTextBorder.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/intellij/MacIntelliJTextFieldUI.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/ide/ui/laf/intellijlaf_mac.properties
platform/platform-impl/src/com/intellij/idea/SocketLock.java
platform/platform-impl/src/com/intellij/idea/StartupUtil.java
platform/platform-impl/src/com/intellij/openapi/actionSystem/ex/QuickList.java
platform/platform-impl/src/com/intellij/openapi/actionSystem/ex/QuickListsManager.java
platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StreamProvider.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/XmlElementStorage.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/ChangeEditorFontSizeAction.java
platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/EditorColorsManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/ComplementaryFontsRegistry.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/CompositeSoftWrapPainter.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java
platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/AbstractFileType.java
platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/DefaultKeymap.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/GenericKeymapManager.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/EditQuickListDialog.java [deleted file]
platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapListener.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/KeymapPanel.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/QuickListPanel.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/QuickListsPanel.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/QuickListsUi.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerFactoryImpl.java
platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java
platform/platform-impl/src/com/intellij/ui/BalloonImpl.java
platform/platform-impl/src/com/intellij/ui/FinderRecursivePanel.java
platform/platform-impl/src/com/intellij/util/ui/CollectionItemEditor.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/util/ui/CollectionModelEditor.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/util/ui/ListItemEditor.java [moved from jps/model-api/src/org/jetbrains/jps/service/ThreadExecutor.java with 74% similarity]
platform/platform-impl/src/com/intellij/util/ui/ListModelEditor.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/util/ui/table/TableModelEditor.java
platform/platform-impl/src/org/jetbrains/io/BuiltInServer.java
platform/platform-resources-en/src/messages/CodeInsightBundle.properties
platform/platform-resources-en/src/messages/ToolsBundle.properties
platform/platform-resources/src/brokenPlugins.txt
platform/platform-resources/src/checkedPlugins.txt
platform/platform-resources/src/componentSets/Lang.xml
platform/platform-resources/src/idea/Keymap_Xcode.xml
platform/platform-resources/src/idea/LangActions.xml
platform/platform-tests/testSrc/com/intellij/application/ApplicationImplTest.java
platform/platform-tests/testSrc/com/intellij/idea/LockSupportTest.java
platform/platform-tests/testSrc/com/intellij/openapi/components/impl/ApplicationStoreTest.java
platform/platform-tests/testSrc/com/intellij/openapi/fileEditor/NonProjectFileAccessTest.java
platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java
platform/platform-tests/testSrc/com/intellij/openapi/progress/impl/ProgressIndicatorTest.java
platform/platform-tests/testSrc/com/intellij/psi/autodetect/AbstractIndentAutoDetectionTest.java
platform/platform-tests/testSrc/com/intellij/ui/FinderRecursivePanelListModelMergeTest.java
platform/platform-tests/testSrc/com/intellij/ui/FinderRecursivePanelSelectionUpdateTest.java
platform/remote-servers/impl/src/META-INF/RemoteServers.xml
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/deployment/DeployToServerSettingsEditor.java
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/deployment/DeploymentConfigurationManagerImpl.java
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/log/CloudTerminalProvider.java
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/log/ConsoleTerminalHandlerImpl.java
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/log/ConsoleTerminalProvider.java [new file with mode: 0644]
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/log/DeploymentLogManagerImpl.java
platform/smRunner/src/com/intellij/execution/testframework/sm/SMTestRunnerConnectionUtil.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/OutputToGeneralTestEventsConverter.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMRunnerConsolePropertiesProvider.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleProperties.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestConsoleProperties.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestContentHandler.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedTestRunnableState.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/ImportedToGeneralTestEventsConverter.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/actions/ImportTestResultsDialog.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/history/actions/ImportTestsAction.java [new file with mode: 0644]
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerConsoleView.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerToolbarPanel.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsForm.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/TestsPresentationUtil.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/GeneralToSMTRunnerEventsConvertorTest.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/SMTRunnerConsoleTest.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTRunnerUIActionsHandlerTest.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/SMTestRunnerResultsFormTest.java
platform/smRunner/testSrc/com/intellij/execution/testframework/sm/runner/ui/statistics/SMTRunnerStatisticsPanelTest.java
platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java
platform/testFramework/src/com/intellij/testFramework/MockSchemesManagerFactory.java
platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java
platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java
platform/testFramework/src/com/intellij/testFramework/Timings.java
platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestUtil.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/HeavyIdeaTestFixtureImpl.java
platform/testFramework/src/com/intellij/util/GCUtil.java
platform/testRunner/src/com/intellij/execution/testframework/AbstractTestProxy.java
platform/testRunner/src/com/intellij/execution/testframework/TestConsoleProperties.java
platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java
platform/testRunner/src/com/intellij/execution/testframework/TestsUIUtil.java
platform/testRunner/src/com/intellij/execution/testframework/ToolbarPanel.java
platform/testRunner/src/com/intellij/execution/testframework/export/ExportTestResultsAction.java
platform/testRunner/src/com/intellij/execution/testframework/export/TestResultsXmlFormatter.java
platform/testRunner/src/com/intellij/execution/testframework/ui/TestResultsPanel.java
platform/testRunner/src/com/intellij/execution/testframework/ui/TestStatusLine.java
platform/util/resources/misc/registry.properties
platform/util/src/com/intellij/openapi/util/io/FileSystemUtil.java
platform/util/src/com/intellij/util/ArrayUtil.java
platform/util/src/com/intellij/util/ui/ItemRemovable.java
platform/util/src/com/intellij/util/ui/UIUtil.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/conflicts/ChangelistConflictTracker.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchDifferentiatedDialog.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/CompoundShelfFileProcessor.java
platform/vcs-impl/testSrc/com/intellij/openapi/vcs/changes/ConvertExcludedToIgnoredTest.java
platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XLineBreakpointType.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/XDebuggerUtilImpl.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XValueHint.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/MemberSignature.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/fixes/SerialVersionUIDBuilder.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/UnnecessaryFullyQualifiedNameInspection.java
plugins/InspectionGadgets/test/com/siyeh/igfixes/serialization/serialVersionUID/BridgeMethod.after.java [new file with mode: 0644]
plugins/InspectionGadgets/test/com/siyeh/igfixes/serialization/serialVersionUID/BridgeMethod.java [new file with mode: 0644]
plugins/InspectionGadgets/test/com/siyeh/igfixes/serialization/serialVersionUID/ClassAccess.after.java
plugins/InspectionGadgets/test/com/siyeh/igfixes/serialization/serialVersionUID/GenericParameter.after.java [new file with mode: 0644]
plugins/InspectionGadgets/test/com/siyeh/igfixes/serialization/serialVersionUID/GenericParameter.java [new file with mode: 0644]
plugins/InspectionGadgets/test/com/siyeh/igtest/style/unnecessary_fqn_javadoc_fully_qualify_if_not_imported/expected.xml
plugins/InspectionGadgets/test/com/siyeh/igtest/style/unnecessary_fully_qualified_name/expected.xml
plugins/InspectionGadgets/testsrc/com/siyeh/ig/fixes/serialization/AddSerialVersionUIDFixTest.java
plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/ReferenceInjectionTest.java
plugins/IntelliLang/java-support/org/intellij/plugins/intelliLang/inject/java/InjectionCache.java
plugins/IntelliLang/src/org/intellij/plugins/intelliLang/references/InjectedReferencesContributor.java
plugins/coverage-common/src/com/intellij/coverage/actions/TrackCoverageAction.java
plugins/devkit/src/testAssistant/NavigateToTestDataAction.java
plugins/devkit/src/testAssistant/TestDataGuessByExistingFilesUtil.java
plugins/gradle/src/org/jetbrains/plugins/gradle/execution/test/runner/OpenGradleTestResultActionProvider.java
plugins/gradle/tooling-extension-impl/gradle-tooling-extension-impl.iml
plugins/groovy/src/org/jetbrains/plugins/groovy/debugger/GroovyHotSwapper.java
plugins/groovy/src/org/jetbrains/plugins/groovy/shell/DefaultGroovyShellRunner.java
plugins/groovy/src/org/jetbrains/plugins/groovy/shell/GroovyShellLanguageConsoleView.java
plugins/junit/junit.iml
plugins/junit/src/com/intellij/execution/junit/JUnitConfiguration.java
plugins/junit/src/com/intellij/execution/junit/TestDirectory.java
plugins/junit/src/com/intellij/execution/junit/TestMethods.java
plugins/junit/src/com/intellij/execution/junit/TestObject.java
plugins/junit/src/com/intellij/execution/junit/TestPackage.java
plugins/junit/src/com/intellij/execution/junit2/ui/ConsolePanel.java
plugins/junit/src/com/intellij/execution/junit2/ui/JUnitStatusLine.java
plugins/junit/src/com/intellij/execution/junit2/ui/JUnitTreeConsoleView.java
plugins/junit/src/com/intellij/execution/junit2/ui/actions/JUnitToolbarPanel.java
plugins/junit/src/com/intellij/execution/junit2/ui/actions/LvcsLabeler.java
plugins/junit/src/com/intellij/execution/junit2/ui/actions/RerunFailedTestsAction.java
plugins/junit/src/com/intellij/execution/junit2/ui/properties/JUnitConsoleProperties.java
plugins/junit_rt/junit_rt.iml
plugins/junit_rt/src/com/intellij/junit3/JUnit3IdeaTestRunner.java
plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java
plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java
plugins/junit_rt/src/com/intellij/rt/execution/junit/MapSerializerUtil.java [new file with mode: 0644]
plugins/maven/maven-server-api/src/org/jetbrains/idea/maven/server/MavenServerEmbedder.java
plugins/maven/maven2-server-impl/src/org/jetbrains/idea/maven/server/embedder/Maven2ServerEmbedderImpl.java
plugins/maven/maven30-server-impl/maven30-server-impl.iml
plugins/maven/maven30-server-impl/src/org/jetbrains/idea/maven/server/Maven30ServerEmbedderImpl.java
plugins/maven/maven32-server-impl/maven32-server-impl.iml
plugins/maven/maven32-server-impl/src/org/jetbrains/idea/maven/server/Maven32ServerEmbedderImpl.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/server/MavenServerManager.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/library/RepositoryAttachHandler.java
plugins/svn4idea/src/org/jetbrains/idea/svn/difftool/properties/SvnPropertiesDiffViewer.java
plugins/terminal/resources/META-INF/terminal.xml
plugins/terminal/src/org/jetbrains/plugins/terminal/cloud/CloudTerminalProcess.java
plugins/terminal/src/org/jetbrains/plugins/terminal/cloud/CloudTerminalProviderImpl.java
plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfiguration.java
plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGRunnableState.java
plugins/testng/src/com/theoryinpractice/testng/model/TestNGConsoleProperties.java
plugins/testng/src/com/theoryinpractice/testng/ui/TestNGConsoleView.java
plugins/testng/src/com/theoryinpractice/testng/ui/TestNGResults.java
plugins/testng/src/com/theoryinpractice/testng/ui/actions/RerunFailedTestsAction.java
plugins/testng/testng.iml
plugins/testng_rt/src/org/testng/IDEATestNGRemoteListener.java
plugins/testng_rt/src/org/testng/MapSerializerUtil.java [new file with mode: 0644]
plugins/testng_rt/testng_rt.iml
python/build/pycharm_community_build.gant
python/edu/build/pycharm_edu_build.gant
python/helpers/pydev/pydevd.py
python/pluginResources/META-INF/plugin.xml
python/pluginTestResources/app.yaml [moved from python/pluginResources/app.yaml with 100% similarity]
python/pluginTestResources/main.py [moved from python/pluginResources/main.py with 100% similarity]
python/python-community-plugin-resources.iml [new file with mode: 0644]
python/python-plugin-tests.iml
python/resources/idea/PyCharmCoreApplicationInfo.xml
python/src/com/jetbrains/commandInterface/console/CommandConsole.java
python/src/com/jetbrains/python/codeInsight/imports/AddImportHelper.java
python/src/com/jetbrains/python/codeInsight/imports/PyImportOptimizer.java
python/src/com/jetbrains/python/formatter/PythonFormattingModelBuilder.java
python/src/com/jetbrains/python/psi/impl/PyReferenceExpressionImpl.java
python/src/com/jetbrains/python/refactoring/classes/membersManager/MethodsManager.java
python/src/com/jetbrains/python/testing/PythonTestCommandLineStateBase.java
python/testData/MockSdk2.7/Lib/abc.py [moved from python/testData/refactoring/pullup/abstractMethodPy2AddMeta/abc.py with 100% similarity]
python/testData/MockSdk3.2/Lib/abc.py [moved from python/testData/refactoring/pullup/abstractMethodPy3AddMeta/abc.py with 100% similarity]
python/testData/MockSdk3.4/Lib/abc.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInBuiltinGroup/a.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInBuiltinGroup/main.after.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInBuiltinGroup/main.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroup/a.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroup/b.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroup/main.after.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroup/main.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroupWithExistingBlankLineAbove/a.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroupWithExistingBlankLineAbove/b.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroupWithExistingBlankLineAbove/main.after.py [new file with mode: 0644]
python/testData/addImport/newFirstImportInProjectGroupWithExistingBlankLineAbove/main.py [new file with mode: 0644]
python/testData/addImport/newFromImportFromSameModule.after.py [new file with mode: 0644]
python/testData/addImport/newFromImportFromSameModule.py [new file with mode: 0644]
python/testData/addImport/newLastImportInBuiltinGroup/a.py [new file with mode: 0644]
python/testData/addImport/newLastImportInBuiltinGroup/main.after.py [new file with mode: 0644]
python/testData/addImport/newLastImportInBuiltinGroup/main.py [new file with mode: 0644]
python/testData/addImport/newLastImportInProjectGroup/a.py [new file with mode: 0644]
python/testData/addImport/newLastImportInProjectGroup/main.after.py [new file with mode: 0644]
python/testData/addImport/newLastImportInProjectGroup/main.py [new file with mode: 0644]
python/testData/addImport/newThirdPartyImportInBetween/a.py [new file with mode: 0644]
python/testData/addImport/newThirdPartyImportInBetween/main.after.py [new file with mode: 0644]
python/testData/addImport/newThirdPartyImportInBetween/main.py [new file with mode: 0644]
python/testData/inspections/MoveFromFutureImportDocString_after.py
python/testData/optimizeImports/alphabeticalOrder.after.py [new file with mode: 0644]
python/testData/optimizeImports/alphabeticalOrder.py [new file with mode: 0644]
python/testData/optimizeImports/insertBlankLines.after.py
python/testData/optimizeImports/orderByType.after.py [moved from python/testData/optimizeImports/order.after.py with 93% similarity]
python/testData/optimizeImports/orderByType.py [moved from python/testData/optimizeImports/order.py with 100% similarity]
python/testData/optimizeImports/split.after.py
python/testData/refactoring/extractsuperclass/moveAndMakeAbstract/dest_module.after.py
python/testData/refactoring/pullup/abstractMethodPy2AddMeta/SuperClass.after.py
python/testData/refactoring/pullup/abstractMethodPy3AddMeta/SuperClass.after.py
python/testSrc/com/jetbrains/python/PyAddImportTest.java
python/testSrc/com/jetbrains/python/PyOptimizeImportsTest.java
python/testSrc/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpTest.java
resources-en/src/messages/QuickFixBundle.properties
resources/src/META-INF/IdeaPlugin.xml
resources/src/liveTemplates/surround.xml
spellchecker/src/com/intellij/spellchecker/inspections/SpellCheckingInspection.java
spellchecker/src/com/intellij/spellchecker/jetbrains.dic
xml/dom-tests/tests/com/intellij/util/xml/DomFileDescriptionTest.java

index 607a28263ff1eb747b9104cf7dc95794bd12f85a..fcef33509bfe4b6c83ec65c9f454768512a26797 100644 (file)
@@ -57,7 +57,6 @@ setProperty("maySkipAndroidPlugin", true)
 
 target(compile: "Compile project") {
   loadProject()
-  bundledJDKs()
   projectBuilder.stage("Cleaning up sandbox folder")
   forceDelete(paths.sandbox)
 
@@ -67,6 +66,7 @@ target(compile: "Compile project") {
 
   projectBuilder.targetFolder = "$out/classes"
   projectBuilder.cleanOutput()
+  bundledJDKs()
   projectBuilder.buildProduction()
   projectBuilder.makeModuleTests(findModule("jps-builders"))
 }
@@ -159,7 +159,7 @@ def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps =
   layoutMac(args, home, paths)
   layoutUnix(args, home, paths)
 
-  buildWinZip("$paths.artifacts/idea${args.buildNumber}.win.zip", [paths.distAll, paths.distWin])
+  buildWinZip("$paths.artifacts/idea${args.buildNumber}.win.zip", [paths.distAll, paths.distWin, "${paths.sandbox}/bundled.win.jdk"])
   buildCrossPlatformZip("$paths.artifacts/idea${args.buildNumber}.zip", "${paths.sandbox}/sandbox-ce", [paths.distAll],
                         paths.distWin, paths.distUnix, paths.distMac)
 
index f6156766438ad185077ad535b2f6cd318ee5189a..1a95e2e51d099ab3471379164cfde2ce93ea1798 100644 (file)
@@ -318,6 +318,7 @@ binding.setVariable("wireBuildDate", { String buildNumber, String appInfoFile ->
 binding.setVariable("commonJvmArgsForTests", {
   def jdwp = "-Xrunjdwp:transport=dt_socket,server=y,suspend=$debugSuspend"
   if (debugPort != null) jdwp += ",address=$debugPort"
+
   return [
     "-ea",
     "-Dio.netty.leakDetectionLevel=PARANOID",
@@ -822,7 +823,10 @@ binding.setVariable("bundledJDKs"){
   requireProperty("jdk.bundled.mac", "1.8")
   requireProperty("jdk.custom.mac", "true")
 
-  setProperty("winJDK", getPathToBundledJDK(new File("${home}/build/jdk/win"), "jdk" + p("jdk.bundled.win"), "x32.zip"))
+  if (p("jdk.bundled.win") != "false") {
+    setProperty("winJDK", getPathToBundledJDK(new File("${home}/build/jdk/win"), "jdk" + p("jdk.bundled.win"), "x32.zip"))
+    extractRedistJre(winJDK, "${paths.sandbox}/bundled.win.jdk")
+  }
   if (p("jdk.bundled.linux") != "false"){
     setProperty("linuxJDK", getPathToBundledJDK(new File("${home}/build/jdk/linux"), "jdk" + p("jdk.bundled.linux"), ".tar"))
     extractRedistJre(linuxJDK, "${paths.sandbox}/bundled.linux.jdk")
index 2b12302a0937491ef3adc5d506522c738c6df39e..9f701721e4f0efa103e54376f86d286272733dd2 100644 (file)
@@ -111,7 +111,7 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
   private Map<Module, ProcessorConfigProfile> myProcessorsProfilesMap = null;
 
   @Nullable
-  private String myBytecodeTargetLevel = null;  // null means compiler default
+  private String myBytecodeTargetLevel = null;  // null means same as effective language level
   private final Map<String, String> myModuleBytecodeTarget = new HashMap<String, String>();
 
   public CompilerConfigurationImpl(Project project) {
index 3e5e30ee5ac09dc2e18b0cd98dfef50b657ef406..19b305a8ddf9390d4cda92de0516c6e3be55c1a8 100644 (file)
@@ -230,6 +230,7 @@ public class TargetOptionsComponent extends JPanel {
     @Override
     public void removeRow(int idx) {
       myItems.remove(idx);
+      fireTableRowsDeleted(idx, idx);
     }
 
     public void setItems(Map<Module, String> items) {
index 92d1bcd74d890082f9f626d15b9408a7793956f6..79933a517a6945e6890837351ebf99a76bb01d66 100644 (file)
@@ -109,7 +109,8 @@ import org.jetbrains.jps.incremental.Utils;
 import org.jetbrains.jps.model.serialization.JpsGlobalLoader;
 
 import javax.swing.*;
-import javax.tools.*;
+import javax.tools.JavaCompiler;
+import javax.tools.ToolProvider;
 import java.awt.*;
 import java.io.File;
 import java.io.FileFilter;
@@ -232,21 +233,23 @@ public class BuildManager implements ApplicationComponent{
           return pathname.isDirectory() && !TEMP_DIR_NAME.equals(pathname.getName());
         }
       });
-      final Date now = new Date();
-      for (File buildDataProjectDir : dirs) {
-        final File usageFile = getUsageFile(buildDataProjectDir);
-        if (usageFile.exists()) {
-          final Pair<Date, File> usageData = readUsageFile(usageFile);
-          if (usageData != null) {
-            final File projectFile = usageData.second;
-            if ((projectFile != null && !projectFile.exists()) || DateFormatUtil.getDifferenceInDays(usageData.first, now) > unusedThresholdDays) {
-              LOG.info("Clearing project build data because the project does not exist or was not opened for more than " + unusedThresholdDays + " days: " + buildDataProjectDir.getPath());
-              FileUtil.delete(buildDataProjectDir);
+      if (dirs != null) {
+        final Date now = new Date();
+        for (File buildDataProjectDir : dirs) {
+          final File usageFile = getUsageFile(buildDataProjectDir);
+          if (usageFile.exists()) {
+            final Pair<Date, File> usageData = readUsageFile(usageFile);
+            if (usageData != null) {
+              final File projectFile = usageData.second;
+              if ((projectFile != null && !projectFile.exists()) || DateFormatUtil.getDifferenceInDays(usageData.first, now) > unusedThresholdDays) {
+                LOG.info("Clearing project build data because the project does not exist or was not opened for more than " + unusedThresholdDays + " days: " + buildDataProjectDir.getPath());
+                FileUtil.delete(buildDataProjectDir);
+              }
             }
           }
-        }
-        else {
-          updateUsageFile(null, buildDataProjectDir); // set usage stamp to start countdown
+          else {
+            updateUsageFile(null, buildDataProjectDir); // set usage stamp to start countdown
+          }
         }
       }
     }
@@ -916,6 +919,58 @@ public class BuildManager implements ApplicationComponent{
     return "com.intellij.compiler.server.BuildManager";
   }
 
+  @NotNull
+  public static Pair<Sdk, JavaSdkVersion> getBuildProcessRuntimeSdk(Project project) {
+    Sdk projectJdk = null;
+    int sdkMinorVersion = 0;
+    JavaSdkVersion sdkVersion = null;
+
+    final Set<Sdk> candidates = new HashSet<Sdk>();
+    final Sdk defaultSdk = ProjectRootManager.getInstance(project).getProjectSdk();
+    if (defaultSdk != null && defaultSdk.getSdkType() instanceof JavaSdkType) {
+      candidates.add(defaultSdk);
+    }
+
+    for (Module module : ModuleManager.getInstance(project).getModules()) {
+      final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
+      if (sdk != null && sdk.getSdkType() instanceof JavaSdkType) {
+        candidates.add(sdk);
+      }
+    }
+
+    // now select the latest version from the sdks that are used in the project, but not older than the internal sdk version
+    final JavaSdk javaSdkType = JavaSdk.getInstance();
+    for (Sdk candidate : candidates) {
+      final String vs = candidate.getVersionString();
+      if (vs != null) {
+        final JavaSdkVersion candidateVersion = javaSdkType.getVersion(vs);
+        if (candidateVersion != null) {
+          final int candidateMinorVersion = getMinorVersion(vs);
+          if (projectJdk == null) {
+            sdkVersion = candidateVersion;
+            sdkMinorVersion = candidateMinorVersion;
+            projectJdk = candidate;
+          }
+          else {
+            final int result = candidateVersion.compareTo(sdkVersion);
+            if (result > 0 || (result == 0 && candidateMinorVersion > sdkMinorVersion)) {
+              sdkVersion = candidateVersion;
+              sdkMinorVersion = candidateMinorVersion;
+              projectJdk = candidate;
+            }
+          }
+        }
+      }
+    }
+
+    final Sdk internalJdk = JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk();
+    if (projectJdk == null || sdkVersion == null || !sdkVersion.isAtLeast(JavaSdkVersion.JDK_1_6)) {
+      projectJdk = internalJdk;
+      sdkVersion = javaSdkType.getVersion(internalJdk);
+    }
+    return Pair.create(projectJdk, sdkVersion);
+  }
+
   private Future<Pair<RequestFuture<PreloadedProcessMessageHandler>, OSProcessHandler>> launchPreloadedBuildProcess(final Project project, SequentialTaskExecutor projectTaskQueue) throws Exception {
     ensureListening();
 
@@ -953,52 +1008,11 @@ public class BuildManager implements ApplicationComponent{
 
     if (StringUtil.isEmptyOrSpaces(forcedCompiledJdkHome)) {
       // choosing sdk with which the build process should be run
-      Sdk projectJdk = null;
-      int sdkMinorVersion = 0;
-
-      final Set<Sdk> candidates = new HashSet<Sdk>();
-      final Sdk defaultSdk = ProjectRootManager.getInstance(project).getProjectSdk();
-      if (defaultSdk != null && defaultSdk.getSdkType() instanceof JavaSdkType) {
-        candidates.add(defaultSdk);
-      }
-
-      for (Module module : ModuleManager.getInstance(project).getModules()) {
-        final Sdk sdk = ModuleRootManager.getInstance(module).getSdk();
-        if (sdk != null && sdk.getSdkType() instanceof JavaSdkType) {
-          candidates.add(sdk);
-        }
-      }
-
-      // now select the latest version from the sdks that are used in the project, but not older than the internal sdk version
-      final JavaSdk javaSdkType = JavaSdk.getInstance();
-      for (Sdk candidate : candidates) {
-        final String vs = candidate.getVersionString();
-        if (vs != null) {
-          final JavaSdkVersion candidateVersion = javaSdkType.getVersion(vs);
-          if (candidateVersion != null) {
-            final int candidateMinorVersion = getMinorVersion(vs);
-            if (projectJdk == null) {
-              sdkVersion = candidateVersion;
-              sdkMinorVersion = candidateMinorVersion;
-              projectJdk = candidate;
-            }
-            else {
-              final int result = candidateVersion.compareTo(sdkVersion);
-              if (result > 0 || (result == 0 && candidateMinorVersion > sdkMinorVersion)) {
-                sdkVersion = candidateVersion;
-                sdkMinorVersion = candidateMinorVersion;
-                projectJdk = candidate;
-              }
-            }
-          }
-        }
-      }
+      final Pair<Sdk, JavaSdkVersion> pair = getBuildProcessRuntimeSdk(project);
+      final Sdk projectJdk = pair.first;
+      sdkVersion = pair.second;
 
       final Sdk internalJdk = JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk();
-      if (projectJdk == null || sdkVersion == null || !sdkVersion.isAtLeast(JavaSdkVersion.JDK_1_6)) {
-        projectJdk = internalJdk;
-      }
-
       // validate tools.jar presence
       final JavaSdkType projectJdkType = (JavaSdkType)projectJdk.getSdkType();
       if (FileUtil.pathsEqual(projectJdk.getHomePath(), internalJdk.getHomePath())) {
@@ -1443,6 +1457,7 @@ public class BuildManager implements ApplicationComponent{
 
     @Override
     public void projectOpened(final Project project) {
+      if (ApplicationManager.getApplication().isUnitTestMode()) return;
       final MessageBusConnection conn = project.getMessageBus().connect();
       myConnections.put(project, conn);
       conn.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {
index 22fd6c6527efcaf32a5c0b644f7f5185f8ae9073..74ad7cfae9b1f4f0b9dc266773839e559aeff7e7 100644 (file)
@@ -22,6 +22,7 @@ package com.intellij.compiler;
 import com.intellij.openapi.components.*;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.registry.Registry;
 import com.intellij.util.xmlb.XmlSerializerUtil;
 
 @State(
@@ -60,6 +61,6 @@ public class CompilerWorkspaceConfiguration implements PersistentStateComponent<
   }
 
   public boolean allowAutoMakeWhileRunningApplication() {
-    return false;/*ALLOW_AUTOMAKE_WHILE_RUNNING_APPLICATION*/
+    return Registry.is("compiler.automake.allow.when.app.running", false);/*ALLOW_AUTOMAKE_WHILE_RUNNING_APPLICATION*/
   }
 }
index a18ddacc54f07f061130a49593b235a26dbab319..d9f4692e2124ef8b2002a5bc6b139d0b220d8050 100644 (file)
     <orderEntry type="module" module-name="xdebugger-impl" />
     <orderEntry type="module" module-name="lang-api" />
     <orderEntry type="module" module-name="compiler-openapi" />
+    <orderEntry type="module" module-name="compiler-impl" />
     <orderEntry type="module" module-name="java-runtime" />
     <orderEntry type="module" module-name="jsp-openapi" />
     <orderEntry type="module" module-name="java-impl" />
     <orderEntry type="module" module-name="platform-impl" />
     <orderEntry type="module" module-name="util" />
     <orderEntry type="module" module-name="diff-api" />
+    <orderEntry type="module" module-name="jps-builders" />
   </component>
   <component name="copyright">
     <Base>
index f39eb4b336fdf7ac10e2a5ed8a4bcb100fc6bf37..e917fb2a1df77f5552839c0ecb47c8a9801ae996 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,13 +21,9 @@ import com.intellij.debugger.engine.BasicStepMethodFilter;
 import com.intellij.debugger.engine.LambdaMethodFilter;
 import com.intellij.debugger.engine.MethodFilter;
 import com.intellij.debugger.impl.DebuggerSession;
-import com.intellij.openapi.actionSystem.ActionManager;
-import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.extensions.ExtensionPointName;
 import com.intellij.openapi.fileEditor.TextEditor;
-import com.intellij.openapi.keymap.KeymapUtil;
-import com.intellij.openapi.ui.popup.ListPopup;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiMethod;
 import com.intellij.ui.awt.RelativePoint;
@@ -38,10 +34,8 @@ import com.intellij.xdebugger.impl.ui.DebuggerUIUtil;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
-import javax.swing.*;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
-import java.awt.event.ActionEvent;
 import java.util.Collections;
 import java.util.List;
 
@@ -78,27 +72,9 @@ public abstract class JvmSmartStepIntoHandler {
             session.stepInto(true, createMethodFilter(chosenTarget));
           }
         });
-        final ListPopup popup = new ListPopupImpl(popupStep) {
-          @Override
-          protected JComponent createContent() {
-            registerExtraHandleShortcuts(XDebuggerActions.STEP_INTO);
-            registerExtraHandleShortcuts(XDebuggerActions.SMART_STEP_INTO);
-            return super.createContent();
-          }
-
-          private void registerExtraHandleShortcuts(String actionName) {
-            AnAction action = ActionManager.getInstance().getAction(actionName);
-            KeyStroke stroke = KeymapUtil.getKeyStroke(action.getShortcutSet());
-            if (stroke != null) {
-              registerAction("handleSelection " + stroke, stroke, new AbstractAction() {
-                @Override
-                public void actionPerformed(ActionEvent e) {
-                  handleSelect(true);
-                }
-              });
-            }
-          }
-        };
+        ListPopupImpl popup = new ListPopupImpl(popupStep);
+        DebuggerUIUtil.registerExtraHandleShortcuts(popup, XDebuggerActions.STEP_INTO);
+        DebuggerUIUtil.registerExtraHandleShortcuts(popup, XDebuggerActions.SMART_STEP_INTO);
         popup.addListSelectionListener(new ListSelectionListener() {
           public void valueChanged(ListSelectionEvent e) {
             popupStep.getScopeHighlighter().dropHighlight();
index 0f1fb88734a14c4341f2ba17eede8537c39db4e0..85d181a4b20bc91f8d42bd4d0f46b3334fac5335 100644 (file)
@@ -475,7 +475,8 @@ public class JVMNameUtil {
   }
 
   @Nullable
-  public static String getClassVMName(PsiClass containingClass) {
+  public static String getClassVMName(@Nullable PsiClass containingClass) {
+    if (containingClass == null) return null;
     if (containingClass instanceof PsiAnonymousClass) {
       return getClassVMName(PsiTreeUtil.getParentOfType(containingClass, PsiClass.class)) +
              JavaAnonymousClassesHelper.getName((PsiAnonymousClass)containingClass);
index da915026b9d3acec9fc0eccc4ddfbf2f02622d7b..bdf2bfce2bcba098037e6b05f9e3cab449bd370c 100644 (file)
@@ -35,6 +35,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.search.FilenameIndex;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.Function;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.EmptyIterable;
 import com.intellij.xdebugger.impl.ui.ExecutionPointHighlighter;
@@ -179,25 +180,21 @@ public class PositionManagerImpl implements PositionManager, MultiRequestPositio
     SourcePosition sourcePosition = SourcePosition.createFromLine(psiFile, lineNumber);
     int lambdaOrdinal = -1;
     if (LambdaMethodFilter.isLambdaName(method.name())) {
-      List<Location> lambdas = ContainerUtil.filter(locationsOfLine(location.declaringType(), sourcePosition), new Condition<Location>() {
-        @Override
-        public boolean value(Location location) {
-          return LambdaMethodFilter.isLambdaName(location.method().name());
-        }
-      });
-      if (lambdas.size() > 1) {
-        Collections.sort(lambdas, new Comparator<Location>() {
+      Set<Method> lambdas =
+        ContainerUtil.map2SetNotNull(locationsOfLine(location.declaringType(), sourcePosition), new Function<Location, Method>() {
           @Override
-          public int compare(Location o1, Location o2) {
-            return LambdaMethodFilter.getLambdaOrdinal(o1.method().name()) - LambdaMethodFilter.getLambdaOrdinal(o2.method().name());
-          }
-        });
-        lambdaOrdinal = ContainerUtil.indexOf(lambdas, new Condition<Location>() {
-          @Override
-          public boolean value(Location location) {
-            return location.method().equals(method);
+          public Method fun(Location location) {
+            Method method = location.method();
+            if (LambdaMethodFilter.isLambdaName(method.name())) {
+              return method;
+            }
+            return null;
           }
         });
+      if (lambdas.size() > 1) {
+        ArrayList<Method> lambdasList = new ArrayList<Method>(lambdas);
+        Collections.sort(lambdasList, DebuggerUtilsEx.LAMBDA_ORDINAL_COMPARATOR);
+        lambdaOrdinal = lambdasList.indexOf(method);
       }
     }
     return new JavaSourcePosition(sourcePosition, location.declaringType(), method, lambdaOrdinal);
index 8779d9f94b91b71bca22b8a4a4dbe6b5928f7a02..cab3811be6876c3ac9c5674df658a5e3f60116ac 100644 (file)
@@ -720,17 +720,12 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
             myResult = new FieldEvaluator(new TypeEvaluator(typeName), FieldEvaluator.createClassFilter(psiClass), name);
           }
           else {
-            PsiType type = qualifier.getType();
-            if(type == null) {
-              throwEvaluateException(DebuggerBundle.message("evaluation.error.qualifier.type.unknown", qualifier.getText()));
-            }
-
             qualifier.accept(this);
             if (myResult == null) {
               throwEvaluateException(DebuggerBundle.message("evaluation.error.cannot.evaluate.qualifier", qualifier.getText()));
             }
 
-            myResult = new FieldEvaluator(myResult, FieldEvaluator.createClassFilter(type), name);
+            myResult = new FieldEvaluator(myResult, FieldEvaluator.createClassFilter(qualifier.getType()), name);
           }
         }
         else {
index 4e35754b52e6354942ef5aa4f0d22345be9decae..719b2a3cbab875b2ef2d2ae8e7f84fdb8e58e6b3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -36,6 +36,7 @@ import com.intellij.psi.PsiType;
 import com.intellij.psi.util.PsiUtil;
 import com.sun.jdi.*;
 import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 public class FieldEvaluator implements Evaluator {
@@ -60,8 +61,9 @@ public class FieldEvaluator implements Evaluator {
     myTargetClassFilter = filter;
   }
 
-  public static TargetClassFilter createClassFilter(PsiType psiType) {
-    if(psiType instanceof PsiArrayType) {
+  @NotNull
+  public static TargetClassFilter createClassFilter(@Nullable PsiType psiType) {
+    if(psiType == null || psiType instanceof PsiArrayType) {
       return TargetClassFilter.ALL;
     }
     PsiClass psiClass = PsiUtil.resolveClassInType(psiType);
index ce8a1dfe9a3da1f1f3bdce6565150e69e8987776..f139f137e1d14fa617c2bc20e88d798f3d169c1c 100644 (file)
@@ -24,6 +24,7 @@ import com.intellij.debugger.DebuggerBundle;
 import com.intellij.debugger.SourcePosition;
 import com.intellij.debugger.engine.DebuggerManagerThreadImpl;
 import com.intellij.debugger.engine.DebuggerUtils;
+import com.intellij.debugger.engine.LambdaMethodFilter;
 import com.intellij.debugger.engine.SuspendContextImpl;
 import com.intellij.debugger.engine.evaluation.*;
 import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilder;
@@ -874,4 +875,11 @@ public abstract class DebuggerUtilsEx extends DebuggerUtils {
     }
     return false;
   }
+
+  public static final Comparator<Method> LAMBDA_ORDINAL_COMPARATOR = new Comparator<Method>() {
+    @Override
+    public int compare(Method m1, Method m2) {
+      return LambdaMethodFilter.getLambdaOrdinal(m1.name()) - LambdaMethodFilter.getLambdaOrdinal(m2.name());
+    }
+  };
 }
index be538d33116d10b4a7109b165af0e174c4f3ddd9..ad56fc217ee9d5869af8898221cdc01cd98601ee 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.debugger.engine.DebugProcessImpl;
 import com.intellij.debugger.engine.LambdaMethodFilter;
 import com.intellij.debugger.engine.evaluation.EvaluateException;
 import com.intellij.debugger.engine.requests.RequestManagerImpl;
+import com.intellij.debugger.impl.DebuggerUtilsEx;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
 import com.sun.jdi.*;
@@ -79,11 +80,7 @@ public class StepIntoBreakpoint extends RunToCursorBreakpoint {
             final LambdaMethodFilter lambdaFilter = (LambdaMethodFilter)myFilter;
             if (lambdaFilter.getLambdaOrdinal() < methodsFound) {
               final Method[] candidates = methods.toArray(new Method[methodsFound]);
-              Arrays.sort(candidates, new Comparator<Method>() {
-                public int compare(Method m1, Method m2) {
-                  return LambdaMethodFilter.getLambdaOrdinal(m1.name()) - LambdaMethodFilter.getLambdaOrdinal(m2.name());
-                }
-              });
+              Arrays.sort(candidates, DebuggerUtilsEx.LAMBDA_ORDINAL_COMPARATOR);
               location = candidates[lambdaFilter.getLambdaOrdinal()].location();
             }
           }
index 5d4aaed71106412023d9964f8ff81c6bc1954543..a40a3ba71dc58a42ef8c1f6966a6bde7d80862e0 100644 (file)
@@ -37,15 +37,14 @@ import com.sun.jdi.ClassLoaderReference;
 import com.sun.jdi.ClassType;
 import com.sun.jdi.Value;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.jps.incremental.BinaryContent;
+import org.jetbrains.jps.javac.OutputFileObject;
 import org.jetbrains.org.objectweb.asm.ClassReader;
 import org.jetbrains.org.objectweb.asm.ClassVisitor;
 import org.jetbrains.org.objectweb.asm.ClassWriter;
 import org.jetbrains.org.objectweb.asm.Opcodes;
 
-import javax.tools.*;
-import java.io.ByteArrayOutputStream;
-import java.net.URI;
-import java.util.ArrayList;
 import java.util.Collection;
 
 /**
@@ -81,8 +80,7 @@ public abstract class CompilingEvaluator implements ExpressionEvaluator {
     ClassLoaderReference classLoader = ClassLoadingUtils.getClassLoader(evaluationContext, process);
 
     String version = ((VirtualMachineProxyImpl)process.getVirtualMachineProxy()).version();
-    JavaSdkVersion sdkVersion = JdkVersionUtil.getVersion(version);
-    Collection<OutputFileObject> classes = compile(sdkVersion != null ? sdkVersion.getDescription() : null);
+    Collection<OutputFileObject> classes = compile(JdkVersionUtil.getVersion(version));
 
     defineClasses(classes, evaluationContext, process, classLoader);
 
@@ -120,8 +118,11 @@ public abstract class CompilingEvaluator implements ExpressionEvaluator {
                                   ClassLoaderReference classLoader) throws EvaluateException {
     for (OutputFileObject cls : classes) {
       if (cls.getName().contains(GEN_CLASS_NAME)) {
-        byte[] bytes = changeSuperToMagicAccessor(cls.toByteArray());
-        ClassLoadingUtils.defineClass(cls.myOrigName, bytes, context, process, classLoader);
+        final BinaryContent content = cls.getContent();
+        if (content != null) {
+          byte[] bytes = changeSuperToMagicAccessor(content.toByteArray());
+          ClassLoadingUtils.defineClass(cls.getClassName(), bytes, context, process, classLoader);
+        }
       }
     }
     return (ClassType)process.findClass(context, getGenClassQName(), classLoader);
@@ -164,58 +165,6 @@ public abstract class CompilingEvaluator implements ExpressionEvaluator {
   ///////////////// Compiler stuff
 
   @NotNull
-  protected abstract Collection<OutputFileObject> compile(String target) throws EvaluateException;
-
-  private static URI getUri(String name, JavaFileObject.Kind kind) {
-    return URI.create("memo:///" + name.replace('.', '/') + kind.extension);
-  }
-
-  protected static class SourceFileObject extends SimpleJavaFileObject {
-    private final String myContent;
-
-    SourceFileObject(String name, Kind kind, String content) {
-      super(getUri(name, kind), kind);
-      myContent = content;
-    }
-
-    @Override
-    public CharSequence getCharContent(boolean ignore) {
-      return myContent;
-    }
-  }
-
-  protected static class OutputFileObject extends SimpleJavaFileObject {
-    private final ByteArrayOutputStream myStream = new ByteArrayOutputStream();
-    private final String myOrigName;
-
-    OutputFileObject(String name, Kind kind) {
-      super(getUri(name, kind), kind);
-      myOrigName = name;
-    }
-
-    byte[] toByteArray() {
-      return myStream.toByteArray();
-    }
-
-    @Override
-    public ByteArrayOutputStream openOutputStream() {
-      return myStream;
-    }
-  }
-
-  protected static class MemoryFileManager extends ForwardingJavaFileManager<StandardJavaFileManager> {
-    protected final Collection<OutputFileObject> classes = new ArrayList<OutputFileObject>();
-
-    MemoryFileManager(JavaCompiler compiler) {
-      super(compiler.getStandardFileManager(null, null, null));
-    }
-
-    @Override
-    public OutputFileObject getJavaFileForOutput(Location location, String name, JavaFileObject.Kind kind, FileObject source) {
-      OutputFileObject mc = new OutputFileObject(name, kind);
-      classes.add(mc);
-      return mc;
-    }
-  }
+  protected abstract Collection<OutputFileObject> compile(@Nullable JavaSdkVersion debuggeeVersion) throws EvaluateException;
 
 }
index e7e2b8d62e5bb0a90ad967bfd3452f51a36c78c3..e7027c7fe8bf030fea80e7e2e3b13fd129b7a48f 100644 (file)
  */
 package com.intellij.debugger.ui.impl.watch;
 
+import com.intellij.compiler.server.BuildManager;
+import com.intellij.debugger.engine.DebugProcess;
+import com.intellij.debugger.engine.DebugProcessAdapter;
+import com.intellij.debugger.engine.DebugProcessImpl;
+import com.intellij.debugger.engine.DebuggerManagerThreadImpl;
 import com.intellij.debugger.engine.evaluation.EvaluateException;
+import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleUtilCore;
+import com.intellij.openapi.projectRoots.JavaSdkType;
+import com.intellij.openapi.projectRoots.JavaSdkVersion;
+import com.intellij.openapi.projectRoots.Sdk;
+import com.intellij.openapi.projectRoots.SdkTypeId;
 import com.intellij.openapi.roots.ModuleRootManager;
 import com.intellij.openapi.util.Computable;
-import com.intellij.openapi.util.SystemInfo;
+import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.util.io.FileUtil;
-import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.pom.java.LanguageLevel;
 import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiFile;
 import com.intellij.refactoring.extractMethodObject.ExtractLightMethodObjectHandler;
-import com.intellij.util.PathsList;
+import com.intellij.util.net.NetUtils;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+import org.jetbrains.jps.api.CanceledStatus;
+import org.jetbrains.jps.builders.impl.java.JavacCompilerTool;
+import org.jetbrains.jps.javac.DiagnosticOutputConsumer;
+import org.jetbrains.jps.javac.ExternalJavacManager;
+import org.jetbrains.jps.javac.OutputFileConsumer;
+import org.jetbrains.jps.javac.OutputFileObject;
 
-import javax.tools.*;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
+import javax.tools.Diagnostic;
+import javax.tools.JavaFileObject;
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
 
+// todo: consider batching compilations in order not to start a separate process for every class that needs to be compiled
 public class CompilingEvaluatorImpl extends CompilingEvaluator {
 
-  public CompilingEvaluatorImpl(@NotNull PsiElement context, @NotNull ExtractLightMethodObjectHandler.ExtractedData data) {
+  private final EvaluationContextImpl myEvaluationContext;
+
+  public CompilingEvaluatorImpl(EvaluationContextImpl evaluationContext, @NotNull PsiElement context, @NotNull ExtractLightMethodObjectHandler.ExtractedData data) {
     super(context, data);
+    myEvaluationContext = evaluationContext;
   }
 
   @Override
   @NotNull
-  protected Collection<OutputFileObject> compile(String target) throws EvaluateException {
-    if (!SystemInfo.isJavaVersionAtLeast(target)) {
-      throw new EvaluateException("Unable to compile for target level " + target + ". Need to run IDEA on java version at least " + target + ", currently running on " + SystemInfo.JAVA_RUNTIME_VERSION);
-    }
-    JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
-    MemoryFileManager manager = new MemoryFileManager(compiler);
-    DiagnosticCollector<JavaFileObject> diagnostic = new DiagnosticCollector<JavaFileObject>();
-    Module module = ApplicationManager.getApplication().runReadAction(new Computable<Module>() {
+  protected Collection<OutputFileObject> compile(@Nullable JavaSdkVersion debuggeeVersion) throws EvaluateException {
+    final Pair<Sdk, JavaSdkVersion> runtime = BuildManager.getBuildProcessRuntimeSdk(myEvaluationContext.getProject());
+    final Module module = ApplicationManager.getApplication().runReadAction(new Computable<Module>() {
       @Override
       public Module compute() {
         return ModuleUtilCore.findModuleForPsiElement(myPsiContext);
       }
     });
-    List<String> options = new ArrayList<String>();
+    String javaHome = null;
+    final Sdk sdk = runtime.getFirst();
+    final SdkTypeId type = sdk.getSdkType();
+    if (type instanceof JavaSdkType) {
+      javaHome = sdk.getHomePath();
+    }
+    if (javaHome == null) {
+      throw new EvaluateException("Was not able to determine JDK for current evaluation context");
+    }
+    final List<String> options = new ArrayList<String>();
+    options.add("-proc:none"); // for our purposes annotation processing is not needed
+    options.add("-encoding");
+    options.add("UTF-8");
+    final List<File> platformClasspath = new ArrayList<File>();
+    final List<File> classpath = new ArrayList<File>();
     if (module != null) {
-      options.add("-cp");
-      PathsList cp = ModuleRootManager.getInstance(module).orderEntries().compileOnly().recursively().exportedOnly().withoutSdk().getPathsList();
-      options.add(cp.getPathsString());
+      final ModuleRootManager rootManager = ModuleRootManager.getInstance(module);
+      rootManager.orderEntries().compileOnly().recursively().exportedOnly().withoutSdk().getPathsList().addAllFiles(classpath);
+      rootManager.orderEntries().compileOnly().sdkOnly().getPathsList().addAllFiles(platformClasspath);
     }
-    if (!StringUtil.isEmpty(target)) {
+
+    final JavaSdkVersion buildRuntimeVersion = runtime.getSecond();
+    // if compiler or debuggee version or both are unknown, let source and target be the compiler's defaults
+    if (buildRuntimeVersion != null && debuggeeVersion != null) {
+      final JavaSdkVersion minVersion = buildRuntimeVersion.ordinal() > debuggeeVersion.ordinal() ? debuggeeVersion : buildRuntimeVersion;
+      final String sourceOption = getSourceOption(minVersion.getMaxLanguageLevel());
       options.add("-source");
-      options.add(target);
+      options.add(sourceOption);
       options.add("-target");
-      options.add(target);
+      options.add(sourceOption);
     }
+
+    File sourceFile = null;
+    final OutputCollector outputSink = new OutputCollector();
     try {
-      if (!compiler.getTask(null,
-                            manager,
-                            diagnostic,
-                            options,
-                            null,
-                            Collections.singletonList(new SourceFileObject(getMainClassName(), JavaFileObject.Kind.SOURCE, getClassCode()))
-      ).call()) {
-        StringBuilder res = new StringBuilder("Compilation failed:\n");
+      final ExternalJavacManager javacManager = getJavacManager();
+      if (javacManager == null) {
+        throw new EvaluateException("Cannot compile java code");
+      }
+      sourceFile = generateTempSourceFile(javacManager.getWorkingDir());
+      final File srcDir = sourceFile.getParentFile();
+      final Map<File, Set<File>> output = Collections.singletonMap(srcDir, Collections.singleton(srcDir));
+      DiagnosticCollector diagnostic = new DiagnosticCollector();
+      final List<String> vmOptions = Collections.emptyList();
+      final List<File> sourcePath = Collections.emptyList();
+      final Set<File> sources = Collections.singleton(sourceFile);
+      boolean compiledOK = javacManager.forkJavac(
+        javaHome, -1, vmOptions, options, platformClasspath, classpath, sourcePath, sources, output, diagnostic, outputSink, new JavacCompilerTool(), CanceledStatus.NULL
+      );
+
+      if (!compiledOK) {
+        final StringBuilder res = new StringBuilder("Compilation failed:\n");
         for (Diagnostic<? extends JavaFileObject> d : diagnostic.getDiagnostics()) {
-          res.append(d);
+          if (d.getKind() == Diagnostic.Kind.ERROR) {
+            res.append(d.getMessage(Locale.US));
+          }
         }
         throw new EvaluateException(res.toString());
       }
     }
+    catch (EvaluateException e) {
+      throw e;
+    }
     catch (Exception e) {
       throw new EvaluateException(e.getMessage());
     }
-    return manager.classes;
+    finally {
+      if (sourceFile != null) {
+        FileUtil.delete(sourceFile);
+      }
+    }
+    return outputSink.getCompiledClasses();
   }
 
-  protected String getClassCode() {
-    return ApplicationManager.getApplication().runReadAction(new Computable<String>() {
+  @NotNull
+  private static String getSourceOption(@NotNull LanguageLevel languageLevel) {
+    return "1." + Integer.valueOf(3 + languageLevel.ordinal());
+  }
+
+  private File generateTempSourceFile(File workingDir) throws IOException {
+    final Pair<String, String> fileData = ApplicationManager.getApplication().runReadAction(new Computable<Pair<String, String>>() {
       @Override
-      public String compute() {
-        return myData.getGeneratedInnerClass().getContainingFile().getText();
+      public Pair<String, String> compute() {
+        final PsiFile file = myData.getGeneratedInnerClass().getContainingFile();
+        return Pair.create(file.getName(), file.getText());
       }
     });
+    if (fileData.first == null) {
+      throw new IOException("Class file name not specified");
+    }
+    if (fileData.second == null) {
+      throw new IOException("Class source code not specified");
+    }
+    final File file = new File(workingDir, "src/"+fileData.first);
+    FileUtil.writeToFile(file, fileData.second);
+    return file;
   }
 
-  protected String getMainClassName() {
-    return ApplicationManager.getApplication().runReadAction(new Computable<String>() {
-      @Override
-      public String compute() {
-        return FileUtil.getNameWithoutExtension(myData.getGeneratedInnerClass().getContainingFile().getName());
+  private static final Key<ExternalJavacManager> JAVAC_MANAGER_KEY = Key.create("_external_java_compiler_manager_");
+
+  @Nullable
+  private ExternalJavacManager getJavacManager() throws IOException {
+    // need dedicated thread access to be able to cache the manager in the user data
+    DebuggerManagerThreadImpl.assertIsManagerThread();
+
+    final DebugProcessImpl debugProcess = myEvaluationContext.getDebugProcess();
+    ExternalJavacManager manager = JAVAC_MANAGER_KEY.get(debugProcess);
+    if (manager == null && debugProcess.isAttached()) {
+      final File compilerWorkingDir = getCompilerWorkingDir();
+      if (compilerWorkingDir == null) {
+        return null; // should not happen for real projects
       }
-    });
+      final int listenPort = NetUtils.findAvailableSocketPort();
+      manager = new ExternalJavacManager(compilerWorkingDir);
+      manager.start(listenPort);
+      final ExternalJavacManager _manager = manager;
+      debugProcess.addDebugProcessListener(new DebugProcessAdapter() {
+        public void processDetached(DebugProcess process, boolean closedByUser) {
+          if (process == debugProcess) {
+            _manager.stop();
+          }
+        }
+      });
+      JAVAC_MANAGER_KEY.set(debugProcess, manager);
+    }
+    return manager;
+  }
+
+  @Nullable
+  private File getCompilerWorkingDir() {
+    final File projectBuildDir = BuildManager.getInstance().getProjectSystemDirectory(myEvaluationContext.getProject());
+    if (projectBuildDir == null) {
+      return null;
+    }
+    final File root = new File(projectBuildDir, "debugger");
+    root.mkdirs();
+    return root;
+  }
+
+  private static class DiagnosticCollector implements DiagnosticOutputConsumer {
+    private final List<Diagnostic<? extends JavaFileObject>> myDiagnostics = new ArrayList<Diagnostic<? extends JavaFileObject>>();
+    public void outputLineAvailable(String line) {
+      // for debugging purposes uncomment this line
+      //System.out.println(line);
+    }
+
+    public void registerImports(String className, Collection<String> imports, Collection<String> staticImports) {
+      // ignore
+    }
+
+    public void javaFileLoaded(File file) {
+      // ignore
+    }
+
+    public void report(Diagnostic<? extends JavaFileObject> diagnostic) {
+      myDiagnostics.add(diagnostic);
+    }
+
+    public List<Diagnostic<? extends JavaFileObject>> getDiagnostics() {
+      return myDiagnostics;
+    }
+  }
+
+  private static class OutputCollector implements OutputFileConsumer {
+    private List<OutputFileObject> myClasses = new ArrayList<OutputFileObject>();
+
+    public void save(@NotNull OutputFileObject fileObject) {
+      myClasses.add(fileObject);
+    }
+
+    public List<OutputFileObject> getCompiledClasses() {
+      return myClasses;
+    }
   }
 }
index 3695d0c462b0fd6c36243230011898a3fb2e57c8..df04d5a53eff58f9716b81038eacc076daf1fe9f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -34,6 +34,7 @@ import com.intellij.util.IncorrectOperationException;
 import com.sun.jdi.ObjectReference;
 import com.sun.jdi.ReferenceType;
 import com.sun.jdi.Value;
+import org.jetbrains.annotations.Nullable;
 
 /**
  * User: lex
@@ -147,8 +148,10 @@ public class DebuggerTreeNodeExpression {
       return false;
     }
 
-  public static PsiExpression substituteThis(PsiExpression expressionWithThis, PsiExpression howToEvaluateThis, Value howToEvaluateThisValue)
+  @Nullable
+  public static PsiExpression substituteThis(@Nullable PsiExpression expressionWithThis, PsiExpression howToEvaluateThis, Value howToEvaluateThisValue)
     throws EvaluateException {
+    if (expressionWithThis == null) return null;
     PsiExpression result = (PsiExpression)expressionWithThis.copy();
 
     PsiClass thisClass = PsiTreeUtil.getContextOfType(result, PsiClass.class, true);
index 62c6d225dcfec6e3b78f81be1e5cdee9c928c7cc..620424e34457b47c7ddcf7f4cc02c2ff222903fc 100644 (file)
@@ -99,7 +99,7 @@ public abstract class EvaluationDescriptor extends ValueDescriptorImpl{
                 ExtractLightMethodObjectHandler.ExtractedData data = ExtractLightMethodObjectHandler.extractLightMethodObject(myProject,
                                                                      psiFile, fragment, CompilingEvaluator.getGeneratedClassName());
                 if (data != null) {
-                  return new CompilingEvaluatorImpl(psiContext, data);
+                  return new CompilingEvaluatorImpl(evaluationContext, psiContext, data);
                 }
               }
               catch (PrepareFailedException e) {
index f33e37c9f289a88384c26169f54e5a79c6b8b04b..b96c409ef4f142cbce521a7d5f9b766600f80940 100644 (file)
@@ -34,4 +34,11 @@ public class JavaLineBreakpointProperties extends JavaBreakpointProperties<JavaL
   public void setLambdaOrdinal(Integer lambdaOrdinal) {
     myLambdaOrdinal = lambdaOrdinal;
   }
+
+  @Override
+  public void loadState(JavaLineBreakpointProperties state) {
+    super.loadState(state);
+
+    myLambdaOrdinal = state.myLambdaOrdinal;
+  }
 }
index 827fd3f2dfd7fff4365eed5b03a24608b757ef14..7ce1975f1858e877c99fa19b383b84d5a5ade694 100644 (file)
@@ -25,11 +25,11 @@ import com.intellij.execution.runners.ExecutionEnvironment;
 import com.intellij.execution.testframework.*;
 import com.intellij.execution.testframework.actions.AbstractRerunFailedTestsAction;
 import com.intellij.execution.testframework.sm.SMTestRunnerConnectionUtil;
+import com.intellij.execution.testframework.sm.runner.SMRunnerConsolePropertiesProvider;
 import com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties;
 import com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView;
 import com.intellij.execution.testframework.sm.runner.ui.SMTestRunnerResultsForm;
 import com.intellij.execution.testframework.ui.BaseTestsOutputConsoleView;
-import com.intellij.execution.ui.ConsoleView;
 import com.intellij.execution.util.JavaParametersUtil;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.Extensions;
@@ -57,7 +57,6 @@ import com.intellij.psi.search.GlobalSearchScopesCore;
 import com.intellij.rt.execution.CommandLineWrapper;
 import com.intellij.util.PathUtil;
 import com.intellij.util.ui.UIUtil;
-import jetbrains.buildServer.messages.serviceMessages.ServiceMessageTypes;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.jps.model.serialization.PathMacroUtil;
@@ -69,7 +68,7 @@ import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.util.Locale;
 
-public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfiguration<JavaRunConfigurationModule> & CommonJavaRunConfigurationParameters> extends JavaCommandLineState {
+public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfiguration<JavaRunConfigurationModule> & CommonJavaRunConfigurationParameters & SMRunnerConsolePropertiesProvider> extends JavaCommandLineState {
   private static final Logger LOG = Logger.getInstance("#" + JavaTestFrameworkRunnableState.class.getName());
   protected ServerSocket myServerSocket;
   protected File myTempFile;
@@ -84,8 +83,6 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
 
   protected abstract void passTempFile(ParametersList parametersList, String tempFilePath);
 
-  @NotNull protected abstract AbstractRerunFailedTestsAction createRerunFailedTestsAction(TestConsoleProperties testConsoleProperties, ConsoleView consoleView);
-
   @NotNull protected abstract T getConfiguration();
 
   @Nullable protected abstract TestSearchScope getScope();
@@ -94,8 +91,6 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
 
   @NotNull protected abstract OSProcessHandler createHandler(Executor executor) throws ExecutionException;
 
-  @NotNull protected abstract SMTRunnerConsoleProperties createTestConsoleProperties(Executor executor);
-
   public SearchForTestsTask createSearchingForTestsTask() {
     return null;
   }
@@ -109,14 +104,13 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
       return null;
     }
     getJavaParameters().getVMParametersList().addProperty("idea." + getFrameworkId() + ".sm_runner");
-    getJavaParameters().getClassPath().addFirst(PathUtil.getJarPathForClass(ServiceMessageTypes.class));
 
     final RunnerSettings runnerSettings = getRunnerSettings();
 
-    final TestConsoleProperties testConsoleProperties = createTestConsoleProperties(executor);
+    final SMTRunnerConsoleProperties testConsoleProperties = getConfiguration().createTestConsoleProperties(executor);
     testConsoleProperties.setIfUndefined(TestConsoleProperties.HIDE_PASSED_TESTS, false);
 
-    final BaseTestsOutputConsoleView consoleView = SMTestRunnerConnectionUtil.createConsole(getFrameworkName(), testConsoleProperties, getEnvironment());
+    final BaseTestsOutputConsoleView consoleView = SMTestRunnerConnectionUtil.createConsole(getFrameworkName(), testConsoleProperties);
     final SMTestRunnerResultsForm viewer = ((SMTRunnerConsoleView)consoleView).getResultsViewer();
     Disposer.register(getConfiguration().getProject(), consoleView);
 
@@ -144,7 +138,8 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
       }
     });
 
-    AbstractRerunFailedTestsAction rerunFailedTestsAction = createRerunFailedTestsAction(testConsoleProperties, consoleView);
+    AbstractRerunFailedTestsAction rerunFailedTestsAction = testConsoleProperties.createRerunFailedTestsAction(consoleView);
+    LOG.assertTrue(rerunFailedTestsAction != null);
     rerunFailedTestsAction.setModelProvider(new Getter<TestFrameworkRunningModel>() {
       @Override
       public TestFrameworkRunningModel get() {
index 0b83da74e9f593c1c8f32803c42348c591c04475..162e166696be75dd41a5edae371ad745fd7ce2f7 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.ide.util.projectWizard.ProjectBuilder;
 import com.intellij.ide.util.projectWizard.WizardContext;
 import com.intellij.ide.wizard.AbstractWizard;
 import com.intellij.ide.wizard.CommitStepException;
+import com.intellij.openapi.Disposable;
 import com.intellij.openapi.components.StorageScheme;
 import com.intellij.openapi.options.ConfigurationException;
 import com.intellij.openapi.project.Project;
@@ -50,12 +51,12 @@ public abstract class AbstractProjectWizard extends AbstractWizard<ModuleWizardS
 
   public AbstractProjectWizard(String title, Project project, String defaultPath) {
     super(title, project);
-    myWizardContext = initContext(project, defaultPath);
+    myWizardContext = initContext(project, defaultPath, getDisposable());
   }
 
   public AbstractProjectWizard(String title, Project project, Component dialogParent) {
     super(title, dialogParent);
-    myWizardContext = initContext(project, null);
+    myWizardContext = initContext(project, null, getDisposable());
   }
 
   @Override
@@ -68,8 +69,8 @@ public abstract class AbstractProjectWizard extends AbstractWizard<ModuleWizardS
 
   public abstract StepSequence getSequence();
 
-  private static WizardContext initContext(@Nullable Project project, @Nullable String defaultPath) {
-    WizardContext context = new WizardContext(project);
+  private static WizardContext initContext(@Nullable Project project, @Nullable String defaultPath, Disposable parentDisposable) {
+    WizardContext context = new WizardContext(project, parentDisposable);
     if (defaultPath != null) {
       context.setProjectFileDirectory(defaultPath);
       context.setProjectName(defaultPath.substring(FileUtil.toSystemIndependentName(defaultPath).lastIndexOf("/") + 1));
index a10265607029f332459fc5c3790389fbe7be5560..31cad7748450baaf65e0c99494d269f3a890e91b 100644 (file)
@@ -332,7 +332,7 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
     return myName;
   }
 
-  private class ModifiableRootModelInvocationHandler implements InvocationHandler {
+  private class ModifiableRootModelInvocationHandler implements InvocationHandler, ProxyDelegateAccessor {
     private final ModifiableRootModel myDelegateModel;
     @NonNls private final Set<String> myCheckedNames = new HashSet<String>(
       Arrays.asList("addOrderEntry", "addLibraryEntry", "addInvalidLibrary", "addModuleOrderEntry", "addInvalidModuleEntry",
@@ -362,6 +362,11 @@ public abstract class ModuleEditor implements Place.Navigator, Disposable {
         }
       }
     }
+
+    @Override
+    public Object getDelegate() {
+      return myDelegateModel;
+    }
   }
 
   private class LibraryTableInvocationHandler implements InvocationHandler, ProxyDelegateAccessor {
index 2936d2426a7267840af57aae9b2c0492373ab2b4..c056140d921d94bc38e61e2ac1291c4d0f77805e 100644 (file)
@@ -272,6 +272,7 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
     actionGroup.add(myEditButton);
     actionGroup.add(myRemoveButton);
     actionGroup.add(navigateAction);
+    actionGroup.add(new InlineModuleDependencyAction(this));
     actionGroup.add(new MyFindUsagesAction());
     actionGroup.add(new AnalyzeDependencyAction());
     addChangeLibraryLevelAction(actionGroup, LibraryTablesRegistrar.PROJECT_LEVEL);
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/InlineModuleDependencyAction.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/InlineModuleDependencyAction.java
new file mode 100644 (file)
index 0000000..7f63e57
--- /dev/null
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.openapi.roots.ui.configuration.classpath;
+
+import com.intellij.openapi.actionSystem.AnAction;
+import com.intellij.openapi.actionSystem.AnActionEvent;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.module.Module;
+import com.intellij.openapi.roots.*;
+import com.intellij.openapi.roots.impl.ClonableOrderEntry;
+import com.intellij.openapi.roots.impl.OrderEntryUtil;
+import com.intellij.openapi.roots.impl.ProjectRootManagerImpl;
+import com.intellij.openapi.roots.impl.RootModelImpl;
+import com.intellij.openapi.roots.ui.configuration.ModuleEditor;
+import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
+import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;
+import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ModuleProjectStructureElement;
+import com.intellij.openapi.vfs.pointers.VirtualFilePointerManager;
+
+import java.lang.reflect.Proxy;
+
+/**
+ * @author nik
+ */
+public class InlineModuleDependencyAction extends AnAction {
+  private static final Logger LOG = Logger.getInstance(InlineModuleDependencyAction.class);
+  private final ClasspathPanelImpl myClasspathPanel;
+
+  public InlineModuleDependencyAction(ClasspathPanelImpl classpathPanel) {
+    super("Inline Module Dependency", "Replace dependency on a module without source roots by the list of its dependencies", null);
+    myClasspathPanel = classpathPanel;
+  }
+
+  @Override
+  public void actionPerformed(AnActionEvent e) {
+    OrderEntry selectedEntry = myClasspathPanel.getSelectedEntry();
+    if (!(selectedEntry instanceof ModuleOrderEntry)) return;
+
+    ModuleOrderEntry entryToInline = (ModuleOrderEntry)selectedEntry;
+    Module module = entryToInline.getModule();
+    if (module == null) return;
+
+    ModifiableRootModel model = myClasspathPanel.getRootModel();
+    int toInlineIndex = findModuleEntryIndex(model, module);
+    if (toInlineIndex == -1) return;
+
+    model.removeOrderEntry(entryToInline);
+
+    RootModelImpl modelImpl;
+    if (Proxy.isProxyClass(model.getClass())) {
+      modelImpl = (RootModelImpl)((ModuleEditor.ProxyDelegateAccessor)Proxy.getInvocationHandler(model)).getDelegate();
+    }
+    else {
+      modelImpl = (RootModelImpl)model;
+    }
+    int addedCount = 0;
+    ModuleRootModel otherModel = myClasspathPanel.getModuleConfigurationState().getModulesProvider().getRootModel(module);
+    ProjectRootManagerImpl rootManager = ProjectRootManagerImpl.getInstanceImpl(myClasspathPanel.getProject());
+    VirtualFilePointerManager virtualFilePointerManager = VirtualFilePointerManager.getInstance();
+    for (OrderEntry entry : otherModel.getOrderEntries()) {
+      if (entry instanceof LibraryOrderEntry || entry instanceof ModuleOrderEntry) {
+        LOG.assertTrue(entry instanceof ClonableOrderEntry, entry);
+        ExportableOrderEntry entryToCopy = (ExportableOrderEntry)entry;
+        ExportableOrderEntry cloned = (ExportableOrderEntry)((ClonableOrderEntry)entry).cloneEntry(modelImpl, rootManager, virtualFilePointerManager);
+        cloned.setExported(entryToInline.isExported() && entryToCopy.isExported());
+        cloned.setScope(OrderEntryUtil.intersectScopes(entryToInline.getScope(), entryToCopy.getScope()));
+        model.addOrderEntry(cloned);
+        addedCount++;
+      }
+    }
+
+    OrderEntry[] oldEntries = model.getOrderEntries();
+    OrderEntry[] newEntries = new OrderEntry[oldEntries.length];
+    System.arraycopy(oldEntries, 0, newEntries, 0, toInlineIndex);
+    System.arraycopy(oldEntries, oldEntries.length - addedCount, newEntries, toInlineIndex, addedCount);
+    System.arraycopy(oldEntries, toInlineIndex, newEntries, toInlineIndex + addedCount, oldEntries.length - toInlineIndex - addedCount);
+    model.rearrangeOrderEntries(newEntries);
+
+    StructureConfigurableContext context = ProjectStructureConfigurable.getInstance(myClasspathPanel.getProject()).getContext();
+    context.getDaemonAnalyzer().queueUpdate(new ModuleProjectStructureElement(context, module));
+  }
+
+  private static int findModuleEntryIndex(ModifiableRootModel model, Module module) {
+    OrderEntry[] entries = model.getOrderEntries();
+    for (int i = 0; i < entries.length; i++) {
+      OrderEntry entry = entries[i];
+      if (entry instanceof ModuleOrderEntry && module.equals(((ModuleOrderEntry)entry).getModule())) {
+        return i;
+      }
+    }
+    return -1;
+  }
+
+  @Override
+  public void update(AnActionEvent e) {
+    e.getPresentation().setEnabledAndVisible(isEnabled());
+  }
+
+  private boolean isEnabled() {
+    OrderEntry entry = myClasspathPanel.getSelectedEntry();
+    if (!(entry instanceof ModuleOrderEntry)) return false;
+
+    Module module = ((ModuleOrderEntry)entry).getModule();
+    if (module == null) return false;
+
+    ModuleRootModel model = myClasspathPanel.getModuleConfigurationState().getModulesProvider().getRootModel(module);
+    return model.getSourceRootUrls().length == 0;
+  }
+}
index 5988f6960c8826ae7a162c61c154ecfb3f1082e7..dfa02a2cc9a0961aff95d23034e6d85653bc1c36 100644 (file)
@@ -53,7 +53,7 @@ class ManageProjectTemplatesDialog extends DialogWrapper {
     super(false);
     setTitle("Manage Project Templates");
     final ProjectTemplate[] templates =
-      new ArchivedTemplatesFactory().createTemplates(ProjectTemplatesFactory.CUSTOM_GROUP, new WizardContext(null));
+      new ArchivedTemplatesFactory().createTemplates(ProjectTemplatesFactory.CUSTOM_GROUP, new WizardContext(null, getDisposable()));
     myTemplatesList = new JBList(new CollectionListModel<ProjectTemplate>(Arrays.asList(templates)) {
       @Override
       public void remove(int index) {
index bf138c8433cdc394aaf1b8718cf46de027bc10e8..d8ada936be9352c692d227728f10416748000de1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -469,7 +469,7 @@ public class GenericsHighlightUtil {
               }
 
               if (isDefault || !isAbstract && superMethod.hasModifierProperty(PsiModifier.ABSTRACT)) {
-                final String message = isDefault
+                final String message = isDefault && !isAbstract
                                        ? " inherits unrelated defaults for "
                                        : " inherits abstract and default for ";
                 final String inheritUnrelatedDefaultsMessage = HighlightUtil.formatClass(aClass) +
@@ -912,18 +912,15 @@ public class GenericsHighlightUtil {
   }
 
   @Nullable
-  public static HighlightInfo checkOverrideAnnotation(PsiMethod method, final LanguageLevel languageLevel) {
-    PsiModifierList list = method.getModifierList();
-    final PsiAnnotation overrideAnnotation = list.findAnnotation("java.lang.Override");
-    if (overrideAnnotation == null) {
-      return null;
-    }
+  static HighlightInfo checkOverrideAnnotation(@NotNull PsiMethod method,
+                                               @NotNull PsiAnnotation overrideAnnotation,
+                                               @NotNull LanguageLevel languageLevel) {
     try {
       MethodSignatureBackedByPsiMethod superMethod = SuperMethodsSearch.search(method, null, true, false).findFirst();
       if (superMethod != null && method.getContainingClass().isInterface()) {
         final PsiMethod psiMethod = superMethod.getMethod();
         final PsiClass containingClass = psiMethod.getContainingClass();
-        if (containingClass != null && 
+        if (containingClass != null &&
             CommonClassNames.JAVA_LANG_OBJECT.equals(containingClass.getQualifiedName()) &&
             psiMethod.hasModifierProperty(PsiModifier.PROTECTED)) {
           superMethod = null;
index 6cba2e140fc8aa329028fbebf6d0efb253e6531e..621dc78e208e22a5aca81cfec42e5665c3042ea5 100644 (file)
@@ -569,12 +569,13 @@ public class HighlightMethodUtil {
 
   @Nullable
   static HighlightInfo checkAmbiguousMethodCallArguments(@NotNull PsiReferenceExpression referenceToMethod,
-                                                @NotNull JavaResolveResult[] resolveResults,
-                                                @NotNull PsiExpressionList list,
-                                                final PsiElement element,
-                                                @NotNull JavaResolveResult resolveResult,
-                                                @NotNull PsiMethodCallExpression methodCall,
-                                                @NotNull PsiResolveHelper resolveHelper) {
+                                                         @NotNull JavaResolveResult[] resolveResults,
+                                                         @NotNull PsiExpressionList list,
+                                                         final PsiElement element,
+                                                         @NotNull JavaResolveResult resolveResult,
+                                                         @NotNull PsiMethodCallExpression methodCall,
+                                                         @NotNull PsiResolveHelper resolveHelper, 
+                                                         @NotNull PsiElement elementToHighlight) {
     MethodCandidateInfo methodCandidate1 = null;
     MethodCandidateInfo methodCandidate2 = null;
     for (JavaResolveResult result : resolveResults) {
@@ -594,7 +595,6 @@ public class HighlightMethodUtil {
 
     String description;
     String toolTip;
-    PsiElement elementToHighlight;
     HighlightInfoType highlightInfoType = HighlightInfoType.ERROR;
     if (methodCandidate2 != null) {
       PsiMethod element1 = methodCandidate1.getElement();
@@ -617,7 +617,6 @@ public class HighlightMethodUtil {
       }
       description = JavaErrorMessages.message("ambiguous.method.call", m1, m2);
       toolTip = createAmbiguousMethodHtmlTooltip(new MethodCandidateInfo[]{methodCandidate1, methodCandidate2});
-      elementToHighlight = list;
     }
     else {
       if (element != null && !resolveResult.isAccessible()) {
@@ -632,9 +631,6 @@ public class HighlightMethodUtil {
         if (candidates.length == 0) {
           return null;
         }
-        else {
-          elementToHighlight = list;
-        }
       }
       toolTip = XmlStringUtil.escapeString(description);
     }
index b6dacbe717fb7595acaf9c0fe4e4501cca9a591b..dd29fa70d4051bf0c88fcbe60602fff1e7842ecc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -1019,89 +1019,90 @@ public class HighlightUtil extends HighlightUtilBase {
             parent instanceof PsiPrefixExpression &&
             ((PsiPrefixExpression)parent).getOperationTokenType() == JavaTokenType.MINUS)) {
         if (text.equals(PsiLiteralExpressionImpl.HEX_PREFIX)) {
-          final String message = JavaErrorMessages.message("hexadecimal.numbers.must.contain.at.least.one.hexadecimal.digit");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("hexadecimal.numbers.must.contain.at.least.one.hexadecimal.digit");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
         if (text.equals(PsiLiteralExpressionImpl.BIN_PREFIX)) {
-          final String message = JavaErrorMessages.message("binary.numbers.must.contain.at.least.one.hexadecimal.digit");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("binary.numbers.must.contain.at.least.one.hexadecimal.digit");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
         if (value == null || text.equals(PsiLiteralExpressionImpl._2_IN_31)) {
-          final String message = JavaErrorMessages.message("integer.number.too.large");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("integer.number.too.large");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
       }
     }
     else if (type == JavaTokenType.LONG_LITERAL) {
-      final String mText = text.endsWith("l") ? text.substring(0, text.length() - 1) : text;
+      String mText = text.endsWith("l") ? text.substring(0, text.length() - 1) : text;
       //literal 9223372036854775808L may appear only as the operand of the unary negation operator -.
       if (!(mText.equals(PsiLiteralExpressionImpl._2_IN_63) &&
             parent instanceof PsiPrefixExpression &&
             ((PsiPrefixExpression)parent).getOperationTokenType() == JavaTokenType.MINUS)) {
         if (mText.equals(PsiLiteralExpressionImpl.HEX_PREFIX)) {
-          final String message = JavaErrorMessages.message("hexadecimal.numbers.must.contain.at.least.one.hexadecimal.digit");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("hexadecimal.numbers.must.contain.at.least.one.hexadecimal.digit");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
         if (mText.equals(PsiLiteralExpressionImpl.BIN_PREFIX)) {
-          final String message = JavaErrorMessages.message("binary.numbers.must.contain.at.least.one.hexadecimal.digit");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("binary.numbers.must.contain.at.least.one.hexadecimal.digit");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
         if (value == null || mText.equals(PsiLiteralExpressionImpl._2_IN_63)) {
-          final String message = JavaErrorMessages.message("long.number.too.large");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("long.number.too.large");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
       }
     }
     else if (isFP) {
       if (value == null) {
-        final String message = JavaErrorMessages.message("malformed.floating.point.literal");
-          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+        String message = JavaErrorMessages.message("malformed.floating.point.literal");
+        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
       }
     }
     else if (type == JavaTokenType.CHARACTER_LITERAL) {
-      // todo[r.sh] clean this mess up
       if (value != null) {
         if (!StringUtil.endsWithChar(text, '\'')) {
-          final String message = JavaErrorMessages.message("unclosed.char.literal");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("unclosed.char.literal");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
       }
       else {
-        if (!StringUtil.startsWithChar(text, '\'')) return null;
+        if (!StringUtil.startsWithChar(text, '\'')) {
+          return null;
+        }
         if (StringUtil.endsWithChar(text, '\'')) {
           if (text.length() == 1) {
-            final String message = JavaErrorMessages.message("illegal.line.end.in.character.literal");
-              return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+            String message = JavaErrorMessages.message("illegal.line.end.in.character.literal");
+            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
           }
           text = text.substring(1, text.length() - 1);
         }
         else {
-          final String message = JavaErrorMessages.message("illegal.line.end.in.character.literal");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("illegal.line.end.in.character.literal");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
+
         StringBuilder chars = new StringBuilder();
-        final boolean success = PsiLiteralExpressionImpl.parseStringCharacters(text, chars, null);
+        boolean success = PsiLiteralExpressionImpl.parseStringCharacters(text, chars, null);
         if (!success) {
-          final String message = JavaErrorMessages.message("illegal.escape.character.in.character.literal");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("illegal.escape.character.in.character.literal");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
         int length = chars.length();
         if (length > 1) {
-          final String message = JavaErrorMessages.message("too.many.characters.in.character.literal");
-          final HighlightInfo info =
-            HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("too.many.characters.in.character.literal");
+          HighlightInfo info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
           QuickFixAction.registerQuickFixAction(info, QUICK_FIX_FACTORY.createConvertToStringLiteralAction());
           return info;
         }
         else if (length == 0) {
-          final String message = JavaErrorMessages.message("empty.character.literal");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("empty.character.literal");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
       }
     }
     else if (type == JavaTokenType.STRING_LITERAL) {
       if (value == null) {
-        for (final PsiElement element : expression.getChildren()) {
+        for (PsiElement element : expression.getChildren()) {
           if (element instanceof OuterLanguageElement) {
             return null;
           }
@@ -1110,44 +1111,45 @@ public class HighlightUtil extends HighlightUtilBase {
         if (!StringUtil.startsWithChar(text, '\"')) return null;
         if (StringUtil.endsWithChar(text, '\"')) {
           if (text.length() == 1) {
-            final String message = JavaErrorMessages.message("illegal.line.end.in.string.literal");
-              return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+            String message = JavaErrorMessages.message("illegal.line.end.in.string.literal");
+            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
           }
           text = text.substring(1, text.length() - 1);
         }
         else {
-          final String message = JavaErrorMessages.message("illegal.line.end.in.string.literal");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("illegal.line.end.in.string.literal");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
+
         StringBuilder chars = new StringBuilder();
         boolean success = PsiLiteralExpressionImpl.parseStringCharacters(text, chars, null);
         if (!success) {
-          final String message = JavaErrorMessages.message("illegal.escape.character.in.string.literal");
-            return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+          String message = JavaErrorMessages.message("illegal.escape.character.in.string.literal");
+          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
         }
       }
     }
 
     if (value instanceof Float) {
-      final Float number = (Float)value;
+      Float number = (Float)value;
       if (number.isInfinite()) {
-        final String message = JavaErrorMessages.message("floating.point.number.too.large");
-          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+        String message = JavaErrorMessages.message("floating.point.number.too.large");
+        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
       }
       if (number.floatValue() == 0 && !TypeConversionUtil.isFPZero(text)) {
-        final String message = JavaErrorMessages.message("floating.point.number.too.small");
-          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+        String message = JavaErrorMessages.message("floating.point.number.too.small");
+        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
       }
     }
     else if (value instanceof Double) {
-      final Double number = (Double)value;
+      Double number = (Double)value;
       if (number.isInfinite()) {
-        final String message = JavaErrorMessages.message("floating.point.number.too.large");
-          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+        String message = JavaErrorMessages.message("floating.point.number.too.large");
+        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
       }
       if (number.doubleValue() == 0 && !TypeConversionUtil.isFPZero(text)) {
-        final String message = JavaErrorMessages.message("floating.point.number.too.small");
-          return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
+        String message = JavaErrorMessages.message("floating.point.number.too.small");
+        return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(message).create();
       }
     }
 
@@ -1749,23 +1751,22 @@ public class HighlightUtil extends HighlightUtilBase {
   }
 
   @Nullable
-  static HighlightInfo checkExpressionRequired(@NotNull PsiReferenceExpression expression,
-                                               @NotNull JavaResolveResult resultForIncompleteCode) {
+  static HighlightInfo checkExpressionRequired(@NotNull PsiReferenceExpression expression, @NotNull JavaResolveResult resultForIncompleteCode) {
     if (expression.getNextSibling() instanceof PsiErrorElement) return null;
+
     PsiElement resolved = resultForIncompleteCode.getElement();
-    if (resolved == null) return null;
+    if (resolved == null || resolved instanceof PsiVariable) return null;
+
     PsiElement parent = expression.getParent();
     // String.class or String() are both correct
     if (parent instanceof PsiReferenceExpression || parent instanceof PsiMethodCallExpression) return null;
-    if (resolved instanceof PsiVariable) return null;
+
     String description = JavaErrorMessages.message("expression.expected");
-    final HighlightInfo info =
-      HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(description).create();
+    HighlightInfo info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(description).create();
     UnresolvedReferenceQuickFixProvider.registerReferenceFixes(expression, new QuickFixActionRegistrarImpl(info));
     return info;
   }
 
-
   @Nullable
   static HighlightInfo checkArrayInitializerApplicable(@NotNull PsiArrayInitializerExpression expression) {
     /*
@@ -1782,8 +1783,7 @@ public class HighlightUtil extends HighlightUtilBase {
     }
 
     String description = JavaErrorMessages.message("array.initializer.not.allowed");
-    HighlightInfo info =
-      HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(description).create();
+    HighlightInfo info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip(description).create();
     QuickFixAction.registerQuickFixAction(info, QUICK_FIX_FACTORY.createAddNewArrayExpressionFix(expression));
     return info;
   }
index 1357b90ec0cb0ab16f0a3bf9594ac4e823b9bc4d..6690d42f32b02d4c2bad1935cbf38f8502fb6cf6 100644 (file)
@@ -237,6 +237,13 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
     if (!myHolder.hasErrorResults()) myHolder.add(AnnotationsHighlightUtil.checkForeignInnerClassesUsed(annotation));
     if (!myHolder.hasErrorResults()) myHolder.add(AnnotationsHighlightUtil.checkFunctionalInterface(annotation, myLanguageLevel));
     if (!myHolder.hasErrorResults()) myHolder.add(AnnotationsHighlightUtil.checkRepeatableAnnotation(annotation));
+    if (CommonClassNames.JAVA_LANG_OVERRIDE.equals(annotation.getQualifiedName())) {
+      PsiAnnotationOwner owner = annotation.getOwner();
+      PsiElement parent = owner instanceof PsiModifierList ? ((PsiModifierList)owner).getParent() : null;
+      if (parent instanceof PsiMethod) {
+        myHolder.add(GenericsHighlightUtil.checkOverrideAnnotation((PsiMethod)parent, annotation, myLanguageLevel));
+      }
+    }
   }
 
   @Override
@@ -553,7 +560,9 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
             // this check is for fake expression from JspMethodCallImpl
             referenceExpression.getParent() == expression) {
           try {
-            myHolder.add(HighlightMethodUtil.checkAmbiguousMethodCallArguments(referenceExpression, results, list, resolved, result, expression, myResolveHelper));
+            if (PsiTreeUtil.findChildrenOfType(expression.getArgumentList(), PsiLambdaExpression.class).isEmpty()) {
+              myHolder.add(HighlightMethodUtil.checkAmbiguousMethodCallArguments(referenceExpression, results, list, resolved, result, expression, myResolveHelper, list));
+            }
           }
           catch (IndexNotReadyException ignored) {
           }
@@ -771,7 +780,6 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
     if (!myHolder.hasErrorResults()) myHolder.add(HighlightControlFlowUtil.checkUnreachableStatement(method.getBody()));
     if (!myHolder.hasErrorResults()) myHolder.add(HighlightMethodUtil.checkConstructorHandleSuperClassExceptions(method));
     if (!myHolder.hasErrorResults()) myHolder.add(HighlightMethodUtil.checkRecursiveConstructorInvocation(method));
-    if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkOverrideAnnotation(method, myLanguageLevel));
     if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkSafeVarargsAnnotation(method, myLanguageLevel));
 
     PsiClass aClass = method.getContainingClass();
@@ -1210,8 +1218,12 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
       PsiExpressionList list = methodCallExpression.getArgumentList();
       if (!HighlightMethodUtil.isDummyConstructorCall(methodCallExpression, myResolveHelper, list, expression)) {
         try {
-          myHolder.add(HighlightMethodUtil.checkAmbiguousMethodCallIdentifier(expression, results, list, resolved, result,
-                                                                              methodCallExpression, myResolveHelper));
+          myHolder.add(HighlightMethodUtil.checkAmbiguousMethodCallIdentifier(expression, results, list, resolved, result, methodCallExpression, myResolveHelper));
+          
+          if (!PsiTreeUtil.findChildrenOfType(methodCallExpression.getArgumentList(), PsiLambdaExpression.class).isEmpty()) {
+            myHolder.add(HighlightMethodUtil
+              .checkAmbiguousMethodCallArguments(expression, results, list, resolved, result, methodCallExpression, myResolveHelper, expression.getReferenceNameElement()));
+          }
         }
         catch (IndexNotReadyException ignored) {
         }
index cc43f962fc195c40c94ef57fbf33ee1eb68469af..605e7686ac94321582b077c1fcddfedb84e878d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -56,6 +56,8 @@ public class AddExceptionToCatchFix extends BaseIntentionAction {
 
     PsiTryStatement tryStatement = (PsiTryStatement)element.getParent();
     List<PsiClassType> unhandledExceptions = new ArrayList<PsiClassType>(ExceptionUtil.collectUnhandledExceptions(element, null));
+    if (unhandledExceptions.isEmpty()) return;
+
     ExceptionUtil.sortExceptionsByHierarchy(unhandledExceptions);
 
     IdeDocumentHistory.getInstance(project).includeCurrentPlaceAsChangePlace();
index a7375a981c273b665ff8c247217fd552b85b129a..3b56a946e281e12454626407432fc03fc2536a53 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.impl.source.jsp.jspJava.JspClassLevelDeclarationStatement;
 import com.intellij.psi.impl.source.tree.Factory;
 import com.intellij.psi.impl.source.tree.TreeElement;
+import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.IncorrectOperationException;
 import org.jetbrains.annotations.NotNull;
@@ -37,6 +38,7 @@ import java.util.List;
 class DeclarationMover extends LineMover {
   private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.editor.actions.moveUpDown.DeclarationMover");
   private PsiEnumConstant myEnumToInsertSemicolonAfter;
+  private boolean moveEnumConstant = false;
 
   @Override
   public void beforeMove(@NotNull final Editor editor, @NotNull final MoveInfo info, final boolean down) {
@@ -61,6 +63,40 @@ class DeclarationMover extends LineMover {
     }
   }
 
+  @Override
+  public void afterMove(@NotNull Editor editor, @NotNull PsiFile file, @NotNull MoveInfo info, boolean down) {
+    super.afterMove(editor, file, info, down);
+    if (moveEnumConstant) {
+      final Document document = editor.getDocument();
+      final CharSequence cs = document.getCharsSequence();
+      int end1 = info.range1.getEndOffset();
+      char c1 = cs.charAt(--end1);
+      while (Character.isWhitespace(c1)) {
+        c1 = cs.charAt(--end1);
+      }
+      int end2 = info.range2.getEndOffset();
+      char c2 = cs.charAt(--end2);
+      while (Character.isWhitespace(c2)) {
+        c2 = cs.charAt(--end2);
+      }
+      if (c1 == c2 || c1 != ',' && c2 != ',') {
+        return;
+      }
+      if (c1 == ';' || c2 == ';') {
+        document.replaceString(end1, end1 + 1, String.valueOf(c2));
+        document.replaceString(end2, end2 + 1, String.valueOf(c1));
+      }
+      else if (c1 == ',') {
+        document.deleteString(end1, end1 + 1);
+        document.insertString(end2 + 1, ",");
+      }
+      else {
+        document.deleteString(end2, end2 + 1);
+        document.insertString(end1 + 1, ",");
+      }
+    }
+  }
+
   @Override
   public boolean checkAvailable(@NotNull final Editor editor, @NotNull final PsiFile file, @NotNull final MoveInfo info, final boolean down) {
     if (!(file instanceof PsiJavaFile)) {
@@ -75,11 +111,22 @@ class DeclarationMover extends LineMover {
     if (psiRange == null) return false;
 
     final PsiMember firstMember = PsiTreeUtil.getParentOfType(psiRange.getFirst(), PsiMember.class, false);
-    final PsiMember lastMember = PsiTreeUtil.getParentOfType(psiRange.getSecond(), PsiMember.class, false);
+    PsiElement endElement = psiRange.getSecond();
+    if (firstMember instanceof PsiEnumConstant && endElement instanceof PsiJavaToken) {
+      final IElementType tokenType = ((PsiJavaToken)endElement).getTokenType();
+      if (down && tokenType == JavaTokenType.SEMICOLON) {
+        return info.prohibitMove();
+      }
+      if (tokenType == JavaTokenType.COMMA || tokenType == JavaTokenType.SEMICOLON) {
+        endElement = PsiTreeUtil.skipSiblingsBackward(endElement, PsiWhiteSpace.class);
+      }
+    }
+    final PsiMember lastMember = PsiTreeUtil.getParentOfType(endElement, PsiMember.class, false);
     if (firstMember == null || lastMember == null) return false;
 
     LineRange range;
     if (firstMember == lastMember) {
+      moveEnumConstant = firstMember instanceof PsiEnumConstant;
       range = memberRange(firstMember, editor, oldRange);
       if (range == null) return false;
       range.firstElement = range.lastElement = firstMember;
@@ -102,8 +149,17 @@ class DeclarationMover extends LineMover {
 
     PsiElement sibling = down ? range.lastElement.getNextSibling() : range.firstElement.getPrevSibling();
     sibling = firstNonWhiteElement(sibling, down);
-    if (down && range.lastElement instanceof PsiEnumConstant && sibling instanceof PsiJavaToken) {
-      sibling = ((PsiJavaToken)sibling).getTokenType() == JavaTokenType.COMMA ? firstNonWhiteElement(sibling.getNextSibling(), true) : null;
+    if (range.lastElement instanceof PsiEnumConstant && sibling instanceof PsiJavaToken) {
+      final PsiJavaToken token = (PsiJavaToken)sibling;
+      final IElementType tokenType = token.getTokenType();
+      if (down && tokenType == JavaTokenType.SEMICOLON) {
+        return info.prohibitMove();
+      }
+      if (tokenType == JavaTokenType.COMMA) {
+        sibling = down ?
+                  PsiTreeUtil.skipSiblingsForward(sibling, PsiWhiteSpace.class) :
+                  PsiTreeUtil.skipSiblingsBackward(sibling, PsiWhiteSpace.class);
+      }
     }
     final boolean areWeMovingClass = range.firstElement instanceof PsiClass;
     info.toMove = range;
index d6dabc95d5e4178f2ad72dd0929fc1ef24a9216f..eb51afdec3bd45f6e8e85728a1694feb9245b902 100644 (file)
@@ -47,3 +47,13 @@ if(this == $paramName) return true;
   Float.compare(${classInstanceName}.$field.accessor, $field.accessor) != 0 ##
   #end
 #end
+#macro(addPrimitiveFieldComparisonConditionDirect $field)
+  $field.accessor == ${classInstanceName}.$field.accessor ##
+#end
+#macro(addDoubleFieldComparisonConditionDirect $field)
+  #if ($field.double)
+  Double.compare(${classInstanceName}.$field.accessor, $field.accessor) == 0 ##
+  #else
+  Float.compare(${classInstanceName}.$field.accessor, $field.accessor) == 0 ##
+  #end
+#end
index 879ec80e2f8a89258243ad1a8c64e477e9eb8b0d..5213a009d6e1e9f97afb88c476b86958b517caa4 100644 (file)
@@ -15,12 +15,12 @@ Object $paramName){
      #set($i = $i + 1)
      #if ($field.primitive)
          #if ($field.double || $field.float)
-           #addDoubleFieldComparisonCondition($field) ##
+           #addDoubleFieldComparisonConditionDirect($field) ##
          #else
-           #addPrimitiveFieldComparisonCondition($field) ##
+           #addPrimitiveFieldComparisonConditionDirect($field) ##
          #end
       #elseif ($field.enum)
-         #addPrimitiveFieldComparisonCondition($field) ##
+         #addPrimitiveFieldComparisonConditionDirect($field) ##
       #else
 com.google.common.base.Objects.equal($field.accessor, ${classInstanceName}.$field.accessor)##
      #end
index 17eb89f1d1557a86402a4171ac5308c4ccb75f1e..b3af467fc24220e799a3f9d4c9affb896e0a65bf 100644 (file)
@@ -15,12 +15,12 @@ Object $paramName){
      #set($i = $i + 1)
      #if ($field.primitive)
        #if ($field.double || $field.float)
-         #addDoubleFieldComparisonCondition($field) ##
+         #addDoubleFieldComparisonConditionDirect($field) ##
        #else
-         #addPrimitiveFieldComparisonCondition($field) ##
+         #addPrimitiveFieldComparisonConditionDirect($field) ##
        #end
      #elseif ($field.enum)
-       #addPrimitiveFieldComparisonCondition($field) ##
+       #addPrimitiveFieldComparisonConditionDirect($field) ##
      #elseif ($field.array)
 java.util.Arrays.equals($field.accessor, ${classInstanceName}.$field.accessor)##
      #else
index 6f8821af27bdd11e185ae26576919007f7e66bab..2324cb2b6838cd2f054d0417bdfc02e72be618f6 100644 (file)
@@ -47,7 +47,7 @@ public class IntroduceVariableIntentionAction extends BaseRefactoringIntentionAc
       return false;
     }
 
-    final PsiExpressionStatement statement = PsiTreeUtil.getParentOfType(element,PsiExpressionStatement.class);
+    final PsiExpressionStatement statement = detectExpressionStatement(element);
     if (statement == null){
       return false;
     }
@@ -59,11 +59,17 @@ public class IntroduceVariableIntentionAction extends BaseRefactoringIntentionAc
 
   @Override
   public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
-    final PsiExpressionStatement statement = PsiTreeUtil.getParentOfType(element,PsiExpressionStatement.class);
+    final PsiExpressionStatement statement = detectExpressionStatement(element);
     if (statement == null){
       return;
     }
 
     new IntroduceVariableHandler().invoke(project, editor, statement.getExpression());
   }
+
+  private static PsiExpressionStatement detectExpressionStatement(@NotNull PsiElement element) {
+    final PsiElement prevSibling = PsiTreeUtil.skipSiblingsBackward(element, PsiWhiteSpace.class);
+    return prevSibling instanceof PsiExpressionStatement ? (PsiExpressionStatement)prevSibling
+                                                         : PsiTreeUtil.getParentOfType(element, PsiExpressionStatement.class);
+  }
 }
index e60743c0ae711641e398a650d663596b18cc8f23..6ede7a3b710d387f8b828543b92eee1d75594b69 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -25,7 +25,6 @@ import com.intellij.pom.java.LanguageLevel;
 import com.intellij.psi.*;
 import com.intellij.psi.codeStyle.CodeStyleManager;
 import com.intellij.psi.search.LocalSearchScope;
-import com.intellij.psi.search.ProjectScope;
 import com.intellij.psi.search.searches.ReferencesSearch;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.PsiTreeUtil;
@@ -39,7 +38,7 @@ import java.util.List;
 
 public class SurroundAutoCloseableAction extends PsiElementBaseIntentionAction {
   @Override
-  public boolean isAvailable(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) {
+  public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
     if (!element.getLanguage().isKindOf(JavaLanguage.INSTANCE)) return false;
     if (!PsiUtil.getLanguageLevel(element).isAtLeast(LanguageLevel.JDK_1_7)) return false;
 
@@ -52,18 +51,11 @@ public class SurroundAutoCloseableAction extends PsiElementBaseIntentionAction {
     final PsiElement codeBlock = declaration.getParent();
     if (!(codeBlock instanceof PsiCodeBlock)) return false;
 
-    final PsiType type = variable.getType();
-    if (!(type instanceof PsiClassType)) return false;
-    final PsiClass aClass = ((PsiClassType)type).resolve();
-    final JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
-    final PsiClass autoCloseable = facade.findClass(CommonClassNames.JAVA_LANG_AUTO_CLOSEABLE, ProjectScope.getLibrariesScope(project));
-    if (!InheritanceUtil.isInheritorOrSelf(aClass, autoCloseable, true)) return false;
-
-    return true;
+    return InheritanceUtil.isInheritor(variable.getType(), CommonClassNames.JAVA_LANG_AUTO_CLOSEABLE);
   }
 
   @Override
-  public void invoke(@NotNull final Project project, final Editor editor, @NotNull final PsiElement element) throws IncorrectOperationException {
+  public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {
     if (!FileModificationService.getInstance().preparePsiElementForWrite(element)) {
       return;
     }
@@ -92,10 +84,7 @@ public class SurroundAutoCloseableAction extends PsiElementBaseIntentionAction {
 
     List<PsiElement> toFormat = null;
     if (last != null) {
-      final PsiElement first = armStatement.getNextSibling();
-      if (first != null) {
-        toFormat = moveStatements(first, last, armStatement);
-      }
+      toFormat = moveStatements(last, armStatement);
     }
 
     final CodeStyleManager codeStyleManager = CodeStyleManager.getInstance(project);
@@ -117,14 +106,19 @@ public class SurroundAutoCloseableAction extends PsiElementBaseIntentionAction {
     }
   }
 
-  private static List<PsiElement> moveStatements(@NotNull PsiElement first, PsiElement last, PsiTryStatement statement) {
+  private static List<PsiElement> moveStatements(PsiElement last, PsiTryStatement statement) {
     PsiCodeBlock tryBlock = statement.getTryBlock();
     assert tryBlock != null : statement.getText();
     PsiElement parent = statement.getParent();
 
     List<PsiElement> toFormat = new SmartList<PsiElement>();
     PsiElement stopAt = last.getNextSibling();
-    for (PsiElement child = first; child != null && child != stopAt; child = child.getNextSibling()) {
+
+    PsiElement i = statement.getNextSibling();
+    while (i != null && i != stopAt) {
+      PsiElement child = i;
+      i = PsiTreeUtil.skipSiblingsForward(i, PsiWhiteSpace.class, PsiComment.class);
+
       if (!(child instanceof PsiDeclarationStatement)) continue;
 
       PsiElement anchor = child;
@@ -134,8 +128,8 @@ public class SurroundAutoCloseableAction extends PsiElementBaseIntentionAction {
         final int endOffset = last.getTextRange().getEndOffset();
         boolean contained = ReferencesSearch.search(declared, new LocalSearchScope(parent)).forEach(new Processor<PsiReference>() {
           @Override
-          public boolean process(PsiReference reference) {
-            return reference.getElement().getTextOffset() <= endOffset;
+          public boolean process(PsiReference ref) {
+            return ref.getElement().getTextOffset() <= endOffset;
           }
         });
 
@@ -148,9 +142,10 @@ public class SurroundAutoCloseableAction extends PsiElementBaseIntentionAction {
           toFormat.add(parent.addBefore(factory.createVariableDeclarationStatement(name, var.getType(), null), statement));
 
           PsiExpression varInit = var.getInitializer();
-          assert varInit != null : child.getText();
-          String varAssignText = name + " = " + varInit.getText() + ";";
-          anchor = parent.addAfter(factory.createStatementFromText(varAssignText, parent), anchor);
+          if (varInit != null) {
+            String varAssignText = name + " = " + varInit.getText() + ";";
+            anchor = parent.addAfter(factory.createStatementFromText(varAssignText, parent), anchor);
+          }
 
           var.delete();
         }
@@ -161,6 +156,7 @@ public class SurroundAutoCloseableAction extends PsiElementBaseIntentionAction {
       }
     }
 
+    PsiElement first = statement.getNextSibling();
     tryBlock.addRangeBefore(first, last, tryBlock.getRBrace());
     parent.deleteChildRange(first, last);
 
index 5c32067a646c7296f3be78920db77b574d0b7226..aa5437d076d52994da7c8e83f1837cd772bfb7b3 100644 (file)
@@ -120,7 +120,7 @@ public class JavaDocExternalFilter extends AbstractExternalFilter {
   @Override
   @Nullable
    public String getExternalDocInfoForElement(@NotNull String docURL, final PsiElement element) throws Exception {
-    CharSequence externalDoc = null;
+    String externalDoc = null;
     String builtInServer = "http://localhost:" + BuiltInServerOptions.getInstance().getEffectiveBuiltInServerPort() + "/" + myProject.getName() + "/";
     if (docURL.startsWith(builtInServer)) {
       int refPosition = docURL.lastIndexOf('#');
@@ -137,7 +137,7 @@ public class JavaDocExternalFilter extends AbstractExternalFilter {
           reader.close();
         }
 
-        externalDoc = result;
+        externalDoc = correctDocText(docURL, result);
       }
     }
 
@@ -165,7 +165,7 @@ public class JavaDocExternalFilter extends AbstractExternalFilter {
       DocumentationManager.createHyperlink(buffer, className, className, false);
       return matcher.replaceFirst(buffer.append("</h3>").toString());
     }
-    return externalDoc.toString();
+    return externalDoc;
   }
 
   @NotNull
index 40832fe974cd8d9d5c88f2e63d18578c3aec2fa6..047c4cff1b3b87f3146d8bf4a79bb2d51932d3e8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 package com.intellij.codeInsight.template.impl;
 
-import org.jetbrains.annotations.NonNls;
-
 /**
  * @author yole
  */
 public class JavaDefaultLiveTemplatesProvider implements DefaultLiveTemplatesProvider {
-  private static final @NonNls String[] DEFAULT_TEMPLATES = new String[]{
+  private static final String[] DEFAULT_TEMPLATES = {
     "/liveTemplates/iterations",
     "/liveTemplates/other",
     "/liveTemplates/output",
diff --git a/java/java-impl/src/com/intellij/codeInsight/template/macro/ExpressionTypeMacro.java b/java/java-impl/src/com/intellij/codeInsight/template/macro/ExpressionTypeMacro.java
new file mode 100644 (file)
index 0000000..586420d
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.codeInsight.template.macro;
+
+import com.intellij.codeInsight.CodeInsightBundle;
+import com.intellij.codeInsight.template.*;
+import com.intellij.psi.PsiExpression;
+import com.intellij.psi.PsiType;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+public class ExpressionTypeMacro extends Macro {
+  @Override
+  public String getName() {
+    return "expressionType";
+  }
+
+  @Override
+  public String getPresentableName() {
+    return CodeInsightBundle.message("macro.expression.type");
+  }
+
+  @Nullable
+  @Override
+  public Result calculateResult(@NotNull Expression[] params, ExpressionContext context) {
+    if (params.length == 1) {
+      Result result = params[0].calculateResult(context);
+      if (result != null) {
+        PsiExpression expression = MacroUtil.resultToPsiExpression(result, context);
+        if (expression != null) {
+          PsiType type = expression.getType();
+          if (type != null) {
+            return new PsiTypeResult(type, context.getProject());
+          }
+        }
+      }
+    }
+
+    return null;
+  }
+}
index 78f43afacad2ff7520343ac2b0577b5f255dfc71..f4d9be9d3ed1998b22c9150a8ed4885c88292b88 100644 (file)
@@ -221,14 +221,7 @@ public class GlobalJavaInspectionContextImpl extends GlobalJavaInspectionContext
       for (SmartPsiElementPointer sortedID : sortedIDs) {
         final PsiClass psiClass = (PsiClass)dereferenceInReadAction(sortedID);
         if (psiClass == null) continue;
-        context.incrementJobDoneAmount(context.getStdJobDescriptors().FIND_EXTERNAL_USAGES, ApplicationManager.getApplication().runReadAction(
-          new Computable<String>() {
-            @Override
-            public String compute() {
-              return psiClass.getQualifiedName();
-            }
-          }
-        ));
+        context.incrementJobDoneAmount(context.getStdJobDescriptors().FIND_EXTERNAL_USAGES, getClassPresentableName(psiClass));
 
         final List<DerivedClassesProcessor> processors = myDerivedClassesRequests.get(sortedID);
         LOG.assertTrue(processors != null, psiClass.getClass().getName());
@@ -282,14 +275,7 @@ public class GlobalJavaInspectionContextImpl extends GlobalJavaInspectionContext
         final List<UsagesProcessor> processors = myClassUsagesRequests.get(sortedID);
 
         LOG.assertTrue(processors != null, psiClass.getClass().getName());
-        context.incrementJobDoneAmount(context.getStdJobDescriptors().FIND_EXTERNAL_USAGES, ApplicationManager.getApplication().runReadAction(
-          new Computable<String>() {
-            @Override
-            public String compute() {
-              return psiClass.getQualifiedName();
-            }
-          }
-        ));
+        context.incrementJobDoneAmount(context.getStdJobDescriptors().FIND_EXTERNAL_USAGES, getClassPresentableName(psiClass));
 
         ReferencesSearch.search(psiClass, searchScope, false)
           .forEach(new PsiReferenceProcessorAdapter(createReferenceProcessor(processors, context)));
@@ -316,6 +302,18 @@ public class GlobalJavaInspectionContextImpl extends GlobalJavaInspectionContext
     }
   }
 
+  private String getClassPresentableName(final PsiClass psiClass) {
+    return ApplicationManager.getApplication().runReadAction(
+      new Computable<String>() {
+        @Override
+        public String compute() {
+          final String qualifiedName = psiClass.getQualifiedName();
+          return qualifiedName != null ? qualifiedName : psiClass.getName();
+        }
+      }
+    );
+  }
+
   private static PsiElement dereferenceInReadAction(final SmartPsiElementPointer sortedID) {
     return ApplicationManager.getApplication().runReadAction(new Computable<PsiElement>() {
       @Override
index da011319c80fbf5a6a494a597f54fffcdedcd5d9..e64059ec2d9e30ea91e559c449ebc71e6233fb69 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -333,6 +333,6 @@ public class JavaQualifiedNameProvider implements QualifiedNameProvider {
     //  }
     //}
     final JavaCodeStyleManager codeStyleManagerEx = JavaCodeStyleManager.getInstance(element.getProject());
-    codeStyleManagerEx.shortenClassReferences(element, JavaCodeStyleManager.UNCOMPLETE_CODE);
+    codeStyleManagerEx.shortenClassReferences(element, JavaCodeStyleManager.INCOMPLETE_CODE);
   }
 }
index dcc24453edf880291dad505f2519827fd3e4fa9d..35caf3df55106573b6fd43fe94b91433e20888d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -71,7 +71,7 @@ public class JavaCodeStyleManagerImpl extends JavaCodeStyleManager {
     if (!SourceTreeToPsiMap.hasTreeElement(element)) return element;
 
     final boolean addImports = (flags & DO_NOT_ADD_IMPORTS) == 0;
-    final boolean incompleteCode = (flags & UNCOMPLETE_CODE) != 0;
+    final boolean incompleteCode = (flags & INCOMPLETE_CODE) != 0;
 
     final ReferenceAdjuster adjuster = ReferenceAdjuster.Extension.getReferenceAdjuster(element.getLanguage());
     if (adjuster != null) {
index 651474f94037b6f963eca5e02590a1986765d7c3..d0fb8200ba3300c02144dd96c9ea88f42f71f64f 100644 (file)
@@ -43,7 +43,9 @@ public class RenameFileAction extends AnAction implements DumbAware {
     PsiFile file = e.getData(CommonDataKeys.PSI_FILE);
     Presentation presentation = e.getPresentation();
     String place = e.getPlace();
-    boolean enabled = (file instanceof PsiClassOwner || ActionPlaces.EDITOR_TAB_POPUP.equals(place)) && place != ActionPlaces.EDITOR_POPUP && e.getData(CommonDataKeys.PROJECT) != null;
+    boolean enabled = file != null && 
+                      (file instanceof PsiClassOwner || ActionPlaces.EDITOR_TAB_POPUP.equals(place)) && 
+                      place != ActionPlaces.EDITOR_POPUP && e.getData(CommonDataKeys.PROJECT) != null;
     presentation.setEnabled(enabled);
     presentation.setVisible(enabled);
     if (enabled) {
index 1a39404cf52cc7a4dadb6ec5ccfc3d262cf7a82c..63d1c71e705da976e82bd0e768c482fe8f6224ef 100644 (file)
@@ -215,6 +215,7 @@ public class ExtractMethodDialog extends DialogWrapper implements AbstractExtrac
     });
 
     myVisibilityPanel = createVisibilityPanel();
+    myVisibilityPanel.registerUpDownActionsFor(myNameField);
     final JPanel visibilityAndReturnType = new JPanel(new BorderLayout(2, 0));
     if (!myTargetClass.isInterface()) {
       visibilityAndReturnType.add(myVisibilityPanel, BorderLayout.WEST);
index 84bc10e52484b221409d755115f952c0f6e9e821..385fe8b578ee839c85a11c817e03f0b630469b5d 100644 (file)
@@ -319,7 +319,8 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase {
     if (endOffset <= startOffset) return null;
 
     PsiElement elementAt = PsiTreeUtil.findCommonParent(elementAtStart, elementAtEnd);
-    if (PsiTreeUtil.getParentOfType(elementAt, PsiExpression.class, false) == null) {
+    final PsiExpression containingExpression = PsiTreeUtil.getParentOfType(elementAt, PsiExpression.class, false);
+    if (containingExpression == null || containingExpression instanceof PsiLambdaExpression) {
       if (injectedLanguageManager.isInjectedFragment(file)) {
         return getSelectionFromInjectedHost(project, file, injectedLanguageManager, startOffset, endOffset);
       }
index bfcc166c6e5f377bab59323a40525c0a5706f6a6..95771808608512de9f6f54242661d5260858f0e9 100644 (file)
@@ -109,6 +109,10 @@ public class JavaVariableInplaceIntroducer extends AbstractJavaInplaceIntroducer
       }
     }
     super.beforeTemplateStart();
+  }
+
+  @Override
+  protected void onRenameTemplateStarted() {
     final ResolveSnapshotProvider resolveSnapshotProvider = VariableInplaceRenamer.INSTANCE.forLanguage(myScope.getLanguage());
     myConflictResolver = resolveSnapshotProvider != null ? resolveSnapshotProvider.createSnapshot(myScope) : null;
   }
index 1308fa22ae73cd375fdb941bcee624f0ed176366..d94d8436bf92d219fe78281f2c78961137d5c788 100644 (file)
@@ -224,7 +224,7 @@ public abstract class DestinationFolderComboBox extends ComboboxWithBrowseButton
         oldOne = itemWrapper;
       }
     }
-    if (!fileIndex.isInLibrarySource(oldSelection)) {
+    if (oldSelection == null || !fileIndex.isInLibrarySource(oldSelection)) {
       items.add(NULL_WRAPPER);
     }
     final DirectoryChooser.ItemWrapper selection = chooseSelection(initialTargetDirectorySourceRoot, fileIndex, items, initial, oldOne);
index 8c0a82d424acdccf569724b32e2b90b1c85bde8a..93b2aa940c55c59d24bb7ffe4d53932b28092c31 100644 (file)
@@ -490,7 +490,11 @@ public class JavaSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase {
             }
           }
           LOG.assertTrue(element.getTextRange() != null);
-          usages.add(new SafeDeleteReferenceJavaDeleteUsageInfo(element, psiClass, isInNonStaticImport(element)));
+          final PsiFile containingFile = psiClass.getContainingFile();
+          final boolean sameFileWithSingleClass = containingFile instanceof PsiClassOwner &&
+                                                  ((PsiClassOwner)containingFile).getClasses().length == 1 &&
+                                                  element.getContainingFile() == containingFile;
+          usages.add(new SafeDeleteReferenceJavaDeleteUsageInfo(element, psiClass, sameFileWithSingleClass || isInNonStaticImport(element)));
         }
         return true;
       }
index b93ec588d2bbc541358c99884a2dfd9bd5a3ec26..4fb64e6e245ce53c9ce03dfae50aebabda2167a1 100644 (file)
@@ -19,6 +19,9 @@ import com.intellij.openapi.components.ServiceManager;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiMethod;
+import com.intellij.psi.util.CachedValueProvider;
+import com.intellij.psi.util.CachedValuesManager;
+import com.intellij.psi.util.PsiModificationTracker;
 import com.intellij.testIntegration.TestFramework;
 import org.jetbrains.annotations.Nullable;
 
@@ -51,7 +54,18 @@ public abstract class TestFrameworks {
   }
   
   @Nullable
-  public static TestFramework detectFramework(PsiClass psiClass) {
+  public static TestFramework detectFramework(final PsiClass psiClass) {
+    return CachedValuesManager.getCachedValue(psiClass, new CachedValueProvider<TestFramework>() {
+      @Nullable
+      @Override
+      public Result<TestFramework> compute() {
+        return Result.create(computeFramework(psiClass), PsiModificationTracker.JAVA_STRUCTURE_MODIFICATION_COUNT);
+      }
+    });
+  }
+
+  @Nullable
+  private static TestFramework computeFramework(PsiClass psiClass) {
     for (TestFramework framework : Extensions.getExtensions(TestFramework.EXTENSION_NAME)) {
       if (framework.isTestClass(psiClass)) {
         return framework;
@@ -63,7 +77,6 @@ public abstract class TestFrameworks {
         return framework;
       }
     }
-
     return null;
   }
 }
index f0ef1aaac01a679f203d3680620423b7b46ad212..1c783d4a0a0c66c5eeefcf383bcff545ce6102f7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-/*
- * @author max
- */
 package com.intellij.psi.codeStyle;
 
 import com.intellij.openapi.components.ServiceManager;
@@ -30,16 +26,23 @@ import org.jetbrains.annotations.Nullable;
 
 import java.util.Collection;
 
+/**
+ * @author max
+ */
 public abstract class JavaCodeStyleManager {
   public static JavaCodeStyleManager getInstance(Project project) {
     return ServiceManager.getService(project, JavaCodeStyleManager.class);
   }
 
   public static final int DO_NOT_ADD_IMPORTS = 0x1000;
-  public static final int UNCOMPLETE_CODE = 0x2000;
+  public static final int INCOMPLETE_CODE = 0x2000;
+
+  /** @deprecated use {@link #INCOMPLETE_CODE} (to be removed in IDEA 17) */
+  @SuppressWarnings({"unused", "SpellCheckingInspection"}) public static final int UNCOMPLETE_CODE = INCOMPLETE_CODE;
 
   public abstract boolean addImport(@NotNull PsiJavaFile file, @NotNull PsiClass refClass);
-  public abstract PsiElement shortenClassReferences(@NotNull PsiElement element, @MagicConstant(flags = {DO_NOT_ADD_IMPORTS, UNCOMPLETE_CODE}) int flags) throws IncorrectOperationException;
+  public abstract PsiElement shortenClassReferences(@NotNull PsiElement element,
+                                                    @MagicConstant(flags = {DO_NOT_ADD_IMPORTS, INCOMPLETE_CODE}) int flags) throws IncorrectOperationException;
 
   @NotNull public abstract String getPrefixByVariableKind(VariableKind variableKind);
   @NotNull public abstract String getSuffixByVariableKind(VariableKind variableKind);
@@ -51,9 +54,8 @@ public abstract class JavaCodeStyleManager {
    * non-qualified names and adds import statements as necessary.
    *
    * @param element the element to shorten references in.
-   * @return the element in the PSI tree after the shorten references operation corresponding
-   *         to the original element.
-   * @throws com.intellij.util.IncorrectOperationException if the file to shorten references in is read-only.
+   * @return the element in the PSI tree after the shorten references operation corresponding to the original element.
+   * @throws IncorrectOperationException if the file to shorten references in is read-only.
    */
   public abstract PsiElement shortenClassReferences(@NotNull PsiElement element) throws IncorrectOperationException;
 
@@ -62,10 +64,8 @@ public abstract class JavaCodeStyleManager {
    * non-qualified names and adds import statements as necessary.
    *
    * @param element     the element to shorten references in.
-   * @param startOffset the start offset in the <b>element</b> of the part where class references are
-   *                    shortened.
-   * @param endOffset   the end offset in the <b>element</b> of the part where class references are
-   *                    shortened.
+   * @param startOffset the start offset in the <b>element</b> of the part where class references are shortened.
+   * @param endOffset   the end offset in the <b>element</b> of the part where class references are shortened.
    * @throws IncorrectOperationException if the file to shorten references in is read-only.
    */
   public abstract void shortenClassReferences(@NotNull PsiElement element, int startOffset, int endOffset) throws IncorrectOperationException;
@@ -88,8 +88,7 @@ public abstract class JavaCodeStyleManager {
   public abstract PsiImportList prepareOptimizeImportsResult(@NotNull PsiJavaFile file);
 
   /**
-   * Returns the kind of the specified variable (local, parameter, field, static field or static
-   * final field).
+   * Returns the kind of the specified variable (local, parameter, field, static field or static final field).
    *
    * @param variable the variable to get the kind for.
    * @return the variable kind.
@@ -169,9 +168,9 @@ public abstract class JavaCodeStyleManager {
   /**
    * Suggests a unique name for the variable used at the specified location.
    *
-   * @param baseNameInfo    the base name info for the variable.
-   * @param place       the location where the variable will be used.
-   * @param lookForward if true, the existing variables are searched in both directions; if false - only backward
+   * @param baseNameInfo the base name info for the variable.
+   * @param place        the location where the variable will be used.
+   * @param lookForward  if true, the existing variables are searched in both directions; if false - only backward
    * @return the generated unique name
    */
   @NotNull
@@ -184,17 +183,17 @@ public abstract class JavaCodeStyleManager {
   /**
    * Suggests a unique name for the variable used at the specified location.
    *
-   *
    * @param baseNameInfo    the base name info for the variable.
    * @param place           the location where the variable will be used.
-   * @param ignorePlaceName  if true and place is PsiNamedElement, place.getName() would be still treated as unique name
-   * @param lookForward     if true, the existing variables are searched in both directions; if false - only backward  @return the generated unique name,
+   * @param ignorePlaceName if true and place is PsiNamedElement, place.getName() would be still treated as unique name
+   * @param lookForward     if true, the existing variables are searched in both directions; if false - only backward
    * @return the generated unique name
    */
-  @NotNull public abstract SuggestedNameInfo suggestUniqueVariableName(@NotNull SuggestedNameInfo baseNameInfo,
-                                                                       PsiElement place,
-                                                                       boolean ignorePlaceName,
-                                                                       boolean lookForward);
+  @NotNull
+  public abstract SuggestedNameInfo suggestUniqueVariableName(@NotNull SuggestedNameInfo baseNameInfo,
+                                                              PsiElement place,
+                                                              boolean ignorePlaceName,
+                                                              boolean lookForward);
 
   /**
    * Replaces all references to Java classes in the contents of the specified element,
@@ -202,8 +201,7 @@ public abstract class JavaCodeStyleManager {
    * with full-qualified references.
    *
    * @param element the element to replace the references in.
-   * @return the element in the PSI tree after the qualify operation corresponding to the
-   *         original element.
+   * @return the element in the PSI tree after the qualify operation corresponding to the original element.
    */
   public abstract PsiElement qualifyClassReferences(@NotNull PsiElement element);
 
@@ -211,8 +209,7 @@ public abstract class JavaCodeStyleManager {
    * Removes unused import statements from the specified Java file.
    *
    * @param file the file to remove the import statements from.
-   * @throws IncorrectOperationException if the operation fails for some reason (for example,
-   *                                     the file is read-only).
+   * @throws IncorrectOperationException if the operation fails for some reason (for example, the file is read-only).
    */
   public abstract void removeRedundantImports(@NotNull PsiJavaFile file) throws IncorrectOperationException;
 
index c9673d1385ac7690410a560531944bbfc882d2b8..bc45534cb964b9a50e2c642669229c55afef35fb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@ public class CoreJavaCodeStyleManager extends JavaCodeStyleManager {
 
   @Override
   public PsiElement shortenClassReferences(@NotNull PsiElement element,
-                                           @MagicConstant(flags = {DO_NOT_ADD_IMPORTS, UNCOMPLETE_CODE}) int flags)
+                                           @MagicConstant(flags = {DO_NOT_ADD_IMPORTS, INCOMPLETE_CODE}) int flags)
     throws IncorrectOperationException {
     return null;
   }
index 9ebe8673af225d3ac8580796e8f494e9691cee28..dc919245f5c9a497127b95d53beffbb474281f29 100644 (file)
@@ -315,11 +315,10 @@ public class ExpressionParser {
     return operand;
   }
 
-  private enum BreakPoint {P1, P2, P3, P4}
+  private enum BreakPoint {P1, P2, P4}
 
-  // todo[r.sh] make 'this', 'super' and 'class' reference expressions
   @Nullable
-  private PsiBuilder.Marker parsePrimary(final PsiBuilder builder, @Nullable final BreakPoint breakPoint, final int breakOffset) {
+  private PsiBuilder.Marker parsePrimary(PsiBuilder builder, @Nullable BreakPoint breakPoint, int breakOffset) {
     PsiBuilder.Marker startMarker = builder.mark();
 
     PsiBuilder.Marker expr = parsePrimaryExpressionStart(builder);
@@ -365,6 +364,14 @@ public class ExpressionParser {
           dotPos.drop();
           expr = parseNew(builder, expr);
         }
+        else if (dotTokenType == JavaTokenType.SUPER_KEYWORD && builder.lookAhead(1) == JavaTokenType.LPARENTH) {
+          dotPos.drop();
+          PsiBuilder.Marker refExpr = expr.precede();
+          builder.mark().done(JavaElementType.REFERENCE_PARAMETER_LIST);
+          builder.advanceLexer();
+          refExpr.done(JavaElementType.REFERENCE_EXPRESSION);
+          expr = refExpr;
+        }
         else if (THIS_OR_SUPER.contains(dotTokenType) && exprType(expr) == JavaElementType.REFERENCE_EXPRESSION) {
           if (breakPoint == BreakPoint.P2 && builder.getCurrentOffset() == breakOffset) {
             dotPos.rollbackTo();
@@ -372,11 +379,11 @@ public class ExpressionParser {
             return expr;
           }
 
-          final PsiBuilder.Marker copy = startMarker.precede();
-          final int offset = builder.getCurrentOffset();
+          PsiBuilder.Marker copy = startMarker.precede();
+          int offset = builder.getCurrentOffset();
           startMarker.rollbackTo();
 
-          final PsiBuilder.Marker ref = myParser.getReferenceParser().parseJavaCodeReference(builder, false, true, false, false);
+          PsiBuilder.Marker ref = myParser.getReferenceParser().parseJavaCodeReference(builder, false, true, false, false);
           if (ref == null || builder.getTokenType() != JavaTokenType.DOT || builder.getCurrentOffset() != dotOffset) {
             copy.rollbackTo();
             return parsePrimary(builder, BreakPoint.P2, offset);
@@ -393,17 +400,10 @@ public class ExpressionParser {
           expr = ref.precede();
           expr.done(dotTokenType == JavaTokenType.THIS_KEYWORD ? JavaElementType.THIS_EXPRESSION : JavaElementType.SUPER_EXPRESSION);
         }
-        else if (dotTokenType == JavaTokenType.SUPER_KEYWORD) {
-          dotPos.drop();
-          final PsiBuilder.Marker refExpr = expr.precede();
-          builder.mark().done(JavaElementType.REFERENCE_PARAMETER_LIST);
-          builder.advanceLexer();
-          refExpr.done(JavaElementType.REFERENCE_EXPRESSION);
-          expr = refExpr;
-        }
         else {
           dotPos.drop();
-          final PsiBuilder.Marker refExpr = expr.precede();
+          PsiBuilder.Marker refExpr = expr.precede();
+
           myParser.getReferenceParser().parseReferenceParameterList(builder, false, false);
 
           if (!expectOrError(builder, ID_OR_SUPER, "expected.identifier")) {
@@ -418,40 +418,11 @@ public class ExpressionParser {
       }
       else if (tokenType == JavaTokenType.LPARENTH) {
         if (exprType(expr) != JavaElementType.REFERENCE_EXPRESSION) {
-          if (exprType(expr) == JavaElementType.SUPER_EXPRESSION) {
-            if (breakPoint == BreakPoint.P3) {
-              startMarker.drop();
-              return expr;
-            }
-
-            final PsiBuilder.Marker copy = startMarker.precede();
-            startMarker.rollbackTo();
-
-            final PsiBuilder.Marker qualifier = parsePrimaryExpressionStart(builder);
-            if (qualifier != null) {
-              final PsiBuilder.Marker refExpr = qualifier.precede();
-              if (builder.getTokenType() == JavaTokenType.DOT) {
-                builder.advanceLexer();
-                if (builder.getTokenType() == JavaTokenType.SUPER_KEYWORD) {
-                  builder.advanceLexer();
-                  refExpr.done(JavaElementType.REFERENCE_EXPRESSION);
-                  expr = refExpr;
-                  startMarker = copy;
-                  continue;
-                }
-              }
-            }
-
-            copy.rollbackTo();
-            return parsePrimary(builder, BreakPoint.P3, -1);
-          }
-          else {
-            startMarker.drop();
-            return expr;
-          }
+          startMarker.drop();
+          return expr;
         }
 
-        final PsiBuilder.Marker callExpr = expr.precede();
+        PsiBuilder.Marker callExpr = expr.precede();
         parseArgumentList(builder);
         callExpr.done(JavaElementType.METHOD_CALL_EXPRESSION);
         expr = callExpr;
index dba1d05fd1d0211637c4a49048bd8ecabf6ab114..cba5c8d9db02a8f89c1015807653adc9d5fb5b39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -357,7 +357,6 @@ public class PsiImplUtil {
     return TargetType.UNKNOWN;
   }
 
-  // todo[r.sh] cache?
   @Nullable
   public static Set<TargetType> getAnnotationTargets(@NotNull PsiClass annotationType) {
     if (!annotationType.isAnnotationType()) return null;
@@ -393,38 +392,38 @@ public class PsiImplUtil {
     PsiUtilCore.ensureValid(expression);
     PsiUtil.ensureValidType(type);
 
-    PsiExpression toplevel = expression;
-    while (toplevel.getParent() instanceof PsiArrayAccessExpression &&
-           ((PsiArrayAccessExpression)toplevel.getParent()).getArrayExpression() == toplevel) {
-      toplevel = (PsiExpression)toplevel.getParent();
+    PsiExpression topLevel = expression;
+    while (topLevel.getParent() instanceof PsiArrayAccessExpression &&
+           ((PsiArrayAccessExpression)topLevel.getParent()).getArrayExpression() == topLevel) {
+      topLevel = (PsiExpression)topLevel.getParent();
     }
 
-    if (toplevel instanceof PsiArrayAccessExpression && !PsiUtil.isAccessedForWriting(toplevel)) {
+    if (topLevel instanceof PsiArrayAccessExpression && !PsiUtil.isAccessedForWriting(topLevel)) {
       return PsiUtil.captureToplevelWildcards(type, expression);
     }
 
-    final PsiType normalized = doNormalizeWildcardByPosition(type, expression, toplevel);
+    final PsiType normalized = doNormalizeWildcardByPosition(type, expression, topLevel);
     LOG.assertTrue(normalized.isValid(), type);
-    if (normalized instanceof PsiClassType && !PsiUtil.isAccessedForWriting(toplevel)) {
+    if (normalized instanceof PsiClassType && !PsiUtil.isAccessedForWriting(topLevel)) {
       return PsiUtil.captureToplevelWildcards(normalized, expression);
     }
 
     return normalized;
   }
 
-  private static PsiType doNormalizeWildcardByPosition(final PsiType type, @NotNull PsiExpression expression, final PsiExpression toplevel) {
+  private static PsiType doNormalizeWildcardByPosition(PsiType type, @NotNull PsiExpression expression, PsiExpression topLevel) {
     if (type instanceof PsiCapturedWildcardType) {
       final PsiWildcardType wildcardType = ((PsiCapturedWildcardType)type).getWildcard();
       if (expression instanceof PsiReferenceExpression && LambdaUtil.isLambdaReturnExpression(expression)) {
         return type;
       }
 
-      if (PsiUtil.isAccessedForWriting(toplevel)) {
+      if (PsiUtil.isAccessedForWriting(topLevel)) {
         return wildcardType.isSuper() ? wildcardType.getBound() : PsiCapturedWildcardType.create(wildcardType, expression);
       }
       else {
         final PsiType upperBound = ((PsiCapturedWildcardType)type).getUpperBound();
-        return upperBound instanceof PsiWildcardType ? doNormalizeWildcardByPosition(upperBound, expression, toplevel) : upperBound;
+        return upperBound instanceof PsiWildcardType ? doNormalizeWildcardByPosition(upperBound, expression, topLevel) : upperBound;
       }
     }
 
@@ -432,7 +431,7 @@ public class PsiImplUtil {
     if (type instanceof PsiWildcardType) {
       final PsiWildcardType wildcardType = (PsiWildcardType)type;
 
-      if (PsiUtil.isAccessedForWriting(toplevel)) {
+      if (PsiUtil.isAccessedForWriting(topLevel)) {
         return wildcardType.isSuper() ? wildcardType.getBound() : PsiCapturedWildcardType.create(wildcardType, expression);
       }
       else {
@@ -446,7 +445,7 @@ public class PsiImplUtil {
     }
     else if (type instanceof PsiArrayType) {
       final PsiType componentType = ((PsiArrayType)type).getComponentType();
-      final PsiType normalizedComponentType = doNormalizeWildcardByPosition(componentType, expression, toplevel);
+      final PsiType normalizedComponentType = doNormalizeWildcardByPosition(componentType, expression, topLevel);
       if (normalizedComponentType != componentType) {
         return normalizedComponentType.createArrayType();
       }
@@ -521,26 +520,34 @@ public class PsiImplUtil {
                                                                    @Nullable String attributeName,
                                                                    @Nullable PsiAnnotationMemberValue value,
                                                                    @NotNull PairFunction<Project, String, PsiAnnotation> annotationCreator) {
-    final PsiAnnotationMemberValue existing = psiAnnotation.findDeclaredAttributeValue(attributeName);
+    PsiAnnotationMemberValue existing = psiAnnotation.findDeclaredAttributeValue(attributeName);
     if (value == null) {
       if (existing == null) {
         return null;
       }
       existing.getParent().delete();
-    } else {
+    }
+    else {
       if (existing != null) {
         ((PsiNameValuePair)existing.getParent()).setValue(value);
-      } else {
-        final PsiNameValuePair[] attributes = psiAnnotation.getParameterList().getAttributes();
-        if (attributes.length == 1 && attributes[0].getName() == null) {
-          attributes[0].replace(createNameValuePair(attributes[0].getValue(), PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME + "=", annotationCreator));
+      }
+      else {
+        PsiNameValuePair[] attributes = psiAnnotation.getParameterList().getAttributes();
+        if (attributes.length == 1) {
+          PsiNameValuePair attribute = attributes[0];
+          if (attribute.getName() == null) {
+            PsiAnnotationMemberValue defValue = attribute.getValue();
+            assert defValue != null : attribute;
+            attribute.replace(createNameValuePair(defValue, PsiAnnotation.DEFAULT_REFERENCED_METHOD_NAME + "=", annotationCreator));
+          }
         }
 
         boolean allowNoName = attributes.length == 0 && ("value".equals(attributeName) || null == attributeName);
         final String namePrefix;
         if (allowNoName) {
           namePrefix = "";
-        } else {
+        }
+        else {
           namePrefix = attributeName + "=";
         }
         psiAnnotation.getParameterList().addBefore(createNameValuePair(value, namePrefix, annotationCreator), null);
@@ -709,7 +716,8 @@ public class PsiImplUtil {
     if (typeName.indexOf('<') != -1 || typeName.indexOf('[') != -1 || typeName.indexOf('.') == -1) {
       try {
         return JavaPsiFacade.getInstance(psiManager.getProject()).getElementFactory().createTypeFromText(typeName, context);
-      } catch(Exception ex) {} // invalid syntax will produce unresolved class type
+      }
+      catch(Exception ignored) { } // invalid syntax will produce unresolved class type
     }
 
     PsiClass aClass = JavaPsiFacade.getInstance(psiManager.getProject()).findClass(typeName, context.getResolveScope());
index 0978fe8100d35868bac7768c585eb62074cce2a3..1eb3a4efe70c8805b40a3c525f76b64c6b93b140 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -575,7 +575,7 @@ public class PsiJavaCodeReferenceElementImpl extends CompositePsiElement impleme
 
     if (!preserveQualification) {
       JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(project);
-      ref = (PsiJavaCodeReferenceElement)codeStyleManager.shortenClassReferences(ref, JavaCodeStyleManager.UNCOMPLETE_CODE);
+      ref = (PsiJavaCodeReferenceElement)codeStyleManager.shortenClassReferences(ref, JavaCodeStyleManager.INCOMPLETE_CODE);
     }
 
     return ref;
index aaeb06e8d7955699786b664edcf622e8af59df0b..b5977596424b06950e73d5d8d2dfa78b8dde3c15 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -570,7 +570,7 @@ public class PsiReferenceExpressionImpl extends PsiReferenceExpressionBase imple
       getTreeParent().replaceChildInternal(this, (TreeElement)ref.getNode());
       final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(manager.getProject());
       if (!preserveQualification) {
-        ref = (PsiExpression)codeStyleManager.shortenClassReferences(ref, JavaCodeStyleManager.UNCOMPLETE_CODE);
+        ref = (PsiExpression)codeStyleManager.shortenClassReferences(ref, JavaCodeStyleManager.INCOMPLETE_CODE);
       }
       return ref;
     }
index 6c664dd9e65a677da0d5e299fb48a00f1fa1686c..2e95d0205abb0d09cd58c85a92efb72d2b4bd522 100644 (file)
@@ -22,6 +22,6 @@ class AmbiguityRawGenerics {
     <Z> void foo(I3<Z> s) { }
 
     void bar() {
-        foo<error descr="Ambiguous method call: both 'AmbiguityRawGenerics.foo(I1)' and 'AmbiguityRawGenerics.foo(I2)' match">(()-> { throw new RuntimeException(); })</error>;
+        <error descr="Ambiguous method call: both 'AmbiguityRawGenerics.foo(I1)' and 'AmbiguityRawGenerics.foo(I2)' match">foo</error>(()-> { throw new RuntimeException(); });
     }
 }
\ No newline at end of file
index 1512dd0abc4310760ffc6e5381f135b390aac5df..b8fb475c6c0b599a34a58512a50daf470afe2a5b 100644 (file)
@@ -1,6 +1,6 @@
 public interface IDEA99969 {
   default IntStream distinct(Stream s) {
-    return s.map(i -> <error descr="Inconvertible types; cannot cast '<lambda parameter>' to 'int'">(int) i</error>);
+    return s.<error descr="Ambiguous method call: both 'Stream.map(Function)' and 'Stream.map(IntFunction)' match">map</error>(i -> <error descr="Inconvertible types; cannot cast '<lambda parameter>' to 'int'">(int) i</error>);
   }
 }
 interface Stream<T> {