Merge remote-tracking branch 'origin/master'
authorIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Tue, 2 Sep 2014 17:39:02 +0000 (21:39 +0400)
committerIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Tue, 2 Sep 2014 17:39:02 +0000 (21:39 +0400)
551 files changed:
.idea/libraries/JSch.xml
build/scripts/layouts.gant
build/scripts/libLicenses.gant
community-tests/src/tests/testGroups.properties
java/debugger/impl/src/com/intellij/debugger/actions/JavaReferringObjectsValue.java
java/debugger/impl/src/com/intellij/debugger/actions/PopFrameAction.java
java/debugger/impl/src/com/intellij/debugger/engine/JavaDebuggerEvaluator.java
java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSettings.java
java/debugger/impl/src/com/intellij/debugger/settings/DebuggerSteppingConfigurable.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/EvaluationDescriptor.java
java/debugger/openapi/src/com/intellij/debugger/SourcePosition.java
java/execution/impl/src/com/intellij/execution/junit/InheritorChooser.java
java/java-analysis-impl/src/com/intellij/codeInsight/InferredAnnotationsManagerImpl.java
java/java-analysis-impl/src/com/intellij/codeInspection/bytecodeAnalysis/BytecodeAnalysisIndex.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ContractInference.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/ControlFlowAnalyzer.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/StandardInstructionVisitor.java
java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/value/DfaExpressionFactory.java
java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcodeBase.java [moved from java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcode.java with 91% similarity]
java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsLineMarkerProvider.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionUtil.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaDocCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/PreferByKindWeigher.java
java/java-impl/src/com/intellij/codeInsight/highlighting/HighlightExceptionsHandlerFactory.java
java/java-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcode.java [new file with mode: 0644]
java/java-impl/src/com/intellij/find/findUsages/JavaFindUsagesHandler.java
java/java-impl/src/com/intellij/openapi/roots/impl/LanguageLevelProjectExtensionImpl.java
java/java-impl/src/com/intellij/psi/impl/file/PsiPackageImplementationHelperImpl.java
java/java-impl/src/com/intellij/refactoring/util/RefactoringUtil.java
java/java-indexing-api/src/com/intellij/psi/search/searches/ClassInheritorsSearch.java
java/java-psi-api/src/com/intellij/psi/PsiPackage.java
java/java-psi-api/src/com/intellij/psi/util/ClassUtil.java
java/java-psi-impl/src/com/intellij/core/CorePsiPackageImplementationHelper.java
java/java-psi-impl/src/com/intellij/psi/NonClasspathClassFinder.java
java/java-psi-impl/src/com/intellij/psi/impl/file/PsiPackageImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/file/PsiPackageImplementationHelper.java
java/java-psi-impl/src/com/intellij/psi/impl/source/PsiParameterImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceSession.java
java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java
java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/LambdaExpressionCompatibilityConstraint.java
java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/constraints/PsiMethodReferenceCompatibilityConstraint.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/DeepNestedLambdaExpressionsNoFormalParams.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/IDEA126778.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressions1.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParams.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParams1.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParamsStopAtStandalone.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ParenthesizedExpressionsDuringConstrainsCollection.java [new file with mode: 0644]
java/java-tests/testData/inspection/dataFlow/fixture/RootThrowableCause.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewMethodRefHighlightingTest.java
java/java-tests/testSrc/com/intellij/codeInspection/ContractInferenceFromSourceTest.groovy
lib/jsch-0.1.50.jar [deleted file]
lib/jsch-0.1.51.jar [new file with mode: 0644]
lib/required_for_dist.txt
lib/src/jsch-0.1.50.zip [deleted file]
lib/src/jsch-0.1.51.zip [new file with mode: 0644]
platform/analysis-impl/src/com/intellij/codeInspection/InspectionEngine.java
platform/analysis-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
platform/core-api/src/com/intellij/openapi/options/SchemeProcessor.java
platform/core-api/src/com/intellij/psi/util/CachedValuesManager.java
platform/core-impl/src/com/intellij/mock/MockComponentManager.java
platform/core-impl/src/com/intellij/psi/MultiplePsiFilesPerDocumentFileViewProvider.java
platform/core-impl/src/com/intellij/psi/SingleRootFileViewProvider.java
platform/core-impl/src/com/intellij/psi/impl/file/impl/FileManagerImpl.java
platform/core-impl/src/com/intellij/psi/impl/source/tree/FileElement.java
platform/core-impl/src/com/intellij/util/CachedValuesManagerImpl.java
platform/dvcs-api/src/com/intellij/dvcs/push/PushSupport.java
platform/dvcs-api/src/com/intellij/dvcs/push/TargetEditor.java [new file with mode: 0644]
platform/dvcs-api/src/com/intellij/dvcs/push/VcsError.java
platform/dvcs-impl/src/com/intellij/dvcs/push/PushController.java
platform/dvcs-impl/src/com/intellij/dvcs/push/RepositoryNodeListener.java
platform/dvcs-impl/src/com/intellij/dvcs/push/ui/EditableTreeNode.java
platform/dvcs-impl/src/com/intellij/dvcs/push/ui/PushLog.java
platform/dvcs-impl/src/com/intellij/dvcs/push/ui/RepositoryNode.java
platform/dvcs-impl/src/com/intellij/dvcs/push/ui/RepositoryWithBranchPanel.java
platform/dvcs-impl/src/com/intellij/dvcs/push/ui/SingleRepositoryNode.java
platform/dvcs-impl/src/com/intellij/dvcs/push/ui/VcsBranchEditorListener.java
platform/editor-ui-api/src/com/intellij/ide/ui/UISettings.java
platform/lang-impl/src/com/intellij/codeInsight/hint/actions/ShowImplementationsAction.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSettings.java
platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/ElseExpressionPostfixTemplateBase.java
platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/IfPostfixTemplateBase.java
platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java
platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/StatementWrapPostfixTemplate.java
platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/SurroundPostfixTemplateBase.java
platform/lang-impl/src/com/intellij/execution/impl/BeforeRunStepsPanel.java
platform/lang-impl/src/com/intellij/find/impl/FindInProjectTask.java
platform/lang-impl/src/com/intellij/ide/impl/convert/JDomConvertingUtil.java
platform/lang-impl/src/com/intellij/openapi/components/impl/stores/ModuleStoreImpl.java
platform/lang-impl/src/com/intellij/profile/codeInspection/InspectionProfileManagerImpl.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/tools/ToolsProcessor.java
platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java
platform/platform-api/src/com/intellij/ide/util/treeView/UpdaterTreeState.java
platform/platform-api/src/com/intellij/openapi/ui/popup/util/BaseListPopupStep.java
platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java
platform/platform-api/src/com/intellij/util/concurrency/QueueProcessor.java
platform/platform-impl/src/com/intellij/featureStatistics/FeatureUsageTrackerImpl.java
platform/platform-impl/src/com/intellij/ide/actions/PinActiveTabAction.java
platform/platform-impl/src/com/intellij/ide/actions/SplitAction.java
platform/platform-impl/src/com/intellij/ide/passwordSafe/impl/providers/masterKey/MasterKeyPasswordSafe.java
platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java
platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java
platform/platform-impl/src/com/intellij/ide/ui/AppearancePanel.form
platform/platform-impl/src/com/intellij/openapi/actionSystem/ex/QuickListsManager.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/BaseFileConfigurableStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/DefaultProjectStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/DirectoryBasedStorage.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/FileBasedStorage.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/XmlElementStorage.java
platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/EditorColorsManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorEmptyTextPainter.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorsSplitters.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/PreviewPanel.java
platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurableWrapper.java
platform/platform-impl/src/com/intellij/openapi/options/newEditor/SettingsTreeView.java
platform/platform-impl/src/com/intellij/openapi/ui/popup/MultiSelectionListPopupStep.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VfsRootAccess.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/CommandProcessor.java
platform/platform-resources-en/src/messages/IdeBundle.properties
platform/platform-resources-en/src/messages/InspectionsBundle.properties
platform/platform-resources/src/idea/LangActions.xml
platform/platform-tests/testSrc/com/intellij/formatting/GeneralCodeFormatterTest.java
platform/platform-tests/testSrc/com/intellij/ide/util/treeView/BaseTreeTestCase.java
platform/platform-tests/testSrc/com/intellij/openapi/components/impl/ApplicationStoreTest.java
platform/platform-tests/testSrc/com/intellij/openapi/components/impl/XmlElementStorageTest.java
platform/platform-tests/testSrc/com/intellij/openapi/progress/util/ProgressIndicatorTest.java [new file with mode: 0644]
platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DefaultStateSerializer.java
platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/DirectoryStorageData.java
platform/projectModel-impl/src/com/intellij/openapi/components/impl/stores/StorageData.java
platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentLoggingHandler.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudGitApplicationRuntime.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudLoggingHandlerImpl.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudSilentLoggingHandlerImpl.java
platform/script-debugger/debugger-ui/src/org/jetbrains/debugger/VariableView.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/GeneralTestEventsProcessor.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
platform/util-rt/src/com/intellij/openapi/util/Condition.java
platform/util-rt/src/com/intellij/openapi/util/Conditions.java
platform/util-rt/src/com/intellij/openapi/util/text/StringUtilRt.java
platform/util-rt/src/com/intellij/util/ArrayUtilRt.java
platform/util-rt/src/com/intellij/util/containers/ContainerUtilRt.java
platform/util/resources/misc/registry.properties
platform/util/src/com/intellij/openapi/util/JDOMUtil.java
platform/util/src/com/intellij/openapi/util/text/StringUtil.java
platform/util/src/com/intellij/util/ArrayUtil.java
platform/util/src/com/intellij/util/containers/ContainerUtil.java
platform/util/src/com/intellij/util/containers/TransferToEDTQueue.java
platform/util/src/com/intellij/util/ui/tree/WideSelectionTreeUI.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesFragmentedDiffPanel.java
platform/xdebugger-api/src/com/intellij/xdebugger/evaluation/XDebuggerEvaluator.java
platform/xdebugger-api/src/com/intellij/xdebugger/frame/XReferrersProvider.java
platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValue.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/XDebuggerEvaluationDialog.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/style/NestedMethodCallInspectionBase.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/NestedMethodCallInspection.java
plugins/InspectionGadgets/test/com/siyeh/igtest/confusing/NestedMethodCallInspection.java [deleted file]
plugins/InspectionGadgets/test/com/siyeh/igtest/style/nested_method_call/NestedMethodCall.java [new file with mode: 0644]
plugins/InspectionGadgets/testsrc/com/siyeh/ig/style/NestedMethodCallInspectionTest.java [new file with mode: 0644]
plugins/devkit/src/dom/impl/ExtensionDomExtender.java
plugins/devkit/testData/pluginXmlDomStubs/pluginWithXInclude-extensionPoints.xml [new file with mode: 0644]
plugins/devkit/testData/pluginXmlDomStubs/pluginWithXInclude-main.xml [new file with mode: 0644]
plugins/devkit/testData/pluginXmlDomStubs/pluginWithXInclude.xml [new file with mode: 0644]
plugins/devkit/testSources/codeInsight/PluginXmlDomStubsTest.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionUtil.java
plugins/hg4idea/hg4idea.iml
plugins/hg4idea/src/org/zmlx/hg4idea/push/HgPushSupport.java
plugins/hg4idea/src/org/zmlx/hg4idea/push/HgTargetEditor.java [new file with mode: 0644]
plugins/hg4idea/src/org/zmlx/hg4idea/util/HgUtil.java
plugins/java-decompiler/engine/build.xml [new file with mode: 0644]
plugins/java-decompiler/engine/readme.txt [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/CodeConstants.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/ConstantsUtil.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/ExceptionHandler.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/ExceptionTable.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/FullInstructionSequence.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/IfInstruction.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/Instruction.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/InstructionSequence.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/JumpInstruction.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/SimpleInstructionSequence.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/SwitchInstruction.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/cfg/BasicBlock.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/cfg/ControlFlowGraph.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/cfg/ExceptionRangeCFG.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/interpreter/InstructionImpact.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/interpreter/Util.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/ALOAD.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/ANEWARRAY.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/ASTORE.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/BIPUSH.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/CHECKCAST.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/DLOAD.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/DSTORE.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/FLOAD.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/FSTORE.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/GETFIELD.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/GETSTATIC.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/GOTO_W.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/IINC.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/ILOAD.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/INSTANCEOF.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEDYNAMIC.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEINTERFACE.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESPECIAL.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKESTATIC.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/INVOKEVIRTUAL.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/ISTORE.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/JSR.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/JSR_W.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/LDC.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/LDC2_W.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/LDC_W.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/LLOAD.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/LOOKUPSWITCH.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/LSTORE.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/MULTIANEWARRAY.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/NEW.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/NEWARRAY.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/PUTFIELD.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/PUTSTATIC.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/RET.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/SIPUSH.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/code/optinstructions/TABLESWITCH.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/AssertProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/ClassReference14Processor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/ClassWriter.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/ClassesProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/DecompilerContext.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/EnumProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/Fernflower.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/InitializerProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/collectors/CounterContainer.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/collectors/ImportCollector.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/collectors/VarNamesCollector.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/decompiler/ConsoleDecompiler.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/decompiler/IdeDecompiler.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/decompiler/WebDecompiler.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/decompiler/helper/PrintStreamLogger.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IBytecodeProvider.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IDecompilatSaver.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IFernflowerLogger.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IFernflowerPreferences.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/extern/IIdentifierRenamer.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/rels/ClassWrapper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/rels/LambdaProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/rels/MethodProcessorThread.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/rels/MethodWrapper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/rels/NestedClassProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/main/rels/NestedMemberAccess.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/code/DeadCodeHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/ClearStructHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/ConcatenationHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/DecHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/DomHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/EliminateLoopsHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/ExitHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/ExprProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/ExprentStack.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/FinallyProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/IdeaNotNullHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/IfHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/InlineSingleBlockHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/LabelHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/LoopExtractHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/LowBreakHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/MergeHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/PPandMMHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/PrimitiveExprsList.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/SecondaryFunctionsHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/SequenceHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/SimplifyExprentsHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/StackVarsProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/StatEdge.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/StrongConnectivityHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorEngine.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/DominatorTreeExceptionFilter.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/FastExtendedPostdominanceHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/GenericDominatorEngine.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraph.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/decompose/IGraphNode.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/ExceptionDeobfuscator.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/deobfuscator/IrreducibleCFGDeobfuscator.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AnnotationExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ArrayExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssertExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/AssignmentExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ConstExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/ExitExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/Exprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FieldExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/FunctionExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/IfExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/InvocationExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/MonitorExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/NewExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/SwitchExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/exps/VarExprent.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/DirectGraph.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/DirectNode.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/FlattenStatementsHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAConstructorSparseEx.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/sforms/SSAUConstructorSparseEx.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/BasicBlockStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchAllStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/CatchStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/DoStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/GeneralStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/IfStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/RootStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SequenceStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/Statement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SwitchStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/stats/SynchronizedStatement.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/CheckTypesResult.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarDefinitionHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarTypeProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionEdge.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionNode.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionPaar.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionsGraph.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/decompiler/vars/VarVersionsProcessor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/renamer/ClassWrapperNode.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/renamer/ConverterHelper.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/renamer/IdentifierConverter.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/modules/renamer/PoolInterceptor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/ContextUnit.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/IDecompiledData.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/StructClass.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/StructContext.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/StructField.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/StructMethod.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructAnnDefaultAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructAnnotationAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructAnnotationParameterAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructAnnotationTypeAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructBootstrapMethodsAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructConstantValueAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructEnclosingMethodAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructExceptionsAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructGeneralAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructGenericSignatureAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructInnerClassesAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/attr/StructLocalVariableTableAttribute.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/consts/ConstantPool.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/consts/LinkConstant.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/consts/PooledConstant.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/consts/PrimitiveConstant.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/consts/VariableTypeEnum.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/DataPoint.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/FieldDescriptor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/MethodDescriptor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/VarType.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericClassDescriptor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericFieldDescriptor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericMain.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericMethodDescriptor.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/gen/generics/GenericType.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/struct/lazy/LazyLoader.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/DataInputFullStream.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/FastFixedSetFactory.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/FastSetFactory.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/FastSparseSetFactory.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/InterpreterUtil.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/ListStack.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/SFormsFastMapDirect.java [new file with mode: 0644]
plugins/java-decompiler/engine/src/org/jetbrains/java/decompiler/util/VBStyleCollection.java [new file with mode: 0644]
plugins/java-decompiler/engine/test/org/jetbrains/java/decompiler/SingleClassesTest.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestClassFields.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestClassLambda.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestClassLoop.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestClassSwitch.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestClassTypes.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestClassVar.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestCodeConstructs.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestConstants$A.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestConstants.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestDeprecations$ByAnno.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestDeprecations$ByComment.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestDeprecations.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestEnum$1.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestEnum$2.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestEnum.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestExtendsList.class [moved from plugins/java-decompiler/testData/ExtendsList.class with 54% similarity]
plugins/java-decompiler/engine/testData/classes/pkg/TestMethodParameters$1Local.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestMethodParameters$C1.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestMethodParameters$C2.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/classes/pkg/TestMethodParameters.class [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestClassFields.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestClassLambda.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestClassLoop.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestClassSwitch.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestClassTypes.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestClassVar.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestCodeConstructs.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestConstants.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestDeprecations.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestEnum.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestExtendsList.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/results/TestMethodParameters.dec [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestClassFields.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestClassLambda.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestClassLoop.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestClassSwitch.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestClassTypes.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestClassVar.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestCodeConstructs.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestConstants.java [moved from plugins/java-decompiler/testData/Constants.java with 68% similarity]
plugins/java-decompiler/engine/testData/src/pkg/TestDeprecations.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestEnum.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestExtendsList.java [new file with mode: 0644]
plugins/java-decompiler/engine/testData/src/pkg/TestMethodParameters.java [new file with mode: 0644]
plugins/java-decompiler/java-decompiler.iml
plugins/java-decompiler/lib/fernflower.jar [deleted file]
plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaDecompiler.java
plugins/java-decompiler/src/org/jetbrains/java/decompiler/IdeaLogger.java
plugins/java-decompiler/test/org/jetbrains/java/decompiler/IdeaDecompilerTest.java
plugins/java-decompiler/testData/Anonymous$1.class [deleted file]
plugins/java-decompiler/testData/Anonymous.class [deleted file]
plugins/java-decompiler/testData/Anonymous.java [deleted file]
plugins/java-decompiler/testData/Anonymous.txt [deleted file]
plugins/java-decompiler/testData/CodeConstructs.class [deleted file]
plugins/java-decompiler/testData/CodeConstructs.java [deleted file]
plugins/java-decompiler/testData/CodeConstructs.txt [deleted file]
plugins/java-decompiler/testData/Constants$A.class [deleted file]
plugins/java-decompiler/testData/Constants.class [deleted file]
plugins/java-decompiler/testData/Constants.txt [deleted file]
plugins/java-decompiler/testData/Deprecations$ByAnno.class [deleted file]
plugins/java-decompiler/testData/Deprecations$ByComment.class [deleted file]
plugins/java-decompiler/testData/Deprecations.class [deleted file]
plugins/java-decompiler/testData/Deprecations.java [deleted file]
plugins/java-decompiler/testData/Deprecations.txt [deleted file]
plugins/java-decompiler/testData/Enum$1.class [deleted file]
plugins/java-decompiler/testData/Enum$2.class [deleted file]
plugins/java-decompiler/testData/Enum.class [deleted file]
plugins/java-decompiler/testData/Enum.java [deleted file]
plugins/java-decompiler/testData/Enum.txt [deleted file]
plugins/java-decompiler/testData/ExtendsList.java [deleted file]
plugins/java-decompiler/testData/ExtendsList.txt [deleted file]
plugins/java-decompiler/testData/Parameters$1Local.class [deleted file]
plugins/java-decompiler/testData/Parameters$C1.class [deleted file]
plugins/java-decompiler/testData/Parameters$C2.class [deleted file]
plugins/java-decompiler/testData/Parameters.class [deleted file]
plugins/java-decompiler/testData/Parameters.java [deleted file]
plugins/java-decompiler/testData/Parameters.txt [deleted file]
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenPathReferenceConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/plugins/api/common/MavenCommonParamReferenceProviders.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenArtifactDownloader.java
plugins/tasks/tasks-core/jira/src/com/intellij/tasks/jira/JiraRepository.java
plugins/tasks/tasks-core/src/com/intellij/tasks/gitlab/GitlabRepository.java
plugins/tasks/tasks-core/src/com/intellij/tasks/impl/httpclient/NewBaseRepositoryImpl.java
plugins/tasks/tasks-core/src/com/intellij/tasks/redmine/RedmineRepository.java
plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/JiraIntegrationTest.java
plugins/tasks/tasks-tests/test/com/intellij/tasks/integration/RedmineIntegrationTest.java
plugins/testng/src/com/theoryinpractice/testng/configuration/SearchingForTestsTask.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/search/SearchScope.java
python/edu/build/pycharm_edu_build.gant
python/edu/build/upload_pythonInfo.xml
python/edu/learn-python/resources/courses/introduction_course.zip
python/pydevSrc/com/jetbrains/python/debugger/IPyDebugProcess.java
python/pydevSrc/com/jetbrains/python/debugger/PyDebugValue.java
python/pydevSrc/com/jetbrains/python/debugger/PyFrameAccessor.java
python/pydevSrc/com/jetbrains/python/debugger/PyReferrersLoader.java [new file with mode: 0644]
python/pydevSrc/com/jetbrains/python/debugger/PyReferringObjectsValue.java [new file with mode: 0644]
python/pydevSrc/com/jetbrains/python/debugger/pydev/AbstractCommand.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/ConsoleExecCommand.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/GetReferrersCommand.java [new file with mode: 0644]
python/pydevSrc/com/jetbrains/python/debugger/pydev/GetVariableCommand.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/MultiProcessDebugger.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/ProcessDebugger.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/ProtocolParser.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/PyDebugCallback.java [new file with mode: 0644]
python/pydevSrc/com/jetbrains/python/debugger/pydev/PyVariableLocator.java [new file with mode: 0644]
python/pydevSrc/com/jetbrains/python/debugger/pydev/RemoteDebugger.java
python/pydevSrc/com/jetbrains/python/debugger/pydev/RunCustomOperationCommand.java [new file with mode: 0644]
python/src/META-INF/python-core.xml
python/src/com/jetbrains/python/console/PydevConsoleCommunication.java
python/src/com/jetbrains/python/console/PythonDebugConsoleCommunication.java
python/src/com/jetbrains/python/debugger/PyDebugProcess.java
python/src/com/jetbrains/python/debugger/PyExceptionBreakpointProperties.java
python/src/com/jetbrains/python/findUsages/PyFunctionFindUsagesHandler.java
python/src/com/jetbrains/python/hierarchy/call/PyCallDataManager.java [new file with mode: 0644]
python/src/com/jetbrains/python/hierarchy/call/PyCallHierarchyBrowser.java [new file with mode: 0644]
python/src/com/jetbrains/python/hierarchy/call/PyCallHierarchyNodeDescriptor.java [new file with mode: 0644]
python/src/com/jetbrains/python/hierarchy/call/PyCallHierarchyProvider.java [new file with mode: 0644]
python/src/com/jetbrains/python/hierarchy/call/PyCalleeFunctionTreeStructure.java [new file with mode: 0644]
python/src/com/jetbrains/python/hierarchy/call/PyCallerFunctionTreeStructure.java [new file with mode: 0644]
python/src/com/jetbrains/python/hierarchy/call/PyStaticCallDataManager.java [new file with mode: 0644]
python/src/com/jetbrains/python/hierarchy/call/PyStaticCallDataManagerImpl.java [new file with mode: 0644]
python/src/com/jetbrains/python/inspections/quickfix/PyDefaultArgumentQuickFix.java
python/src/com/jetbrains/python/inspections/quickfix/StatementEffectFunctionCallQuickFix.java
python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
python/src/com/jetbrains/python/sdk/flavors/WinPythonSdkFlavor.java
python/testData/hierarchy/call/Static/ArgumentList/ArgumentList_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/ArgumentList/ArgumentList_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/ArgumentList/file_1.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/ArgumentList/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/Constructor/Constructor_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Constructor/Constructor_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Constructor/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/DefaultValue/DefaultValue_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/DefaultValue/DefaultValue_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/DefaultValue/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/Inheritance/Inheritance_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Inheritance/Inheritance_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Inheritance/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/InnerFunction/InnerFunction_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/InnerFunction/InnerFunction_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/InnerFunction/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/Lambda/Lambda_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Lambda/Lambda_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Lambda/file_1.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/Lambda/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/NestedCall/NestedCall_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/NestedCall/NestedCall_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/NestedCall/file_1.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/NestedCall/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/OverriddenMethod/OverriddenMethod_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/OverriddenMethod/OverriddenMethod_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/OverriddenMethod/file_1.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/OverriddenMethod/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/Parentheses/Parentheses_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Parentheses/Parentheses_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Parentheses/file_1.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/Parentheses/main.py [new file with mode: 0644]
python/testData/hierarchy/call/Static/Simple/Simple_callee_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Simple/Simple_caller_verification.xml [new file with mode: 0644]
python/testData/hierarchy/call/Static/Simple/main.py [new file with mode: 0644]
python/testData/inspections/DefaultArgumentEmptyList.py
python/testData/inspections/DefaultArgumentEmptyList_after.py
python/testSrc/com/jetbrains/env/python/PythonDebuggerTest.java
python/testSrc/com/jetbrains/python/hierarchy/HierarchyTreeStructureViewer.java [new file with mode: 0644]
python/testSrc/com/jetbrains/python/hierarchy/PyCallHierarchyTest.java [new file with mode: 0644]
resources-en/src/messages/DebuggerBundle.properties
xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java
xml/dom-impl/src/com/intellij/util/xml/stubs/StubParentStrategy.java
xml/dom-tests/tests/com/intellij/util/xml/stubs/DomStubTest.java
xml/relaxng/src/org/intellij/plugins/relaxNG/convert/ConvertSchemaSettingsImpl.java

index 196b08ba10913a1051a74967c2014200f1a35732..27c51c853ea3bd001f872e73591e2ffc2fcbb5f2 100644 (file)
@@ -1,12 +1,12 @@
 <component name="libraryTable">
   <library name="JSch">
     <CLASSES>
-      <root url="jar://$PROJECT_DIR$/lib/jsch-0.1.50.jar!/" />
+      <root url="jar://$PROJECT_DIR$/lib/jsch-0.1.51.jar!/" />
     </CLASSES>
     <JAVADOC />
     <SOURCES>
-      <root url="jar://$PROJECT_DIR$/lib/src/jsch-0.1.50.zip!/jsch-0.1.50/src/main/java" />
-      <root url="jar://$PROJECT_DIR$/lib/src/jsch-0.1.50.zip!/jsch-0.1.50/examples" />
+      <root url="jar://$PROJECT_DIR$/lib/src/jsch-0.1.51.zip!/jsch-0.1.51/src/main/java" />
+      <root url="jar://$PROJECT_DIR$/lib/src/jsch-0.1.51.zip!/jsch-0.1.51/examples" />
     </SOURCES>
   </library>
 </component>
\ No newline at end of file
index e33f920fe1460a1e6ec435b544f778717978e58d..7d5698fc9aee3f8a55646d0795500fc371951e62 100644 (file)
@@ -554,14 +554,7 @@ public def layoutCommunityPlugins(String home) {
       }
     }
 
-    pluginDir("java-decompiler") {
-      dir("lib") {
-        jar("java-decompiler.jar") {
-          module("java-decompiler")
-        }
-        fileset(file: "$home/plugins/java-decompiler/lib/fernflower.jar")
-      }
-    }
+    layoutPlugin("java-decompiler")
   }
 }
 
