Merge branch 'master' into nz/shared_shelf
authorVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Tue, 14 Jul 2015 16:34:59 +0000 (18:34 +0200)
committerVladimir Krivosheev <vladimir.krivosheev@jetbrains.com>
Tue, 14 Jul 2015 16:34:59 +0000 (18:34 +0200)
# Conflicts:
# platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java

500 files changed:
.idea/modules.xml
build.xml
build/build.iml
build/gant.xml
build/groovy/ProductProperties.groovy [new file with mode: 0644]
build/order.txt
build/scripts/buildScripts.gdsl [moved from platform/platform-impl/src/com/intellij/openapi/components/ex/ComponentRegistrar.java with 73% similarity]
build/scripts/dist.gant
build/scripts/idea_properties.gant [new file with mode: 0644]
build/scripts/layouts.gant
build/scripts/libLicenses.gant
build/scripts/utils.gant
community-main.iml
community-tests/src/tests/testGroups.properties
java/compiler/impl/src/com/intellij/openapi/compiler/util/InspectionValidatorWrapper.java
java/debugger/impl/src/com/intellij/debugger/actions/ResumeThreadAction.java
java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessEvents.java
java/debugger/impl/src/com/intellij/debugger/engine/JavaStackFrame.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/FrameVariablesTree.java
java/debugger/openapi/src/com/intellij/debugger/engine/SourcePositionHighlighter.java
java/idea-ui/idea-ui.iml
java/idea-ui/src/com/intellij/openapi/components/impl/stores/IdeaProjectStoreClassProvider.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ProjectConfigurable.java
java/idea-ui/src/com/intellij/platform/templates/SaveProjectAsTemplateAction.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/GenericsHighlightUtil.java
java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightVisitorImpl.java
java/java-analysis-impl/src/com/intellij/codeInsight/intention/AddAnnotationPsiFix.java
java/java-impl/src/com/intellij/codeInsight/completion/ReferenceExpressionCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/IconLineMarkerProvider.java
java/java-impl/src/com/intellij/externalSystem/JavaProjectData.java
java/java-impl/src/com/intellij/psi/util/ProjectIconsAccessor.java [new file with mode: 0644]
java/java-psi-api/src/com/intellij/openapi/projectRoots/JavaSdkVersion.java
java/java-psi-api/src/com/intellij/pom/java/LanguageLevel.java
java/java-psi-api/src/messages/JavaCoreBundle.properties
java/java-psi-impl/src/com/intellij/lang/java/parser/JavaParserUtil.java
java/java-psi-impl/src/com/intellij/lang/java/parser/ReferenceParser.java
java/java-psi-impl/src/com/intellij/psi/impl/PsiElementFinderImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/source/PsiTypeElementImpl.java
java/java-psi-impl/src/com/intellij/psi/impl/source/tree/java/PsiLambdaExpressionImpl.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting9/ValueTypes.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ControlFlowAnalysisFailedValueCompatibilityUnchanged.java [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/references/AnyTypeArgs.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/references/AnyTypeParams.txt [moved from java/java-tests/testData/psi/parser-partial/references/AnyType.txt with 80% similarity]
java/java-tests/testSrc/com/intellij/codeInsight/GenerateGetterSetterTest.groovy
java/java-tests/testSrc/com/intellij/codeInsight/daemon/LightAdvHighlightingJdk9Test.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/NewLambdaHighlightingTest.java
java/java-tests/testSrc/com/intellij/lang/java/parser/partial/ReferenceParserTest.java
platform/analysis-api/src/com/intellij/openapi/roots/GeneratedSourcesFilter.java
platform/analysis-impl/src/com/intellij/profile/codeInspection/InspectionProfileManager.java
platform/configuration-store-impl/configuration-store-impl.iml [new file with mode: 0644]
platform/configuration-store-impl/src/SchemeManagerFactoryImpl.kt [new file with mode: 0644]
platform/configuration-store-impl/src/SchemeManagerImpl.kt [moved from platform/platform-impl/src/com/intellij/openapi/options/SchemeManagerImpl.kt with 98% similarity]
platform/configuration-store-impl/src/com/intellij/openapi/components/impl/stores/DefaultProjectStoreImpl.java [moved from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/DefaultProjectStoreImpl.java with 98% similarity]
platform/configuration-store-impl/src/com/intellij/openapi/components/impl/stores/PlatformProjectStoreClassProvider.java [moved from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/PlatformProjectStoreClassProvider.java with 86% similarity]
platform/configuration-store-impl/src/com/intellij/openapi/components/impl/stores/ProjectStateStorageManager.java [moved from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStateStorageManager.java with 100% similarity]
platform/configuration-store-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java [moved from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ProjectStoreImpl.java with 100% similarity]
platform/configuration-store-impl/testSrc/MockStreamProvider.kt [moved from platform/platform-tests/testSrc/com/intellij/options/MockStreamProvider.kt with 97% similarity]
platform/configuration-store-impl/testSrc/SchemeManagerTest.kt [moved from platform/platform-tests/testSrc/com/intellij/options/SchemeManagerTest.kt with 99% similarity]
platform/configuration-store-impl/testSrc/bundledSchemes/default.xml [moved from platform/platform-tests/testSrc/bundledSchemes/default.xml with 100% similarity]
platform/core-api/src/com/intellij/openapi/options/SchemesManagerFactory.java
platform/core-api/src/com/intellij/psi/util/PsiTreeUtil.java
platform/core-impl/core-impl.iml
platform/diff-api/src/com/intellij/diff/comparison/ComparisonManager.java
platform/diff-api/src/com/intellij/diff/fragments/LineFragment.java
platform/diff-impl/src/com/intellij/diff/comparison/ComparisonManagerImpl.java
platform/diff-impl/src/com/intellij/diff/comparison/iterables/ChangeDiffIterableBase.java
platform/diff-impl/src/com/intellij/diff/comparison/iterables/DiffIterableUtil.java
platform/diff-impl/src/com/intellij/diff/comparison/iterables/FairDiffIterable.java
platform/diff-impl/src/com/intellij/diff/tools/util/base/TextDiffViewerUtil.java
platform/diff-impl/tests/com/intellij/diff/comparison/ComparisonUtilTest.java [new file with mode: 0644]
platform/dvcs-impl/src/com/intellij/dvcs/ui/CloneDvcsDialog.java
platform/external-system-api/resources/i18n/ExternalSystemBundle.properties
platform/external-system-api/src/com/intellij/openapi/externalSystem/model/DataNode.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/model/ExternalProjectInfo.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/model/Key.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ModuleData.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/model/project/ProjectData.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/service/project/PlatformFacade.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemApiUtil.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/util/ExternalSystemConstants.java
platform/external-system-api/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewState.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/DetachExternalProjectAction.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemAction.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemNodeAction.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemOpenProjectStructureAction.java [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/ExternalSystemToggleAction.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/IgnoreExternalProjectAction.java [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/RefreshExternalProjectAction.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/task/AssignShortcutAction.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/task/ShowIgnoredAction.java [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/action/task/ToggleTaskActivationAction.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/ExternalProjectStructureCustomizer.java [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/importing/ExternalProjectStructureCustomizerImpl.java [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/model/internal/InternalExternalProjectInfo.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/PlatformFacadeImpl.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/autoimport/ExternalSystemAutoImporter.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractDependencyDataService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/AbstractProjectDataService.java [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ContentRootDataService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsDataStorage.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsManager.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalProjectsState.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalSystemKeymapExtension.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ExternalSystemTaskActivator.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDataService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/LibraryDependencyDataService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDataService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ModuleDependencyDataService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ProjectDataManager.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ProjectDataServiceEx.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/manage/ProjectDataServiceImpl.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportBuilder.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ToolWindowModuleService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ToolWindowTaskService.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/task/ui/ConfigureTasksActivationDialog.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ui/ExternalProjectStructureDialog.form [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/ui/ExternalProjectStructureDialog.java [new file with mode: 0644]
platform/external-system-impl/src/com/intellij/openapi/externalSystem/util/ExternalSystemUtil.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsStructure.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsView.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewAdapter.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalProjectsViewImpl.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ExternalSystemNode.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ModuleNode.java
platform/external-system-impl/src/com/intellij/openapi/externalSystem/view/ProjectNode.java
platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/AbstractExternalSystemTest.groovy
platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalProjectBuilder.groovy
platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/test/ExternalSystemImportingTestCase.java
platform/funcTests/config/disabled_plugins.txt
platform/lang-api/src/com/intellij/execution/configuration/RunConfigurationExtensionsManager.java
platform/lang-api/src/com/intellij/ide/util/EditSourceUtil.java
platform/lang-impl/lang-impl.iml
platform/lang-impl/src/com/intellij/application/options/colors/ColorAndFontOptions.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateSettings.java
platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileManagerImpl.java
platform/lang-impl/src/com/intellij/conversion/impl/ConversionServiceImpl.java
platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java
platform/lang-impl/src/com/intellij/ide/fileTemplates/impl/ExportableFileTemplateSettings.java
platform/lang-impl/src/com/intellij/ide/impl/convert/ProjectFileVersionImpl.java
platform/lang-impl/src/com/intellij/openapi/components/impl/stores/IModuleStore.java [moved from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IModuleStore.java with 100% similarity]
platform/lang-impl/src/com/intellij/openapi/components/impl/stores/ModuleStoreImpl.java
platform/lang-impl/src/com/intellij/openapi/components/impl/stores/PlatformLangProjectStoreClassProvider.java
platform/lang-impl/src/com/intellij/openapi/module/impl/ModuleImpl.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerComponent.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleSchemesImpl.java
platform/lang-impl/src/com/intellij/refactoring/rename/RenameDialog.java
platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java
platform/lang-impl/src/com/intellij/refactoring/rename/naming/AutomaticRenamerFactory.java
platform/lang-impl/src/com/intellij/tools/ToolManager.java
platform/platform-impl/platform-impl.iml
platform/platform-impl/src/com/intellij/externalDependencies/impl/ExternalDependenciesConfigurableProvider.java
platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java
platform/platform-impl/src/com/intellij/ide/OpenAPIAccessor.java [deleted file]
platform/platform-impl/src/com/intellij/ide/actions/ExportSettingsAction.java
platform/platform-impl/src/com/intellij/ide/actions/SaveAsDirectoryBasedFormatAction.java
platform/platform-impl/src/com/intellij/ide/impl/ProjectUtil.java
platform/platform-impl/src/com/intellij/ide/startup/impl/StartupManagerImpl.java
platform/platform-impl/src/com/intellij/ide/ui/laf/IntelliJLaf.java
platform/platform-impl/src/com/intellij/ide/ui/laf/darcula/ui/DarculaRootPaneUI.java
platform/platform-impl/src/com/intellij/notification/EventLog.java
platform/platform-impl/src/com/intellij/notification/LogModel.java
platform/platform-impl/src/com/intellij/openapi/actionSystem/ex/QuickListsManager.java
platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionButtonWithText.java
platform/platform-impl/src/com/intellij/openapi/application/JBProtocolCommand.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/openapi/application/actions.kt [moved from platform/core-impl/src/com/intellij/openapi/application/actions.kt with 100% similarity]
platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ApplicationStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/BaseFileConfigurableStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentVersionListener.java [deleted file]
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IComponentStore.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IProjectStore.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StateStorageManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/colors/impl/EditorColorsManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/TrailingSpacesStripper.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileDocumentManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/NonProjectFileWritingAccessProvider.java
platform/platform-impl/src/com/intellij/openapi/fileTypes/impl/FileTypeManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/keymap/impl/KeymapManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/options/SchemesManagerFactoryImpl.java [deleted file]
platform/platform-impl/src/com/intellij/openapi/project/impl/JBProtocolOpenProjectCommand.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java
platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectStoreClassProvider.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateChecker.java
platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/content/ToolWindowContentUi.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/welcomeScreen/FlatWelcomeFrame.java
platform/platform-impl/src/com/intellij/ui/BalloonImpl.java
platform/platform-impl/src/com/intellij/ui/KeyStrokeAdapter.java
platform/platform-impl/src/org/jetbrains/io/FileResponses.java
platform/platform-impl/src/org/jetbrains/io/Responses.java
platform/platform-resources-en/src/messages/ApplicationBundle.properties
platform/platform-resources/src/DefaultColorSchemesManager.xml
platform/platform-resources/src/META-INF/ExternalSystemExtensionPoints.xml
platform/platform-resources/src/META-INF/PlatformExtensionPoints.xml
platform/platform-resources/src/META-INF/PlatformExtensions.xml
platform/platform-resources/src/META-INF/VcsExtensions.xml
platform/platform-resources/src/idea/ExternalSystemActions.xml
platform/platform-tests/testSrc/com/intellij/openapi/components/impl/ApplicationStoreTest.kt
platform/platform-tests/testSrc/com/intellij/openapi/components/impl/ProjectStoreImplIdeaDirTest.java
platform/platform-tests/testSrc/com/intellij/openapi/components/impl/ProjectStoreImplIprFileTest.java
platform/platform-tests/testSrc/com/intellij/openapi/vfs/VfsUtilPerformanceTest.java
platform/projectModel-impl/src/com/intellij/openapi/components/PathMacroManager.java
platform/testFramework/src/com/intellij/mock/MockProjectStore.java
platform/testFramework/src/com/intellij/testFramework/LightPlatformTestCase.java
platform/testFramework/src/com/intellij/testFramework/MockSchemesManagerFactory.java
platform/testFramework/src/com/intellij/testFramework/UsefulTestCase.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
platform/util/resources/misc/registry.properties
platform/util/src/com/intellij/execution/process/ProcessAdapter.java
platform/util/src/com/intellij/openapi/application/JetBrainsProtocolHandler.java
platform/util/src/com/intellij/openapi/util/io/FileUtil.java
platform/util/src/com/intellij/openapi/util/io/NullAppendable.java [moved from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/IApplicationStore.java with 53% similarity]
platform/util/src/com/intellij/util/ObjectUtils.java
platform/util/src/com/intellij/util/containers/ContainerUtil.java
platform/util/src/com/intellij/util/io/BaseDataReader.java
platform/util/src/com/intellij/util/io/BaseOutputReader.java
platform/util/src/com/intellij/util/io/OutputReader.java
platform/vcs-api/src/com/intellij/openapi/vcs/CheckoutProviderEx.java [new file with mode: 0644]
platform/vcs-impl/src/com/intellij/openapi/vcs/OpenProjectSetProcessor.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java
platform/vcs-impl/src/com/intellij/openapi/vcs/checkin/CheckinHandlerUtil.java
platform/vcs-impl/src/com/intellij/openapi/vcs/checkout/JBProtocolCheckoutCommand.java [new file with mode: 0644]
platform/vcs-impl/src/com/intellij/openapi/vcs/impl/DefaultVcsRootPolicy.java
platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ModuleDefaultVcsRootPolicy.java
platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/resources/IOResourceInspectionBase.java
plugins/InspectionGadgets/src/inspectionDescriptions/SimplifiableIfStatement.html
plugins/coverage/coverage.iml
plugins/devkit/src/projectRoots/IdeaJdk.java
plugins/devkit/src/run/JUnitDevKitPatcher.java
plugins/editorconfig/src/org/editorconfig/plugincomponents/SettingsProviderComponent.java
plugins/generate-tostring/src/org/jetbrains/java/generate/element/GenerationHelper.java
plugins/git4idea/src/git4idea/GitVcs.java
plugins/git4idea/src/git4idea/checkout/GitCheckoutProvider.java
plugins/git4idea/src/git4idea/checkout/GitCloneDialog.java
plugins/gradle/src/org/jetbrains/plugins/gradle/integrations/javaee/JavaEEGradleProjectResolverExtension.java
plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/BaseGradleProjectResolverExtension.java
plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/GradleProjectResolver.java
plugins/gradle/src/org/jetbrains/plugins/gradle/service/project/data/ExternalProjectDataService.java
plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleDependenciesImportingTest.java
plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java
plugins/gradle/tooling-extension-impl/src/org/jetbrains/plugins/gradle/tooling/builder/ExternalProjectBuilderImpl.groovy
plugins/gradle/tooling-extension-impl/testSources/org/jetbrains/plugins/gradle/tooling/builder/AbstractModelBuilderTest.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/hg4idea/src/org/zmlx/hg4idea/action/mq/HgMqAppliedPatchAction.java
plugins/hg4idea/src/org/zmlx/hg4idea/action/mq/HgQImportFromLogAction.java
plugins/junit/src/com/intellij/execution/junit/TestDirectory.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/junit/test/com/intellij/execution/junit/JUnitTreeByDescriptionHierarchyTest.java
plugins/junit_rt/src/com/intellij/junit4/JUnit4TestListener.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/indices/MavenSearcherTest.java
plugins/settings-repository/lib/jgit-sources.jar [moved from plugins/settings-repository/lib/org.eclipse.jgit-4.0.2-SNAPSHOT-sources.jar with 74% similarity]
plugins/settings-repository/lib/jgit.jar [new file with mode: 0644]
plugins/settings-repository/lib/org.eclipse.jgit-4.0.2-SNAPSHOT.jar [deleted file]
plugins/settings-repository/settings-repository.iml
plugins/settings-repository/src/git/GitEx.kt
plugins/settings-repository/src/sync.kt
plugins/settings-repository/testSrc/LoadTest.kt
plugins/testng/src/com/theoryinpractice/testng/model/TestNGTestObject.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
plugins/testng/testSources/com/theoryinpractice/testng/configuration/DetectClassesToRunTest.java
python/edu/build/pycharm_edu_build.gant
python/edu/resources/tips/images/RunConfigFolder.png
python/edu/resources/tips/images/RunConfigFolder@2x.png
python/edu/resources/tips/images/RunConfigFolder@2x_dark.png
python/edu/resources/tips/images/RunConfigFolder_dark.png
python/edu/resources/tips/images/SpeedSearchInLiveTemplates.png
python/edu/resources/tips/images/SpeedSearchInLiveTemplates@2x.png
python/edu/resources/tips/images/SpeedSearchInLiveTemplates@2x_dark.png
python/edu/resources/tips/images/SpeedSearchInLiveTemplates_dark.png
python/edu/resources/tips/images/builtInServer.png
python/edu/resources/tips/images/builtInServer@2x.png
python/edu/resources/tips/images/buitInServer@2x_dark.png
python/edu/resources/tips/images/buitInServer_dark.png
python/edu/resources/tips/images/camel_completion.png
python/edu/resources/tips/images/camel_completion@2x.png
python/edu/resources/tips/images/camel_completion@2x_dark.png
python/edu/resources/tips/images/camel_completion_dark.png
python/edu/resources/tips/images/camel_goto.png
python/edu/resources/tips/images/camel_goto@2x.png
python/edu/resources/tips/images/camel_goto@2x_dark.png
python/edu/resources/tips/images/camel_goto_dark.png
python/edu/resources/tips/images/changeLookupSorting.png
python/edu/resources/tips/images/changeLookupSorting@2x.png
python/edu/resources/tips/images/changeLookupSorting@2x_dark.png
python/edu/resources/tips/images/changeLookupSorting_dark.png
python/edu/resources/tips/images/class_name_completion.png
python/edu/resources/tips/images/class_name_completion@2x.png
python/edu/resources/tips/images/class_name_completion@2x_dark.png
python/edu/resources/tips/images/class_name_completion_dark.png
python/edu/resources/tips/images/columnSelection.png
python/edu/resources/tips/images/columnSelection@2x.png
python/edu/resources/tips/images/columnSelection@2x_dark.png
python/edu/resources/tips/images/columnSelection_dark.png
python/edu/resources/tips/images/copy_rich_text.png
python/edu/resources/tips/images/copy_rich_text@2x.png
python/edu/resources/tips/images/copy_rich_text@2x_dark.png
python/edu/resources/tips/images/copy_rich_text_dark.png
python/edu/resources/tips/images/ctrl_shift_i.png
python/edu/resources/tips/images/ctrl_shift_i@2x.png
python/edu/resources/tips/images/ctrl_shift_i@2x_dark.png
python/edu/resources/tips/images/ctrl_shift_i_dark.png
python/edu/resources/tips/images/lens.png
python/edu/resources/tips/images/lens1.png
python/edu/resources/tips/images/lens1@2x.png
python/edu/resources/tips/images/lens1@2x_dark.png
python/edu/resources/tips/images/lens1_dark.png
python/edu/resources/tips/images/lens@2x.png
python/edu/resources/tips/images/lens@2x_dark.png
python/edu/resources/tips/images/lens_dark.png
python/edu/resources/tips/images/live_templates_1.png
python/edu/resources/tips/images/live_templates_1@2x.png
python/edu/resources/tips/images/live_templates_1@2x_dark.png
python/edu/resources/tips/images/live_templates_1_dark.png
python/edu/resources/tips/images/live_templates_2.png
python/edu/resources/tips/images/live_templates_2@2x.png
python/edu/resources/tips/images/live_templates_2@2x_dark.png
python/edu/resources/tips/images/live_templates_2_dark.png
python/edu/resources/tips/images/method_separator.png
python/edu/resources/tips/images/method_separator@2x.png
python/edu/resources/tips/images/method_separator@2x_dark.png
python/edu/resources/tips/images/method_separator_dark.png
python/edu/resources/tips/images/multicursor.png
python/edu/resources/tips/images/multicursor1.png
python/edu/resources/tips/images/multicursor1@2x_dark.png
python/edu/resources/tips/images/multicursor1_dark.png
python/edu/resources/tips/images/multicursor@2x.png
python/edu/resources/tips/images/multicursor@2x_dark.png
python/edu/resources/tips/images/multicursor_dark.png
python/edu/resources/tips/images/multiselection2.png
python/edu/resources/tips/images/multiselection2@2x.png
python/edu/resources/tips/images/multiselection2@2x_dark.png
python/edu/resources/tips/images/multiselection2_dark.png
python/edu/resources/tips/images/multiselection_column.png
python/edu/resources/tips/images/multiselection_column@2x.png
python/edu/resources/tips/images/multiselection_column@2x_dark.png
python/edu/resources/tips/images/multiselection_column_dark.png
python/edu/resources/tips/images/multiselection_words.png
python/edu/resources/tips/images/multiselection_words@2x.png
python/edu/resources/tips/images/multiselection_words@2x_dark.png
python/edu/resources/tips/images/multiselection_words_dark.png
python/edu/resources/tips/images/pyColoredFiles.png
python/edu/resources/tips/images/pyColoredFiles@2x.png
python/edu/resources/tips/images/pyColoredFiles@2x_dark.png
python/edu/resources/tips/images/pyColoredFiles_dark.png
python/edu/resources/tips/images/pyconsole.png
python/edu/resources/tips/images/pyconsole1.png
python/edu/resources/tips/images/pyconsole1@2x.png
python/edu/resources/tips/images/pyconsole1@2x_dark.png
python/edu/resources/tips/images/pyconsole1_dark.png
python/edu/resources/tips/images/pyconsole@2x.png
python/edu/resources/tips/images/pyconsole@2x_dark.png
python/edu/resources/tips/images/pyconsole_dark.png
python/edu/resources/tips/images/qdoc_live_template.png
python/edu/resources/tips/images/qdoc_live_template@2x.png
python/edu/resources/tips/images/qdoc_live_template@2x_dark.png
python/edu/resources/tips/images/qdoc_live_template_dark.png
python/edu/resources/tips/images/quick_doc_on_mouse_move.png
python/edu/resources/tips/images/quick_doc_on_mouse_move@2x.png
python/edu/resources/tips/images/quick_doc_on_mouse_move@2x_dark.png
python/edu/resources/tips/images/quick_doc_on_mouse_move_dark.png
python/edu/resources/tips/images/quick_fix_options.png
python/edu/resources/tips/images/quick_fix_options@2x.png
python/edu/resources/tips/images/quick_fix_options@2x_dark.png
python/edu/resources/tips/images/quick_fix_options_dark.png
python/edu/resources/tips/images/quick_javadoc_in_lookups.png
python/edu/resources/tips/images/quick_javadoc_in_lookups@2x.png
python/edu/resources/tips/images/quick_javadoc_in_lookups@2x_dark.png
python/edu/resources/tips/images/quick_javadoc_in_lookups_dark.png
python/edu/resources/tips/images/recent_files_1.png
python/edu/resources/tips/images/recent_files_1@2x.png
python/edu/resources/tips/images/recent_files_1@2x_dark.png
python/edu/resources/tips/images/recent_files_1_dark.png
python/edu/resources/tips/images/reopen@2x.png
python/edu/resources/tips/images/reopen@2x_dark.png
python/edu/resources/tips/images/run_inspection_by_name.png
python/edu/resources/tips/images/run_inspection_by_name@2x.png
python/edu/resources/tips/images/run_inspection_by_name@2x_dark.png
python/edu/resources/tips/images/run_inspection_by_name_dark.png
python/edu/resources/tips/images/scratches_view.png
python/edu/resources/tips/images/scratches_view@2x.png
python/edu/resources/tips/images/scratches_view@2x_dark.png
python/edu/resources/tips/images/scratches_view_dark.png
python/edu/resources/tips/images/searchEverywhere.png
python/edu/resources/tips/images/searchEverywhere@2x.png
python/edu/resources/tips/images/searchEverywhere@2x_dark.png
python/edu/resources/tips/images/searchEverywhere_dark.png
python/edu/resources/tips/images/select_in.png
python/edu/resources/tips/images/select_in@2x.png
python/edu/resources/tips/images/select_in@2x_dark.png
python/edu/resources/tips/images/select_in_dark.png
python/edu/resources/tips/images/speed_search.png
python/edu/resources/tips/images/speed_search@2x.png
python/edu/resources/tips/images/speed_search@2x_dark.png
python/edu/resources/tips/images/speed_search_dark.png
python/edu/resources/tips/images/switcher.png
python/edu/resources/tips/images/switcher@2x.png
python/edu/resources/tips/images/switcher@2x_dark.png
python/edu/resources/tips/images/switcher_dark.png
python/edu/src/META-INF/PyCharmEduPlugin.xml
python/educational/course-creator/src/com/jetbrains/edu/coursecreator/actions/CCFromCourseArchive.java
python/educational/course-creator/src/com/jetbrains/edu/coursecreator/actions/oldCourseFormat/OldCourse.java [new file with mode: 0644]
python/educational/course-creator/src/com/jetbrains/edu/coursecreator/actions/oldCourseFormat/OldLesson.java [new file with mode: 0644]
python/educational/course-creator/src/com/jetbrains/edu/coursecreator/actions/oldCourseFormat/OldLessonInfo.java [new file with mode: 0644]
python/educational/course-creator/src/com/jetbrains/edu/coursecreator/actions/oldCourseFormat/OldTask.java [new file with mode: 0644]
python/educational/course-creator/src/com/jetbrains/edu/coursecreator/actions/oldCourseFormat/OldTaskFile.java [new file with mode: 0644]
python/educational/course-creator/src/com/jetbrains/edu/coursecreator/actions/oldCourseFormat/OldTaskWindow.java [new file with mode: 0644]
python/educational/interactive-learning/src/com/jetbrains/edu/learning/StudyUtils.java
python/educational/interactive-learning/src/com/jetbrains/edu/learning/courseGeneration/StudyProjectGenerator.java
python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.form
python/educational/interactive-learning/src/com/jetbrains/edu/learning/ui/StudyNewProjectPanel.java
python/educational/src/com/jetbrains/edu/stepic/CourseInfo.java
python/helpers/pydev/pydevd_resolver.py
python/helpers/pydev/pydevd_xml.py
python/ide/src/com/jetbrains/python/configuration/PyActiveSdkConfigurable.java
python/psi-api/src/com/jetbrains/python/psi/PyFile.java
python/psi-api/src/com/jetbrains/python/psi/PyFromImportStatement.java
python/src/com/jetbrains/python/PyBundle.properties
python/src/com/jetbrains/python/codeInsight/imports/AutoImportQuickFix.java
python/src/com/jetbrains/python/codeInsight/imports/PythonReferenceImporter.java
python/src/com/jetbrains/python/inspections/quickfix/PyAddImportFix.java
python/src/com/jetbrains/python/psi/PyUtil.java
python/src/com/jetbrains/python/psi/impl/PyFileImpl.java
python/src/com/jetbrains/python/psi/impl/PyFromImportStatementImpl.java
python/src/com/jetbrains/python/psi/impl/PythonLanguageLevelPusher.java
python/testData/addImport/localImportQuickFixAvailable.py [new file with mode: 0644]
python/testSrc/com/jetbrains/python/PyAddImportTest.java
resources-en/src/tips/images/closing_tags.png
resources-en/src/tips/images/closing_tags@2x.png
resources-en/src/tips/images/closing_tags@2x_dark.png
resources-en/src/tips/images/closing_tags_dark.png
resources-en/src/tips/images/copy_rich_text.png
resources-en/src/tips/images/copy_rich_text@2x.png
resources-en/src/tips/images/copy_rich_text@2x_dark.png
resources-en/src/tips/images/copy_rich_text_dark.png
resources-en/src/tips/images/emmet.png
resources-en/src/tips/images/emmet@2x.png
resources-en/src/tips/images/extract_variable_incomplete.png
resources-en/src/tips/images/extract_variable_incomplete@2x.png
resources-en/src/tips/images/extract_variable_incomplete@2x_dark.png
resources-en/src/tips/images/extract_variable_incomplete_dark.png
resources-en/src/tips/images/lens.png
resources-en/src/tips/images/lens1.png
resources-en/src/tips/images/lens1@2x.png
resources-en/src/tips/images/lens1@2x_dark.png
resources-en/src/tips/images/lens1_dark.png
resources-en/src/tips/images/lens@2x.png
resources-en/src/tips/images/lens@2x_dark.png
resources-en/src/tips/images/lens_dark.png
resources-en/src/tips/images/multiselection2.png
resources-en/src/tips/images/multiselection2@2x.png
resources-en/src/tips/images/multiselection2@2x_dark.png
resources-en/src/tips/images/multiselection2_dark.png
resources-en/src/tips/images/multiselection_column.png
resources-en/src/tips/images/multiselection_column@2x.png
resources-en/src/tips/images/multiselection_column@2x_dark.png
resources-en/src/tips/images/multiselection_column_dark.png
resources-en/src/tips/images/multiselection_words.png
resources-en/src/tips/images/multiselection_words@2x.png
resources-en/src/tips/images/multiselection_words@2x_dark.png
resources-en/src/tips/images/multiselection_words_dark.png
resources-en/src/tips/images/quick_doc_on_mouse_move.png
resources-en/src/tips/images/quick_doc_on_mouse_move@2x.png
resources-en/src/tips/images/quick_doc_on_mouse_move@2x_dark.png
resources-en/src/tips/images/quick_doc_on_mouse_move_dark.png
resources-en/src/tips/images/quickdoc.png
resources-en/src/tips/images/quickdoc@2x.png
resources-en/src/tips/images/quickdoc@2x_dark.png
resources-en/src/tips/images/quickdoc_dark.png
resources-en/src/tips/images/scratches_view.png
resources-en/src/tips/images/scratches_view@2x.png
resources-en/src/tips/images/scratches_view@2x_dark.png
resources-en/src/tips/images/scratches_view_dark.png
resources/src/META-INF/IdeaPlugin.xml
xml/impl/src/com/intellij/codeInsight/editorActions/XmlAutoPopupHandler.java
xml/impl/src/com/intellij/codeInsight/editorActions/XmlEqTypedHandler.java
xml/impl/src/com/intellij/codeInsight/editorActions/XmlGtTypedHandler.java
xml/impl/src/com/intellij/codeInsight/editorActions/XmlSlashTypedHandler.java

index 608f45776b351a79bf2cc130ec47fa25de2baac9..f44ef2057e15e25a50ee03887173faae12e581f7 100644 (file)
@@ -42,6 +42,7 @@
       <module fileurl="file://$PROJECT_DIR$/community-tests/community-tests.iml" filepath="$PROJECT_DIR$/community-tests/community-tests.iml" />
       <module fileurl="file://$PROJECT_DIR$/java/compiler/impl/compiler-impl.iml" filepath="$PROJECT_DIR$/java/compiler/impl/compiler-impl.iml" group="java/compiler" />
       <module fileurl="file://$PROJECT_DIR$/java/compiler/openapi/compiler-openapi.iml" filepath="$PROJECT_DIR$/java/compiler/openapi/compiler-openapi.iml" group="java/compiler" />
+      <module fileurl="file://$PROJECT_DIR$/platform/configuration-store-impl/configuration-store-impl.iml" filepath="$PROJECT_DIR$/platform/configuration-store-impl/configuration-store-impl.iml" />
       <module fileurl="file://$PROJECT_DIR$/plugins/copyright/copyright.iml" filepath="$PROJECT_DIR$/plugins/copyright/copyright.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/platform/core-api/core-api.iml" filepath="$PROJECT_DIR$/platform/core-api/core-api.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/core-impl/core-impl.iml" filepath="$PROJECT_DIR$/platform/core-impl/core-impl.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/script-debugger/debugger-ui/script-debugger-ui.iml" filepath="$PROJECT_DIR$/platform/script-debugger/debugger-ui/script-debugger-ui.iml" group="platform/script-debugger" />
       <module fileurl="file://$PROJECT_DIR$/android/tools-base/sdk-common/sdk-common.iml" filepath="$PROJECT_DIR$/android/tools-base/sdk-common/sdk-common.iml" group="android/sdktools" />
       <module fileurl="file://$PROJECT_DIR$/android/tools-base/sdklib/sdklib.iml" filepath="$PROJECT_DIR$/android/tools-base/sdklib/sdklib.iml" group="android/sdktools" />
+      <module fileurl="file://$PROJECT_DIR$/plugins/settings-repository/settings-repository.iml" filepath="$PROJECT_DIR$/plugins/settings-repository/settings-repository.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/smRunner/smRunner.iml" filepath="$PROJECT_DIR$/platform/smRunner/smRunner.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/plugins/cvs/smartcvs-src/smartcvs-src.iml" filepath="$PROJECT_DIR$/plugins/cvs/smartcvs-src/smartcvs-src.iml" group="plugins/VCS/cvs" />
       <module fileurl="file://$PROJECT_DIR$/spellchecker/spellchecker.iml" filepath="$PROJECT_DIR$/spellchecker/spellchecker.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/ui-designer.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" filepath="$PROJECT_DIR$/plugins/ui-designer-core/ui-designer-core.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ui-designer/jps-plugin/ui-designer-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/ui-designer/jps-plugin/ui-designer-jps-plugin.iml" group="plugins" />
+      <module fileurl="file://$PROJECT_DIR$/updater/updater.iml" filepath="$PROJECT_DIR$/updater/updater.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/usageView/usageView.iml" filepath="$PROJECT_DIR$/platform/usageView/usageView.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/util/util.iml" filepath="$PROJECT_DIR$/platform/util/util.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/util-rt/util-rt.iml" filepath="$PROJECT_DIR$/platform/util-rt/util-rt.iml" group="platform" />
index d4cd47e2fe3aea238b216c525dbe8d42896ea29f..ab62c1eb19321ee5dcdd95f26e3e2e030140aa76 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,7 +1,31 @@
+<!--
+ This build script compiles IntelliJ IDEA. Options include:
+    -Dout=/path/to/out/dir, defaults to ${basedir}/out
+    -Dbuild=123, defaults to SNAPSHOT
+    -Dtestpatterns=com.foo.*, defaults to empty string
+    -Dproduct=foo, defaults to idea
+ -->
 <project name="IntelliJ IDEA Community Edition" default="all">
   <property name="project.home" value="${basedir}"/>
-  <property name="out.dir" value="${project.home}/out"/>
-  <property name="tmp.dir" value="${project.home}/out/tmp"/>
+
+  <condition property="out.dir" value="${out}" else="${project.home}/out">
+    <isset property="out" />
+  </condition>
+
+  <condition property="build.number" value="${build}" else="SNAPSHOT">
+    <isset property="build" />
+  </condition>
+
+  <condition property="test.patterns" value="${testpatterns}"
+             else="org.jetbrains.android.*;com.android.tools.idea.*;com.google.gct.*;com.intellij.android.*">
+    <isset property="testpatterns" />
+  </condition>
+
+  <condition property="product.name" value="${product}" else="idea">
+    <isset property="product" />
+  </condition>
+
+  <property name="tmp.dir" value="${out.dir}/tmp"/>
 
   <target name="cleanup">
     <delete dir="${out.dir}" failonerror="false"/>
     <sequential>
       <java failonerror="true" jar="${project.home}/lib/ant/lib/ant-launcher.jar" fork="true">
         <jvmarg line="-Xmx612m -XX:MaxPermSize=152m"/>
+        <jvmarg value="-Djna.nosys=true" />
+        <jvmarg value="-Dout=${out.dir}" />
+        <jvmarg value="-DbuildNumber=${build.number}" />
+        <jvmarg value="-Didea.test.patterns=${test.patterns}" />
+        <jvmarg value="-Dproduct=${product.name}" />
         <sysproperty key="java.awt.headless" value="true"/>
         <arg line="&quot;-Dgant.script=@{script}&quot;"/>
         <arg line="&quot;-Dteamcity.build.tempDir=${tmp.dir}&quot;"/>
     <call_gant script="${project.home}/build/scripts/tests.gant"/>
   </target>
 
+  <!-- The build task creates an updater.jar in ${out.dir}. This task bundles the updater and its dependencies into a single jar -->
+  <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${project.home}/build/lib/jarjar-1.0.jar"/>
+  <target name="fullupdater" depends="build">
+    <jarjar jarfile="${out.dir}/updater-full.jar">
+      <zipfileset src="${out.dir}/updater.jar" />
+      <zipfileset src="lib/log4j.jar" />
+      <zipfileset src="lib/jna.jar" />
+      <zipfileset src="lib/jna-utils.jar" />
+    </jarjar>
+  </target>
+
   <target name="all" depends="cleanup,build"/>
 </project>
index 6b8f9e05f014428bab472268575dce4dc9e5175f..cf1c56ee4aad3f964d6a38ca72f0ce470e374356 100644 (file)
@@ -5,6 +5,7 @@
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/scripts" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/groovy" type="java-resource" />
       <excludeFolder url="file://$MODULE_DIR$/jdk" />
       <excludeFolder url="file://$MODULE_DIR$/restApiDocGenerator/node_modules" />
     </content>
index 8a7460997353cbc52e089af0364bd5c13e004979..945df255838692b6cc8df3f511b7d4a7d531d151 100644 (file)
@@ -17,6 +17,7 @@
     <fileset dir="${project.home}/build/lib/jps">
       <include name="*.jar"/>
     </fileset>
+    <pathelement path="${project.home}/build/groovy"/>
     <fileset file="${project.home}/jps/lib/optimizedFileManager.jar"/>
     <fileset dir="${project.home}/build/kotlinc/jps" erroronmissingdir="false">
       <include name="*.jar"/>
diff --git a/build/groovy/ProductProperties.groovy b/build/groovy/ProductProperties.groovy
new file mode 100644 (file)
index 0000000..8370618
--- /dev/null
@@ -0,0 +1,73 @@
+
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * @author nik
+ */
+public abstract class ProductProperties {
+  String prefix
+  String code
+  String appInfoModule
+  String appInfoModulePath
+
+  abstract def String appInfoFile()
+
+  /**
+   * @return build number with produce code (e.g. IC-142.239 for IDEA Community)
+   */
+  abstract def String fullBuildNumber()
+
+  abstract def String systemSelector()
+
+  String exe_selector = null
+  String exe_launcher_properties
+  String exe64_launcher_properties
+  String platformPrefix = null
+  String bundleIdentifier
+
+  abstract def String macAppRoot()
+
+  abstract def String winAppRoot()
+
+  abstract def String linuxAppRoot()
+
+  abstract def String archiveName()
+
+  String ideJvmArgs = null
+  boolean maySkipAndroidPlugin
+  String relativeAndroidHome
+  String relativeAndroidToolsBaseHome
+
+  boolean includeYourkitAgentInEAP = false
+  boolean includeBatchLauncher = true
+  boolean buildUpdater = false
+  List<String> excludedPlugins = []
+  List<String> extraMacBins = []
+  List<String> extraLinuxBins = []
+
+  def customLayout(targetDirectory) {}
+
+  def customWinLayout(targetDirectory) {}
+
+  def customLinLayout(targetDirectory) {}
+
+  def customMacLayout(targetDirectory) {}
+
+  String icon128
+  String ico
+  String icns
+}
index 1a086d24dbf521a26e8cbdb411992f4770538e8b..945bfd8f2b83921dd22f0a6567e73a11dc0a59f0 100644 (file)
@@ -1164,7 +1164,6 @@ com/intellij/ide/ui/LafManagerImpl$1.class:/lib/idea.jar
 com/intellij/ide/ui/LafManagerImpl$2.class:/lib/idea.jar
 com/intellij/diagnostic/PerformanceWatcher.class:/lib/idea.jar
 com/intellij/openapi/options/SchemesManagerFactory.class:/lib/openapi.jar
-com/intellij/openapi/options/SchemesManagerFactoryImpl.class:/lib/idea.jar
 com/intellij/openapi/components/SettingsSavingComponent.class:/lib/openapi.jar
 com/intellij/openapi/options/SchemesManager.class:/lib/openapi.jar
 com/intellij/ide/XmlRpcServer.class:/lib/openapi.jar
similarity index 73%
rename from platform/platform-impl/src/com/intellij/openapi/components/ex/ComponentRegistrar.java
rename to build/scripts/buildScripts.gdsl
index beea0ed63a2c0a6fe295a6c08729d6ef006adcd6..a8d3dbf57a2f3cabe0b8f6d08b3e166314a24a34 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.intellij.openapi.components.ex;
-
 
 /**
- * @author mike
+ * @author nik
  */
-public interface ComponentRegistrar {
-  void registerComponents(ComponentManagerEx manager);
-}
+def ctx = context(scope: scriptScope(), filetypes: ["gant"])
+
+contributor([ctx], {
+  property name: "productProperties", type: "ProductProperties"
+})
index dfe40cd923820f72258d950e3f79ed6570b6380b..549e21090bda41e931521e4fd78845ebcc3e0a05 100644 (file)
@@ -16,6 +16,7 @@
 
 
 import com.intellij.openapi.util.text.StringUtil
+import org.apache.tools.ant.BuildException
 import org.jetbrains.jps.gant.LayoutInfo
 
 import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
@@ -24,6 +25,11 @@ includeTargets << new File("${guessHome(this)}/build/scripts/utils.gant")
 
 requireProperty("out", "$home/out")
 
+// "out" has to be canonical, otherwise the ant build fails
+// with mysterious errors
+out = new File(out).getCanonicalPath()
+setProperty("out", out)
+
 class Paths {
   final sandbox
   final distWin
@@ -52,14 +58,23 @@ class Paths {
 
 def paths = new Paths(out)
 setProperty("paths", paths)
+loadProductProperties(home, snapshot)
 
-setProperty("maySkipAndroidPlugin", true)
+def loadProductProperties(String home, String buildNumber) {
+  requireProperty("product", "idea")
+  def productPropertiesPath = "$home/build/scripts/" + p("product") + "_properties.gant"
+  if (!new File(productPropertiesPath).exists()) {
+    throw new BuildException("No product specific properties file found at: " + productPropertiesPath)
+  }
+  setProperty("productProperties", includeFile(productPropertiesPath).getProperties(home, buildNumber))
+}
 
 target(compile: "Compile project") {
-  loadProject()
   projectBuilder.stage("Cleaning up sandbox folder")
   forceDelete(paths.sandbox)
 
+  loadProject()
+
   [paths.sandbox, paths.distWin, paths.distAll, paths.distUnix, paths.distMac, paths.artifacts, paths.artifacts_core, paths.artifacts_jps].each {
     ant.mkdir(dir: it)
   }
@@ -72,7 +87,7 @@ target(compile: "Compile project") {
 }
 
 private String appInfoFile() {
-  return "${projectBuilder.moduleOutput(findModule("community-resources"))}/idea/IdeaApplicationInfo.xml"
+  return productProperties.appInfoFile()
 }
 
 target('default': 'The default target') {
@@ -85,12 +100,20 @@ target('default': 'The default target') {
 
   indexSearchableOptions()
 
-  layoutAll([buildNumber: "IC-$snapshot",
-             system_selector: "IdeaIC${p("component.version.major")}",
+  layoutAll([buildNumber: productProperties.fullBuildNumber(),
+             system_selector: productProperties.systemSelector(),
+             platform_prefix: productProperties.platformPrefix,
+             ide_jvm_args: productProperties.ideJvmArgs,
              tools_jar: true],
             home, null, paths, true)
-  String macZip = "$paths.artifacts/ideaIC-${snapshot}.mac.zip"
+  String archiveName = productProperties.archiveName()
+  String macZip = "$paths.artifacts/${archiveName}.mac.zip"
   notifyArtifactBuilt(macZip)
+
+  if (productProperties.buildUpdater) {
+    // Generate updater.jar from the updater module (patch updater)
+    layoutUpdater(out)
+  }
 }
 
 target('build-dist-jars' : 'Target to build jars from locally compiled classes') {
@@ -101,11 +124,14 @@ target('build-dist-jars' : 'Target to build jars from locally compiled classes')
 
   indexSearchableOptions()
 
-  layoutAll([buildNumber: "IC-$snapshot",
-             system_selector: "IdeaIC${p("component.version.major")}",
+  layoutAll([buildNumber: productProperties.fullBuildNumber(),
+             system_selector: productProperties.systemSelector(),
+             platform_prefix: productProperties.platformPrefix,
+             ide_jvm_args: productProperties.ideJvmArgs,
              tools_jar: true],
              home, null, paths)
-  String macZip = "$paths.artifacts/ideaIC-${snapshot}.mac.zip"
+  String macZipPrefix = productProperties.prefix + productProperties.fullBuildNumber()
+  String macZip = "$paths.artifacts/${macZipPrefix}.mac.zip"
   notifyArtifactBuilt(macZip)
 }
 
@@ -158,21 +184,24 @@ def layoutAll(Map args, String home, String out, Paths _paths = null, buildJps =
   layoutWin(args, home, paths)
   layoutMac(args, home, paths)
   layoutUnix(args, home, paths)
+
+  def macAppRoot = productProperties.macAppRoot()
+  def winAppRoot = productProperties.winAppRoot()
+  def linuxAppRoot = productProperties.linuxAppRoot()
+  def archiveName = productProperties.archiveName()
+
   List pathsDist = new File("${paths.sandbox}/bundled.win.jdk/jre").exists() ? [paths.distAll, paths.distWin, "${paths.sandbox}/bundled.win.jdk"] : [paths.distAll, paths.distWin]
-  buildWinZip("$paths.artifacts/idea${args.buildNumber}.win.zip", pathsDist)
+  buildWinZip("$paths.artifacts/${archiveName}.win.zip", pathsDist, winAppRoot)
+
   buildCrossPlatformZip("$paths.artifacts/idea${args.buildNumber}.zip", "${paths.sandbox}/sandbox-ce", [paths.distAll],
                         paths.distWin, paths.distUnix, paths.distMac)
 
-  def macAppRoot = isEap() ?
-                   "IntelliJ IDEA ${p("component.version.major")} CE EAP.app/Contents" :
-                   "IntelliJ IDEA ${p("component.version.major")} CE.app/Contents"
+  String macZip = "$paths.artifacts/${archiveName}.mac.zip"
+  buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac, productProperties.extraMacBins)
 
-  String macZip = "$paths.artifacts/idea${args.buildNumber}.mac.zip"
-  buildMacZip(macAppRoot, macZip, [paths.distAll], paths.distMac)
-
-  buildTarGz("idea-${args.buildNumber}", "$paths.artifacts/idea${args.buildNumber}.tar", [paths.distAll, paths.distUnix])
+  buildTarGz(linuxAppRoot, "$paths.artifacts/${archiveName}.tar", [paths.distAll, paths.distUnix], productProperties.extraLinuxBins)
   if (p("jdk.bundled.linux") != "false") {
-    buildTarGz("idea-${args.buildNumber}", "$paths.artifacts/idea${args.buildNumber}-jdk-bundled.tar", [paths.distAll, paths.distUnix, "${paths.sandbox}/bundled.linux.jdk"], ["jre/jre/bin/*"])
+    buildTarGz(linuxAppRoot, "$paths.artifacts/${archiveName}-jdk-bundled.tar", [paths.distAll, paths.distUnix, "${paths.sandbox}/bundled.linux.jdk"], ["jre/jre/bin/*"] + productProperties.extraLinuxBins)
   }
   return info
 }
@@ -186,22 +215,32 @@ private layoutWin(Map args, String home, Paths paths) {
     }
   }
 
-  ant.copy(file: "$home/platform/icons/src/idea_CE.ico", tofile: "$target/bin/idea.ico")
+  def name = productProperties.prefix
+  def ico = productProperties.ico
+
+  ant.copy(file: ico, tofile: "$target/bin/${name}.ico")
+
+  if (productProperties.includeBatchLauncher) {
+    winScripts(target, home, "${name}.bat", args)
+  }
+  winVMOptions(target, productProperties.includeYourkitAgentInEAP ? args.system_selector : null, "${name}.exe", "${name}64.exe")
+  def appInfoModulePath = productProperties.appInfoModulePath
+
+  List resourcePaths = ["$home/${appInfoModulePath}/src", "$home/platform/icons/src"]
+  buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher.exe", "$target/bin/${name}.exe", appInfoFile(),
+                   productProperties.exe_launcher_properties, productProperties.exe_selector, resourcePaths)
+  buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher64.exe", "$target/bin/${name}64.exe", appInfoFile(),
+                   productProperties.exe64_launcher_properties, productProperties.exe_selector, resourcePaths)
 
-  winScripts(target, home, "idea.bat", args)
-  winVMOptions(target, null, "idea.exe", "idea64.exe")
-  List resourcePaths = ["$home/community-resources/src", "$home/platform/icons/src"]
-  buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher.exe", "$target/bin/idea.exe", appInfoFile(),
-                   "$home/build/conf/ideaCE-launcher.properties", args.ce_exe_selector, resourcePaths)
-  buildWinLauncher(home, "$home/bin/WinLauncher/WinLauncher64.exe", "$target/bin/idea64.exe", appInfoFile(),
-                   "$home/build/conf/ideaCE64-launcher.properties", args.ce_exe_selector, resourcePaths)
+  productProperties.customWinLayout(target)
 }
 
 private layoutMac(Map _args, String home, Paths paths) {
   String target = paths.distMac
+  def prefix = productProperties.prefix
 
   Map args = new HashMap(_args)
-  args.bundleIdentifier = "com.jetbrains.intellij.ce"
+  args.bundleIdentifier = productProperties.bundleIdentifier
   args.doc_types = """
       <dict>
         <key>CFBundleTypeExtensions</key>
@@ -209,7 +248,7 @@ private layoutMac(Map _args, String home, Paths paths) {
           <string>ipr</string>
         </array>
         <key>CFBundleTypeIconFile</key>
-        <string>idea.icns</string>
+        <string>${prefix}.icns</string>
         <key>CFBundleTypeName</key>
         <string>IntelliJ IDEA Project File</string>
         <key>CFBundleTypeRole</key>
@@ -219,8 +258,10 @@ private layoutMac(Map _args, String home, Paths paths) {
   args."idea.properties.path" = "${paths.distAll}/bin/idea.properties"
   args.urlSchemes = ["idea"]
   args.mac_no_yjp = true
-  args.executable = "idea"
+  args.executable = prefix
+  args.icns = productProperties.icns
   layoutMacApp(target, home, args)
+  productProperties.customMacLayout(target)
 }
 
 private layoutUnix(Map args, String home, Paths paths) {
@@ -232,9 +273,13 @@ private layoutUnix(Map args, String home, Paths paths) {
     }
   }
 
-  ant.copy(file: "$home/platform/icons/src/icon_CE_128.png", tofile: "$target/bin/idea.png")
+  def name = productProperties.prefix
+  def icon128 = productProperties.icon128
+
+  ant.copy(file: icon128, tofile: "$target/bin/${name}.png")
 
-  unixScripts(target, home, "idea.sh", args)
-  unixVMOptions(target, "idea")
+  unixScripts(target, home, "${name}.sh", args)
+  unixVMOptions(target, "${name}")
   unixReadme(target, home, args)
+  productProperties.customLinLayout(target)
 }
diff --git a/build/scripts/idea_properties.gant b/build/scripts/idea_properties.gant
new file mode 100644 (file)
index 0000000..76d3760
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2015 The Android Open Source Project
+ *
+ * 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.
+ */
+
+
+def getProperties(String home, String buildNumber) {
+  return new ProductProperties() {
+    {
+      prefix = "idea"
+      code = "IC"
+      appInfoModule = "community-resources"
+      appInfoModulePath = "community-resources"
+      exe_launcher_properties = "$home/build/conf/ideaCE-launcher.properties"
+      exe64_launcher_properties = "$home/build/conf/ideaCE64-launcher.properties"
+      bundleIdentifier = "com.jetbrains.intellij.ce"
+      maySkipAndroidPlugin = true
+      relativeAndroidHome = "android"
+      relativeAndroidToolsBaseHome = "android/tools-base"
+
+      icon128 = "$home/platform/icons/src/icon_CE_128.png"
+      ico = "$home/platform/icons/src/idea_CE.ico"
+    }
+
+    def String appInfoFile() {
+      "${projectBuilder.moduleOutput(findModule("community-resources"))}/idea/IdeaApplicationInfo.xml"
+    }
+
+    def String fullBuildNumber() { "IC-$buildNumber" }
+
+    def String systemSelector() { "IdeaIC${p("component.version.major")}" }
+
+    def String macAppRoot() {
+      isEap() ? "IntelliJ IDEA ${p("component.version.major")} CE EAP.app/Contents"
+              : "IntelliJ IDEA ${p("component.version.major")} CE.app/Contents"
+    }
+
+    def String winAppRoot() { "" }
+
+    def String linuxAppRoot() { "idea-IC-$buildNumber" }
+
+    def String archiveName() { "ideaIC-$buildNumber" }
+  }
+}
\ No newline at end of file
index 03e5dac6dc457b8ba4b5c306f4a1862650c2de40..9b0ea0d50e2ba8ef3daa03840ed80931d37db525 100644 (file)
@@ -27,7 +27,38 @@ target('default': "Developers update") {
 }
 
 String appInfoFileName() {
-  return "idea/IdeaApplicationInfo.xml"
+  return isDefined("productProperties") ? productProperties.appInfoFile() : "idea/IdeaApplicationInfo.xml"
+}
+
+boolean maySkipAndroidPlugin() {
+  return isDefined("productProperties") && productProperties.maySkipAndroidPlugin
+}
+
+
+String appInfoModule() {
+  return isDefined("productProperties") ? productProperties.appInfoModule : "community-resources"
+}
+
+String productCode() {
+  return isDefined("productProperties") ? productProperties.code : "IC"
+}
+
+void customLayout(String targetDirectory) {
+  if (isDefined("productProperties")) {
+    productProperties.customLayout(targetDirectory)
+  }
+}
+
+String relativeAndroidHome() {
+  return isDefined("productProperties") ? productProperties.relativeAndroidHome : "android"
+}
+
+String relativeAndroidToolsBaseHome() {
+  return isDefined("productProperties") ? productProperties.relativeAndroidToolsBaseHome : relativeAndroidHome() + "/tools-base"
+}
+
+List<String> getExcludedPlugins() {
+  return isDefined("productProperties") ? productProperties.excludedPlugins : []
 }
 
 String patchAppDescriptor(String targetDirectory) {
@@ -36,12 +67,13 @@ String patchAppDescriptor(String targetDirectory) {
   ant.delete(dir: patchedDirectory)
 
   layout(patchedDirectory) {
-    module("community-resources") {
+    module(appInfoModule()) {
       include(name: appInfoFileName())
     }
   }
 
-  ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_NUMBER__", value: "IC-$snapshot")
+  def code = productCode()
+  ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_NUMBER__", value: "${code}-$snapshot")
   ant.replace(file: "$patchedDirectory/${appInfoFileName()}", token: "__BUILD_DATE__", value: new Date().format("yyyyMMddHHmm"))
 
   return patchedDirectory
@@ -88,7 +120,7 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
     "testFramework",
     "tests_bootstrap",
     "typeMigration",
-    "ui-designer-core"
+    "ui-designer-core",
   ].flatten()
   implementationModules.removeAll(jpsCommonModules) //todo[nik] remove jps modules from platformImplementationModules instead and update layouts of minor IDEs accordingly
 
@@ -158,9 +190,22 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
         module("colorSchemes")
         module("resources")
         module("platform-resources")
-        module("community-resources") {
-          if (patchedDescriptorDir != null) {
-            exclude(name: appInfoFileName())
+
+        def appInfoModule = appInfoModule()
+        def appInfoInCommunity = "community-resources".equals(appInfoModule)
+
+        if (appInfoInCommunity) {
+          module("community-resources") {
+            if (patchedDescriptorDir != null) {
+              exclude(name: appInfoFileName())
+            }
+          }
+        } else {
+          module("community-resources")
+          module(appInfoModule) {
+            if (patchedDescriptorDir != null) {
+              exclude(name: appInfoFileName())
+            }
           }
         }
         if (patchedDescriptorDir != null) {
@@ -229,7 +274,7 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
       }
     }
 
-    layoutCommunityPlugins(home)
+    layoutCommunityPlugins(home, maySkipAndroidPlugin())
 
     dir("plugins") {
       dir("javaFX") {
@@ -267,18 +312,29 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
     }
   }
 
+  // product specific custom layout
+  customLayout(targetDirectory)
+
   printUnusedModules(info.usedModules)
 
   reorder(home, targetDirectory)
   return info
 }
 
-public def layoutCommunityPlugins(String home) {
-  if (!isDefined("maySkipAndroidPlugin") || new File("$home/android").exists()) {
-    layoutAndroid("$home/android")
+public def layoutCommunityPlugins(String home, boolean maySkipAndroidPlugin = false) {
+  def androidHome = relativeAndroidHome()
+  def androidToolsBaseHome = relativeAndroidToolsBaseHome()
+  if (new File("$home/$androidHome").exists()) {
+    layoutAndroid("$home/$androidHome", "$home/$androidToolsBaseHome")
   }
   else {
-    projectBuilder.warning("Android plugin sources aren't found at $home/android. Android plugin is excluded from layout.")
+    def message = "Android plugin sources aren't found at ${androidHome}"
+    if (maySkipAndroidPlugin) {
+      projectBuilder.warning("$message. Android plugin is excluded from layout.")
+    }
+    else {
+      projectBuilder.error(message)
+    }
   }
 
   dir("plugins") {
@@ -601,6 +657,10 @@ public def layoutCommunityPlugins(String home) {
     pluginDir("Kotlin") {
       fileset(dir: "${home}/build/kotlinc/plugin/Kotlin")
     }
+
+    layoutPlugin("settings-repository") {
+      fileset(dir: "$home/plugins/settings-repository/lib", excludes: "**/*-sources.jar,**/*.xml,**/com/**,**/org/**,**/java/**")
+    }
   }
 }
 
@@ -630,6 +690,11 @@ def layoutPlugin(String pluginName, String moduleName, String jarName, Closure c
     if (!pluginFilter.contains(moduleName) && !pluginFilter.contains(pluginName)) return
   }
 
+  def excludedPlugins = getExcludedPlugins()
+  if (excludedPlugins.contains(moduleName) || excludedPlugins.contains(pluginName)) {
+    return
+  }
+
   dir(pluginName) {
     dir("lib") {
       jar("${jarName}.jar") {
@@ -647,6 +712,11 @@ def pluginDir(String dirName, Closure initializer) {
     if (!pluginFilter.contains(dirName)) return
   }
 
+  def excludedPlugins = getExcludedPlugins()
+  if (excludedPlugins.contains(dirName)) {
+    return
+  }
+
   dir(dirName) {
     initializer()
   }
@@ -707,7 +777,7 @@ def reorder(String home, String targetDirectory) {
   }
 }
 
-def layoutAndroid(String androidHome) {
+def layoutAndroid(String androidHome, String androidToolsBaseHome) {
   dir("plugins") {
     layoutPlugin("android") {
       fileset(dir: "${androidHome}/android/lib") {
@@ -763,7 +833,7 @@ def layoutAndroid(String androidHome) {
         jar("android-jps-plugin.jar") { module("android-jps-plugin") }
       }
       dir("templates") {
-        fileset(dir: "$androidHome/tools-base/templates")
+        fileset(dir: "$androidToolsBaseHome/templates")
       }
     }
   }
index e301961d88040051d3990324aa2a0ed4383093e0..9a4c8168b1a997e02f55a28a0decb7faffbab32c 100644 (file)
@@ -289,6 +289,8 @@ libraryLicense(name: "EditorConfig Java Core", libraryName: "editorconfig-core-j
 libraryLicense(name: "Fest", libraryName: "fest", version: "", license: "Apache 2.0", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.txt", url: "https://code.google.com/p/fest/")
 libraryLicense(name: "Gherkin", libraryName: "Gherkin", version: "2.12.2", license: "MIT", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.txt", url: "https://github.com/cucumber/gherkin")
 libraryLicense(name: "imgscalr", libraryName: "imgscalr", version: "4.2", license: "Apache 2.0", licenseUrl: "http://www.apache.org/licenses/LICENSE-2.0.txt", url: "https://github.com/thebuzzmedia/imgscalr")
+libraryLicense(name: "JGit", libraryName: "jgit", version: "4.0", license: "Eclipse Distribution License 1.0", licenseUrl: "http://www.eclipse.org/org/documents/edl-v10.php", url: "https://eclipse.org/jgit/")
+libraryLicense(name: "JGit", libraryName: "jackson", version: "2.5.1", license: "Apache 2.0", licenseUrl: "http://www.eclipse.org/org/documents/edl-v10.php", url: "https://github.com/FasterXML/jackson")
 jetbrainsLibrary("Coverage")
 jetbrainsLibrary("CoverageReport")
 jetbrainsLibrary("JPS")
index 474b7c2a7e92f5a28573e2cbc16bb732f742193d..26ea46bda664a88fd5c5e7bd335be0e1376143ab 100644 (file)
@@ -14,8 +14,6 @@
  * limitations under the License.
  */
 
-
-
 import com.intellij.openapi.util.SystemInfo
 import com.intellij.openapi.util.io.FileUtil
 import org.jetbrains.jps.gant.JpsGantTool
@@ -80,14 +78,14 @@ binding.setVariable("vmOptions", { "$common_vmoptions".trim() })
 binding.setVariable("vmOptions32", { "$mem32 ${vmOptions()}".trim() })
 binding.setVariable("vmOptions64", { "$mem64 ${vmOptions()}".trim() })
 
-binding.setVariable("yjpOptions", { String systemSelector, String platformSuffix = "" ->
-  "-agentlib:yjpagent$platformSuffix=probe_disable=*,disablealloc,disabletracing,onlylocal,disableexceptiontelemetry,delay=10000,sessionname=$systemSelector".trim()
+binding.setVariable("yjpOptions", { String sessionName, String platformSuffix = "" ->
+  "-agentlib:yjpagent$platformSuffix=probe_disable=*,disablealloc,disabletracing,onlylocal,disableexceptiontelemetry,delay=10000,sessionname=$sessionName".trim()
 })
-binding.setVariable("vmOptions32yjp", { String systemSelector ->
-  "${vmOptions32()} ${yjpOptions(systemSelector)}".trim()
+binding.setVariable("vmOptions32yjp", { String sessionName ->
+  "${vmOptions32()} ${yjpOptions(sessionName)}".trim()
 })
-binding.setVariable("vmOptions64yjp", { String systemSelector ->
-  "${vmOptions64()} ${yjpOptions(systemSelector, "64")}".trim()
+binding.setVariable("vmOptions64yjp", { String sessionName ->
+  "${vmOptions64()} ${yjpOptions(sessionName, "64")}".trim()
 })
 
 binding.setVariable("isDefined", {String key ->
@@ -329,7 +327,8 @@ binding.setVariable("copyAndPatchFiles", { Closure files, String target, Map arg
 
 binding.setVariable("wireBuildDate", { String buildNumber, String appInfoFile ->
   ant.tstamp()
-  patchFiles([appInfoFile], ["BUILD_NUMBER": buildNumber, "BUILD_DATE": DSTAMP])
+  patchFiles([appInfoFile], ["BUILD_NUMBER": buildNumber, "BUILD_DATE": DSTAMP,
+          "PACKAGE_CODE": buildNumber.substring(0, buildNumber.indexOf('-'))])
 })
 
 binding.setVariable("commonJvmArgsForTests", {
@@ -422,7 +421,8 @@ binding.setVariable("platformImplementationModules", [
   "xml-analysis-impl",
   "xml-psi-impl",
   "xml-structure-view-impl",
-  "xml"
+  "xml",
+  "configuration-store-impl",
 ])
 
 binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
@@ -521,6 +521,9 @@ binding.setVariable("layoutMacApp", { String path, String ch, Map args ->
     replacefilter(token: "@@product_state@@", value: EAP)
     replacefilter(token: "@@bundle_identifier@@", value: args.bundleIdentifier)
     replacefilter(token: "@@year@@", value: "$todayYear")
+    replacefilter(token: "@@company_name@@", value: p("component.company.name"))
+    replacefilter(token: "@@min_year@@", value: "2000")
+    replacefilter(token: "@@max_year@@", value: "$todayYear")
     replacefilter(token: "@@version@@", value: version)
     replacefilter(token: "@@vmoptions@@", value: vmOptions)
     replacefilter(token: "@@idea_properties@@", value: coreProperties)
@@ -622,14 +625,14 @@ binding.setVariable("unixScripts", { String target, String home, String name, Ma
   ant.fixcrlf(srcdir: "$target/bin", includes: "*.sh", eol: "unix")
 })
 
-binding.setVariable("winVMOptions", { String target, String system_selector, String name, String name64 = null ->
+binding.setVariable("winVMOptions", { String target, String yjpSessionName, String name, String name64 = null ->
   if (name != null) {
-    def options = isEap() && system_selector != null ? vmOptions32yjp(system_selector) : vmOptions32()
+    def options = isEap() && yjpSessionName != null ? vmOptions32yjp(yjpSessionName) : vmOptions32()
     ant.echo(file: "$target/bin/${name}.vmoptions", message: options.replace(' ', '\n'))
   }
 
   if (name64 != null) {
-    def options = isEap() && system_selector != null ? vmOptions64yjp(system_selector) : vmOptions64()
+    def options = isEap() && yjpSessionName != null ? vmOptions64yjp(yjpSessionName) : vmOptions64()
     ant.echo(file: "$target/bin/${name64}.vmoptions", message: options.replace(' ', '\n'))
   }
 
@@ -875,14 +878,14 @@ binding.setVariable("getPathToBundledJDK", { File jdkDir, String prefix, String
   return JdkFileName.replace('\\', '/')
 })
 
-binding.setVariable("buildWinZip", { String zipPath, List paths ->
+binding.setVariable("buildWinZip", { String zipPath, List paths, String zipPrefix = "" ->
   projectBuilder.stage(".win.zip")
 
   fixIdeaPropertiesEol(paths, "dos")
 
   ant.zip(zipfile: zipPath) {
     paths.each {
-      fileset(dir: it)
+      zipfileset(dir: it, prefix: zipPrefix)
     }
   }
 
@@ -1103,6 +1106,14 @@ binding.setVariable("buildWinLauncher", { String ch, String inputPath, String ou
   }
 })
 
+binding.setVariable("layoutUpdater", { String target, String jarName = "updater.jar" ->
+  layout(target) {
+    jar(jarName) {
+      module("updater")
+    }
+  }
+})
+
 binding.setVariable("collectUsedJars", { List modules, List approvedJars, List forbiddenJars, List modulesToBuild ->
   def usedJars = new HashSet();
 
index 0f811d874405ba18fd4d2e9d193623bcffc11211..3c9e6c09ccc65fe684a5a9f2cd67e4df7a85690a 100644 (file)
     <orderEntry type="module" module-name="json-tests" scope="TEST" />
     <orderEntry type="module" module-name="typeMigration" />
     <orderEntry type="module" module-name="platform-tests" />
+    <orderEntry type="module" module-name="android" />
   </component>
 </module>
\ No newline at end of file
index 79498230552ce6d73df021a133cdccb9f618e0d3..598ddc48ce04a0ee4dfb8eb144083f15d62f87be 100644 (file)
@@ -7,4 +7,95 @@ com.intellij.tasks.integration.live.*
 
 [GIT_TESTS]
 git4idea.*
-org.jetbrains.plugins.github.*
\ No newline at end of file
+org.jetbrains.plugins.github.*
+
+[ANDROID_SDK_TOOLS_TESTS]
+com.android.dvlib.*
+com.android.ide.common.*
+com.android.sdklib.*
+com.android.tools.lint.*
+com.android.tools.gradle.*
+com.android.utils.*
+com.android.ddmlib.*
+com.android.resources.*
+com.android.manifmerger.*
+com.android.assetstudio.*
+com.android.draw9patch.*
+com.android.ninepatch.*
+com.android.testutils.*
+com.android.perflib.*
+
+[ANDROID_FULL_SDK_TESTS]
+com.android.tools.idea.rendering.RenderErrorPanelTest
+com.android.tools.idea.sdk.VersionCheckTest
+org.jetbrains.android.sdk.AndroidSdkUtilsTest
+org.jetbrains.android.sdk.AndroidSdkDataTest
+com.android.tools.idea.gradle.project.GradleProjectImporterTest
+com.android.tools.idea.gradle.compiler.AndroidGradleBuildProcessParametersProviderTest
+com.android.tools.idea.sdk.JdksTest
+com.android.tools.idea.model.AndroidModuleInfoTest
+com.android.tools.idea.gradle.util.ProjectsTest
+com.android.tools.idea.rendering.LayoutPullParserFactoryTest
+com.android.tools.idea.rendering.MenuPreviewRendererTest
+com.android.tools.idea.templates.ParameterTest
+com.android.tools.idea.templates.TemplateTest
+com.android.tools.idea.templates.UniqueParameterTest
+com.android.tools.idea.sdk.DefaultSdksTest
+com.android.tools.idea.gradle.project.SdkSyncTest
+com.android.tools.idea.wizard.NewModuleWizardStateTest
+com.android.tools.idea.wizard.NewProjectWizardTest
+com.android.tools.idea.wizard.ConfigureAndroidModuleDynamicStepTest
+com.android.tools.idea.wizard.ConfigureAndroidModuleStepTest
+com.android.tools.idea.wizard.TemplateWizardStateTest
+com.android.tools.idea.wizard.TemplateWizardModuleBuilderTest
+com.android.tools.idea.wizard.NewTemplateObjectWizardTest
+org.jetbrains.android.run.AndroidRunConfigurationTest
+org.jetbrains.android.facet.IdeaSourceProviderTest
+com.android.tools.idea.gradle.service.resolve.AndroidResolveTest
+com.android.tools.idea.gradle.service.resolve.AndroidDslContributorTest
+com.intellij.android.designer.designSurface.AndroidDesignerEditorPanelTest
+com.intellij.android.designer.model.RadComponentOperationsTest
+com.intellij.android.designer.model.RadModelBuilderTest
+com.android.tools.idea.configurations.ResourceResolverCacheTest
+com.android.tools.idea.navigator.packageview.AndroidPackageViewTest
+com.android.tools.idea.gradle.project.AndroidGradleProjectDataTest
+com.android.tools.idea.exportSignedPackage.ExportSignedPackageTest
+com.android.tools.idea.avdmanager.AvdManagerConnectionTest
+com.android.tools.idea.ddms.adb.AdbServiceTest
+com.android.tools.idea.navigator.AndroidProjectViewTest
+com.android.navigation.NavigationEditorTest
+com.android.tools.idea.editors.navigation.model.TestIdiomRecognition
+com.android.tools.idea.gradle.service.sync.Ide2GradleProjectSyncTest
+com.android.tools.idea.welcome.FirstRunWizardTest
+com.android.tools.idea.welcome.InstallComponentsTest
+com.android.tools.idea.welcome.AndroidVirtualDeviceTest
+com.android.tools.idea.wizard.ConfigureAndroidModuleStepDynamicTest
+
+[ANDROID_BOMBED]
+com.android.tools.idea.gradle.project.GradleModuleImportTest
+com.android.tools.idea.wizard.TemplateParameterStep2Test
+com.android.tools.idea.wizard.TemplateParameterStep2DynamcTypeTest
+com.android.tools.idea.tests.gui.*
+com.android.tools.idea.avdmanager.AvdListDialogTest
+com.android.tools.idea.gradle.eclipse.GradleImportTest
+com.android.tools.idea.gradle.util.GradleUtilTest
+com.android.tools.idea.wizard.WrapArchiveWizardPathTest
+com.android.tools.idea.configurations.VaryingConfigurationTest
+com.android.tools.idea.editors.navigation.model.MasterDetailTest
+com.android.tools.idea.gradle.output.parser.BuildOutputParserTest
+com.android.tools.idea.wizard.DynamicWizardPathTest
+com.android.tools.idea.wizard.DynamicWizardStepTest
+com.android.tools.idea.rendering.FlagManagerTest
+com.android.tools.idea.rendering.ResourceFolderRepositoryTest
+com.android.tools.idea.javadoc.AndroidJavaDocRendererTest
+com.android.tools.idea.editors.strings.StringResourceDataTest
+com.android.tools.idea.rendering.ClassConverterTest
+com.android.tools.idea.gradle.service.notification.errors.UnknownHostErrorHandlerTest
+
+[GRADLE_INTEGRATION_TESTS]
+org.jetbrains.plugins.gradle.importing.*
+org.jetbrains.plugins.gradle.compiler.*
+
+[MAVEN_INTEGRATION_TESTS]
+org.jetbrains.idea.maven.importing.*
+org.jetbrains.idea.maven.compiler.*
index dbfedd236d3f61d09a4a3ab824358cb53fc4d3ee..0abbe05a217345e6f4a4244fbe6fa25fa902edf1 100644 (file)
@@ -313,7 +313,19 @@ public class InspectionValidatorWrapper implements Validator {
                                                                                  final HighlightDisplayLevel level) {
     Map<ProblemDescriptor, HighlightDisplayLevel> problemsMap = new LinkedHashMap<ProblemDescriptor, HighlightDisplayLevel>();
     for (ProblemDescriptor descriptor : runInspectionOnFile(file, inspectionTool)) {
-      problemsMap.put(descriptor, level);
+      final ProblemHighlightType highlightType = descriptor.getHighlightType();
+
+      final HighlightDisplayLevel highlightDisplayLevel;
+      if (highlightType == ProblemHighlightType.WEAK_WARNING) {
+        highlightDisplayLevel = HighlightDisplayLevel.WEAK_WARNING;
+      }
+      else if (highlightType == ProblemHighlightType.INFORMATION) {
+        highlightDisplayLevel = HighlightDisplayLevel.DO_NOT_SHOW;
+      }
+      else {
+        highlightDisplayLevel = level;
+      }
+      problemsMap.put(descriptor, highlightDisplayLevel);
     }
     return problemsMap;
   }
index 4c9e57aa13c7ac94ddef0eca6dae66cd8580a0cc..2e506ebdacd9261ee408cdc13d013ce13a82917f 100644 (file)
@@ -17,7 +17,9 @@ package com.intellij.debugger.actions;
 
 import com.intellij.debugger.DebuggerBundle;
 import com.intellij.debugger.engine.DebugProcessImpl;
-import com.intellij.debugger.engine.events.SuspendContextCommandImpl;
+import com.intellij.debugger.engine.SuspendContextImpl;
+import com.intellij.debugger.engine.SuspendManagerUtil;
+import com.intellij.debugger.engine.events.DebuggerCommandImpl;
 import com.intellij.debugger.impl.DebuggerContextImpl;
 import com.intellij.debugger.jdi.ThreadReferenceProxyImpl;
 import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl;
@@ -26,6 +28,8 @@ import com.intellij.debugger.ui.impl.watch.ThreadDescriptorImpl;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.Presentation;
 
+import java.util.Set;
+
 /**
  * User: lex
  * Date: Sep 26, 2003
@@ -37,15 +41,21 @@ public class ResumeThreadAction extends DebuggerAction{
     final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
     final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
 
+    if (debugProcess == null) return;
+
     //noinspection ConstantConditions
     for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
       final ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());
 
       if (threadDescriptor.isSuspended()) {
         final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();
-        debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext()) {
-          public void contextAction() throws Exception {
-            debugProcess.createResumeThreadCommand(getSuspendContext(), thread).run();
+        debugProcess.getManagerThread().schedule(new DebuggerCommandImpl() {
+          @Override
+          protected void action() throws Exception {
+            Set<SuspendContextImpl> contexts = SuspendManagerUtil.getSuspendingContexts(debugProcess.getSuspendManager(), thread);
+            if (!contexts.isEmpty()) {
+              debugProcess.createResumeThreadCommand(contexts.iterator().next(), thread).run();
+            }
             debuggerTreeNode.calcValue();
           }
         });
index 4910d870799f2f5747e688f74c15648306613cb0..9ffe54e4e731baf4bac1705857ed29581362ec81 100644 (file)
@@ -39,6 +39,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.MessageType;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.registry.Registry;
 import com.intellij.ui.classFilter.ClassFilter;
 import com.intellij.xdebugger.XDebugSession;
 import com.intellij.xdebugger.breakpoints.XBreakpoint;
@@ -52,6 +53,7 @@ import com.sun.jdi.request.EventRequest;
 import com.sun.jdi.request.EventRequestManager;
 import com.sun.jdi.request.ThreadDeathRequest;
 import com.sun.jdi.request.ThreadStartRequest;
+import org.jetbrains.annotations.Nullable;
 
 import java.util.List;
 
@@ -189,24 +191,44 @@ public class DebugProcessEvents extends DebugProcessImpl {
             getManagerThread().invokeAndWait(new DebuggerCommandImpl() {
               @Override
               protected void action() throws Exception {
-                if (eventSet.suspendPolicy() == EventRequest.SUSPEND_ALL && !DebuggerSession.enableBreakpointsDuringEvaluation()) {
+                if (eventSet.suspendPolicy() == EventRequest.SUSPEND_ALL) {
                   // check if there is already one request with policy SUSPEND_ALL
-                  contexts: for (SuspendContextImpl context : getSuspendManager().getEventContexts()) {
+                  for (SuspendContextImpl context : getSuspendManager().getEventContexts()) {
                     if (context.getSuspendPolicy() == EventRequest.SUSPEND_ALL) {
-                      for (Event event : eventSet) {
-                        if (event instanceof StepEvent) {
-                          // if step event is present - switch context
-                          ((SuspendManagerImpl)getSuspendManager()).popContext(context);
-                          continue contexts;
-                        }
+                      if (Registry.is("debugger.step.resumes.one.thread") && getStepEvent(eventSet) != null) {
+                        // if step event is present - switch context
+                        getSuspendManager().resume(context);
+                        //((SuspendManagerImpl)getSuspendManager()).popContext(context);
+                        continue;
                       }
-                      eventSet.resume();
-                      return;
+                      if (!DebuggerSession.enableBreakpointsDuringEvaluation()) {
+                        eventSet.resume();
+                        return;
+                      }
+                    }
+                  }
+                }
+
+                SuspendContextImpl suspendContext = null;
+
+                StepEvent stepEvent = getStepEvent(eventSet);
+                if (Registry.is("debugger.step.resumes.one.thread") && stepEvent != null) {
+                  for (SuspendContextImpl context : getSuspendManager().getEventContexts()) {
+                    ThreadReferenceProxyImpl threadProxy = getVirtualMachineProxy().getThreadReferenceProxy(stepEvent.thread());
+                    if (context.getSuspendPolicy() == EventRequest.SUSPEND_ALL &&
+                        context.isExplicitlyResumed(threadProxy)) {
+                      context.myResumedThreads.remove(threadProxy);
+                      suspendContext = context;
+                      suspendContext.myVotesToVote = eventSet.size();
+                      break;
                     }
                   }
                 }
 
-                final SuspendContextImpl suspendContext = getSuspendManager().pushSuspendContext(eventSet);
+                if (suspendContext == null) {
+                  suspendContext = getSuspendManager().pushSuspendContext(eventSet);
+                }
+
                 for (EventIterator eventIterator = eventSet.eventIterator(); eventIterator.hasNext();) {
                   final Event event = eventIterator.nextEvent();
                   //if (LOG.isDebugEnabled()) {
@@ -515,6 +537,16 @@ public class DebugProcessEvents extends DebugProcessImpl {
     });
   }
 
+  @Nullable
+  private static StepEvent getStepEvent(EventSet eventSet) {
+    for (Event event : eventSet) {
+      if (event instanceof StepEvent) {
+        return (StepEvent)event;
+      }
+    }
+    return null;
+  }
+
   private void processDefaultEvent(SuspendContextImpl suspendContext) {
     preprocessEvent(suspendContext, null);
     getSuspendManager().voteResume(suspendContext);
index 2df38a77e926c1b0509bb427c7260deea8ba03a6..0bd8f9ac372e9569ffab86d1064bf5b015a4a79c 100644 (file)
@@ -30,7 +30,6 @@ import com.intellij.debugger.settings.NodeRendererSettings;
 import com.intellij.debugger.ui.breakpoints.Breakpoint;
 import com.intellij.debugger.ui.impl.FrameVariablesTree;
 import com.intellij.debugger.ui.impl.watch.*;
-import com.intellij.debugger.ui.tree.render.ClassRenderer;
 import com.intellij.debugger.ui.tree.render.DescriptorLabelListener;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
@@ -38,6 +37,7 @@ import com.intellij.openapi.util.Computable;
 import com.intellij.openapi.util.Pair;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.ui.ColoredTextContainer;
+import com.intellij.util.containers.ContainerUtil;
 import com.intellij.xdebugger.XDebugSession;
 import com.intellij.xdebugger.XSourcePosition;
 import com.intellij.xdebugger.evaluation.XDebuggerEvaluator;
@@ -209,25 +209,8 @@ public class JavaStackFrame extends XStackFrame {
         }
       }
 
-      final ClassRenderer classRenderer = NodeRendererSettings.getInstance().getClassRenderer();
-      if (classRenderer.SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES) {
-        if (thisObjectReference != null && debugProcess.getVirtualMachineProxy().canGetSyntheticAttribute())  {
-          final ReferenceType thisRefType = thisObjectReference.referenceType();
-          if (thisRefType instanceof ClassType && location != null
-              && thisRefType.equals(location.declaringType()) && thisRefType.name().contains("$")) { // makes sense for nested classes only
-            final ClassType clsType = (ClassType)thisRefType;
-            for (Field field : clsType.fields()) {
-              if (DebuggerUtils.isSynthetic(field) && StringUtil.startsWith(field.name(), FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX)) {
-                final FieldDescriptorImpl fieldDescriptor = myNodeManager.getFieldDescriptor(myDescriptor, thisObjectReference, field);
-                children.add(JavaValue.create(fieldDescriptor, evaluationContext, myNodeManager));
-              }
-            }
-          }
-        }
-      }
-
       try {
-        buildVariables(debuggerContext, evaluationContext, children, node);
+        buildVariables(debuggerContext, evaluationContext, debugProcess, children, thisObjectReference, location);
         //if (classRenderer.SORT_ASCENDING) {
         //  Collections.sort(myChildren, NodeManagerImpl.getNodeComparator());
         //}
@@ -255,7 +238,29 @@ public class JavaStackFrame extends XStackFrame {
   }
 
   // copied from FrameVariablesTree
-  private void buildVariables(DebuggerContextImpl debuggerContext, EvaluationContextImpl evaluationContext, XValueChildrenList children, XCompositeNode node) throws EvaluateException {
+  private void buildVariables(DebuggerContextImpl debuggerContext,
+                              EvaluationContextImpl evaluationContext,
+                              @NotNull DebugProcessImpl debugProcess,
+                              XValueChildrenList children,
+                              ObjectReference thisObjectReference,
+                              Location location) throws EvaluateException {
+    final Set<String> visibleLocals = new HashSet<String>();
+    if (NodeRendererSettings.getInstance().getClassRenderer().SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES) {
+      if (thisObjectReference != null && debugProcess.getVirtualMachineProxy().canGetSyntheticAttribute()) {
+        final ReferenceType thisRefType = thisObjectReference.referenceType();
+        if (thisRefType instanceof ClassType && location != null
+            && thisRefType.equals(location.declaringType()) && thisRefType.name().contains("$")) { // makes sense for nested classes only
+          for (Field field : thisRefType.fields()) {
+            if (DebuggerUtils.isSynthetic(field) && StringUtil.startsWith(field.name(), FieldDescriptorImpl.OUTER_LOCAL_VAR_FIELD_PREFIX)) {
+              final FieldDescriptorImpl fieldDescriptor = myNodeManager.getFieldDescriptor(myDescriptor, thisObjectReference, field);
+              children.add(JavaValue.create(fieldDescriptor, evaluationContext, myNodeManager));
+              visibleLocals.add(fieldDescriptor.getName());
+            }
+          }
+        }
+      }
+    }
+
     boolean myAutoWatchMode = DebuggerSettings.getInstance().AUTO_VARIABLES_MODE;
     if (evaluationContext == null) {
       return;
@@ -277,14 +282,16 @@ public class JavaStackFrame extends XStackFrame {
           ApplicationManager.getApplication().runReadAction(new Computable<Pair<Set<String>, Set<TextWithImports>>>() {
             @Override
             public Pair<Set<String>, Set<TextWithImports>> compute() {
-              return FrameVariablesTree.findReferencedVars(visibleVariables.keySet(), sourcePosition, evalContext);
+              return FrameVariablesTree.findReferencedVars(ContainerUtil.union(visibleVariables.keySet(), visibleLocals), sourcePosition, evalContext);
             }
           });
         // add locals
         if (myAutoWatchMode) {
           for (String var : usedVars.first) {
-            final LocalVariableDescriptorImpl descriptor = myNodeManager.getLocalVariableDescriptor(null, visibleVariables.get(var));
-            children.add(JavaValue.create(descriptor, evaluationContext, myNodeManager));
+            LocalVariableProxyImpl local = visibleVariables.get(var);
+            if (local != null) {
+              children.add(JavaValue.create(myNodeManager.getLocalVariableDescriptor(null, local), evaluationContext, myNodeManager));
+            }
           }
         }
         else {
index 5bf55df20844fb4cf8183b938770e0e55edacfb0..a9c077080c0826a6161d73153b5ce54a53705e97 100644 (file)
@@ -42,10 +42,7 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Computable;
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.Ref;
-import com.intellij.openapi.util.TextRange;
+import com.intellij.openapi.util.*;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiTreeUtil;
@@ -625,6 +622,13 @@ public class FrameVariablesTree extends DebuggerTree {
             if (myVisibleLocals.contains(var.getName())) {
               myVars.add(var.getName());
             }
+            else {
+              // fix for variables used in inner classes
+              if (!Comparing.equal(PsiTreeUtil.getParentOfType(reference, PsiClass.class),
+                                   PsiTreeUtil.getParentOfType(var, PsiClass.class))) {
+                myExpressions.add(new TextWithImportsImpl(reference));
+              }
+            }
           }
         }
       }
index f8349e8bffb2290b9d4121421f22a52e3d10c269..35c56fb96b0193805603c858aaa1e775db800e15 100644 (file)
@@ -26,7 +26,7 @@ import org.jetbrains.annotations.Nullable;
 public abstract class SourcePositionHighlighter {
   public static final ExtensionPointName<SourcePositionHighlighter> EP_NAME = ExtensionPointName.create("com.intellij.debugger.sourcePositionHighlighter");
 
-  abstract TextRange getHighlightRange(SourcePosition sourcePosition);
+  public abstract TextRange getHighlightRange(SourcePosition sourcePosition);
 
   @Nullable
   public static TextRange getHighlightRangeFor(SourcePosition sourcePosition) {
index 2a6932c91115d2d57ceeea61b7dfab94491b3ea9..b5f830e1f7e8b7e58a27586e934cc867a2e35aaa 100644 (file)
@@ -14,5 +14,6 @@
     <orderEntry type="library" name="XmlRPC" level="project" />
     <orderEntry type="library" name="OroMatcher" level="project" />
     <orderEntry type="module" module-name="vcs-impl" />
+    <orderEntry type="module" module-name="configuration-store-impl" />
   </component>
 </module>
\ No newline at end of file
index bf2294f923a8c141d4612b1399ef23502ee9a82b..3b1c6c4444c21546f4be35345d5ebbb71fb28cdc 100644 (file)
 package com.intellij.openapi.components.impl.stores;
 
 import com.intellij.openapi.project.impl.ProjectStoreClassProvider;
+import org.jetbrains.annotations.NotNull;
 
-/**
- * @author mike
- */
 public class IdeaProjectStoreClassProvider implements ProjectStoreClassProvider {
+  @NotNull
   @Override
   public Class<? extends IComponentStore> getProjectStoreClass(final boolean isDefaultProject) {
     return isDefaultProject ? DefaultProjectStoreImpl.class : IdeaProjectStoreImpl.class;
index b7ba7b6fb3077489b4c804e67d160474e9ee5bac..5d0670093a991c1f9b7536883032f738eb306aeb 100644 (file)
@@ -18,9 +18,9 @@ package com.intellij.openapi.roots.ui.configuration;
 
 import com.intellij.core.JavaCoreBundle;
 import com.intellij.icons.AllIcons;
+import com.intellij.ide.impl.ProjectUtil;
 import com.intellij.ide.util.BrowseFilesListener;
 import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.components.StorageScheme;
 import com.intellij.openapi.fileChooser.FileChooserDescriptor;
 import com.intellij.openapi.fileChooser.FileChooserDescriptorFactory;
 import com.intellij.openapi.fileChooser.FileChooserFactory;
@@ -131,7 +131,7 @@ public class ProjectConfigurable extends ProjectStructureElementConfigurable<Pro
     myPanel = new JPanel(new GridBagLayout());
     myPanel.setPreferredSize(JBUI.size(700, 500));
 
-    if (((ProjectEx)myProject).getStateStore().getStorageScheme().equals(StorageScheme.DIRECTORY_BASED)) {
+    if (ProjectUtil.isDirectoryBased(myProject)) {
       final JPanel namePanel = new JPanel(new BorderLayout());
       final JLabel label =
         new JLabel("<html><body><b>Project name:</b></body></html>", SwingConstants.LEFT);
index fa9ab673d45af1cf2413fd7429fbe6370f36b64f..973ffa59426cfc72b14e37cec74e736b8b9789df 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,12 +19,12 @@ import com.intellij.CommonBundle;
 import com.intellij.codeInspection.defaultFileTemplateUsage.FileHeaderChecker;
 import com.intellij.ide.fileTemplates.FileTemplate;
 import com.intellij.ide.fileTemplates.FileTemplateManager;
+import com.intellij.ide.impl.ProjectUtil;
 import com.intellij.ide.util.projectWizard.ProjectTemplateFileProcessor;
 import com.intellij.ide.util.projectWizard.ProjectTemplateParameterFactory;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.components.StorageScheme;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.module.Module;
@@ -33,7 +33,6 @@ import com.intellij.openapi.progress.ProgressIndicator;
 import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.progress.Task;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.project.ex.ProjectEx;
 import com.intellij.openapi.roots.ContentIterator;
 import com.intellij.openapi.roots.FileIndex;
 import com.intellij.openapi.roots.ModuleRootManager;
@@ -74,8 +73,7 @@ public class SaveProjectAsTemplateAction extends AnAction {
   public void actionPerformed(AnActionEvent e) {
     final Project project = getEventProject(e);
     assert project != null;
-    StorageScheme scheme = ((ProjectEx)project).getStateStore().getStorageScheme();
-    if (scheme != StorageScheme.DIRECTORY_BASED) {
+    if (!ProjectUtil.isDirectoryBased(project)) {
       Messages.showErrorDialog(project, "Project templates do not support old .ipr (file-based) format.\n" +
                                         "Please convert your project via File->Save as Directory-Based format.", CommonBundle.getErrorTitle());
       return;
@@ -111,7 +109,7 @@ public class SaveProjectAsTemplateAction extends AnAction {
   }
 
   public static VirtualFile getDescriptionFile(Project project, String path) {
-    return VfsUtil.findRelativeFile(path, project.getBaseDir());
+    return VfsUtilCore.findRelativeFile(path, project.getBaseDir());
   }
 
   public static void saveProject(final Project project,
index f4ad751675df8a9926014e73dc8960ce5fedafd3..f563f316422b1b0b02c067f705aaf33a9e1bffb3 100644 (file)
@@ -658,7 +658,7 @@ public class GenericsHighlightUtil {
     return null;
   }
 
-  static HighlightInfo checkReferenceTypeUsedAsTypeArgument(final PsiTypeElement typeElement) {
+  static HighlightInfo checkReferenceTypeUsedAsTypeArgument(PsiTypeElement typeElement, LanguageLevel level) {
     final PsiType type = typeElement.getType();
     if (type != PsiType.NULL && type instanceof PsiPrimitiveType ||
         type instanceof PsiWildcardType && ((PsiWildcardType)type).getBound() instanceof PsiPrimitiveType) {
@@ -668,9 +668,11 @@ public class GenericsHighlightUtil {
         .getElement();
       if (element == null) return null;
 
-      String description = JavaErrorMessages.message("generics.type.argument.cannot.be.of.primitive.type");
-      final HighlightInfo highlightInfo =
-        HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeElement).descriptionAndTooltip(description).create();
+      if (level.isAtLeast(LanguageLevel.JDK_X)) return null;
+
+      String text = JavaErrorMessages.message("generics.type.argument.cannot.be.of.primitive.type");
+      HighlightInfo highlightInfo = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(typeElement).descriptionAndTooltip(text).create();
+
       PsiType toConvert = type;
       if (type instanceof PsiWildcardType) {
         toConvert = ((PsiWildcardType)type).getBound();
@@ -678,8 +680,8 @@ public class GenericsHighlightUtil {
       if (toConvert instanceof PsiPrimitiveType) {
         final PsiClassType boxedType = ((PsiPrimitiveType)toConvert).getBoxedType(typeElement);
         if (boxedType != null) {
-          QuickFixAction.registerQuickFixAction(highlightInfo,
-                                                QUICK_FIX_FACTORY.createReplacePrimitiveWithBoxedTypeAction(typeElement, toConvert.getPresentableText(), ((PsiPrimitiveType)toConvert).getBoxedTypeName()));
+          QuickFixAction.registerQuickFixAction(highlightInfo, QUICK_FIX_FACTORY.createReplacePrimitiveWithBoxedTypeAction(
+            typeElement, toConvert.getPresentableText(), ((PsiPrimitiveType)toConvert).getBoxedTypeName()));
         }
       }
       return highlightInfo;
index 7012c7603aeccc8128353c3c0b533c3710d01b29..917095adc2c99ee598918860198103abc6e4ac97 100644 (file)
@@ -1506,7 +1506,7 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
   @Override
   public void visitTypeElement(final PsiTypeElement type) {
     if (!myHolder.hasErrorResults()) myHolder.add(HighlightUtil.checkIllegalType(type));
-    if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkReferenceTypeUsedAsTypeArgument(type));
+    if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkReferenceTypeUsedAsTypeArgument(type, myLanguageLevel));
     if (!myHolder.hasErrorResults()) myHolder.add(GenericsHighlightUtil.checkWildcardUsage(type));
   }
 
index 1efc11876129a6a1c6d1206d21d54f41f9f00b47..26d9b0950d74ce29c55ef33fd0d027cb44a1e297 100644 (file)
@@ -29,6 +29,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.codeStyle.JavaCodeStyleManager;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
+import com.intellij.util.ObjectUtils;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -40,12 +41,14 @@ public class AddAnnotationPsiFix extends LocalQuickFixOnPsiElement {
   protected final String myText;
 
   public AddAnnotationPsiFix(@NotNull String fqn,
-                            @NotNull PsiModifierListOwner modifierListOwner,
-                            @NotNull PsiNameValuePair[] values,
-                            @NotNull String... annotationsToRemove) {
+                             @NotNull PsiModifierListOwner modifierListOwner,
+                             @NotNull PsiNameValuePair[] values,
+                             @NotNull String... annotationsToRemove) {
     super(modifierListOwner);
     myAnnotation = fqn;
+    ObjectUtils.assertAllElementsNotNull(values);
     myPairs = values;
+    ObjectUtils.assertAllElementsNotNull(annotationsToRemove);
     myAnnotationsToRemove = annotationsToRemove;
     myText = calcText(modifierListOwner, myAnnotation);
   }
index 0d362c864a7bb0e070397fc2979fae148aeb4e7f..0f09bed18904484e47ba6233515f2161962e4e37 100644 (file)
@@ -510,8 +510,7 @@ public class ReferenceExpressionCompletionContributor {
         if (expr instanceof PsiReferenceExpression) {
           return (PsiReferenceExpression)expr;
         }
-        LOG.error("Unexpected type: " + expr.getClass() + " from text " + text);
-        return null;
+        return null; // ignore ill-formed qualified names like "org.spark-project.jetty" that can't be used from Java code anyway
       }
       catch (IncorrectOperationException e) {
         LOG.info(e);
index b2309275e94df194e3150ff25e59fcbbf1a1a522..27dbce23bd300f2904070ed9f7a9195215e01e21 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,46 +23,37 @@ import com.intellij.codeInsight.daemon.LineMarkerProvider;
 import com.intellij.openapi.editor.markup.GutterIconRenderer;
 import com.intellij.openapi.fileEditor.FileEditorManager;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.IconLoader;
-import com.intellij.openapi.util.Pair;
-import com.intellij.openapi.util.Ref;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.*;
-import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
-import com.intellij.psi.util.InheritanceUtil;
+import com.intellij.psi.util.ProjectIconsAccessor;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.util.PsiUtilCore;
-import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import java.awt.event.MouseEvent;
-import java.io.File;
-import java.io.IOException;
-import java.util.*;
+import java.util.Collection;
+import java.util.List;
 
 /**
- * Shows small (16x16 or less) icons as gutters
+ * Shows small (16x16 or less) icons as gutters.
+ * <p/>
  * Works in places where it's possible to resolve from literal expression
- * to an icon image
+ * to an icon image.
  *
  * @author Konstantin Bulenkov
  */
 public class IconLineMarkerProvider implements LineMarkerProvider {
-  @NonNls private static final String JAVAX_SWING_ICON = "javax.swing.Icon";
-  private static final int ICON_MAX_WEIGHT = 16;
-  private static final int ICON_MAX_HEIGHT = 16;
-  private static final int ICON_MAX_SIZE = 2 * 1024 * 1024; //2Kb
-  private static final List<String> ICON_EXTS = Arrays.asList("png", "ico", "bmp", "gif", "jpg");
 
-  //TODO: remove old unused icons from the cache
-  private final HashMap<String, Pair<Long, Icon>> iconsCache = new HashMap<String, Pair<Long, Icon>>();
+  @Override
+  public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) {
+  }
 
   @Override
   public LineMarkerInfo getLineMarkerInfo(@NotNull PsiElement element) {
-    if (! DaemonCodeAnalyzerSettings.getInstance().SHOW_SMALL_ICONS_IN_GUTTER) return null;
+    if (!DaemonCodeAnalyzerSettings.getInstance().SHOW_SMALL_ICONS_IN_GUTTER) return null;
 
     if (element instanceof PsiAssignmentExpression) {
       final PsiExpression lExpression = ((PsiAssignmentExpression)element).getLExpression();
@@ -70,7 +61,7 @@ public class IconLineMarkerProvider implements LineMarkerProvider {
       if (lExpression instanceof PsiReferenceExpression) {
         PsiElement var = ((PsiReferenceExpression)lExpression).resolve();
         if (var instanceof PsiVariable) {
-          return resolveIconInfo(((PsiVariable)var).getType(), expr);
+          return createIconLineMarker(((PsiVariable)var).getType(), expr);
         }
       }
     }
@@ -80,15 +71,15 @@ public class IconLineMarkerProvider implements LineMarkerProvider {
       final PsiMethod method = PsiTreeUtil.getParentOfType(element, PsiMethod.class);
       if (method != null) {
         final PsiType returnType = method.getReturnType();
-        final LineMarkerInfo<PsiElement> result = resolveIconInfo(returnType, value);
+        final LineMarkerInfo<PsiElement> result = createIconLineMarker(returnType, value);
 
-        if (result != null || !isIconClassType(returnType) || value == null) return result;
+        if (result != null || !ProjectIconsAccessor.isIconClassType(returnType) || value == null) return result;
 
         if (methodContainsReturnStatementOnly(method)) {
           for (PsiReference ref : value.getReferences()) {
             final PsiElement field = ref.resolve();
             if (field instanceof PsiField) {
-              return resolveIconInfo(returnType, ((PsiField)field).getInitializer(), psiReturnStatement);
+              return createIconLineMarker(returnType, ((PsiField)field).getInitializer(), psiReturnStatement);
             }
           }
         }
@@ -103,7 +94,7 @@ public class IconLineMarkerProvider implements LineMarkerProvider {
         PsiUtil.ensureValidType(type, "in variable: " + var + " of " + var.getClass());
       }
 
-      return resolveIconInfo(type, var.getInitializer());
+      return createIconLineMarker(type, var.getInitializer());
     }
     return null;
   }
@@ -116,113 +107,33 @@ public class IconLineMarkerProvider implements LineMarkerProvider {
   }
 
   @Nullable
-  private LineMarkerInfo<PsiElement> resolveIconInfo(PsiType type, PsiExpression initializer) {
-    return resolveIconInfo(type, initializer, initializer);
+  private static LineMarkerInfo<PsiElement> createIconLineMarker(PsiType type, @Nullable PsiExpression initializer) {
+    return createIconLineMarker(type, initializer, initializer);
   }
 
   @Nullable
-  private LineMarkerInfo<PsiElement> resolveIconInfo(PsiType type, PsiExpression initializer, PsiElement bindingElement) {
-    if (initializer != null && initializer.isValid() && isIconClassType(type)) {
-      final Project project = initializer.getProject();
-      final List<FileReference> refs = new ArrayList<FileReference>();
-      initializer.accept(new JavaRecursiveElementWalkingVisitor() {
-        @Override
-        public void visitElement(PsiElement element) {
-          if (element instanceof PsiLiteralExpression) {
-            for (PsiReference ref : element.getReferences()) {
-              if (ref instanceof FileReference) {
-                refs.add((FileReference)ref);
-              }
-            }
-          }
-          super.visitElement(element);
-        }
-      });
-
-      for (FileReference ref : refs) {
-        final PsiFileSystemItem psiFileSystemItem = ref.resolve();
-        VirtualFile file = null;
-        if (psiFileSystemItem == null) {
-          final ResolveResult[] results = ref.multiResolve(false);
-          for (ResolveResult result : results) {
-            final PsiElement element = result.getElement();
-            if (element instanceof PsiBinaryFile) {
-              file = ((PsiFile)element).getVirtualFile();
-              break;
-            }
-          }
-        } else {
-          file = psiFileSystemItem.getVirtualFile();
-        }
-
-        if (file == null || file.isDirectory()
-            || !isIconFileExtension(file.getExtension())
-            || file.getLength() > ICON_MAX_SIZE) continue;
-
-        final Icon icon = getIcon(file, project);
-
-        if (icon != null) {
-          final Ref<VirtualFile> f = Ref.create(file);
-          final GutterIconNavigationHandler<PsiElement> navHandler = new GutterIconNavigationHandler<PsiElement>() {
-            @Override
-            public void navigate(MouseEvent e, PsiElement elt) {
-              FileEditorManager.getInstance(project).openFile(f.get(), true);
-            }
-          };
-          return new LineMarkerInfo<PsiElement>(bindingElement, bindingElement.getTextRange(), icon,
-                                                Pass.UPDATE_ALL, null, navHandler,
-                                                GutterIconRenderer.Alignment.LEFT);
-        }
-      }
-    }
-    return null;
-  }
+  private static LineMarkerInfo<PsiElement> createIconLineMarker(PsiType type,
+                                                                 @Nullable PsiExpression initializer,
+                                                                 PsiElement bindingElement) {
+    if (initializer == null) return null;
 
-  private static boolean isIconFileExtension(String extension) {
-    return extension != null && ICON_EXTS.contains(extension.toLowerCase());
-  }
+    final Project project = initializer.getProject();
 
-  @Override
-  public void collectSlowLineMarkers(@NotNull List<PsiElement> elements, @NotNull Collection<LineMarkerInfo> result) {
-  }
+    final VirtualFile file = ProjectIconsAccessor.getInstance(project).resolveIconFile(type, initializer);
+    if (file == null) return null;
 
-  private static boolean hasProperSize(Icon icon) {
-    return icon.getIconHeight() <= ICON_MAX_HEIGHT && icon.getIconWidth() <= ICON_MAX_WEIGHT;
-  }
+    final Icon icon = ProjectIconsAccessor.getInstance(project).getIcon(file);
+    if (icon == null) return null;
 
-  @Nullable
-  private Icon getIcon(VirtualFile file, Project project) {
-    final String path = file.getPath();
-    final long stamp = file.getModificationStamp();
-    Pair<Long, Icon> iconInfo = iconsCache.get(path);
-    if (iconInfo == null || iconInfo.getFirst() < stamp) {
-      try {
-        final Icon icon = createOrFindBetterIcon(file, isIdeaProject(project));
-        iconInfo = new Pair<Long, Icon>(stamp, hasProperSize(icon) ? icon : null);
-        iconsCache.put(file.getPath(), iconInfo);
+    final GutterIconNavigationHandler<PsiElement> navHandler = new GutterIconNavigationHandler<PsiElement>() {
+      @Override
+      public void navigate(MouseEvent e, PsiElement elt) {
+        FileEditorManager.getInstance(project).openFile(file, true);
       }
-      catch (Exception e) {//
-        iconInfo = null;
-        iconsCache.remove(path);
-      }
-    }
-    return iconInfo == null ? null : iconInfo.getSecond();
-  }
-
-  private static boolean isIdeaProject(Project project) {
-    if (project == null) return false;
-    VirtualFile baseDir = project.getBaseDir();
-    return baseDir != null && (baseDir.findChild("idea.iml") != null || baseDir.findChild("community-main.iml") != null);
-  }
-
-  private static Icon createOrFindBetterIcon(VirtualFile file, boolean tryToFindBetter) throws IOException {
-    if (tryToFindBetter) {
-      return IconLoader.findIcon(new File(file.getPath()).toURI().toURL());
-    }
-    return new ImageIcon(file.contentsToByteArray());
-  }
+    };
 
-  private static boolean isIconClassType(PsiType type) {
-    return InheritanceUtil.isInheritor(type, JAVAX_SWING_ICON);
+    return new LineMarkerInfo<PsiElement>(bindingElement, bindingElement.getTextRange(), icon,
+                                          Pass.UPDATE_ALL, null, navHandler,
+                                          GutterIconRenderer.Alignment.LEFT);
   }
-}
\ No newline at end of file
+}
index fb632cdd7123ac0babbd13ee56d5e791561b27ba..8f030f4b0c336b7d00b976e7970bdc5ec57a6eab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2013 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,7 +35,7 @@ import java.util.regex.Pattern;
  */
 public class JavaProjectData extends AbstractExternalEntityData {
 
-  @NotNull public static final Key<JavaProjectData> KEY = Key.create(JavaProjectData.class, ProjectKeys.PROJECT.getProcessingWeight() + 1);
+  public static final Key<JavaProjectData> KEY = Key.create(JavaProjectData.class, ProjectKeys.PROJECT.getProcessingWeight() + 1);
 
   private static final Logger LOG = Logger.getInstance("#" + JavaProjectData.class.getName());
 
@@ -128,7 +128,7 @@ public class JavaProjectData extends AbstractExternalEntityData {
 
   public void setLanguageLevel(@Nullable String languageLevel) {
     LanguageLevel level = LanguageLevel.parse(languageLevel);
-    if (level == null) {
+    if (level == null && languageLevel != null) {
       Matcher matcher = JDK_VERSION_PATTERN.matcher(languageLevel);
       if (matcher.matches()) {
         String versionAsString = matcher.group(1);
diff --git a/java/java-impl/src/com/intellij/psi/util/ProjectIconsAccessor.java b/java/java-impl/src/com/intellij/psi/util/ProjectIconsAccessor.java
new file mode 100644 (file)
index 0000000..9bda513
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.psi.util;
+
+import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.IconLoader;
+import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.psi.*;
+import com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference;
+import com.intellij.util.containers.ContainerUtil;
+import com.intellij.util.containers.SLRUMap;
+import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+import javax.swing.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+/**
+ * Resolve small icons located in project for use in UI (e.g. gutter preview icon, lookups).
+ *
+ * @since 15
+ */
+public class ProjectIconsAccessor {
+
+  @NonNls
+  private static final String JAVAX_SWING_ICON = "javax.swing.Icon";
+
+  private static final int ICON_MAX_WEIGHT = 16;
+  private static final int ICON_MAX_HEIGHT = 16;
+  private static final int ICON_MAX_SIZE = 2 * 1024 * 1024; // 2Kb
+
+  private static final List<String> ICON_EXTENSIONS = ContainerUtil.immutableList("png", "ico", "bmp", "gif", "jpg");
+
+  private final Project myProject;
+
+  private final SLRUMap<String, Pair<Long, Icon>> iconsCache = new SLRUMap<String, Pair<Long, Icon>>(500, 1000);
+
+  ProjectIconsAccessor(Project project) {
+    myProject = project;
+  }
+
+  public static ProjectIconsAccessor getInstance(Project project) {
+    return ServiceManager.getService(project, ProjectIconsAccessor.class);
+  }
+
+  @Nullable
+  public VirtualFile resolveIconFile(PsiType type, @Nullable PsiExpression initializer) {
+    if (initializer == null || !initializer.isValid() || !isIconClassType(type)) {
+      return null;
+    }
+
+    final List<FileReference> refs = new ArrayList<FileReference>();
+    initializer.accept(new JavaRecursiveElementWalkingVisitor() {
+      @Override
+      public void visitElement(PsiElement element) {
+        if (element instanceof PsiLiteralExpression) {
+          for (PsiReference ref : element.getReferences()) {
+            if (ref instanceof FileReference) {
+              refs.add((FileReference)ref);
+            }
+          }
+        }
+        super.visitElement(element);
+      }
+    });
+
+    for (FileReference ref : refs) {
+      final PsiFileSystemItem psiFileSystemItem = ref.resolve();
+      VirtualFile file = null;
+      if (psiFileSystemItem == null) {
+        final ResolveResult[] results = ref.multiResolve(false);
+        for (ResolveResult result : results) {
+          final PsiElement element = result.getElement();
+          if (element instanceof PsiBinaryFile) {
+            file = ((PsiFile)element).getVirtualFile();
+            break;
+          }
+        }
+      }
+      else {
+        file = psiFileSystemItem.getVirtualFile();
+      }
+
+      if (file == null || file.isDirectory() ||
+          !isIconFileExtension(file.getExtension()) ||
+          file.getLength() > ICON_MAX_SIZE) {
+        continue;
+      }
+
+      return file;
+    }
+    return null;
+  }
+
+  @Nullable
+  public Icon getIcon(@NotNull VirtualFile file) {
+    final String path = file.getPath();
+    final long stamp = file.getModificationStamp();
+    Pair<Long, Icon> iconInfo = iconsCache.get(path);
+    if (iconInfo == null || iconInfo.getFirst() < stamp) {
+      try {
+        final Icon icon = createOrFindBetterIcon(file, isIdeaProject(myProject));
+        iconInfo = new Pair<Long, Icon>(stamp, hasProperSize(icon) ? icon : null);
+        iconsCache.put(file.getPath(), iconInfo);
+      }
+      catch (Exception e) {//
+        iconInfo = null;
+        iconsCache.remove(path);
+      }
+    }
+    return iconInfo == null ? null : iconInfo.getSecond();
+  }
+
+  public static boolean isIconClassType(PsiType type) {
+    return InheritanceUtil.isInheritor(type, JAVAX_SWING_ICON);
+  }
+
+  private static boolean isIconFileExtension(String extension) {
+    return extension != null && ICON_EXTENSIONS.contains(extension.toLowerCase(Locale.US));
+  }
+
+  private static boolean hasProperSize(Icon icon) {
+    return icon.getIconHeight() <= ICON_MAX_HEIGHT &&
+           icon.getIconWidth() <= ICON_MAX_WEIGHT;
+  }
+
+  private static boolean isIdeaProject(Project project) {
+    if (project == null) return false;
+    VirtualFile baseDir = project.getBaseDir();
+    return baseDir != null && (baseDir.findChild("idea.iml") != null || baseDir.findChild("community-main.iml") != null);
+  }
+
+  private static Icon createOrFindBetterIcon(VirtualFile file, boolean useIconLoader) throws IOException {
+    if (useIconLoader) {
+      return IconLoader.findIcon(new File(file.getPath()).toURI().toURL());
+    }
+    return new ImageIcon(file.contentsToByteArray());
+  }
+}
index 9e19383fd45b734c887690983997a98aa603ef0b..1e77a4cb936e91a1f6c8cef674cdbb7357ff3f85 100644 (file)
@@ -37,6 +37,8 @@ public enum JavaSdkVersion {
   JDK_1_8(LanguageLevel.JDK_1_8, "1.8"),
   JDK_1_9(LanguageLevel.JDK_1_9, "1.9");
 
+  private static final JavaSdkVersion MAX_JDK = JDK_1_9;
+
   private final LanguageLevel myMaxLanguageLevel;
   private final String myDescription;
 
@@ -81,6 +83,9 @@ public enum JavaSdkVersion {
     if (languageLevel == LanguageLevel.JDK_1_3) {
       return JDK_1_3;
     }
+    if (languageLevel == LanguageLevel.JDK_X) {
+      return MAX_JDK;
+    }
     for (JavaSdkVersion version : values()) {
       if (version.getMaxLanguageLevel().isAtLeast(languageLevel)) {
         return version;
index 176474cbc4d343cc6cc4d72d6809e2b6573ab68c..b0e03a7c8824d4d69be5ad443bd5ed0edefca830 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@ import com.intellij.openapi.roots.LanguageLevelModuleExtension;
 import com.intellij.openapi.roots.LanguageLevelProjectExtension;
 import com.intellij.openapi.util.Key;
 import org.jetbrains.annotations.Nls;
-import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
@@ -36,7 +35,8 @@ public enum LanguageLevel {
   JDK_1_6("Java 6", JavaCoreBundle.message("jdk.1.6.language.level.description")),
   JDK_1_7("Java 7", JavaCoreBundle.message("jdk.1.7.language.level.description")),
   JDK_1_8("Java 8", JavaCoreBundle.message("jdk.1.8.language.level.description")),
-  JDK_1_9("Java 9", JavaCoreBundle.message("jdk.1.9.language.level.description"));
+  JDK_1_9("Java 9", JavaCoreBundle.message("jdk.1.9.language.level.description")),
+  JDK_X("Java X", JavaCoreBundle.message("jdk.X.language.level.description"));
 
   public static final LanguageLevel HIGHEST = JDK_1_8; // TODO! when language level 9 is really supported, update this field
   public static final Key<LanguageLevel> KEY = Key.create("LANGUAGE_LEVEL");
@@ -44,13 +44,12 @@ public enum LanguageLevel {
   private final String myName;
   private final String myPresentableText;
 
-  LanguageLevel(@NotNull @NonNls String name, @NotNull @Nls String presentableText) {
+  LanguageLevel(@NotNull String name, @NotNull @Nls String presentableText) {
     myName = name;
     myPresentableText = presentableText;
   }
 
   @NotNull
-  @NonNls
   public String getName() {
     return myName;
   }
index 5ff783532c04ba0f70fb508160d5cf7074638a6f..c64bfa9814c965fa40f5f0e4cc47cf8184962a2c 100644 (file)
@@ -7,4 +7,6 @@ jdk.1.5.language.level.description=5.0 - 'enum' keyword, generics, autoboxing et
 jdk.1.6.language.level.description=6 - @Override in interfaces
 jdk.1.7.language.level.description=7 - Diamonds, ARM, multi-catch etc.
 jdk.1.8.language.level.description=8 - Lambdas, type annotations etc.
-jdk.1.9.language.level.description=9 - Jigsaw project etc.
+jdk.1.9.language.level.description=9 - JDK modularization etc.
+
+jdk.X.language.level.description=X - Experimental features
index 1eb16b3f03d174dad9a9bd1b3e21dc740720b8cb..572707325034597d738f8e0d64116b5b06a49184 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -21,8 +21,6 @@ import com.intellij.lang.impl.PsiBuilderAdapter;
 import com.intellij.lang.java.JavaLanguage;
 import com.intellij.lang.java.JavaParserDefinition;
 import com.intellij.lexer.Lexer;
-import com.intellij.openapi.application.Application;
-import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Condition;
 import com.intellij.openapi.util.Key;
@@ -38,7 +36,6 @@ import com.intellij.psi.impl.source.tree.TreeUtil;
 import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.tree.TokenSet;
 import com.intellij.psi.util.PsiUtil;
-import com.intellij.util.SystemProperties;
 import com.intellij.util.indexing.IndexingDataKeys;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -122,12 +119,6 @@ public class JavaParserUtil {
   public static final WhitespacesAndCommentsBinder SPECIAL_PRECEDING_COMMENT_BINDER = new PrecedingWhitespacesAndCommentsBinder(true);
   public static final WhitespacesAndCommentsBinder TRAILING_COMMENT_BINDER = new TrailingWhitespacesAndCommentsBinder();
 
-  public static final boolean EXPERIMENTAL_FEATURES;
-  static {
-    Application app = ApplicationManager.getApplication();
-    EXPERIMENTAL_FEATURES = SystemProperties.getBooleanProperty("idea.experimental.java.features", app != null && app.isUnitTestMode());
-  }
-
   private JavaParserUtil() { }
 
   public static void setLanguageLevel(final PsiBuilder builder, final LanguageLevel level) {
index a2eb9047c2a84e89c6b87e4ecff519d0e3b7f73a..ced52aa0c29a6cde46b05f92b293f08e5498e734 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -102,15 +102,20 @@ public class ReferenceParser {
     if (expect(builder, ElementType.PRIMITIVE_TYPE_BIT_SET)) {
       typeInfo.isPrimitive = true;
     }
-    else if (tokenType == JavaTokenType.IDENTIFIER) {
-      parseJavaCodeReference(builder, isSet(flags, EAT_LAST_DOT), true, false, false, false, isSet(flags, DIAMONDS), typeInfo);
-    }
-    else if ((isSet(flags, WILDCARD) || badWildcard) && tokenType == JavaTokenType.QUEST) {
-      builder.advanceLexer();
+    else if ((isSet(flags, WILDCARD) || badWildcard) && (tokenType == JavaTokenType.QUEST || isKeywordAny(builder))) {
+      if (tokenType == JavaTokenType.QUEST) {
+        builder.advanceLexer();
+      }
+      else {
+        dummy(builder);
+      }
       completeWildcardType(builder, isSet(flags, WILDCARD), type);
       typeInfo.marker = type;
       return typeInfo;
     }
+    else if (tokenType == JavaTokenType.IDENTIFIER) {
+      parseJavaCodeReference(builder, isSet(flags, EAT_LAST_DOT), true, false, false, false, isSet(flags, DIAMONDS), typeInfo);
+    }
     else if (isSet(flags, DIAMONDS) && tokenType == JavaTokenType.GT) {
       emptyElement(builder, JavaElementType.DIAMOND_TYPE);
       type.done(JavaElementType.TYPE);
@@ -344,10 +349,8 @@ public class ReferenceParser {
 
     myParser.getDeclarationParser().parseAnnotations(builder);
 
-    if (EXPERIMENTAL_FEATURES && "any".equals(builder.getTokenText()) && getLanguageLevel(builder).isAtLeast(LanguageLevel.JDK_1_9)) {
-      PsiBuilder.Marker mark = builder.mark();
-      builder.advanceLexer();
-      mark.done(JavaElementType.DUMMY_ELEMENT);
+    if (isKeywordAny(builder)) {
+      dummy(builder);
     }
 
     final boolean wild = expect(builder, JavaTokenType.QUEST);
@@ -368,8 +371,7 @@ public class ReferenceParser {
   }
 
   @NotNull
-  public PsiBuilder.Marker parseReferenceList(final PsiBuilder builder, final IElementType start,
-                                              @Nullable final IElementType type, final IElementType delimiter) {
+  public PsiBuilder.Marker parseReferenceList(PsiBuilder builder, IElementType start, @Nullable IElementType type, IElementType delimiter) {
     final PsiBuilder.Marker element = builder.mark();
 
     if (expect(builder, start)) {
@@ -392,4 +394,14 @@ public class ReferenceParser {
     }
     return element;
   }
+
+  private static boolean isKeywordAny(PsiBuilder builder) {
+    return getLanguageLevel(builder).isAtLeast(LanguageLevel.JDK_X) && "any".equals(builder.getTokenText());
+  }
+
+  private static void dummy(PsiBuilder builder) {
+    PsiBuilder.Marker mark = builder.mark();
+    builder.advanceLexer();
+    mark.done(JavaElementType.DUMMY_ELEMENT);
+  }
 }
index 2c482367abd64669dde347e24dd53df7f62aafea..7014b1efb420ccfd417603d79416abd2cc1a9305 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -37,16 +37,16 @@ import org.jetbrains.annotations.Nullable;
 import java.util.*;
 
 /**
- * Created by kosyakov on 05.12.14.
+ * @author kosyakov
+ * @since 05.12.2014
  */
 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;
+    myProject = project;
+    myFileManager = javaFileManager;
   }
 
   @Override
@@ -164,7 +164,8 @@ public class PsiElementFinderImpl extends PsiElementFinder implements DumbAware
                                            @NotNull final Processor<PsiDirectory> consumer,
                                            boolean includeLibrarySources) {
     final PsiManager psiManager = PsiManager.getInstance(myProject);
-    return PackageIndex.getInstance(myProject).getDirsByPackageName(psiPackage.getQualifiedName(), includeLibrarySources)
+    return PackageIndex.getInstance(myProject)
+      .getDirsByPackageName(psiPackage.getQualifiedName(), includeLibrarySources)
       .forEach(new ReadActionProcessor<VirtualFile>() {
         @Override
         public boolean processInReadAction(final VirtualFile dir) {
index 1786bd719755a542f59e71c1943d9e09b9ab9300..2adc60fbfac78189a5fa032f1ca2bae38847c900 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@ import com.intellij.lang.ASTNode;
 import com.intellij.psi.*;
 import com.intellij.psi.augment.PsiAugmentProvider;
 import com.intellij.psi.impl.PsiImplUtil;
-import com.intellij.psi.impl.source.codeStyle.CodeEditUtil;
 import com.intellij.psi.impl.source.tree.CompositePsiElement;
 import com.intellij.psi.impl.source.tree.ElementType;
 import com.intellij.psi.impl.source.tree.JavaElementType;
@@ -124,7 +123,8 @@ public class PsiTypeElementImpl extends CompositePsiElement implements PsiTypeEl
         type = PsiEllipsisType.createEllipsis(type, array);
       }
 
-      if (PsiUtil.isJavaToken(child, JavaTokenType.QUEST)) {
+      if (PsiUtil.isJavaToken(child, JavaTokenType.QUEST) ||
+          child instanceof ASTNode && ((ASTNode)child).getElementType() == JavaElementType.DUMMY_ELEMENT && "any".equals(child.getText())) {
         assert type == null : this;
         PsiElement boundKind = PsiTreeUtil.skipSiblingsForward(child, PsiComment.class, PsiWhiteSpace.class);
         PsiElement boundType = PsiTreeUtil.skipSiblingsForward(boundKind, PsiComment.class, PsiWhiteSpace.class);
index 74092851e57953a9b95d6c9501291693e844476b..7b24a96ff03dcaabd056083c2bce2d67b920d15d 100644 (file)
@@ -117,9 +117,8 @@ public class PsiLambdaExpressionImpl extends ExpressionPsiElement implements Psi
           return false;
         }
       }
-      catch (AnalysisCanceledException e) {
-        return false;
-      }
+      //error would be shown inside body
+      catch (AnalysisCanceledException ignore) {}
 
       for (PsiReturnStatement statement : PsiUtil.findReturnStatements((PsiCodeBlock)body)) {
         if (statement.getReturnValue() == null) {
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting9/ValueTypes.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/advHighlighting9/ValueTypes.java
new file mode 100644 (file)
index 0000000..570d01a
--- /dev/null
@@ -0,0 +1,10 @@
+class C<X, any Y> { }
+
+class Test {
+  void m(C<?, any> c) { }
+
+  void test() {
+    C<String, int> c = new C<String, int>();
+    m(c);
+  }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ControlFlowAnalysisFailedValueCompatibilityUnchanged.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/newLambda/ControlFlowAnalysisFailedValueCompatibilityUnchanged.java
new file mode 100644 (file)
index 0000000..e2ff4cf
--- /dev/null
@@ -0,0 +1,15 @@
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+class Test {
+  public static void processDifference(final Stream<String> stream, final Stream<String> cells) {
+    stream.map(rule -> {
+      try {
+        return cells.collect(Collectors.toMap(c -> c, null));
+      } finally {
+        System.out.println(<error descr="')' expected"><error descr="Expression expected">;</error></error><error descr="Unexpected token">)</error>;
+      }
+    });
+  }
+
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/references/AnyTypeArgs.txt b/java/java-tests/testData/psi/parser-partial/references/AnyTypeArgs.txt
new file mode 100644 (file)
index 0000000..f09448d
--- /dev/null
@@ -0,0 +1,28 @@
+PsiJavaFile:AnyTypeArgs.java
+  PsiTypeElement:T<E_SRC, any, E_DST, ?>
+    PsiJavaCodeReferenceElement:T<E_SRC, any, E_DST, ?>
+      PsiIdentifier:T('T')
+      PsiReferenceParameterList
+        PsiJavaToken:LT('<')
+        PsiTypeElement:E_SRC
+          PsiJavaCodeReferenceElement:E_SRC
+            PsiIdentifier:E_SRC('E_SRC')
+            PsiReferenceParameterList
+              <empty list>
+        PsiJavaToken:COMMA(',')
+        PsiWhiteSpace(' ')
+        PsiTypeElement:any
+          PsiElement(DUMMY_ELEMENT)
+            PsiIdentifier:any('any')
+        PsiJavaToken:COMMA(',')
+        PsiWhiteSpace(' ')
+        PsiTypeElement:E_DST
+          PsiJavaCodeReferenceElement:E_DST
+            PsiIdentifier:E_DST('E_DST')
+            PsiReferenceParameterList
+              <empty list>
+        PsiJavaToken:COMMA(',')
+        PsiWhiteSpace(' ')
+        PsiTypeElement:?
+          PsiJavaToken:QUEST('?')
+        PsiJavaToken:GT('>')
\ No newline at end of file
similarity index 80%
rename from java/java-tests/testData/psi/parser-partial/references/AnyType.txt
rename to java/java-tests/testData/psi/parser-partial/references/AnyTypeParams.txt
index e8ffbdfec6c887aa26898594743b020c9594eb7a..33f4ecc9e8712be69374dd7e2edfd3d218bcf006 100644 (file)
@@ -1,4 +1,4 @@
-PsiJavaFile:AnyType.java
+PsiJavaFile:AnyTypeParams.java
   PsiTypeParameterList
     PsiJavaToken:LT('<')
     PsiTypeParameter:T
index b27540c6a50d08094d623d15afd083be6df1398f..7c8956b4dfa0f1df17bdae48065f7bdfccf4c211 100644 (file)
@@ -70,6 +70,26 @@ class Foo {
         return isStateForceMailField;
     }
 }
+'''
+  } 
+  
+  public void "test strip is of boolean fields setter"() {
+    myFixture.configureByText 'a.java', '''
+class Foo {
+    boolean isStateForceMailField;
+
+    <caret>
+}
+'''
+    generateSetter()
+    myFixture.checkResult '''
+class Foo {
+    boolean isStateForceMailField;
+
+    public void setStateForceMailField(boolean stateForceMailField) {
+        isStateForceMailField = stateForceMailField;
+    }
+}
 '''
   }
 
index 912947d674599c82740d309094a86662830d11f2..8a7f901744983d0c7b5c82291800fb4042fb4e64 100644 (file)
@@ -46,4 +46,6 @@ public class LightAdvHighlightingJdk9Test extends LightDaemonAnalyzerTestCase {
 
   public void testSafeVarargsApplicability() { doTest(true, false); }
   public void testPrivateInInterfaces() { doTest(false, false); }
+
+  public void testValueTypes() { setLanguageLevel(LanguageLevel.JDK_X); doTest(false, false); }
 }
index 07a7b0930d8347f627e491cfff63901d2b97fb4e..efc6c3c1d9cb65be8c3ce1188c4ed9a29c5681b7 100644 (file)
@@ -199,6 +199,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
     doTest();
   }
 
+  public void testControlFlowAnalysisFailedValueCompatibilityUnchanged() throws Exception {
+    doTest();
+  }
+
   private void doTest() {
     doTest(false);
   }
index 50b9a634cc33052ef333b72c108849b5317f475d..7fd1e5422440e97f92ee92d4bc8023de8606c5ec 100644 (file)
@@ -50,10 +50,8 @@ public class ReferenceParserTest extends JavaParsingTestCase {
   public void testTypeParams7() { doTypeParamsParserTest("<T extends X, Y>"); }
   public void testTypeParams8() { doTypeParamsParserTest("<?>"); }
 
-  public void testAnyType() {
-    setLanguageLevel(LanguageLevel.JDK_1_9);
-    doTypeParamsParserTest("<any T>");
-  }
+  public void testAnyTypeParams() { setLanguageLevel(LanguageLevel.JDK_X); doTypeParamsParserTest("<any T>"); }
+  public void testAnyTypeArgs() { setLanguageLevel(LanguageLevel.JDK_X); doTypeParserTest("T<E_SRC, any, E_DST, ?>"); }
 
   private void doRefParserTest(String text, boolean incomplete) {
     doParserTest(text, builder -> JavaParser.INSTANCE.getReferenceParser().parseJavaCodeReference(builder, incomplete, false, false, false));
index a988c619c722a988bbcfebdedcc3d671c1dec4ac..32f14b2356104c5c701c9c5d1cd0a6dcf406a331 100644 (file)
@@ -17,12 +17,9 @@ package com.intellij.openapi.roots;
 
 import com.intellij.openapi.extensions.ExtensionPointName;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Segment;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.psi.PsiElement;
-import com.intellij.util.containers.ContainerUtil;
 import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
 
 import java.util.Collections;
 import java.util.List;
@@ -42,71 +39,6 @@ public abstract class GeneratedSourcesFilter {
     return false;
   }
 
-  /**
-   * Collect original elements from all filters.
-   */
-  @NotNull
-  public static List<? extends PsiElement> collectAllOriginalElements(@NotNull PsiElement element) {
-    List<PsiElement> result = null;
-    for (GeneratedSourcesFilter filter : EP_NAME.getExtensions()) {
-      result = addAll(filter.getOriginalElements(element), result);
-    }
-    return orEmpty(result);
-  }
-
-  /**
-   * Collect generated elements from all filters.
-   */
-  @NotNull
-  public static List<? extends PsiElement> collectAllGeneratedElements(@NotNull PsiElement element) {
-    List<PsiElement> result = null;
-    for (GeneratedSourcesFilter filter : EP_NAME.getExtensions()) {
-      result = addAll(filter.getGeneratedElements(element), result);
-    }
-    return orEmpty(result);
-  }
-
-  /**
-   * Collect original locations from all filters.
-   */
-  @NotNull
-  public static List<? extends LocationInFile> collectAllOriginalLocations(@NotNull Project project,
-                                                                           @NotNull VirtualFile file,
-                                                                           @Nullable Segment segment) {
-    List<LocationInFile> result = null;
-    for (GeneratedSourcesFilter filter : EP_NAME.getExtensions()) {
-      result = addAll(filter.getOriginalLocations(project, file, segment), result);
-    }
-    return orEmpty(result);
-  }
-
-  /**
-   * Collect generated locations from all filters.
-   */
-  @NotNull
-  public static List<? extends LocationInFile> collectAllGeneratedLocations(@NotNull Project project,
-                                                                            @NotNull VirtualFile file,
-                                                                            @Nullable Segment segment) {
-    List<LocationInFile> result = null;
-    for (GeneratedSourcesFilter filter : EP_NAME.getExtensions()) {
-      result = addAll(filter.getGeneratedLocations(project, file, segment), result);
-    }
-    return orEmpty(result);
-  }
-
-  private static <T> List<T> addAll(List<? extends T> elements, List<T> result) {
-    if (result == null) {
-      return ContainerUtil.newArrayList(elements);
-    }
-    result.addAll(elements);
-    return result;
-  }
-
-  private static <T> List<T> orEmpty(List<T> elements) {
-    if (elements != null) return elements;
-    return Collections.emptyList();
-  }
-
   public abstract boolean isGeneratedSource(@NotNull VirtualFile file, @NotNull Project project);
 
   /**
@@ -119,88 +51,4 @@ public abstract class GeneratedSourcesFilter {
   public List<? extends PsiElement> getOriginalElements(@NotNull PsiElement element) {
     return Collections.emptyList();
   }
-
-  /**
-   * Returns all elements that have been generated from the given element.
-   *
-   * @param element the generated element
-   * @return a list of generated elements. An empty result indicates that no elements are known to be generated from the given element.
-   */
-  @NotNull
-  public List<? extends PsiElement> getGeneratedElements(@NotNull PsiElement element) {
-    return Collections.emptyList();
-  }
-
-  /**
-   * Returns all locations that have been processed by a code generator to generate the given location.
-   *
-   * @return a list of locations. An empty result indicates that the given segment is not considered to be generated by the filter.
-   */
-  @NotNull
-  public List<? extends LocationInFile> getOriginalLocations(@NotNull Project project,
-                                                             @NotNull VirtualFile file,
-                                                             @Nullable Segment segment) {
-    return Collections.emptyList();
-  }
-
-  /**
-   * Returns all locations that have been generated from the given location.
-   *
-   * @return a list of locations. An empty result indicates that no locations are known to be generated from the given segments.
-   */
-  @NotNull
-  public List<? extends LocationInFile> getGeneratedLocations(@NotNull Project project,
-                                                              @NotNull VirtualFile file,
-                                                              @Nullable Segment segment) {
-    return Collections.emptyList();
-  }
-
-  public static class LocationInFile {
-
-    @NotNull private final VirtualFile myFile;
-    @Nullable private final Segment mySegment;
-
-    public LocationInFile(@NotNull VirtualFile file, @Nullable Segment segment) {
-      myFile = file;
-      mySegment = segment;
-    }
-
-    @NotNull
-    public VirtualFile getFile() {
-      return myFile;
-    }
-
-    @Nullable
-    public Segment getSegment() {
-      return mySegment;
-    }
-
-    @Override
-    public String toString() {
-      return "LocationInFile{" +
-             "myFile=" + myFile +
-             ", mySegment=" + mySegment +
-             '}';
-    }
-
-    @Override
-    public boolean equals(Object o) {
-      if (this == o) return true;
-      if (o == null || getClass() != o.getClass()) return false;
-
-      LocationInFile that = (LocationInFile)o;
-
-      if (!myFile.equals(that.myFile)) return false;
-      if (mySegment != null ? !mySegment.equals(that.mySegment) : that.mySegment != null) return false;
-
-      return true;
-    }
-
-    @Override
-    public int hashCode() {
-      int result = myFile.hashCode();
-      result = 31 * result + (mySegment != null ? mySegment.hashCode() : 0);
-      return result;
-    }
-  }
 }
index c41297afad0bed5ff45b504f30d41a7cf7571b0c..ea3c4bd20d07436e30e21913735aea143e888c1a 100644 (file)
@@ -17,7 +17,6 @@ package com.intellij.profile.codeInspection;
 
 import com.intellij.openapi.Disposable;
 import com.intellij.openapi.components.ServiceManager;
-import com.intellij.openapi.components.StoragePathMacros;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.profile.ApplicationProfileManager;
 import com.intellij.profile.Profile;
@@ -38,7 +37,6 @@ import java.util.List;
  */
 public abstract class InspectionProfileManager extends ApplicationProfileManager implements SeverityProvider {
   @NonNls public static final String INSPECTION_DIR = "inspection";
-  @NonNls public static final String FILE_SPEC = StoragePathMacros.ROOT_CONFIG + '/' + INSPECTION_DIR;
 
   private final List<ProfileChangeAdapter> myProfileChangeAdapters = ContainerUtil.createLockFreeCopyOnWriteList();
 
diff --git a/platform/configuration-store-impl/configuration-store-impl.iml b/platform/configuration-store-impl/configuration-store-impl.iml
new file mode 100644 (file)
index 0000000..64b1869
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/testSrc" isTestSource="true" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="library" name="KotlinJavaRuntime" level="project" />
+    <orderEntry type="module" module-name="util" />
+    <orderEntry type="module" module-name="core-api" />
+    <orderEntry type="module" module-name="platform-api" />
+    <orderEntry type="module" module-name="projectModel-impl" />
+    <orderEntry type="library" scope="TEST" name="JUnit4" level="project" />
+    <orderEntry type="module" module-name="testFramework" scope="TEST" />
+    <orderEntry type="module" module-name="platform-impl" />
+  </component>
+</module>
\ No newline at end of file
diff --git a/platform/configuration-store-impl/src/SchemeManagerFactoryImpl.kt b/platform/configuration-store-impl/src/SchemeManagerFactoryImpl.kt
new file mode 100644 (file)
index 0000000..03c9a33
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.configurationStore
+
+import com.intellij.openapi.application.ApplicationManager
+import com.intellij.openapi.components.RoamingType
+import com.intellij.openapi.components.SettingsSavingComponent
+import com.intellij.openapi.components.StoragePathMacros
+import com.intellij.openapi.components.impl.stores.IComponentStore
+import com.intellij.openapi.diagnostic.Logger
+import com.intellij.openapi.options.*
+import com.intellij.util.SmartList
+import com.intellij.util.containers.ContainerUtil
+import com.intellij.util.lang.CompoundRuntimeException
+import java.io.File
+
+private val LOG = Logger.getInstance(javaClass<SchemeManagerFactoryImpl>())
+
+public class SchemeManagerFactoryImpl : SchemesManagerFactory(), SettingsSavingComponent {
+  private val myRegisteredManagers = ContainerUtil.createLockFreeCopyOnWriteList<SchemeManagerImpl<Scheme, ExternalizableScheme>>()
+
+  override fun <T : Scheme, E : ExternalizableScheme> createSchemesManager(directoryName: String, processor: SchemeProcessor<E>, roamingType: RoamingType): SchemesManager<T, E> {
+    val storageManager = (ApplicationManager.getApplication().getPicoContainer().getComponentInstance(javaClass<IComponentStore>()) as IComponentStore).getStateStorageManager()
+
+    val fileSpec = if (directoryName.startsWith('$')) directoryName else "${StoragePathMacros.ROOT_CONFIG}/$directoryName"
+    val manager = SchemeManagerImpl<T, E>(fileSpec, processor, roamingType, storageManager.getStreamProvider(), File(storageManager.expandMacros(fileSpec)))
+    @suppress("CAST_NEVER_SUCCEEDS")
+    myRegisteredManagers.add(manager as SchemeManagerImpl<Scheme, ExternalizableScheme>)
+    return manager
+  }
+
+  public fun process(processor: (SchemeManagerImpl<Scheme, ExternalizableScheme>) -> Unit) {
+    for (manager in myRegisteredManagers) {
+      try {
+        processor(manager)
+      }
+      catch (e: Throwable) {
+        LOG.error("Cannot reload settings for ${manager.javaClass.getName()}", e)
+      }
+    }
+  }
+
+  override fun save() {
+    val errors = SmartList<Throwable>()
+    for (registeredManager in myRegisteredManagers) {
+      try {
+        registeredManager.save(errors)
+      }
+      catch (e: Throwable) {
+        errors.add(e)
+      }
+
+    }
+
+    CompoundRuntimeException.doThrow(errors)
+  }
+}
similarity index 98%
rename from platform/platform-impl/src/com/intellij/openapi/options/SchemeManagerImpl.kt
rename to platform/configuration-store-impl/src/SchemeManagerImpl.kt
index 136dfcf88402741599c11f0af563a254b7238fd1..27c8c15a9337c8ba60080bcc3caaca7a8ccd3747 100644 (file)
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.intellij.openapi.options
+package com.intellij.configurationStore
 
 import com.intellij.openapi.application.AccessToken
 import com.intellij.openapi.application.ApplicationManager
@@ -28,6 +28,7 @@ import com.intellij.openapi.components.impl.stores.StreamProvider
 import com.intellij.openapi.components.service
 import com.intellij.openapi.diagnostic.Logger
 import com.intellij.openapi.extensions.AbstractExtensionPointBean
+import com.intellij.openapi.options.*
 import com.intellij.openapi.util.Comparing
 import com.intellij.openapi.util.Condition
 import com.intellij.openapi.util.JDOMUtil
@@ -53,13 +54,11 @@ import java.io.InputStream
 import java.util.ArrayList
 import java.util.Collections
 
-val LOG = Logger.getInstance(javaClass<SchemesManagerFactoryImpl>())
-
 public class SchemeManagerImpl<T : Scheme, E : ExternalizableScheme>(private val fileSpec: String,
-                                                                      private val processor: SchemeProcessor<E>,
-                                                                      private val roamingType: RoamingType,
-                                                                      private val provider: StreamProvider?,
-                                                                      private val ioDirectory: File) : SchemesManager<T, E>(), SafeWriteRequestor {
+                                                                     private val processor: SchemeProcessor<E>,
+                                                                     private val roamingType: RoamingType,
+                                                                     private val provider: StreamProvider?,
+                                                                     private val ioDirectory: File) : SchemesManager<T, E>(), SafeWriteRequestor {
   private val schemes = ArrayList<T>()
   private val readOnlyExternalizableSchemes = THashMap<String, E>()
 
@@ -511,7 +510,6 @@ public class SchemeManagerImpl<T : Scheme, E : ExternalizableScheme>(private val
       if (renamed) {
         file = dir.findChild(externalInfo!!.fileName)
         if (file != null) {
-          runWriteAction {  }
           runWriteAction {
             file!!.rename(this, fileName)
           }
similarity index 98%
rename from platform/platform-impl/src/com/intellij/openapi/components/impl/stores/DefaultProjectStoreImpl.java
rename to platform/configuration-store-impl/src/com/intellij/openapi/components/impl/stores/DefaultProjectStoreImpl.java
index bcef9a16761bdba0ceb8d49f993bff052896f81d..a9e3170d0071183cbca5056d8cd4c200df331908 100644 (file)
@@ -163,13 +163,6 @@ public class DefaultProjectStoreImpl extends ProjectStoreImpl {
     };
   }
 
-  @Override
-  public void load() {
-    if (myProjectManager.getDefaultProjectRootElement() != null) {
-      super.load();
-    }
-  }
-
   private static class MyExternalizationSession implements StateStorageManager.ExternalizationSession {
     @NotNull final StateStorage.ExternalizationSession externalizationSession;
 
 package com.intellij.openapi.components.impl.stores;
 
 import com.intellij.openapi.project.impl.ProjectStoreClassProvider;
+import org.jetbrains.annotations.NotNull;
 
-/**
- * @author mike
- */
 public class PlatformProjectStoreClassProvider implements ProjectStoreClassProvider {
-  public Class<? extends IComponentStore> getProjectStoreClass(final boolean isDefaultProject) {
+  @NotNull
+  public Class<? extends IComponentStore> getProjectStoreClass(boolean isDefaultProject) {
     return isDefaultProject ? DefaultProjectStoreImpl.class : ProjectStoreImpl.class;
   }
-}
+}
\ No newline at end of file
similarity index 97%
rename from platform/platform-tests/testSrc/com/intellij/options/MockStreamProvider.kt
rename to platform/configuration-store-impl/testSrc/MockStreamProvider.kt
index e7ed0ff3b4958a7ed53bb40cd64de420a8a7d87f..4e813445c43f129579a3270c2b3c1ddd982a8cd1 100644 (file)
@@ -1,4 +1,4 @@
-package com.intellij.options
+package com.intellij.configurationStore
 
 import com.intellij.openapi.components.RoamingType
 import com.intellij.openapi.components.impl.stores.StreamProvider
similarity index 99%
rename from platform/platform-tests/testSrc/com/intellij/options/SchemeManagerTest.kt
rename to platform/configuration-store-impl/testSrc/SchemeManagerTest.kt
index fffcb55dda35b6b59df70afcb268fe168d0c9a70..16d3ae1c658dbf9e6cf199c9e7053adee3ac2f02 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.intellij.options
+package com.intellij.configurationStore
 
 import com.intellij.openapi.application.invokeAndWaitIfNeed
 import com.intellij.openapi.components.RoamingType
 import com.intellij.openapi.options.BaseSchemeProcessor
 import com.intellij.openapi.options.ExternalizableScheme
-import com.intellij.openapi.options.SchemeManagerImpl
 import com.intellij.openapi.util.JDOMUtil
 import com.intellij.openapi.util.io.BufferExposingByteArrayOutputStream
 import com.intellij.openapi.util.io.FileUtil
index 667a9203cac70943c384b5069f00e7808224ab26..987506a2646201c05ca0025aadf9784f329cb72f 100644 (file)
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
 
 public abstract class SchemesManagerFactory {
   @NotNull
-  public abstract <T extends Scheme, E extends ExternalizableScheme> SchemesManager<T, E> createSchemesManager(@NotNull String fileSpec,
+  public abstract <T extends Scheme, E extends ExternalizableScheme> SchemesManager<T, E> createSchemesManager(@NotNull String directoryName,
                                                                                                                @NotNull SchemeProcessor<E> processor,
                                                                                                                @NotNull RoamingType roamingType);
 
index f305b6e77f5c278df537b06cad49037d7ede58b4..f3cb61eb8ec9069fad553a506ee56e7ea75a9865 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -530,6 +530,9 @@ public class PsiTreeUtil {
     }
 
     if (strict) {
+      if (element instanceof PsiFile) {
+        return null;
+      }
       element = element.getParent();
     }
 
@@ -555,6 +558,7 @@ public class PsiTreeUtil {
                                                          @NotNull Class<? extends PsiElement>... stopAt) {
     if (element == null) return null;
     if (strict) {
+      if (element instanceof PsiFile) return null;
       element = element.getParent();
     }
 
@@ -608,7 +612,7 @@ public class PsiTreeUtil {
   @Contract("null, _ -> null")
   public static <T extends PsiElement> T getParentOfType(@Nullable final PsiElement element,
                                                          @NotNull final Class<? extends T>... classes) {
-    if (element == null) return null;
+    if (element == null || element instanceof PsiFile) return null;
     PsiElement parent = element.getParent();
     if (parent == null) return null;
     return getNonStrictParentOfType(parent, classes);
index 6d93fd99a32c2d3a70812a23d1f956d29e7a275b..e57a2b6e112a011bbb6c0ab9790bdbe73da17a9f 100644 (file)
@@ -11,5 +11,6 @@
     <orderEntry type="library" name="picocontainer" level="project" />
     <orderEntry type="module" module-name="boot" />
     <orderEntry type="library" name="Guava" level="project" />
+    <orderEntry type="library" name="KotlinJavaRuntime" level="project" />
   </component>
 </module>
\ No newline at end of file
index db5bee21cf69ee2f3fd4fe7e9d781fcd6501d803..1287961c34745da23f0a3ef114ab20b4a4e6148c 100644 (file)
@@ -27,7 +27,7 @@ import java.util.List;
  * Class for the text comparison
  * CharSequences should to have '\n' as line separator
  * <p/>
- * It's good idea not to compare String due to expensive subSequence() implementation. Try to wrap into CharSequenceSubSequence.
+ * It's good idea not to compare String due to expensive subSequence() implementation. Use CharSequenceSubSequence.
  */
 public abstract class ComparisonManager {
   @NotNull
@@ -35,12 +35,18 @@ public abstract class ComparisonManager {
     return ServiceManager.getService(ComparisonManager.class);
   }
 
+  /**
+   * Compare two texts by-line
+   */
   @NotNull
   public abstract List<LineFragment> compareLines(@NotNull CharSequence text1,
                                                   @NotNull CharSequence text2,
                                                   @NotNull ComparisonPolicy policy,
                                                   @NotNull ProgressIndicator indicator) throws DiffTooBigException;
 
+  /**
+   * Compare two texts by-line and then compare changed fragments by-word
+   */
   @NotNull
   public abstract List<LineFragment> compareLinesInner(@NotNull CharSequence text1,
                                                        @NotNull CharSequence text2,
@@ -54,27 +60,46 @@ public abstract class ComparisonManager {
                                                        @NotNull ComparisonPolicy policy,
                                                        @NotNull ProgressIndicator indicator) throws DiffTooBigException;
 
+  /**
+   * Compare two texts by-word
+   */
   @NotNull
   public abstract List<DiffFragment> compareWords(@NotNull CharSequence text1,
                                                   @NotNull CharSequence text2,
                                                   @NotNull ComparisonPolicy policy,
                                                   @NotNull ProgressIndicator indicator) throws DiffTooBigException;
 
+  /**
+   * Compare two texts by-char
+   */
   @NotNull
   public abstract List<DiffFragment> compareChars(@NotNull CharSequence text1,
                                                   @NotNull CharSequence text2,
                                                   @NotNull ComparisonPolicy policy,
                                                   @NotNull ProgressIndicator indicator) throws DiffTooBigException;
 
+  /**
+   * Check if two texts are equal using ComparisonPolicy
+   */
   public abstract boolean isEquals(@NotNull CharSequence text1, @NotNull CharSequence text2, @NotNull ComparisonPolicy policy);
 
   //
   // Post process line fragments
   //
 
+  /**
+   * compareLinesInner() comparison can produce adjustment line chunks. This method allows to squash shem.
+   *
+   * ex: "A\nB" vs "A X\nB Y" will result to two LineFragments: [0, 1) - [0, 1) and [1, 2) - [1, 2)
+   *     squash will produce a single fragment: [0, 2) - [0, 2)
+   */
   @NotNull
   public abstract List<LineFragment> squash(@NotNull List<LineFragment> oldFragments);
 
+  /**
+   * @see #squash
+   * @param trim - if leading/trailing LineFragments with equal contents should be skipped
+   */
   @NotNull
   public abstract List<LineFragment> processBlocks(@NotNull List<LineFragment> oldFragments,
                                                    @NotNull final CharSequence text1, @NotNull final CharSequence text2,
index ad5e391e6bba3e20ff0149e74ec2732b2b0450ee..1cb657e6ac74baa7745e92451f9b3aa0c14ccf82 100644 (file)
@@ -28,7 +28,10 @@ public interface LineFragment extends DiffFragment {
 
   int getEndLine2();
 
-  /*
+  /**
+   * High-granularity changes inside line fragment (ex: detected by ByWord)
+   * Offsets of inner changes are relative to the start of LineFragment.
+   *
    * null - no inner similarities was found
    */
   @Nullable
index 417d2450495e21ee71c54be4eabbda820e2ad057..69c86488e81d5b6260988278313fe51ed1e5d5f8 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.util.Consumer;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.diff.FilesTooBigForDiffException;
 import com.intellij.util.text.CharSequenceSubSequence;
+import org.jetbrains.annotations.Contract;
 import org.jetbrains.annotations.NotNull;
 
 import java.util.ArrayList;
@@ -153,7 +154,7 @@ public class ComparisonManagerImpl extends ComparisonManager {
       case DEFAULT:
         return StringUtil.equals(text1, text2);
       case TRIM_WHITESPACES:
-        return StringUtil.equalsTrimWhitespaces(text1, text2);
+        return equalsTrimWhitespaces(text1, text2);
       case IGNORE_WHITESPACES:
         return StringUtil.equalsIgnoreWhitespaces(text1, text2);
       default:
@@ -161,6 +162,37 @@ public class ComparisonManagerImpl extends ComparisonManager {
     }
   }
 
+  @Contract(pure = true)
+  private static boolean equalsTrimWhitespaces(@NotNull CharSequence s1, @NotNull CharSequence s2) {
+    int index1 = 0;
+    int index2 = 0;
+
+    while (true) {
+      boolean lastLine1 = false;
+      boolean lastLine2 = false;
+
+      int end1 = StringUtil.indexOf(s1, '\n', index1) + 1;
+      int end2 = StringUtil.indexOf(s2, '\n', index2) + 1;
+      if (end1 == 0) {
+        end1 = s1.length();
+        lastLine1 = true;
+      }
+      if (end2 == 0) {
+        end2 = s2.length();
+        lastLine2 = true;
+      }
+      if (lastLine1 ^ lastLine2) return false;
+
+      CharSequence line1 = s1.subSequence(index1, end1);
+      CharSequence line2 = s2.subSequence(index2, end2);
+      if (!StringUtil.equalsTrimWhitespaces(line1, line2)) return false;
+
+      index1 = end1;
+      index2 = end2;
+      if (lastLine1) return true;
+    }
+  }
+
   //
   // Post process line fragments
   //
index 0517ad1222e898dd7fa242b3dd66e89db339b326..0a062defa43a07c073698b0d60e53adb63b313c8 100644 (file)
@@ -22,8 +22,6 @@ import java.util.Iterator;
 
 @SuppressWarnings("ConstantConditions")
 abstract class ChangeDiffIterableBase extends DiffIterableBase {
-  // TODO: non-abstract implementation could be faster
-
   private final int myLength1;
   private final int myLength2;
 
index 4bdecdf1451d9d13b4ae2953081e22761b5dd70f..8316ae5f6094cca0127c57d9593e14bfca79c386 100644 (file)
@@ -106,6 +106,7 @@ public class DiffIterableUtil {
 
   @NotNull
   public static FairDiffIterable fair(@NotNull DiffIterable iterable) {
+    if (iterable instanceof FairDiffIterable) return (FairDiffIterable)iterable;
     FairDiffIterable wrapper = new FairDiffIterableWrapper(iterable);
     verifyFair(wrapper);
     return wrapper;
index 94f04eeeade2be24aa31dd1776b4eddba0faeb09..f2ad74200f781f9197a44c09067f096c2f92cf78 100644 (file)
  */
 package com.intellij.diff.comparison.iterables;
 
-/*
- * Matched fragments are guaranteed to have same length
+/**
+ * Elements are compared one-by-one.
+ * If range [a, b) is equal to [a', b'), than element(a + i) is equal to element(a' + i) for all i in [0, b-a)
+ *
+ * Matched fragments are guaranteed to have same length.
  */
 public interface FairDiffIterable extends DiffIterable {
 }
index 02a907e793b633f43b0328a459dfcbf78735967f..392a2f0b3d07074ce011766dc4bec2eeb010f978 100644 (file)
@@ -123,7 +123,7 @@ public class TextDiffViewerUtil {
       for (DiffContent content : contents) {
         message.append(content.toString()).append("\n");
       }
-      LOG.error(new Throwable(message.toString()));
+      LOG.warn(new Throwable(message.toString()));
     }
   }
 
diff --git a/platform/diff-impl/tests/com/intellij/diff/comparison/ComparisonUtilTest.java b/platform/diff-impl/tests/com/intellij/diff/comparison/ComparisonUtilTest.java
new file mode 100644 (file)
index 0000000..fe71a6b
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2000-2015 JetBrains s.r.o.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.diff.comparison;
+
+import com.intellij.testFramework.UsefulTestCase;
+
+public class ComparisonUtilTest extends UsefulTestCase {
+  private static final ComparisonManager manager = new ComparisonManagerImpl();
+
+  public void testTrimEquals() {
+    assertTrue(manager.isEquals("", "", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("", "   ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("   ", "   ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("\n   ", "  \n", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("asd ", "asd  ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("    asd", "asd", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("\n\n\n", "\n\n\n", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("\n  \n  \n ", "  \n \n\n  ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("\n\n", "\n\n\n", ComparisonPolicy.TRIM_WHITESPACES));
+
+    assertFalse(manager.isEquals("\nasd ", "asd\n  ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("\nasd \n", "\n asd\n  ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("x", "y", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("\n", " ", ComparisonPolicy.TRIM_WHITESPACES));
+
+    assertTrue(manager.isEquals("\t ", "", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("", "\t\n \n\t", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("\t", "\n", ComparisonPolicy.TRIM_WHITESPACES));
+
+    assertTrue(manager.isEquals("x", " x", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("x", "x ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("x\n", "x", ComparisonPolicy.TRIM_WHITESPACES));
+
+    assertFalse(manager.isEquals("abc", "a\nb\nc\n", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("\nx y x\n", "\nx y x\n", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("\nxyx\n", "\nx y x\n", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("\nx y x", "\nx y x", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("\nxyx", "\nx y x", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("x y x", "x y x", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("xyx", "x y x", ComparisonPolicy.TRIM_WHITESPACES));
+    assertTrue(manager.isEquals("  x y x  ", "x y x", ComparisonPolicy.TRIM_WHITESPACES));
+
+    assertFalse(manager.isEquals("x", "\t\n ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("", " x ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("", "x ", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("", " x", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("xyx", "xxx", ComparisonPolicy.TRIM_WHITESPACES));
+    assertFalse(manager.isEquals("xyx", "xYx", ComparisonPolicy.TRIM_WHITESPACES));
+  }
+}
index 98d8a0921035cf2d133fb126934b53468a64d5ab..8f3cdb2e5c585de342d46601e249dc11dbd92ad0 100644 (file)
@@ -38,6 +38,8 @@ import java.awt.event.ActionListener;
 import java.io.File;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.regex.Pattern;
 
 /**
@@ -70,9 +72,15 @@ public abstract class CloneDvcsDialog extends DialogWrapper {
   @NotNull private String myDefaultDirectoryName = "";
   @NotNull protected final Project myProject;
   @NotNull protected final String myVcsDirectoryName;
+  @Nullable private final String myDefaultRepoUrl;
 
   public CloneDvcsDialog(@NotNull Project project, @NotNull String displayName, @NotNull String vcsDirectoryName) {
+    this(project, displayName, vcsDirectoryName, null);
+  }
+
+  public CloneDvcsDialog(@NotNull Project project, @NotNull String displayName, @NotNull String vcsDirectoryName, @Nullable String defaultUrl) {
     super(project, true);
+    myDefaultRepoUrl = defaultUrl;
     myProject = project;
     myVcsDirectoryName = vcsDirectoryName;
     init();
@@ -95,23 +103,6 @@ public abstract class CloneDvcsDialog extends DialogWrapper {
     return myDirectoryName.getText();
   }
 
-  @Override
-  public void show() {
-    //noinspection SSBasedInspection
-    SwingUtilities.invokeLater(new Runnable() {
-      @Override
-      public void run() {
-        String repo = System.getProperty("checkout.repo");
-        if (!StringUtil.isEmpty(repo)) {
-          myRepositoryURL.setText(repo);
-          System.setProperty("checkout.repo", "");
-
-        }
-      }
-    });
-    super.show();
-  }
-
   /**
    * Init components
    */
@@ -283,7 +274,11 @@ public abstract class CloneDvcsDialog extends DialogWrapper {
   private void createUIComponents() {
     myRepositoryURL = new EditorComboBox("");
     final DvcsRememberedInputs rememberedInputs = getRememberedInputs();
-    myRepositoryURL.setHistory(ArrayUtil.toObjectArray(rememberedInputs.getVisitedUrls(), String.class));
+    List<String> urls = new ArrayList<String>(rememberedInputs.getVisitedUrls());
+    if (myDefaultRepoUrl != null) {
+      urls.add(0, myDefaultRepoUrl);
+    }
+    myRepositoryURL.setHistory(ArrayUtil.toObjectArray(urls, String.class));
     myRepositoryURL.addDocumentListener(new com.intellij.openapi.editor.event.DocumentAdapter() {
       @Override
       public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) {
index ca2f1e3403c7397eaf6378993224fbb5579dfe60..bd6a05ce46683704c7ffbffc526890808fc5e95f 100644 (file)
@@ -46,6 +46,10 @@ action.attach.external.project.text=Attach {0} project
 action.attach.external.project.description=Attach {0} project to the current ide project
 action.detach.external.project.text=Detach {0} project
 action.detach.external.project.description=Detach selected external project
+action.ignore.external.project.text=Ignore {0} project
+action.ignore.external.project.description=Ignore selected {0} project
+action.unignore.external.project.text=Unignore {0} project
+action.unignore.external.project.description=Unignore selected {0} project
 action.open.config.text=Open {0} config
 action.open.config.description=Allows to open project file of the linked {0} project at the editor
 
index edfd3059c0d1748f5e6bd1058da86f5cfd61f3f3..86e35d1d5aa4095883abed6bc223f3a09ea02437 100644 (file)
 package com.intellij.openapi.externalSystem.model;
 
 import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.UserDataHolderBase;
+import com.intellij.openapi.util.UserDataHolderEx;
 import com.intellij.openapi.util.io.StreamUtil;
 import com.intellij.util.containers.ContainerUtilRt;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
 
 import java.io.*;
 import java.lang.reflect.Modifier;
@@ -39,17 +42,19 @@ import java.util.*;
  * @author Denis Zhdanov
  * @since 4/12/13 11:53 AM
  */
-public class DataNode<T> implements Serializable {
+public class DataNode<T> implements Serializable, UserDataHolderEx {
 
   private static final long serialVersionUID = 1L;
   private static final Logger LOG = Logger.getInstance(DataNode.class);
 
   @NotNull private final List<DataNode<?>> myChildren = ContainerUtilRt.newArrayList();
   @NotNull private transient List<DataNode<?>> myChildrenView = Collections.unmodifiableList(myChildren);
+  @NotNull private transient UserDataHolderBase myUserData = new UserDataHolderBase();
 
   @NotNull private final Key<T> myKey;
   private transient T myData;
   private byte[] myRawData;
+  private boolean myIgnored;
 
   @Nullable private DataNode<?> myParent;
 
@@ -88,6 +93,14 @@ public class DataNode<T> implements Serializable {
     return myData;
   }
 
+  public boolean isIgnored() {
+    return myIgnored;
+  }
+
+  public void setIgnored(boolean ignored) {
+    myIgnored = ignored;
+  }
+
   /**
    * This class is a generic holder for any kind of project data. That project data might originate from different locations, e.g.
    * core ide plugins, non-core ide plugins, third-party plugins etc. That means that when a service from a core plugin needs to
@@ -245,6 +258,7 @@ public class DataNode<T> implements Serializable {
     throws IOException, ClassNotFoundException {
     in.defaultReadObject();
     myChildrenView = Collections.unmodifiableList(myChildren);
+    myUserData = new UserDataHolderBase();
   }
 
   public byte[] getDataBytes() throws IOException {
@@ -313,17 +327,70 @@ public class DataNode<T> implements Serializable {
     myChildren.clear();
   }
 
+  @NotNull
   public DataNode<T> graphCopy() {
-    return nodeCopy(this, null);
+    return сopy(this, null);
   }
 
-  private static <T> DataNode<T> nodeCopy(@NotNull DataNode<T> dataNode, @Nullable DataNode<?> newParent) {
+  @NotNull
+  public DataNode<T> nodeCopy() {
+    return nodeCopy(this);
+  }
+
+  @Nullable
+  @Override
+  public <U> U getUserData(@NotNull com.intellij.openapi.util.Key<U> key) {
+    return (U)myUserData.getUserData(key);
+  }
+
+  @Override
+  public <U> void putUserData(@NotNull com.intellij.openapi.util.Key<U> key, U value) {
+    myUserData.putUserData(key, value);
+  }
+
+  public <U> void removeUserData(@NotNull com.intellij.openapi.util.Key<U> key) {
+    myUserData.putUserData(key, null);
+  }
+
+  @NotNull
+  @Override
+  public <T> T putUserDataIfAbsent(@NotNull com.intellij.openapi.util.Key<T> key, @NotNull T value) {
+    return myUserData.putUserDataIfAbsent(key, value);
+  }
+
+  @Override
+  public <T> boolean replace(@NotNull com.intellij.openapi.util.Key<T> key, @Nullable T oldValue, @Nullable T newValue) {
+    return myUserData.replace(key, oldValue, newValue);
+  }
+
+  public <T> void putCopyableUserData(@NotNull com.intellij.openapi.util.Key<T> key, T value) {
+    myUserData.putCopyableUserData(key, value);
+  }
+
+  public boolean isUserDataEmpty() {
+    return myUserData.isUserDataEmpty();
+  }
+
+  public <T> T getCopyableUserData(@NotNull com.intellij.openapi.util.Key<T> key) {
+    return myUserData.getCopyableUserData(key);
+  }
+
+  @NotNull
+  public static <T> DataNode<T> nodeCopy(@NotNull DataNode<T> dataNode) {
     DataNode<T> copy = new DataNode<T>(dataNode.myKey);
-    copy.myParent = newParent;
     copy.myData = dataNode.myData;
     copy.myRawData = dataNode.myRawData;
+    copy.myIgnored = dataNode.myIgnored;
+    dataNode.myUserData.copyCopyableDataTo(copy.myUserData);
+    return copy;
+  }
+
+  @NotNull
+  private static <T> DataNode<T> сopy(@NotNull DataNode<T> dataNode, @Nullable DataNode<?> newParent) {
+    DataNode<T> copy = nodeCopy(dataNode);
+    copy.myParent = newParent;
     for (DataNode<?> child : dataNode.myChildren) {
-      copy.addChild(nodeCopy(child, copy));
+      copy.addChild(сopy(child, copy));
     }
     return copy;
   }
index 27d20b83be64ea19a837be5720a8869aa8991411..3481e26236433227a927f259592ce8702db9cb9d 100644 (file)
@@ -36,4 +36,6 @@ public interface ExternalProjectInfo {
   long getLastSuccessfulImportTimestamp();
 
   long getLastImportTimestamp();
+
+  ExternalProjectInfo copy();
 }
index 3e25602cb54632f931998446c3db61e84cf9e4f4..32f76849c68dfc6e4821d83c0c0efe04963ab917 100644 (file)
@@ -60,6 +60,10 @@ public class Key<T> implements Serializable, Comparable<Key<?>> {
     return new Key<T>(dataClass.getName(), processingWeight);
   }
 
+  public String getDataType() {
+    return myDataClass;
+  }
+
   /**
    * There is a possible case that when a {@link DataNode} object has children of more than on type (children with more than
    * one different {@link Key} we might want to process one type of children before another. That's why we need a way to define
index 212396c586c0e9164a9d6a2e35d2f8f35bf5fab8..1d8af229bebf57967c6fd1b917fa3bc9d34f5464 100644 (file)
@@ -27,6 +27,7 @@ public class ModuleData extends AbstractNamedData implements Named, ExternalConf
   @NotNull private String myModuleFilePath;
   @Nullable private String group;
   @Nullable private String version;
+  @Nullable private String description;
   @NotNull private List<File> myArtifacts;
 
   private boolean myInheritProjectCompileOutputPath = true;
@@ -127,6 +128,15 @@ public class ModuleData extends AbstractNamedData implements Named, ExternalConf
     this.version = version;
   }
 
+  @Nullable
+  public String getDescription() {
+    return description;
+  }
+
+  public void setDescription(@Nullable String description) {
+    this.description = description;
+  }
+
   @NotNull
   public List<File> getArtifacts() {
     return myArtifacts;
@@ -146,6 +156,7 @@ public class ModuleData extends AbstractNamedData implements Named, ExternalConf
     if (group != null ? !group.equals(that.group) : that.group != null) return false;
     if (!myModuleTypeId.equals(that.myModuleTypeId)) return false;
     if (version != null ? !version.equals(that.version) : that.version != null) return false;
+    if (description != null ? !description.equals(that.description) : that.description != null) return false;
 
     return true;
   }
@@ -156,6 +167,7 @@ public class ModuleData extends AbstractNamedData implements Named, ExternalConf
     result = 31 * result + myModuleTypeId.hashCode();
     result = 31 * result + (group != null ? group.hashCode() : 0);
     result = 31 * result + (version != null ? version.hashCode() : 0);