Merge remote-tracking branch 'origin/master' into test2
authorIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Tue, 23 Dec 2014 18:53:28 +0000 (21:53 +0300)
committerIlya.Kazakevich <Ilya.Kazakevich@jetbrains.com>
Tue, 23 Dec 2014 18:53:28 +0000 (21:53 +0300)
397 files changed:
build/scripts/utils.gant
images/src/org/intellij/images/thumbnail/actions/EnterAction.java
java/compiler/impl/src/com/intellij/compiler/CompilerConfigurationImpl.java
java/compiler/impl/src/com/intellij/compiler/options/JavaCompilersTab.java
java/compiler/openapi/src/com/intellij/openapi/deployment/DeploymentUtil.java
java/debugger/impl/src/com/intellij/debugger/actions/ViewAsGroup.java
java/debugger/impl/src/com/intellij/debugger/engine/CompoundPositionManager.java
java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
java/debugger/impl/src/com/intellij/debugger/engine/requests/RequestManagerImpl.java
java/debugger/openapi/src/com/intellij/debugger/MultiRequestPositionManager.java [new file with mode: 0644]
java/idea-ui/src/com/intellij/framework/FrameworkGroup.java
java/idea-ui/src/com/intellij/framework/FrameworkOrGroup.java
java/java-impl/src/com/intellij/codeInsight/completion/JavadocCompletionConfidence.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaLineMarkerProvider.java
java/java-impl/src/com/intellij/codeInsight/template/impl/JavaTemplateUtil.java
java/java-impl/src/com/intellij/jarFinder/SourceSearcher.java
java/java-impl/src/com/intellij/refactoring/JavaRefactoringSettings.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeInfoImpl.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureHandler.java
java/java-impl/src/com/intellij/refactoring/changeSignature/JavaChangeSignatureUsageProcessor.java
java/java-impl/src/com/intellij/refactoring/convertToInstanceMethod/ConvertToInstanceMethodDialog.java
java/java-impl/src/com/intellij/refactoring/convertToInstanceMethod/ConvertToInstanceMethodProcessor.java
java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java
java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodProcessor.java
java/java-impl/src/com/intellij/refactoring/introduceParameter/InplaceIntroduceParameterPopup.java
java/java-impl/src/com/intellij/refactoring/introduceParameter/IntroduceParameterSettingsUI.java
java/java-impl/src/com/intellij/refactoring/makeStatic/AbstractMakeStaticDialog.java
java/java-impl/src/com/intellij/refactoring/makeStatic/MakeMethodStaticProcessor.java
java/java-impl/src/com/intellij/refactoring/makeStatic/MakeParameterizedStaticDialog.java
java/java-impl/src/com/intellij/refactoring/makeStatic/Settings.java
java/java-impl/src/com/intellij/refactoring/move/MoveDialogBase.java [new file with mode: 0644]
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassToInnerProcessor.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesDialog.form
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesDialog.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesProcessor.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesToNewDirectoryDialog.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesToNewDirectoryForm.form
java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerDialog.form
java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerDialog.java
java/java-impl/src/com/intellij/refactoring/move/moveInner/MoveInnerProcessor.java
java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodDialog.java
java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodDialogBase.java
java/java-impl/src/com/intellij/refactoring/move/moveInstanceMethod/MoveInstanceMethodProcessor.java
java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersDialog.java
java/java-impl/src/com/intellij/refactoring/move/moveMembers/MoveMembersProcessor.java
java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticOverloadsRenamer.java [new file with mode: 0644]
java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticOverloadsRenamerFactory.java [new file with mode: 0644]
java/java-impl/src/com/intellij/refactoring/safeDelete/JavaSafeDeleteProcessor.java
java/java-psi-api/src/com/intellij/psi/PsiElementFinder.java
java/java-psi-api/src/com/intellij/psi/PsiPackage.java
java/java-psi-api/src/com/intellij/psi/augment/PsiAugmentProvider.java
java/java-psi-impl/src/com/intellij/psi/impl/JavaPsiFacadeImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java [new file with mode: 0644]
java/java-psi-impl/src/com/intellij/psi/impl/file/PsiPackageImpl.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/changeSignature/DelegateInInterface.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/changeSignature/DelegateInInterface_after.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterMethodTypeParamWithNestedClass.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeMethodTypeParamWithNestedClass.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/template/IterParameterizedInnerInMethod-out.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/template/IterParameterizedInnerInMethod.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/template/postfix/templates/for/inAnonymousRunnable.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/template/postfix/templates/for/inAnonymousRunnable_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromConstant.java [new file with mode: 0644]
java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromConstant_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromStatic.java [new file with mode: 0644]
java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromStatic_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inplaceIntroduceParameter/replaceOneLeaveParamToDelete.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inplaceIntroduceParameter/replaceOneLeaveParamToDelete_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/makeMethodStatic/afterFieldsAndDelegation.java [new file with mode: 0644]
java/java-tests/testData/refactoring/makeMethodStatic/beforeFieldsAndDelegation.java [new file with mode: 0644]
java/java-tests/testData/refactoring/renameMethod/multi/automaticallyRenamedOverloads/after/p/Foo.java [new file with mode: 0644]
java/java-tests/testData/refactoring/renameMethod/multi/automaticallyRenamedOverloads/before/p/Foo.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/ChangeSignatureTouchLambdaTest.java
java/java-tests/testSrc/com/intellij/codeInsight/javadoc/ExternalJavadocPresentationTest.java
java/java-tests/testSrc/com/intellij/codeInsight/template/LiveTemplateTest.groovy
java/java-tests/testSrc/com/intellij/codeInsight/template/postfix/templates/ForeachTemplateTest.java
java/java-tests/testSrc/com/intellij/ide/fileTemplates/impl/FileTemplateTestUtil.java
java/java-tests/testSrc/com/intellij/refactoring/ExtractMethodTest.java
java/java-tests/testSrc/com/intellij/refactoring/InplaceIntroduceParameterTest.java
java/java-tests/testSrc/com/intellij/refactoring/MakeMethodStaticTest.java
java/java-tests/testSrc/com/intellij/refactoring/RenameMethodMultiTest.java
java/structuralsearch-java/src/com/intellij/structuralsearch/JavaReplaceHandler.java
java/structuralsearch-java/src/com/intellij/structuralsearch/impl/matcher/compiler/JavaCompilingVisitor.java
jps/jps-builders/src/org/jetbrains/jps/javac/JavacMain.java
platform/analysis-api/src/com/intellij/psi/search/scope/packageSet/FilePatternPackageSet.java
platform/core-api/src/com/intellij/openapi/project/DumbService.java
platform/core-impl/src/com/intellij/mock/MockDumbService.java
platform/icons/src/javaee/JavaeeAppModule.png [changed mode: 0644->0755]
platform/icons/src/javaee/JavaeeAppModule@2x.png [new file with mode: 0755]
platform/icons/src/javaee/JavaeeAppModule@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/JavaeeAppModule_dark.png [new file with mode: 0755]
platform/icons/src/javaee/WebService.png [changed mode: 0644->0755]
platform/icons/src/javaee/WebService2.png [new file with mode: 0755]
platform/icons/src/javaee/WebService2@2x.png [new file with mode: 0755]
platform/icons/src/javaee/WebService2@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/WebService@2x.png [new file with mode: 0755]
platform/icons/src/javaee/WebServiceClient.png [changed mode: 0644->0755]
platform/icons/src/javaee/WebServiceClient2.png [new file with mode: 0755]
platform/icons/src/javaee/WebServiceClient2@2x.png [new file with mode: 0755]
platform/icons/src/javaee/WebServiceClient2@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/WebServiceClient2_dark.png [new file with mode: 0755]
platform/icons/src/javaee/WebServiceClient@2x.png [new file with mode: 0755]
platform/icons/src/javaee/WebService_dark.png [new file with mode: 0755]
platform/icons/src/javaee/application_xml.png [changed mode: 0644->0755]
platform/icons/src/javaee/application_xml@2x.png [new file with mode: 0755]
platform/icons/src/javaee/application_xml@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/application_xml_dark.png [new file with mode: 0755]
platform/icons/src/javaee/buildOnFrameDeactivation.png [changed mode: 0644->0755]
platform/icons/src/javaee/dataSourceImport.png [changed mode: 0644->0755]
platform/icons/src/javaee/dataSourceImport@2x.png [new file with mode: 0755]
platform/icons/src/javaee/databaseSchemaImportLegend.png [changed mode: 0644->0755]
platform/icons/src/javaee/dbSchemaImportBig.png [changed mode: 0644->0755]
platform/icons/src/javaee/dbSchemaImportBig@2x.png [new file with mode: 0755]
platform/icons/src/javaee/ejb-jar_xml.png [changed mode: 0644->0755]
platform/icons/src/javaee/ejb-jar_xml@2x.png [new file with mode: 0755]
platform/icons/src/javaee/ejbClass.png [changed mode: 0644->0755]
platform/icons/src/javaee/ejbClass@2x.png [new file with mode: 0755]
platform/icons/src/javaee/ejbModule.png [changed mode: 0644->0755]
platform/icons/src/javaee/ejbModule@2x.png [new file with mode: 0755]
platform/icons/src/javaee/embeddedAttributeOverlay.png [changed mode: 0644->0755]
platform/icons/src/javaee/embeddedAttributeOverlay@2x.png [new file with mode: 0755]
platform/icons/src/javaee/embeddedAttributeOverlay@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/embeddedAttributeOverlay_dark.png [new file with mode: 0755]
platform/icons/src/javaee/entityBean.png [changed mode: 0644->0755]
platform/icons/src/javaee/entityBean@2x.png [new file with mode: 0755]
platform/icons/src/javaee/entityBean@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/entityBeanBig.png [changed mode: 0644->0755]
platform/icons/src/javaee/entityBeanBig@2x.png [new file with mode: 0755]
platform/icons/src/javaee/entityBeanBig@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/entityBeanBig_dark.png [new file with mode: 0755]
platform/icons/src/javaee/entityBean_dark.png [new file with mode: 0755]
platform/icons/src/javaee/home.png [changed mode: 0644->0755]
platform/icons/src/javaee/home@2x.png [new file with mode: 0755]
platform/icons/src/javaee/inheritedAttributeOverlay.png [changed mode: 0644->0755]
platform/icons/src/javaee/inheritedAttributeOverlay@2x.png [new file with mode: 0755]
platform/icons/src/javaee/inheritedAttributeOverlay@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/inheritedAttributeOverlay_dark.png [new file with mode: 0755]
platform/icons/src/javaee/interceptorClass.png [changed mode: 0644->0755]
platform/icons/src/javaee/interceptorClass@2x.png [new file with mode: 0755]
platform/icons/src/javaee/interceptorMethod.png [changed mode: 0644->0755]
platform/icons/src/javaee/interceptorMethod@2x.png [new file with mode: 0755]
platform/icons/src/javaee/jpaFacet.png [changed mode: 0644->0755]
platform/icons/src/javaee/jpaFacet@2x.png [new file with mode: 0755]
platform/icons/src/javaee/local.png [changed mode: 0644->0755]
platform/icons/src/javaee/local@2x.png [new file with mode: 0755]
platform/icons/src/javaee/local@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/localHome.png [changed mode: 0644->0755]
platform/icons/src/javaee/localHome@2x.png [new file with mode: 0755]
platform/icons/src/javaee/localHome@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/localHome_dark.png [new file with mode: 0755]
platform/icons/src/javaee/local_dark.png [new file with mode: 0755]
platform/icons/src/javaee/messageBean.png [changed mode: 0644->0755]
platform/icons/src/javaee/messageBean@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceAttribute.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceAttribute@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceEmbeddable.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceEmbeddable@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceEmbeddable@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceEmbeddable_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceEntity.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceEntity@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceEntity@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceEntityListener.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceEntityListener@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceEntity_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceId.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceId@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceId@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceIdRelationship.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceIdRelationship@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceIdRelationship@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceIdRelationship_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceId_dark.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceMappedSuperclass.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceMappedSuperclass@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceRelationship.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceRelationship@2x.png [new file with mode: 0755]
platform/icons/src/javaee/persistenceUnit.png [changed mode: 0644->0755]
platform/icons/src/javaee/persistenceUnit@2x.png [new file with mode: 0755]
platform/icons/src/javaee/remote.png [changed mode: 0644->0755]
platform/icons/src/javaee/remote@2x.png [new file with mode: 0755]
platform/icons/src/javaee/remote@2x_dark.png [new file with mode: 0755]
platform/icons/src/javaee/remote_dark.png [new file with mode: 0755]
platform/icons/src/javaee/sessionBean.png [changed mode: 0644->0755]
platform/icons/src/javaee/sessionBean@2x.png [new file with mode: 0755]
platform/icons/src/javaee/updateRunningApplication.png [changed mode: 0644->0755]
platform/icons/src/javaee/updateRunningApplication@2x.png [changed mode: 0644->0755]
platform/icons/src/javaee/webModule.png [changed mode: 0644->0755]
platform/icons/src/javaee/webModule@2x.png [new file with mode: 0755]
platform/icons/src/javaee/webModuleGroup.png [changed mode: 0644->0755]
platform/icons/src/javaee/webModuleGroup@2x.png [new file with mode: 0755]
platform/icons/src/javaee/web_xml.png [changed mode: 0644->0755]
platform/icons/src/javaee/web_xml@2x.png [changed mode: 0644->0755]
platform/lang-api/src/com/intellij/execution/runners/ExecutionUtil.java
platform/lang-api/src/com/intellij/facet/frameworks/SettingsConnectionService.java
platform/lang-api/src/com/intellij/lang/folding/CustomFoldingSurroundDescriptor.java
platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java
platform/lang-impl/src/com/intellij/codeInsight/actions/AbstractLayoutCodeProcessor.java
platform/lang-impl/src/com/intellij/codeInsight/actions/RearrangeCodeProcessor.java
platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeAction.java
platform/lang-impl/src/com/intellij/codeInsight/actions/ReformatCodeProcessor.java
platform/lang-impl/src/com/intellij/codeInsight/documentation/AbstractExternalFilter.java
platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoDeclarationAction.java
platform/lang-impl/src/com/intellij/codeInsight/navigation/actions/GotoTypeDeclarationAction.java
platform/lang-impl/src/com/intellij/find/impl/FindInProjectUtil.java
platform/lang-impl/src/com/intellij/ide/actions/GotoActionAction.java
platform/lang-impl/src/com/intellij/ide/fileTemplates/FileTemplateManager.java
platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/AllFileTemplatesConfigurable.java
platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/FTManager.java
platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.form
platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java
platform/lang-impl/src/com/intellij/openapi/vfs/encoding/FileEncodingConfigurable.java
platform/lang-impl/src/com/intellij/packageDependencies/ui/RefactoringScopeElementListenerProvider.java
platform/lang-impl/src/com/intellij/refactoring/move/moveFilesOrDirectories/MoveFilesOrDirectoriesDialog.java
platform/lang-impl/src/com/intellij/refactoring/move/moveFilesOrDirectories/MoveFilesOrDirectoriesProcessor.java
platform/lang-impl/src/com/intellij/refactoring/move/moveFilesOrDirectories/MoveFilesOrDirectoriesUtil.java
platform/lang-impl/src/com/intellij/webcore/packaging/ManagePackagesDialog.java
platform/platform-api/src/com/intellij/notification/Notifications.java
platform/platform-api/src/com/intellij/openapi/ui/Messages.java
platform/platform-api/src/com/intellij/ui/MessageException.java [moved from platform/platform-impl/src/com/intellij/ui/mac/MacMessageException.java with 82% similarity]
platform/platform-api/src/com/intellij/ui/components/labels/LinkLabel.java
platform/platform-api/src/com/intellij/util/io/HttpRequests.java
platform/platform-api/src/com/intellij/util/io/ProgressMonitorInputStream.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/diagnostic/DevelopersLoader.java
platform/platform-impl/src/com/intellij/ide/actions/ToggleDistractionFreeModeAction.java
platform/platform-impl/src/com/intellij/ide/plugins/InstallPluginAction.java
platform/platform-impl/src/com/intellij/ide/plugins/InstalledPluginsManagerMain.java
platform/platform-impl/src/com/intellij/ide/plugins/PluginManager.java
platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerConfigurable.java
platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java
platform/platform-impl/src/com/intellij/ide/plugins/RepositoryHelper.java
platform/platform-impl/src/com/intellij/notification/impl/GotItStateKeeper.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/notification/impl/NotificationsConfigurable.java
platform/platform-impl/src/com/intellij/openapi/components/impl/ServiceManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/ForcedSoftWrapsNotificationProvider.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/text/TextEditorComponent.java
platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressStream.java [deleted file]
platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/PluginDownloader.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/PluginUpdateInfoDialog.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateChecker.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiser.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/pluginsAdvertisement/PluginsAdvertiserDialog.java
platform/platform-impl/src/com/intellij/ui/mac/MacMessagesImpl.java
platform/platform-impl/src/com/intellij/ui/messages/JBMacMessages.java
platform/platform-impl/src/com/intellij/ui/messages/SheetController.java
platform/platform-impl/src/com/intellij/ui/messages/SheetMessage.java
platform/platform-impl/src/com/intellij/util/ui/ReloadableComboBoxPanel.form [new file with mode: 0644]
platform/platform-impl/src/com/intellij/util/ui/ReloadableComboBoxPanel.java [new file with mode: 0644]
platform/platform-resources-en/src/messages/EditorBundle.properties
platform/platform-resources-en/src/messages/IdeBundle.properties
platform/platform-resources-en/src/messages/RefactoringBundle.properties
platform/platform-resources/src/META-INF/PlatformExtensions.xml
platform/platform-resources/src/brokenPlugins.txt
platform/platform-tests/testSrc/com/intellij/codeInsight/actions/ReformatFilesWithFiltersTest.java
platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/LightFileTemplatesTest.java
platform/platform-tests/testSrc/com/intellij/ide/fileTemplates/impl/SimpleTemplatesTest.java [moved from java/java-tests/testSrc/com/intellij/ide/fileTemplates/SimpleTemplatesTest.java with 90% similarity]
platform/platform-tests/testSrc/com/intellij/openapi/fileTypes/impl/FileTypesTest.java
platform/platform-tests/testSrc/com/intellij/usages/impl/UsageViewManagerTest.java [new file with mode: 0644]
platform/platform-tests/testSrc/com/intellij/util/io/HttpRequestsTest.java
platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentBase.java
platform/remote-servers/agent-rt/src/com/intellij/remoteServer/agent/util/CloudAgentWithDeployment.java
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/configuration/RemoteServerListConfigurable.java
platform/remote-servers/impl/src/com/intellij/remoteServer/impl/runtime/ui/tree/ServersTreeNode.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeBase.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudApplicationRuntimeImpl.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudMultiSourceServerRuntimeInstance.java
platform/remote-servers/impl/src/com/intellij/remoteServer/util/CloudServerRuntimeInstance.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/SMTestProxy.java
platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/compiler/GlobalCompilingVisitor.java
platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/SearchDialog.java
platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/UIUtil.java
platform/structuralsearch/source/messages/SSRBundle.properties
platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralReplaceTest.java
platform/structuralsearch/testSource/com/intellij/structuralsearch/StructuralSearchTest.java
platform/testRunner/src/com/intellij/execution/testframework/actions/ViewAssertEqualsDiffAction.java
platform/usageView/src/com/intellij/usages/impl/UsageViewManagerImpl.java
platform/util/src/com/intellij/icons/AllIcons.java
platform/util/src/com/intellij/openapi/util/JDOMExternalizableStringList.java
platform/util/src/com/intellij/openapi/util/JDOMUtil.java
platform/util/src/com/intellij/util/xmlb/BeanBinding.java
platform/util/src/com/intellij/util/xmlb/JDOMExternalizableStringListBinding.java [new file with mode: 0644]
platform/util/src/com/intellij/util/xmlb/XmlSerializerImpl.java
platform/util/testSrc/com/intellij/util/xmlb/XmlSerializerTest.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java
platform/vcs-impl/src/com/intellij/openapi/vcs/update/RefreshVFsSynchronously.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/frame/XWatchesViewImpl.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/SetValueInplaceEditor.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties
plugins/InspectionGadgets/src/com/siyeh/ig/performance/MethodMayBeStaticInspection.java
plugins/InspectionGadgets/test/com/siyeh/igtest/visibility/ambiguous_field_access/AmbiguousFieldAccess.java
plugins/coverage/src/com/intellij/coverage/JavaCoverageEngineExtension.java
plugins/coverage/src/com/intellij/coverage/PackageAnnotator.java
plugins/coverage/src/com/intellij/coverage/view/JavaCoverageViewExtension.java
plugins/devkit/src/inspections/TitleCapitalizationInspection.java
plugins/devkit/testData/inspections/capitalization/MultipleReturns.java [new file with mode: 0644]
plugins/devkit/testData/inspections/capitalization/MultipleReturns_after.java [new file with mode: 0644]
plugins/devkit/testSources/inspections/CapitalizationInspectionTest.java
plugins/git4idea/src/git4idea/GitUtil.java
plugins/git4idea/src/git4idea/cherrypick/GitCherryPicker.java
plugins/git4idea/src/git4idea/merge/GitConflictResolver.java
plugins/gradle/src/org/jetbrains/plugins/gradle/config/GradlePatcher.java [deleted file]
plugins/gradle/src/org/jetbrains/plugins/gradle/execution/GradleOrderEnumeratorHandler.java
plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/data/ExternalProjectDataService.java
plugins/groovy/groovy-psi/resources/fileTemplates/code/Groovy JUnit SetUp Method.groovy.html
plugins/groovy/groovy-psi/resources/fileTemplates/code/Groovy JUnit TearDown Method.groovy.html
plugins/groovy/groovy-psi/resources/fileTemplates/code/Groovy JUnit Test Case.groovy.html
plugins/groovy/groovy-psi/resources/fileTemplates/code/Groovy JUnit Test Method.groovy.html
plugins/groovy/groovy-psi/resources/fileTemplates/code/Groovy New Method Body.groovy.html
plugins/groovy/groovy-psi/resources/fileTemplates/code/Spock Test Method.groovy.html
plugins/groovy/groovy-psi/resources/fileTemplates/code/Spock cleanup Method.groovy.html
plugins/groovy/groovy-psi/resources/fileTemplates/code/Spock_SetUp_Method.groovy.html
plugins/groovy/groovy-psi/src/org/jetbrains/plugins/groovy/lang/groovydoc/lexer/GroovyDocLexer.java
plugins/groovy/src/org/jetbrains/plugins/groovy/codeInsight/GroovyLineMarkerProvider.java
plugins/groovy/src/org/jetbrains/plugins/groovy/griffon/GriffonFramework.java
plugins/groovy/src/org/jetbrains/plugins/groovy/ivy/AbstractAttachSourceProvider.java
plugins/groovy/src/org/jetbrains/plugins/groovy/mvc/MvcFramework.java
plugins/groovy/test/org/jetbrains/plugins/groovy/GroovyActionsTest.groovy
plugins/hg4idea/src/org/zmlx/hg4idea/HgVcs.java
plugins/hg4idea/src/org/zmlx/hg4idea/branch/HgBranchPopup.java
plugins/hg4idea/src/org/zmlx/hg4idea/branch/HgBranchPopupActions.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgCommitCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/command/HgUpdateCommand.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCheckinEnvironment.java
plugins/hg4idea/src/org/zmlx/hg4idea/provider/commit/HgCloseBranchExecutor.java [new file with mode: 0644]
plugins/junit/src/com/intellij/execution/junit2/TestProxy.java
plugins/junit/src/com/intellij/execution/junit2/ui/actions/RunningTestTracker.java
plugins/junit/src/fileTemplates/code/JUnit3 SetUp Method.java.html
plugins/junit/src/fileTemplates/code/JUnit3 TearDown Method.java.html
plugins/junit/src/fileTemplates/code/JUnit3 Test Class.java.html
plugins/junit/src/fileTemplates/code/JUnit3 Test Method.java.html
plugins/junit/src/fileTemplates/code/JUnit4 Parameters Method.java.html
plugins/junit/src/fileTemplates/code/JUnit4 SetUp Method.java.html
plugins/junit/src/fileTemplates/code/JUnit4 TearDown Method.java.html
plugins/junit/src/fileTemplates/code/JUnit4 Test Class.java.html
plugins/junit/src/fileTemplates/code/JUnit4 Test Method.java.html
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManager.java
plugins/svn4idea/src/org/jetbrains/idea/svn/SvnUtil.java
plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/BranchConfigurationDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/CreateBranchOrTagAction.java
plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/CreateBranchOrTagDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/NewRootBunch.java
plugins/svn4idea/src/org/jetbrains/idea/svn/branchConfig/SvnBranchConfigurationNew.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SelectLocationDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/info/CmdInfoClient.java
plugins/svn4idea/src/org/jetbrains/idea/svn/info/SvnInfoHandler.java
plugins/svn4idea/src/org/jetbrains/idea/svn/update/SingleRootSwitcher.java
plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnIntegrateRootOptionsPanel.java
plugins/svn4idea/src/org/jetbrains/idea/svn/update/SvnUpdateRootOptionsPanel.java
plugins/svn4idea/src/org/jetbrains/idea/svn/update/UpdateRootInfo.java
plugins/tasks/tasks-core/src/com/intellij/tasks/impl/TaskUiUtil.java
plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloRepository.java
plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloRepositoryEditor.java
plugins/tasks/tasks-core/src/com/intellij/tasks/trello/TrelloUtil.java
plugins/tasks/tasks-core/src/com/intellij/tasks/trello/model/TrelloList.java
plugins/terminal/resources/icons/OpenTerminal_13x13@2x_dark.png
plugins/terminal/resources/icons/OpenTerminal_13x13_dark.png
plugins/terminal/src/org/jetbrains/plugins/terminal/AbstractTerminalRunner.java
plugins/testng/src/com/theoryinpractice/testng/model/TestProxy.java
plugins/testng/src/fileTemplates/code/TestNG Parameters Method.java.html
plugins/testng/src/fileTemplates/code/TestNG SetUp Method.java.html
plugins/testng/src/fileTemplates/code/TestNG TearDown Method.java.html
plugins/testng/src/fileTemplates/code/TestNG Test Class.java.html
plugins/testng/src/fileTemplates/code/TestNG Test Method.java.html
python/edu/course-creator/resources/fileTemplates/internal/test_helper.py.ft
python/edu/learn-python/resources/courses/introduction_course.zip
python/edu/learn-python/src/com/jetbrains/python/edu/StudyInitialConfigurator.java
python/edu/learn-python/src/com/jetbrains/python/edu/StudyNames.java
python/edu/learn-python/src/com/jetbrains/python/edu/StudyTaskManager.java
python/edu/learn-python/src/com/jetbrains/python/edu/StudyTestRunner.java
python/edu/learn-python/src/com/jetbrains/python/edu/course/Course.java
python/helpers/pydev/_pydev_imps/_pydev_django_oscar_patch.py [deleted file]
python/helpers/pydev/_pydev_imps/_pydev_pluginbase.py
python/helpers/pydev/pydev_monkey_qt.py
python/helpers/pydev/pydevd.py
python/helpers/pydev/pydevd_comm.py
python/helpers/pydev/pydevd_io.py
python/src/com/jetbrains/python/PyBundle.properties
python/src/com/jetbrains/python/packaging/PyPIPackageUtil.java
python/src/com/jetbrains/python/refactoring/changeSignature/PyChangeSignatureDialog.java
python/src/com/jetbrains/python/refactoring/changeSignature/PyChangeSignatureUsageProcessor.java
python/src/com/jetbrains/python/refactoring/changeSignature/PyMethodDescriptor.java
python/testData/refactoring/changeSignature/duplicateNamesOfStarredParameters.py [new file with mode: 0644]
python/testData/refactoring/changeSignature/multipleDoubleStarredParameters.py [new file with mode: 0644]
python/testData/refactoring/changeSignature/multipleSingleStarredParameters.py [new file with mode: 0644]
python/testData/refactoring/changeSignature/parameterNameWithMoreThanTwoStars.py [new file with mode: 0644]
python/testSrc/com/jetbrains/python/refactoring/changeSignature/PyChangeSignatureTest.java
resources-en/src/messages/CompilerBundle.properties
resources/src/META-INF/IdeaPlugin.xml
xml/impl/src/com/intellij/codeInsight/daemon/impl/quickfix/FetchExtResourceAction.java