index 5319444eaae63c34403288ef2e5df70bbef9e7a4..cdf6fb10c823b51a50d085644cdcf744ad0986a4 100644 (file)
@@ -196,7 +196,7 @@ libraryLicense(name: "JGoodies Forms", libraryName: "jgoodies-forms", version: "
 libraryLicense(name: "JGoodies Looks", libraryName: "jgoodies-looks", version: "2.4.2", license: "BSD ", url: "http://www.jgoodies.com/freeware/looks/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
 libraryLicense(name: "JGoodies Common", libraryName: "jgoodies-common", version: "1.2.1", license: "BSD ", url: "http://www.jgoodies.com/freeware/looks/", licenseUrl: "http://www.jgoodies.com/downloads/libraries.html")
 libraryLicense(name: "JNA", libraryName: "jna", version: "3.4.0", license: "LGPL 2.1", url: "https://jna.dev.java.net/", licenseUrl: "http://www.opensource.org/licenses/lgpl-2.1.php")
-libraryLicense(name: "JSch", libraryName: "JSch", version: "0.1.50", license: "BSD", url: "http://www.jcraft.com/jsch/", licenseUrl: "http://www.jcraft.com/jsch/LICENSE.txt")
+libraryLicense(name: "JSch", libraryName: "JSch", version: "0.1.51", license: "BSD", url: "http://www.jcraft.com/jsch/", licenseUrl: "http://www.jcraft.com/jsch/LICENSE.txt")
 libraryLicense(name: "jsch-agent-proxy", libraryName: "jsch-agent-proxy", version: "0.0.6", license: "BSD", url: "https://github.com/ymnk/jsch-agent-proxy", licenseUrl: "https://github.com/ymnk/jsch-agent-proxy/blob/master/LICENSE.txt")
 libraryLicense(name: "jsch-agent-proxy for svnkit trilead", libraryName: "jsch.agentproxy.svnkit-trilead-ssh2.jar", version: "0.0.6", license: "BSD", url: "https://github.com/ymnk/jsch-agent-proxy", licenseUrl: "https://github.com/ymnk/jsch-agent-proxy/blob/master/LICENSE.txt")
 libraryLicense(name: "JUnit", libraryName: "JUnit3", version: "3.8.1", license: "CPL 1.0", url: "http://junit.org/")
@@ -285,4 +285,3 @@ jetbrainsLibrary("JPS")
 jetbrainsLibrary("Maven Embedder")
 jetbrainsLibrary("tcServiceMessages")
 jetbrainsLibrary("optimizedFileManager.jar")
-jetbrainsLibrary("fernflower.jar")
index a528fa8840df91d8ff7a2918accff42880acc146..5104b681ee6fd8e1c46f65f73ac281771b838e30 100644 (file)
@@ -4,6 +4,3 @@ org.jetbrains.idea.svn.*
 org.jetbrains.idea.svn16.*
 com.intellij.util.net.ssl.*
 com.intellij.tasks.integration.live.*
-
-[DECOMPILER_TESTS]
-org.jetbrains.java.decompiler.*
index 815ddd231f14c674b2e643ed17328d6c31c2866b..a362e7d7caffffb7da41bab27ce989b931615843 100644 (file)
@@ -61,6 +61,7 @@ public class JavaReferringObjectsValue extends JavaValue {
 
   @Override
   public void computeChildren(@NotNull final XCompositeNode node) {
+    if (checkContextNotResumed(node)) return;
     getEvaluationContext().getDebugProcess().getManagerThread().schedule(
       new SuspendContextCommandImpl(getEvaluationContext().getSuspendContext()) {
         @Override
index 665ac7ebf16740f881d42630fb85d9983c61cde3..4d2b549d69f8dcbfc851545fef71cfdd2ec2928b 100644 (file)
@@ -29,125 +29,202 @@ import com.intellij.debugger.impl.DebuggerContextImpl;
 import com.intellij.debugger.jdi.StackFrameProxyImpl;
 import com.intellij.debugger.jdi.VirtualMachineProxyImpl;
 import com.intellij.debugger.settings.DebuggerSettings;
-import com.intellij.debugger.ui.impl.watch.*;
+import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
+import com.intellij.debugger.ui.impl.watch.StackFrameDescriptorImpl;
+import com.intellij.debugger.ui.impl.watch.ThreadDescriptorImpl;
 import com.intellij.idea.ActionsBundle;
 import com.intellij.openapi.actionSystem.ActionPlaces;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.CommonDataKeys;
+import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.MessageDialogBuilder;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.psi.PsiCodeBlock;
 import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiStatement;
 import com.intellij.psi.PsiTryStatement;
 import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.UIUtil;
 import com.intellij.xdebugger.XDebugSession;
+import com.intellij.xdebugger.XDebuggerBundle;
 import com.intellij.xdebugger.XDebuggerManager;
+import com.intellij.xdebugger.evaluation.EvaluationMode;
+import com.intellij.xdebugger.evaluation.XDebuggerEvaluator;
 import com.intellij.xdebugger.frame.XStackFrame;
+import com.intellij.xdebugger.frame.XValue;
+import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl;
 import com.sun.jdi.InvalidStackFrameException;
 import com.sun.jdi.NativeMethodException;
 import com.sun.jdi.VMDisconnectedException;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class PopFrameAction extends DebuggerAction {
   public void actionPerformed(AnActionEvent e) {
-    Project project = e.getData(CommonDataKeys.PROJECT);
-    StackFrameProxyImpl stackFrame = getStackFrameProxy(e);
+    final Project project = e.getData(CommonDataKeys.PROJECT);
+    final JavaStackFrame stackFrame = getStackFrame(e);
     if(stackFrame == null) {
       return;
     }
     try {
-      DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
-      DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
+      final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
+      final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
       if(debugProcess == null) {
         return;
       }
-      if (DebuggerSettings.getInstance().CHECK_FINALLY_ON_POP_FRAME && isInTryWithFinally(debuggerContext.getSourcePosition())) {
-        int res = MessageDialogBuilder
-          .yesNo(UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)),
-                 DebuggerBundle.message("warning.finally.block.detected"))
-          .project(project)
-          .icon(Messages.getWarningIcon())
-          .yesText(DebuggerBundle.message("button.drop.anyway"))
-          .noText(CommonBundle.message("button.cancel"))
-          .doNotAsk(
-            new DialogWrapper.DoNotAskOption() {
-              @Override
-              public boolean isToBeShown() {
-                return DebuggerSettings.getInstance().CHECK_FINALLY_ON_POP_FRAME;
-              }
-
-              @Override
-              public void setToBeShown(boolean value, int exitCode) {
-                DebuggerSettings.getInstance().CHECK_FINALLY_ON_POP_FRAME = false;
-              }
-
-              @Override
-              public boolean canBeHidden() {
-                return true;
-              }
-
-              @Override
-              public boolean shouldSaveOptionsOnCancel() {
-                return false;
-              }
-
-              @NotNull
-              @Override
-              public String getDoNotShowMessage() {
-                return CommonBundle.message("dialog.options.do.not.show");
-              }
-            })
-          .show();
-
-        if (res == Messages.NO) {
-          return;
+
+      if (!DebuggerSettings.EVALUATE_FINALLY_NEVER.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME)) {
+        List<PsiStatement> statements = getFinallyStatements(debuggerContext.getSourcePosition());
+        if (!statements.isEmpty()) {
+          StringBuilder sb = new StringBuilder();
+          for (PsiStatement statement : statements) {
+            sb.append("\n").append(statement.getText());
+          }
+          if (DebuggerSettings.EVALUATE_FINALLY_ALWAYS.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME)) {
+            evaluateAndPop(project, stackFrame, debuggerContext, debugProcess, sb);
+            return;
+          }
+          else {
+            int res = MessageDialogBuilder
+              .yesNoCancel(UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)),
+                           DebuggerBundle.message("warning.finally.block.detected") + sb)
+              .project(project)
+              .icon(Messages.getWarningIcon())
+              .yesText(DebuggerBundle.message("button.execute.finally"))
+              .noText(DebuggerBundle.message("button.drop.anyway"))
+              .cancelText(CommonBundle.message("button.cancel"))
+              .doNotAsk(
+                new DialogWrapper.DoNotAskOption() {
+                  @Override
+                  public boolean isToBeShown() {
+                    return !DebuggerSettings.EVALUATE_FINALLY_ALWAYS.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME) &&
+                           !DebuggerSettings.EVALUATE_FINALLY_NEVER.equals(DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME);
+                  }
+
+                  @Override
+                  public void setToBeShown(boolean value, int exitCode) {
+                    if (!value) {
+                      DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME =
+                        exitCode == Messages.YES ? DebuggerSettings.EVALUATE_FINALLY_ALWAYS : DebuggerSettings.EVALUATE_FINALLY_NEVER;
+                    }
+                    else {
+                      DebuggerSettings.getInstance().EVALUATE_FINALLY_ON_POP_FRAME = DebuggerSettings.EVALUATE_FINALLY_ASK;
+                    }
+                  }
+
+                  @Override
+                  public boolean canBeHidden() {
+                    return true;
+                  }
+
+                  @Override
+                  public boolean shouldSaveOptionsOnCancel() {
+                    return false;
+                  }
+
+                  @NotNull
+                  @Override
+                  public String getDoNotShowMessage() {
+                    return CommonBundle.message("dialog.options.do.not.show");
+                  }
+                })
+              .show();
+
+            switch (res) {
+              case Messages.CANCEL:
+                return;
+              case Messages.NO:
+                break;
+              case Messages.YES: // evaluate finally
+                evaluateAndPop(project, stackFrame, debuggerContext, debugProcess, sb);
+                return;
+            }
+          }
         }
       }
-      debugProcess.getManagerThread().schedule(debugProcess.createPopFrameCommand(debuggerContext, stackFrame));
+      debugProcess.getManagerThread().schedule(debugProcess.createPopFrameCommand(debuggerContext, stackFrame.getStackFrameProxy()));
     }
     catch (NativeMethodException e2){
-      Messages.showMessageDialog(project, DebuggerBundle.message("error.native.method.exception"), UIUtil.removeMnemonic(
-        ActionsBundle.actionText(DebuggerActions.POP_FRAME)), Messages.getErrorIcon());
+      Messages.showMessageDialog(project, DebuggerBundle.message("error.native.method.exception"),
+                                 UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)), Messages.getErrorIcon());
     }
     catch (InvalidStackFrameException ignored) {
     }
-    catch(VMDisconnectedException vde) {
+    catch(VMDisconnectedException ignored) {
     }
   }
 
-  private static boolean isInTryWithFinally(SourcePosition position) {
+  private static void evaluateAndPop(final Project project,
+                                     final JavaStackFrame stackFrame,
+                                     final DebuggerContextImpl debuggerContext,
+                                     final DebugProcessImpl debugProcess, StringBuilder sb) {
+    XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
+    if (evaluator != null) {
+      evaluator.evaluate(XExpressionImpl.fromText(sb.toString(), EvaluationMode.CODE_FRAGMENT),
+                         new XDebuggerEvaluator.XEvaluationCallback() {
+                           @Override
+                           public void evaluated(@NotNull XValue result) {
+                             debugProcess.getManagerThread()
+                               .schedule(debugProcess.createPopFrameCommand(debuggerContext, stackFrame.getStackFrameProxy()));
+                           }
+
+                           @Override
+                           public void errorOccurred(@NotNull final String errorMessage) {
+                             ApplicationManager.getApplication().invokeLater(new Runnable() {
+                               @Override
+                               public void run() {
+                                 Messages
+                                   .showMessageDialog(project, DebuggerBundle.message("error.executing.finally", errorMessage),
+                                                      UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)),
+                                                      Messages.getErrorIcon());
+                               }
+                             });
+                           }
+                         }, stackFrame.getSourcePosition());
+    }
+    else {
+      Messages.showMessageDialog(project, XDebuggerBundle.message("xdebugger.evaluate.stack.frame.has.not.evaluator"),
+                                 UIUtil.removeMnemonic(ActionsBundle.actionText(DebuggerActions.POP_FRAME)),
+                                 Messages.getErrorIcon());
+    }
+  }
+
+  private static List<PsiStatement> getFinallyStatements(SourcePosition position) {
+    List<PsiStatement> res = new ArrayList<PsiStatement>();
     PsiElement element = position.getFile().findElementAt(position.getOffset());
     PsiTryStatement tryStatement = PsiTreeUtil.getParentOfType(element, PsiTryStatement.class);
     while (tryStatement != null) {
       PsiCodeBlock finallyBlock = tryStatement.getFinallyBlock();
-      if (finallyBlock != null && finallyBlock.getStatements().length > 0) {
-        return true;
+      if (finallyBlock != null) {
+        ContainerUtil.addAll(res, finallyBlock.getStatements());
       }
       tryStatement = PsiTreeUtil.getParentOfType(tryStatement, PsiTryStatement.class);
     }
-    return false;
+    return res;
   }
 
   @Nullable
-  private static StackFrameProxyImpl getStackFrameProxy(AnActionEvent e) {
-    DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
-    if(selectedNode != null) {
-      NodeDescriptorImpl descriptor = selectedNode.getDescriptor();
-      if(descriptor instanceof StackFrameDescriptorImpl) {
-        if(selectedNode.getNextSibling() != null) {
-          StackFrameDescriptorImpl frameDescriptor = ((StackFrameDescriptorImpl)descriptor);
-          return frameDescriptor.getFrameProxy();
-        }
-        return null;
-      }
-      else if(descriptor instanceof ThreadDescriptorImpl || descriptor instanceof ThreadGroupDescriptorImpl) {
-        return null;
-      }
-    }
+  private static JavaStackFrame getStackFrame(AnActionEvent e) {
+    //DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
+    //if(selectedNode != null) {
+    //  NodeDescriptorImpl descriptor = selectedNode.getDescriptor();
+    //  if(descriptor instanceof StackFrameDescriptorImpl) {
+    //    if(selectedNode.getNextSibling() != null) {
+    //      StackFrameDescriptorImpl frameDescriptor = ((StackFrameDescriptorImpl)descriptor);
+    //      return frameDescriptor.getFrameProxy();
+    //    }
+    //    return null;
+    //  }
+    //  else if(descriptor instanceof ThreadDescriptorImpl || descriptor instanceof ThreadGroupDescriptorImpl) {
+    //    return null;
+    //  }
+    //}
 
     Project project = e.getProject();
     if (project != null) {
@@ -156,18 +233,19 @@ public class PopFrameAction extends DebuggerAction {
         XStackFrame frame = session.getCurrentStackFrame();
         if (frame instanceof JavaStackFrame) {
           StackFrameProxyImpl proxy = ((JavaStackFrame)frame).getStackFrameProxy();
-          return !proxy.isBottom() ? proxy : null;
+          return !proxy.isBottom() ? ((JavaStackFrame)frame) : null;
         }
       }
     }
 
-    DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
-    StackFrameProxyImpl frameProxy = debuggerContext.getFrameProxy();
-
-    if(frameProxy == null || frameProxy.isBottom()) {
-      return null;
-    }
-    return frameProxy;
+    //DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
+    //StackFrameProxyImpl frameProxy = debuggerContext.getFrameProxy();
+    //
+    //if(frameProxy == null || frameProxy.isBottom()) {
+    //  return null;
+    //}
+    //return frameProxy;
+    return null;
   }
 
   private static boolean isAtBreakpoint(AnActionEvent e) {
@@ -185,10 +263,10 @@ public class PopFrameAction extends DebuggerAction {
 
   public void update(AnActionEvent e) {
     boolean enable = false;
-    StackFrameProxyImpl stackFrameProxy = getStackFrameProxy(e);
+    JavaStackFrame stackFrame = getStackFrame(e);
 
-    if(stackFrameProxy != null && isAtBreakpoint(e)) {
-      VirtualMachineProxyImpl virtualMachineProxy = stackFrameProxy.getVirtualMachine();
+    if(stackFrame != null && isAtBreakpoint(e)) {
+      VirtualMachineProxyImpl virtualMachineProxy = stackFrame.getStackFrameProxy().getVirtualMachine();
       enable = virtualMachineProxy.canPopFrames();
     }
 
index f2178c1d4fb532c9280e39b614ef7e060c97b3ca..2eab90666967f565e2ee01c03ce777a9710fe407 100644 (file)
@@ -82,9 +82,11 @@ public class JavaDebuggerEvaluator extends XDebuggerEvaluator {
           return;
         }
         JavaDebugProcess process = myDebugProcess.getXdebugProcess();
-        if (process != null) {
-          callback.evaluated(JavaValue.create(null, descriptor, evalContext, process.getNodeManager(), true));
+        if (process == null) {
+          callback.errorOccurred("No debug process");
+          return;
         }
+        callback.evaluated(JavaValue.create(null, descriptor, evalContext, process.getNodeManager(), true));
       }
     });
   }
index 7b0ffffe98d5fce108c53ef92938d0951982d34e..fd3a15bd8943c43878b56a8e9e69a0badf2bd714 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.debugger.engine;
 
+import com.intellij.debugger.DebuggerBundle;
 import com.intellij.debugger.DebuggerInvocationUtil;
 import com.intellij.debugger.SourcePosition;
 import com.intellij.debugger.actions.JavaReferringObjectsValue;
@@ -273,7 +274,7 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
 
   @Override
   public void computeChildren(@NotNull final XCompositeNode node) {
-    if (myEvaluationContext.getSuspendContext().isResumed()) return;
+    if (checkContextNotResumed(node)) return;
     myEvaluationContext.getDebugProcess().getManagerThread().schedule(new SuspendContextCommandImpl(myEvaluationContext.getSuspendContext()) {
       @Override
       public Priority getPriority() {
@@ -335,6 +336,14 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
     });
   }
 
+  protected boolean checkContextNotResumed(XCompositeNode node) {
+    if (myEvaluationContext.getSuspendContext().isResumed()) {
+      node.setErrorMessage(DebuggerBundle.message("error.context.has.changed"));
+      return true;
+    }
+    return false;
+  }
+
   @Override
   public void computeSourcePosition(@NotNull final XNavigatable navigatable) {
     if (myEvaluationContext.getSuspendContext().isResumed()) return;
index d18b0eb15fca671d1d6334e14bb9dd7545632c20..2855ab4dfc1f2b66ac02544a8528d3a37d42d07f 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.openapi.components.*;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.InvalidDataException;
 import com.intellij.openapi.util.WriteExternalException;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.ui.classFilter.ClassFilter;
 import com.intellij.util.containers.hash.LinkedHashMap;
 import com.intellij.util.xmlb.SkipDefaultValuesSerializationFilters;
@@ -55,6 +56,10 @@ public class DebuggerSettings implements Cloneable, PersistentStateComponent<Ele
   @NonNls public static final String RUN_HOTSWAP_NEVER = "RunHotswapNever";
   @NonNls public static final String RUN_HOTSWAP_ASK = "RunHotswapAsk";
 
+  @NonNls public static final String EVALUATE_FINALLY_ALWAYS = "EvaluateFinallyAlways";
+  @NonNls public static final String EVALUATE_FINALLY_NEVER = "EvaluateFinallyNever";
+  @NonNls public static final String EVALUATE_FINALLY_ASK = "EvaluateFinallyAsk";
+
   public boolean TRACING_FILTERS_ENABLED;
   public int DEBUGGER_TRANSPORT;
   public boolean FORCE_CLASSIC_VM;
@@ -74,7 +79,7 @@ public class DebuggerSettings implements Cloneable, PersistentStateComponent<Ele
   public volatile boolean AUTO_VARIABLES_MODE = false;
   public volatile boolean SHOW_LIBRARY_STACKFRAMES = true;
 
-  public boolean CHECK_FINALLY_ON_POP_FRAME = true;
+  public String EVALUATE_FINALLY_ON_POP_FRAME = EVALUATE_FINALLY_ASK;
 
   private ClassFilter[] mySteppingFilters = ClassFilter.EMPTY_ARRAY;
 
@@ -144,7 +149,7 @@ public class DebuggerSettings implements Cloneable, PersistentStateComponent<Ele
     return
       TRACING_FILTERS_ENABLED == secondSettings.TRACING_FILTERS_ENABLED &&
       DEBUGGER_TRANSPORT == secondSettings.DEBUGGER_TRANSPORT &&
-      CHECK_FINALLY_ON_POP_FRAME == secondSettings.CHECK_FINALLY_ON_POP_FRAME &&
+      StringUtil.equals(EVALUATE_FINALLY_ON_POP_FRAME, secondSettings.EVALUATE_FINALLY_ON_POP_FRAME) &&
       FORCE_CLASSIC_VM == secondSettings.FORCE_CLASSIC_VM &&
       DISABLE_JIT == secondSettings.DISABLE_JIT &&
       HOTSWAP_IN_BACKGROUND == secondSettings.HOTSWAP_IN_BACKGROUND &&
index a1dc11590ade48b855ac495e99bdb2369ad3ef70..914df8b14a838b78e30dfcff7a9b0b7c2ca61b1c 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.ui.classFilter.ClassFilterEditor;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
+import javax.swing.border.Border;
 import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -33,7 +34,9 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
   private JCheckBox myCbSkipClassLoaders;
   private ClassFilterEditor mySteppingFilterEditor;
   private JCheckBox myCbSkipSimpleGetters;
-  private JCheckBox myCbCheckFinallyOnPopFrame;
+  private JRadioButton myRbEvaluateFinallyAlways;
+  private JRadioButton myRbEvaluateFinallyNever;
+  private JRadioButton myRbEvaluateFinallyAsk;
 
   @Override
   public void reset(@NotNull DebuggerSettings settings) {
@@ -47,7 +50,15 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
     mySteppingFilterEditor.setFilters(settings.getSteppingFilters());
     mySteppingFilterEditor.setEnabled(settings.TRACING_FILTERS_ENABLED);
 
-    myCbCheckFinallyOnPopFrame.setSelected(settings.CHECK_FINALLY_ON_POP_FRAME);
+    if (DebuggerSettings.EVALUATE_FINALLY_ALWAYS.equals(settings.EVALUATE_FINALLY_ON_POP_FRAME)) {
+      myRbEvaluateFinallyAlways.setSelected(true);
+    }
+    else if (DebuggerSettings.EVALUATE_FINALLY_NEVER.equals(settings.EVALUATE_FINALLY_ON_POP_FRAME)) {
+      myRbEvaluateFinallyNever.setSelected(true);
+    }
+    else {
+      myRbEvaluateFinallyAsk.setSelected(true);
+    }
   }
 
   @Override
@@ -62,7 +73,15 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
     settings.SKIP_CLASSLOADERS = myCbSkipClassLoaders.isSelected();
     settings.TRACING_FILTERS_ENABLED = myCbStepInfoFiltersEnabled.isSelected();
 
-    settings.CHECK_FINALLY_ON_POP_FRAME = myCbCheckFinallyOnPopFrame.isSelected();
+    if (myRbEvaluateFinallyAlways.isSelected()) {
+      settings.EVALUATE_FINALLY_ON_POP_FRAME = DebuggerSettings.EVALUATE_FINALLY_ALWAYS;
+    }
+    else if (myRbEvaluateFinallyNever.isSelected()) {
+      settings.EVALUATE_FINALLY_ON_POP_FRAME = DebuggerSettings.EVALUATE_FINALLY_NEVER;
+    }
+    else {
+      settings.EVALUATE_FINALLY_ON_POP_FRAME = DebuggerSettings.EVALUATE_FINALLY_ASK;
+    }
 
     mySteppingFilterEditor.stopEditing();
     settings.setSteppingFilters(mySteppingFilterEditor.getFilters());
@@ -83,13 +102,11 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
     myCbSkipConstructors = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.constructors"));
     myCbSkipClassLoaders = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.classLoaders"));
     myCbSkipSimpleGetters = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.skip.simple.getters"));
-    myCbCheckFinallyOnPopFrame = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.check.finally.on.pop"));
     myCbStepInfoFiltersEnabled = new JCheckBox(DebuggerBundle.message("label.debugger.general.configurable.step.filters.list.header"));
     panel.add(myCbSkipSyntheticMethods, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0),0, 0));
     panel.add(myCbSkipConstructors, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0),0, 0));
     panel.add(myCbSkipClassLoaders, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0),0, 0));
     panel.add(myCbSkipSimpleGetters, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0),0, 0));
-    panel.add(myCbCheckFinallyOnPopFrame, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0),0, 0));
     panel.add(myCbStepInfoFiltersEnabled, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(8, 0, 0, 0),0, 0));
 
     mySteppingFilterEditor = new ClassFilterEditor(JavaDebuggerSupport.getContextProjectForEditorFieldsInDebuggerConfigurables(), null, "reference.viewBreakpoints.classFilters.newPattern");
@@ -101,6 +118,33 @@ class DebuggerSteppingConfigurable implements ConfigurableUi<DebuggerSettings> {
         mySteppingFilterEditor.setEnabled(myCbStepInfoFiltersEnabled.isSelected());
       }
     });
+
+    myRbEvaluateFinallyAlways = new JRadioButton(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.always"));
+    myRbEvaluateFinallyNever = new JRadioButton(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.never"));
+    myRbEvaluateFinallyAsk = new JRadioButton(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.ask"));
+
+    int cbLeftOffset = 0;
+    final Border border = myCbSkipSimpleGetters.getBorder();
+    if (border != null) {
+      final Insets insets = border.getBorderInsets(myCbSkipSimpleGetters);
+      if (insets != null) {
+        cbLeftOffset = insets.left;
+      }
+    }
+
+    final ButtonGroup group = new ButtonGroup();
+    group.add(myRbEvaluateFinallyAlways);
+    group.add(myRbEvaluateFinallyNever);
+    group.add(myRbEvaluateFinallyAsk);
+    final Box box = Box.createHorizontalBox();
+    box.add(myRbEvaluateFinallyAlways);
+    box.add(myRbEvaluateFinallyNever);
+    box.add(myRbEvaluateFinallyAsk);
+    final JPanel evalFinallyPanel = new JPanel(new BorderLayout());
+    evalFinallyPanel.add(box, BorderLayout.CENTER);
+    evalFinallyPanel.add(new JLabel(DebuggerBundle.message("label.debugger.general.configurable.evaluate.finally.on.pop")), BorderLayout.WEST);
+    panel.add(evalFinallyPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(4, cbLeftOffset, 0, 0), 0, 0));
+
     return panel;
   }
 }
\ No newline at end of file
index 1f880513cacda7c265542e6f33775d176162b2cf..510a74e9e5792c0a8ee68d5b6ae08a467bbb772d 100644 (file)
@@ -27,12 +27,14 @@ import com.intellij.debugger.engine.evaluation.expression.Modifier;
 import com.intellij.debugger.impl.DebuggerUtilsEx;
 import com.intellij.debugger.impl.PositionUtil;
 import com.intellij.debugger.jdi.StackFrameProxyImpl;
+import com.intellij.debugger.jdi.VirtualMachineProxyImpl;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.registry.Registry;
 import com.intellij.psi.PsiCodeFragment;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiExpression;
 import com.intellij.psi.PsiExpressionCodeFragment;
+import com.sun.jdi.ObjectCollectedException;
 import com.sun.jdi.ObjectReference;
 import com.sun.jdi.Value;
 import org.jetbrains.annotations.NotNull;