index ba22ca404a99f83490c2e1b3a9ebc9c58d59884a..45a529ff3d231ca4e0b42f1b15218c60521050a3 100644 (file)
@@ -18,6 +18,7 @@
 import org.jetbrains.jps.gant.JpsGantTool
 import org.jetbrains.jps.gant.TeamCityBuildInfoPrinter
 import org.jetbrains.jps.model.java.JavaSourceRootType
+import org.jetbrains.jps.model.java.JpsJavaExtensionService
 import org.jetbrains.jps.model.module.JpsModule
 
 includeTool << JpsGantTool
@@ -140,6 +141,10 @@ binding.setVariable("loadProject", {
   projectBuilder.setupAdditionalLogging(new File("${p("teamcity.build.tempDir", p("java.io.tmpdir"))}/system/build-log/build.log"),
                                         p("jps.build.debug.logging.categories", ""))
   loadProjectFromPath(home)
+
+  def compilerOptions = JpsJavaExtensionService.instance.getOrCreateCompilerConfiguration(project).currentCompilerOptions
+  compilerOptions.GENERATE_NO_WARNINGS = true
+  compilerOptions.DEPRECATION = false
 })
 
 boolean hasSourceRoots(JpsModule module) {
@@ -628,13 +633,12 @@ binding.setVariable("zipSources", { String home, String targetDir ->
   notifyArtifactBuilt(sources)
 })
 
-binding.setVariable("zipSourcesOfModules", { String home, String targetDir, Collection<String> modules ->
-  String sources = "$targetDir/sources.zip"
-  projectBuilder.stage("zip sources of ${modules.size()} modules to $sources")
+binding.setVariable("zipSourcesOfModules", { String home, String targetFilePath, Collection<String> modules ->
+  projectBuilder.stage("zip sources of ${modules.size()} modules to $targetFilePath")
 
-  ant.mkdir(dir: targetDir)
-  ant.delete(file: sources)
-  ant.zip(destfile: sources) {
+  ant.mkdir(dir: new File(targetFilePath).getParent())
+  ant.delete(file: targetFilePath)
+  ant.zip(destfile: targetFilePath) {
     modules.each {
       JpsModule module = findModule(it)
       module.getSourceRoots(JavaSourceRootType.SOURCE).flatten().collect {it.file}.each { File srcRoot ->
@@ -643,7 +647,7 @@ binding.setVariable("zipSourcesOfModules", { String home, String targetDir, Coll
     }
   }
 
-  notifyArtifactBuilt(sources)
+  notifyArtifactBuilt(targetFilePath)
 })
 
 /**
index b608b82f97c76b05a7fff59405426869d694db16..d0cb098f33a45bb10e148ad34ca21ddc415989d2 100644 (file)
@@ -57,7 +57,7 @@ public final class EnterAction extends AnAction {
             if (selection.length > 0) {
                 if (selection.length == 1 && selection[0].isDirectory()) {
                     presentation.setVisible(true);
-                } else if (selection.length > 0) {
+                } else {
                     boolean notImages = false;
                     ImageFileTypeManager typeManager = ImageFileTypeManager.getInstance();
                     for (VirtualFile file : selection) {
@@ -65,9 +65,6 @@ public final class EnterAction extends AnAction {
                     }
                     presentation.setEnabled(!notImages);
                     presentation.setVisible(false);
-                } else {
-                    presentation.setVisible(false);
-                    presentation.setEnabled(false);
                 }
             } else {
                 presentation.setVisible(false);
index 87eae631d3043b53c6cf010801ffea7c88f9403f..4edda91e2dd6097e49d503ca0459465b26a701f4 100644 (file)
@@ -270,6 +270,7 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
       addWildcardResourcePattern("!?*.flex");
       addWildcardResourcePattern("!?*.kt");
       addWildcardResourcePattern("!?*.clj");
+      addWildcardResourcePattern("!?*.aj");
     }
     catch (MalformedPatternException e) {
       LOG.error(e);
index f54cae8988aba2e43ef683ab848c58b1d6061278..13dcc5051dc503b48abb2976adb72bc353bbfdbf 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.
@@ -135,14 +135,13 @@ public class JavaCompilersTab implements SearchableConfigurable, Configurable.No
   }
 
   public void apply() throws ConfigurationException {
-    boolean modified = false;
     try {
       for (Configurable configurable : myConfigurables) {
         if (configurable.isModified()) {
-          modified = true;
           configurable.apply();
         }
       }
+
       myCompilerConfiguration.setDefaultCompiler(mySelectedCompiler);
       myCompilerConfiguration.setProjectBytecodeTarget(myTargetLevelComponent.getProjectBytecodeTarget());
       myCompilerConfiguration.setModulesBytecodeTargetMap(myTargetLevelComponent.getModulesBytecodeTargetMap());
@@ -151,9 +150,7 @@ public class JavaCompilersTab implements SearchableConfigurable, Configurable.No
       myTargetLevelComponent.setModuleTargetLevels(myCompilerConfiguration.getModulesBytecodeTargetMap());
     }
     finally {
-      if (modified) {
-        BuildManager.getInstance().clearState(myProject);
-      }
+      BuildManager.getInstance().clearState(myProject);
     }
   }
 
index 4919789ca176142dfa48be789205cefa807590f0..9b3532808f05afddb3dd99fbc5ee1ba95fab8dca 100644 (file)
@@ -34,6 +34,7 @@ public abstract class DeploymentUtil {
     return ServiceManager.getService(DeploymentUtil.class);
   }
 
+  @Deprecated
   public abstract void copyFile(@NotNull File fromFile,
                                 @NotNull File toFile,
                                 @NotNull CompileContext context,
@@ -47,6 +48,7 @@ public abstract class DeploymentUtil {
     return path;
   }
 
+  @Deprecated
   public abstract void reportDeploymentDescriptorDoesNotExists(ConfigFile descriptor, CompileContext context, Module module);
 
   public static String concatPaths(String... paths) {
@@ -119,6 +121,7 @@ public abstract class DeploymentUtil {
     }
   }
 
+  @Deprecated
   public abstract void checkConfigFile(final ConfigFile descriptor, final CompileContext compileContext, final Module module);
 
 }
index c4217a179f0fdffd6b6eb68cadfa42fe87f4e172..8c884fdef1f2aebf195ed4cd8b9132fff84e0eb3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2014 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -75,15 +75,23 @@ public class ViewAsGroup extends ActionGroup implements DumbAware {
 
       final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
       final List<JavaValue> values = getSelectedValues(e);
+      final List<XValueNodeImpl> selectedNodes = XDebuggerTreeActionBase.getSelectedNodes(e.getDataContext());
 
       LOG.assertTrue(debuggerContext != null && !values.isEmpty());
 
-      debuggerContext.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
+      DebugProcessImpl process = debuggerContext.getDebugProcess();
+      if (process == null) {
+        return;
+      }
+
+      process.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
           public void threadAction() {
-            for (JavaValue value : values) {
-              value.getDescriptor().setRenderer(myNodeRenderer);
+            for (final XValueNodeImpl node : selectedNodes) {
+              final XValue container = node.getValueContainer();
+              if (container instanceof JavaValue) {
+                ((JavaValue)container).setRenderer(myNodeRenderer, node);
+              }
             }
-            DebuggerAction.refreshViews(e);
           }
         }
       );
@@ -106,6 +114,9 @@ public class ViewAsGroup extends ActionGroup implements DumbAware {
       boolean allApp = true;
 
       for (JavaValue value : values) {
+        if (value instanceof JavaReferringObjectsValue) { // disable for any referrers at all
+          return AnAction.EMPTY_ARRAY;
+        }
         ValueDescriptorImpl valueDescriptor = value.getDescriptor();
         anyValueDescriptor = true;
         if (!valueDescriptor.isValueValid() || !nodeRenderer.isApplicable(valueDescriptor.getType())) {
index d43a1bb0b6ee54ef12e09be3979f296db2aa8f85..aabdc0fcb17555455e92875dd96d23e7421c1799 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.debugger.engine;
 
+import com.intellij.debugger.MultiRequestPositionManager;
 import com.intellij.debugger.NoDataException;
 import com.intellij.debugger.PositionManager;
 import com.intellij.debugger.SourcePosition;
@@ -38,7 +39,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 
-public class CompoundPositionManager extends PositionManagerEx {
+public class CompoundPositionManager extends PositionManagerEx implements MultiRequestPositionManager{
   private static final Logger LOG = Logger.getInstance(CompoundPositionManager.class);
 
   private final ArrayList<PositionManager> myPositionManagers = new ArrayList<PositionManager>();
@@ -168,6 +169,38 @@ public class CompoundPositionManager extends PositionManagerEx {
     return null;
   }
 
+  @NotNull
+  @Override
+  public List<ClassPrepareRequest> createPrepareRequests(@NotNull ClassPrepareRequestor requestor, @NotNull SourcePosition position) {
+    for (PositionManager positionManager : myPositionManagers) {
+      try {
+        if (positionManager instanceof MultiRequestPositionManager) {
+          return ((MultiRequestPositionManager)positionManager).createPrepareRequests(requestor, position);
+        }
+        else {
+          ClassPrepareRequest prepareRequest = positionManager.createPrepareRequest(requestor, position);
+          if (prepareRequest == null) {
+            return Collections.emptyList();
+          }
+          return Collections.singletonList(prepareRequest);
+        }
+      }
+      catch (NoDataException ignored) {
+      }
+      catch (VMDisconnectedException e) {
+        throw e;
+      }
+      catch (Exception e) {
+        LOG.error(e);
+      }
+      catch (AssertionError e) {
+        LOG.error(e);
+      }
+    }
+
+    return Collections.emptyList();
+  }
+
   @Nullable
   @Override
   public XStackFrame createStackFrame(@NotNull StackFrameProxyImpl frame, @NotNull DebugProcessImpl debugProcess, @NotNull Location location) {
index 45166acce45d1e09fb1e5efd2d0a3da014b11bbb..b325a696ec14a4da2a54a8dbde30e74711d36455 100644 (file)
@@ -288,7 +288,7 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
     return myValueDescriptor.getValueText();
   }
 
-  private int currentStart = 0;
+  private int myCurrentChildrenStart = 0;
 
   @Override
   public void computeChildren(@NotNull final XCompositeNode node) {
@@ -326,9 +326,9 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
 
           @Override
           public void initChildrenArrayRenderer(ArrayRenderer renderer) {
-            renderer.START_INDEX = currentStart;
-            renderer.END_INDEX = currentStart + XCompositeNode.MAX_CHILDREN_TO_SHOW - 1;
-            currentStart += XCompositeNode.MAX_CHILDREN_TO_SHOW;
+            renderer.START_INDEX = myCurrentChildrenStart;
+            renderer.END_INDEX = myCurrentChildrenStart + XCompositeNode.MAX_CHILDREN_TO_SHOW - 1;
+            myCurrentChildrenStart += XCompositeNode.MAX_CHILDREN_TO_SHOW;
           }
 
           @Override
@@ -456,14 +456,14 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
   public String getEvaluationExpression() {
     if (evaluationExpression == null) {
       // TODO: change API to allow to calculate it asynchronously
-      myEvaluationContext.getManagerThread().invokeAndWait(new DebuggerCommandImpl() {
+      myEvaluationContext.getManagerThread().invokeAndWait(new SuspendContextCommandImpl(myEvaluationContext.getSuspendContext()) {
         @Override
         public Priority getPriority() {
           return Priority.HIGH;
         }
 
         @Override
-        protected void action() throws Exception {
+        public void contextAction() throws Exception {
           evaluationExpression = ApplicationManager.getApplication().runReadAction(new Computable<String>() {
             @Override
             public String compute() {
@@ -536,4 +536,17 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
       }
     };
   }
+
+  public void setRenderer(NodeRenderer nodeRenderer, final XValueNodeImpl node) {
+    DebuggerManagerThreadImpl.assertIsManagerThread();
+    myValueDescriptor.setRenderer(nodeRenderer);
+    myCurrentChildrenStart = 0;
+    node.getTree().getLaterInvocator().offer(new Runnable() {
+      @Override
+      public void run() {
+        node.clearChildren();
+        computePresentation(node, XValuePlace.TREE);
+      }
+    });
+  }
 }
index c4e08c03d931b335dfc9fde4eb2d52447c18d59a..9ef6ab90be05dc805372b81a0b164c7f6058d0de 100644 (file)
@@ -38,10 +38,7 @@ import com.sun.jdi.event.ClassPrepareEvent;
 import com.sun.jdi.request.*;
 import org.jetbrains.annotations.Nullable;
 
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
 
 /**
  * @author lex
@@ -307,15 +304,17 @@ public class RequestManagerImpl extends DebugProcessAdapterImpl implements Reque
 
   public void callbackOnPrepareClasses(final ClassPrepareRequestor requestor, final SourcePosition classPosition) {
     DebuggerManagerThreadImpl.assertIsManagerThread();
-    ClassPrepareRequest prepareRequest = myDebugProcess.getPositionManager().createPrepareRequest(requestor, classPosition);
 
-    if(prepareRequest == null) {
+    List<ClassPrepareRequest> prepareRequests = myDebugProcess.getPositionManager().createPrepareRequests(requestor, classPosition);
+    if(prepareRequests.isEmpty()) {
       setInvalid(requestor, DebuggerBundle.message("status.invalid.breakpoint.out.of.class"));
       return;
     }
 
-    registerRequest(requestor, prepareRequest);
-    prepareRequest.enable();
+    for (ClassPrepareRequest prepareRequest : prepareRequests) {
+      registerRequest(requestor, prepareRequest);
+      prepareRequest.enable();
+    }
   }
 
   public void callbackOnPrepareClasses(ClassPrepareRequestor requestor, String classOrPatternToBeLoaded) {
diff --git a/java/debugger/openapi/src/com/intellij/debugger/MultiRequestPositionManager.java b/java/debugger/openapi/src/com/intellij/debugger/MultiRequestPositionManager.java
new file mode 100644 (file)
index 0000000..0052a77
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * 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.debugger;
+
+import com.intellij.debugger.requests.ClassPrepareRequestor;
+import com.sun.jdi.request.ClassPrepareRequest;
+import org.jetbrains.annotations.NotNull;
+
+import java.util.List;
+
+public interface MultiRequestPositionManager extends PositionManager {
+
+  /**
+   * @see PositionManager#createPrepareRequest
+   */
+  @NotNull
+  List<ClassPrepareRequest> createPrepareRequests(@NotNull ClassPrepareRequestor requestor, @NotNull SourcePosition position)
+    throws NoDataException;
+}
index a3705c263cbd1b08f1fd3996f25ebe2ef2ddd6e9..ac8d6b63c475d2648fe89e133cba176f1dd352de 100644 (file)
@@ -8,6 +8,10 @@ import java.util.Collections;
 import java.util.List;
 
 /**
+ * Represents a group of frameworks. in the frameworks tree ("Additional Libraries and Frameworks"
+ * in the New Project dialog or the tree displayed in the "Add Framework Support" dialog).
+ * Frameworks in a group can have a common version number.
+ *
  * @author nik
  */
 public abstract class FrameworkGroup<V extends FrameworkVersion> implements FrameworkOrGroup {
@@ -26,6 +30,10 @@ public abstract class FrameworkGroup<V extends FrameworkVersion> implements Fram
   @NotNull
   public abstract Icon getIcon();
 
+  /**
+   * Returns the list of known versions of the framework group. The list is shown to the user
+   * and allows them to choose the version used in their project.
+   */
   @NotNull
   public List<V> getGroupVersions() {
     return Collections.emptyList();
index 8265b71d4658bec8cb92636b97bc347836954b14..9b491f602a84f989c7ed70eb0fe151d7f88913bf 100644 (file)
@@ -20,8 +20,11 @@ import org.jetbrains.annotations.NotNull;
 import javax.swing.*;
 
 /**
+ * Represents a single node (framework or group) in the frameworks tree ("Additional Libraries and Frameworks"
+ * in the New Project dialog or the tree displayed in the "Add Framework Support" dialog).
+ *
  * @author Dmitry Avdeev
- *         Date: 09.10.13
+ * @since 09.10.13
  */
 public interface FrameworkOrGroup {
   @NotNull
index b2c1bfa970bd695570c76409e5e5fd95a804f434..c1a0ead516e2062c671c72a61aecb7fd3c6a894d 100644 (file)
@@ -20,11 +20,14 @@ import com.intellij.psi.JavaDocTokenType;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.PsiJavaCodeReferenceElement;
+import com.intellij.psi.impl.source.javadoc.PsiDocMethodOrFieldRef;
 import com.intellij.psi.javadoc.PsiDocTag;
-import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.util.ThreeState;
 import org.jetbrains.annotations.NotNull;
 
+import static com.intellij.patterns.PsiJavaPatterns.psiElement;
+import static com.intellij.patterns.StandardPatterns.or;
+
 /**
  * @author peter
  */
@@ -33,8 +36,9 @@ public class JavadocCompletionConfidence extends CompletionConfidence {
   @NotNull
   @Override
   public ThreeState shouldSkipAutopopup(@NotNull PsiElement contextElement, @NotNull PsiFile psiFile, int offset) {
-    if (PsiTreeUtil.findElementOfClassAtOffset(psiFile, offset - 1, PsiDocTag.class, false) != null &&
-        PsiTreeUtil.findElementOfClassAtOffset(psiFile, offset - 1, PsiJavaCodeReferenceElement.class, false) != null) {
+    if (psiElement().inside(PsiDocTag.class).inside(
+      or(psiElement(PsiJavaCodeReferenceElement.class), psiElement(PsiDocMethodOrFieldRef.class)))
+      .accepts(contextElement)) {
       return ThreeState.NO;
     }
     if (PlatformPatterns.psiElement(JavaDocTokenType.DOC_TAG_NAME).accepts(contextElement)) {
index 6ae88736d1f4cb77092cc3f30cb344e6cffe5e57..bed7658c1c8c53e87fbbc3586cb914f93949743e 100644 (file)
@@ -29,7 +29,6 @@ import com.intellij.openapi.editor.colors.EditorColorsScheme;
 import com.intellij.openapi.editor.markup.GutterIconRenderer;
 import com.intellij.openapi.editor.markup.SeparatorPlacement;
 import com.intellij.openapi.progress.ProgressManager;
-import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.util.TextRange;
@@ -54,7 +53,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 
-public class JavaLineMarkerProvider implements LineMarkerProvider, DumbAware {
+public class JavaLineMarkerProvider implements LineMarkerProvider {
 
   protected final DaemonCodeAnalyzerSettings myDaemonSettings;
   protected final EditorColorsManager myColorsManager;
@@ -68,8 +67,7 @@ public class JavaLineMarkerProvider implements LineMarkerProvider, DumbAware {
   @Nullable
   public LineMarkerInfo getLineMarkerInfo(@NotNull final PsiElement element) {
     PsiElement parent;
-    if (element instanceof PsiIdentifier && (parent = element.getParent()) instanceof PsiMethod && 
-        !DumbService.getInstance(element.getProject()).isDumb()) {
+    if (element instanceof PsiIdentifier && (parent = element.getParent()) instanceof PsiMethod) {
       PsiMethod method = (PsiMethod)parent;
       MethodSignatureBackedByPsiMethod superSignature = SuperMethodsSearch.search(method, null, true, false).findFirst();
       if (superSignature != null) {
@@ -151,10 +149,6 @@ public class JavaLineMarkerProvider implements LineMarkerProvider, DumbAware {
   public void collectSlowLineMarkers(@NotNull final List<PsiElement> elements, @NotNull final Collection<LineMarkerInfo> result) {
     ApplicationManager.getApplication().assertReadAccessAllowed();
 
-    if (elements.isEmpty() || DumbService.getInstance(elements.get(0).getProject()).isDumb()) {
-      return;
-    }
-
     Set<PsiMethod> methods = new HashSet<PsiMethod>();
     //noinspection ForLoopReplaceableByForEach
     for (int i = 0; i < elements.size(); i++) {
index ab9e5b7ceb6e276be954ab3e0c7fbf3952e987e7..b93b364a636627bfa5ee2995f3cad1bf44aa0bb0 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.
@@ -68,27 +68,33 @@ public class JavaTemplateUtil {
           PsiElement element = file.findElementAt(segmentStart);
           PsiMethod method = PsiTreeUtil.getParentOfType(element, PsiMethod.class);
           if (method != null) {
-            if (((PsiTypeParameter)aClass).getOwner() instanceof PsiMethod || method.hasModifierProperty(PsiModifier.STATIC)) {
-              PsiTypeParameterList paramList = method.getTypeParameterList();
-              PsiTypeParameter[] params = paramList != null ? paramList.getTypeParameters() : PsiTypeParameter.EMPTY_ARRAY;
-              for (PsiTypeParameter param : params) {
-                if (param.getName().equals(aClass.getName())) return;
+            if (!method.hasModifierProperty(PsiModifier.STATIC)) {
+              PsiTypeParameterListOwner owner = ((PsiTypeParameter)aClass).getOwner();
+              if (PsiTreeUtil.isAncestor(owner, method, false)) {
+                continue;
               }
-              try {
-                if (paramList == null) {
-                  final PsiTypeParameterList newList =
-                    JVMElementFactories.getFactory(method.getLanguage(), project).createTypeParameterList();
-                  paramList = (PsiTypeParameterList)method.addAfter(newList, method.getModifierList());
-                }
-                paramList.add(aClass.copy());
-                PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(document);
-              }
-              catch (IncorrectOperationException e) {
-                LOG.error(e);
+            }
+
+            PsiTypeParameterList paramList = method.getTypeParameterList();
+            PsiTypeParameter[] params = paramList != null ? paramList.getTypeParameters() : PsiTypeParameter.EMPTY_ARRAY;
+            for (PsiTypeParameter param : params) {
+              if (param.getName().equals(aClass.getName())) return;
+            }
+            try {
+              if (paramList == null) {
+                final PsiTypeParameterList newList =
+                  JVMElementFactories.getFactory(method.getLanguage(), project).createTypeParameterList();
+                paramList = (PsiTypeParameterList)method.addAfter(newList, method.getModifierList());
               }
+              paramList.add(aClass.copy());
+              PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(document);
+            }
+            catch (IncorrectOperationException e) {
+              LOG.error(e);
             }
           }
-        } else if (!noImport) {
+        }
+        else if (!noImport) {
           addImportForClass(document, aClass, segmentStart, segmentEnd);
           PsiDocumentManager.getInstance(project).doPostponedOperationsAndUnblockDocument(document);
         }
index 19c1fec11a4cc68f40d19dd328a788ba2acfe5b9..3c5d138e2b13d0bf1c899a3a7bd37f93a6aedaa0 100644 (file)
@@ -1,7 +1,6 @@
 package com.intellij.jarFinder;
 
 import com.intellij.openapi.progress.ProgressIndicator;
-import com.intellij.openapi.progress.util.ProgressStream;
 import com.intellij.openapi.util.JDOMUtil;
 import com.intellij.util.io.HttpRequests;
 import org.jdom.Document;
@@ -10,7 +9,6 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import java.io.IOException;
-import java.io.InputStream;
 
 /**
  * @author Sergey Evdokimov
@@ -25,15 +23,15 @@ public abstract class SourceSearcher {
   @Nullable
   protected abstract String findSourceJar(@NotNull final ProgressIndicator indicator, @NotNull String artifactId, @NotNull String version) throws SourceSearchException;
 
+  @NotNull
   protected static Document readDocumentCancelable(final ProgressIndicator indicator, String url) throws IOException {
     return HttpRequests.request(url)
       .accept("application/xml")
       .connect(new HttpRequests.RequestProcessor<Document>() {
         @Override
         public Document process(@NotNull HttpRequests.Request request) throws IOException {
-          InputStream inputStream = request.getInputStream();
           try {
-            return JDOMUtil.loadDocument(new ProgressStream(0, request.getConnection().getContentLength(), inputStream, indicator));
+            return JDOMUtil.loadDocument(request.getReader(indicator));
           }
           catch (JDOMException e) {
             throw new IOException(e);
index 07461178c32a6517abc54a4613c653c2df180b47..7453c329b0d00a3ab224827633ee911009c3638a 100644 (file)
@@ -101,6 +101,7 @@ public class JavaRefactoringSettings implements PersistentStateComponent<JavaRef
   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_PARAMETER_IN_HIERARCHY = true;
   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_VARIABLES = true;
   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_TESTS = true;
+  @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_OVERLOADS = true;
 
   public static JavaRefactoringSettings getInstance() {
     return ServiceManager.getService(JavaRefactoringSettings.class);
@@ -145,4 +146,12 @@ public class JavaRefactoringSettings implements PersistentStateComponent<JavaRef
   public void setRenameTests(boolean renameTests) {
     this.RENAME_TESTS = renameTests;
   }
+
+  public void setRenameOverloads(boolean renameOverloads) {
+    RENAME_OVERLOADS = renameOverloads;
+  }
+
+  public boolean isRenameOverloads() {
+    return RENAME_OVERLOADS;
+  }
 }
\ No newline at end of file
index 2157b7040d16b884b4adb08a3e72c62089fe7d73..e60f7fd3d97497a72adaa91e3da3aaf09dc8470d 100644 (file)
@@ -35,7 +35,7 @@ import java.util.*;
 
 import static com.intellij.refactoring.changeSignature.ChangeSignatureUtil.deepTypeEqual;
 
-class JavaChangeInfoImpl implements JavaChangeInfo {
+public class JavaChangeInfoImpl implements JavaChangeInfo {
   private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.changeSignature.JavaChangeInfoImpl");
 
   @PsiModifier.ModifierConstant
index d7f193e1fe700a7a1c14accf52be6ade353fc23f..1883fa27c7dff35be46d1173bfc4d6139f86f051 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.psi.util.PsiUtil;
 import com.intellij.refactoring.HelpID;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.changeClassSignature.ChangeClassSignatureDialog;
@@ -89,7 +90,7 @@ public class JavaChangeSignatureHandler implements ChangeSignatureHandler {
 
     final PsiClass containingClass = method.getContainingClass();
     final PsiReferenceExpression refExpr = editor != null ? TargetElementUtil.findReferenceExpression(editor) : null;
-    final boolean allowDelegation = containingClass != null && !containingClass.isInterface();
+    final boolean allowDelegation = containingClass != null && (!containingClass.isInterface() || PsiUtil.isLanguageLevel8OrHigher(containingClass));
     final DialogWrapper dialog = new JavaChangeSignatureDialog(project, method, allowDelegation, refExpr == null ? method : refExpr);
     dialog.show();
   }
index 2a7cdd5f46f9d5fd37fad6541273c4420c975d5a..3d72a85ea15da3bf5d9548b6a5976fce4a0fbd93 100644 (file)
@@ -636,10 +636,13 @@ public class JavaChangeSignatureUsageProcessor implements ChangeSignatureUsagePr
            !((JavaChangeInfoImpl)changeInfo).propagateParametersMethods.contains(method);
   }
 
-  private static void generateDelegate(JavaChangeInfo changeInfo) throws IncorrectOperationException {
+  public static void generateDelegate(JavaChangeInfo changeInfo) throws IncorrectOperationException {
     final PsiMethod delegate = (PsiMethod)changeInfo.getMethod().copy();
     final PsiClass targetClass = changeInfo.getMethod().getContainingClass();
-    LOG.assertTrue(!targetClass.isInterface());
+    LOG.assertTrue(targetClass != null);
+    if (targetClass.isInterface() && delegate.getBody() == null) {
+      delegate.getModifierList().setModifierProperty(PsiModifier.DEFAULT, true);
+    }
     PsiElementFactory factory = JavaPsiFacade.getElementFactory(targetClass.getProject());
     ChangeSignatureProcessor.makeEmptyBody(factory, delegate);
     final PsiCallExpression callExpression = ChangeSignatureProcessor.addDelegatingCallTemplate(delegate, changeInfo.getNewName());
index be2b088dd6b4fbc0ec3b17e0c71957983a8732ef..d054943e6a7fae5fd519cb3fbe93b64ec7743d60 100644 (file)
@@ -78,4 +78,14 @@ public class ConvertToInstanceMethodDialog  extends MoveInstanceMethodDialogBase
     }.installOn(variableChooser);
     return variableChooser;
   }
+
+  @Override
+  protected String getMovePropertySuffix() {
+    return null;
+  }
+
+  @Override
+  protected String getCbTitle() {
+    return null;
+  }
 }
index 5804445d714159d2486e5c4da69554d46412ea5d..ff362fbf3fe49b0904d8878aaca13add1971a245 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.refactoring.convertToInstanceMethod;
 import com.intellij.codeInsight.ChangeContextUtil;
 import com.intellij.history.LocalHistory;
 import com.intellij.history.LocalHistoryAction;
+import com.intellij.ide.util.EditorHelper;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Key;
@@ -231,6 +232,7 @@ public class ConvertToInstanceMethodProcessor extends BaseRefactoringProcessor {
     if (!myTargetClass.isInterface()) {
       PsiMethod method = addMethodToClass(myTargetClass);
       fixVisibility(method, usages);
+      EditorHelper.openInEditor(method);
     }
     else {
       final PsiMethod interfaceMethod = addMethodToClass(myTargetClass);
@@ -240,6 +242,8 @@ public class ConvertToInstanceMethodProcessor extends BaseRefactoringProcessor {
       modifierList.setModifierProperty(PsiModifier.PROTECTED, false);
       RefactoringUtil.makeMethodAbstract(myTargetClass, interfaceMethod);
 
+      EditorHelper.openInEditor(interfaceMethod);
+
       for (final PsiClass psiClass : inheritors) {
         final PsiMethod newMethod = addMethodToClass(psiClass);
         PsiUtil.setModifierProperty(newMethod, myNewVisibility != null && !myNewVisibility.equals(VisibilityUtil.ESCALATE_VISIBILITY) ? myNewVisibility
index f8d67168628f6b8a135b589ed3b46141dc93afc2..59afecefda75442cc9393c339c69899435a8b617 100644 (file)
@@ -22,7 +22,6 @@ import com.intellij.ide.util.PropertiesComponent;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.Splitter;
-import com.intellij.openapi.ui.VerticalFlowLayout;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiFormatUtil;
@@ -216,7 +215,9 @@ public class ExtractMethodDialog extends DialogWrapper implements AbstractExtrac
 
     myVisibilityPanel = createVisibilityPanel();
     final JPanel visibilityAndReturnType = new JPanel(new BorderLayout(2, 0));
-    visibilityAndReturnType.add(myVisibilityPanel, BorderLayout.WEST);
+    if (!myTargetClass.isInterface()) {
+      visibilityAndReturnType.add(myVisibilityPanel, BorderLayout.WEST);
+    }
     final JPanel returnTypePanel = createReturnTypePanel();
     if (returnTypePanel != null) {
       visibilityAndReturnType.add(returnTypePanel, BorderLayout.EAST);
@@ -430,7 +431,7 @@ public class ExtractMethodDialog extends DialogWrapper implements AbstractExtrac
   }
 
   public String getVisibility() {
-    return myVisibilityPanel.getVisibility();
+    return myTargetClass.isInterface() ? PsiModifier.PUBLIC : myVisibilityPanel.getVisibility();
   }
 
 
@@ -525,7 +526,7 @@ public class ExtractMethodDialog extends DialogWrapper implements AbstractExtrac
       buffer.append(StringUtil.getShortName(myNullness == Nullness.NULLABLE ? nullManager.getDefaultNullable() : nullManager.getDefaultNotNull()));
       buffer.append("\n");
     }
-    final String visibilityString = VisibilityUtil.getVisibilityString(myVisibilityPanel.getVisibility());
+    final String visibilityString = VisibilityUtil.getVisibilityString(getVisibility());
     buffer.append(visibilityString);
     if (buffer.length() > 0) {
       buffer.append(" ");
index 6b3e2e709d1311973c2299364fd3c24738f06cfe..7804e23aedd4ffea780d5c556a87b642b4d357ee 100644 (file)
@@ -1339,7 +1339,10 @@ public class ExtractMethodProcessor implements MatchProvider {
     }
 
     if (myTargetClass.isInterface() && PsiUtil.isLanguageLevel8OrHigher(myTargetClass)) {
-      PsiUtil.setModifierProperty(newMethod, PsiModifier.DEFAULT, true);
+      final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(myCodeFragmentMember, PsiMethod.class, false);
+      if (containingMethod != null && containingMethod.hasModifierProperty(PsiModifier.DEFAULT)) {
+        PsiUtil.setModifierProperty(newMethod, PsiModifier.DEFAULT, true);
+      }
     }
     return (PsiMethod)myStyleManager.reformat(newMethod);
   }
@@ -1579,24 +1582,34 @@ public class ExtractMethodProcessor implements MatchProvider {
     myStatic = shouldBeStatic();
     final Set<PsiField> fields = new LinkedHashSet<PsiField>();
     if (!PsiUtil.isLocalOrAnonymousClass(myTargetClass) && (myTargetClass.getContainingClass() == null || myTargetClass.hasModifierProperty(PsiModifier.STATIC))) {
-      ElementNeedsThis needsThis = new ElementNeedsThis(myTargetClass) {
-        @Override
-        protected void visitClassMemberReferenceElement(PsiMember classMember, PsiJavaCodeReferenceElement classMemberReference) {
-          if (classMember instanceof PsiField && !classMember.hasModifierProperty(PsiModifier.STATIC)) {
-            final PsiExpression expression = PsiTreeUtil.getParentOfType(classMemberReference, PsiExpression.class, false);
-            if (expression == null || !PsiUtil.isAccessedForWriting(expression)) {
-              fields.add((PsiField)classMember);
-              return;
+      boolean canBeStatic = true;
+      if (myTargetClass.isInterface()) {
+        final PsiMethod containingMethod = PsiTreeUtil.getParentOfType(myCodeFragmentMember, PsiMethod.class, false);
+        canBeStatic = containingMethod == null || containingMethod.hasModifierProperty(PsiModifier.STATIC);
+      }
+      if (canBeStatic) {
+        ElementNeedsThis needsThis = new ElementNeedsThis(myTargetClass) {
+          @Override
+          protected void visitClassMemberReferenceElement(PsiMember classMember, PsiJavaCodeReferenceElement classMemberReference) {
+            if (classMember instanceof PsiField && !classMember.hasModifierProperty(PsiModifier.STATIC)) {
+              final PsiExpression expression = PsiTreeUtil.getParentOfType(classMemberReference, PsiExpression.class, false);
+              if (expression == null || !PsiUtil.isAccessedForWriting(expression)) {
+                fields.add((PsiField)classMember);
+                return;
+              }
             }
+            super.visitClassMemberReferenceElement(classMember, classMemberReference);
           }
-          super.visitClassMemberReferenceElement(classMember, classMemberReference);
+        };
+        for (int i = 0; i < myElements.length && !needsThis.usesMembers(); i++) {
+          PsiElement element = myElements[i];
+          element.accept(needsThis);
         }
-      };
-      for (int i = 0; i < myElements.length && !needsThis.usesMembers(); i++) {
-        PsiElement element = myElements[i];
-        element.accept(needsThis);
+        myCanBeStatic = !needsThis.usesMembers();
+      }
+      else {
+        myCanBeStatic = false;
       }
-      myCanBeStatic = !needsThis.usesMembers();
     }
     else {
       myCanBeStatic = false;
index 5528a93cae6b683338bf7a2dace275ac56457be9..54ae5167601da80a8ecaa1904ee687af545ebb81 100644 (file)
@@ -97,9 +97,11 @@ public class InplaceIntroduceParameterPopup extends AbstractJavaInplaceIntroduce
 
       protected TIntArrayList getParametersToRemove() {
         TIntArrayList parameters = new TIntArrayList();
-        for (int i = 0; i < myParametersToRemove.length; i++) {
-          if (myParametersToRemove[i] != null) {
-            parameters.add(i);
+        if (myCbReplaceAllOccurences == null || myCbReplaceAllOccurences.isSelected()) {
+          for (int i = 0; i < myParametersToRemove.length; i++) {
+            if (myParametersToRemove[i] != null) {
+              parameters.add(i);
+            }
           }
         }
         return parameters;
index 10def5808511b59b90fa8674cebcc11e9ddf75f4..af4c559bbc807f33a59a7e47a7d3865ebd588400 100644 (file)
@@ -243,6 +243,9 @@ public abstract class IntroduceParameterSettingsUI {
   }
 
   public boolean isParamToRemove(PsiParameter param) {
+    if (myCbReplaceAllOccurences != null && !myCbReplaceAllOccurences.isSelected()) {
+      return false;
+    }
     if (param.isVarArgs()) {
       return myParametersToRemove[myParametersToRemove.length - 1] != null;
     }
index a990681da32ec38ba988b5ec9a69bbb3aadabfa7..153739f95d1d5430a8a2ac0e5810ba926422b073 100644 (file)
@@ -52,7 +52,8 @@ public abstract class AbstractMakeStaticDialog extends RefactoringDialog {
     final Settings settings = new Settings(
             isReplaceUsages(),
             isMakeClassParameter() ? getClassParameterName() : null,
-            getVariableData()
+            getVariableData(),
+            isGenerateDelegate()
     );
     if (myMember instanceof PsiMethod) {
       invokeRefactoring(new MakeMethodStaticProcessor(getProject(), (PsiMethod)myMember, settings));
@@ -62,6 +63,10 @@ public abstract class AbstractMakeStaticDialog extends RefactoringDialog {
     }
   }
 
+  protected boolean isGenerateDelegate() {
+    return false;
+  }
+
   protected abstract boolean validateData();
 
   public abstract boolean isMakeClassParameter();
index 5f13be0fb7f9c8e0fd33af8d9b5d23a817717fbf..d5b7b84ab161908be1207e0f18fb75b981aef869 100644 (file)
@@ -16,6 +16,7 @@
 package com.intellij.refactoring.makeStatic;
 
 import com.intellij.codeInsight.TestFrameworks;
+import com.intellij.lang.Language;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
@@ -25,18 +26,21 @@ import com.intellij.psi.javadoc.PsiDocTag;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
+import com.intellij.refactoring.changeSignature.*;
 import com.intellij.refactoring.changeSignature.inCallers.JavaCallerChooser;
+import com.intellij.refactoring.util.CanonicalTypes;
 import com.intellij.refactoring.util.RefactoringUtil;
 import com.intellij.refactoring.util.javadoc.MethodJavaDocHelper;
 import com.intellij.usageView.UsageInfo;
 import com.intellij.util.Consumer;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.util.VisibilityUtil;
 import com.intellij.util.containers.MultiMap;
 import com.intellij.util.ui.tree.TreeUtil;
+import org.jetbrains.annotations.NotNull;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * @author dsl
@@ -131,9 +135,44 @@ public class MakeMethodStaticProcessor extends MakeMethodOrClassStaticProcessor<
     PsiDocTag anchor = null;
     List<PsiType> addedTypes = new ArrayList<PsiType>();
 
+    final PsiClass containingClass = myMember.getContainingClass();
+    LOG.assertTrue(containingClass != null);
+    
+    if (mySettings.isDelegate()) {
+      List<ParameterInfoImpl> params = new ArrayList<ParameterInfoImpl>();
+      PsiParameter[] parameters = myMember.getParameterList().getParameters();
+
+      for (int i = 0; i < parameters.length; i++) {
+        params.add(new ParameterInfoImpl(i));
+      }
+
+      if (mySettings.isMakeClassParameter()) {
+        params.add(new ParameterInfoImpl(-1, mySettings.getClassParameterName(),
+                                         factory.createType(containingClass, PsiSubstitutor.EMPTY), "this"));
+      }
+
+      if (mySettings.isMakeFieldParameters()) {
+        for (Settings.FieldParameter parameter : mySettings.getParameterOrderList()) {
+          params.add(new ParameterInfoImpl(-1, mySettings.getClassParameterName(), parameter.type, parameter.field.getName()));
+        }
+      }
+
+      final PsiType returnType = myMember.getReturnType();
+      LOG.assertTrue(returnType != null);
+      JavaChangeSignatureUsageProcessor.generateDelegate(new JavaChangeInfoImpl(VisibilityUtil.getVisibilityModifier(myMember.getModifierList()),
+                                                                                myMember,
+                                                                                myMember.getName(),
+                                                                                CanonicalTypes.createTypeWrapper(returnType),
+                                                                                params.toArray(new ParameterInfoImpl[params.size()]),
+                                                                                new ThrownExceptionInfo[0],
+                                                                                false,
+                                                                                Collections.<PsiMethod>emptySet(),
+                                                                                Collections.<PsiMethod>emptySet()));
+    }
+
     if (mySettings.isMakeClassParameter()) {
       // Add parameter for object
-      PsiType parameterType = factory.createType(myMember.getContainingClass(), PsiSubstitutor.EMPTY);
+      PsiType parameterType = factory.createType(containingClass, PsiSubstitutor.EMPTY);
       addedTypes.add(parameterType);
 
       final String classParameterName = mySettings.getClassParameterName();
@@ -310,6 +349,7 @@ public class MakeMethodStaticProcessor extends MakeMethodOrClassStaticProcessor<
   }
 
   protected void findExternalUsages(final ArrayList<UsageInfo> result) {
+    if (mySettings.isDelegate()) return;
     findExternalReferences(myMember, result);
   }
 
index b08c8d33ca0f5770fb219bb0efdd8b0637b5a159..f5187b44f3e57d3fa49883f964b38efee32b44bf 100644 (file)
@@ -55,6 +55,7 @@ public class MakeParameterizedStaticDialog extends AbstractMakeStaticDialog {
   private ParameterTablePanel myParameterPanel;
   private VariableData[] myVariableData;
   private final boolean myAnyNonFieldMembersUsed;
+  private JCheckBox myGenerateDelegateCb;
 
 
   public MakeParameterizedStaticDialog(Project project,
@@ -212,12 +213,21 @@ public class MakeParameterizedStaticDialog extends AbstractMakeStaticDialog {
     myMakeFieldParameters.addActionListener(inputFieldValidator);
 
 
+    if (myMember instanceof PsiMethod) {
+      myGenerateDelegateCb = new JCheckBox(RefactoringBundle.message("delegation.panel.delegate.via.overloading.method"));
+      panel.add(myGenerateDelegateCb, gbConstraints);
+    }
 
     updateControls();
 
     return panel;
   }
 
+  @Override
+  protected boolean isGenerateDelegate() {
+    return myGenerateDelegateCb != null && myGenerateDelegateCb.isSelected();
+  }
+
   protected boolean validateData() {
     int ret = Messages.YES;
     if (isMakeClassParameter()) {
index c08de3870f0f9e2c5512c2cf1106b40aec4fc349..c153e2c4433c6a359cab20fd80324f8ba3aafe71 100644 (file)
@@ -40,6 +40,7 @@ public final class Settings {
   private final HashMap<PsiField,String> myFieldToNameMapping;
   private final ArrayList<FieldParameter> myFieldToNameList;
   private final boolean myReplaceUsages;
+  private final boolean myDelegate;
 
 
   public static final class FieldParameter {
@@ -56,7 +57,15 @@ public final class Settings {
 
 
   public Settings(boolean replaceUsages, @Nullable String classParameterName, @Nullable VariableData[] variableDatum) {
+    this(replaceUsages, classParameterName, variableDatum, false);
+  }
+
+  public Settings(boolean replaceUsages,
+                  @Nullable String classParameterName,
+                  @Nullable VariableData[] variableDatum,
+                  boolean delegate) {
     myReplaceUsages = replaceUsages;
+    myDelegate = delegate;
     myMakeClassParameter = classParameterName != null;
     myClassParameterName = classParameterName;
     myMakeFieldParameters = variableDatum != null;
@@ -94,6 +103,7 @@ public final class Settings {
     else {
       myFieldToNameMapping = null;
     }
+    myDelegate = false;
   }
 
   public boolean isReplaceUsages() {
@@ -112,6 +122,10 @@ public final class Settings {
     return myMakeFieldParameters;
   }
 
+  public boolean isDelegate() {
+    return myDelegate;
+  }
+
   @Nullable
   public String getNameForField(PsiField field) {
     if (myFieldToNameMapping != null) {
diff --git a/java/java-impl/src/com/intellij/refactoring/move/MoveDialogBase.java b/java/java-impl/src/com/intellij/refactoring/move/MoveDialogBase.java
new file mode 100644 (file)
index 0000000..256aacb
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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.refactoring.move;
+
+import com.intellij.ide.util.PropertiesComponent;
+import com.intellij.openapi.project.Project;
+import com.intellij.refactoring.ui.RefactoringDialog;
+import org.jetbrains.annotations.NotNull;
+
+import javax.swing.*;
+
+public abstract class MoveDialogBase extends RefactoringDialog {
+
+  private JCheckBox myOpenEditorCb;
+
+  protected abstract String getMovePropertySuffix();
+  protected abstract String getCbTitle();
+  
+  protected JCheckBox initOpenInEditorCb() {
+    myOpenEditorCb = new JCheckBox(getCbTitle(), PropertiesComponent.getInstance().getBoolean("Move" + getMovePropertySuffix() +".OpenInEditor",
+                                                                                              isEnabledByDefault()));
+    return myOpenEditorCb;
+  }
+
+  protected boolean isEnabledByDefault() {
+    return true;
+  }
+
+  protected void saveOpenInEditorOption() {
+    if (myOpenEditorCb != null) {
+      PropertiesComponent.getInstance().setValue("Move" + getMovePropertySuffix() +".OpenInEditor", String.valueOf(myOpenEditorCb.isSelected()));
+    }
+  }
+
+  protected boolean isOpenInEditor() {
+    return myOpenEditorCb != null && myOpenEditorCb.isSelected();
+  }
+
+  protected MoveDialogBase(@NotNull Project project, boolean canBeParent) {
+    super(project, canBeParent);
+  }
+}
index 48ab4c42887a2f15cd89f5102d35330a605cb8ed..03739a7ab5d11f5d9e556b7f6693396883e1a122 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.refactoring.move.moveClassesOrPackages;
 
+import com.intellij.ide.util.EditorHelper;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
@@ -39,6 +40,7 @@ import com.intellij.util.Function;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.Processor;
 import com.intellij.util.VisibilityUtil;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.MultiMap;
 import org.jetbrains.annotations.NotNull;
 
@@ -60,6 +62,7 @@ public class MoveClassToInnerProcessor extends BaseRefactoringProcessor {
   private final boolean mySearchInNonJavaFiles;
   private NonCodeUsageInfo[] myNonCodeUsages;
   private final MoveCallback myMoveCallback;
+  private boolean myOpenInEditor;
 
   public MoveClassToInnerProcessor(Project project,
                                    final PsiClass[] classesToMove,
@@ -167,6 +170,13 @@ public class MoveClassToInnerProcessor extends BaseRefactoringProcessor {
           element.delete();
         }
       }
+
+      if (myOpenInEditor && !oldToNewElementsMapping.isEmpty()) {
+        final PsiElement item = ContainerUtil.getFirstItem(oldToNewElementsMapping.values());
+        if (item != null) {
+          EditorHelper.openInEditor(item);
+        }
+      }
     }
     catch (IncorrectOperationException e) {
       LOG.error(e);
@@ -324,6 +334,10 @@ public class MoveClassToInnerProcessor extends BaseRefactoringProcessor {
     });
   }
 
+  public void setOpenInEditor(boolean openInEditor) {
+    myOpenInEditor = openInEditor;
+  }
+
   private static class ConflictsCollector {
     private final PsiClass myClassToMove;
     private final MultiMap<PsiElement, String> myConflicts;
index a69d2e8726687094bc8c7bad6901e3eda7acb5d8..60a7d8d5e2a8cd35ed1534c6409d6820ebb743b7 100644 (file)
           </grid>
         </children>
       </grid>
-      <grid id="ce694" binding="myTargetPanel" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+      <grid id="ce694" binding="myTargetPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
         <margin top="0" left="0" bottom="0" right="0"/>
         <constraints>
           <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
             </constraints>
             <properties/>
           </component>
+          <grid id="58f9b" binding="myOpenInEditorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties/>
+            <border type="none"/>
+            <children/>
+          </grid>
         </children>
       </grid>
       <vspacer id="fdc31">
index 3bbcf743506cce4a2c1fc94a68dd8608482a00ab..e0d206e733c15fcf8b06502fb2acd250103783a1 100644 (file)
@@ -39,6 +39,7 @@ import com.intellij.psi.util.PsiUtilCore;
 import com.intellij.refactoring.*;
 import com.intellij.refactoring.move.MoveCallback;
 import com.intellij.refactoring.move.MoveClassesOrPackagesCallback;
+import com.intellij.refactoring.move.MoveDialogBase;
 import com.intellij.refactoring.move.MoveHandler;
 import com.intellij.refactoring.move.moveFilesOrDirectories.MoveFilesOrDirectoriesUtil;
 import com.intellij.refactoring.ui.ClassNameReferenceEditor;
@@ -64,7 +65,7 @@ import java.awt.event.ActionListener;
 import java.util.List;
 import java.util.Set;
 
-public class MoveClassesOrPackagesDialog extends RefactoringDialog {
+public class MoveClassesOrPackagesDialog extends MoveDialogBase {
   @NonNls private static final String RECENTS_KEY = "MoveClassesOrPackagesDialog.RECENTS_KEY";
   private final PsiElement[] myElementsToMove;
   private final MoveCallback myMoveCallback;
@@ -90,6 +91,7 @@ public class MoveClassesOrPackagesDialog extends RefactoringDialog {
   private ComboboxWithBrowseButton myDestinationFolderCB;
   private JPanel myTargetPanel;
   private JLabel myTargetDestinationLabel;
+  private JPanel myOpenInEditorPanel;
   private boolean myHavePackages;
   private boolean myTargetDirectoryFixed;
   private boolean mySuggestToMoveToAnotherRoot;
@@ -138,6 +140,13 @@ public class MoveClassesOrPackagesDialog extends RefactoringDialog {
         myInnerClassChooser.requestFocus();
       }
     });
+
+    for (PsiElement element : elementsToMove) {
+      if (element.getContainingFile() != null) {
+        myOpenInEditorPanel.add(initOpenInEditorCb(), BorderLayout.EAST);
+        break;
+      }
+    }
   }
 
   private void updateControlsEnabled() {
@@ -376,6 +385,7 @@ public class MoveClassesOrPackagesDialog extends RefactoringDialog {
   }
 
   protected void doAction() {
+    saveOpenInEditorOption();
     if (isMoveToPackage()) {
       invokeMoveToPackage();
     }
@@ -419,6 +429,7 @@ public class MoveClassesOrPackagesDialog extends RefactoringDialog {
 
       MoveClassesOrPackagesProcessor processor = createMoveToPackageProcessor(destination, myElementsToMove, myMoveCallback);
       if (processor.verifyValidPackageName()) {
+        processor.setOpenInEditor(isOpenInEditor());
         invokeRefactoring(processor);
       }
     }
@@ -476,7 +487,9 @@ public class MoveClassesOrPackagesDialog extends RefactoringDialog {
     for (int i = 0; i < myElementsToMove.length; i++) {
       classesToMove[i] = (PsiClass)myElementsToMove[i];
     }
-    invokeRefactoring(createMoveToInnerProcessor(targetClass, classesToMove, myMoveCallback));
+    final MoveClassToInnerProcessor processor = createMoveToInnerProcessor(targetClass, classesToMove, myMoveCallback);
+    processor.setOpenInEditor(isOpenInEditor());
+    invokeRefactoring(processor);
   }
 
   //for scala plugin
@@ -510,4 +523,14 @@ public class MoveClassesOrPackagesDialog extends RefactoringDialog {
   private List<VirtualFile> getSourceRoots() {
     return JavaProjectRootsUtil.getSuitableDestinationSourceRoots(myProject);
   }
+
+  @Override
+  protected String getMovePropertySuffix() {
+    return "Class";
+  }
+
+  @Override
+  protected String getCbTitle() {
+    return "Open moved in editor";
+  }
 }
index 54ddf03a5c573ca0a2e999bc924344fbc18dbaef..1d4548b23abf8682762f28655459ee758898adb5 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.refactoring.move.moveClassesOrPackages;
 
+import com.intellij.ide.util.EditorHelper;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.project.Project;
@@ -71,6 +72,7 @@ public class MoveClassesOrPackagesProcessor extends BaseRefactoringProcessor {
   private final MoveCallback myMoveCallback;
   protected @NotNull final MoveDestination myMoveDestination;
   protected NonCodeUsageInfo[] myNonCodeUsages;
+  private boolean myOpenInEditor;
 
   public MoveClassesOrPackagesProcessor(Project project,
                                         PsiElement[] elements,
@@ -203,6 +205,10 @@ public class MoveClassesOrPackagesProcessor extends BaseRefactoringProcessor {
     return myMoveDestination.getTargetPackage();
   }
 
+  public void setOpenInEditor(boolean openInEditor) {
+    myOpenInEditor = openInEditor;
+  }
+
   protected static class ConflictsUsageInfo extends UsageInfo {
     private final Collection<String> myConflicts;
 
@@ -540,6 +546,15 @@ public class MoveClassesOrPackagesProcessor extends BaseRefactoringProcessor {
       }
 
       myNonCodeUsages = CommonMoveUtil.retargetUsages(usages, oldToNewElementsMapping);
+
+      if (myOpenInEditor) {
+        for (PsiElement element : myElementsToMove) {
+          if (element.getContainingFile() != null) {
+            EditorHelper.openInEditor(element);
+            break;
+          }
+        }
+      }
     }
     catch (IncorrectOperationException e) {
       myNonCodeUsages = new NonCodeUsageInfo[0];
index 2640b2492a3497cc407d5e4430357b8e4a585c85..b70564343ac1d99bea1b50f3e165d92c74cd521b 100644 (file)
@@ -33,6 +33,7 @@ import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.*;
 import com.intellij.refactoring.*;
 import com.intellij.refactoring.move.MoveCallback;
+import com.intellij.refactoring.move.MoveDialogBase;
 import com.intellij.refactoring.move.MoveHandler;
 import com.intellij.refactoring.ui.RefactoringDialog;
 import com.intellij.ui.DocumentAdapter;
@@ -43,6 +44,7 @@ import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import javax.swing.event.DocumentEvent;
+import java.awt.*;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.HashSet;
@@ -51,7 +53,7 @@ import java.util.Set;
 /**
  * @author ven
  */
-public class MoveClassesOrPackagesToNewDirectoryDialog extends RefactoringDialog {
+public class MoveClassesOrPackagesToNewDirectoryDialog extends MoveDialogBase {
   private static final Logger LOG = Logger.getInstance("com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesToNewDirectoryDialog");
 
   private final PsiDirectory myDirectory;
@@ -124,6 +126,12 @@ public class MoveClassesOrPackagesToNewDirectoryDialog extends RefactoringDialog
       myPreserveSourceRoot.setSelected(sameModule);
     }
     init();
+    for (PsiElement element : elementsToMove) {
+      if (element.getContainingFile() != null) {
+        myOpenInEditor.add(initOpenInEditorCb(), BorderLayout.WEST);
+        break;
+      }
+    }
   }
 
   private TextFieldWithBrowseButton myDestDirectoryField;
@@ -132,6 +140,7 @@ public class MoveClassesOrPackagesToNewDirectoryDialog extends RefactoringDialog
   private JPanel myRootPanel;
   private JLabel myNameLabel;
   private JCheckBox myPreserveSourceRoot;
+  private JPanel myOpenInEditor;
 
   private boolean isSearchInNonJavaFiles() {
     return mySearchForTextOccurrencesCheckBox.isSelected();
@@ -179,6 +188,7 @@ public class MoveClassesOrPackagesToNewDirectoryDialog extends RefactoringDialog
     final boolean searchForTextOccurences = isSearchInNonJavaFiles();
     refactoringSettings.MOVE_SEARCH_IN_COMMENTS = searchInComments;
     refactoringSettings.MOVE_SEARCH_FOR_TEXT = searchForTextOccurences;
+    saveOpenInEditorOption();
     invokeRefactoring(createRefactoringProcessor(project, directory, aPackage, searchInComments, searchForTextOccurences));
   }
 
@@ -218,12 +228,28 @@ public class MoveClassesOrPackagesToNewDirectoryDialog extends RefactoringDialog
 
     MoveClassesOrPackagesProcessor processor = createMoveClassesOrPackagesProcessor(myDirectory.getProject(), myElementsToMove, destination,
         searchInComments, searchForTextOccurences, myMoveCallback);
-
+    
+    processor.setOpenInEditor(isOpenInEditor());
     if (processor.verifyValidPackageName()) {
       return processor;
     }
     return null;
   }
+
+  @Override
+  protected String getMovePropertySuffix() {
+    return "ClassWithTarget";
+  }
+
+  @Override
+  protected String getCbTitle() {
+    return "Open moved classes in editor";
+  }
+
+  @Override
+  protected boolean isEnabledByDefault() {
+    return false;
+  }
 }
 
 
index 75f157521894e18b7deaf41ae159abdbb1c893c0..069ddf6153dbb096b4a45693a36cc61a90e8353a 100644 (file)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesToNewDirectoryDialog">
-  <grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+  <grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
     <margin top="5" left="5" bottom="5" right="5"/>
     <constraints>
-      <xy x="20" y="20" width="666" height="148"/>
+      <xy x="20" y="20" width="666" height="168"/>
     </constraints>
     <properties/>
     <border type="none"/>
       </component>
       <vspacer id="c1dce">
         <constraints>
-          <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+          <grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
         </constraints>
       </vspacer>
+      <grid id="60268" binding="myOpenInEditor" layout-manager="BorderLayout" hgap="0" vgap="0">
+        <constraints>
+          <grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children/>
+      </grid>
     </children>
   </grid>
   <inspectionSuppressions>
index 7e30dc6901cc1961a36cbf2b718f8dc97b5be6ab..8fb954645c7ba08e475709d864acef291e595c2d 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.refactoring.move.moveInner.MoveInnerDialog">
-  <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="9" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+  <grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="10" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
     <margin top="0" left="0" bottom="0" right="0"/>
     <constraints>
       <xy x="20" y="20" width="500" height="400"/>
@@ -23,7 +23,7 @@
       </hspacer>
       <vspacer id="34c3">
         <constraints>
-          <grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
+          <grid row="9" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
         </constraints>
       </vspacer>
       <component id="8093b" class="com.intellij.ui.EditorTextField" binding="myClassNameField">
         </constraints>
         <properties/>
       </component>
+      <grid id="f9ba1" binding="myOpenInEditorPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
+        <constraints>
+          <grid row="8" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children/>
+      </grid>
     </children>
   </grid>
 </form>
index cb502377f83bd273857d1a377a4474b4dbf80fee..71539abd98c0eaee9500d9b980b69e586bd38456 100644 (file)
@@ -20,6 +20,7 @@
  */
 package com.intellij.refactoring.move.moveInner;
 
+import com.intellij.ide.util.PropertiesComponent;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.help.HelpManager;
 import com.intellij.openapi.project.Project;
@@ -37,6 +38,7 @@ import com.intellij.refactoring.HelpID;
 import com.intellij.refactoring.JavaRefactoringSettings;
 import com.intellij.refactoring.PackageWrapper;
 import com.intellij.refactoring.RefactoringBundle;
+import com.intellij.refactoring.move.MoveDialogBase;
 import com.intellij.refactoring.move.MoveInstanceMembersUtil;
 import com.intellij.refactoring.move.moveClassesOrPackages.MoveClassesOrPackagesUtil;
 import com.intellij.refactoring.ui.NameSuggestionsField;
@@ -52,13 +54,14 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
+import java.awt.*;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
-public class MoveInnerDialog extends RefactoringDialog {
+public class MoveInnerDialog extends MoveDialogBase {
   private final Project myProject;
   private final PsiClass myInnerClass;
   private final PsiElement myTargetContainer;
@@ -74,11 +77,22 @@ public class MoveInnerDialog extends RefactoringDialog {
   private JLabel myPackageNameLabel;
   private JLabel myClassNameLabel;
   private JLabel myParameterNameLabel;
+  private JPanel myOpenInEditorPanel;
   private SuggestedNameInfo mySuggestedNameInfo;
   private final PsiClass myOuterClass;
 
   @NonNls private static final String RECENTS_KEY = "MoveInnerDialog.RECENTS_KEY";
 
+  @Override
+  protected String getMovePropertySuffix() {
+    return "Inner";
+  }
+
+  @Override
+  protected String getCbTitle() {
+    return "Open moved member in editor";
+  }
+
   public MoveInnerDialog(Project project, PsiClass innerClass, MoveInnerProcessor processor, final PsiElement targetContainer) {
     super(project, true);
     myProject = project;
@@ -91,6 +105,7 @@ public class MoveInnerDialog extends RefactoringDialog {
     myPackageNameLabel.setLabelFor(myPackageNameField.getChildComponent());
     myClassNameLabel.setLabelFor(myClassNameField);
     myParameterNameLabel.setLabelFor(myParameterField);
+    myOpenInEditorPanel.add(initOpenInEditorCb(), BorderLayout.EAST);
   }
 
   public boolean isSearchInComments() {
@@ -297,6 +312,10 @@ public class MoveInnerDialog extends RefactoringDialog {
     if (target == null) return;
     myProcessor.setup(getInnerClass(), className, isPassOuterClass(), parameterName,
                       isSearchInComments(), isSearchInNonJavaFiles(), target);
+
+    final boolean openInEditor = isOpenInEditor();
+    saveOpenInEditorOption();
+    myProcessor.setOpenInEditor(openInEditor);
     invokeRefactoring(myProcessor);
   }
 
index d56b8c02844efaaa4725a8769f671c9e8986fdc6..a95d6ef78a7fee3f8b8b0fd4f61e8a626e7bdac7 100644 (file)
@@ -17,6 +17,7 @@ package com.intellij.refactoring.move.moveInner;
 
 import com.intellij.codeInsight.ChangeContextUtil;
 import com.intellij.codeInsight.CodeInsightUtilCore;
+import com.intellij.ide.util.EditorHelper;
 import com.intellij.lang.findUsages.DescriptiveNameUtil;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.fileEditor.FileEditorManager;
@@ -70,6 +71,7 @@ public class MoveInnerProcessor extends BaseRefactoringProcessor {
   private boolean mySearchInComments;
   private boolean mySearchInNonJavaFiles;
   private NonCodeUsageInfo[] myNonCodeUsages;
+  private boolean myOpenInEditor;
 
   public MoveInnerProcessor(Project project, MoveCallback moveCallback) {
     super(project);
@@ -267,9 +269,9 @@ public class MoveInnerProcessor extends BaseRefactoringProcessor {
         ChangeContextUtil.decodeContextInfo(newClass, null, null);
       }
 
-      PsiFile targetFile = newClass.getContainingFile();
-      OpenFileDescriptor descriptor = new OpenFileDescriptor(myProject, targetFile.getVirtualFile(), newClass.getTextOffset());
-      FileEditorManager.getInstance(myProject).openTextEditor(descriptor, true);
+      if (myOpenInEditor) {
+        EditorHelper.openInEditor(newClass);
+      }
 
       if (myMoveCallback != null) {
         myMoveCallback.refactoringCompleted();
@@ -530,4 +532,8 @@ public class MoveInnerProcessor extends BaseRefactoringProcessor {
   public String getParameterName() {
     return myParameterNameOuterClass;
   }
+
+  public void setOpenInEditor(boolean openInEditor) {
+    myOpenInEditor = openInEditor;
+  }
 }
\ No newline at end of file
index 1c058d2fe855ec1f5684c85fdbfbe4bd32010741..7a82ff79d60f4755d1c830f7a95122cfb2b0eabc 100644 (file)
@@ -85,6 +85,8 @@ public class MoveInstanceMethodDialog extends MoveInstanceMethodDialogBase {
       mainPanel.add(parametersPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0,0));
     }
 
+    mainPanel.add(initOpenInEditorCb(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0,0,0,0), 0,0));
+
     separator.setLabelFor(myList);
     validateTextFields(myList.getSelectedIndex());
 
@@ -148,8 +150,10 @@ public class MoveInstanceMethodDialog extends MoveInstanceMethodDialogBase {
     final MoveInstanceMethodProcessor processor = new MoveInstanceMethodProcessor(myMethod.getProject(),
                                                                                   myMethod, targetVariable,
                                                                                   myVisibilityPanel.getVisibility(),
+                                                                                  isOpenInEditor(),
                                                                                   parameterNames);
     if (!verifyTargetClass(processor.getTargetClass())) return;
+    saveOpenInEditorOption();
     invokeRefactoring(processor);
   }
 
@@ -167,4 +171,14 @@ public class MoveInstanceMethodDialog extends MoveInstanceMethodDialogBase {
   protected void doHelpAction() {
     HelpManager.getInstance().invokeHelp(HelpID.MOVE_INSTANCE_METHOD);
   }
+
+  @Override
+  protected String getMovePropertySuffix() {
+    return "Instance";
+  }
+
+  @Override
+  protected String getCbTitle() {
+    return "Open moved method in editor";
+  }
 }
index b839f3bdfe0d057ddf6ce0ecd109cfe4849aa3ec..a02fceb859d27478bb7fdd4343acf2f5607a96bf 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.PsiVariable;
 import com.intellij.psi.search.searches.ClassInheritorsSearch;
 import com.intellij.psi.util.PsiFormatUtil;
 import com.intellij.refactoring.RefactoringBundle;
+import com.intellij.refactoring.move.MoveDialogBase;
 import com.intellij.refactoring.ui.JavaVisibilityPanel;
 import com.intellij.refactoring.ui.RefactoringDialog;
 import com.intellij.ui.ScrollPaneFactory;
@@ -38,7 +39,7 @@ import java.awt.*;
 /**
  * @author dsl
  */
-public abstract class MoveInstanceMethodDialogBase extends RefactoringDialog {
+public abstract class MoveInstanceMethodDialogBase extends MoveDialogBase {
   protected final PsiMethod myMethod;
   protected final PsiVariable[] myVariables;
 
index ca844f0a5bb9e719f9b099318f9f204a836e72eb..3aa806ed98f8248679afeb8e82e86d8e0624775e 100644 (file)
@@ -17,6 +17,7 @@ package com.intellij.refactoring.move.moveInstanceMethod;
 
 import com.intellij.codeInsight.ChangeContextUtil;
 import com.intellij.codeInsight.generation.OverrideImplementUtil;
+import com.intellij.ide.util.EditorHelper;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
@@ -62,16 +63,27 @@ public class MoveInstanceMethodProcessor extends BaseRefactoringProcessor{
   private PsiVariable myTargetVariable;
   private PsiClass myTargetClass;
   private final String myNewVisibility;
+  private final boolean myOpenInEditor;
   private final Map<PsiClass, String> myOldClassParameterNames;
 
+  public MoveInstanceMethodProcessor(final Project project,
+                                   final PsiMethod method,
+                                   final PsiVariable targetVariable,
+                                   final String newVisibility,
+                                   final Map<PsiClass, String> oldClassParameterNames) {
+    this(project, method, targetVariable, newVisibility, false, oldClassParameterNames);
+  }
+
   public MoveInstanceMethodProcessor(final Project project,
                                      final PsiMethod method,
                                      final PsiVariable targetVariable,
                                      final String newVisibility,
+                                     boolean openInEditor, 
                                      final Map<PsiClass, String> oldClassParameterNames) {
     super(project);
     myMethod = method;
     myTargetVariable = targetVariable;
+    myOpenInEditor = openInEditor;
     myOldClassParameterNames = oldClassParameterNames;
     LOG.assertTrue(myTargetVariable instanceof PsiParameter || myTargetVariable instanceof PsiField);
     LOG.assertTrue(myTargetVariable.getType() instanceof PsiClassType);
@@ -247,6 +259,10 @@ public class MoveInstanceMethodProcessor extends BaseRefactoringProcessor{
         reference.bindToElement(method);
       }
       VisibilityUtil.fixVisibility(UsageViewUtil.toElements(usages), method, myNewVisibility);
+
+      if (myOpenInEditor) {
+        EditorHelper.openInEditor(method);
+      }
     }
     catch (IncorrectOperationException e) {
       LOG.error(e);
index a8daa9e733fede9af1653d362876a6fe5340e60c..f5eb13ce73766696f633cff22923a29763ebdab7 100644 (file)
  */
 package com.intellij.refactoring.move.moveMembers;
 
-import com.intellij.ide.util.ClassFilter;
-import com.intellij.ide.util.PackageUtil;
-import com.intellij.ide.util.TreeClassChooser;
-import com.intellij.ide.util.TreeClassChooserFactory;
+import com.intellij.ide.util.*;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.command.CommandProcessor;
 import com.intellij.openapi.editor.event.DocumentAdapter;
@@ -38,6 +35,7 @@ import com.intellij.refactoring.JavaRefactoringSettings;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.classMembers.MemberInfoChange;
 import com.intellij.refactoring.move.MoveCallback;
+import com.intellij.refactoring.move.MoveDialogBase;
 import com.intellij.refactoring.ui.JavaVisibilityPanel;
 import com.intellij.refactoring.ui.MemberSelectionPanel;
 import com.intellij.refactoring.ui.MemberSelectionTable;
@@ -61,7 +59,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Set;
 
-public class MoveMembersDialog extends RefactoringDialog implements MoveMembersOptions {
+public class MoveMembersDialog extends MoveDialogBase implements MoveMembersOptions {
   @NonNls private static final String RECENTS_KEY = "MoveMembersDialog.RECENTS_KEY";
   private MyMemberInfoModel myMemberInfoModel;
 
@@ -76,6 +74,16 @@ public class MoveMembersDialog extends RefactoringDialog implements MoveMembersO
   JavaVisibilityPanel myVisibilityPanel;
   private final JCheckBox myIntroduceEnumConstants = new JCheckBox(RefactoringBundle.message("move.enum.constant.cb"), true);
 
+  @Override
+  protected String getMovePropertySuffix() {
+    return "Member";
+  }
+
+  @Override
+  protected String getCbTitle() {
+    return "Open moved members in editor";
+  }
+
   public MoveMembersDialog(Project project,
                            PsiClass sourceClass,
                            final PsiClass initialTargetClass,
@@ -195,6 +203,7 @@ public class MoveMembersDialog extends RefactoringDialog implements MoveMembersO
     myVisibilityPanel = new JavaVisibilityPanel(true, true);
     myVisibilityPanel.setVisibility(null);
     panel.add(myVisibilityPanel, BorderLayout.EAST);
+    panel.add(initOpenInEditorCb(), BorderLayout.SOUTH);
 
     return panel;
   }
@@ -246,8 +255,9 @@ public class MoveMembersDialog extends RefactoringDialog implements MoveMembersO
       public String getTargetClassName() {
         return MoveMembersDialog.this.getTargetClassName();
       }
-    }));
+    }, isOpenInEditor()));
 
+    saveOpenInEditorOption();
     JavaRefactoringSettings.getInstance().MOVE_PREVIEW_USAGES = isPreviewUsages();
   }
 
index cc594a37c1073a0ccaec1ea154c1bc6987c8c5c9..3e7dba171d64f6968954d75c076cbfd454b7a617 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.refactoring.move.moveMembers;
 
+import com.intellij.ide.util.EditorHelper;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Ref;
@@ -56,6 +57,7 @@ public class MoveMembersProcessor extends BaseRefactoringProcessor {
   private PsiClass myTargetClass;
   private final Set<PsiMember> myMembersToMove = new LinkedHashSet<PsiMember>();
   private final MoveCallback myMoveCallback;
+  private final boolean myOpenInEditor;
   private String myNewVisibility; // "null" means "as is"
   private String myCommandName = MoveMembersImpl.REFACTORING_NAME;
   private MoveMembersOptions myOptions;
@@ -65,8 +67,13 @@ public class MoveMembersProcessor extends BaseRefactoringProcessor {
   }
 
   public MoveMembersProcessor(Project project, @Nullable MoveCallback moveCallback, MoveMembersOptions options) {
+    this(project, moveCallback, options, false);
+  }
+
+  public MoveMembersProcessor(Project project, @Nullable MoveCallback moveCallback, MoveMembersOptions options, boolean openInEditor) {
     super(project);
     myMoveCallback = moveCallback;
+    myOpenInEditor = openInEditor;
     setOptions(options);
   }
 
@@ -231,6 +238,13 @@ public class MoveMembersProcessor extends BaseRefactoringProcessor {
       if (myMoveCallback != null) {
         myMoveCallback.refactoringCompleted();
       }
+
+      if (myOpenInEditor && !movedMembers.isEmpty()) {
+        final PsiMember item = ContainerUtil.getFirstItem(movedMembers.values());
+        if (item != null) {
+          EditorHelper.openInEditor(item);
+        }
+      }
     }
     catch (IncorrectOperationException e) {
       LOG.error(e);
diff --git a/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticOverloadsRenamer.java b/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticOverloadsRenamer.java
new file mode 100644 (file)
index 0000000..f85ad5c
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+/*
+ * User: anna
+ * Date: 12-Jan-2010
+ */
+package com.intellij.refactoring.rename.naming;
+
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiMethod;
+
+public class AutomaticOverloadsRenamer extends AutomaticRenamer {
+  public AutomaticOverloadsRenamer(PsiMethod method, String newName) {
+    final PsiClass containingClass = method.getContainingClass();
+    if (containingClass != null) {
+      final PsiMethod[] overloads = containingClass.findMethodsByName(method.getName(), false);
+      for (PsiMethod overload : overloads) {
+        if (overload != method) {
+          myElements.add(overload);
+          suggestAllNames(overload.getName(), newName);
+        }
+      }
+    }
+  }
+
+  public String getDialogTitle() {
+    return "Rename overloads";
+  }
+
+  public String getDialogDescription() {
+    return "Rename overloads to:";
+  }
+
+  @Override
+  public String entityName() {
+    return "Overload";
+  }
+
+  @Override
+  public boolean isSelectedByDefault() {
+    return true;
+  }
+}
\ No newline at end of file
diff --git a/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticOverloadsRenamerFactory.java b/java/java-impl/src/com/intellij/refactoring/rename/naming/AutomaticOverloadsRenamerFactory.java
new file mode 100644 (file)
index 0000000..fab97ba
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+/*
+ * User: anna
+ * Date: 12-Jan-2010
+ */
+package com.intellij.refactoring.rename.naming;
+
+import com.intellij.psi.*;
+import com.intellij.refactoring.JavaRefactoringSettings;
+import com.intellij.refactoring.RefactoringBundle;
+import com.intellij.usageView.UsageInfo;
+
+import java.util.Collection;
+
+public class AutomaticOverloadsRenamerFactory implements AutomaticRenamerFactory{
+  public boolean isApplicable(PsiElement element) {
+    if (element instanceof PsiMethod && !((PsiMethod)element).isConstructor()) {
+      final PsiClass containingClass = ((PsiMethod)element).getContainingClass();
+      return containingClass != null && containingClass.findMethodsByName(((PsiMethod)element).getName(), false).length > 1;
+    }
+    return false;
+  }
+
+  public String getOptionName() {
+    return RefactoringBundle.message("rename.overloads");
+  }
+
+  public boolean isEnabled() {
+    return JavaRefactoringSettings.getInstance().isRenameOverloads();
+  }
+
+  public void setEnabled(boolean enabled) {
+    JavaRefactoringSettings.getInstance().setRenameOverloads(enabled);
+  }
+
+  public AutomaticRenamer createRenamer(PsiElement element, String newName, Collection<UsageInfo> usages) {
+    return new AutomaticOverloadsRenamer((PsiMethod)element, newName);
+  }
+}
\ No newline at end of file
index dee26d6d80bb042c28a43880de5e348b2bd32c7c..00993f51fbebb3a78b83557ff7e6e30104ae5fa4 100644 (file)
@@ -49,8 +49,10 @@ import com.intellij.usageView.UsageInfo;
 import com.intellij.usageView.UsageViewUtil;
 import com.intellij.usages.*;
 import com.intellij.util.ArrayUtil;
+import com.intellij.util.Function;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.containers.MultiMap;
 import com.intellij.util.ui.tree.TreeUtil;
@@ -291,7 +293,28 @@ public class JavaSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase {
         if (!dialog.showAndGet()) {
           return null;
         }
-        result.addAll(dialog.getSelected());
+        final ArrayList<UsageInfo> selected = dialog.getSelected();
+        final Set<UsageInfo> unselected = new HashSet<UsageInfo>(overridingMethods);
+        unselected.removeAll(selected);
+
+        if (!unselected.isEmpty()) {
+          final List<PsiMethod> unselectedMethods = ContainerUtil.map(unselected, new Function<UsageInfo, PsiMethod>() {
+            @Override
+            public PsiMethod fun(UsageInfo info) {
+              return ((SafeDeleteOverridingMethodUsageInfo)info).getOverridingMethod();
+            }
+          });
+
+          for (Iterator<UsageInfo> iterator = result.iterator(); iterator.hasNext(); ) {
+            final UsageInfo info = iterator.next();
+            if (info instanceof SafeDeleteOverrideAnnotation &&
+                !allSuperMethodsSelectedToDelete(unselectedMethods, ((SafeDeleteOverrideAnnotation)info).getMethod())) {
+              iterator.remove();
+            }
+          }
+        }
+
+        result.addAll(selected);
       }
     }
 
@@ -356,6 +379,12 @@ public class JavaSafeDeleteProcessor extends SafeDeleteProcessorDelegateBase {
     return result.toArray(new UsageInfo[result.size()]);
   }
 
+  private static boolean allSuperMethodsSelectedToDelete(List<PsiMethod> unselectedMethods, PsiMethod method) {
+    final ArrayList<PsiMethod> superMethods = new ArrayList<PsiMethod>(Arrays.asList(method.findSuperMethods()));
+    superMethods.retainAll(unselectedMethods);
+    return superMethods.isEmpty();
+  }
+
   public void prepareForDeletion(final PsiElement element) throws IncorrectOperationException {
     if (element instanceof PsiVariable) {
       ((PsiVariable)element).normalizeDeclaration();
index 8ae3ca80e17555a2bb5b7b1ee4d34175f5d76d7e..85b5cf1b6e42a7d029b3c82ff8debee27bd5cd2f 100644 (file)
@@ -20,6 +20,7 @@ import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.util.Processor;
 import com.intellij.util.SmartList;
 import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.Predicate;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -99,6 +100,37 @@ public abstract class PsiElementFinder {
     return PsiClass.EMPTY_ARRAY;
   }
 
+  /**
+   * Returns a list of children (classes, subpackages and possibly other elements) belonging to the specified package.
+   *
+   * @param psiPackage the package to return the list of children for.
+   * @param scope      the scope in which children are searched.
+   * @return the list of children.
+   * @since 14.1
+   */
+  @NotNull
+  public PsiNamedElement[] getChildren(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
+    Set<PsiNamedElement> children = new HashSet<PsiNamedElement>();
+    Collections.addAll(children, getSubPackages(psiPackage, scope));
+    Collections.addAll(children, getClasses(psiPackage, scope));
+    return children.toArray(new PsiNamedElement[children.size()]);
+  }
+
+  /**
+   * Returns the filter to use for filtering the list of children for a given package produced by other PsiElementFinder
+   * implementations. (For example, the list of children for a Kotlin package includes files directly, rather than classes,
+   * so the classes located by the standard Java package children finder need to be excluded.)
+   *
+   * @param psiPackage the package to return the list of children for.
+   * @param scope      the scope in which children are searched.
+   * @return the filter to use, or null if no additional filtering is necessary.
+   * @since 14.1
+   */
+  @Nullable
+  public Predicate<PsiNamedElement> getPackageChildrenFilter(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
+    return null;
+  }
+
   /**
    * A method to optimize resolve (to only search classes in a package which might be there)
    */
index 65e0af8265ad50e4b31af767c9ea5ae8dd0dde66..cab1728ad650d6c521cb93556c2cf703c75f49ef 100644 (file)
@@ -83,6 +83,14 @@ public interface PsiPackage extends PsiCheckedRenameElement, NavigationItem, Psi
   @NotNull
   PsiClass[] getClasses(@NotNull GlobalSearchScope scope);
 
+  /**
+   * Returns the list of all elements (classes, subpackages and potentially other elements) belonging to this package
+   * (non-recursively), restricted by the specified scope.
+   *
+   * @since 14.1
+   */
+  PsiElement[] getChildren(@NotNull GlobalSearchScope scope);
+
   /**
    * Returns the list of package-level annotations for the package.
    *
index b404c94b83d25eea011fbd4af13fd9b769a31352..3a0824a3f114a0fb2701e79f7637a3fa63d099f8 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.psi.augment;
 
+import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.ExtensionPointName;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.psi.PsiElement;
@@ -29,6 +30,7 @@ import java.util.List;
 
 
 public abstract class PsiAugmentProvider {
+  private static final Logger LOG = Logger.getInstance("#" + PsiAugmentProvider.class.getName());
   public static final ExtensionPointName<PsiAugmentProvider> EP_NAME = ExtensionPointName.create("com.intellij.lang.psiAugmentProvider");
 
   @NotNull
@@ -55,6 +57,8 @@ public abstract class PsiAugmentProvider {
    * @param typeElement place where inference takes place, 
    *                    also nested PsiTypeElement-s (e.g. for List<String> PsiTypeElements corresponding to both List and String would be suggested)
    * @return inferred type or null, if inference is not applicable
+   * 
+   * @since 14.1
    */
   @Nullable
   protected PsiType inferType(PsiTypeElement typeElement) {
@@ -64,9 +68,14 @@ public abstract class PsiAugmentProvider {
   @Nullable
   public static PsiType getInferredType(PsiTypeElement typeElement) {
     for (PsiAugmentProvider provider : Extensions.getExtensions(EP_NAME)) {
-      final PsiType type = provider.inferType(typeElement);
-      if (type != null) {
-        return type;
+      try {
+        final PsiType type = provider.inferType(typeElement);
+        if (type != null) {
+          return type;
+        }
+      }
+      catch (Exception e) {
+        LOG.error("provider: " + provider, e);
       }
     }
     return null;
index bf75430563edd348755aad9783c1269913e9ef25..028e067666fc6e6b58c0213e28ac3109e940b3d2 100644 (file)
 package com.intellij.psi.impl;
 
 import com.intellij.openapi.Disposable;
-import com.intellij.openapi.application.ReadActionProcessor;
 import com.intellij.openapi.progress.ProgressIndicatorProvider;
-import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.roots.FileIndexFacade;
-import com.intellij.openapi.roots.PackageIndex;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.text.StringUtil;
-import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.vfs.VirtualFileFilter;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.file.impl.JavaFileManager;
@@ -34,15 +29,14 @@ import com.intellij.psi.impl.source.JavaDummyHolder;
 import com.intellij.psi.impl.source.JavaDummyHolderFactory;
 import com.intellij.psi.impl.source.resolve.FileContextUtil;
 import com.intellij.psi.search.GlobalSearchScope;
-import com.intellij.psi.stubs.StubTreeLoader;
 import com.intellij.psi.util.PsiModificationTracker;
-import com.intellij.psi.util.PsiUtilCore;
 import com.intellij.reference.SoftReference;
 import com.intellij.util.ConcurrencyUtil;
 import com.intellij.util.Processor;
 import com.intellij.util.SmartList;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
+import com.intellij.util.containers.Predicate;
 import com.intellij.util.messages.MessageBus;
 import gnu.trove.THashSet;
 import org.jetbrains.annotations.NotNull;
@@ -94,7 +88,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
   public PsiClass findClass(@NotNull final String qualifiedName, @NotNull GlobalSearchScope scope) {
     ProgressIndicatorProvider.checkCanceled(); // We hope this method is being called often enough to cancel daemon processes smoothly
 
-    if (DumbService.getInstance(getProject()).isDumb()) {
+    if (shouldUseSlowResolve()) {
       PsiClass[] classes = findClassesInDumbMode(qualifiedName, scope);
       if (classes.length != 0) {
         return classes[0];
@@ -134,7 +128,7 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
   @Override
   @NotNull
   public PsiClass[] findClasses(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
-    if (DumbService.getInstance(getProject()).isDumb()) {
+    if (shouldUseSlowResolve()) {
       return findClassesInDumbMode(qualifiedName, scope);
     }
 
@@ -147,6 +141,11 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
     return classes.toArray(new PsiClass[classes.size()]);
   }
 
+  private boolean shouldUseSlowResolve() {
+    DumbService dumbService = DumbService.getInstance(getProject());
+    return dumbService.isDumb() && dumbService.isAlternativeResolveEnabled();
+  }
+
   @NotNull
   private PsiElementFinder[] finders() {
     PsiElementFinder[] answer = myElementFinders;
@@ -161,7 +160,6 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
   @NotNull
   private PsiElementFinder[] calcFinders() {
     List<PsiElementFinder> elementFinders = new ArrayList<PsiElementFinder>();
-    elementFinders.add(new PsiElementFinderImpl());
     ContainerUtil.addAll(elementFinders, myProject.getExtensions(PsiElementFinder.EP_NAME));
     return elementFinders.toArray(new PsiElementFinder[elementFinders.size()]);
   }
@@ -245,6 +243,56 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
     return result == null ? PsiClass.EMPTY_ARRAY : result.toArray(new PsiClass[result.size()]);
   }
 
+  private static class AndPredicate implements Predicate<PsiNamedElement> {
+    private final List<Predicate<PsiNamedElement>> myComponents = new SmartList<Predicate<PsiNamedElement>>();
+
+    public AndPredicate(Predicate<PsiNamedElement> filter1, Predicate<PsiNamedElement> filter2) {
+      myComponents.add(filter1);
+      myComponents.add(filter2);
+    }
+
+    @Override
+    public boolean apply(@Nullable PsiNamedElement input) {
+      for (Predicate<PsiNamedElement> component : myComponents) {
+        if (!component.apply(input)) {
+          return false;
+        }
+      }
+      return true;
+    }
+  }
+
+  @NotNull
+  public PsiElement[] getPackageChildren(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
+    Map<String, PsiNamedElement> result = new HashMap<String, PsiNamedElement>();
+    Predicate<PsiNamedElement> filter = null;
+
+    for (PsiElementFinder finder : filteredFinders()) {
+      Predicate<PsiNamedElement> finderFilter = finder.getPackageChildrenFilter(psiPackage, scope);
+      if (finderFilter != null) {
+        if (filter == null) {
+          filter = finderFilter;
+        }
+        else if (filter instanceof AndPredicate) {
+          ((AndPredicate) filter).myComponents.add(finderFilter);
+        }
+        else {
+          filter = new AndPredicate(filter, finderFilter);
+        }
+      }
+    }
+
+    for (PsiElementFinder finder : filteredFinders()) {
+      PsiNamedElement[] children = finder.getChildren(psiPackage, scope);
+      for (PsiNamedElement child : children) {
+        if (!result.containsKey(child.getName()) && (filter == null || filter.apply(child))) {
+          result.put(child.getName(), child);
+        }
+      }
+    }
+    return result.values().toArray(new PsiElement[result.size()]);
+  }
+
   public boolean processPackageDirectories(@NotNull PsiPackage psiPackage,
                                            @NotNull GlobalSearchScope scope,
                                            @NotNull Processor<PsiDirectory> consumer,
@@ -274,146 +322,6 @@ public class JavaPsiFacadeImpl extends JavaPsiFacadeEx {
     return result.values().toArray(new PsiPackage[result.size()]);
   }
 
-  public PsiClass[] findClassByShortName(String name, PsiPackage psiPackage, GlobalSearchScope scope) {
-    List<PsiClass> result = null;
-    for (PsiElementFinder finder : filteredFinders()) {
-      PsiClass[] classes = finder.getClasses(name, psiPackage, scope);
-      if (classes.length == 0) continue;
-      if (result == null) result = new ArrayList<PsiClass>();
-      ContainerUtil.addAll(result, classes);
-    }
-
-    return result == null ? PsiClass.EMPTY_ARRAY : result.toArray(new PsiClass[result.size()]);
-  }
-
-  private class PsiElementFinderImpl extends PsiElementFinder implements DumbAware {
-    @Override
-    public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
-      return myFileManager.findClass(qualifiedName, scope);
-    }
-
-    @Override
-    @NotNull
-    public PsiClass[] findClasses(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
-      return myFileManager.findClasses(qualifiedName, scope);
-    }
-
-    @Override
-    public PsiPackage findPackage(@NotNull String qualifiedName) {
-      return myFileManager.findPackage(qualifiedName);
-    }
-
-    @Override
-    @NotNull
-    public PsiPackage[] getSubPackages(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
-      final Map<String, PsiPackage> packagesMap = new HashMap<String, PsiPackage>();
-      final String qualifiedName = psiPackage.getQualifiedName();
-      for (PsiDirectory dir : psiPackage.getDirectories(scope)) {
-        PsiDirectory[] subDirs = dir.getSubdirectories();
-        for (PsiDirectory subDir : subDirs) {
-          final PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(subDir);
-          if (aPackage != null) {
-            final String subQualifiedName = aPackage.getQualifiedName();
-            if (subQualifiedName.startsWith(qualifiedName) && !packagesMap.containsKey(subQualifiedName)) {
-              packagesMap.put(aPackage.getQualifiedName(), aPackage);
-            }
-          }
-        }
-      }
-
-      packagesMap.remove(qualifiedName);    // avoid SOE caused by returning a package as a subpackage of itself
-      return packagesMap.values().toArray(new PsiPackage[packagesMap.size()]);
-    }
-
-    @Override
-    @NotNull
-    public PsiClass[] getClasses(@NotNull PsiPackage psiPackage, @NotNull final GlobalSearchScope scope) {
-      return getClasses(null, psiPackage, scope);
-    }
-
-    @Override
-    @NotNull
-    public PsiClass[] getClasses(@Nullable String shortName, @NotNull PsiPackage psiPackage, @NotNull final GlobalSearchScope scope) {
-      List<PsiClass> list = null;
-      String packageName = psiPackage.getQualifiedName();
-      for (PsiDirectory dir : psiPackage.getDirectories(scope)) {
-        PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(dir);
-        if (classes.length == 0) continue;
-        if (list == null) list = new ArrayList<PsiClass>();
-        for (PsiClass aClass : classes) {
-          // class file can be located in wrong place inside file system
-          String qualifiedName = aClass.getQualifiedName();
-          if (qualifiedName != null) qualifiedName = StringUtil.getPackageName(qualifiedName);
-          if (Comparing.strEqual(qualifiedName, packageName)) {
-            if (shortName == null || shortName.equals(aClass.getName())) list.add(aClass);
-          }
-        }
-      }
-      if (list == null) {
-        return PsiClass.EMPTY_ARRAY;
-      }
-
-      if (list.size() > 1) {
-        ContainerUtil.quickSort(list, new Comparator<PsiClass>() {
-          @Override
-          public int compare(PsiClass o1, PsiClass o2) {
-            VirtualFile file1 = PsiUtilCore.getVirtualFile(o1);
-            VirtualFile file2 = PsiUtilCore.getVirtualFile(o2);
-            return file1 == null ? file2 == null ? 0 : -1 : file2 == null ? 1 : scope.compare(file2, file1);
-          }
-        });
-      }
-
-      return list.toArray(new PsiClass[list.size()]);
-    }
-
-    @NotNull
-    @Override
-    public Set<String> getClassNames(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
-      Set<String> names = null;
-      FileIndexFacade facade = FileIndexFacade.getInstance(myProject);
-      for (PsiDirectory dir : psiPackage.getDirectories(scope)) {
-        for (PsiFile file : dir.getFiles()) {
-          if (file instanceof PsiClassOwner && file.getViewProvider().getLanguages().size() == 1) {
-            VirtualFile vFile = file.getVirtualFile();
-            if (vFile != null &&
-                !(file instanceof PsiCompiledElement) &&
-                !facade.isInSourceContent(vFile) &&
-                (!scope.isForceSearchingInLibrarySources() ||
-                 !StubTreeLoader.getInstance().canHaveStub(vFile))) {
-              continue;
-            }
-
-            Set<String> inFile = file instanceof PsiClassOwnerEx ? ((PsiClassOwnerEx)file).getClassNames() : getClassNames(((PsiClassOwner)file).getClasses());
-
-            if (inFile.isEmpty()) continue;
-            if (names == null) names = new HashSet<String>();
-            names.addAll(inFile);
-          }
-        }
-
-      }
-      return names == null ? Collections.<String>emptySet() : names;
-    }
-
-    @Override
-    public boolean processPackageDirectories(@NotNull PsiPackage psiPackage,
-                                             @NotNull final GlobalSearchScope scope,
-                                             @NotNull final Processor<PsiDirectory> consumer,
-                                             boolean includeLibrarySources) {
-      final PsiManager psiManager = PsiManager.getInstance(getProject());
-      return PackageIndex.getInstance(getProject()).getDirsByPackageName(psiPackage.getQualifiedName(), includeLibrarySources)
-        .forEach(new ReadActionProcessor<VirtualFile>() {
-          @Override
-          public boolean processInReadAction(final VirtualFile dir) {
-            if (!scope.contains(dir)) return true;
-            PsiDirectory psiDir = psiManager.findDirectory(dir);
-            return psiDir == null || consumer.process(psiDir);
-          }
-        });
-    }
-  }
-
   @Override
   public boolean isPartOfPackagePrefix(@NotNull String packageName) {
     final Collection<String> packagePrefixes = myFileManager.getNonTrivialPackagePrefixes();
diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java b/java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java
new file mode 100644 (file)
index 0000000..2c48236
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * 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.psi.impl;
+
+import com.intellij.openapi.application.ReadActionProcessor;
+import com.intellij.openapi.project.DumbAware;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.roots.FileIndexFacade;
+import com.intellij.openapi.roots.PackageIndex;
+import com.intellij.openapi.util.Comparing;
+import com.intellij.openapi.util.text.StringUtil;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.file.impl.JavaFileManager;
+import com.intellij.psi.search.GlobalSearchScope;
+import com.intellij.psi.stubs.StubTreeLoader;
+import com.intellij.psi.util.PsiUtilCore;
+import com.intellij.util.Processor;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.HashMap;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import java.util.*;
+
+/**
+ * Created by kosyakov on 05.12.14.
+ */
+public class PsiElementFinderImpl extends PsiElementFinder implements DumbAware {
+
+  private final Project myProject;
+  private final JavaFileManager myFileManager;
+
+  public PsiElementFinderImpl(Project project, JavaFileManager javaFileManager) {
+    this.myProject = project;
+    this.myFileManager = javaFileManager;
+  }
+
+  @Override
+  public PsiClass findClass(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
+    return myFileManager.findClass(qualifiedName, scope);
+  }
+
+  @Override
+  @NotNull
+  public PsiClass[] findClasses(@NotNull String qualifiedName, @NotNull GlobalSearchScope scope) {
+    return myFileManager.findClasses(qualifiedName, scope);
+  }
+
+  @Override
+  public PsiPackage findPackage(@NotNull String qualifiedName) {
+    return myFileManager.findPackage(qualifiedName);
+  }
+
+  @Override
+  @NotNull
+  public PsiPackage[] getSubPackages(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
+    final Map<String, PsiPackage> packagesMap = new HashMap<String, PsiPackage>();
+    final String qualifiedName = psiPackage.getQualifiedName();
+    for (PsiDirectory dir : psiPackage.getDirectories(scope)) {
+      PsiDirectory[] subDirs = dir.getSubdirectories();
+      for (PsiDirectory subDir : subDirs) {
+        final PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(subDir);
+        if (aPackage != null) {
+          final String subQualifiedName = aPackage.getQualifiedName();
+          if (subQualifiedName.startsWith(qualifiedName) && !packagesMap.containsKey(subQualifiedName)) {
+            packagesMap.put(aPackage.getQualifiedName(), aPackage);
+          }
+        }
+      }
+    }
+
+    packagesMap.remove(qualifiedName);    // avoid SOE caused by returning a package as a subpackage of itself
+    return packagesMap.values().toArray(new PsiPackage[packagesMap.size()]);
+  }
+
+  @Override
+  @NotNull
+  public PsiClass[] getClasses(@NotNull PsiPackage psiPackage, @NotNull final GlobalSearchScope scope) {
+    return getClasses(null, psiPackage, scope);
+  }
+
+  @Override
+  @NotNull
+  public PsiClass[] getClasses(@Nullable String shortName, @NotNull PsiPackage psiPackage, @NotNull final GlobalSearchScope scope) {
+    List<PsiClass> list = null;
+    String packageName = psiPackage.getQualifiedName();
+    for (PsiDirectory dir : psiPackage.getDirectories(scope)) {
+      PsiClass[] classes = JavaDirectoryService.getInstance().getClasses(dir);
+      if (classes.length == 0) continue;
+      if (list == null) list = new ArrayList<PsiClass>();
+      for (PsiClass aClass : classes) {
+        // class file can be located in wrong place inside file system
+        String qualifiedName = aClass.getQualifiedName();
+        if (qualifiedName != null) qualifiedName = StringUtil.getPackageName(qualifiedName);
+        if (Comparing.strEqual(qualifiedName, packageName)) {
+          if (shortName == null || shortName.equals(aClass.getName())) list.add(aClass);
+        }
+      }
+    }
+    if (list == null) {
+      return PsiClass.EMPTY_ARRAY;
+    }
+
+    if (list.size() > 1) {
+      ContainerUtil.quickSort(list, new Comparator<PsiClass>() {
+        @Override
+        public int compare(PsiClass o1, PsiClass o2) {
+          VirtualFile file1 = PsiUtilCore.getVirtualFile(o1);
+          VirtualFile file2 = PsiUtilCore.getVirtualFile(o2);
+          return file1 == null ? file2 == null ? 0 : -1 : file2 == null ? 1 : scope.compare(file2, file1);
+        }
+      });
+    }
+
+    return list.toArray(new PsiClass[list.size()]);
+  }
+
+  @NotNull
+  @Override
+  public Set<String> getClassNames(@NotNull PsiPackage psiPackage, @NotNull GlobalSearchScope scope) {
+    Set<String> names = null;
+    FileIndexFacade facade = FileIndexFacade.getInstance(myProject);
+    for (PsiDirectory dir : psiPackage.getDirectories(scope)) {
+      for (PsiFile file : dir.getFiles()) {
+        if (file instanceof PsiClassOwner && file.getViewProvider().getLanguages().size() == 1) {
+          VirtualFile vFile = file.getVirtualFile();
+          if (vFile != null &&
+              !(file instanceof PsiCompiledElement) &&
+              !facade.isInSourceContent(vFile) &&
+              (!scope.isForceSearchingInLibrarySources() || !StubTreeLoader.getInstance().canHaveStub(vFile))) {
+            continue;
+          }
+
+          Set<String> inFile =
+            file instanceof PsiClassOwnerEx ? ((PsiClassOwnerEx)file).getClassNames() : getClassNames(((PsiClassOwner)file).getClasses());
+
+          if (inFile.isEmpty()) continue;
+          if (names == null) names = new HashSet<String>();
+          names.addAll(inFile);
+        }
+      }
+
+    }
+    return names == null ? Collections.<String>emptySet() : names;
+  }
+
+  @Override
+  public boolean processPackageDirectories(@NotNull PsiPackage psiPackage,
+                                           @NotNull final GlobalSearchScope scope,
+                                           @NotNull final Processor<PsiDirectory> consumer,
+                                           boolean includeLibrarySources) {
+    final PsiManager psiManager = PsiManager.getInstance(myProject);
+    return PackageIndex.getInstance(myProject).getDirsByPackageName(psiPackage.getQualifiedName(), includeLibrarySources)
+      .forEach(new ReadActionProcessor<VirtualFile>() {
+        @Override
+        public boolean processInReadAction(final VirtualFile dir) {
+          if (!scope.contains(dir)) return true;
+          PsiDirectory psiDir = psiManager.findDirectory(dir);
+          return psiDir == null || consumer.process(psiDir);
+        }
+      });
+  }
+}
index f0862c14ab79347dc6b2084ec56e4b342cb0776a..d1b0a3553a13fc0a4cfe34ae1ed98fb5d4970c42 100644 (file)
@@ -153,6 +153,17 @@ public class PsiPackageImpl extends PsiPackageBase implements PsiPackage, Querya
     return getFacade().getClasses(this, scope);
   }
 
+  @NotNull
+  @Override
+  public PsiElement[] getChildren() {
+    return getChildren(allScope());
+  }
+
+  @Override
+  public PsiElement[] getChildren(@NotNull GlobalSearchScope scope) {
+    return getFacade().getPackageChildren(this, scope);
+  }
+
   @Override
   @Nullable
   public PsiModifierList getAnnotationList() {
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/changeSignature/DelegateInInterface.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/changeSignature/DelegateInInterface.java
new file mode 100644 (file)
index 0000000..3a0e191
--- /dev/null
@@ -0,0 +1,3 @@
+interface SAM {
+  void <caret>foo();
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/changeSignature/DelegateInInterface_after.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/changeSignature/DelegateInInterface_after.java
new file mode 100644 (file)
index 0000000..b654c68
--- /dev/null
@@ -0,0 +1,7 @@
+interface SAM {
+    default void foo() {
+        foo(false);
+    }
+
+    void foo(boolean b);
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterMethodTypeParamWithNestedClass.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterMethodTypeParamWithNestedClass.java
new file mode 100644 (file)
index 0000000..84d779f
--- /dev/null
@@ -0,0 +1,15 @@
+// "Create method 'f'" "true"
+public class CreateMethodTest {
+  public <T> void aMethod(final T t) {
+    class Nested {
+        public T call() {
+            T result = f(t);
+            return result;
+        }
+
+        private T f(T t) {
+            <selection>return null;</selection>
+        }
+    }
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeMethodTypeParamWithNestedClass.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeMethodTypeParamWithNestedClass.java
new file mode 100644 (file)
index 0000000..8af0154
--- /dev/null
@@ -0,0 +1,11 @@
+// "Create method 'f'" "true"
+public class CreateMethodTest {
+  public <T> void aMethod(final T t) {
+    class Nested {
+        public T call() {
+            T result = f<caret>(t);
+            return result;
+        }
+    }
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/template/IterParameterizedInnerInMethod-out.java b/java/java-tests/testData/codeInsight/template/IterParameterizedInnerInMethod-out.java
new file mode 100644 (file)
index 0000000..0905286
--- /dev/null
@@ -0,0 +1,13 @@
+import java.util.List;
+
+class Foo {
+    <T> void method1(final T[] val) {
+        class Inner {
+            void method2() {
+                for (T t : <selection>val</selection><caret>) {
+
+                }
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/template/IterParameterizedInnerInMethod.java b/java/java-tests/testData/codeInsight/template/IterParameterizedInnerInMethod.java
new file mode 100644 (file)
index 0000000..1156365
--- /dev/null
@@ -0,0 +1,11 @@
+import java.util.List;
+
+class Foo {
+    <T> void method1(final T[] val) {
+        class Inner {
+            void method2() {
+                <caret>
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/template/postfix/templates/for/inAnonymousRunnable.java b/java/java-tests/testData/codeInsight/template/postfix/templates/for/inAnonymousRunnable.java
new file mode 100644 (file)
index 0000000..8c04272
--- /dev/null
@@ -0,0 +1,10 @@
+class Example {
+    <T> void test(T[] foo) {
+        new Runnable() {
+            @Override
+            public void run() {
+                foo.for<caret>
+            }
+        };
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/template/postfix/templates/for/inAnonymousRunnable_after.java b/java/java-tests/testData/codeInsight/template/postfix/templates/for/inAnonymousRunnable_after.java
new file mode 100644 (file)
index 0000000..0430bf5
--- /dev/null
@@ -0,0 +1,12 @@
+class Example {
+    <T> void test(T[] foo) {
+        new Runnable() {
+            @Override
+            public void run() {
+                for (T t : foo) {
+                    <caret>
+                }
+            }
+        };
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromConstant.java b/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromConstant.java
new file mode 100644 (file)
index 0000000..3ea40dd
--- /dev/null
@@ -0,0 +1,3 @@
+interface I {
+    String FOO = <selection>"hello";</selection>
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromConstant_after.java b/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromConstant_after.java
new file mode 100644 (file)
index 0000000..fc47db8
--- /dev/null
@@ -0,0 +1,10 @@
+import org.jetbrains.annotations.NotNull;
+
+interface I {
+    String FOO = newMethod();
+
+    @NotNull
+    private static String newMethod() {
+        return "hello";
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromStatic.java b/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromStatic.java
new file mode 100644 (file)
index 0000000..1272d81
--- /dev/null
@@ -0,0 +1,5 @@
+interface I {
+    static void foo () {
+        <selection>System.out.println("hello");</selection>
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromStatic_after.java b/java/java-tests/testData/refactoring/extractMethod/Method2InterfaceFromStatic_after.java
new file mode 100644 (file)
index 0000000..ba4666f
--- /dev/null
@@ -0,0 +1,9 @@
+interface I {
+    static void foo () {
+        newMethod();
+    }
+
+    private static void newMethod() {
+        System.out.println("hello");
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inplaceIntroduceParameter/replaceOneLeaveParamToDelete.java b/java/java-tests/testData/refactoring/inplaceIntroduceParameter/replaceOneLeaveParamToDelete.java
new file mode 100644 (file)
index 0000000..fedc19b
--- /dev/null
@@ -0,0 +1,6 @@
+class Test {
+    void foo(int i) {
+        System.out.println(<caret>i);
+        System.out.println(i);
+    }
+}
diff --git a/java/java-tests/testData/refactoring/inplaceIntroduceParameter/replaceOneLeaveParamToDelete_after.java b/java/java-tests/testData/refactoring/inplaceIntroduceParameter/replaceOneLeaveParamToDelete_after.java
new file mode 100644 (file)
index 0000000..f759299
--- /dev/null
@@ -0,0 +1,6 @@
+class Test {
+    void foo(int i, int i1) {
+        System.out.println(i1);
+        System.out.println(i);
+    }
+}
diff --git a/java/java-tests/testData/refactoring/makeMethodStatic/afterFieldsAndDelegation.java b/java/java-tests/testData/refactoring/makeMethodStatic/afterFieldsAndDelegation.java
new file mode 100644 (file)
index 0000000..2624eef
--- /dev/null
@@ -0,0 +1,18 @@
+class C {
+  int i;
+
+    private void foo() {
+        foo(i);
+    }
+
+    private static void foo(int i) {
+    if (true) {
+      foo(i);
+    }
+    System.out.println(i);
+  }
+  
+  {
+    foo();
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/makeMethodStatic/beforeFieldsAndDelegation.java b/java/java-tests/testData/refactoring/makeMethodStatic/beforeFieldsAndDelegation.java
new file mode 100644 (file)
index 0000000..d0ad4ac
--- /dev/null
@@ -0,0 +1,13 @@
+class C {
+  int i;
+  private void fo<caret>o() {
+    if (true) {
+      foo();
+    }
+    System.out.println(i);
+  }
+  
+  {
+    foo();
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/renameMethod/multi/automaticallyRenamedOverloads/after/p/Foo.java b/java/java-tests/testData/refactoring/renameMethod/multi/automaticallyRenamedOverloads/after/p/Foo.java
new file mode 100644 (file)
index 0000000..32d92b2
--- /dev/null
@@ -0,0 +1,13 @@
+package p;
+
+class Foo {
+  void bar() {}
+  void bar(int i){
+    bar();
+  }
+
+  {
+    bar();
+    bar(1);
+  }
+}
diff --git a/java/java-tests/testData/refactoring/renameMethod/multi/automaticallyRenamedOverloads/before/p/Foo.java b/java/java-tests/testData/refactoring/renameMethod/multi/automaticallyRenamedOverloads/before/p/Foo.java
new file mode 100644 (file)
index 0000000..b4a1cea
--- /dev/null
@@ -0,0 +1,13 @@
+package p;
+
+class Foo {
+  void foo() {}
+  void foo(int i){
+    foo();
+  }
+
+  {
+    foo();
+    foo(1);
+  }
+}
index 3c077f1ca801b27d1d5446dae2460d0187c755a3..6be767a7248ef1f3f60f2b20e411aea4994dba4f 100644 (file)
@@ -259,6 +259,19 @@ class JavaAutoPopupTest extends CompletionAutoPopupTestCase {
     assert lookup
   }
 
+  public void "test popup in javadoc local reference"() {
+    myFixture.configureByText("a.java", """
+    /**
+    * {@link #<caret>}
+    */
+      class Foo {
+        void foo() {}
+      }
+    """)
+    type 'f'
+    assert lookup
+  }
+
   public void "test autopopup in javadoc tag name"() {
     myFixture.configureByText("a.java", """
     /**
index 3b651cff08a45af411918c32d00a89670f165065..eef39a1aa92a2e25e677cdb591cb38b1edb219dc 100644 (file)
@@ -38,6 +38,10 @@ public class ChangeSignatureTouchLambdaTest extends ChangeSignatureBaseTest {
     doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
   }
 
+  public void testDelegateInInterface() throws Exception {
+    doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN, "false")}, new ThrownExceptionInfo[0], true);
+  }
+
   private void doTestConflict() {
     try {
       doTest(null, null, null, new ParameterInfoImpl[] {new ParameterInfoImpl(-1, "b", PsiType.BOOLEAN)}, new ThrownExceptionInfo[0], false);
index 9d51c0ccb5082a1c6e9907277f5ae6d8be641257..540f1e3caa313d61726e8d5f3c5b00eb4ff49d45 100644 (file)
@@ -71,8 +71,8 @@ public class ExternalJavadocPresentationTest extends LightCodeInsightTestCase {
       }
 
       @Override
-      public void doBuildFromStream(String url, Reader input, StringBuilder data, boolean search4Encoding) throws IOException {
-        super.doBuildFromStream(url, input, data, search4Encoding);
+      public void doBuildFromStream(String url, Reader input, StringBuilder data, boolean searchForEncoding) throws IOException {
+        super.doBuildFromStream(url, input, data, searchForEncoding);
       }
     }
     JavadocExternalTestFilter filter = new JavadocExternalTestFilter(getProject());
index 5b2ff9d54ff06b7dd11da8d186ebe08ac10d26a8..e2ccb58f981a2917c24b0e97dc2c79585381587f 100644 (file)
@@ -385,6 +385,13 @@ class Foo {
     checkResult();
   }
 
+  public void testIterParameterizedInnerInMethod() {
+    configure();
+    startTemplate("iter", "iterations")
+    stripTrailingSpaces();
+    checkResult();
+  }
+
   public void testAsListToar() {
     configure();
     startTemplate("toar", "other")
@@ -955,6 +962,4 @@ class Foo {
 }
 """)
   }
-
-
 }
index bf8c755556186227cf535d20c6e9af2dfb294bed..ff29755dd05e6f797a06040e9bcad4f77b064214 100644 (file)
@@ -34,6 +34,10 @@ public class ForeachTemplateTest extends PostfixTemplateTestCase {
     doTest();
   }
 
+  public void testInAnonymousRunnable() {
+    doTest();
+  }
+
   public void testFinalLocals() {
     CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
     boolean oldGenerateFinalLocals = settings.GENERATE_FINAL_LOCALS;
index 305454563ab8f6baa9261f3cb1a0038c6200ea54..77be162dce7c0f123746f2b9148bea9cf3a0b891 100644 (file)
@@ -39,11 +39,6 @@ public class FileTemplateTestUtil {
     public File getConfigRoot(boolean create) {
       return myTestConfigDir;
     }
-
-    @Override
-    public void saveTemplates() {
-      super.saveTemplates();
-    }
   }
 
   public static void loadCustomizedContent(FTManager templateManager) {
index 220956b56aa447d65c187d716d24b9a4cd18456f..327ab42363f371af1025e532877ab743f524d9e0 100644 (file)
@@ -581,6 +581,14 @@ public class ExtractMethodTest extends LightCodeInsightTestCase {
   public void testMethod2Interface() throws Exception {
     doTest();
   }
+  
+  public void testMethod2InterfaceFromStatic() throws Exception {
+    doTest();
+  }
+
+  public void testMethod2InterfaceFromConstant() throws Exception {
+    doTest();
+  }
 
   public void testParamDetection() throws Exception {
     doTest();
index b0749bf56f728cc2936d67c6de48aef15b94c0b7..6eb55cf539d21bb28d53cd2c17e7d31987b74174 100644 (file)
@@ -60,6 +60,14 @@ public class InplaceIntroduceParameterTest extends AbstractJavaInplaceIntroduceT
     });
   }
 
+  public void testReplaceOneLeaveParamToDelete() throws Exception {
+    doTest(new Pass<AbstractInplaceIntroducer>() {
+      @Override
+      public void pass(AbstractInplaceIntroducer inplaceIntroduceFieldPopup) {
+      }
+    });
+  }
+
   public void testReplaceAllBrokenIdentifier() throws Exception {
     doTest(new Pass<AbstractInplaceIntroducer>() {
       @Override
index f5ae8121f45ecd41efd039fde231803e082b9ba3..6427e2e0526537e61c13fb6d4bdd4d899d95448e 100644 (file)
@@ -185,9 +185,11 @@ public class MakeMethodStaticTest extends LightRefactoringTestCase {
   }
 
   public void testPreserveTypeParams() throws Exception {
-    configureByFile("/refactoring/makeMethodStatic/beforePreserveTypeParams.java");
-    performWithFields();
-    checkResultByFile("/refactoring/makeMethodStatic/afterPreserveTypeParams.java");
+    doTestFields(false);
+  }
+
+  public void testFieldsAndDelegation() throws Exception {
+    doTestFields(true);
   }
 
   public void testInnerStaticClassUsed() throws Exception {
@@ -215,6 +217,14 @@ public class MakeMethodStaticTest extends LightRefactoringTestCase {
     checkResultByFile("/refactoring/makeMethodStatic/after" + getTestName(false) + ".java");
   }
 
+  private void doTestFields(boolean delegate) throws Exception {
+    final String testName = getTestName(false);
+    configureByFile("/refactoring/makeMethodStatic/before" + testName + ".java");
+    performWithFields(delegate);
+    checkResultByFile("/refactoring/makeMethodStatic/after" + testName + ".java");
+  }
+
+
   private static void perform(boolean addClassParameter) {
     PsiElement element = TargetElementUtilBase.findTargetElement(myEditor, TargetElementUtilBase.ELEMENT_NAME_ACCEPTED);
     assertTrue(element instanceof PsiMethod);
@@ -227,6 +237,10 @@ public class MakeMethodStaticTest extends LightRefactoringTestCase {
   }
 
   private static void performWithFields() {
+    performWithFields(false);
+  }
+
+  private static void performWithFields(boolean delegate) {
     PsiElement element = TargetElementUtilBase.findTargetElement(myEditor, TargetElementUtilBase.ELEMENT_NAME_ACCEPTED);
     assertTrue(element instanceof PsiMethod);
     PsiMethod method = (PsiMethod) element;
@@ -238,6 +252,6 @@ public class MakeMethodStaticTest extends LightRefactoringTestCase {
             method,
             new Settings(true, addClassParameter ? "anObject" : null,
                          parametersForFields.toArray(
-                           new VariableData[parametersForFields.size()]))).run();
+                           new VariableData[parametersForFields.size()]), delegate)).run();
   }
 }
index cb354a6c0b7f69993b38b2ea7cffef38391a69df..9df3bebcd6dd253be48d883fd78d5a4bce50d68e 100644 (file)
 package com.intellij.refactoring;
 
 import com.intellij.JavaTestUtil;
+import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.JavaPsiFacade;
 import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiMethod;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.refactoring.rename.RenameProcessor;
+import com.intellij.refactoring.rename.naming.AutomaticRenamerFactory;
 import org.jetbrains.annotations.NotNull;
 import org.junit.Assert;
 
@@ -84,6 +87,10 @@ public class RenameMethodMultiTest extends MultiFileTestCase {
     doTest("void test123(int i, int j)", "test123asd");
   }
 
+  public void testAutomaticallyRenamedOverloads() throws Exception {
+    doAutomaticRenameMethod("p.Foo", "void foo()", "bar");
+  }
+
   private void doTest(final String methodSignature, final String newName) throws Exception {
     doTest(getTestName(false), methodSignature, newName);
   }
@@ -105,4 +112,27 @@ public class RenameMethodMultiTest extends MultiFileTestCase {
     });
   }
 
+  private void doAutomaticRenameMethod(final String className, final String methodSignature, final String newName) throws Exception {
+    doTest(new PerformAction() {
+      @Override
+      public void performAction(VirtualFile rootDir, VirtualFile rootAfter) throws Exception {
+        final JavaPsiFacade manager = getJavaFacade();
+        final PsiClass aClass = manager.findClass(className, GlobalSearchScope.moduleScope(myModule));
+        assertNotNull(aClass);
+        final PsiMethod methodBySignature = aClass.findMethodBySignature(manager.getElementFactory().createMethodFromText(
+          methodSignature + "{}", null), false);
+        assertNotNull(methodBySignature);
+
+        final RenameProcessor processor = new RenameProcessor(myProject, methodBySignature, newName, false, false);
+        for (AutomaticRenamerFactory factory : Extensions.getExtensions(AutomaticRenamerFactory.EP_NAME)) {
+          processor.addRenamerFactory(factory);
+        }
+        processor.run();
+        PsiDocumentManager.getInstance(myProject).commitAllDocuments();
+        FileDocumentManager.getInstance().saveAllDocuments();
+      }
+    });
+  }
+
+
 }
index 3164a297a8b9105a92804424d590c23d6d3b40d7..e1494de5a0a1bfd4a63cea2632bda4a90c1c43b8 100644 (file)
@@ -468,19 +468,19 @@ public class JavaReplaceHandler extends StructuralReplaceHandler {
     final int elementOffset = affectedElement.getTextOffset();
     final int finalStartOffset = startOffset + elementOffset;
     final int finalEndOffset = endOffset + elementOffset;
-    final List<PsiReferenceExpression> references = new ArrayList<PsiReferenceExpression>();
+    final List<PsiJavaCodeReferenceElement> references = new ArrayList<PsiJavaCodeReferenceElement>();
     final JavaRecursiveElementVisitor collector = new JavaRecursiveElementVisitor() {
       @Override
-      public void visitReferenceExpression(PsiReferenceExpression expression) {
-        final int offset = expression.getTextOffset();
+      public void visitReferenceElement(PsiJavaCodeReferenceElement reference) {
+        final int offset = reference.getTextOffset();
         if (offset > finalEndOffset) {
           return;
         }
-        super.visitReferenceExpression(expression);
-        if (offset + expression.getTextLength() < finalStartOffset) {
+        super.visitReferenceElement(reference);
+        if (offset + reference.getTextLength() < finalStartOffset) {
           return;
         }
-        final PsiElement target = expression.resolve();
+        final PsiElement target = reference.resolve();
         if (!(target instanceof PsiMember)) {
           return;
         }
@@ -488,14 +488,14 @@ public class JavaReplaceHandler extends StructuralReplaceHandler {
         if (!member.hasModifierProperty(PsiModifier.STATIC)) {
           return;
         }
-        if (expression.getQualifierExpression() == null) {
+        if (reference.getQualifier() == null) {
           return;
         }
-        references.add(expression);
+        references.add(reference);
       }
     };
     affectedElement.accept(collector);
-    for (PsiReferenceExpression expression : references) {
+    for (PsiJavaCodeReferenceElement expression : references) {
       final PsiElement target = expression.resolve();
       if (!(target instanceof PsiMember)) {
         continue;
@@ -514,9 +514,9 @@ public class JavaReplaceHandler extends StructuralReplaceHandler {
         continue;
       }
       if (ImportUtils.addStaticImport(className, name, expression)) {
-        final PsiExpression qualifierExpression = expression.getQualifierExpression();
-        if (qualifierExpression != null) {
-          qualifierExpression.delete();
+        final PsiElement qualifier = expression.getQualifier();
+        if (qualifier != null) {
+          qualifier.delete();
         }
       }
     }
index 25b8a125704586aaa12cd7f4945a32ab66ee297e..e416c0cbe778d3bf5e3ec9c34797107b207896f9 100644 (file)
@@ -258,21 +258,16 @@ public class JavaCompilingVisitor extends JavaRecursiveElementWalkingVisitor {
   public void visitDeclarationStatement(PsiDeclarationStatement psiDeclarationStatement) {
     super.visitDeclarationStatement(psiDeclarationStatement);
 
-    if (psiDeclarationStatement.getFirstChild() instanceof PsiTypeElement) {
+    final PsiElement firstChild = psiDeclarationStatement.getFirstChild();
+    if (firstChild instanceof PsiTypeElement) {
       // search for expression or symbol
-      final PsiJavaCodeReferenceElement reference =
-        ((PsiTypeElement)psiDeclarationStatement.getFirstChild()).getInnermostComponentReferenceElement();
+      final PsiJavaCodeReferenceElement reference = ((PsiTypeElement)firstChild).getInnermostComponentReferenceElement();
 
-      if (reference != null &&
-          (myCompilingVisitor.getContext().getPattern().isRealTypedVar(reference.getReferenceNameElement())) &&
-          reference.getParameterList().getTypeParameterElements().length > 0
-        ) {
+      if (reference != null && reference.getParameterList().getTypeParameterElements().length > 0) {
         myCompilingVisitor.setHandler(psiDeclarationStatement, new TypedSymbolHandler());
         final MatchingHandler handler = myCompilingVisitor.getContext().getPattern().getHandler(psiDeclarationStatement);
         // typed symbol
-        handler.setFilter(
-          TypedSymbolNodeFilter.getInstance()
-        );
+        handler.setFilter(TypedSymbolNodeFilter.getInstance());
 
         final PsiTypeElement[] params = reference.getParameterList().getTypeParameterElements();
         for (PsiTypeElement param : params) {
index ed5bf0270f5f1b85f9d6ca22757b93b87ef91545..c880924ea2326a01eecf10bec393e08fc7b832f5 100644 (file)
@@ -193,8 +193,7 @@ public class JavacMain {
 
   private static boolean canUseOptimizedFileManager(JavaCompilingTool compilingTool) {
     // since java 9 internal API's used by the optimizedFileManager have changed
-    return compilingTool instanceof JavacCompilerTool && 
-           (JAVA_VERSION.contains("1.6") || JAVA_VERSION.contains("1.7") || JAVA_VERSION.contains("1.8"));
+    return compilingTool instanceof JavacCompilerTool && !SystemInfo.isJavaVersionAtLeast("1.9");
   }
 
   private static void handleCancelException(DiagnosticOutputConsumer diagnosticConsumer) {
index d383ffb3146615078b852e7128a5460210819229..e34571a017a80003fea078195a23d9ae562a1853 100644 (file)
@@ -216,7 +216,9 @@ public class FilePatternPackageSet extends PatternBasedPackageSet {
 
   @Override
   public boolean isOn(String oldQName) {
-    return Comparing.strEqual(myPathPattern, oldQName);
+    return Comparing.strEqual(myPathPattern, oldQName) ||
+           Comparing.strEqual(oldQName + "//*", myPathPattern) ||
+           Comparing.strEqual(oldQName + "/*", myPathPattern);
   }
 
   @Nullable
index a0f5b43ce308e68ca0954e6861eed8232a9e566d..bbc3e824e93378d11ce5141543158d16c37a9e1d 100644 (file)
@@ -34,7 +34,7 @@ import java.util.List;
 
 /**
  * A service managing IDEA's 'dumb' mode: when indices are updated in background and the functionality is very much limited.
- * Only the explicitly allowed functionality is available. Usually it's allowed by implementing {@link com.intellij.openapi.project.DumbAware} interface.
+ * Only the explicitly allowed functionality is available. Usually it's allowed by implementing {@link DumbAware} interface.
  *
  * If you want to register a toolwindow, which will be enabled during the dumb mode, please use {@link com.intellij.openapi.wm.ToolWindowManager}'s
  * registration methods which have 'canWorkInDumMode' parameter. 
@@ -45,7 +45,7 @@ public abstract class DumbService {
   private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.project.DumbService");
 
   /**
-   * @see com.intellij.openapi.project.Project#getMessageBus()
+   * @see Project#getMessageBus()
    */
   public static final Topic<DumbModeListener> DUMB_MODE = new Topic<DumbModeListener>("dumb mode", DumbModeListener.class);
 
@@ -210,6 +210,30 @@ public abstract class DumbService {
     return o instanceof DumbAware;
   }
 
+  /**
+   * Enables or disables alternative resolve strategies for the current thread.<p/> 
+   * 
+   * Normally reference resolution uses index, and hence is not available in dumb mode. In some cases, alternative ways
+   * of performing resolve are available, although much slower. It's impractical to always use these ways because it'll
+   * lead to overloaded CPU (especially given there's also indexing in progress). But for some explicit user actions
+   * (e.g. explicit Goto Declaration) turning these slower methods is beneficial.<p/>
+   *
+   * NOTE: even with alternative resolution enabled, methods like resolve(), findClass() etc may still throw
+   * {@link IndexNotReadyException}. So alternative resolve is not a panacea, it might help provide navigation in some cases
+   * but not in all.<p/>
+   * 
+   * A typical usage would involve try-finally, where the alternative resolution is first enabled, then an action is performed,
+   * and then alternative resolution is turned off in the finally block.
+   */
+  public abstract void setAlternativeResolveEnabled(boolean enabled);
+
+  /**
+   * @return whether alternative resolution is enabled for the current thread.
+   * 
+   * @see #setAlternativeResolveEnabled(boolean) 
+   */
+  public abstract boolean isAlternativeResolveEnabled();
+
   /**
    * @see #DUMB_MODE
    */
index 1e1179cc5ee8e50fad2f1e78dfd0f71d21e32a02..b1fe7ae2a727892d6ad06851780967a19f8c0837 100644 (file)
@@ -74,6 +74,15 @@ public class MockDumbService extends DumbService {
     return myProject;
   }
 
+  @Override
+  public void setAlternativeResolveEnabled(boolean enabled) {
+  }
+
+  @Override
+  public boolean isAlternativeResolveEnabled() {
+    return false;
+  }
+
   public void smartInvokeLater(@NotNull final Runnable runnable) {
     runnable.run();
   }
old mode 100644 (file)
new mode 100755 (executable)
index 0a67d92..ba55aac
Binary files a/platform/icons/src/javaee/JavaeeAppModule.png and b/platform/icons/src/javaee/JavaeeAppModule.png differ
diff --git a/platform/icons/src/javaee/JavaeeAppModule@2x.png b/platform/icons/src/javaee/JavaeeAppModule@2x.png
new file mode 100755 (executable)
index 0000000..92f2fb0
Binary files /dev/null and b/platform/icons/src/javaee/JavaeeAppModule@2x.png differ
diff --git a/platform/icons/src/javaee/JavaeeAppModule@2x_dark.png b/platform/icons/src/javaee/JavaeeAppModule@2x_dark.png
new file mode 100755 (executable)
index 0000000..79201c6
Binary files /dev/null and b/platform/icons/src/javaee/JavaeeAppModule@2x_dark.png differ
diff --git a/platform/icons/src/javaee/JavaeeAppModule_dark.png b/platform/icons/src/javaee/JavaeeAppModule_dark.png
new file mode 100755 (executable)
index 0000000..d96b253
Binary files /dev/null and b/platform/icons/src/javaee/JavaeeAppModule_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 9961daa..6e6a162
Binary files a/platform/icons/src/javaee/WebService.png and b/platform/icons/src/javaee/WebService.png differ
diff --git a/platform/icons/src/javaee/WebService2.png b/platform/icons/src/javaee/WebService2.png
new file mode 100755 (executable)
index 0000000..590f3a5
Binary files /dev/null and b/platform/icons/src/javaee/WebService2.png differ
diff --git a/platform/icons/src/javaee/WebService2@2x.png b/platform/icons/src/javaee/WebService2@2x.png
new file mode 100755 (executable)
index 0000000..2e7a3bc
Binary files /dev/null and b/platform/icons/src/javaee/WebService2@2x.png differ
diff --git a/platform/icons/src/javaee/WebService2@2x_dark.png b/platform/icons/src/javaee/WebService2@2x_dark.png
new file mode 100755 (executable)
index 0000000..46daeb4
Binary files /dev/null and b/platform/icons/src/javaee/WebService2@2x_dark.png differ
diff --git a/platform/icons/src/javaee/WebService@2x.png b/platform/icons/src/javaee/WebService@2x.png
new file mode 100755 (executable)
index 0000000..516a1b7
Binary files /dev/null and b/platform/icons/src/javaee/WebService@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 63df7e0..a5a951a
Binary files a/platform/icons/src/javaee/WebServiceClient.png and b/platform/icons/src/javaee/WebServiceClient.png differ
diff --git a/platform/icons/src/javaee/WebServiceClient2.png b/platform/icons/src/javaee/WebServiceClient2.png
new file mode 100755 (executable)
index 0000000..114cdda
Binary files /dev/null and b/platform/icons/src/javaee/WebServiceClient2.png differ
diff --git a/platform/icons/src/javaee/WebServiceClient2@2x.png b/platform/icons/src/javaee/WebServiceClient2@2x.png
new file mode 100755 (executable)
index 0000000..839131b
Binary files /dev/null and b/platform/icons/src/javaee/WebServiceClient2@2x.png differ
diff --git a/platform/icons/src/javaee/WebServiceClient2@2x_dark.png b/platform/icons/src/javaee/WebServiceClient2@2x_dark.png
new file mode 100755 (executable)
index 0000000..c473459
Binary files /dev/null and b/platform/icons/src/javaee/WebServiceClient2@2x_dark.png differ
diff --git a/platform/icons/src/javaee/WebServiceClient2_dark.png b/platform/icons/src/javaee/WebServiceClient2_dark.png
new file mode 100755 (executable)
index 0000000..eaad417
Binary files /dev/null and b/platform/icons/src/javaee/WebServiceClient2_dark.png differ
diff --git a/platform/icons/src/javaee/WebServiceClient@2x.png b/platform/icons/src/javaee/WebServiceClient@2x.png
new file mode 100755 (executable)
index 0000000..30a584a
Binary files /dev/null and b/platform/icons/src/javaee/WebServiceClient@2x.png differ
diff --git a/platform/icons/src/javaee/WebService_dark.png b/platform/icons/src/javaee/WebService_dark.png
new file mode 100755 (executable)
index 0000000..118fb9b
Binary files /dev/null and b/platform/icons/src/javaee/WebService_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 8bd86a3..c7772fe
Binary files a/platform/icons/src/javaee/application_xml.png and b/platform/icons/src/javaee/application_xml.png differ
diff --git a/platform/icons/src/javaee/application_xml@2x.png b/platform/icons/src/javaee/application_xml@2x.png
new file mode 100755 (executable)
index 0000000..d41ea77
Binary files /dev/null and b/platform/icons/src/javaee/application_xml@2x.png differ
diff --git a/platform/icons/src/javaee/application_xml@2x_dark.png b/platform/icons/src/javaee/application_xml@2x_dark.png
new file mode 100755 (executable)
index 0000000..f2c6e61
Binary files /dev/null and b/platform/icons/src/javaee/application_xml@2x_dark.png differ
diff --git a/platform/icons/src/javaee/application_xml_dark.png b/platform/icons/src/javaee/application_xml_dark.png
new file mode 100755 (executable)
index 0000000..0d20c5b
Binary files /dev/null and b/platform/icons/src/javaee/application_xml_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 417055d..b882c72
Binary files a/platform/icons/src/javaee/dataSourceImport.png and b/platform/icons/src/javaee/dataSourceImport.png differ
diff --git a/platform/icons/src/javaee/dataSourceImport@2x.png b/platform/icons/src/javaee/dataSourceImport@2x.png
new file mode 100755 (executable)
index 0000000..1e9697c
Binary files /dev/null and b/platform/icons/src/javaee/dataSourceImport@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index e7b85f7..1e9697c
Binary files a/platform/icons/src/javaee/dbSchemaImportBig.png and b/platform/icons/src/javaee/dbSchemaImportBig.png differ
diff --git a/platform/icons/src/javaee/dbSchemaImportBig@2x.png b/platform/icons/src/javaee/dbSchemaImportBig@2x.png
new file mode 100755 (executable)
index 0000000..af52813
Binary files /dev/null and b/platform/icons/src/javaee/dbSchemaImportBig@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 4fa3a36..a2761bf
Binary files a/platform/icons/src/javaee/ejb-jar_xml.png and b/platform/icons/src/javaee/ejb-jar_xml.png differ
diff --git a/platform/icons/src/javaee/ejb-jar_xml@2x.png b/platform/icons/src/javaee/ejb-jar_xml@2x.png
new file mode 100755 (executable)
index 0000000..471aa6c
Binary files /dev/null and b/platform/icons/src/javaee/ejb-jar_xml@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 5b3ab29..c296e7b
Binary files a/platform/icons/src/javaee/ejbClass.png and b/platform/icons/src/javaee/ejbClass.png differ
diff --git a/platform/icons/src/javaee/ejbClass@2x.png b/platform/icons/src/javaee/ejbClass@2x.png
new file mode 100755 (executable)
index 0000000..a7e22c5
Binary files /dev/null and b/platform/icons/src/javaee/ejbClass@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 03ec8e1..95dc2be
Binary files a/platform/icons/src/javaee/ejbModule.png and b/platform/icons/src/javaee/ejbModule.png differ
diff --git a/platform/icons/src/javaee/ejbModule@2x.png b/platform/icons/src/javaee/ejbModule@2x.png
new file mode 100755 (executable)
index 0000000..da59cea
Binary files /dev/null and b/platform/icons/src/javaee/ejbModule@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index e2d0da4..475c2ed
Binary files a/platform/icons/src/javaee/embeddedAttributeOverlay.png and b/platform/icons/src/javaee/embeddedAttributeOverlay.png differ
diff --git a/platform/icons/src/javaee/embeddedAttributeOverlay@2x.png b/platform/icons/src/javaee/embeddedAttributeOverlay@2x.png
new file mode 100755 (executable)
index 0000000..e7fb7f3
Binary files /dev/null and b/platform/icons/src/javaee/embeddedAttributeOverlay@2x.png differ
diff --git a/platform/icons/src/javaee/embeddedAttributeOverlay@2x_dark.png b/platform/icons/src/javaee/embeddedAttributeOverlay@2x_dark.png
new file mode 100755 (executable)
index 0000000..942f4cb
Binary files /dev/null and b/platform/icons/src/javaee/embeddedAttributeOverlay@2x_dark.png differ
diff --git a/platform/icons/src/javaee/embeddedAttributeOverlay_dark.png b/platform/icons/src/javaee/embeddedAttributeOverlay_dark.png
new file mode 100755 (executable)
index 0000000..e59fa89
Binary files /dev/null and b/platform/icons/src/javaee/embeddedAttributeOverlay_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 6bd91f2..fa15277
Binary files a/platform/icons/src/javaee/entityBean.png and b/platform/icons/src/javaee/entityBean.png differ
diff --git a/platform/icons/src/javaee/entityBean@2x.png b/platform/icons/src/javaee/entityBean@2x.png
new file mode 100755 (executable)
index 0000000..3b527da
Binary files /dev/null and b/platform/icons/src/javaee/entityBean@2x.png differ
diff --git a/platform/icons/src/javaee/entityBean@2x_dark.png b/platform/icons/src/javaee/entityBean@2x_dark.png
new file mode 100755 (executable)
index 0000000..0a946c2
Binary files /dev/null and b/platform/icons/src/javaee/entityBean@2x_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index fa59d64..4d81661
Binary files a/platform/icons/src/javaee/entityBeanBig.png and b/platform/icons/src/javaee/entityBeanBig.png differ
diff --git a/platform/icons/src/javaee/entityBeanBig@2x.png b/platform/icons/src/javaee/entityBeanBig@2x.png
new file mode 100755 (executable)
index 0000000..6f5a16f
Binary files /dev/null and b/platform/icons/src/javaee/entityBeanBig@2x.png differ
diff --git a/platform/icons/src/javaee/entityBeanBig@2x_dark.png b/platform/icons/src/javaee/entityBeanBig@2x_dark.png
new file mode 100755 (executable)
index 0000000..6762894
Binary files /dev/null and b/platform/icons/src/javaee/entityBeanBig@2x_dark.png differ
diff --git a/platform/icons/src/javaee/entityBeanBig_dark.png b/platform/icons/src/javaee/entityBeanBig_dark.png
new file mode 100755 (executable)
index 0000000..5edeaaa
Binary files /dev/null and b/platform/icons/src/javaee/entityBeanBig_dark.png differ
diff --git a/platform/icons/src/javaee/entityBean_dark.png b/platform/icons/src/javaee/entityBean_dark.png
new file mode 100755 (executable)
index 0000000..e62a2ec
Binary files /dev/null and b/platform/icons/src/javaee/entityBean_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 5ab0f92..5d6e70e
Binary files a/platform/icons/src/javaee/home.png and b/platform/icons/src/javaee/home.png differ
diff --git a/platform/icons/src/javaee/home@2x.png b/platform/icons/src/javaee/home@2x.png
new file mode 100755 (executable)
index 0000000..bbdc01b
Binary files /dev/null and b/platform/icons/src/javaee/home@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index dd829d5..8e04255
Binary files a/platform/icons/src/javaee/inheritedAttributeOverlay.png and b/platform/icons/src/javaee/inheritedAttributeOverlay.png differ
diff --git a/platform/icons/src/javaee/inheritedAttributeOverlay@2x.png b/platform/icons/src/javaee/inheritedAttributeOverlay@2x.png
new file mode 100755 (executable)
index 0000000..2cb2c27
Binary files /dev/null and b/platform/icons/src/javaee/inheritedAttributeOverlay@2x.png differ
diff --git a/platform/icons/src/javaee/inheritedAttributeOverlay@2x_dark.png b/platform/icons/src/javaee/inheritedAttributeOverlay@2x_dark.png
new file mode 100755 (executable)
index 0000000..f61fe95
Binary files /dev/null and b/platform/icons/src/javaee/inheritedAttributeOverlay@2x_dark.png differ
diff --git a/platform/icons/src/javaee/inheritedAttributeOverlay_dark.png b/platform/icons/src/javaee/inheritedAttributeOverlay_dark.png
new file mode 100755 (executable)
index 0000000..398e25c
Binary files /dev/null and b/platform/icons/src/javaee/inheritedAttributeOverlay_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index cee6081..f543e27
Binary files a/platform/icons/src/javaee/interceptorClass.png and b/platform/icons/src/javaee/interceptorClass.png differ
diff --git a/platform/icons/src/javaee/interceptorClass@2x.png b/platform/icons/src/javaee/interceptorClass@2x.png
new file mode 100755 (executable)
index 0000000..01837fb
Binary files /dev/null and b/platform/icons/src/javaee/interceptorClass@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 689653e..146cefb
Binary files a/platform/icons/src/javaee/interceptorMethod.png and b/platform/icons/src/javaee/interceptorMethod.png differ
diff --git a/platform/icons/src/javaee/interceptorMethod@2x.png b/platform/icons/src/javaee/interceptorMethod@2x.png
new file mode 100755 (executable)
index 0000000..ca01ef3
Binary files /dev/null and b/platform/icons/src/javaee/interceptorMethod@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 5bc6a74..b96a2d2
Binary files a/platform/icons/src/javaee/jpaFacet.png and b/platform/icons/src/javaee/jpaFacet.png differ
diff --git a/platform/icons/src/javaee/jpaFacet@2x.png b/platform/icons/src/javaee/jpaFacet@2x.png
new file mode 100755 (executable)
index 0000000..d317d01
Binary files /dev/null and b/platform/icons/src/javaee/jpaFacet@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index ed4ace4..3675414
Binary files a/platform/icons/src/javaee/local.png and b/platform/icons/src/javaee/local.png differ
diff --git a/platform/icons/src/javaee/local@2x.png b/platform/icons/src/javaee/local@2x.png
new file mode 100755 (executable)
index 0000000..477284e
Binary files /dev/null and b/platform/icons/src/javaee/local@2x.png differ
diff --git a/platform/icons/src/javaee/local@2x_dark.png b/platform/icons/src/javaee/local@2x_dark.png
new file mode 100755 (executable)
index 0000000..d067e38
Binary files /dev/null and b/platform/icons/src/javaee/local@2x_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 87c66c4..9889c0a
Binary files a/platform/icons/src/javaee/localHome.png and b/platform/icons/src/javaee/localHome.png differ
diff --git a/platform/icons/src/javaee/localHome@2x.png b/platform/icons/src/javaee/localHome@2x.png
new file mode 100755 (executable)
index 0000000..fe5706f
Binary files /dev/null and b/platform/icons/src/javaee/localHome@2x.png differ
diff --git a/platform/icons/src/javaee/localHome@2x_dark.png b/platform/icons/src/javaee/localHome@2x_dark.png
new file mode 100755 (executable)
index 0000000..44d95fe
Binary files /dev/null and b/platform/icons/src/javaee/localHome@2x_dark.png differ
diff --git a/platform/icons/src/javaee/localHome_dark.png b/platform/icons/src/javaee/localHome_dark.png
new file mode 100755 (executable)
index 0000000..684bfdf
Binary files /dev/null and b/platform/icons/src/javaee/localHome_dark.png differ
diff --git a/platform/icons/src/javaee/local_dark.png b/platform/icons/src/javaee/local_dark.png
new file mode 100755 (executable)
index 0000000..f42e1ed
Binary files /dev/null and b/platform/icons/src/javaee/local_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 37f84fc..a249445
Binary files a/platform/icons/src/javaee/messageBean.png and b/platform/icons/src/javaee/messageBean.png differ
diff --git a/platform/icons/src/javaee/messageBean@2x.png b/platform/icons/src/javaee/messageBean@2x.png
new file mode 100755 (executable)
index 0000000..b5e73fe
Binary files /dev/null and b/platform/icons/src/javaee/messageBean@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index d77b780..293f978
Binary files a/platform/icons/src/javaee/persistenceAttribute.png and b/platform/icons/src/javaee/persistenceAttribute.png differ
diff --git a/platform/icons/src/javaee/persistenceAttribute@2x.png b/platform/icons/src/javaee/persistenceAttribute@2x.png
new file mode 100755 (executable)
index 0000000..58ffb22
Binary files /dev/null and b/platform/icons/src/javaee/persistenceAttribute@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index e8ada10..03f46d9
Binary files a/platform/icons/src/javaee/persistenceEmbeddable.png and b/platform/icons/src/javaee/persistenceEmbeddable.png differ
diff --git a/platform/icons/src/javaee/persistenceEmbeddable@2x.png b/platform/icons/src/javaee/persistenceEmbeddable@2x.png
new file mode 100755 (executable)
index 0000000..0d4858b
Binary files /dev/null and b/platform/icons/src/javaee/persistenceEmbeddable@2x.png differ
diff --git a/platform/icons/src/javaee/persistenceEmbeddable@2x_dark.png b/platform/icons/src/javaee/persistenceEmbeddable@2x_dark.png
new file mode 100755 (executable)
index 0000000..85dd10a
Binary files /dev/null and b/platform/icons/src/javaee/persistenceEmbeddable@2x_dark.png differ
diff --git a/platform/icons/src/javaee/persistenceEmbeddable_dark.png b/platform/icons/src/javaee/persistenceEmbeddable_dark.png
new file mode 100755 (executable)
index 0000000..94a876d
Binary files /dev/null and b/platform/icons/src/javaee/persistenceEmbeddable_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index cf9264f..9f942f9
Binary files a/platform/icons/src/javaee/persistenceEntity.png and b/platform/icons/src/javaee/persistenceEntity.png differ
diff --git a/platform/icons/src/javaee/persistenceEntity@2x.png b/platform/icons/src/javaee/persistenceEntity@2x.png
new file mode 100755 (executable)
index 0000000..8da8fa5
Binary files /dev/null and b/platform/icons/src/javaee/persistenceEntity@2x.png differ
diff --git a/platform/icons/src/javaee/persistenceEntity@2x_dark.png b/platform/icons/src/javaee/persistenceEntity@2x_dark.png
new file mode 100755 (executable)
index 0000000..830e28e
Binary files /dev/null and b/platform/icons/src/javaee/persistenceEntity@2x_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index cee6081..f543e27
Binary files a/platform/icons/src/javaee/persistenceEntityListener.png and b/platform/icons/src/javaee/persistenceEntityListener.png differ
diff --git a/platform/icons/src/javaee/persistenceEntityListener@2x.png b/platform/icons/src/javaee/persistenceEntityListener@2x.png
new file mode 100755 (executable)
index 0000000..01837fb
Binary files /dev/null and b/platform/icons/src/javaee/persistenceEntityListener@2x.png differ
diff --git a/platform/icons/src/javaee/persistenceEntity_dark.png b/platform/icons/src/javaee/persistenceEntity_dark.png
new file mode 100755 (executable)
index 0000000..10c8b59
Binary files /dev/null and b/platform/icons/src/javaee/persistenceEntity_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index b1e9983..f4d960e
Binary files a/platform/icons/src/javaee/persistenceId.png and b/platform/icons/src/javaee/persistenceId.png differ
diff --git a/platform/icons/src/javaee/persistenceId@2x.png b/platform/icons/src/javaee/persistenceId@2x.png
new file mode 100755 (executable)
index 0000000..a19c74f
Binary files /dev/null and b/platform/icons/src/javaee/persistenceId@2x.png differ
diff --git a/platform/icons/src/javaee/persistenceId@2x_dark.png b/platform/icons/src/javaee/persistenceId@2x_dark.png
new file mode 100755 (executable)
index 0000000..21ada90
Binary files /dev/null and b/platform/icons/src/javaee/persistenceId@2x_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 8889522..565399d
Binary files a/platform/icons/src/javaee/persistenceIdRelationship.png and b/platform/icons/src/javaee/persistenceIdRelationship.png differ
diff --git a/platform/icons/src/javaee/persistenceIdRelationship@2x.png b/platform/icons/src/javaee/persistenceIdRelationship@2x.png
new file mode 100755 (executable)
index 0000000..0b37bf0
Binary files /dev/null and b/platform/icons/src/javaee/persistenceIdRelationship@2x.png differ
diff --git a/platform/icons/src/javaee/persistenceIdRelationship@2x_dark.png b/platform/icons/src/javaee/persistenceIdRelationship@2x_dark.png
new file mode 100755 (executable)
index 0000000..9dd16bd
Binary files /dev/null and b/platform/icons/src/javaee/persistenceIdRelationship@2x_dark.png differ
diff --git a/platform/icons/src/javaee/persistenceIdRelationship_dark.png b/platform/icons/src/javaee/persistenceIdRelationship_dark.png
new file mode 100755 (executable)
index 0000000..2b0a5db
Binary files /dev/null and b/platform/icons/src/javaee/persistenceIdRelationship_dark.png differ
diff --git a/platform/icons/src/javaee/persistenceId_dark.png b/platform/icons/src/javaee/persistenceId_dark.png
new file mode 100755 (executable)
index 0000000..1be9a7b
Binary files /dev/null and b/platform/icons/src/javaee/persistenceId_dark.png differ
old mode 100644 (file)
new mode 100755 (executable)
index f51d41d..c65f565
Binary files a/platform/icons/src/javaee/persistenceMappedSuperclass.png and b/platform/icons/src/javaee/persistenceMappedSuperclass.png differ
diff --git a/platform/icons/src/javaee/persistenceMappedSuperclass@2x.png b/platform/icons/src/javaee/persistenceMappedSuperclass@2x.png
new file mode 100755 (executable)
index 0000000..84231ab
Binary files /dev/null and b/platform/icons/src/javaee/persistenceMappedSuperclass@2x.png differ
old mode 100644 (file)
new mode 100755 (executable)
index 3953728..6ce6b65
Binary files a/platform/icons/src/javaee/persistenceRelationship.png and b/platform/icons/src/javaee/persistenceRelationship.png differ
diff --git a/platform/icons/src/javaee/persistenceRelationship@2x.png b/platform/icons/src/javaee/persistenceRelationship@2x.png
new file mode 100755 (executable)
index 0000000..