@@ -106,7 +108,11 @@ public abstract class EvaluationDescriptor extends ValueDescriptorImpl{
 
       final Value value = evaluator.evaluate(thisEvaluationContext);
       if (value instanceof ObjectReference) {
-        thisEvaluationContext.getSuspendContext().keep(((ObjectReference)value));
+        ObjectReference objRef = (ObjectReference)value;
+        if (VirtualMachineProxyImpl.isCollected(objRef)) {
+          throw EvaluateExceptionUtil.OBJECT_WAS_COLLECTED;
+        }
+        thisEvaluationContext.getSuspendContext().keep(objRef);
       }
       myModifier = evaluator.getModifier();
       setLvalue(myModifier != null);
@@ -116,6 +122,9 @@ public abstract class EvaluationDescriptor extends ValueDescriptorImpl{
     catch (final EvaluateException ex) {
       throw new EvaluateException(ex.getLocalizedMessage(), ex);
     }
+    catch (ObjectCollectedException ex) {
+      throw EvaluateExceptionUtil.OBJECT_WAS_COLLECTED;
+    }
   }
 
   public String calcValueName() {
index 45f50d34b9227d062b62bbdfec4a765501708a1a..86bdbde182018c201f7eddc1b7a62ecef2e2b8bf 100644 (file)
@@ -233,7 +233,7 @@ public abstract class SourcePosition implements Navigatable{
             }
           }
 
-          PsiElement element;
+          PsiElement element = null;
           int offset = startOffset;
           while (true) {
             final CharSequence charsSequence = document.getCharsSequence();
@@ -243,6 +243,8 @@ public abstract class SourcePosition implements Navigatable{
                 break;
               }
             }
+            if (offset >= charsSequence.length()) break;
+
             element = rootElement.findElementAt(offset);
 
             if (element instanceof PsiComment) {
index d318ad47bb70a606f193b44309a4eff7f3e5a0ed..74c919537d45d18953d64bd92bdc72b97218eafb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import com.intellij.openapi.fileEditor.TextEditor;
 import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.ui.popup.JBPopupFactory;
 import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
 import com.intellij.psi.*;
 import com.intellij.psi.search.searches.ClassInheritorsSearch;
 import com.intellij.psi.util.PsiClassUtil;
@@ -59,7 +60,7 @@ public class InheritorChooser {
                                           final Runnable performRunnable,
                                           final PsiMethod psiMethod,
                                           final PsiClass containingClass) {
-    return runMethodInAbstractClass(context, performRunnable, psiMethod, containingClass, Condition.TRUE);
+    return runMethodInAbstractClass(context, performRunnable, psiMethod, containingClass, Conditions.<PsiClass>alwaysTrue());
   }
 
   public boolean runMethodInAbstractClass(final ConfigurationContext context,
index 813ff25caee27e8d470c97a9de337f39a4ad70d6..c9230625eecd18247bce3606f6dc5f813675eae6 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.codeInspection.dataFlow.ContractInference;
 import com.intellij.codeInspection.dataFlow.MethodContract;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.PsiAnnotation;
+import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiMethod;
 import com.intellij.psi.PsiModifierListOwner;
 import com.intellij.psi.util.PsiUtil;
@@ -32,9 +33,17 @@ import java.util.List;
 import static com.intellij.codeInspection.dataFlow.ControlFlowAnalyzer.ORG_JETBRAINS_ANNOTATIONS_CONTRACT;
 
 public class InferredAnnotationsManagerImpl extends InferredAnnotationsManager {
+
+  @NotNull
+  private static PsiModifierListOwner preferCompiledElement(@NotNull PsiModifierListOwner element) {
+    PsiElement original = element.getOriginalElement();
+    return original instanceof PsiModifierListOwner ? (PsiModifierListOwner)original : element;
+  }
+
   @Nullable
   @Override
   public PsiAnnotation findInferredAnnotation(@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) {
+    listOwner = preferCompiledElement(listOwner);
     PsiAnnotation fromBytecode = ProjectBytecodeAnalysis.getInstance(listOwner.getProject()).findInferredAnnotation(listOwner, annotationFQN);
     if (fromBytecode != null) {
       return fromBytecode;
@@ -57,6 +66,7 @@ public class InferredAnnotationsManagerImpl extends InferredAnnotationsManager {
   @NotNull
   @Override
   public PsiAnnotation[] findInferredAnnotations(@NotNull PsiModifierListOwner listOwner) {
+    listOwner = preferCompiledElement(listOwner);
     List<PsiAnnotation> result = ContainerUtil.newArrayList();
     PsiAnnotation[] fromBytecode = ProjectBytecodeAnalysis.getInstance(listOwner.getProject()).findInferredAnnotations(listOwner);
     for (PsiAnnotation annotation : fromBytecode) {
index a7070b882431ca18df0ae22c57289de9c918bb5e..4311dd39c2c0f07736225f131766d0e7bec4b044 100644 (file)
@@ -40,7 +40,7 @@ public class BytecodeAnalysisIndex extends FileBasedIndexExtension<Bytes, HEquat
   private static final ClassDataIndexer INDEXER = new ClassDataIndexer();
   private static final HKeyDescriptor KEY_DESCRIPTOR = new HKeyDescriptor();
 
-  private static final int ourInternalVersion = 1;
+  private static final int ourInternalVersion = 2;
   private static boolean ourEnabled = SystemProperties.getBooleanProperty("idea.enable.bytecode.contract.inference", true);
 
   @NotNull
index 7e178538f60fd6ed8bd03d1b6a2a30c874162d5a..4dde00c4057ed1d92d970df797e506719c396d34 100644 (file)
@@ -31,6 +31,7 @@ import com.siyeh.ig.psiutils.SideEffectChecker;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
@@ -130,12 +131,13 @@ class ContractInferenceInterpreter {
     return RecursionManager.doPreventingRecursion(myMethod, true, new Computable<List<MethodContract>>() {
       @Override
       public List<MethodContract> compute() {
-        List<MethodContract> delegateContracts = ControlFlowAnalyzer.getMethodContracts(targetMethod);
-        return ContainerUtil.mapNotNull(delegateContracts, new NullableFunction<MethodContract, MethodContract>() {
+        final boolean notNull = NullableNotNullManager.isNotNull(targetMethod);
+        final ValueConstraint[] emptyConstraints = MethodContract.createConstraintArray(myMethod.getParameterList().getParametersCount());
+        List<MethodContract> fromDelegate = ContainerUtil.mapNotNull(ControlFlowAnalyzer.getMethodContracts(targetMethod), new NullableFunction<MethodContract, MethodContract>() {
           @Nullable
           @Override
           public MethodContract fun(MethodContract delegateContract) {
-            ValueConstraint[] answer = MethodContract.createConstraintArray(myMethod.getParameterList().getParametersCount());
+            ValueConstraint[] answer = emptyConstraints;
             for (int i = 0; i < delegateContract.arguments.length; i++) {
               if (i >= arguments.length) return null;
 
@@ -155,9 +157,17 @@ class ContractInferenceInterpreter {
                 }
               }
             }
-            return answer == null ? null : new MethodContract(answer, negated ? negateConstraint(delegateContract.returnValue) : delegateContract.returnValue);
+            ValueConstraint returnValue = negated ? negateConstraint(delegateContract.returnValue) : delegateContract.returnValue;
+            if (notNull && returnValue != THROW_EXCEPTION) {
+              returnValue = NOT_NULL_VALUE;
+            }
+            return answer == null ? null : new MethodContract(answer, returnValue);
           }
         });
+        if (notNull) {
+          return ContainerUtil.concat(fromDelegate, Arrays.asList(new MethodContract(emptyConstraints, NOT_NULL_VALUE)));
+        }
+        return fromDelegate;
       }
     });
   }
index 7539d71957019467bd6c14d1122f1ae842043a04..92777dd659e0631516684e90681752d10f0aeba4 100644 (file)
@@ -1434,6 +1434,10 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
     final PsiAnnotation contractAnno = findContractAnnotation(method);
     final int paramCount = method.getParameterList().getParametersCount();
     if (contractAnno != null) {
+      if (AnnotationUtil.isInferredAnnotation(contractAnno) && PsiUtil.canBeOverriden(method)) {
+        return Collections.emptyList();
+      }
+
       return CachedValuesManager.getCachedValue(contractAnno, new CachedValueProvider<List<MethodContract>>() {
         @Nullable
         @Override
index 36449128b494b3d514383e6dcd75e6521815152d..96102b53f5d4257bb5e38ae6a12bd917da848eee 100644 (file)
@@ -70,7 +70,9 @@ public class StandardInstructionVisitor extends InstructionVisitor {
 
       DfaValueFactory factory = runner.getFactory();
       if (dfaSource instanceof DfaVariableValue && factory.getVarFactory().getAllQualifiedBy(var).contains(dfaSource)) {
-        dfaSource = factory.createTypeValue(((DfaVariableValue)dfaSource).getVariableType(), ((DfaVariableValue)dfaSource).getInherentNullability());
+        Nullness nullability = memState.isNotNull(dfaSource) ? Nullness.NOT_NULL
+                                                             : ((DfaVariableValue)dfaSource).getInherentNullability();
+        dfaSource = factory.createTypeValue(((DfaVariableValue)dfaSource).getVariableType(), nullability);
       }
 
       if (var.getInherentNullability() == Nullness.NOT_NULL) {
index 7ebce779c3a8dd99f4686a228224ce84dd10531f..9b32f8a4c00070e2a6f501ad568188f489ba1253 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.codeInspection.dataFlow.DfaPsiUtil;
 import com.intellij.codeInspection.dataFlow.Nullness;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
 import com.intellij.openapi.util.registry.Registry;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.JavaConstantExpressionEvaluator;
@@ -50,8 +51,7 @@ public class DfaExpressionFactory {
     }
     catch (Exception e) {
       LOG.error(e);
-      //noinspection unchecked
-      return Condition.FALSE;
+      return Conditions.alwaysFalse();
     }
   }
 
similarity index 91%
rename from java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcode.java
rename to java/java-analysis-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcodeBase.java
index 4c41d90a9afac79578556c1f7ccd568f573f8dcd..6a5f0627d5e139966cefabd21ed0c18fc1942069 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 package com.intellij.codeInspection.equalsAndHashcode;
 
-import com.intellij.codeInspection.BaseJavaBatchLocalInspectionTool;
-import com.intellij.codeInspection.InspectionsBundle;
-import com.intellij.codeInspection.LocalQuickFix;
-import com.intellij.codeInspection.ProblemsHolder;
+import com.intellij.codeInspection.*;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.ProjectRootManager;
@@ -36,10 +33,10 @@ import org.jetbrains.annotations.Nullable;
 /**
  * @author max
  */
-public class EqualsAndHashcode extends BaseJavaBatchLocalInspectionTool {
+public class EqualsAndHashcodeBase extends BaseJavaBatchLocalInspectionTool {
   @Override
   @NotNull
-  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, boolean isOnTheFly) {
+  public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
     final Project project = holder.getProject();
     Pair<PsiMethod, PsiMethod> pair = CachedValuesManager.getManager(project).getCachedValue(project, new CachedValueProvider<Pair<PsiMethod, PsiMethod>>() {
       @Override
@@ -92,7 +89,7 @@ public class EqualsAndHashcode extends BaseJavaBatchLocalInspectionTool {
                                  hasEquals[0]
                                   ? InspectionsBundle.message("inspection.equals.hashcode.only.one.defined.problem.descriptor", "<code>equals()</code>", "<code>hashCode()</code>")
                                   : InspectionsBundle.message("inspection.equals.hashcode.only.one.defined.problem.descriptor","<code>hashCode()</code>", "<code>equals()</code>"),
-                                 (LocalQuickFix[])null);
+                                  buildFixes(isOnTheFly, hasEquals[0]));
         }
       }
     };
@@ -130,4 +127,8 @@ public class EqualsAndHashcode extends BaseJavaBatchLocalInspectionTool {
   public String getShortName() {
     return "EqualsAndHashcode";
   }
+
+  protected LocalQuickFix[] buildFixes(boolean isOnTheFly, boolean hasEquals) {
+    return LocalQuickFix.EMPTY_ARRAY;
+  }
 }
index e373207222eab72ac0adfa1db22aa18731beb932..8605a8f91a83d6291a7c30bc802e04c90459561c 100644 (file)
@@ -51,14 +51,14 @@ public class ExternalAnnotationsLineMarkerProvider implements LineMarkerProvider
     if (!(element instanceof PsiModifierListOwner)) return null;
     if (element instanceof PsiParameter || element instanceof PsiLocalVariable) return null;
 
-    if (!shouldShowSignature(preferCompiledElement((PsiModifierListOwner)element))) {
+    if (!shouldShowSignature((PsiModifierListOwner)element)) {
       return null;
     }
 
     final Function<PsiModifierListOwner, String> annotationsCollector = new Function<PsiModifierListOwner, String>() {
       @Override
       public String fun(PsiModifierListOwner owner) {
-        return XmlStringUtil.wrapInHtml(JavaDocInfoGenerator.generateSignature(preferCompiledElement(owner)));
+        return XmlStringUtil.wrapInHtml(JavaDocInfoGenerator.generateSignature(owner));
       }
     };
     return new LineMarkerInfo<PsiModifierListOwner>((PsiModifierListOwner)element, element.getTextOffset(), AllIcons.Gutter.ExtAnnotation,
@@ -67,11 +67,6 @@ public class ExternalAnnotationsLineMarkerProvider implements LineMarkerProvider
                                                     GutterIconRenderer.Alignment.LEFT);
   }
 
-  private static PsiModifierListOwner preferCompiledElement(PsiModifierListOwner element) {
-    PsiElement original = element.getOriginalElement();
-    return original instanceof PsiModifierListOwner ? (PsiModifierListOwner)original : element;
-  }
-
   private static boolean shouldShowSignature(PsiModifierListOwner owner) {
     if (hasNonCodeAnnotations(owner)) {
       return true;
@@ -111,7 +106,7 @@ public class ExternalAnnotationsLineMarkerProvider implements LineMarkerProvider
     if (ref == null) return true;
 
     PsiElement target = ref.resolve();
-    return !(target instanceof PsiClass) || JavaDocInfoGenerator.isDocumentedAnnotationType((PsiClass)target);
+    return !(target instanceof PsiClass) || JavaDocInfoGenerator.isDocumentedAnnotationType(target);
   }
 
   @Override
index 8cc9d06aed040a4008864ff7d8f618417d63d424..112b243e0ea30902dba87a64e271238b79cf373c 100644 (file)
@@ -544,7 +544,7 @@ public class JavaCompletionUtil {
         return JavaClassNameCompletionContributor.createClassLookupItems((PsiClass)completion,
                                                                          JavaClassNameCompletionContributor.AFTER_NEW.accepts(reference),
                                                                          JavaClassNameInsertHandler.JAVA_CLASS_INSERT_HANDLER,
-                                                                         Condition.TRUE);
+                                                                         Conditions.<PsiClass>alwaysTrue());
       }
     }
 
index 2a9fc2f4a79fa74a73ca39788d10331d98e86a0d..978e5b24d2e890ad52093a9d98f46996438c41a7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.*;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
-import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.patterns.PsiJavaPatterns;
 import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
@@ -43,7 +43,10 @@ import com.intellij.psi.javadoc.*;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.TypeConversionUtil;
-import com.intellij.util.*;
+import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.ProcessingContext;
+import com.intellij.util.Processor;
+import com.intellij.util.SystemProperties;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.text.CharArrayUtil;
 import org.jetbrains.annotations.NonNls;
@@ -81,7 +84,7 @@ public class JavaDocCompletionContributor extends CompletionContributor {
         if (ref instanceof PsiJavaReference) {
           result.stopHere();
 
-          final JavaCompletionProcessor processor = new JavaCompletionProcessor(position, TrueFilter.INSTANCE, JavaCompletionProcessor.Options.CHECK_NOTHING, Condition.TRUE);
+          final JavaCompletionProcessor processor = new JavaCompletionProcessor(position, TrueFilter.INSTANCE, JavaCompletionProcessor.Options.CHECK_NOTHING, Conditions.<String>alwaysTrue());
           ((PsiJavaReference) ref).processVariants(processor);
 
           for (final CompletionElement _item : processor.getResults()) {
index ad53d9484959898bbe2eb22727d55945849a1657..cc67ca51de58dc90c0c41a6a29b28b529b7efda1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import com.intellij.codeInsight.completion.scope.JavaCompletionProcessor;
 import com.intellij.codeInsight.lookup.LookupElement;
 import com.intellij.codeInsight.lookup.LookupElementWeigher;
 import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
 import com.intellij.patterns.ElementPattern;
 import com.intellij.psi.*;
 import com.intellij.psi.filters.getters.MembersGetter;
@@ -127,8 +128,7 @@ public class PreferByKindWeigher extends LookupElementWeigher {
       };
     }
 
-    //noinspection unchecked
-    return Condition.FALSE;
+    return Conditions.alwaysFalse();
   }
 
   enum MyResult {
index c7bd10cc2b396b77f47f44714ef7dcd401ae4df3..a1f206b4ba8e698838d2be6d1ede622b51f0258d 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.codeInsight.ExceptionUtil;
 import com.intellij.featureStatistics.FeatureUsageTracker;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
 import com.intellij.psi.*;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -57,7 +58,7 @@ public class HighlightExceptionsHandlerFactory extends HighlightUsagesHandlerFac
     final PsiCodeBlock tryBlock = tryStatement.getTryBlock();
     if (tryBlock == null) return null;
     final Collection<PsiClassType> psiClassTypes = ExceptionUtil.collectUnhandledExceptions(tryBlock, tryBlock);
-    return new HighlightExceptionsHandler(editor, file, target, psiClassTypes.toArray(new PsiClassType[psiClassTypes.size()]), tryBlock, Condition.TRUE);
+    return new HighlightExceptionsHandler(editor, file, target, psiClassTypes.toArray(new PsiClassType[psiClassTypes.size()]), tryBlock, Conditions.<PsiType>alwaysTrue());
   }
 
   @Nullable
@@ -112,6 +113,6 @@ public class HighlightExceptionsHandlerFactory extends HighlightUsagesHandlerFac
 
     final Collection<PsiClassType> psiClassTypes = ExceptionUtil.collectUnhandledExceptions(method.getBody(), method.getBody());
 
-    return new HighlightExceptionsHandler(editor, file, target, psiClassTypes.toArray(new PsiClassType[psiClassTypes.size()]), method.getBody(), Condition.TRUE);
+    return new HighlightExceptionsHandler(editor, file, target, psiClassTypes.toArray(new PsiClassType[psiClassTypes.size()]), method.getBody(), Conditions.<PsiType>alwaysTrue());
   }
 }
diff --git a/java/java-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcode.java b/java/java-impl/src/com/intellij/codeInspection/equalsAndHashcode/EqualsAndHashcode.java
new file mode 100644 (file)
index 0000000..3887640
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2000-2014 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.codeInspection.equalsAndHashcode;
+
+import com.intellij.codeInsight.generation.GenerateEqualsHandler;
+import com.intellij.codeInspection.InspectionsBundle;
+import com.intellij.codeInspection.LocalQuickFix;
+import com.intellij.codeInspection.ProblemDescriptor;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.fileEditor.FileEditorManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.PsiElement;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author Bas Leijdekkers
+ */
+public class EqualsAndHashcode extends EqualsAndHashcodeBase {
+
+  protected LocalQuickFix[] buildFixes(boolean isOnTheFly, boolean hasEquals) {
+    if (!isOnTheFly) {
+      return LocalQuickFix.EMPTY_ARRAY;
+    }
+    return new LocalQuickFix[]{new GenerateEqualsHashcodeFix(hasEquals)};
+  }
+
+  private static class GenerateEqualsHashcodeFix implements LocalQuickFix {
+
+    private final boolean myHasEquals;
+
+    public GenerateEqualsHashcodeFix(boolean hasEquals) {
+      myHasEquals = hasEquals;
+    }
+
+    @NotNull
+    @Override
+    public String getName() {
+      return myHasEquals
+             ? InspectionsBundle.message("inspection.equals.hashcode.generate.hashcode.quickfix")
+             : InspectionsBundle.message("inspection.equals.hashcode.generate.equals.quickfix");
+    }
+
+    @NotNull
+    @Override
+    public String getFamilyName() {
+      return getName();
+    }
+
+    @Override
+    public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) {
+      final Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
+      if (editor == null) {
+        return;
+      }
+      final PsiElement element = descriptor.getPsiElement();
+      new GenerateEqualsHandler().invoke(project, editor, element.getContainingFile());
+    }
+  }
+}
index 5c226b84500b9328d04363110d500f2fa37f89f9..4aff727524bfacf46ed7b2d7baf4e9a283099962 100644 (file)
@@ -100,7 +100,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     return super.getFindUsagesDialog(isSingleFile, toShowInNewTab, mustOpenInNewTab);
   }
 
-  private static boolean askWhetherShouldSearchForParameterInOverridingMethods(final PsiElement psiElement, final PsiParameter parameter) {
+  private static boolean askWhetherShouldSearchForParameterInOverridingMethods(@NotNull PsiElement psiElement, @NotNull PsiParameter parameter) {
     return Messages.showOkCancelDialog(psiElement.getProject(),
                                FindBundle.message("find.parameter.usages.in.overriding.methods.prompt", parameter.getName()),
                                FindBundle.message("find.parameter.usages.in.overriding.methods.title"),
@@ -283,10 +283,10 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
       final JavaVariableFindUsagesOptions varOptions = (JavaVariableFindUsagesOptions) options;
       if (varOptions.isReadAccess || varOptions.isWriteAccess){
         if (varOptions.isReadAccess && varOptions.isWriteAccess){
-          if (!addElementUsages(element, processor, options)) return false;
+          if (!addElementUsages(element, options, processor)) return false;
         }
         else{
-          if (!addElementUsages(element, new Processor<UsageInfo>() {
+          if (!addElementUsages(element, varOptions, new Processor<UsageInfo>() {
             @Override
             public boolean process(UsageInfo info) {
               final PsiElement element = info.getElement();
@@ -296,12 +296,12 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
               }
               return true;
             }
-          }, varOptions)) return false;
+          })) return false;
         }
       }
     }
     else if (options.isUsages) {
-      if (!addElementUsages(element, processor, options)) return false;
+      if (!addElementUsages(element, options, processor)) return false;
     }
 
     boolean success = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@@ -325,29 +325,35 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     if (!success) return false;
 
     if (options instanceof JavaPackageFindUsagesOptions && ((JavaPackageFindUsagesOptions)options).isClassesUsages){
-      if (!addClassesUsages((PsiPackage)element, processor, (JavaPackageFindUsagesOptions)options)) return false;
+      if (!addClassesUsages((PsiPackage)element, (JavaPackageFindUsagesOptions)options, processor)) return false;
     }
 
     if (options instanceof JavaClassFindUsagesOptions) {
       final JavaClassFindUsagesOptions classOptions = (JavaClassFindUsagesOptions)options;
       final PsiClass psiClass = (PsiClass)element;
+      PsiManager manager = ApplicationManager.getApplication().runReadAction(new Computable<PsiManager>() {
+        @Override
+        public PsiManager compute() {
+          return psiClass.getManager();
+        }
+      });
       if (classOptions.isMethodsUsages){
-        if (!addMethodsUsages(psiClass, processor, classOptions)) return false;
+        if (!addMethodsUsages(psiClass, manager, classOptions, processor)) return false;
       }
       if (classOptions.isFieldsUsages){
-        if (!addFieldsUsages(psiClass, processor, classOptions)) return false;
+        if (!addFieldsUsages(psiClass, manager, classOptions, processor)) return false;
       }
       if (psiClass.isInterface()) {
         if (classOptions.isDerivedInterfaces){
           if (classOptions.isImplementingClasses){
-            if (!addInheritors(psiClass, processor, classOptions)) return false;
+            if (!addInheritors(psiClass, classOptions, processor)) return false;
           }
           else{
-            if (!addDerivedInterfaces(psiClass, processor, classOptions)) return false;
+            if (!addDerivedInterfaces(psiClass, classOptions, processor)) return false;
           }
         }
         else if (classOptions.isImplementingClasses){
-          if (!addImplementingClasses(psiClass, processor, classOptions)) return false;
+          if (!addImplementingClasses(psiClass, classOptions, processor)) return false;
         }
 
         if (classOptions.isImplementingClasses) {
@@ -355,13 +361,13 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
             new PsiElementProcessor<PsiFunctionalExpression>() {
               @Override
               public boolean execute(@NotNull PsiFunctionalExpression expression) {
-                return addResult(processor, expression, options);
+                return addResult(expression, options, processor);
               }
             }));
         }
       }
       else if (classOptions.isDerivedClasses) {
-        if (!addInheritors(psiClass, processor, classOptions)) return false;
+        if (!addInheritors(psiClass, classOptions, processor)) return false;
       }
     }
 
@@ -380,14 +386,14 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
           new PsiElementProcessor<PsiFunctionalExpression>() {
             @Override
             public boolean execute(@NotNull PsiFunctionalExpression expression) {
-              return addResult(processor, expression, options);
+              return addResult(expression, options, processor);
             }
           }));
       }
     }
 
     if (element instanceof PomTarget) {
-       if (!addAliasingUsages((PomTarget)element, processor, options)) return false;
+       if (!addAliasingUsages((PomTarget)element, options, processor)) return false;
     }
     final Boolean isSearchable = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
       @Override
@@ -403,8 +409,8 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
   }
 
   private static boolean addAliasingUsages(@NotNull PomTarget pomTarget,
-                                           @NotNull final Processor<UsageInfo> processor,
-                                           @NotNull final FindUsagesOptions options) {
+                                           @NotNull final FindUsagesOptions options,
+                                           @NotNull final Processor<UsageInfo> processor) {
     for (AliasingPsiTargetMapper aliasingPsiTargetMapper : Extensions.getExtensions(AliasingPsiTargetMapper.EP_NAME)) {
       for (AliasingPsiTarget psiTarget : aliasingPsiTargetMapper.getTargets(pomTarget)) {
         boolean success = ReferencesSearch
@@ -412,7 +418,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
           .forEach(new ReadActionProcessor<PsiReference>() {
             @Override
             public boolean processInReadAction(final PsiReference reference) {
-              return addResult(processor, reference, options);
+              return addResult(reference, options, processor);
             }
           });
         if (!success) return false;
@@ -428,15 +434,15 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
       new PsiElementProcessor<PsiMethod>() {
       @Override
       public boolean execute(@NotNull PsiMethod element) {
-        return addResult(processor, element.getNavigationElement(), options);
+        return addResult(element.getNavigationElement(), options, processor);
       }
     }));
   }
 
 
   private static boolean addClassesUsages(@NotNull PsiPackage aPackage,
-                                          @NotNull final Processor<UsageInfo> processor,
-                                          @NotNull final JavaPackageFindUsagesOptions options) {
+                                          @NotNull final JavaPackageFindUsagesOptions options,
+                                          @NotNull final Processor<UsageInfo> processor) {
     ProgressIndicator progress = ProgressManager.getInstance().getProgressIndicator();
     if (progress != null){
       progress.pushState();
@@ -446,18 +452,19 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     addClassesInPackage(aPackage, options.isIncludeSubpackages, classes);
     for (final PsiClass aClass : classes) {
       if (progress != null) {
-        progress.setText(FindBundle.message("find.searching.for.references.to.class.progress", ApplicationManager.getApplication().runReadAction(new Computable<String>(){
+        String name = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
           @Override
           public String compute() {
             return aClass.getName();
           }
-        })));
+        });
+        progress.setText(FindBundle.message("find.searching.for.references.to.class.progress", name));
         progress.checkCanceled();
       }
       boolean success = ReferencesSearch.search(new ReferencesSearch.SearchParameters(aClass, options.searchScope, false, options.fastTrack)).forEach(new ReadActionProcessor<PsiReference>() {
         @Override
         public boolean processInReadAction(final PsiReference psiReference) {
-          return addResult(processor, psiReference, options);
+          return addResult(psiReference, options, processor);
         }
       });
       if (!success) return false;
@@ -469,8 +476,13 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     return true;
   }
 
-  private static void addClassesInPackage(@NotNull PsiPackage aPackage, boolean includeSubpackages, @NotNull List<PsiClass> array) {
-    PsiDirectory[] dirs = aPackage.getDirectories();
+  private static void addClassesInPackage(@NotNull final PsiPackage aPackage, boolean includeSubpackages, @NotNull List<PsiClass> array) {
+    PsiDirectory[] dirs = ApplicationManager.getApplication().runReadAction(new Computable<PsiDirectory[]>() {
+      @Override
+      public PsiDirectory[] compute() {
+        return aPackage.getDirectories();
+      }
+    });
     for (PsiDirectory dir : dirs) {
       addClassesInDirectory(dir, includeSubpackages, array);
     }
@@ -495,22 +507,40 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
   }
 
   private static boolean addMethodsUsages(@NotNull final PsiClass aClass,
-                                          @NotNull final Processor<UsageInfo> processor,
-                                          @NotNull final JavaClassFindUsagesOptions options) {
+                                          @NotNull final PsiManager manager,
+                                          @NotNull final JavaClassFindUsagesOptions options,
+                                          @NotNull final Processor<UsageInfo> processor) {
     if (options.isIncludeInherited) {
-      final PsiManager manager = aClass.getManager();
-      PsiMethod[] methods = aClass.getAllMethods();
-      MethodsLoop:
+      final PsiMethod[] methods = ApplicationManager.getApplication().runReadAction(new Computable<PsiMethod[]>() {
+        @Override
+        public PsiMethod[] compute() {
+          return aClass.getAllMethods();
+        }
+      });
       for(int i = 0; i < methods.length; i++){
         final PsiMethod method = methods[i];
-        // filter overriden methods
-        MethodSignature methodSignature = method.getSignature(PsiSubstitutor.EMPTY);
-        for(int j = 0; j < i; j++){
-          if (methodSignature.equals(methods[j].getSignature(PsiSubstitutor.EMPTY))) continue MethodsLoop;
-        }
-        final PsiClass methodClass = method.getContainingClass();
-        if (methodClass != null && manager.areElementsEquivalent(methodClass, aClass)){
-          if (!addElementUsages(methods[i], processor, options)) return false;
+        // filter overridden methods
+        final int finalI = i;
+        final PsiClass methodClass =
+        ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() {
+          @Override
+          public PsiClass compute() {
+            MethodSignature methodSignature = method.getSignature(PsiSubstitutor.EMPTY);
+            for (int j = 0; j < finalI; j++) {
+              if (methodSignature.equals(methods[j].getSignature(PsiSubstitutor.EMPTY))) return null;
+            }
+            return method.getContainingClass();
+          }
+        });
+        if (methodClass == null) continue;
+        boolean equivalent = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
+          @Override
+          public Boolean compute() {
+            return manager.areElementsEquivalent(methodClass, aClass);
+          }
+        });
+        if (equivalent){
+          if (!addElementUsages(method, options, processor)) return false;
         }
         else {
           MethodReferencesSearch.SearchParameters parameters =
@@ -519,7 +549,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
             .forEach(new PsiReferenceProcessorAdapter(new PsiReferenceProcessor() {
               @Override
               public boolean execute(PsiReference reference) {
-                addResultFromReference(reference, methodClass, manager, aClass, processor, options);
+                addResultFromReference(reference, methodClass, manager, aClass, options, processor);
                 return true;
               }
             }));
@@ -528,35 +558,59 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
       }
     }
     else {
-      for (PsiMethod method : aClass.getMethods()) {
-        if (!addElementUsages(method, processor, options)) return false;
+      PsiMethod[] methods = ApplicationManager.getApplication().runReadAction(new Computable<PsiMethod[]>() {
+        @Override
+        public PsiMethod[] compute() {
+          return aClass.getMethods();
+        }
+      });
+      for (PsiMethod method : methods) {
+        if (!addElementUsages(method, options, processor)) return false;
       }
     }
     return true;
   }
 
   private static boolean addFieldsUsages(@NotNull final PsiClass aClass,
-                                         @NotNull final Processor<UsageInfo> processor,
-                                         @NotNull final JavaClassFindUsagesOptions options) {
+                                         @NotNull final PsiManager manager,
+                                         @NotNull final JavaClassFindUsagesOptions options,
+                                         @NotNull final Processor<UsageInfo> processor) {
     if (options.isIncludeInherited) {
-      final PsiManager manager = aClass.getManager();
-      PsiField[] fields = aClass.getAllFields();
-      FieldsLoop:
+      final PsiField[] fields = ApplicationManager.getApplication().runReadAction(new Computable<PsiField[]>() {
+        @Override
+        public PsiField[] compute() {
+          return aClass.getAllFields();
+        }
+      });
       for (int i = 0; i < fields.length; i++) {
         final PsiField field = fields[i];
         // filter hidden fields
-        for (int j = 0; j < i; j++) {
-          if (Comparing.strEqual(field.getName(), fields[j].getName())) continue FieldsLoop;
-        }
-        final PsiClass fieldClass = field.getContainingClass();
-        if (manager.areElementsEquivalent(fieldClass, aClass)) {
-          if (!addElementUsages(fields[i], processor, options)) return false;
+        final int finalI = i;
+        final PsiClass fieldClass =
+        ApplicationManager.getApplication().runReadAction(new Computable<PsiClass>() {
+          @Override
+          public PsiClass compute() {
+            for (int j = 0; j < finalI; j++) {
+              if (Comparing.strEqual(field.getName(), fields[j].getName())) return null;
+            }
+            return field.getContainingClass();
+          }
+        });
+        if (fieldClass == null) continue;
+        boolean equivalent = ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
+          @Override
+          public Boolean compute() {
+            return manager.areElementsEquivalent(fieldClass, aClass);
+          }
+        });
+        if (equivalent) {
+          if (!addElementUsages(fields[i], options, processor)) return false;
         }
         else {
           boolean success = ReferencesSearch.search(new ReferencesSearch.SearchParameters(field, options.searchScope, false, options.fastTrack)).forEach(new ReadActionProcessor<PsiReference>() {
             @Override
             public boolean processInReadAction(final PsiReference reference) {
-              return addResultFromReference(reference, fieldClass, manager, aClass, processor, options);
+              return addResultFromReference(reference, fieldClass, manager, aClass, options, processor);
             }
           });
           if (!success) return false;
@@ -571,14 +625,14 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
         }
       });
       for (PsiField field : fields) {
-        if (!addElementUsages(field, processor, options)) return false;
+        if (!addElementUsages(field, options, processor)) return false;
       }
     }
     return true;
   }
 
   @Nullable
-  private static PsiClass getFieldOrMethodAccessedClass(@NotNull PsiReferenceExpression ref, PsiClass fieldOrMethodClass) {
+  private static PsiClass getFieldOrMethodAccessedClass(@NotNull PsiReferenceExpression ref, @NotNull PsiClass fieldOrMethodClass) {
     PsiElement[] children = ref.getChildren();
     if (children.length > 1 && children[0] instanceof PsiExpression) {
       PsiExpression expr = (PsiExpression)children[0];
@@ -606,39 +660,39 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
   }
 
   private static boolean addInheritors(@NotNull PsiClass aClass,
-                                       @NotNull final Processor<UsageInfo> processor,
-                                       @NotNull final JavaClassFindUsagesOptions options) {
+                                       @NotNull final JavaClassFindUsagesOptions options,
+                                       @NotNull final Processor<UsageInfo> processor) {
     return ClassInheritorsSearch.search(aClass, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>(
       new PsiElementProcessor<PsiClass>() {
       @Override
       public boolean execute(@NotNull PsiClass element) {
-        return addResult(processor, element, options);
+        return addResult(element, options, processor);
       }
 
     }));
   }
 
   private static boolean addDerivedInterfaces(@NotNull PsiClass anInterface,
-                                              @NotNull final Processor<UsageInfo> processor,
-                                              @NotNull final JavaClassFindUsagesOptions options) {
+                                              @NotNull final JavaClassFindUsagesOptions options,
+                                              @NotNull final Processor<UsageInfo> processor) {
     return ClassInheritorsSearch.search(anInterface, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>(
       new PsiElementProcessor<PsiClass>() {
       @Override
       public boolean execute(@NotNull PsiClass inheritor) {
-        return !inheritor.isInterface() || addResult(processor, inheritor, options);
+        return !inheritor.isInterface() || addResult(inheritor, options, processor);
       }
 
     }));
   }
 
   private static boolean addImplementingClasses(@NotNull PsiClass anInterface,
-                                                @NotNull final Processor<UsageInfo> processor,
-                                                @NotNull final JavaClassFindUsagesOptions options) {
+                                                @NotNull final JavaClassFindUsagesOptions options,
+                                                @NotNull final Processor<UsageInfo> processor) {
     return ClassInheritorsSearch.search(anInterface, options.searchScope, options.isCheckDeepInheritance).forEach(new PsiElementProcessorAdapter<PsiClass>(
       new PsiElementProcessor<PsiClass>() {
       @Override
       public boolean execute(@NotNull PsiClass inheritor) {
-        return inheritor.isInterface() || addResult(processor, inheritor, options);
+        return inheritor.isInterface() || addResult(inheritor, options, processor);
       }
     }));
   }
@@ -647,14 +701,14 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
                                                 @NotNull PsiClass methodClass,
                                                 @NotNull PsiManager manager,
                                                 @NotNull PsiClass aClass,
-                                                @NotNull Processor<UsageInfo> processor,
-                                                @NotNull FindUsagesOptions options) {
+                                                @NotNull FindUsagesOptions options,
+                                                @NotNull Processor<UsageInfo> processor) {
     PsiElement refElement = reference.getElement();
     if (refElement instanceof PsiReferenceExpression) {
       PsiClass usedClass = getFieldOrMethodAccessedClass((PsiReferenceExpression)refElement, methodClass);
       if (usedClass != null) {
         if (manager.areElementsEquivalent(usedClass, aClass) || usedClass.isInheritor(aClass, true)) {
-          if (!addResult(processor, refElement, options)) return false;
+          if (!addResult(refElement, options, processor)) return false;
         }
       }
     }
@@ -662,8 +716,8 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
   }
 
   private static boolean addElementUsages(@NotNull final PsiElement element,
-                                          @NotNull final Processor<UsageInfo> processor,
-                                          @NotNull final FindUsagesOptions options) {
+                                          @NotNull final FindUsagesOptions options,
+                                          @NotNull final Processor<UsageInfo> processor) {
     final SearchScope searchScope = options.searchScope;
     final PsiClass[] parentClass = new PsiClass[1];
     if (element instanceof PsiMethod && ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@@ -684,7 +738,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
           .forEach(new ReadActionProcessor<PsiReference>() {
             @Override
             public boolean processInReadAction(final PsiReference ref) {
-              return addResult(processor, ref, options);
+              return addResult(ref, options, processor);
             }
           });
       }
@@ -694,7 +748,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     final ReadActionProcessor<PsiReference> consumer = new ReadActionProcessor<PsiReference>() {
       @Override
       public boolean processInReadAction(final PsiReference ref) {
-        return addResult(processor, ref, options);
+        return addResult(ref, options, processor);
       }
     };
 
@@ -708,11 +762,13 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     return ReferencesSearch.search(new ReferencesSearch.SearchParameters(element, searchScope, false, options.fastTrack)).forEach(consumer);
   }
 
-  private static boolean addResult(@NotNull Processor<UsageInfo> processor, @NotNull PsiElement element, @NotNull FindUsagesOptions options) {
+  private static boolean addResult(@NotNull PsiElement element,
+                                   @NotNull FindUsagesOptions options,
+                                   @NotNull Processor<UsageInfo> processor) {
     return !filterUsage(element, options) || processor.process(new UsageInfo(element));
   }
 
-  private static boolean addResult(Processor<UsageInfo> processor, PsiReference ref, FindUsagesOptions options) {
+  private static boolean addResult(@NotNull PsiReference ref, @NotNull FindUsagesOptions options, @NotNull Processor<UsageInfo> processor) {
     if (filterUsage(ref.getElement(), options)){
       TextRange rangeInElement = ref.getRangeInElement();
       return processor.process(new UsageInfo(ref.getElement(), rangeInElement.getStartOffset(), rangeInElement.getEndOffset(), false));
@@ -720,7 +776,7 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     return true;
   }
 
-  private static boolean filterUsage(PsiElement usage, FindUsagesOptions options) {
+  private static boolean filterUsage(PsiElement usage, @NotNull FindUsagesOptions options) {
     if (!(usage instanceof PsiJavaCodeReferenceElement)) {
       return true;
     }
@@ -780,5 +836,4 @@ public class JavaFindUsagesHandler extends FindUsagesHandler{
     }
     return super.findReferencesToHighlight(target, searchScope);
   }
-
 }
index 496795b85444a317281f11f7591ae8cb7d7ee7de..836d6e0051133336653978c292895e0777f39b27 100644 (file)
@@ -97,7 +97,9 @@ public class LanguageLevelProjectExtensionImpl extends LanguageLevelProjectExten
 
   @Override
   public void languageLevelsChanged() {
-    JavaLanguageLevelPusher.pushLanguageLevel(myProject);
+    if (!myProject.isDefault()) {
+      JavaLanguageLevelPusher.pushLanguageLevel(myProject);
+    }
   }
 
   @Override
index 658ee6561e686b750cb3a1bf4a5023706ab7a25f..ae46742bed46bbbb65e758ea5fa1b71838718333 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,11 +24,11 @@ import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.fileEditor.FileEditorManager;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleManager;
-import com.intellij.openapi.module.ModuleUtil;
-import com.intellij.openapi.roots.impl.ModifiableModelCommitter;
+import com.intellij.openapi.module.ModuleUtilCore;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.*;
-import com.intellij.openapi.vfs.VfsUtil;
+import com.intellij.openapi.roots.impl.ModifiableModelCommitter;
+import com.intellij.openapi.vfs.VfsUtilCore;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.wm.ToolWindow;
 import com.intellij.openapi.wm.ToolWindowId;
@@ -37,6 +37,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.impl.PackagePrefixElementFinder;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.util.PsiModificationTracker;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.jps.model.java.JavaModuleSourceRootTypes;
 
 import java.util.ArrayList;
@@ -46,22 +47,25 @@ import java.util.List;
  * @author yole
  */
 public class PsiPackageImplementationHelperImpl extends PsiPackageImplementationHelper {
+  @NotNull
   @Override
-  public GlobalSearchScope adjustAllScope(PsiPackage psiPackage, GlobalSearchScope globalSearchScope) {
+  public GlobalSearchScope adjustAllScope(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope globalSearchScope) {
     return NonClasspathClassFinder.addNonClasspathScope(psiPackage.getProject(), globalSearchScope);
   }
 
+  @NotNull
   @Override
-  public VirtualFile[] occursInPackagePrefixes(PsiPackage psiPackage) {
+  public VirtualFile[] occursInPackagePrefixes(@NotNull PsiPackage psiPackage) {
     List<VirtualFile> result = new ArrayList<VirtualFile>();
     final Module[] modules = ModuleManager.getInstance(psiPackage.getProject()).getModules();
 
+    String qualifiedName = psiPackage.getQualifiedName();
     for (final Module module : modules) {
       for (final ContentEntry contentEntry : ModuleRootManager.getInstance(module).getContentEntries()) {
         final List<SourceFolder> sourceFolders = contentEntry.getSourceFolders(JavaModuleSourceRootTypes.SOURCES);
         for (final SourceFolder sourceFolder : sourceFolders) {
           final String packagePrefix = sourceFolder.getPackagePrefix();
-          if (packagePrefix.startsWith(psiPackage.getQualifiedName())) {
+          if (packagePrefix.startsWith(qualifiedName)) {
             final VirtualFile file = sourceFolder.getFile();
             if (file != null) {
               result.add(file);
@@ -71,11 +75,11 @@ public class PsiPackageImplementationHelperImpl extends PsiPackageImplementation
       }
     }
 
-    return VfsUtil.toVirtualFileArray(result);
+    return VfsUtilCore.toVirtualFileArray(result);
   }
 
   @Override
-  public void handleQualifiedNameChange(final PsiPackage psiPackage, final String newQualifiedName) {
+  public void handleQualifiedNameChange(@NotNull final PsiPackage psiPackage, @NotNull final String newQualifiedName) {
     ApplicationManager.getApplication().assertWriteAccessAllowed();
     final String oldQualifedName = psiPackage.getQualifiedName();
     final boolean anyChanged = changePackagePrefixes(psiPackage, oldQualifedName, newQualifiedName);
@@ -94,7 +98,7 @@ public class PsiPackageImplementationHelperImpl extends PsiPackageImplementation
     }
   }
 
-  private static boolean changePackagePrefixes(PsiPackage psiPackage, final String oldQualifiedName, final String newQualifiedName) {
+  private static boolean changePackagePrefixes(@NotNull PsiPackage psiPackage, @NotNull String oldQualifiedName, @NotNull String newQualifiedName) {
     final Module[] modules = ModuleManager.getInstance(psiPackage.getProject()).getModules();
     List<ModifiableRootModel> modelsToCommit = new ArrayList<ModifiableRootModel>();
     for (final Module module : modules) {
@@ -128,7 +132,7 @@ public class PsiPackageImplementationHelperImpl extends PsiPackageImplementation
   }
 
   @Override
-  public void navigate(final PsiPackage psiPackage, final boolean requestFocus) {
+  public void navigate(@NotNull final PsiPackage psiPackage, final boolean requestFocus) {
     final Project project = psiPackage.getProject();
     ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.PROJECT_VIEW);
     window.activate(null);
@@ -143,7 +147,8 @@ public class PsiPackageImplementationHelperImpl extends PsiPackageImplementation
     });
   }
 
-  private static PsiDirectory[] suggestMostAppropriateDirectories(PsiPackage psiPackage) {
+  @NotNull
+  private static PsiDirectory[] suggestMostAppropriateDirectories(@NotNull PsiPackage psiPackage) {
     final Project project = psiPackage.getProject();
     PsiDirectory[] directories = null;
     final Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
@@ -151,10 +156,11 @@ public class PsiPackageImplementationHelperImpl extends PsiPackageImplementation
       final Document document = editor.getDocument();
       final PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);
       if (psiFile != null) {
-        final Module module = ModuleUtil.findModuleForPsiElement(psiFile);
+        final Module module = ModuleUtilCore.findModuleForPsiElement(psiFile);
         if (module != null) {
           directories = psiPackage.getDirectories(GlobalSearchScope.moduleWithDependenciesScope(module));
-        } else {
+        }
+        else {
           directories = psiPackage.getDirectories(GlobalSearchScope.notScope(GlobalSearchScope.projectScope(project)));
         }
       }
@@ -167,12 +173,13 @@ public class PsiPackageImplementationHelperImpl extends PsiPackageImplementation
   }
 
   @Override
-  public boolean packagePrefixExists(PsiPackage psiPackage) {
+  public boolean packagePrefixExists(@NotNull PsiPackage psiPackage) {
     return PackagePrefixElementFinder.getInstance(psiPackage.getProject()).packagePrefixExists(psiPackage.getQualifiedName());
   }
 
+  @NotNull
   @Override
-  public Object[] getDirectoryCachedValueDependencies(PsiPackage psiPackage) {
+  public Object[] getDirectoryCachedValueDependencies(@NotNull PsiPackage psiPackage) {
     return new Object[] { PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT, ProjectRootManager.getInstance(psiPackage.getProject()) };
   }
 }
index ed08349519a769cab38577641f76aec10dc9b746..0cc9819c4574421123cddcea742feef7dea78682 100644 (file)
@@ -30,10 +30,7 @@ import com.intellij.openapi.editor.markup.RangeHighlighter;
 import com.intellij.openapi.editor.markup.TextAttributes;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.ProjectRootManager;
-import com.intellij.openapi.util.Comparing;
-import com.intellij.openapi.util.Condition;
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.*;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
@@ -1045,13 +1042,13 @@ public class RefactoringUtil {
   }
 
   public static void fixJavadocsForParams(PsiMethod method, Set<PsiParameter> newParameters) throws IncorrectOperationException {
-    fixJavadocsForParams(method, newParameters, Condition.FALSE);
+    fixJavadocsForParams(method, newParameters, Conditions.<Pair<PsiParameter,String>>alwaysFalse());
   }
 
   public static void fixJavadocsForParams(PsiMethod method,
                                         Set<PsiParameter> newParameters,
                                         Condition<Pair<PsiParameter, String>> eqCondition) throws IncorrectOperationException {
-    fixJavadocsForParams(method, newParameters, eqCondition, Condition.TRUE);
+    fixJavadocsForParams(method, newParameters, eqCondition, Conditions.<String>alwaysTrue());
   }
 
   public static void fixJavadocsForParams(PsiMethod method,
@@ -1245,7 +1242,7 @@ public class RefactoringUtil {
   @Nullable
   public static PsiTypeParameterList createTypeParameterListWithUsedTypeParameters(@Nullable final PsiTypeParameterList fromList,
                                                                                    @NotNull final PsiElement... elements) {
-    return createTypeParameterListWithUsedTypeParameters(fromList, Condition.TRUE, elements);
+    return createTypeParameterListWithUsedTypeParameters(fromList, Conditions.<PsiTypeParameter>alwaysTrue(), elements);
   }
 
   @Nullable
@@ -1290,7 +1287,7 @@ public class RefactoringUtil {
   }
 
   public static void collectTypeParameters(final Set<PsiTypeParameter> used, final PsiElement element) {
-    collectTypeParameters(used, element, Condition.TRUE);
+    collectTypeParameters(used, element, Conditions.<PsiTypeParameter>alwaysTrue());
   }
   public static void collectTypeParameters(final Set<PsiTypeParameter> used, final PsiElement element,
                                            final Condition<PsiTypeParameter> filter) {
index cc6bf9d3044d6d759f181833b420f4a3b8ac67c7..44d71c5e72a7f3b0578bc69258687db86a0a6630 100644 (file)
@@ -21,10 +21,7 @@ import com.intellij.openapi.extensions.ExtensionPointName;
 import com.intellij.openapi.progress.ProgressIndicator;
 import com.intellij.openapi.progress.ProgressIndicatorProvider;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Computable;
-import com.intellij.openapi.util.Condition;
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.*;
 import com.intellij.psi.*;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.PsiSearchScopeUtil;
@@ -106,7 +103,7 @@ public class ClassInheritorsSearch extends ExtensibleQueryFactory<PsiClass, Clas
     private final InheritanceChecker myInheritanceChecker;
 
     public SearchParameters(@NotNull final PsiClass aClass, @NotNull SearchScope scope, final boolean checkDeep, final boolean checkInheritance, boolean includeAnonymous) {
-      this(aClass, scope, checkDeep, checkInheritance, includeAnonymous, Condition.TRUE);
+      this(aClass, scope, checkDeep, checkInheritance, includeAnonymous, Conditions.<String>alwaysTrue());
     }
 
     public SearchParameters(@NotNull final PsiClass aClass, @NotNull SearchScope scope, final boolean checkDeep, final boolean checkInheritance,
index ed68dc2ac204200de56d292d3f70df1af41c9ea1..65e0af8265ad50e4b31af767c9ea5ae8dd0dde66 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -111,7 +111,7 @@ public interface PsiPackage extends PsiCheckedRenameElement, NavigationItem, Psi
   @NonNls
   String getName();
 
-  boolean containsClassNamed(String name);
+  boolean containsClassNamed(@NotNull String name);
 
   @NotNull
   PsiClass[] findClassByShortName(@NotNull String name, @NotNull GlobalSearchScope scope);
index 9f7f6e2cc164e2ec69b98ae917b4cceb7a4792a5..b5b72565da19b11f2401485f4029dfe53608e5f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@ public class ClassUtil {
     return null;
   }
 
+  @NotNull
   public static String extractClassName(@NotNull String fqName) {
     int i = fqName.lastIndexOf('.');
     return i == -1 ? fqName : fqName.substring(i + 1);
@@ -58,7 +59,7 @@ public class ClassUtil {
     return null;
   }
 
-  public static void formatClassName(@NotNull final PsiClass aClass, final StringBuilder buf) {
+  public static void formatClassName(@NotNull final PsiClass aClass, @NotNull StringBuilder buf) {
     final String qName = aClass.getQualifiedName();
     if (qName != null) {
       buf.append(qName);
@@ -78,7 +79,7 @@ public class ClassUtil {
   }
 
   @Nullable
-  private static PsiClass getContainerClass(final PsiClass aClass) {
+  private static PsiClass getContainerClass(@NotNull PsiClass aClass) {
     PsiElement parent = aClass.getContext();
     while (parent != null && !(parent instanceof PsiClass)) {
       parent = parent.getContext();
@@ -113,11 +114,11 @@ public class ClassUtil {
     return result[0];
   }
 
-  public static PsiClass findNonQualifiedClassByIndex(final String indexName, @NotNull final PsiClass containingClass) {
+  public static PsiClass findNonQualifiedClassByIndex(@NotNull String indexName, @NotNull final PsiClass containingClass) {
     return findNonQualifiedClassByIndex(indexName, containingClass, false);
   }
 
-  public static PsiClass findNonQualifiedClassByIndex(final String indexName, @NotNull final PsiClass containingClass,
+  public static PsiClass findNonQualifiedClassByIndex(@NotNull String indexName, @NotNull final PsiClass containingClass,
                                                       final boolean jvmCompatible) {
     String prefix = getDigitPrefix(indexName);
     final int idx = !prefix.isEmpty() ? Integer.parseInt(prefix) : -1;
@@ -167,6 +168,7 @@ public class ClassUtil {
     return result[0];
   }
 
+  @NotNull
   private static String getDigitPrefix(@NotNull String indexName) {
     int i;
     for (i = 0; i < indexName.length(); i++) {
@@ -186,24 +188,24 @@ public class ClassUtil {
    * @return found psiClass
    */
   @Nullable
-  public static PsiClass findPsiClass(final PsiManager psiManager, String externalName){
+  public static PsiClass findPsiClass(@NotNull PsiManager psiManager, @NotNull String externalName){
     return findPsiClass(psiManager, externalName, null, false);
   }
 
   @Nullable
-  public static PsiClass findPsiClass(final PsiManager psiManager,
-                                      String externalName,
+  public static PsiClass findPsiClass(@NotNull PsiManager psiManager,
+                                      @NotNull String externalName,
                                       PsiClass psiClass,
                                       boolean jvmCompatible) {
     return findPsiClass(psiManager, externalName, psiClass, jvmCompatible, GlobalSearchScope.allScope(psiManager.getProject()));
   }
 
   @Nullable
-  public static PsiClass findPsiClass(final PsiManager psiManager,
-                                      String externalName,
+  public static PsiClass findPsiClass(@NotNull PsiManager psiManager,
+                                      @NotNull String externalName,
                                       @Nullable PsiClass psiClass,
                                       boolean jvmCompatible, 
-                                      final GlobalSearchScope scope) {
+                                      @NotNull GlobalSearchScope scope) {
     for (int pos = 0; pos < externalName.length(); pos++) {
       if (externalName.charAt(pos) == '$') {
         PsiClass parentClass = psiClass;
@@ -220,8 +222,8 @@ public class ClassUtil {
   }
 
   @Nullable
-  private static PsiClass findSubclass(final PsiManager psiManager,
-                                       final String externalName,
+  private static PsiClass findSubclass(@NotNull PsiManager psiManager,
+                                       @NotNull String externalName,
                                        final PsiClass psiClass,
                                        final boolean jvmCompatible) {
     for (int pos = 0; pos < externalName.length(); pos++) {
@@ -251,7 +253,7 @@ public class ClassUtil {
 
 
   @Nullable
-  public static PsiClass findPsiClassByJVMName(final PsiManager manager, final String jvmClassName) {
+  public static PsiClass findPsiClassByJVMName(@NotNull PsiManager manager, @NotNull String jvmClassName) {
     return findPsiClass(manager, jvmClassName.replace('/', '.'), null, true);
   }
 }
\ No newline at end of file
index 5a97f596d983f5fec9a7ea5376b397142830f507..51e010e05d29bcdddbf1d2e77a13fab70082a3eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@ import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiPackage;
 import com.intellij.psi.impl.file.PsiPackageImplementationHelper;
 import com.intellij.psi.search.GlobalSearchScope;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * @author yole
@@ -27,31 +28,34 @@ import com.intellij.psi.search.GlobalSearchScope;
 public class CorePsiPackageImplementationHelper extends PsiPackageImplementationHelper {
   private static final ModificationTracker[] EMPTY_DEPENDENCY = {ModificationTracker.NEVER_CHANGED};
 
+  @NotNull
   @Override
-  public GlobalSearchScope adjustAllScope(PsiPackage psiPackage, GlobalSearchScope globalSearchScope) {
+  public GlobalSearchScope adjustAllScope(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope globalSearchScope) {
     return globalSearchScope;
   }
 
+  @NotNull
   @Override
-  public VirtualFile[] occursInPackagePrefixes(PsiPackage psiPackage) {
+  public VirtualFile[] occursInPackagePrefixes(@NotNull PsiPackage psiPackage) {
     return VirtualFile.EMPTY_ARRAY;
   }
 
   @Override
-  public void handleQualifiedNameChange(PsiPackage psiPackage, String newQualifiedName) {
+  public void handleQualifiedNameChange(@NotNull PsiPackage psiPackage, @NotNull String newQualifiedName) {
   }
 
   @Override
-  public void navigate(PsiPackage psiPackage, boolean requestFocus) {
+  public void navigate(@NotNull PsiPackage psiPackage, boolean requestFocus) {
   }
 
   @Override
-  public boolean packagePrefixExists(PsiPackage psiPackage) {
+  public boolean packagePrefixExists(@NotNull PsiPackage psiPackage) {
     return false;
   }
 
+  @NotNull
   @Override
-  public Object[] getDirectoryCachedValueDependencies(PsiPackage cachedValueProvider) {
+  public Object[] getDirectoryCachedValueDependencies(@NotNull PsiPackage cachedValueProvider) {
     return EMPTY_DEPENDENCY;
   }
 }
index 59a4e10d40fe0f81e6b6d071bf47abbb1778ccdd..7fc4a22459412e33aa85c90fba30b1ce8383b7a4 100644 (file)
@@ -248,7 +248,7 @@ public abstract class NonClasspathClassFinder extends PsiElementFinder {
   }
 
   @NotNull
-  public static GlobalSearchScope addNonClasspathScope(Project project, GlobalSearchScope base) {
+  public static GlobalSearchScope addNonClasspathScope(@NotNull Project project, @NotNull GlobalSearchScope base) {
     GlobalSearchScope scope = base;
     for (PsiElementFinder finder : Extensions.getExtensions(EP_NAME, project)) {
       if (finder instanceof NonClasspathClassFinder) {
index 9129052bf74fedc1e20e8bfee7203d5f6b93631a..93fd1ebbd9352fe1cfc7c127fc5942a94412a0ce 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2012 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@ import com.intellij.navigation.ItemPresentationProviders;
 import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.ui.Queryable;
 import com.intellij.openapi.util.Condition;
+import com.intellij.openapi.util.Conditions;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.JavaPsiFacadeImpl;
@@ -46,7 +47,6 @@ import org.jetbrains.annotations.Nullable;
 import java.util.*;
 
 public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Queryable {
-  public static boolean DEBUG = false;
   private volatile CachedValue<PsiModifierList> myAnnotationList;
   private volatile CachedValue<Collection<PsiDirectory>> myDirectories;
   private volatile CachedValue<Collection<PsiDirectory>> myDirectoriesWithLibSources;
@@ -72,6 +72,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
     }
   }
 
+  @NotNull
   private CachedValue<Collection<PsiDirectory>> createCachedDirectories(final boolean includeLibrarySources) {
     return CachedValuesManager.getManager(myManager.getProject()).createCachedValue(new CachedValueProvider<Collection<PsiDirectory>>() {
       @Override
@@ -131,6 +132,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
     }
   }
 
+  @Override
   public String toString() {
     return "PsiPackage:" + getQualifiedName();
   }
@@ -141,6 +143,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
     return getClasses(allScope());
   }
 
+  @NotNull
   protected GlobalSearchScope allScope() {
     return PsiPackageImplementationHelper.getInstance().adjustAllScope(this, GlobalSearchScope.allScope(getProject()));
   }
@@ -177,7 +180,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
   }
 
   @NotNull
-  private PsiClass[] getCachedClassesByName(String name) {
+  private PsiClass[] getCachedClassesByName(@NotNull String name) {
     if (DumbService.getInstance(getProject()).isDumb()) {
       return getCachedClassInDumbMode(name);
     }
@@ -215,7 +218,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
   }
 
   @Override
-  public boolean containsClassNamed(String name) {
+  public boolean containsClassNamed(@NotNull String name) {
     return getCachedClassesByName(name).length > 0;
   }
 
@@ -247,7 +250,7 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
   }
 
   @Nullable
-  private PsiPackage findSubPackageByName(String name) {
+  private PsiPackage findSubPackageByName(@NotNull String name) {
     final String qName = getQualifiedName();
     final String subpackageQName = qName.isEmpty() ? name : qName + "." + name;
     return getFacade().findPackage(subpackageQName);
@@ -270,11 +273,11 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
       if (nameHint != null) {
         final String shortName = nameHint.getName(state);
         final PsiClass[] classes = findClassByShortName(shortName, scope);
-        if (!processClasses(processor, state, classes, Condition.TRUE)) return false;
+        if (!processClasses(processor, state, classes, Conditions.<String>alwaysTrue())) return false;
       }
       else {
         PsiClass[] classes = getClasses(scope);
-        if (!processClasses(processor, state, classes, nameCondition != null ? nameCondition : Condition.TRUE)) return false;
+        if (!processClasses(processor, state, classes, nameCondition != null ? nameCondition : Conditions.<String>alwaysTrue())) return false;
       }
     }
     if (classHint == null || classHint.shouldProcess(ElementClassHint.DeclarationKind.PACKAGE)) {
@@ -302,7 +305,9 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
     return true;
   }
 
-  private static boolean processClasses(PsiScopeProcessor processor, ResolveState state, PsiClass[] classes, 
+  private static boolean processClasses(@NotNull PsiScopeProcessor processor,
+                                        @NotNull ResolveState state,
+                                        @NotNull PsiClass[] classes,
                                         @NotNull Condition<String> nameCondition) {
     for (PsiClass aClass : classes) {
       String name = aClass.getName();
index 050786c617f01052917b6c9c81937c34d68c3485..4ca3f1fead43e3b5bbade145fa8151e5fb58e1ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,22 +19,26 @@ import com.intellij.openapi.components.ServiceManager;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiPackage;
 import com.intellij.psi.search.GlobalSearchScope;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * @author yole
  */
 public abstract class PsiPackageImplementationHelper {
-  public abstract GlobalSearchScope adjustAllScope(PsiPackage psiPackage, GlobalSearchScope globalSearchScope);
+  @NotNull
+  public abstract GlobalSearchScope adjustAllScope(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope globalSearchScope);
 
-  public abstract VirtualFile[] occursInPackagePrefixes(PsiPackage psiPackage);
+  @NotNull
+  public abstract VirtualFile[] occursInPackagePrefixes(@NotNull PsiPackage psiPackage);
 
-  public abstract void handleQualifiedNameChange(PsiPackage psiPackage, String newQualifiedName);
+  public abstract void handleQualifiedNameChange(@NotNull PsiPackage psiPackage, @NotNull String newQualifiedName);
 
-  public abstract void navigate(PsiPackage psiPackage, boolean requestFocus);
+  public abstract void navigate(@NotNull PsiPackage psiPackage, boolean requestFocus);
 
-  public abstract boolean packagePrefixExists(PsiPackage psiPackage);
+  public abstract boolean packagePrefixExists(@NotNull PsiPackage psiPackage);
 
-  public abstract Object[] getDirectoryCachedValueDependencies(PsiPackage cachedValueProvider);
+  @NotNull
+  public abstract Object[] getDirectoryCachedValueDependencies(@NotNull PsiPackage cachedValueProvider);
 
   public static PsiPackageImplementationHelper getInstance() {
     return ServiceManager.getService(PsiPackageImplementationHelper.class);
index e77e7ad01f5ef8e5175b5d4d0dddf457e9163c99..799f9b459e6962aad0393daace28b2dca8ce028c 100644 (file)
@@ -324,4 +324,24 @@ public class PsiParameterImpl extends JavaStubPsiElement<PsiParameterStub> imple
     final PsiElement declarationScope = getDeclarationScope();
     return new LocalSearchScope(declarationScope);
   }
+
+  @Override
+  public PsiElement getOriginalElement() {
+    PsiElement parent = getParent();
+    if (parent instanceof PsiParameterList) {
+      PsiElement gParent = parent.getParent();
+      if (gParent instanceof PsiMethod) {
+        PsiElement originalMethod = gParent.getOriginalElement();
+        if (originalMethod instanceof PsiMethod) {
+          int index = ((PsiParameterList)parent).getParameterIndex(this);
+          PsiParameter[] originalParameters = ((PsiMethod)originalMethod).getParameterList().getParameters();
+          if (index < originalParameters.length) {
+            return originalParameters[index];
+          }
+        }
+      }
+    }
+    return this;
+  }
+
 }
index 35db6c29bc0c06541951b4929ef2a104c2390ba8..15ea2af284cb95c04a5183445e204a301ed7ab41 100644 (file)
@@ -234,7 +234,7 @@ public class InferenceSession {
           !MethodCandidateInfo.ourOverloadGuard.currentStack().contains(PsiUtil.skipParenthesizedExprUp(parent.getParent()))) {
         final Set<ConstraintFormula> additionalConstraints = new LinkedHashSet<ConstraintFormula>();
         if (parameters.length > 0) {
-          collectAdditionalConstraints(parameters, args, properties.getMethod(), PsiSubstitutor.EMPTY, additionalConstraints, properties.isVarargs(), true);
+          collectAdditionalConstraints(parameters, args, properties.getMethod(), PsiSubstitutor.EMPTY, additionalConstraints, properties.isVarargs());
         }
 
         if (!additionalConstraints.isEmpty() && !proceedWithAdditionalConstraints(additionalConstraints)) {
@@ -264,67 +264,101 @@ public class InferenceSession {
                                             PsiMethod parentMethod,
                                             PsiSubstitutor siteSubstitutor,
                                             Set<ConstraintFormula> additionalConstraints,
-                                            boolean varargs, boolean toplevel) {
+                                            boolean varargs) {
     for (int i = 0; i < args.length; i++) {
-      if (args[i] != null) {
-        InferenceSession session = myNestedSessions.get(PsiTreeUtil.getParentOfType(args[i], PsiCallExpression.class));
-        if (session == null) {
-          session = this;
+      final PsiExpression arg = PsiUtil.skipParenthesizedExprDown(args[i]);
+      if (arg != null) {
+        final InferenceSession nestedCallSession = findNestedCallSession(arg);
+        final PsiType parameterType =
+          nestedCallSession.substituteWithInferenceVariables(getParameterType(parameters, i, siteSubstitutor, varargs));
+        if (!isPertinentToApplicability(arg, parentMethod)) {
+          additionalConstraints.add(new ExpressionCompatibilityConstraint(arg, parameterType));
         }
-        PsiType parameterType = session.substituteWithInferenceVariables(getParameterType(parameters, i, siteSubstitutor, varargs));
-        if (!isPertinentToApplicability(args[i], parentMethod)) {
-          additionalConstraints.add(new ExpressionCompatibilityConstraint(args[i], parameterType));
-        }
-        additionalConstraints.add(new CheckedExceptionCompatibilityConstraint(args[i], parameterType));
-        if (args[i] instanceof PsiCallExpression && PsiPolyExpressionUtil.isPolyExpression(args[i])) {
+        additionalConstraints.add(new CheckedExceptionCompatibilityConstraint(arg, parameterType));
+        if (arg instanceof PsiCallExpression) {
           //If the expression is a poly class instance creation expression (15.9) or a poly method invocation expression (15.12), 
           //the set contains all constraint formulas that would appear in the set C when determining the poly expression's invocation type.
-          final PsiCallExpression callExpression = (PsiCallExpression)args[i];
-          collectAdditionalConstraints(additionalConstraints, callExpression);
-        } else if (args[i] instanceof PsiLambdaExpression && toplevel) {
-          final PsiType interfaceReturnType = LambdaUtil.getFunctionalInterfaceReturnType(parameterType);
-          if (interfaceReturnType != null) {
-            final List<PsiExpression> returnExpressions = LambdaUtil.getReturnExpressions((PsiLambdaExpression)args[i]);
-            for (PsiExpression returnExpression : returnExpressions) {
-              if (returnExpression instanceof PsiCallExpression) {
-                final PsiCallExpression callExpression = (PsiCallExpression)returnExpression;
-                collectAdditionalConstraints(additionalConstraints, callExpression);
-              }
-            }
+          final JavaResolveResult resolveResult = getMethodResult((PsiCallExpression)arg);
+          final PsiMethod calledMethod = resolveResult instanceof MethodCandidateInfo ? (PsiMethod)resolveResult.getElement() : null;
+          if (PsiPolyExpressionUtil.isMethodCallPolyExpression(arg, calledMethod)) {
+            collectAdditionalConstraints(additionalConstraints, (PsiCallExpression)arg);
           }
+        } else if (arg instanceof PsiLambdaExpression) {
+          collectLambdaReturnExpression(additionalConstraints, (PsiLambdaExpression)arg, parameterType);
         }
       }
     }
   }
 
+  private void collectLambdaReturnExpression(Set<ConstraintFormula> additionalConstraints,
+                                             PsiLambdaExpression lambdaExpression,
+                                             PsiType parameterType) {
+    final PsiType interfaceReturnType = LambdaUtil.getFunctionalInterfaceReturnType(parameterType);
+    if (interfaceReturnType != null) {
+      final List<PsiExpression> returnExpressions = LambdaUtil.getReturnExpressions(lambdaExpression);
+      for (PsiExpression returnExpression : returnExpressions) {
+        processReturnExpression(additionalConstraints, returnExpression, interfaceReturnType);
+      }
+    }
+  }
+
+  private void processReturnExpression(Set<ConstraintFormula> additionalConstraints,
+                                       PsiExpression returnExpression,
+                                       PsiType functionalType) {
+    if (returnExpression instanceof PsiCallExpression) {
+      final JavaResolveResult resolveResult = getMethodResult((PsiCallExpression)returnExpression);
+      final PsiMethod calledMethod = resolveResult instanceof MethodCandidateInfo ? (PsiMethod)resolveResult.getElement() : null;
+      if (PsiPolyExpressionUtil.isMethodCallPolyExpression(returnExpression, calledMethod)) {
+        collectAdditionalConstraints(additionalConstraints, (PsiCallExpression)returnExpression);
+      }
+    }
+    else if (returnExpression instanceof PsiParenthesizedExpression) {
+      processReturnExpression(additionalConstraints, ((PsiParenthesizedExpression)returnExpression).getExpression(), functionalType);
+    }
+    else if (returnExpression instanceof PsiConditionalExpression) {
+      processReturnExpression(additionalConstraints, ((PsiConditionalExpression)returnExpression).getThenExpression(), functionalType);
+      processReturnExpression(additionalConstraints, ((PsiConditionalExpression)returnExpression).getElseExpression(), functionalType);
+    }
+    else if (returnExpression instanceof PsiLambdaExpression) {
+      collectLambdaReturnExpression(additionalConstraints, (PsiLambdaExpression)returnExpression, functionalType);
+    }
+  }
+
   private void collectAdditionalConstraints(final Set<ConstraintFormula> additionalConstraints,
                                             final PsiCallExpression callExpression) {
     PsiExpressionList argumentList = callExpression.getArgumentList();
     if (argumentList != null) {
-      final PsiLambdaExpression expression = PsiTreeUtil.getParentOfType(argumentList, PsiLambdaExpression.class);
-      final Computable<JavaResolveResult> computableResolve = new Computable<JavaResolveResult>() {
-        @Override
-        public JavaResolveResult compute() {
-          return callExpression.resolveMethodGenerics();
-        }
-      };
+      final JavaResolveResult result = getMethodResult(callExpression);
       MethodCandidateInfo.CurrentCandidateProperties properties = MethodCandidateInfo.getCurrentMethod(argumentList);
-      final JavaResolveResult result = properties != null ? null :
-                                       expression == null
-                                       ? computableResolve.compute()
-                                       : PsiResolveHelper.ourGraphGuard.doPreventingRecursion(expression, false, computableResolve);
       final PsiMethod method = result instanceof MethodCandidateInfo ? ((MethodCandidateInfo)result).getElement() : properties != null ? properties.getMethod() : null;
       if (method != null) {
         final PsiExpression[] newArgs = argumentList.getExpressions();
         final PsiParameter[] newParams = method.getParameterList().getParameters();
         if (newParams.length > 0) {
           collectAdditionalConstraints(newParams, newArgs, method, result != null ? ((MethodCandidateInfo)result).getSiteSubstitutor() : properties.getSubstitutor(),
-                                       additionalConstraints, result != null ?  ((MethodCandidateInfo)result).isVarargs() : properties.isVarargs(), false);
+                                       additionalConstraints, result != null ?  ((MethodCandidateInfo)result).isVarargs() : properties.isVarargs());
         }
       }
     }
   }
 
+  private static JavaResolveResult getMethodResult(final PsiCallExpression callExpression) {
+    final PsiExpressionList argumentList = callExpression.getArgumentList();
+
+    final PsiLambdaExpression expression = PsiTreeUtil.getParentOfType(argumentList, PsiLambdaExpression.class);
+    final Computable<JavaResolveResult> computableResolve = new Computable<JavaResolveResult>() {
+      @Override
+      public JavaResolveResult compute() {
+        return callExpression.resolveMethodGenerics();
+      }
+    };
+    MethodCandidateInfo.CurrentCandidateProperties properties = MethodCandidateInfo.getCurrentMethod(argumentList);
+    return properties != null ? null :
+           expression == null
+           ? computableResolve.compute()
+           : PsiResolveHelper.ourGraphGuard.doPreventingRecursion(expression, false, computableResolve);
+  }
+
   public PsiSubstitutor retrieveNonPrimitiveEqualsBounds(Collection<InferenceVariable> variables) {
     PsiSubstitutor substitutor = mySiteSubstitutor;
     for (InferenceVariable variable : variables) {
@@ -860,46 +894,67 @@ public class InferenceSession {
       //extract subset of constraints
       final Set<ConstraintFormula> subset = buildSubset(additionalConstraints);
 
-      //collect all input variables of selection 
+      //collect all input variables of selection
       final Set<InferenceVariable> varsToResolve = new LinkedHashSet<InferenceVariable>();
       for (ConstraintFormula formula : subset) {
         if (formula instanceof InputOutputConstraintFormula) {
-          final Set<InferenceVariable> inputVariables = ((InputOutputConstraintFormula)formula).getInputVariables(this);
-          if (inputVariables != null) {
-            for (InferenceVariable inputVariable : inputVariables) {
-              varsToResolve.addAll(inputVariable.getDependencies(this));
-            }
-            varsToResolve.addAll(inputVariables);
-          }
+          collectVarsToResolve(varsToResolve, (InputOutputConstraintFormula)formula);
         }
       }
 
-      //resolve input variables
-      PsiSubstitutor substitutor = resolveSubset(varsToResolve, siteSubstitutor);
-      if (substitutor == null) {
-        return false;
+      for (ConstraintFormula formula : subset) {
+        if (!processOneConstraint(formula, siteSubstitutor, varsToResolve)) return false;
       }
+    }
+    return true;
+  }
 
-      if (myContext instanceof PsiCallExpression) {
-        PsiExpressionList argumentList = ((PsiCallExpression)myContext).getArgumentList();
-        LOG.assertTrue(argumentList != null);
-        MethodCandidateInfo.updateSubstitutor(argumentList, substitutor);
+  private void collectVarsToResolve(Set<InferenceVariable> varsToResolve, InputOutputConstraintFormula formula) {
+    final Set<InferenceVariable> inputVariables = formula.getInputVariables(this);
+    if (inputVariables != null) {
+      for (InferenceVariable inputVariable : inputVariables) {
+        varsToResolve.addAll(inputVariable.getDependencies(this));
       }
+      varsToResolve.addAll(inputVariables);
+    }
+  }
 
-      try {
-        for (ConstraintFormula additionalConstraint : subset) {
-          additionalConstraint.apply(substitutor, true);
-        }
-
-        myConstraints.addAll(subset);
-        if (!repeatInferencePhases(true)) {
-          return false;
+  private boolean processOneConstraint(ConstraintFormula formula, PsiSubstitutor siteSubstitutor, Set<InferenceVariable> varsToResolve) {
+    if (formula instanceof ExpressionCompatibilityConstraint) {
+      final PsiExpression expression = ((ExpressionCompatibilityConstraint)formula).getExpression();
+      final PsiCallExpression callExpression = PsiTreeUtil.getParentOfType(expression, PsiCallExpression.class, false);
+      if (callExpression != null) {
+        final InferenceSession session = myNestedSessions.get(callExpression);
+        if (session != null) {
+          formula.apply(session.myInferenceSubstitution, true);
+          collectVarsToResolve(varsToResolve, (InputOutputConstraintFormula)formula);
         }
       }
-      finally {
-        LambdaUtil.ourFunctionTypes.set(null);
+    }
+
+    //resolve input variables
+    PsiSubstitutor substitutor = resolveSubset(varsToResolve, siteSubstitutor);
+    if (substitutor == null) {
+      return false;
+    }
+
+    if (myContext instanceof PsiCallExpression) {
+      PsiExpressionList argumentList = ((PsiCallExpression)myContext).getArgumentList();
+      LOG.assertTrue(argumentList != null);
+      MethodCandidateInfo.updateSubstitutor(argumentList, substitutor);
+    }
+
+    try {
+      formula.apply(substitutor, true);
+
+      myConstraints.add(formula);
+      if (!repeatInferencePhases(true)) {
+        return false;
       }
     }
+    finally {
+      LambdaUtil.ourFunctionTypes.set(null);
+    }
     return true;
   }
 
@@ -1295,6 +1350,14 @@ public class InferenceSession {
     return myInferenceSubstitution.substitute(type);
   }
 
+  public InferenceSession findNestedCallSession(PsiExpression arg) {
+    InferenceSession session = myNestedSessions.get(PsiTreeUtil.getParentOfType(arg, PsiCallExpression.class));
+    if (session == null) {
+      session = this;
+    }
+    return session;
+  }
+
   public PsiType startWithFreshVars(PsiType type) {
     PsiSubstitutor s = PsiSubstitutor.EMPTY;
     for (InferenceVariable variable : myInferenceVariables) {
index 8d91b620f798fd212a620c595f46ae4eefb01d91..da7b4b78930a7c66243d29763d1fbe6dab456c1c 100644 (file)
@@ -17,6 +17,7 @@ package com.intellij.psi.impl.source.resolve.graphInference;
 
 import com.intellij.psi.*;
 import com.intellij.psi.impl.light.LightTypeParameter;
+import com.intellij.psi.util.PsiUtil;
 
 import java.util.*;
 
@@ -49,6 +50,10 @@ public class InferenceVariable extends LightTypeParameter {
   }
 
   public boolean addBound(PsiType classType, InferenceBound inferenceBound) {
+    if (inferenceBound == InferenceBound.EQ &&
+        PsiUtil.resolveClassInClassTypeOnly(classType) == this) {
+      return false;
+    }
     List<PsiType> list = myBounds.get(inferenceBound);
     if (list == null) {
       list = new ArrayList<PsiType>();
@@ -77,20 +82,18 @@ public class InferenceVariable extends LightTypeParameter {
       }
     }
 
+    if (!session.hasCapture(this) && dependencies.isEmpty()) {
+      return dependencies;
+    }
+
     next:
     for (InferenceVariable variable : session.getInferenceVariables()) {
       if (!dependencies.contains(variable) && variable != this) {
-        nextBound:
-        for (List<PsiType> bounds : myBounds.values()) { //todo
+        for (List<PsiType> bounds : variable.myBounds.values()) { //todo
           if (bounds != null) {
             for (PsiType bound : bounds) {
-              final Set<InferenceVariable> deps = new HashSet<InferenceVariable>();
-              session.collectDependencies(bound, deps);
-              if (deps.isEmpty()) {
-                continue nextBound;
-              }
-
-              if (deps.contains(this)) {
+              final InferenceVariable inferenceVariable = session.getInferenceVariable(bound);
+              if (inferenceVariable == this) {
                 dependencies.add(variable);
                 continue next;
               }
index c282481e79c043bea169afc72166d949de3b3340..f7e9badfa33c9404ae9c0ce413436bb2d03ea6da 100644 (file)
@@ -3,6 +3,7 @@ package com.intellij.psi.impl.source.resolve.graphInference.constraints;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.source.resolve.graphInference.FunctionalInterfaceParameterizationUtil;
 import com.intellij.psi.impl.source.resolve.graphInference.InferenceSession;
+import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
 
 import java.util.List;
@@ -62,8 +63,9 @@ public class LambdaExpressionCompatibilityConstraint implements ConstraintFormul
         if (returnExpressions.isEmpty() && !myExpression.isValueCompatible()) {  //not value-compatible
           return false;
         }
-        returnType = session.substituteWithInferenceVariables(substitutor.substitute(returnType));
-        if (!session.isProperType(returnType)) {
+        InferenceSession callsession = session.findNestedCallSession(myExpression);
+        returnType = callsession.substituteWithInferenceVariables(substitutor.substitute(returnType));
+        if (!callsession.isProperType(returnType)) {
           for (PsiExpression returnExpression : returnExpressions) {
             constraints.add(new ExpressionCompatibilityConstraint(returnExpression, returnType));
           }
index fbfd8195fc112c3aa5d1a333c344a1fa61255e5b..b5e4188e1644babd0adf1e4100478acf8c904bb1 100644 (file)
@@ -169,11 +169,11 @@ public class PsiMethodReferenceCompatibilityConstraint implements ConstraintForm
       }
       LOG.assertTrue(referencedMethodReturnType != null, method);
 
-      session.initBounds(method.getTypeParameters());
+      session.initBounds(myExpression, method.getTypeParameters());
 
       if (!PsiTreeUtil.isContextAncestor(containingClass, myExpression, false) || 
           PsiUtil.getEnclosingStaticElement(myExpression, containingClass) != null) {
-        session.initBounds(containingClass.getTypeParameters());
+        session.initBounds(myExpression, containingClass.getTypeParameters());
       }
 
       //if i) the method reference elides NonWildTypeArguments, 
@@ -243,7 +243,7 @@ public class PsiMethodReferenceCompatibilityConstraint implements ConstraintForm
 
     final PsiClass qualifierClass = PsiUtil.resolveClassInType(qualifierType);
     if (qualifierClass != null) {
-      session.initBounds(qualifierClass.getTypeParameters());
+      session.initBounds(myExpression, qualifierClass.getTypeParameters());
       constraints.add(new StrictSubtypingConstraint(session.substituteWithInferenceVariables(qualifierType),
                                                     session.substituteWithInferenceVariables(substitutor.substitute(targetParameters[0].getType()))));
     }
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/DeepNestedLambdaExpressionsNoFormalParams.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/DeepNestedLambdaExpressionsNoFormalParams.java
new file mode 100644 (file)
index 0000000..5a79aef
--- /dev/null
@@ -0,0 +1,70 @@
+
+import java.util.List;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+
+
+abstract class Simplified {
+  public List<Integer> gerFirstTriangles() {
+    return flatMap(() -> flatMap(() -> map(z -> 1))).collect(Collectors.toList());
+  }
+
+  abstract <R> R flatMap(Supplier<R> mapper);
+  abstract <R> Stream<R> map(Function<Integer, R> mapper);
+}
+
+class PythagoreanTriangles {
+
+  static class Triplet<T,U,R>{
+    private T t;
+    private U u;
+    private R r;
+
+    public Triplet(T t, U u, R r){
+      this.t = t;
+      this.u = u;
+      this.r = r;
+    }
+
+    @Override
+    public String toString() {
+      return t.toString() + "," + u.toString() + "," + r.toString();
+    }
+  }
+
+  public void pythagoreanTriangles(Integer num){
+    Stream<Integer> numbers = IntStream.rangeClosed(1,num).boxed();
+
+    Stream<Triplet<Integer, Integer, Integer>> triangles = numbers.flatMap(x -> {
+      return IntStream.rangeClosed(1, x).boxed().flatMap(y -> {
+        return IntStream.rangeClosed(1, y).boxed().filter(z -> {
+          return x * x == y * y + z * z;
+        }).map(z1 -> new Triplet<Integer, Integer, Integer>(x, y, z1));
+      });
+    });
+
+    triangles.forEach(System.out::println);
+
+  }
+
+  public List<Triplet<Integer, Integer, Integer>> gerFirstTriangles(long num){
+    Stream<Integer> infinity = Stream.iterate(1, (n) -> n + 1);
+    return infinity.flatMap(x -> {
+      return IntStream.rangeClosed(1, x).boxed().flatMap(y -> {
+        return IntStream.rangeClosed(1, y).boxed().filter(z -> {
+          return x * x == y * y + z * z;
+        }).map(z1 -> new Triplet<Integer, Integer, Integer>(x, y, z1));
+      });
+    }).limit(num).collect(Collectors.toList());
+  }
+
+
+  public static void main(String[] args) {
+    PythagoreanTriangles triangles = new PythagoreanTriangles();
+    triangles.pythagoreanTriangles(10);
+    triangles.gerFirstTriangles(5l).forEach(System.out::println);
+  }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/IDEA126778.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/IDEA126778.java
new file mode 100644 (file)
index 0000000..d8bdcc0
--- /dev/null
@@ -0,0 +1,27 @@
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static java.util.stream.Collectors.groupingBy;
+import static java.util.stream.Collectors.mapping;
+
+class Test {
+  private static Map<Long, Long> multiDataPointsToPerTxnSummedValue(final Stream<Map.Entry<DateTime, Map<Long, Long>>> stream) {
+    return stream.flatMap(e -> e.getValue().entrySet().stream().map(ex ->
+                                                                      new Object() {
+                                                                        Long txId = ex.getKey();
+                                                                        DataPoint dataPoint = new DataPoint(e.getKey(), ex.getValue());
+                                                                      }
+    )).collect(groupingBy(t -> t.txId, mapping(t -> t.dataPoint, Collectors.summingLong(dataPoint -> dataPoint.getValue().longValue()))));
+  }
+
+  static class MultiDataPoint {}
+  static class DateTime {}
+
+  static class DataPoint {
+    DataPoint(DateTime t, Long val) {}
+    public Long getValue() {
+      return null;
+    }
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressions1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressions1.java
new file mode 100644 (file)
index 0000000..c31497d
--- /dev/null
@@ -0,0 +1,27 @@
+class ExplicitLambdaNoParams {
+  interface I<T> {
+    T a();
+  }
+
+  <F> I<F> foo(I<F> iff) { return null;}
+
+  {
+    foo(() -> foo(() -> 1)).a();
+    I<Integer> a1 = foo(() -> foo(() -> 1)).a();
+  }
+}
+
+class LambdaWithFormalParameterTypes {
+
+  interface I<T> {
+    T a(int p);
+  }
+
+  <F> I<F> foo(I<F> iff) { return null;}
+
+  {
+    foo((int a) -> foo((int b) -> 1)).a(0);
+    I<Integer> a1 = foo((int a) -> foo((int b) -> 1)).a(0);
+  }
+
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParams.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParams.java
new file mode 100644 (file)
index 0000000..2d62545
--- /dev/null
@@ -0,0 +1,55 @@
+import java.util.function.Function;
+import java.util.stream.IntStream;
+import java.util.stream.Stream;
+
+abstract class NoFormalParams {
+  interface I<T> {
+    T a(int a);
+  }
+
+  <F> I<F> foo(I<F> i) { return null;}
+
+  {
+    I<Integer> i =  foo(a -> foo(b -> 1)).a(0);
+    foo(a -> foo(b -> 1)).a(0);
+  }
+}
+
+abstract class NoFormalParamTypeInferenceNeeded {
+  interface I<T> {
+    T a(int a);
+  }
+
+  abstract <RR> RR  map(I<RR> mapper);
+  abstract <R, V> R zip(Function<V, R> zipper);
+
+  {
+    map(a -> zip(text ->  text));
+    zip(a -> zip(text ->  text));
+    Integer zip = zip(<error descr="Cyclic inference">a -> zip(text -> text)</error>);
+  }
+
+}
+
+class IDEA124983 {
+  class Rectangle{
+    public Rectangle(int i, int j, int h, int w) {
+    }
+  }
+
+  void createGrid() {
+    IntStream.range(0, 4)
+      .mapToObj(i -> IntStream.range(0, 4).mapToObj(j -> {
+        Rectangle rect2 = new Rectangle(i * 64, j * 64, 64, 64);
+        return rect2;
+      }))
+      .flatMap(s -> s)
+      .forEach(this::add);
+  }
+
+  void add(final Rectangle r) {}
+
+  void simplified(final IntStream range) {
+    range.mapToObj(i -> range.mapToObj(j -> 1)).flatMap(s -> s);
+  }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParams1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParams1.java
new file mode 100644 (file)
index 0000000..a3ce57b
--- /dev/null
@@ -0,0 +1,26 @@
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+class IDEA129251 {
+  void simplified(final Stream<String> pStream, final Stream<String> pStream1, final Stream<String> pStream2){
+    pStream.flatMap(x -> Stream.concat(pStream1, pStream2.map(String::toUpperCase)));
+  }
+
+
+  private final Set<String> m_allSubtablesColumns;
+  private final List<SubtableDescription> m_subtablesDescription = null;
+
+  {
+    m_allSubtablesColumns = m_subtablesDescription.stream().
+      flatMap(desc -> Stream.concat(desc.getKeyColumns().stream().map(String::toUpperCase),
+                                    desc.getValueColumns().stream().map(String::toUpperCase))).
+      collect(Collectors.toSet());
+  }
+
+  abstract class SubtableDescription {
+    abstract List<String> getKeyColumns();
+    abstract List<String> getValueColumns();
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParamsStopAtStandalone.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/NestedLambdaExpressionsNoFormalParamsStopAtStandalone.java
new file mode 100644 (file)
index 0000000..be7be35
--- /dev/null
@@ -0,0 +1,32 @@
+import java.util.Map;
+import java.util.function.Function;
+import java.util.function.Supplier;
+import java.util.stream.Collector;
+import java.util.stream.Stream;
+
+class MultiDataPoint {
+  public MultiDataPoint(final Map<String, String> pCollect) {}
+
+  public static void convertValueResults(final Stream<Result> pStream) {
+    map(() -> new MultiDataPoint(collect(toMap(r -> r.event.substring(0)))));
+  }
+
+  static <R> R collect(Collector<? super Result, ?, R> collector) {return null;}
+
+  static <R> R map(Supplier<R> s) {
+    return null;
+  }
+
+  static <T, K> Collector<T, ?, Map<K,K>> toMap(Function< T,  K> keyMapper) {
+    return null;
+  }
+
+  static class Result {
+    public String event;
+
+    public String getValue() {
+      return null;
+    }
+  }
+}
+
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ParenthesizedExpressionsDuringConstrainsCollection.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ParenthesizedExpressionsDuringConstrainsCollection.java
new file mode 100644 (file)
index 0000000..2dd69c3
--- /dev/null
@@ -0,0 +1,13 @@
+import java.util.List;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+abstract class Test {
+  public List<Integer> gerFirstTriangles() {
+    return flatMap((y -> (map((z1 -> (1)))))).collect(Collectors.toList());
+  }
+
+  abstract <R> R         flatMap(Function<Integer, R> mapper);
+  abstract <R> Stream<R> map    (Function<Integer, R> mapper);
+}
\ No newline at end of file
index 6086c92b40d4d7cf4a358704bf8868dff871e3c0..1197fe817e8e4c0a48352865db91c283fbe0e1d0 100644 (file)
@@ -1,3 +1,6 @@
+import org.jetbrains.annotations.Contract;
+import org.jetbrains.annotations.Nullable;
+
 class Doo {
 
   void foo(Throwable e) {
@@ -9,4 +12,18 @@ class Doo {
     }
   }
 
+}
+
+abstract class Test04 {
+  @Nullable
+  @Contract(pure = true)
+  abstract Test04 getParent();
+
+  Test04 getTopParent() {
+    Test04 top = this;
+    while (top.getParent() != null) {
+      top = top.getParent();
+    }
+    return top;
+  }
 }
\ No newline at end of file
index 1da75f51ba6f9a4474249cb3cee94a038ca2922c..5307493a745526deeb1e8f589ed7a75c2d270309 100644 (file)
@@ -71,16 +71,17 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
   public void testIDEA121315() { doTest(); }
   public void testIDEA118965comment() { doTest(); }
   public void testIDEA122074() { doTest(); }
+  @Bombed(day = 30, month = Calendar.SEPTEMBER)
   public void testIDEA122084() { doTest(); }
   public void testAdditionalConstraintDependsOnNonMentionedVars() { doTest(); }
   public void testIDEA122616() { doTest(); }
   public void testIDEA122700() { doTest(); }
   public void testIDEA122406() { doTest(); }
-  @Bombed(day = 30, month = Calendar.SEPTEMBER)
   public void testNestedCallsInsideLambdaReturnExpression() { doTest(); }
   @Bombed(day = 30, month = Calendar.SEPTEMBER)
   public void testIDEA123731() { doTest(); }
   public void testIDEA123869() { doTest(); }
+  @Bombed(day = 30, month = Calendar.SEPTEMBER)
   public void testIDEA123848() { doTest(); }
   public void testOnlyLambdaAtTypeParameterPlace() { doTest(); }
   public void testLiftedIntersectionType() { doTest(); }
@@ -94,6 +95,12 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
   public void testIDEA126109() { doTest(); }
   public void testIDEA126809() { doTest(); }
   public void testIDEA124424() { doTest(); }
+  public void testNestedLambdaExpressions1() { doTest(); }
+  public void testNestedLambdaExpressionsNoFormalParams() { doTest(); }
+  @Bombed(day = 30, month = Calendar.SEPTEMBER)
+  public void testNestedLambdaExpressionsNoFormalParams1() { doTest(); }
+  public void testDeepNestedLambdaExpressionsNoFormalParams() { doTest(); }
+  public void testNestedLambdaExpressionsNoFormalParamsStopAtStandalone() { doTest(); }
 
   public void testIDEA127596() throws Exception {
     doTest();
@@ -115,6 +122,14 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
     doTest();
   }
 
+  public void testParenthesizedExpressionsDuringConstrainsCollection() throws Exception {
+    doTest();
+  }
+
+  public void testIDEA126778() throws Exception {
+    doTest();
+  }
+
   private void doTest() {
     doTest(false);
   }
index c981137d02531d81b8c576ac95f1fe954468df02..437159d1646ee92ad7fee0764e2c0d6340e64c9c 100644 (file)
@@ -305,7 +305,6 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
     doTest();
   }
 
-  @Bombed(day = 30, month = Calendar.SEPTEMBER)
   public void testAdditionalConstraints3Level() throws Exception {
     doTest();
   }
index 8781b7bb473a331dec09c8de60c22d856b24483d..c3f4c3238304c6d955dc6c12d6c161ec215ae20f 100644 (file)
@@ -346,6 +346,31 @@ class ContractInferenceFromSourceTest extends LightCodeInsightFixtureTestCase {
     assert c == ['null -> null', '!null -> !null']
   }
 
+  public void "test use delegated method notnull"() {
+    def c = inferContracts("""
+    final Object foo(Object bar) {
+        return doo();
+    }
+
+    @org.jetbrains.annotations.NotNull Object doo() {}
+    """)
+    assert c == ['_ -> !null']
+  }
+
+  public void "test use delegated method notnull with contracts"() {
+    def c = inferContracts("""
+    final Object foo(Object bar, Object o2) {
+        return doo(o2);
+    }
+
+    @org.jetbrains.annotations.NotNull Object doo(Object o) {
+      if (o == null) throw new RuntimeException();
+      return smth();
+    }
+    """)
+    assert c == ['_, null -> fail', '_, _ -> !null']
+  }
+
   private String inferContract(String method) {
     return assertOneElement(inferContracts(method))
   }
diff --git a/lib/jsch-0.1.50.jar b/lib/jsch-0.1.50.jar
deleted file mode 100644