Merge branch 'master' of git@git.labs.intellij.net:idea/community
authorEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Mon, 19 Apr 2010 11:49:47 +0000 (15:49 +0400)
committerEugene Kudelevsky <Eugene.Kudelevsky@jetbrains.com>
Mon, 19 Apr 2010 11:49:47 +0000 (15:49 +0400)
593 files changed:
.idea/libraries/commons_lang.xml [new file with mode: 0644]
bin/nix/idea.sh
java/compiler/impl/src/com/intellij/compiler/actions/CompileProjectAction.java
java/compiler/impl/src/com/intellij/compiler/impl/TranslatingCompilerFilesMonitor.java
java/debugger/impl/src/com/intellij/debugger/impl/GenericDebuggerRunner.java
java/idea-ui/src/com/intellij/ide/util/newProjectWizard/AddSupportForFrameworksPanel.java
java/java-impl/src/com/intellij/codeInsight/ExternalAnnotationsManagerImpl.java
java/java-impl/src/com/intellij/codeInsight/completion/ConstructorInsertHandler.java
java/java-impl/src/com/intellij/codeInsight/completion/DefaultInsertHandler.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionData.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaPsiClassReferenceElement.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaSmartCompletionContributor.java
java/java-impl/src/com/intellij/codeInspection/varScopeCanBeNarrowed/FieldCanBeLocalInspection.java
java/java-impl/src/com/intellij/ide/JavaLanguageCodeStyleSettingsProvider.java
java/java-impl/src/com/intellij/psi/formatter/java/AbstractJavaBlock.java
java/java-impl/src/com/intellij/psi/impl/source/PsiFieldImpl.java
java/java-impl/src/com/intellij/psi/impl/source/PsiMethodImpl.java
java/java-impl/src/com/intellij/psi/impl/source/tree/JavaSharedImplUtil.java
java/java-impl/src/com/intellij/psi/impl/source/tree/injected/MyTestInjector.java
java/java-impl/src/com/intellij/psi/impl/source/tree/java/FieldElement.java
java/java-impl/src/com/intellij/refactoring/changeClassSignature/ChangeClassSignatureProcessor.java
java/java-impl/src/com/intellij/refactoring/convertToInstanceMethod/ConvertToInstanceMethodProcessor.java
java/java-impl/src/com/intellij/refactoring/copy/CopyClassesHandler.java
java/java-impl/src/com/intellij/refactoring/extractInterface/ExtractInterfaceHandler.java
java/java-impl/src/com/intellij/refactoring/extractSuperclass/ExtractSuperclassHandler.java
java/java-impl/src/com/intellij/refactoring/inheritanceToDelegation/InheritanceToDelegationProcessor.java
java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java
java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceConstantHandler.java
java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceFieldHandler.java
java/java-impl/src/com/intellij/refactoring/introduceField/LocalToFieldHandler.java
java/java-impl/src/com/intellij/refactoring/memberPullUp/PullUpHelper.java
java/java-impl/src/com/intellij/refactoring/memberPushDown/PushDownProcessor.java
java/java-impl/src/com/intellij/refactoring/migration/MigrationProcessor.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesImpl.java
java/java-impl/src/com/intellij/refactoring/move/moveClassesOrPackages/MoveClassesOrPackagesProcessor.java
java/java-impl/src/com/intellij/refactoring/util/RefactoringUtil.java
java/java-impl/src/com/intellij/refactoring/util/duplicates/MethodDuplicatesHandler.java
java/java-runtime/src/com/intellij/rt/execution/application/AppMain.java
java/java-tests/testData/codeInsight/completion/normal/EnumConstantFromEnumMember.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/EnumConstantFromEnumMember_after.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/PrimitiveMethodParameter.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/PrimitiveMethodParameter_after.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/smartType/TabAfterNew-out.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/smartType/TabAfterNew.java [new file with mode: 0644]
java/java-tests/testData/inspection/fieldCanBeLocal/innerClassFieldInitializer/expected.xml [new file with mode: 0644]
java/java-tests/testData/inspection/fieldCanBeLocal/innerClassFieldInitializer/src/Test.java [new file with mode: 0644]
java/java-tests/testData/refactoring/copyClass/libraryClass/Bar.java.expected
java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/after/A.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/after/Intf.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/before/A.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/before/Intf.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/after/Test.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/after/Test1.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Super.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Test.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Test1.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/GenericsInAbstractMethod.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/GenericsInAbstractMethod_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/GenericsInImplements.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/GenericsInImplements_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/TypeArgument.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/TypeArgument_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/TypeParamErasure.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/TypeParamErasure_after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/TypeParamSubst.java [new file with mode: 0644]
java/java-tests/testData/refactoring/pullUp/TypeParamSubst_after.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.java
java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionTest.java
java/java-tests/testSrc/com/intellij/codeInspection/FieldCanBeLocalTest.java
java/java-tests/testSrc/com/intellij/refactoring/InheritanceToDelegationTest.java
java/java-tests/testSrc/com/intellij/refactoring/InlineSuperClassTest.java
java/java-tests/testSrc/com/intellij/refactoring/PullUpTest.java
platform/lang-api/src/com/intellij/execution/runners/GenericProgramRunner.java
platform/lang-api/src/com/intellij/execution/ui/ConsoleViewWrapper.java [deleted file]
platform/lang-api/src/com/intellij/ide/actions/ElementCreator.java
platform/lang-api/src/com/intellij/ide/util/frameworkSupport/FrameworkSupportConfigurable.java
platform/lang-api/src/com/intellij/lang/folding/CompositeFoldingBuilder.java
platform/lang-api/src/com/intellij/lang/folding/FoldingDescriptor.java
platform/lang-api/src/com/intellij/openapi/roots/libraries/LibraryUtil.java
platform/lang-api/src/com/intellij/psi/codeStyle/CodeStyleSettings.java
platform/lang-api/src/com/intellij/util/FileContentUtil.java
platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleIndentAndBracesPanel.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/CodeFoldingPass.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/InjectedCodeFoldingPass.java
platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/CodeFoldingManagerImpl.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/DocumentFoldingInfo.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUpdate.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/FoldingUtil.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/UpdateFoldRegionsOperation.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/BackspaceHandler.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/TypedHandler.java
platform/lang-impl/src/com/intellij/execution/ExecutionHelper.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/ExecutionMode.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/ExecutionModes.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/Output.java [moved from platform/lvcs-impl/src/com/intellij/history/core/storage/UnavailableContent.java with 57% similarity]
platform/lang-impl/src/com/intellij/execution/OutputListener.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/impl/ConsoleViewImpl.java
platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/execution/runners/RunContentBuilder.java
platform/lang-impl/src/com/intellij/formatting/AbstractBlockWrapper.java
platform/lang-impl/src/com/intellij/formatting/AlignmentImpl.java
platform/lang-impl/src/com/intellij/formatting/BlockDebugUtil.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/formatting/CompositeBlockWrapper.java
platform/lang-impl/src/com/intellij/formatting/FormatProcessor.java
platform/lang-impl/src/com/intellij/formatting/FormatTextRanges.java
platform/lang-impl/src/com/intellij/formatting/IndentData.java
platform/lang-impl/src/com/intellij/formatting/IndentImpl.java
platform/lang-impl/src/com/intellij/formatting/InitialInfoBuilder.java
platform/lang-impl/src/com/intellij/formatting/LeafBlockWrapper.java
platform/lang-impl/src/com/intellij/formatting/SpacingImpl.java
platform/lang-impl/src/com/intellij/formatting/WhiteSpace.java
platform/lang-impl/src/com/intellij/formatting/WrapImpl.java
platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlock.java
platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageBlockFactory.java
platform/lang-impl/src/com/intellij/formatting/templateLanguages/TemplateLanguageFormattingModelBuilder.java
platform/lang-impl/src/com/intellij/ide/actions/CreateDirectoryOrPackageAction.java
platform/lang-impl/src/com/intellij/ide/commander/CommanderPanel.java
platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeViewPanel.java
platform/lang-impl/src/com/intellij/ide/hierarchy/TypeHierarchyBrowserBase.java
platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewImpl.java
platform/lang-impl/src/com/intellij/ide/scopeView/ScopeTreeViewPanel.java
platform/lang-impl/src/com/intellij/ide/util/DeleteHandler.java
platform/lang-impl/src/com/intellij/injected/editor/EditorWindow.java
platform/lang-impl/src/com/intellij/injected/editor/FoldingModelWindow.java
platform/lang-impl/src/com/intellij/injected/editor/FoldingRegionWindow.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/openapi/module/impl/scopes/ModuleWithDependenciesScope.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/DirectoryIndexImpl.java
platform/lang-impl/src/com/intellij/psi/formatter/DocumentBasedFormattingModel.java
platform/lang-impl/src/com/intellij/refactoring/BaseRefactoringProcessor.java
platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java
platform/lvcs-api/src/com/intellij/history/DeafLocalHistory.java [deleted file]
platform/lvcs-api/src/com/intellij/history/LocalHistory.java
platform/lvcs-api/src/com/intellij/history/LocalHistoryConfiguration.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LocalVcs.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LocalVcsItemsLocker.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LocalVcsPurgingProvider.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LocalVcsServices.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsComparator.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsDirectory.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsDirectoryRevision.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsFile.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsFileRevision.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsLabel.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsLabelListener.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsObject.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsRevision.java [deleted file]
platform/lvcs-api/src/com/intellij/openapi/localVcs/package.html [deleted file]
platform/lvcs-impl/lvcs-impl.iml
platform/lvcs-impl/src/com/intellij/history/core/ByteContentRetriever.java
platform/lvcs-impl/src/com/intellij/history/core/ChangeCollectingVisitor.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/ChangeListStorage.java [moved from platform/lvcs-impl/src/com/intellij/history/core/storage/IContentStorage.java with 57% similarity]
platform/lvcs-impl/src/com/intellij/history/core/ChangeListStorageImpl.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/ChangeSetBlock.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/ChangeSetsProcessor.java
platform/lvcs-impl/src/com/intellij/history/core/ContentFactory.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/IdPath.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/LabelImpl.java [moved from platform/lvcs-impl/src/com/intellij/history/core/changes/CreateEntryChangeNonAppliedState.java with 73% similarity]
platform/lvcs-impl/src/com/intellij/history/core/LinkedRecordsTable.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/LinkedStorage.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/LocalHistoryFacade.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/LocalVcs.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/Paths.java
platform/lvcs-impl/src/com/intellij/history/core/RevisionsCollector.java
platform/lvcs-impl/src/com/intellij/history/core/changes/Change.java
platform/lvcs-impl/src/com/intellij/history/core/changes/ChangeList.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/ChangeSet.java
platform/lvcs-impl/src/com/intellij/history/core/changes/ChangeVisitor.java
platform/lvcs-impl/src/com/intellij/history/core/changes/ContentChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/ContentChangeAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/ContentChangeNonAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/CreateDirectoryChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/CreateEntryChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/CreateFileChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/CreateFileChangeNonAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/DeleteChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/DeleteChangeAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/MoveChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/MoveChangeNonAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/PutEntryLabelChange.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/PutLabelChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/PutSystemLabelChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/ROStatusChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/ROStatusChangeAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/RenameChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/RenameChangeAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/RenameChangeNonAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/SelectiveChangeVisitor.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/StructuralChange.java
platform/lvcs-impl/src/com/intellij/history/core/changes/StructuralChangeAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/changes/StructuralChangeNonAppliedState.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/revisions/CurrentRevision.java
platform/lvcs-impl/src/com/intellij/history/core/revisions/LabeledRevision.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/revisions/RecentChange.java
platform/lvcs-impl/src/com/intellij/history/core/revisions/Revision.java
platform/lvcs-impl/src/com/intellij/history/core/revisions/RevisionAfterChange.java
platform/lvcs-impl/src/com/intellij/history/core/revisions/RevisionBeforeChange.java
platform/lvcs-impl/src/com/intellij/history/core/storage/CachingContentStorage.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/storage/CompressingContentStorage.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/storage/Content.java
platform/lvcs-impl/src/com/intellij/history/core/storage/ContentStorage.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/storage/Storage.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/storage/StorageChecker.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/storage/StoredContent.java
platform/lvcs-impl/src/com/intellij/history/core/storage/Stream.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/storage/StreamUtil.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/core/storage/ThreadSafeContentStorage.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/core/tree/DirectoryEntry.java
platform/lvcs-impl/src/com/intellij/history/core/tree/Entry.java
platform/lvcs-impl/src/com/intellij/history/core/tree/FileEntry.java
platform/lvcs-impl/src/com/intellij/history/core/tree/RootEntry.java
platform/lvcs-impl/src/com/intellij/history/deprecated/DeprecatedLVCS.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/deprecated/DeprecatedLvcsServicesImpl.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/CacheUpdaterProcessor.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/EventDispatcher.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/FileFilter.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryActionImpl.java
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryBundle.properties
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryCacheUpdater.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryComponent.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryEventDispatcher.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryFacade.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryImpl.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryService.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/patches/PatchCreator.java
platform/lvcs-impl/src/com/intellij/history/integration/revertion/ChangeReverter.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/revertion/ChangeRevertingVisitor.java [moved from platform/lvcs-impl/src/com/intellij/history/integration/revertion/ChangeRevertionVisitor.java with 50% similarity]
platform/lvcs-impl/src/com/intellij/history/integration/revertion/DifferenceReverter.java
platform/lvcs-impl/src/com/intellij/history/integration/revertion/Reverter.java
platform/lvcs-impl/src/com/intellij/history/integration/revertion/RevisionReverter.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/revertion/SelectionReverter.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryAction.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryActionWithDialog.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/PutLabelAction.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/RecentChangesAction.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/ShowHistoryAction.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/ShowSelectionHistoryAction.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/DirectoryChangeModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/DirectoryHistoryDialogModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/EntireFileDifferenceModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/EntireFileHistoryDialogModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/FileDifferenceModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/FileHistoryDialogModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/HistoryDialogModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/RecentChangeDialogModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/models/SelectionDifferenceModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/DirectoryHistoryDialog.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/FileHistoryDialog.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/HistoryDialog.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/LocalHistoryConfigurable.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/PutLabelDialog.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangeDialog.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangesPopup.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java [new file with mode: 0644]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/SelectionHistoryDialog.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/SelectionHistoryDialogModel.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/table/ArrowBorder.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/table/RevisionsTable.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/table/RevisionsTableCellRenderer.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/table/RevisionsTableModel.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/table/RevisionsTableUI.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/table/ShiftedCellRendererWrapper.java [deleted file]
platform/lvcs-impl/src/com/intellij/history/utils/Reversed.java [deleted file]
platform/lvcs-impl/src/com/intellij/openapi/command/impl/ChangeRange.java
platform/lvcs-impl/src/com/intellij/openapi/command/impl/ChangeRangeRevertionVisitor.java [deleted file]
platform/lvcs-impl/src/com/intellij/openapi/command/impl/FileUndoProvider.java
platform/lvcs-impl/testSrc/com/intellij/history/core/ContentFactoryTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/IdPathTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryChangeList.java [moved from platform/lvcs-impl/src/com/intellij/history/core/changes/ROStatusChangeNonAppliedState.java with 73% similarity]
platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryChangeListStorage.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryLocalHistoryFacade.java [moved from platform/lvcs-impl/src/com/intellij/history/core/changes/MoveChangeAppliedState.java with 74% similarity]
platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryLocalVcs.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/InMemoryStorage.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalHistoryTestCase.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsBasicsTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsChangeSetsTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsDatedContentTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsLabelsTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsPurgingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsRecentChangesTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsRevisionsTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsSavingAfterChangeSetsTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsSavingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsTestCase.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/LocalVcsVisitingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/PathsTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/TempDirTestCase.java
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListChainsTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListCollectingChangesTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListPurgingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeListTestCase.java
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangeSetTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangesApplyAndRevertTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangesCanRevertTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/ChangesRevertingTest.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/PutLabelChangesTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/RootEntryDirectoriesTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/RootEntryFilesTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/RootEntryRootsTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/StructuralChangesPurgingTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/changes/StructuralChangesTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/revisions/RevisionsAfterChangeTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/revisions/RevisionsCauseChangesTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/revisions/RevisionsIsImportantTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/ByteContentTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/CachingContentStorageTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/CompressingContentStorageTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/ContentStorageTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/StorageTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/StoredContentTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/StreamTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/TestContent.java [moved from platform/lvcs-impl/src/com/intellij/history/core/storage/ByteContent.java with 86% similarity]
platform/lvcs-impl/testSrc/com/intellij/history/core/storage/UnavailableContentTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/core/tree/DirectoryEntryTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/tree/EntryTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/tree/FileEntryTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/tree/RootEntryFindingTest.java
platform/lvcs-impl/testSrc/com/intellij/history/core/tree/RootEntryTest.java
platform/lvcs-impl/testSrc/com/intellij/history/integration/EventDispatcherActionPerformingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/EventDispatcherCommandProcessingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/EventDispatcherFilteringTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/EventDispatcherListeningTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/EventDispatcherRefreshingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/EventDispatcherTestCase.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/FileFilterTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/FormatUtilTest.java
platform/lvcs-impl/testSrc/com/intellij/history/integration/IdeaGatewayTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryCacheUpdaterTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryComponentTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryServiceCommandProcessingAndActionsTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryServiceFileListeningTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryServiceRootsOnStartupTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryServiceRootsOnUpdateTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/LocalHistoryServiceTestCase.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/TestFileFilter.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/TestIdeaGateway.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/TestVirtualFile.java
platform/lvcs-impl/testSrc/com/intellij/history/integration/UpdaterAsCacheUpdaterTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/DirectoryChangeModelTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/EntireFileHistoryDialogModelTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/HistoryDialogModelTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/RecentChangeDialogModelTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/history/integration/ui/models/SelectionCalculatorTest.java
platform/lvcs-impl/testSrc/com/intellij/history/utils/ReversedTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ActionsTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/BasicsTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ContentRootsAndUpdatingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ExternalChangesAndRefreshingTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/FileListeningTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/GettingContentAtDateTest.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/IdeaGatewayTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/IntegrationTestCase.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/PatchingTestCase.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/PurgingTest.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/RevisionsAndDiffsTest.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/VisitingTest.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/patches/PatchCreatorTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/ChangeReverterCanRevertTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/ChangeReverterOptimizationTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/ChangeReverterROStatusClearingTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/ChangeReverterTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/ChangeReverterTestCase.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/DifferenceReverterTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/IsFromRefreshFileListener.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/revertion/SelectionReverterTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/DirectoryChangeModelTest.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/DirectoryHistoryDialogModelTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/DirectoryHistoryDialogPatchCreationTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/DirectoryHistoryDialogTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/FileHistoryDialogTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/HistoryDialogModelTest.java [new file with mode: 0644]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/LocalHistoryActionsTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/PutLabelDialogTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/RecentChangeDialogTest.java
platform/lvcs-impl/testSrc/com/intellij/historyIntegrTests/ui/SelectionHistoryDialogTest.java
platform/lvcs-impl/testSrc/com/intellij/historyPerfTests/BasicsTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyPerfTests/CompressingContentStorageTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyPerfTests/ContentStorageTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyPerfTests/LocalVcsPerformanceTestCase.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyPerfTests/MemoryTest.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyPerfTests/PerformanceTestCase.java [deleted file]
platform/lvcs-impl/testSrc/com/intellij/historyPerfTests/SelectionCalculatorTest.java [deleted file]
platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java
platform/platform-api/src/com/intellij/ide/plugins/PluginManager.java
platform/platform-api/src/com/intellij/openapi/actionSystem/CommonShortcuts.java
platform/platform-api/src/com/intellij/openapi/project/Project.java
platform/platform-api/src/com/intellij/openapi/vfs/VirtualFile.java
platform/platform-api/src/com/intellij/openapi/vfs/newvfs/FileAttribute.java
platform/platform-api/src/com/intellij/openapi/vfs/newvfs/NewVirtualFile.java
platform/platform-api/src/com/intellij/ui/IdeBorderFactory.java
platform/platform-api/src/com/intellij/ui/components/JBList.java [new file with mode: 0644]
platform/platform-api/src/com/intellij/ui/table/JBTable.java [new file with mode: 0644]
platform/platform-api/src/com/intellij/ui/treeStructure/Tree.java
platform/platform-api/src/com/intellij/util/Alarm.java
platform/platform-api/src/com/intellij/util/OpenSourceUtil.java
platform/platform-api/src/com/intellij/util/ui/ComponentWithEmptyText.java [moved from platform/lvcs-api/src/com/intellij/openapi/localVcs/VirtualFileInfo.java with 52% similarity]
platform/platform-api/src/com/intellij/util/ui/EmptyTextHelper.java
platform/platform-api/src/com/intellij/util/ui/update/Update.java
platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java
platform/platform-impl/src/com/intellij/ide/actions/UndoRedoAction.java
platform/platform-impl/src/com/intellij/idea/IdeaApplication.java
platform/platform-impl/src/com/intellij/openapi/command/impl/DocumentReferenceManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/command/impl/UndoManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/command/impl/UndoProvider.java
platform/platform-impl/src/com/intellij/openapi/command/impl/UndoRedo.java
platform/platform-impl/src/com/intellij/openapi/command/impl/UndoRedoStacksHolder.java
platform/platform-impl/src/com/intellij/openapi/command/impl/UndoableGroup.java
platform/platform-impl/src/com/intellij/openapi/diff/ex/DiffStatusBar.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/DiffPanelImpl.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/DiffUtil.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/external/FrameDiffTool.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/mergeTool/MergeTool.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/splitter/FoldingTransformation.java
platform/platform-impl/src/com/intellij/openapi/editor/ex/FoldingModelEx.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/FoldRegionImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/FoldingModelImpl.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java
platform/platform-impl/src/com/intellij/openapi/project/impl/ProjectImpl.java
platform/platform-impl/src/com/intellij/openapi/ui/FrameWrapper.java [moved from platform/platform-impl/src/com/intellij/openapi/diff/impl/FrameWrapper.java with 81% similarity]
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/AbstractUpdateDialog.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/CheckForUpdateAction.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/NoUpdatesDialog.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateChecker.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettings.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateSettingsConfigurable.java
platform/platform-impl/src/com/intellij/openapi/vcs/changes/issueLinks/LinkMouseListenerBase.java
platform/platform-impl/src/com/intellij/openapi/vcs/changes/issueLinks/TreeLinkMouseListener.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VirtualDirectoryImpl.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VirtualFileImpl.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/PersistentFS.java
platform/platform-resources-en/src/messages/ApplicationBundle.properties
platform/platform-resources-en/src/messages/CommonBundle.properties
platform/platform-resources-en/src/messages/DiffBundle.properties
platform/platform-resources-en/src/messages/ExecutionBundle.properties
platform/platform-resources-en/src/messages/IdeBundle.properties
platform/platform-resources-en/src/messages/UIBundle.properties
platform/platform-resources-en/src/misc/registry.properties
platform/platform-resources/src/META-INF/PlatformExtensions.xml
platform/platform-resources/src/META-INF/PlatformLangPlugin.xml
platform/platform-resources/src/componentSets/LocalHistory.xml [deleted file]
platform/platform-resources/src/componentSets/Platform.xml
platform/platform-resources/src/componentSets/PlatformComponents.xml
platform/platform-resources/src/componentSets/PlatformLangComponents.xml
platform/testFramework/src/com/intellij/TestAll.java
platform/testFramework/src/com/intellij/TestCaseLoader.java
platform/testFramework/src/com/intellij/TestClassesFilter.java
platform/testFramework/src/com/intellij/testFramework/PlatformTestCase.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
platform/testFramework/testFramework.iml
platform/testRunner/src/com/intellij/execution/testframework/LvcsHelper.java
platform/util/src/com/intellij/util/CatchingConsumer.java [moved from platform/lvcs-impl/src/com/intellij/history/core/changes/StructuralChangeState.java with 77% similarity]
platform/util/src/com/intellij/util/containers/ContainerUtil.java
platform/util/src/com/intellij/util/io/storage/AbstractRecordsTable.java [new file with mode: 0644]
platform/util/src/com/intellij/util/io/storage/AbstractStorage.java
platform/util/src/com/intellij/util/io/storage/CompactStorage.java [deleted file]
platform/util/src/com/intellij/util/io/storage/RecordsTable.java
platform/util/src/com/intellij/util/io/storage/RefCountingRecordsTable.java [new file with mode: 0644]
platform/util/src/com/intellij/util/io/storage/RefCountingStorage.java [new file with mode: 0644]
platform/util/src/com/intellij/util/io/storage/Storage.java
platform/util/src/com/intellij/util/ui/Table.java
platform/util/testSrc/com/intellij/util/containers/ContainerUtilTest.java
platform/util/testSrc/com/intellij/util/io/storage/StorageTest.java
platform/util/util.iml
platform/vcs-api/src/com/intellij/util/CalculateContinuation.java [new file with mode: 0644]
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/CommittedChangesTreeBrowser.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/MockAbstractVcs.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/committed/WiseSplitter.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesTreeList.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/RollbackWorker.java
platform/vcs-impl/src/com/intellij/openapi/vcs/history/FileHistoryPanelImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java
platform/vcs-impl/vcs-impl.iml
platform/xdebugger-api/src/com/intellij/xdebugger/breakpoints/XLineBreakpointType.java
platform/xdebugger-api/src/com/intellij/xdebugger/frame/XValueNode.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/evaluate/quick/XValueHint.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/DebuggerUIUtil.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTree.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/XDebuggerTreeRenderer.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XDebuggerNodeLink.java [moved from platform/lvcs-api/src/com/intellij/openapi/localVcs/LvcsAction.java with 59% similarity]
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XDebuggerTreeNode.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/nodes/XValueNodeImpl.java
plugins/InspectionGadgets/src/com/siyeh/InspectionGadgetsBundle.properties
plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/MethodOnlyUsedFromInnerClassInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ReflectionForUnavailableAnnotationInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/ExceptionFromCatchWhichDoesntWrapInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/WhileCanBeForeachInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/numeric/PointlessArithmeticExpressionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/TypeUtils.java
plugins/InspectionGadgets/src/inspectionDescriptions/MethodOnlyUsedFromInnerClass.html
plugins/InspectionGadgets/src/inspectionDescriptions/ReflectionForUnavailableAnnotation.html
plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/ReflectionForUnavailableAnnotationInspection.java
plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/SourceAnnotation.java [deleted file]
plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/UnretainedAnnotation.java [deleted file]
plugins/IntelliLang/xml-support/resources/xmlInjections.xml
plugins/ant/src/META-INF/plugin.xml
plugins/ant/src/com/intellij/lang/ant/AntSupport.java
plugins/ant/src/com/intellij/lang/ant/config/execution/ExecutionHandler.java
plugins/ant/src/com/intellij/lang/ant/dom/AntDomDependentTargetReference.java [deleted file]
plugins/ant/src/com/intellij/lang/ant/dom/AntDomElement.java
plugins/ant/src/com/intellij/lang/ant/dom/AntDomExtender.java
plugins/ant/src/com/intellij/lang/ant/dom/AntDomFileDescription.java
plugins/ant/src/com/intellij/lang/ant/dom/AntDomProject.java
plugins/ant/src/com/intellij/lang/ant/dom/AntDomReference.java [deleted file]
plugins/ant/src/com/intellij/lang/ant/dom/AntDomTarget.java
plugins/ant/src/com/intellij/lang/ant/dom/AntDomTargetConverter.java [new file with mode: 0644]
plugins/ant/src/com/intellij/lang/ant/dom/AntDomTargetDependsListConverter.java [new file with mode: 0644]
plugins/ant/src/com/intellij/lang/ant/dom/AntReferenceInjector.java
plugins/ant/src/com/intellij/lang/ant/psi/changes/AntChangeVisitor.java
plugins/ant/src/com/intellij/lang/ant/psi/impl/ReflectedProject.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/actions/AbstractAction.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsstatuses/CvsChangeProvider.java
plugins/git4idea/src/git4idea/actions/GitMerge.java
plugins/git4idea/src/git4idea/actions/GitPull.java
plugins/git4idea/src/git4idea/history/browser/GitProjectLogManager.java
plugins/git4idea/src/git4idea/history/browser/GitTreeController.java
plugins/git4idea/src/git4idea/i18n/GitBundle.properties
plugins/git4idea/src/git4idea/merge/GitMergeUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/gradle/GradlePositionManager.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionContributor.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrClosureSignatureUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/GrReferenceExpressionImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/toplevel/imports/GrImportStatementImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/GroovyPropertyUtils.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/noncode/ImmutableAnnotationProcessor.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/processors/MethodResolverProcessor.java
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java
plugins/groovy/test/org/jetbrains/plugins/groovy/refactoring/rename/RenameTest.groovy
plugins/groovy/testdata/highlighting/BooleanProperties.groovy [new file with mode: 0644]
plugins/java-i18n/src/com/intellij/codeInspection/i18n/folding/PropertyFoldingBuilder.java
plugins/junit/src/com/intellij/execution/junit2/ui/actions/LvcsLabeler.java
plugins/maven/maven.iml
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomProjectProcessorUtils.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenDomUtil.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/MavenPluginDomUtil.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/annotator/MavenDomGutterAnnotator.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/code/MavenTypedHandlerDelegate.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenArtifactCoordinatesConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenDependencySystemPathConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenParentRelativePathConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/extract/ExtractDependenciesAction.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/extract/SelectMavenProjectDialog.form
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/extract/SelectMavenProjectDialog.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/introduce/IntroducePropertyAction.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/refactorings/introduce/IntroducePropertyDialog.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenPropertyCompletionContributor.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenPropertyPsiReferenceProvider.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/embedder/MavenEmbedderFactory.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/MavenRunConfigurationType.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/importing/MavenProjectImporter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenGeneralSettings.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenParentProjectFileProcessor.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProject.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsManagerWatcher.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenProjectsTree.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/project/actions/MavenOpenOrCreateFilesAction.java
plugins/maven/src/main/resources/META-INF/plugin.xml
plugins/maven/src/test/java/org/jetbrains/idea/maven/MavenImportingTestCase.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenDependencyCompletionAndResolutionTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenPluginCompletionAndResolutionTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/embedder/MavenEmbedderWrapperTest.java
plugins/maven/src/test/java/org/jetbrains/idea/maven/execution/JavaClasspathConfigurationTest.java
plugins/svn4idea/src/org/jetbrains/idea/svn/SvnAuthenticationNotifier.java
plugins/svn4idea/src/org/jetbrains/idea/svn/SvnVcs.java
plugins/svn4idea/src/org/jetbrains/idea/svn/WorkingCopyFormat.java
plugins/svn4idea/src/org/jetbrains/idea/svn/actions/BasicAction.java
plugins/svn4idea/src/org/jetbrains/idea/svn/actions/ShowSvnMapAction.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/CopiesPanel.java [new file with mode: 0644]
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/SvnMapDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/mergeinfo/BranchInfo.java
plugins/testng/src/com/theoryinpractice/testng/util/TestNGUtil.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/HighlightingOutputConsole.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/RunSettingsEditor.form
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltCommandLineState.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunConfiguration.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/run/XsltRunSettingsEditor.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathExpressionGenerator.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/util/Namespace.java
plugins/xpath/xslt-rt/src/org/intellij/plugins/xslt/run/rt/XSLTRunner.java
resources/src/META-INF/IdeaPlugin.xml
resources/src/componentSets/Dom.xml [deleted file]
resources/src/componentSets/IdeaComponents.xml
resources/src/componentSets/InspectionComponents.xml
xml/dom-impl/src/META-INF/DomPlugin.xml [moved from resources/src/META-INF/DomPlugin.xml with 94% similarity]
xml/dom-impl/src/com/intellij/util/xml/impl/VirtualDomParentStrategy.java

diff --git a/.idea/libraries/commons_lang.xml b/.idea/libraries/commons_lang.xml
new file mode 100644 (file)
index 0000000..ba16df7
--- /dev/null
@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="commons-lang">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/lib/commons-lang-2.4.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
index f81b8298b51ba6c0fd539f7c342c890e7b48131a..486bfd094e2ad709f9533b61f0aa1f1ba567165e 100644 (file)
 # ---------------------------------------------------------------------
 if [ -z "$IDEA_JDK" ]; then
   IDEA_JDK=$JDK_HOME
+  if [ -z "$IDEA_JDK" -a -e "$JAVA_HOME/lib/tools.jar" ]; then
+    IDEA_JDK=$JAVA_HOME
+  fi
+  if [ -z "$IDEA_JDK" ]; then
+    # Try to get the jdk path from java binary path
+    JAVA_BIN_PATH=`which java`
+    if [ -n "$JAVA_BIN_PATH" ]; then
+      JAVA_LOCATION=`readlink -f $JAVA_BIN_PATH | xargs dirname | xargs dirname | xargs dirname`
+      if [ -x "$JAVA_LOCATION/bin/java" -a -e "$JAVA_LOCATION/lib/tools.jar" ]; then
+        IDEA_JDK=$JAVA_LOCATION
+      fi
+    fi
+  fi
   if [ -z "$IDEA_JDK" ]; then
     echo ERROR: cannot start IntelliJ IDEA.
     echo No JDK found to run IDEA. Please validate either IDEA_JDK or JDK_HOME points to valid JDK installation
index f5956d391adf2abd94cb012ac8fdbadabe9c4bb3..fde4f552a8ca5b19874b984d7dd503aecbd8efdc 100644 (file)
@@ -16,7 +16,6 @@
 package com.intellij.compiler.actions;
 
 import com.intellij.history.LocalHistory;
-import com.intellij.history.LocalHistoryConfiguration;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.DataContext;
 import com.intellij.openapi.actionSystem.PlatformDataKeys;
@@ -31,14 +30,12 @@ public class CompileProjectAction extends CompileActionBase {
   protected void doAction(DataContext dataContext, final Project project) {
     CompilerManager.getInstance(project).rebuild(new CompileStatusNotification() {
       public void finished(boolean aborted, int errors, int warnings, final CompileContext compileContext) {
-        if (!aborted && LocalHistoryConfiguration.getInstance().ADD_LABEL_ON_PROJECT_COMPILATION) {
-          String text = getTemplatePresentation().getText();
-          if (!project.isDisposed()) {
-            LocalHistory.putSystemLabel(project, errors == 0
-                                           ? CompilerBundle.message("rebuild.lvcs.label.no.errors", text)
-                                           : CompilerBundle.message("rebuild.lvcs.label.with.errors", text));
-          }
-        }
+        if (aborted) return;
+
+        String text = getTemplatePresentation().getText();
+        LocalHistory.getInstance().putSystemLabel(project, errors == 0
+                                       ? CompilerBundle.message("rebuild.lvcs.label.no.errors", text)
+                                       : CompilerBundle.message("rebuild.lvcs.label.with.errors", text));
       }
     });
   }
index 6a918af4bc3362a181128e7993034a7fa19df74e..cfcbcca7435361757fd5a94bac9ea169fe0166bf 100644 (file)
@@ -833,10 +833,8 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
     if (file.getFileSystem() instanceof LocalFileSystem) {
       if (file.isDirectory()) {
         if (dbOnly) {
-          for (VirtualFile child : ((NewVirtualFile)file).getInDbChildren()) {
-            if (NullVirtualFile.INSTANCE != child) {
-              processRecursively(child, true, processor);
-            }
+          for (VirtualFile child : ((NewVirtualFile)file).iterInDbChildren()) {
+            processRecursively(child, true, processor);
           }
         }
         else {
index dca79b50e200eb43cbedd374c27b10912c043c9d..b0e4ed0e3e2d807bc17e11bed88956786221c319 100644 (file)
@@ -25,8 +25,6 @@ import com.intellij.execution.executors.DefaultDebugExecutor;
 import com.intellij.execution.runners.ExecutionEnvironment;
 import com.intellij.execution.runners.JavaPatchableProgramRunner;
 import com.intellij.execution.ui.RunContentDescriptor;
-import com.intellij.history.LocalHistory;
-import com.intellij.history.LocalHistoryConfiguration;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.options.SettingsEditor;
 import com.intellij.openapi.project.Project;
@@ -46,16 +44,16 @@ public class GenericDebuggerRunner extends JavaPatchableProgramRunner<GenericDeb
   protected RunContentDescriptor doExecute(final Project project, final Executor executor, final RunProfileState state, final RunContentDescriptor contentToReuse,
                                            final ExecutionEnvironment env) throws ExecutionException {
     FileDocumentManager.getInstance().saveAllDocuments();
+    return createContentDescriptor(project, executor, state, contentToReuse, env);
+  }
 
-    if (LocalHistoryConfiguration.getInstance().ADD_LABEL_ON_RUNNING) {
-      final String name = env.getRunProfile().getName();
-      final String label = state instanceof RemoteState
-                           ? DebuggerBundle.message("debugger.runner.vcs.label.remote.debug", name)
-                           : DebuggerBundle.message("debugger.runner.vcs.label.debugging", name);
-      LocalHistory.putSystemLabel(project, label);
-    }
+  @Override
+  protected String getLocalHistoryLabel(RunProfile profile, RunProfileState state) {
+    final String name = profile.getName();
+    return state instanceof RemoteState
+                         ? DebuggerBundle.message("debugger.runner.vcs.label.remote.debug", name)
+                         : DebuggerBundle.message("debugger.runner.vcs.label.debugging", name);
 
-    return createContentDescriptor(project, executor, state, contentToReuse, env);
   }
 
   @Nullable
index 88d093b63cd1430e83fe2edbf294199ef8ed7900..6f14d1bb0e5b82128d952ebf3d6555f2b9ddd31b 100644 (file)
@@ -96,6 +96,7 @@ public class AddSupportForFrameworksPanel {
         final FrameworkSupportNode frameworkSupportNode = (FrameworkSupportNode)node;
         frameworkSupportNode.setConfigurableComponentEnabled(node.isChecked());
         updateOptionsPanel();
+        frameworkSupportNode.getConfigurable().onFrameworkSelectionChanged(node.isChecked());
         myModel.onFrameworkSelectionChanged(frameworkSupportNode);
       }
     };
index c5874aefa5717156ed53f10fda2295fb5467b1c7..2baf0849923d9d6dae2e877abcbee7a538c30c08 100644 (file)
@@ -50,7 +50,6 @@ import com.intellij.openapi.ui.popup.JBPopupFactory;
 import com.intellij.openapi.ui.popup.PopupStep;
 import com.intellij.openapi.ui.popup.util.BaseListPopupStep;
 import com.intellij.openapi.util.Comparing;
-import com.intellij.openapi.util.Disposer;
 import com.intellij.openapi.util.IconLoader;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.openapi.util.text.StringUtil;
@@ -576,7 +575,6 @@ public class ExternalAnnotationsManagerImpl extends ExternalAnnotationsManager {
       super(project, MESSAGE, ProjectBundle.message("external.annotation.prompt"), Messages.getQuestionIcon());
       myProject = project;
       init();
-      Disposer.register(myProject, myDisposable);
     }
 
     protected String getOkActionName() {
index 146cbcf41f2363394dc5b2e26e7d283806b28115..38c0516be7759e867cce4e6c33edb9c6c0e1fb3a 100644 (file)
@@ -36,10 +36,11 @@ class ConstructorInsertHandler implements InsertHandler<LookupElementDecorator<L
 
   public void handleInsert(InsertionContext context, LookupElementDecorator<LookupItem> item) {
     @SuppressWarnings({"unchecked"}) final LookupItem<PsiClass> delegate = item.getDelegate();
-    delegate.handleInsert(context);
 
     insertParentheses(context, delegate, delegate.getObject());
 
+    DefaultInsertHandler.addImportForItem(context.getFile(), context.getStartOffset(), delegate);
+
     final PsiElement position = SmartCompletionDecorator.getPosition(context, delegate);
 
     final PsiExpression enclosing = PsiTreeUtil.getContextOfType(position, PsiExpression.class, true);
@@ -66,8 +67,6 @@ class ConstructorInsertHandler implements InsertHandler<LookupElementDecorator<L
   }
 
   public static void insertParentheses(InsertionContext context, LookupItem delegate, final PsiClass psiClass) {
-    PsiDocumentManager.getInstance(context.getProject()).doPostponedOperationsAndUnblockDocument(context.getEditor().getDocument());
-
     final PsiElement place = context.getFile().findElementAt(context.getStartOffset());
     final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(context.getProject()).getResolveHelper();
     assert place != null;
index c12a935e86e9b058004f3f315edbf620941dfbb6..a699861def3e2c83d4aee5a153b5032f86682d45 100644 (file)
@@ -80,10 +80,12 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
     final boolean needLeftParenth = isToInsertParenth();
     final boolean hasParams = needLeftParenth && hasParams();
 
-    if (CompletionUtil.isOverwrite(item, completionChar))
+    if (CompletionUtil.isOverwrite(item, completionChar)) {
       removeEndOfIdentifier(needLeftParenth && hasParams);
-    else if(myContext.getOffsetMap().getOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET) != myContext.getSelectionEndOffset())
+    }
+    else if(myContext.getOffsetMap().getOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET) != myContext.getSelectionEndOffset()) {
       JavaCompletionUtil.resetParensInfo(context.getOffsetMap());
+    }
 
     handleParenses(hasParams, needLeftParenth, tailType);
     handleBrackets();
@@ -253,7 +255,7 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
     }
   }
 
-  private boolean isToInsertParenth(){
+  protected boolean isToInsertParenth(){
     return insertingAnnotationWithParameters();
   }
 
index d6d33237a64abaa929512ea445ce819c2ef6c793..ff460f723914a7ff39f4fc852049a2a7abf0701a 100644 (file)
@@ -37,7 +37,6 @@ import com.intellij.openapi.util.Computable;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.patterns.ElementPattern;
 import com.intellij.patterns.PatternCondition;
-import static com.intellij.patterns.PsiJavaPatterns.*;
 import com.intellij.patterns.PsiNameValuePairPattern;
 import com.intellij.psi.*;
 import com.intellij.psi.filters.*;
@@ -60,6 +59,8 @@ import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
+import static com.intellij.patterns.PsiJavaPatterns.*;
+
 /**
  * @author peter
  */
@@ -88,7 +89,7 @@ public class JavaCompletionContributor extends CompletionContributor {
   @Nullable 
   private static ElementFilter getReferenceFilter(PsiElement position) {
     // Completion after extends in interface, type parameter and implements in class
-    final PsiClass containingClass = PsiTreeUtil.getParentOfType(position, PsiClass.class, false, PsiCodeBlock.class, PsiMethod.class, PsiExpressionList.class);
+    final PsiClass containingClass = PsiTreeUtil.getParentOfType(position, PsiClass.class, false, PsiCodeBlock.class, PsiMethod.class, PsiExpressionList.class, PsiVariable.class);
     if (containingClass != null && psiElement().afterLeaf(PsiKeyword.EXTENDS, PsiKeyword.IMPLEMENTS, ",", "&").accepts(position)) {
       return new AndFilter(ElementClassFilter.CLASS, new NotFilter(new AssignableFromContextFilter()));
     }
index 0d2d3ad6174275d1415d0ee8a4ada5f97c7fcedd..716b8b940dc92274d0742768d9ea1fd1be5a129a 100644 (file)
@@ -60,8 +60,7 @@ public class JavaCompletionData extends JavaAwareCompletionData{
       new ParentElementFilter(new ClassFilter(PsiTryStatement.class)))
 )));
   public static final PsiJavaElementPattern.Capture<PsiElement> INSIDE_PARAMETER_LIST =
-    PsiJavaPatterns.psiElement().withSuperParent(
-      2, 
+    PsiJavaPatterns.psiElement().withParent(
       psiElement(PsiJavaCodeReferenceElement.class).withParent(
         psiElement(PsiTypeElement.class).withParent(PsiParameterList.class)));
 
index e3602ac3ef94c55b45b349cd2ce42859e11c96a5..c2fd803c698cfeadbb2ae1bb694a36fd2f033758 100644 (file)
@@ -31,8 +31,8 @@ public class JavaPsiClassReferenceElement extends LookupItem<Object> {
   public static final InsertHandler<JavaPsiClassReferenceElement> JAVA_CLASS_INSERT_HANDLER = new InsertHandler<JavaPsiClassReferenceElement>() {
     public void handleInsert(final InsertionContext context, final JavaPsiClassReferenceElement item) {
       if (completingRawConstructor(context, item)) {
-        DefaultInsertHandler.NO_TAIL_HANDLER.handleInsert(context, item);
         ConstructorInsertHandler.insertParentheses(context, item, item.getObject());
+        DefaultInsertHandler.addImportForItem(context.getFile(), context.getStartOffset(), item);
       } else {
         new DefaultInsertHandler().handleInsert(context, item);
       }
index 841795650167824458119628ac549e82777c2545..096d07f863bbcdfed2dc9078ca84dafcac9c5c64 100644 (file)
@@ -174,7 +174,6 @@ public class JavaSmartCompletionContributor extends CompletionContributor {
                   JavaCompletionUtil.setShowFQN((LookupItem)item);
                 } else {
                 }
-                ((LookupItem) item).setInsertHandler(DefaultInsertHandler.NO_TAIL_HANDLER);
                 result.addElement(decorate(LookupElementDecorator.withInsertHandler((LookupItem)item, ConstructorInsertHandler.INSTANCE), infos));
               }
             }
@@ -578,7 +577,6 @@ public class JavaSmartCompletionContributor extends CompletionContributor {
       item.setAttribute(LookupItem.INDICATE_ANONYMOUS, "");
     }
 
-    item.setInsertHandler(DefaultInsertHandler.NO_TAIL_HANDLER);
     result.addElement(decorate(type instanceof PsiClassType ? LookupElementDecorator.withInsertHandler(item, ConstructorInsertHandler.INSTANCE) : item, infos));
   }
 
@@ -621,13 +619,19 @@ public class JavaSmartCompletionContributor extends CompletionContributor {
       PsiElement element = file.findElementAt(context.getStartOffset());
       if (element instanceof PsiIdentifier) {
         element = element.getParent();
-        while (element instanceof PsiJavaCodeReferenceElement || element instanceof PsiMethodCallExpression ||
+        while (element instanceof PsiJavaCodeReferenceElement || element instanceof PsiCall ||
                element instanceof PsiThisExpression || element instanceof PsiSuperExpression ||
                element instanceof PsiTypeElement ||
                element instanceof PsiClassObjectAccessExpression) {
           int newEnd = element.getTextRange().getEndOffset();
           if (element instanceof PsiMethodCallExpression) {
-            newEnd = ((PsiMethodCallExpression)element).getMethodExpression().getElement().getTextRange().getEndOffset();
+            newEnd = ((PsiMethodCallExpression)element).getMethodExpression().getTextRange().getEndOffset();
+          }
+          else if (element instanceof PsiNewExpression) {
+            final PsiJavaCodeReferenceElement classReference = ((PsiNewExpression)element).getClassReference();
+            if (classReference != null) {
+              newEnd = classReference.getTextRange().getEndOffset();
+            }
           }
           context.getOffsetMap().addOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET, newEnd);
           element = element.getParent();
index 71a89c534f37f84f1dc237145aada260a3efcdd4..c22da9f943d15fb6e076e0d3c824f88367b96ee0 100644 (file)
@@ -197,7 +197,7 @@ public class FieldCanBeLocalInspection extends BaseLocalInspectionTool {
 
       @Override public void visitReferenceExpression(PsiReferenceExpression expression) {
         final PsiExpression qualifier = expression.getQualifierExpression();
-        if (qualifier == null || qualifier instanceof PsiThisExpression && ((PsiThisExpression)qualifier).getQualifier() == null) {
+        if (qualifier == null || qualifier instanceof PsiThisExpression) {
           final PsiElement resolved = expression.resolve();
           if (resolved instanceof PsiField) {
             final PsiField field = (PsiField)resolved;
index d0ab00d727ef355524078e806c049b05c9491168..823e663f284b72348b124e08e19cca6eb931781a 100644 (file)
@@ -120,6 +120,7 @@ public class JavaLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSett
                                                        "}";
 
   private static final String INDENT_AND_BRACES_SAMPLE = "public class Foo {\n" +
+                                                         "  public Foo foo;\n" +
                                                          "  public int[] X = new int[]{1, 3, 5 7, 9, 11};\n" +
                                                          "\n" +
                                                          "  public void foo(boolean a, int x, int y, int z) {\n" +
@@ -163,6 +164,13 @@ public class JavaLanguageCodeStyleSettingsProvider extends LanguageCodeStyleSett
                                                          "    while (x < 10000);\n" +
                                                          "    while (x < 50000) x++;\n" +
                                                          "    for (int i = 0; i < 5; i++) System.out.println(i);\n" +
+                                                         "    foo.fooBar().fooBar()\n" +
+                                                         "       .fooBar().foo.fooBar().fooBar()\n" +
+                                                         "                    .fooBar();\n" +
+                                                         "  }\n" +
+                                                         "\n" +
+                                                         "  public Foo fooBar() {\n" +
+                                                         "    return this;\n" +
                                                          "  }\n" +
                                                          "\n" +
                                                          "  private class InnerClass implements I1, I2 {\n" +
index 5e7962c7bb913180c8dd0af2c05a7c33525c5c12..d040a3128952070287888e447b9d0b70803f3a6c 100644 (file)
@@ -402,7 +402,7 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
       myIsAfterClassKeyword = true;
     }
     if (childType == JavaElementType.METHOD_CALL_EXPRESSION) {
-      result.add(createMethodCallExpressiobBlock(child,
+      result.add(createMethodCallExpressionBlock(child,
                                                  arrangeChildWrap(child, defaultWrap),
                                                  arrangeChildAlignment(child, defaultAlignment)));
     }
@@ -598,23 +598,53 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
     return role == ChildRole.OPERATION_SIGN || role == ChildRole.COLON;
   }
 
-  private Block createMethodCallExpressiobBlock(final ASTNode node, final Wrap blockWrap, final Alignment alignment) {
+  private Block createMethodCallExpressionBlock(final ASTNode node, final Wrap blockWrap, final Alignment alignment) {
     final ArrayList<ASTNode> nodes = new ArrayList<ASTNode>();
     final ArrayList<Block> subBlocks = new ArrayList<Block>();
     collectNodes(nodes, node);
 
     final Wrap wrap = Wrap.createWrap(getWrapType(mySettings.METHOD_CALL_CHAIN_WRAP), false);
 
+    // We use this alignment object to align chained method calls to the first method invocation place if necessary (see IDEA-30369)
+    Alignment chainedCallsAlignment = createAlignment(mySettings.ALIGN_MULTILINE_CHAINED_METHODS, null);
+
+    // We want to align chained method calls only if method target is explicitly specified, i.e. we don't want to align methods
+    // chain like 'recursive().recursive().recursive()' but want to align calls like 'foo.recursive().recursive().recursive()'
+    boolean callPointDefined = false;
+
     while (!nodes.isEmpty()) {
       ArrayList<ASTNode> subNodes = readToNextDot(nodes);
-      subBlocks.add(createSynthBlock(subNodes, wrap));
+      Alignment alignmentToUseForSubBlock = null;
+
+      // Just create a no-aligned sub-block if we don't need to bother with it's alignment (either due to end-user
+      // setup or sub-block state).
+      if (chainedCallsAlignment == null || subNodes.isEmpty()) {
+        subBlocks.add(createSynthBlock(subNodes, wrap, alignmentToUseForSubBlock));
+        continue;
+      }
+
+      IElementType lastNodeType = subNodes.get(subNodes.size() - 1).getElementType();
+      boolean currentSubBlockIsMethodCall = lastNodeType == JavaElementType.EXPRESSION_LIST;
+
+      // Update information about chained method alignment point if necessary. I.e. we want to align only continuous method calls
+      // like 'foo.bar().bar().bar()' but not 'foo.bar().foo.bar()'
+      if (callPointDefined && !currentSubBlockIsMethodCall) {
+        chainedCallsAlignment = createAlignment(mySettings.ALIGN_MULTILINE_CHAINED_METHODS, null);
+      }
+      callPointDefined |= !currentSubBlockIsMethodCall;
+
+      // We want to align method call only if call target is defined for the first chained method and current block is a method call.
+      if (callPointDefined && currentSubBlockIsMethodCall) {
+        alignmentToUseForSubBlock = chainedCallsAlignment;
+      }
+      subBlocks.add(createSynthBlock(subNodes, wrap, alignmentToUseForSubBlock));
     }
 
     return new SyntheticCodeBlock(subBlocks, alignment, mySettings, Indent.getContinuationWithoutFirstIndent(),
                                   blockWrap);
   }
 
-  private Block createSynthBlock(final ArrayList<ASTNode> subNodes, final Wrap wrap) {
+  private Block createSynthBlock(final ArrayList<ASTNode> subNodes, final Wrap wrap, final Alignment alignment) {
     final ArrayList<Block> subBlocks = new ArrayList<Block>();
     final ASTNode firstNode = subNodes.get(0);
     if (firstNode.getElementType() == JavaTokenType.DOT) {
@@ -623,12 +653,12 @@ public abstract class AbstractJavaBlock extends AbstractBlock implements JavaBlo
                                     null));
       subNodes.remove(0);
       if (!subNodes.isEmpty()) {
-        subBlocks.add(createSynthBlock(subNodes, wrap));
+        subBlocks.add(createSynthBlock(subNodes, wrap, null));
       }
-      return new SyntheticCodeBlock(subBlocks, null, mySettings, Indent.getContinuationIndent(), wrap);
+      return new SyntheticCodeBlock(subBlocks, alignment, mySettings, Indent.getContinuationIndent(), wrap);
     }
     else {
-      return new SyntheticCodeBlock(createJavaBlocks(subNodes), null, mySettings,
+      return new SyntheticCodeBlock(createJavaBlocks(subNodes), alignment, mySettings,
                                     Indent.getContinuationWithoutFirstIndent(), null);
     }
   }
index ceabeed66946aed2299523cad7a8c7622967e79b..318454b9704f818a8e670901d86696307a1dae13 100644 (file)
@@ -33,6 +33,7 @@ import com.intellij.psi.javadoc.PsiDocComment;
 import com.intellij.psi.presentation.java.JavaPresentationUtil;
 import com.intellij.psi.scope.PsiScopeProcessor;
 import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.stubs.IStubElementType;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.ui.RowIcon;
 import com.intellij.util.Icons;
@@ -54,7 +55,11 @@ public class PsiFieldImpl extends JavaStubPsiElement<PsiFieldStub> implements Ps
   private volatile Object myCachedInitializerValue = null; // PsiExpression on constant value for literal
 
   public PsiFieldImpl(final PsiFieldStub stub) {
-    super(stub, JavaStubElementTypes.FIELD);
+    this(stub, JavaStubElementTypes.FIELD);
+  }
+
+  protected PsiFieldImpl(final PsiFieldStub stub, final IStubElementType type) {
+    super(stub, type);
   }
 
   public PsiFieldImpl(final ASTNode node) {
index b67f023fc4fcfdd4224d6c1bdc577c8d02047d9a..eb143b2553669104451ab5c55fa73be89822043f 100644 (file)
@@ -36,6 +36,7 @@ import com.intellij.psi.javadoc.PsiDocComment;
 import com.intellij.psi.presentation.java.JavaPresentationUtil;
 import com.intellij.psi.scope.PsiScopeProcessor;
 import com.intellij.psi.search.SearchScope;
+import com.intellij.psi.stubs.IStubElementType;
 import com.intellij.psi.util.MethodSignature;
 import com.intellij.psi.util.MethodSignatureBackedByPsiMethod;
 import com.intellij.psi.util.PsiTreeUtil;
@@ -55,7 +56,11 @@ public class PsiMethodImpl extends JavaStubPsiElement<PsiMethodStub> implements
   private PatchedSoftReference<PsiType> myCachedType = null;
 
   public PsiMethodImpl(final PsiMethodStub stub) {
-    super(stub, JavaStubElementTypes.METHOD);
+    this(stub, JavaStubElementTypes.METHOD);
+  }
+
+  protected PsiMethodImpl(final PsiMethodStub stub, final IStubElementType type) {
+    super(stub, type);
   }
 
   public PsiMethodImpl(final ASTNode node) {
index 5f7fa3dee74c15038206681d79136de710aca67a..2f9f9294306da764704adaf8e82ae3d224bdeb31 100644 (file)
@@ -94,9 +94,13 @@ public class JavaSharedImplUtil {
 
   public static void normalizeBrackets(PsiVariable variable) {
     CompositeElement variableElement = (CompositeElement)SourceTreeToPsiMap.psiElementToTree(variable);
-    ASTNode type = variableElement.findChildByRole(ChildRole.TYPE);
-    LOG.assertTrue(type.getTreeParent() == variableElement);
-    ASTNode name = variableElement.findChildByRole(ChildRole.NAME);
+
+    PsiTypeElement typeElement = variable.getTypeElement();
+    PsiIdentifier nameElement = variable.getNameIdentifier();
+    LOG.assertTrue(typeElement != null && nameElement != null);
+
+    ASTNode type = typeElement.getNode();
+    ASTNode name = nameElement.getNode();
 
     ASTNode firstBracket = null;
     ASTNode lastBracket = null;
index 6562de5b88e0ee41554a124b027cade6553aef67..3474da35d17a610f6a6e24800450e8fd3d164da4 100644 (file)
@@ -159,6 +159,7 @@ public class MyTestInjector {
     final Language ql = findLanguageByID("JPAQL");
     final Language js = findLanguageByID("JavaScript");
     if (ql == null || js == null) return;
+    final Language ecma4 = findLanguageByID("ECMA Script Level 4");
 
     final MultiHostInjector myMultiHostInjector = new MultiHostInjector() {
       public void getLanguagesToInject(@NotNull MultiHostRegistrar registrar, @NotNull PsiElement context) {
@@ -227,6 +228,10 @@ public class MyTestInjector {
             inject(host, placesToInject, js);
             return;
           }
+          if (ecma4 != null && "ecma4".equals(tag.getLocalName())) {
+            inject(host, placesToInject, ecma4);
+            return;
+          }
           if ("jsprefix".equals(tag.getLocalName())) {
             inject(host, placesToInject, js, "function foo(doc, window){", "}");
             return;
index 18aebfef609e301403642db2c679085e72569d3e..4f1675bcfb2b55f5b40fe64cc9b9de70133f0c70 100644 (file)
@@ -17,11 +17,14 @@ package com.intellij.psi.impl.source.tree.java;
 
 import com.intellij.lang.ASTNode;
 import com.intellij.psi.JavaTokenType;
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiField;
 import com.intellij.psi.impl.PsiImplUtil;
 import com.intellij.psi.impl.source.Constants;
 import com.intellij.psi.impl.source.tree.*;
 import com.intellij.psi.tree.ChildRoleBase;
 import com.intellij.psi.tree.IElementType;
+import com.intellij.util.CharTable;
 import org.jetbrains.annotations.NotNull;
 
 public class FieldElement extends CompositeElement{
@@ -29,6 +32,10 @@ public class FieldElement extends CompositeElement{
     super(Constants.FIELD);
   }
 
+  protected FieldElement(@NotNull IElementType type) {
+    super(type);
+  }
+
   public int getTextOffset() {
     return findChildByRole(ChildRole.NAME).getStartOffset();
   }
@@ -103,4 +110,11 @@ public class FieldElement extends CompositeElement{
       return ChildRoleBase.NONE;
     }
   }
+
+   @Override
+  public ASTNode copyElement() {
+    final CharTable table = SharedImplUtil.findCharTableByTree(this);
+    final PsiClass psiClass = ((PsiField)getPsi()).getContainingClass();
+    return psiClass != null ? ChangeUtil.copyElement(this, psiClass.getTypeParameterList(), table) : super.copyElement();
+  }
 }
index eff1ee26c4e0a64413acc8c2b167ad1e670ed44f..3398a0594f04f748cbb2f67c8216508e9fe5d987 100644 (file)
@@ -83,7 +83,7 @@ public class ChangeClassSignatureProcessor extends BaseRefactoringProcessor {
   }
 
   protected void performRefactoring(UsageInfo[] usages) {
-    LocalHistoryAction a = LocalHistory.startAction(myProject, getCommandName());
+    LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName());
     try {
       doRefactoring(usages);
     }
index c192501dceb573be2f8d399dea185a4096daa003..aed16d3c631a00a713f6ba60d45d198b8e46646a 100644 (file)
@@ -211,7 +211,7 @@ public class ConvertToInstanceMethodProcessor extends BaseRefactoringProcessor {
 
   protected void performRefactoring(UsageInfo[] usages) {
     if (!CommonRefactoringUtil.checkReadOnlyStatus(myProject, myTargetClass)) return;
-    LocalHistoryAction a = LocalHistory.startAction(myProject, getCommandName());
+    LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName());
     try {
       doRefactoring(usages);
     }
index be1b677bec1e49aacfaa1585d13e3a0b98f7c534..ec8f1bf607d7652b32ae87b3e97f2b69909b2912 100644 (file)
@@ -179,7 +179,7 @@ public class CopyClassesHandler implements CopyHandlerDelegate {
           }
           PsiClass source = findByName(sources, destination.getName());
           if (source != null) {
-            final PsiClass copy = copy(destination, copyClassName);
+            final PsiClass copy = copy(source, copyClassName);
             newElement = destination.replace(copy);
             oldToNewMap.put(source, newElement);
           }
@@ -294,8 +294,8 @@ public class CopyClassesHandler implements CopyHandlerDelegate {
   private static PsiClass[] getTopLevelClasses(PsiElement element) {
     while (true) {
       if (element == null || element instanceof PsiFile) break;
-      if (element instanceof PsiClass && (((PsiClass)element).getContainingClass() == null)) break;
-      element = element.getContext();
+      if (element instanceof PsiClass && element.getParent() != null && (((PsiClass)element).getContainingClass() == null)) break;
+      element = element.getParent();
     }
     if (element instanceof PsiClassOwner) {
       PsiClass[] classes = ((PsiClassOwner)element).getClasses();
index 8681c97d53c2a51c5253be52eb328239be8a4dea..eae9a2708121c23cf6889a24aa93f6f47f4ddce4 100644 (file)
@@ -106,7 +106,7 @@ public class ExtractInterfaceHandler implements RefactoringActionHandler, Elemen
 
 
   private void doRefactoring() throws IncorrectOperationException {
-    LocalHistoryAction a = LocalHistory.startAction(myProject, getCommandName());
+    LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName());
     PsiClass anInterface = null;
     try {
       anInterface = extractInterface(myTargetDir, myClass, myInterfaceName, mySelectedMembers, myJavaDocPolicy);
index 4aeb4bb5b64da78569f0eef701837ab6f74a76e7..70641e1f052f0c292472860e9a59e1d21b7d5fbb 100644 (file)
@@ -151,7 +151,7 @@ public class ExtractSuperclassHandler implements RefactoringActionHandler, Extra
     final PsiDirectory targetDirectory = dialog.getTargetDirectory();
     final MemberInfo[] selectedMemberInfos = dialog.getSelectedMemberInfos();
     final DocCommentPolicy javaDocPolicy = new DocCommentPolicy(dialog.getJavaDocPolicy());
-    LocalHistoryAction a = LocalHistory.startAction(myProject, getCommandName(subclass, superclassName));
+    LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName(subclass, superclassName));
     try {
       PsiClass superclass = null;
 
index 803ddbb2f13aadad6d64a70d19f83ddee1e3e2a4..237387fac73722146ca67b1cf4fa8a0ae8246175 100644 (file)
@@ -384,7 +384,9 @@ public class InheritanceToDelegationProcessor extends BaseRefactoringProcessor {
     if (!myIsInnerClassNeeded) return;
 
     PsiClass innerClass = myFactory.createClass(myInnerClassName);
-    final PsiJavaCodeReferenceElement baseClassReferenceElement = myFactory.createClassReferenceElement(myBaseClass);
+    final PsiSubstitutor superClassSubstitutor = TypeConversionUtil.getSuperClassSubstitutor(myBaseClass, myClass, PsiSubstitutor.EMPTY);
+    final PsiClassType superClassType = myFactory.createType(myBaseClass, superClassSubstitutor);
+    final PsiJavaCodeReferenceElement baseClassReferenceElement = myFactory.createReferenceElementByType(superClassType);
     if (!myBaseClass.isInterface()) {
       innerClass.getExtendsList().add(baseClassReferenceElement);
     } else {
index 0313d99c335639aac3b93a2db5cc2e65538cf127..c714bf0a381ba3eef1b0dbae6e148c3e5f99596e 100644 (file)
@@ -243,7 +243,7 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
       myEditor.getCaretModel().moveToLogicalPosition(pos);
     }
 
-    LocalHistoryAction a = LocalHistory.startAction(myProject, getCommandName());
+    LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName());
     try {
       doRefactoring(usages);
     }
index 8360a956ca44c948c407200ac1ba96ed3809b471..4b57acbde0282dd2b127f7103564e7d14e050f86 100644 (file)
@@ -62,8 +62,16 @@ public class IntroduceConstantHandler extends BaseExpressionToFieldHandler {
     ElementToWorkOn.processElementToWorkOn(editor, file, REFACTORING_NAME, getHelpID(), project, getElementProcessor(project, editor));
   }
 
-  protected boolean invokeImpl(Project project, final PsiLocalVariable localVariable, Editor editor) {
-    final LocalToFieldHandler localToFieldHandler = new LocalToFieldHandler(project, true);
+  protected boolean invokeImpl(final Project project, final PsiLocalVariable localVariable, final Editor editor) {
+    final LocalToFieldHandler localToFieldHandler = new LocalToFieldHandler(project, true){
+      @Override
+      protected Settings showRefactoringDialog(PsiClass aClass,
+                                               PsiLocalVariable local,
+                                               PsiExpression[] occurences,
+                                               boolean isStatic) {
+        return IntroduceConstantHandler.this.showRefactoringDialog(project, editor, aClass, local.getInitializer(), local.getType(), occurences, null, null);
+      }
+    };
     return localToFieldHandler.convertLocalToField(localVariable, editor);
   }
 
@@ -112,7 +120,7 @@ public class IntroduceConstantHandler extends BaseExpressionToFieldHandler {
       }
     }
 
-    IntroduceConstantDialog dialog =
+    final IntroduceConstantDialog dialog =
       new IntroduceConstantDialog(project, parentClass, expr, localVariable, false, occurences, getParentClass(),
                                   new TypeSelectorManagerImpl(project, type, expr, occurences));
     dialog.show();
index bc222e11468e6fe672cb3522c3f54d6590b767de..104b5212bf1f0096515a443e981bf97231732ecd 100644 (file)
@@ -127,8 +127,17 @@ public class IntroduceFieldHandler extends BaseExpressionToFieldHandler {
     return new ExpressionOccurenceManager(selectedExpr, parentClass, occurenceFilter, true);
   }
 
-  protected boolean invokeImpl(Project project, PsiLocalVariable localVariable, Editor editor) {
-    LocalToFieldHandler localToFieldHandler = new LocalToFieldHandler(project, false);
+  protected boolean invokeImpl(final Project project, PsiLocalVariable localVariable, final Editor editor) {
+    LocalToFieldHandler localToFieldHandler = new LocalToFieldHandler(project, false){
+      @Override
+      protected Settings showRefactoringDialog(PsiClass aClass,
+                                               PsiLocalVariable local,
+                                               PsiExpression[] occurences,
+                                               boolean isStatic) {
+        final PsiStatement statement = PsiTreeUtil.getParentOfType(local, PsiStatement.class);
+        return IntroduceFieldHandler.this.showRefactoringDialog(project, editor, aClass, local.getInitializer(), local.getType(), occurences, statement, statement);
+      }
+    };
     return localToFieldHandler.convertLocalToField(localVariable, editor);
   }
 
index ee2c97c7dd16035e479c56a7d9c20824d22e0e27..e367e86ebdbd3420386e1dbfc4d46189b7e82a8e 100644 (file)
@@ -26,10 +26,8 @@ import com.intellij.psi.*;
 import com.intellij.psi.codeStyle.CodeStyleManager;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.psi.search.searches.ReferencesSearch;
-import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.refactoring.HelpID;
 import com.intellij.refactoring.RefactoringBundle;
-import com.intellij.refactoring.ui.TypeSelectorManagerImpl;
 import com.intellij.refactoring.util.CommonRefactoringUtil;
 import com.intellij.refactoring.util.EnumConstantsUtil;
 import com.intellij.refactoring.util.RefactoringUtil;
@@ -40,7 +38,7 @@ import org.jetbrains.annotations.NonNls;
 import static com.intellij.refactoring.introduceField.BaseExpressionToFieldHandler.InitializationPlace.IN_CONSTRUCTOR;
 import static com.intellij.refactoring.introduceField.BaseExpressionToFieldHandler.InitializationPlace.IN_FIELD_DECLARATION;
 
-public class LocalToFieldHandler {
+public abstract class LocalToFieldHandler {
   private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.introduceField.LocalToFieldHandler");
 
   private static final String REFACTORING_NAME = RefactoringBundle.message("convert.local.to.field.title");
@@ -54,52 +52,7 @@ public class LocalToFieldHandler {
     myIsConstant = isConstant;
   }
 
-  protected BaseExpressionToFieldHandler.Settings showRefactoringDialog(PsiClass aClass, PsiLocalVariable local, PsiExpression[] occurences, boolean isStatic) {
-    final String fieldName;
-    final BaseExpressionToFieldHandler.InitializationPlace initializerPlace;
-    final boolean declareFinal;
-    @Modifier String fieldVisibility;
-    final TypeSelectorManagerImpl typeSelectorManager = new TypeSelectorManagerImpl(myProject, local.getType(),
-                                                                                    occurences
-    );
-
-    final boolean annotateAsNonNls;
-    final boolean introduceEnumConstant;
-    if (myIsConstant) {
-      IntroduceConstantDialog dialog = new IntroduceConstantDialog(myProject, aClass,
-                                                                   local.getInitializer(), local, true, occurences, aClass, typeSelectorManager
-      );
-      dialog.show();
-      if (!dialog.isOK()) return null;
-      fieldName = dialog.getEnteredName();
-      declareFinal = true;
-      initializerPlace = IN_FIELD_DECLARATION;
-      fieldVisibility = dialog.getFieldVisibility();
-      annotateAsNonNls = dialog.isAnnotateAsNonNls();
-      introduceEnumConstant = dialog.introduceEnumConstant();
-    }
-    else {
-      PsiMethod method = PsiTreeUtil.getParentOfType(local, PsiMethod.class);
-      IntroduceFieldDialog dialog = new IntroduceFieldDialog(myProject, aClass,
-                                                             local.getInitializer(), local,
-                                                             method != null && method.isConstructor(),
-                                                             true, isStatic,
-                                                             occurences.length, method != null, method != null,
-                                                             typeSelectorManager
-      );
-      dialog.show();
-      if (!dialog.isOK()) return null;
-      fieldName = dialog.getEnteredName();
-      initializerPlace = dialog.getInitializerPlace();
-      declareFinal = dialog.isDeclareFinal();
-      fieldVisibility = dialog.getFieldVisibility();
-      annotateAsNonNls = false;
-      introduceEnumConstant = false;
-    }
-
-    return new BaseExpressionToFieldHandler.Settings(fieldName, true, isStatic, declareFinal, initializerPlace, fieldVisibility, local, null, true, new BaseExpressionToFieldHandler.TargetDestination(aClass), annotateAsNonNls,
-                                                     introduceEnumConstant);
-  }
+  protected abstract BaseExpressionToFieldHandler.Settings showRefactoringDialog(PsiClass aClass, PsiLocalVariable local, PsiExpression[] occurences, boolean isStatic);
 
   public boolean convertLocalToField(final PsiLocalVariable local, final Editor editor) {
     PsiClass aClass;
index 70e9a96f3b6375b7443f40346079cd2d1ebe8a4a..f05c5991326041bd19c34dfd779be659b28366fd 100644 (file)
@@ -36,10 +36,7 @@ import com.intellij.psi.codeStyle.CodeStyleSettingsManager;
 import com.intellij.psi.search.LocalSearchScope;
 import com.intellij.psi.search.searches.OverridingMethodsSearch;
 import com.intellij.psi.search.searches.ReferencesSearch;
-import com.intellij.psi.util.InheritanceUtil;
-import com.intellij.psi.util.MethodSignatureUtil;
-import com.intellij.psi.util.PsiTreeUtil;
-import com.intellij.psi.util.PsiUtil;
+import com.intellij.psi.util.*;
 import com.intellij.refactoring.BaseRefactoringProcessor;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.listeners.JavaRefactoringListenerManager;
@@ -129,6 +126,9 @@ public class PullUpHelper extends BaseRefactoringProcessor{
       ChangeContextUtil.encodeContextInfo(info.getMember(), true);
     }
 
+    final PsiSubstitutor substitutor = upDownSuperClassSubstitutor();
+    final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(myProject);
+
     // do actual move
     for (MemberInfo info : myMembersToMove) {
       if (info.getMember() instanceof PsiMethod) {
@@ -138,7 +138,7 @@ public class PullUpHelper extends BaseRefactoringProcessor{
           PsiMethod methodCopy = (PsiMethod)method.copy();
           ChangeContextUtil.clearContextInfo(method);
           RefactoringUtil.abstractizeMethod(myTargetSuperClass, methodCopy);
-
+          RefactoringUtil.replaceMovedMemberTypeParameters(methodCopy, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
           if (method.findDeepestSuperMethods().length == 0 || (myTargetSuperClass.isInterface() && !PsiUtil.isLanguageLevel6OrHigher(mySourceClass))) {
             deleteOverrideAnnotationIfFound(methodCopy);
           }
@@ -169,6 +169,7 @@ public class PullUpHelper extends BaseRefactoringProcessor{
           if (isOriginalMethodAbstract) {
             PsiUtil.setModifierProperty(myTargetSuperClass, PsiModifier.ABSTRACT, true);
           }
+          RefactoringUtil.replaceMovedMemberTypeParameters(method, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
           fixReferencesToStatic(method, movedMembers);
           final PsiMethod superClassMethod = myTargetSuperClass.findMethodBySignature(method, false);
           if (superClassMethod != null && superClassMethod.hasModifierProperty(PsiModifier.ABSTRACT)) {
@@ -184,6 +185,7 @@ public class PullUpHelper extends BaseRefactoringProcessor{
       else if (info.getMember() instanceof PsiField) {
         PsiField field = (PsiField)info.getMember();
         field.normalizeDeclaration();
+        RefactoringUtil.replaceMovedMemberTypeParameters(field, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
         fixReferencesToStatic(field, movedMembers);
         if (myIsTargetInterface) {
           PsiUtil.setModifierProperty(field, PsiModifier.PUBLIC, true);
@@ -201,6 +203,7 @@ public class PullUpHelper extends BaseRefactoringProcessor{
                                             RefactoringUtil.removeFromReferenceList(sourceReferenceList, aClass) :
                                             RefactoringUtil.findReferenceToClass(sourceReferenceList, aClass);
           if (ref != null) {
+            RefactoringUtil.replaceMovedMemberTypeParameters(ref, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
             final PsiReferenceList referenceList =
               myTargetSuperClass.isInterface() ? myTargetSuperClass.getExtendsList() : myTargetSuperClass.getImplementsList();
             assert referenceList != null;
@@ -208,6 +211,7 @@ public class PullUpHelper extends BaseRefactoringProcessor{
           }
         }
         else {
+          RefactoringUtil.replaceMovedMemberTypeParameters(aClass, PsiUtil.typeParametersIterable(mySourceClass), substitutor, elementFactory);
           fixReferencesToStatic(aClass, movedMembers);
           final PsiMember movedElement = (PsiMember)myTargetSuperClass.add(aClass);
           myMembersAfterMove.add(movedElement);
@@ -235,6 +239,23 @@ public class PullUpHelper extends BaseRefactoringProcessor{
     }
   }
 
+  private PsiSubstitutor upDownSuperClassSubstitutor() {
+    PsiSubstitutor substitutor = PsiSubstitutor.EMPTY;
+    for (PsiTypeParameter parameter : PsiUtil.typeParametersIterable(mySourceClass)) {
+      substitutor = substitutor.put(parameter, null);
+    }
+    final Map<PsiTypeParameter, PsiType> substitutionMap =
+      TypeConversionUtil.getSuperClassSubstitutor(myTargetSuperClass, mySourceClass, PsiSubstitutor.EMPTY).getSubstitutionMap();
+    for (PsiTypeParameter parameter : substitutionMap.keySet()) {
+      final PsiType type = substitutionMap.get(parameter);
+      final PsiClass resolvedClass = PsiUtil.resolveClassInType(type);
+      if (resolvedClass instanceof PsiTypeParameter) {
+        substitutor = substitutor.put((PsiTypeParameter)resolvedClass, JavaPsiFacade.getElementFactory(myProject).createType(parameter));
+      }
+    }
+    return substitutor;
+  }
+
   private static void deleteOverrideAnnotationIfFound(PsiMethod oMethod) {
     final PsiAnnotation annotation = AnnotationUtil.findAnnotation(oMethod, Override.class.getName());
     if (annotation != null) {
index 7e8331bdc9828c76ce95c16e86f5f6707e0e0224..0edd3a3228c912d0005f640589578b7caf65be68 100644 (file)
@@ -327,26 +327,8 @@ public class PushDownProcessor extends BaseRefactoringProcessor {
   private void pushDownToClass(PsiClass targetClass) throws IncorrectOperationException {
     final PsiElementFactory factory = JavaPsiFacade.getInstance(myClass.getProject()).getElementFactory();
     final PsiSubstitutor substitutor = TypeConversionUtil.getSuperClassSubstitutor(myClass, targetClass, PsiSubstitutor.EMPTY);
-    for (PsiTypeParameter parameter : PsiUtil.typeParametersIterable(myClass)) {
-      for (PsiReference reference : ReferencesSearch.search(parameter)) {
-        final PsiElement element = reference.getElement();
-        final PsiMember member = PsiTreeUtil.getParentOfType(element, PsiMember.class);
-        if (member != null) {
-          for (MemberInfo memberInfo : myMemberInfos) {
-            if (PsiTreeUtil.isAncestor(memberInfo.getMember(), member, false)) {
-              PsiType substitutedType = substitutor.substitute(parameter);
-              if (substitutedType == null) {
-                substitutedType = TypeConversionUtil.erasure(factory.createType(parameter));
-              }
-              element.getParent().replace(factory.createTypeElement(substitutedType));
-              break;
-            }
-          }
-        }
-      }
-    }
     for (MemberInfo memberInfo : myMemberInfos) {
-      final PsiMember member = memberInfo.getMember();
+      PsiMember member = memberInfo.getMember();
       final List<PsiReference> refsToRebind = new ArrayList<PsiReference>();
       final PsiModifierList list = member.getModifierList();
       LOG.assertTrue(list != null);
@@ -362,7 +344,8 @@ public class PushDownProcessor extends BaseRefactoringProcessor {
           refsToRebind.add(reference);
         }
       }
-
+      member = (PsiMember)member.copy();
+      RefactoringUtil.replaceMovedMemberTypeParameters(member, PsiUtil.typeParametersIterable(myClass), substitutor, factory);
       PsiMember newMember = null;
       if (member instanceof PsiField) {
         ((PsiField)member).normalizeDeclaration();
index 593cc62eebc28299c76a8d45073802226c6da65f..4113edcc80b7d216a0cca0d2cd5273c6602cb321 100644 (file)
@@ -117,7 +117,7 @@ class MigrationProcessor extends BaseRefactoringProcessor {
   protected void performRefactoring(UsageInfo[] usages) {
     PsiManager psiManager = PsiManager.getInstance(myProject);
     final PsiMigration psiMigration = JavaPsiFacade.getInstance(psiManager.getProject()).startMigration();
-    LocalHistoryAction a = LocalHistory.startAction(myProject, getCommandName());
+    LocalHistoryAction a = LocalHistory.getInstance().startAction(getCommandName());
 
     try {
       for (int i = 0; i < myMigrationMap.getEntryCount(); i++) {
index 8f69918665b5e85fec58dc62991f3d3d6c0faaf3..9ab24ce8ab3f281a5d03343f79eb5923917f45b7 100644 (file)
@@ -316,7 +316,7 @@ public class MoveClassesOrPackagesImpl {
       public void run() {
         ApplicationManager.getApplication().runWriteAction(new Runnable() {
           public void run() {
-            LocalHistoryAction a = LocalHistory.startAction(project, commandDescription);
+            LocalHistoryAction a = LocalHistory.getInstance().startAction(commandDescription);
             try {
               rearrangeDirectoriesToTarget(directories, selectedTarget);
             }
index 3555beafb89e993017bbc4d8a49bb9f8e3128ce0..aa68369253e2a8d9686f18a9ffe2474aa3709246 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2010 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.
@@ -473,7 +473,10 @@ public class MoveClassesOrPackagesProcessor extends BaseRefactoringProcessor {
         LOG.assertTrue(newElement != null);
         final PsiReference reference = moveRenameUsage.getReference();
         if (reference != null) {
-          reference.bindToElement(newElement);
+          try {
+            reference.bindToElement(newElement);
+          } catch (IncorrectOperationException e) {//
+          }
         }
       }
     }
index be67e1e2bdb2d5f1ea92c188f6b45cfd5f4bad97..33309695429d3e6a33b029be8b88856f142cecce 100644 (file)
@@ -48,6 +48,7 @@ import com.intellij.psi.tree.IElementType;
 import com.intellij.psi.util.InheritanceUtil;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
+import com.intellij.psi.util.TypeConversionUtil;
 import com.intellij.refactoring.PackageWrapper;
 import com.intellij.refactoring.introduceField.ElementToWorkOn;
 import com.intellij.refactoring.introduceVariable.IntroduceVariableBase;
@@ -855,6 +856,22 @@ public class RefactoringUtil {
     return null;
   }
 
+  public static void replaceMovedMemberTypeParameters(final PsiElement member,
+                                                      final Iterable<PsiTypeParameter> parametersIterable,
+                                                      final PsiSubstitutor substitutor,
+                                                      final PsiElementFactory factory) {
+    for (PsiTypeParameter parameter : parametersIterable) {
+      for (PsiReference reference : ReferencesSearch.search(parameter, new LocalSearchScope(member))) {
+        final PsiElement element = reference.getElement();
+        PsiType substitutedType = substitutor.substitute(parameter);
+        if (substitutedType == null) {
+          substitutedType = TypeConversionUtil.erasure(factory.createType(parameter));
+        }
+        element.getParent().replace(factory.createTypeElement(substitutedType));
+      }
+    }
+  }
+
   public static interface ImplicitConstructorUsageVisitor {
     void visitConstructor(PsiMethod constructor, PsiMethod baseConstructor);
 
index 70c2a23269c2c1b8c0b8b2b93894f9f47b95faa5..4aef1e9d0784353ac2dd62b01c8728fe4f390564 100644 (file)
@@ -134,7 +134,7 @@ public class MethodDuplicatesHandler implements RefactoringActionHandler {
   }
 
   private static void replaceDuplicate(final Project project, final List<Match> duplicates, final PsiMethod method) {
-    LocalHistoryAction a = LocalHistory.startAction(project, REFACTORING_NAME);
+    LocalHistoryAction a = LocalHistory.getInstance().startAction(REFACTORING_NAME);
     try {
       final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
       if (progressIndicator != null && progressIndicator.isCanceled()) return;
index 9e306a10e0abfefd5e66d88d6908b0718479553c..09e6dd5f12aa7ddb59e5fb46eb844efc68e650eb 100644 (file)
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.InputStreamReader;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
 import java.net.ServerSocket;
 import java.net.Socket;
 
@@ -105,6 +106,10 @@ public class AppMain {
       parms[j - 1] = args[j];
     }
     Method m = Class.forName(mainClass).getMethod("main", new Class[]{parms.getClass()});
+    if (!Modifier.isStatic(m.getModifiers())) {
+      System.err.println("main method should be static");
+      return;
+    }
     try {
       ensureAccess(m);
       m.invoke(null, new Object[]{parms});
diff --git a/java/java-tests/testData/codeInsight/completion/normal/EnumConstantFromEnumMember.java b/java/java-tests/testData/codeInsight/completion/normal/EnumConstantFromEnumMember.java
new file mode 100644 (file)
index 0000000..c3503f0
--- /dev/null
@@ -0,0 +1,6 @@
+public enum ButtonKey {
+  CANCEL_ALL,
+  CANCEL_SELL;
+
+  public static final ButtonKey[] ARR = {CANCEL_ALL, CANCEL_S<caret>};
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/normal/EnumConstantFromEnumMember_after.java b/java/java-tests/testData/codeInsight/completion/normal/EnumConstantFromEnumMember_after.java
new file mode 100644 (file)
index 0000000..ec0e055
--- /dev/null
@@ -0,0 +1,6 @@
+public enum ButtonKey {
+  CANCEL_ALL,
+  CANCEL_SELL;
+
+  public static final ButtonKey[] ARR = {CANCEL_ALL, CANCEL_SELL<caret>};
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/codeInsight/completion/normal/PrimitiveMethodParameter.java b/java/java-tests/testData/codeInsight/completion/normal/PrimitiveMethodParameter.java
new file mode 100644 (file)
index 0000000..eea3b77
--- /dev/null
@@ -0,0 +1,3 @@
+public class Foo {
+  Object foo(bo<caret>){ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/normal/PrimitiveMethodParameter_after.java b/java/java-tests/testData/codeInsight/completion/normal/PrimitiveMethodParameter_after.java
new file mode 100644 (file)
index 0000000..aa3645a
--- /dev/null
@@ -0,0 +1,3 @@
+public class Foo {
+  Object foo(boolean <caret>){ }
+}
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TabAfterNew-out.java b/java/java-tests/testData/codeInsight/completion/smartType/TabAfterNew-out.java
new file mode 100644 (file)
index 0000000..0eb33cc
--- /dev/null
@@ -0,0 +1,21 @@
+public class Main {
+
+  public void main(String[] args) {
+    Aaaa a = new Bbbb(<caret>2);
+  }
+
+  class Aaaa {
+    int aaa;
+
+    Aaaa(int aaa) {
+      this.aaa = aaa;
+    }
+  }
+
+  class Bbbb extends Aaaa{
+    Bbbb(int aaa) {
+      super(aaa);
+    }
+  }
+
+}
diff --git a/java/java-tests/testData/codeInsight/completion/smartType/TabAfterNew.java b/java/java-tests/testData/codeInsight/completion/smartType/TabAfterNew.java
new file mode 100644 (file)
index 0000000..98174a6
--- /dev/null
@@ -0,0 +1,21 @@
+public class Main {
+
+  public void main(String[] args) {
+    Aaaa a = new B<caret>Aaaa(2);
+  }
+
+  class Aaaa {
+    int aaa;
+
+    Aaaa(int aaa) {
+      this.aaa = aaa;
+    }
+  }
+
+  class Bbbb extends Aaaa{
+    Bbbb(int aaa) {
+      super(aaa);
+    }
+  }
+
+}
diff --git a/java/java-tests/testData/inspection/fieldCanBeLocal/innerClassFieldInitializer/expected.xml b/java/java-tests/testData/inspection/fieldCanBeLocal/innerClassFieldInitializer/expected.xml
new file mode 100644 (file)
index 0000000..4704d91
--- /dev/null
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<problems/>
\ No newline at end of file
diff --git a/java/java-tests/testData/inspection/fieldCanBeLocal/innerClassFieldInitializer/src/Test.java b/java/java-tests/testData/inspection/fieldCanBeLocal/innerClassFieldInitializer/src/Test.java
new file mode 100644 (file)
index 0000000..018f649
--- /dev/null
@@ -0,0 +1,7 @@
+public class Outer {
+  private int value = 0;
+
+  public class Inner {
+    private final int myValue = Outer.this.value;
+  }
+}
\ No newline at end of file
index aeb61dd127bbe939bd3e0cd452ad7efd5acfed1c..192f96517545e802fe7429430c05a2532dbecfde 100644 (file)
@@ -30,7 +30,7 @@ import java.util.RandomAccess;
  * at least as large as the list size.  As elements are added to an ArrayList,
  * its capacity grows automatically.  The details of the growth policy are not
  * specified beyond the fact that adding an element has constant amortized
- * time cost.<p>
+ * time cost.<p> 
  *
  * An application can increase the capacity of an <tt>ArrayList</tt> instance
  * before adding a large number of elements using the <tt>ensureCapacity</tt>
@@ -63,12 +63,12 @@ import java.util.RandomAccess;
  * Note that the fail-fast behavior of an iterator cannot be guaranteed
  * as it is, generally speaking, impossible to make any hard guarantees in the
  * presence of unsynchronized concurrent modification.  Fail-fast iterators
- * throw <tt>ConcurrentModificationException</tt> on a best-effort basis.
+ * throw <tt>ConcurrentModificationException</tt> on a best-effort basis. 
  * Therefore, it would be wrong to write a program that depended on this
  * exception for its correctness: <i>the fail-fast behavior of iterators
  * should be used only to detect bugs.</i><p>
  *
- * This class is a member of the
+ * This class is a member of the 
  * <a href="{@docRoot}/../guide/collections/index.html">
  * Java Collections Framework</a>.
  *
@@ -136,7 +136,7 @@ public class Bar<E> extends AbstractList<E>
         size = c.size();
         // Allow 10% room for growth
         elementData = (E[])new Object[
-                      (int)Math.min((size*110L)/100,Integer.MAX_VALUE)];
+                      (int)Math.min((size*110L)/100,Integer.MAX_VALUE)]; 
         c.toArray(elementData);
     }
 
@@ -158,7 +158,7 @@ public class Bar<E> extends AbstractList<E>
     /**
      * Increases the capacity of this <tt>ArrayList</tt> instance, if
      * necessary, to ensure  that it can hold at least the number of elements
-     * specified by the minimum capacity argument.
+     * specified by the minimum capacity argument. 
      *
      * @param   minCapacity   the desired minimum capacity.
      */
@@ -206,8 +206,8 @@ public class Bar<E> extends AbstractList<E>
     }
 
     /**
-     * Searches for the first occurence of the given argument, testing
-     * for equality using the <tt>equals</tt> method.
+     * Searches for the first occurence of the given argument, testing 
+     * for equality using the <tt>equals</tt> method. 
      *
      * @param   elem   an object.
      * @return  the index of the first occurrence of the argument in this
@@ -255,13 +255,13 @@ public class Bar<E> extends AbstractList<E>
      * @return  a clone of this <tt>ArrayList</tt> instance.
      */
     public Object clone() {
-       try {
+       try { 
            Bar<E> v = (Bar<E>) super.clone();
            v.elementData = (E[])new Object[size];
            System.arraycopy(elementData, 0, v.elementData, 0, size);
            v.modCount = 0;
            return v;
-       } catch (CloneNotSupportedException e) {
+       } catch (CloneNotSupportedException e) { 
            // this shouldn't happen, since we are Cloneable
            throw new InternalError();
        }
@@ -441,7 +441,7 @@ public class Bar<E> extends AbstractList<E>
         modCount++;
         int numMoved = size - index - 1;
         if (numMoved > 0)
-            System.arraycopy(elementData, index+1, elementData, index,
+            System.arraycopy(elementData, index+1, elementData, index, 
                              numMoved);
         elementData[--size] = null; // Let gc do its work
     }
@@ -589,4 +589,4 @@ public class Bar<E> extends AbstractList<E>
        for (int i=0; i<size; i++)
             a[i] = s.readObject();
     }
-}
\ No newline at end of file
+}
diff --git a/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/after/A.java b/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/after/A.java
new file mode 100644 (file)
index 0000000..9414e4e
--- /dev/null
@@ -0,0 +1,8 @@
+public class A {
+    public final MyIntf myDelegate = new MyIntf();
+
+    private class MyIntf implements Intf<Integer> {
+        public void method1(Integer t) {
+        }
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/after/Intf.java b/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/after/Intf.java
new file mode 100644 (file)
index 0000000..da4078c
--- /dev/null
@@ -0,0 +1,3 @@
+public interface Intf<T> {
+    void method1(T t);
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/before/A.java b/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/before/A.java
new file mode 100644 (file)
index 0000000..377e466
--- /dev/null
@@ -0,0 +1,4 @@
+public class A implements Intf<Integer> {
+    public void method1(Integer t) {
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/before/Intf.java b/java/java-tests/testData/refactoring/inheritanceToDelegation/typeParametersSubstitution/before/Intf.java
new file mode 100644 (file)
index 0000000..da4078c
--- /dev/null
@@ -0,0 +1,3 @@
+public interface Intf<T> {
+    void method1(T t);
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/after/Test.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/after/Test.java
new file mode 100644 (file)
index 0000000..cab6506
--- /dev/null
@@ -0,0 +1,3 @@
+class Test {
+    Integer t;
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/after/Test1.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/after/Test1.java
new file mode 100644 (file)
index 0000000..758551d
--- /dev/null
@@ -0,0 +1,3 @@
+class Test1 {
+    String t;
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Super.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Super.java
new file mode 100644 (file)
index 0000000..89a7eb9
--- /dev/null
@@ -0,0 +1,3 @@
+class Super<T> {
+  T t;
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Test.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Test.java
new file mode 100644 (file)
index 0000000..034a76b
--- /dev/null
@@ -0,0 +1,2 @@
+class Test extends Super<Integer>{
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Test1.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubstitutions/before/Test1.java
new file mode 100644 (file)
index 0000000..1ba993a
--- /dev/null
@@ -0,0 +1,2 @@
+class Test1 extends Super<String>{
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/pullUp/GenericsInAbstractMethod.java b/java/java-tests/testData/refactoring/pullUp/GenericsInAbstractMethod.java
new file mode 100644 (file)
index 0000000..bd2f499
--- /dev/null
@@ -0,0 +1,5 @@
+public abstract class Parent<S> {}
+
+class Child<T> extends Parent<T> {
+   void <caret>method(T t){}
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/GenericsInAbstractMethod_after.java b/java/java-tests/testData/refactoring/pullUp/GenericsInAbstractMethod_after.java
new file mode 100644 (file)
index 0000000..2988117
--- /dev/null
@@ -0,0 +1,8 @@
+public abstract class Parent<S> {
+    abstract void method(S t);
+}
+
+class Child<T> extends Parent<T> {
+   @Override
+   void method(T t){}
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/GenericsInImplements.java b/java/java-tests/testData/refactoring/pullUp/GenericsInImplements.java
new file mode 100644 (file)
index 0000000..07e1f89
--- /dev/null
@@ -0,0 +1,10 @@
+public class Parent<S> {}
+
+interface I<IT> {
+  void method(IT t);
+}
+
+class Child<T> extends Parent<T> implements I<T>{
+  <caret>
+  public void method(T t){}
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/GenericsInImplements_after.java b/java/java-tests/testData/refactoring/pullUp/GenericsInImplements_after.java
new file mode 100644 (file)
index 0000000..3aca9f8
--- /dev/null
@@ -0,0 +1,10 @@
+public class Parent<S> implements I<S> {}
+
+interface I<IT> {
+  void method(IT t);
+}
+
+class Child<T> extends Parent<T> {
+  
+  public void method(T t){}
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/TypeArgument.java b/java/java-tests/testData/refactoring/pullUp/TypeArgument.java
new file mode 100644 (file)
index 0000000..21140c8
--- /dev/null
@@ -0,0 +1,5 @@
+public class Parent<S> {}
+
+class Child extends Parent<String> {
+   String <caret>f;
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/TypeArgument_after.java b/java/java-tests/testData/refactoring/pullUp/TypeArgument_after.java
new file mode 100644 (file)
index 0000000..6530ecf
--- /dev/null
@@ -0,0 +1,6 @@
+public class Parent<S> {
+    String f;
+}
+
+class Child extends Parent<String> {
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/TypeParamErasure.java b/java/java-tests/testData/refactoring/pullUp/TypeParamErasure.java
new file mode 100644 (file)
index 0000000..0dbc24f
--- /dev/null
@@ -0,0 +1,5 @@
+public class Parent {}
+
+class Child<T> extends Parent {
+   T <caret>f;
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/TypeParamErasure_after.java b/java/java-tests/testData/refactoring/pullUp/TypeParamErasure_after.java
new file mode 100644 (file)
index 0000000..fbe98da
--- /dev/null
@@ -0,0 +1,6 @@
+public class Parent {
+    Object f;
+}
+
+class Child<T> extends Parent {
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/TypeParamSubst.java b/java/java-tests/testData/refactoring/pullUp/TypeParamSubst.java
new file mode 100644 (file)
index 0000000..f2ad0c7
--- /dev/null
@@ -0,0 +1,5 @@
+public class Parent<S> {}
+
+class Child<T> extends Parent<T> {
+   T <caret>f;
+}
diff --git a/java/java-tests/testData/refactoring/pullUp/TypeParamSubst_after.java b/java/java-tests/testData/refactoring/pullUp/TypeParamSubst_after.java
new file mode 100644 (file)
index 0000000..bc74745
--- /dev/null
@@ -0,0 +1,6 @@
+public class Parent<S> {
+    S f;
+}
+
+class Child<T> extends Parent<T> {
+}
index 7a6bc1e2b2e48ade035510bbe067986884dad2ae..40cb370a5fe7d732684c84fb5fb84774fe91b0b3 100644 (file)
@@ -662,5 +662,9 @@ public class NormalCompletionTest extends LightCompletionTestCase {
 
   public void testMethodParameterAnnotationClass() throws Throwable { doTest(); }
 
+  public void testEnumConstantFromEnumMember() throws Throwable { doTest(); }
+
+  public void testPrimitiveMethodParameter() throws Throwable { doTest(); }
+
 
 }
index 1883bba1da8571710cab588151868a64f40eeed4..ffb13f847f70ad64337af63417b3c9bdaa4025fe 100644 (file)
@@ -996,6 +996,12 @@ public class SmartTypeCompletionTest extends LightCompletionTestCase {
     checkResultByTestName();
   }
 
+  public void testTabAfterNew() throws Exception {
+    configureByTestName();
+    select('\t');
+    checkResultByTestName();
+  }
+
   private void doTest(boolean performAction, boolean selectItem) throws Exception {
     configureByTestName();
     if (performAction) {
index 0cec8f0eb285efe0b9a2c36e2cd0d3bad82d6bf9..5ebd2c2cf9f67a32ba4e78b63cd3bc4765f78c7c 100644 (file)
@@ -29,4 +29,5 @@ public class FieldCanBeLocalTest extends InspectionTestCase {
   public void testStateField() throws Exception { doTest(); }
   public void testLocalStateVar2InnerClass() throws Exception { doTest(); }
   public void testNotConstantInitializer() throws Exception {doTest();}
+  public void testInnerClassFieldInitializer() throws Exception {doTest();}
 }
index ec9beac919f484315036e0045788f89d0568d03d..e3b45d35ca2f0b749639d4a63d6c2156a164117c 100644 (file)
@@ -119,6 +119,9 @@ public class InheritanceToDelegationTest extends MultiFileTestCase {
         new String[]{"getDate"}, ArrayUtil.EMPTY_STRING_ARRAY, false, false));
   }
 
+  public void testTypeParametersSubstitution() throws Exception {
+     doTest(createPerformAction("A", "myDelegate", "MyIntf", "Intf", new int[]{}, ArrayUtil.EMPTY_STRING_ARRAY, true, false));
+  }
 
   private PerformAction createPerformAction(
     final String className, final String fieldName, final String innerClassName,
index 42106d67c43ba474f40fea01d3db4e16d184f4db..ef07ab92a47dd528debe1914cef7fe6a33d4d875 100644 (file)
@@ -161,6 +161,14 @@ public class InlineSuperClassTest extends MultiFileTestCase {
   }
 
   public void testMultipleSubclasses() throws Exception {
+    doTestMultipleSubclasses();
+  }
+
+  public void testMultipleSubstitutions() throws Exception {
+    doTestMultipleSubclasses();
+  }
+
+  private void doTestMultipleSubclasses() throws Exception {
     doTest(new PerformAction() {
       public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
         PsiClass superClass = myJavaFacade.findClass("Super", GlobalSearchScope.allScope(myProject));
index 956fd609bc995c0ff2a7f6d00d7fac669c8ee02a..ba9f939372badb844861999af9131659c21a1cf0 100644 (file)
@@ -67,7 +67,31 @@ public class PullUpTest extends LightCodeInsightTestCase {
     doTest(new MemberDescriptor ("get", PsiMethod.class));
   }
 
+  public void testTypeParamErasure() throws Exception {
+    doTest(new MemberDescriptor("f", PsiField.class));
+  }
+
+  public void testTypeParamSubst() throws Exception {
+    doTest(new MemberDescriptor("f", PsiField.class));
+  }
+
+  public void testTypeArgument() throws Exception {
+    doTest(new MemberDescriptor("f", PsiField.class));
+  }
+
+  public void testGenericsInAbstractMethod() throws Exception {
+    doTest(new MemberDescriptor("method", PsiMethod.class, true));
+  }
+
+  public void testGenericsInImplements() throws Exception {
+    doTest(false, new MemberDescriptor("I", PsiClass.class));
+  }
+
   private void doTest(MemberDescriptor... membersToFind) throws Exception {
+    doTest(true, membersToFind);
+  }
+
+  private void doTest(final boolean checkMemebersMovedCount, MemberDescriptor... membersToFind) throws Exception {
     configureByFile(BASE_PATH + getTestName(false) + ".java");
     PsiElement elementAt = getFile().findElementAt(getEditor().getCaretModel().getOffset());
     final PsiClass sourceClass = PsiTreeUtil.getParentOfType(elementAt, PsiClass.class);
@@ -93,7 +117,9 @@ public class PullUpTest extends LightCodeInsightTestCase {
     final PullUpHelper helper = new PullUpHelper(sourceClass, targetClass, infos, new DocCommentPolicy(DocCommentPolicy.ASIS));
     helper.run();
     JavaRefactoringListenerManager.getInstance(getProject()).removeMoveMembersListener(listener);
-    assertEquals(countMoved[0], membersToFind.length);
+    if (checkMemebersMovedCount) {
+      assertEquals(countMoved[0], membersToFind.length);
+    }
     checkResultByFile(BASE_PATH + getTestName(false) + "_after.java");
   }
 
index 02b2d95a9247e2291edea5dfa0b046c593dfcb85..d05194d6fe41912761036e606e37c80ce2ae434e 100644 (file)
 
 package com.intellij.execution.runners;
 
-import com.intellij.execution.ExecutionException;
-import com.intellij.execution.ExecutionManager;
-import com.intellij.execution.ExecutionResult;
-import com.intellij.execution.Executor;
+import com.intellij.execution.*;
 import com.intellij.execution.configurations.*;
 import com.intellij.execution.process.ProcessHandler;
 import com.intellij.execution.ui.RunContentDescriptor;
 import com.intellij.history.LocalHistory;
-import com.intellij.history.LocalHistoryConfiguration;
 import com.intellij.openapi.actionSystem.AnAction;
 import com.intellij.openapi.actionSystem.DataKey;
 import com.intellij.openapi.application.ApplicationManager;
@@ -98,9 +94,7 @@ public abstract class GenericProgramRunner<Settings extends JDOMExternalizable>
           if (callback != null) callback.processStarted(descriptor);
 
           if (descriptor != null) {
-            if (LocalHistoryConfiguration.getInstance().ADD_LABEL_ON_RUNNING) {
-              LocalHistory.putSystemLabel(project, executor.getId() + " " + profile.getName());
-            }
+            LocalHistory.getInstance().putSystemLabel(project, getLocalHistoryLabel(profile, state));
 
             ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);
             final ProcessHandler processHandler = descriptor.getProcessHandler();
@@ -124,4 +118,8 @@ public abstract class GenericProgramRunner<Settings extends JDOMExternalizable>
   protected abstract RunContentDescriptor doExecute(final Project project, final Executor executor, final RunProfileState state,
                                         final RunContentDescriptor contentToReuse,
                                         final ExecutionEnvironment env) throws ExecutionException;
+
+  protected String getLocalHistoryLabel(RunProfile profile, RunProfileState state) {
+    return ExecutionBundle.message("default.runner.start.action.label", profile.getName());
+  }
 }
diff --git a/platform/lang-api/src/com/intellij/execution/ui/ConsoleViewWrapper.java b/platform/lang-api/src/com/intellij/execution/ui/ConsoleViewWrapper.java
deleted file mode 100644 (file)
index 4d70faa..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright 2000-2009 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.execution.ui;
-
-import com.intellij.execution.filters.Filter;
-import com.intellij.execution.filters.HyperlinkInfo;
-import com.intellij.execution.process.ProcessHandler;
-import com.intellij.openapi.actionSystem.AnAction;
-import org.jetbrains.annotations.NotNull;
-
-import javax.swing.*;
-
-/**
- * @author Gregory.Shrago
- */
-public class ConsoleViewWrapper implements ConsoleView, ExecutionConsoleEx {
-  private final ConsoleView myDelegate;
-
-  public ConsoleViewWrapper(final ConsoleView delegate) {
-    myDelegate = delegate;
-  }
-
-  public ConsoleView getDelegate() {
-    return myDelegate;
-  }
-
-  public void dispose() {
-    myDelegate.dispose();
-  }
-
-  public JComponent getComponent() {
-    return myDelegate.getComponent();
-  }
-
-  public JComponent getPreferredFocusableComponent() {
-    return myDelegate.getPreferredFocusableComponent();
-  }
-
-  public void print(String s, ConsoleViewContentType contentType) {
-    myDelegate.print(s, contentType);
-  }
-
-  public void clear() {
-    myDelegate.clear();
-  }
-
-  public void scrollTo(int offset) {
-    myDelegate.scrollTo(offset);
-  }
-
-  public void attachToProcess(ProcessHandler processHandler) {
-    myDelegate.attachToProcess(processHandler);
-  }
-
-  public void setOutputPaused(boolean value) {
-    myDelegate.setOutputPaused(value);
-  }
-
-  public boolean isOutputPaused() {
-    return myDelegate.isOutputPaused();
-  }
-
-  public boolean hasDeferredOutput() {
-    return myDelegate.hasDeferredOutput();
-  }
-
-  public void performWhenNoDeferredOutput(Runnable runnable) {
-    myDelegate.performWhenNoDeferredOutput(runnable);
-  }
-
-  public void setHelpId(String helpId) {
-    myDelegate.setHelpId(helpId);
-  }
-
-  public void addMessageFilter(Filter filter) {
-    myDelegate.addMessageFilter(filter);
-  }
-
-  public void printHyperlink(String hyperlinkText, HyperlinkInfo info) {
-    myDelegate.printHyperlink(hyperlinkText, info);
-  }
-
-  public int getContentSize() {
-    return myDelegate.getContentSize();
-  }
-
-  public boolean canPause() {
-    return myDelegate.canPause();
-  }
-
-  public void buildUi(RunnerLayoutUi layoutUi) {
-    if (myDelegate instanceof ExecutionConsoleEx) {
-      ((ExecutionConsoleEx)myDelegate).buildUi(layoutUi);
-    }
-  }
-
-
-  public String getExecutionConsoleId() {
-    if (myDelegate instanceof ExecutionConsoleEx) {
-      return ((ExecutionConsoleEx)myDelegate).getExecutionConsoleId();
-    }
-    return null;
-  }
-
-  @NotNull
-  public AnAction[] createConsoleActions() {
-    return myDelegate.createConsoleActions();
-  }
-
-}
index f33e96632a1d8f2cabd2f00cfdfd7439410e4952..e5fa2f012d7645cf892b2a2024151b0e247d8941 100644 (file)
@@ -75,7 +75,7 @@ public abstract class ElementCreator {
       protected void run(Result result) throws Throwable {
         LocalHistoryAction action = LocalHistoryAction.NULL;
         try {
-          action = LocalHistory.startAction(myProject, commandName);
+          action = LocalHistory.getInstance().startAction(commandName);
 
           PsiElement[] psiElements = create(inputString);
           myCreatedElements[0] = new SmartPsiElementPointer[psiElements.length];
index f8938f7e32876b53f740fbcb8b212816180e934c..1091ab914326498dfff876fae75d5d7aaf125af6 100644 (file)
@@ -41,6 +41,9 @@ public abstract class FrameworkSupportConfigurable {
     return null;
   }
 
+  public void onFrameworkSelectionChanged(boolean selected) {
+  }
+
   public void addListener(@NotNull FrameworkSupportConfigurableListener listener) {
     myDispatcher.addListener(listener);
   }
index ec2e7d68de25b1b63320838045fb058464eececf..92f563b0cceb8ba5b3ed247d8c8a6f823496ee0d 100644 (file)
@@ -63,6 +63,6 @@ public class CompositeFoldingBuilder extends FoldingBuilderEx implements DumbAwa
 
   public boolean isCollapsedByDefault(@NotNull ASTNode node) {
     final FoldingBuilder builder = node.getUserData(FOLDING_BUILDER);
-    return builder == null ? false : builder.isCollapsedByDefault(node);
+    return builder != null && builder.isCollapsedByDefault(node);
   }
 }
index 849c99bf2f0acde3eb6abf484abc7998465a7a7b..5b17f826924fc4c14a2c22de4e09fe342da26c51 100644 (file)
@@ -17,12 +17,10 @@ package com.intellij.lang.folding;
 
 import com.intellij.lang.ASTNode;
 import com.intellij.lang.Language;
-import com.intellij.lang.injection.InjectedLanguageManager;
 import com.intellij.openapi.editor.FoldingGroup;
 import com.intellij.openapi.util.ProperTextRange;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.psi.PsiElement;
-import com.intellij.psi.PsiFile;
 import com.intellij.util.ObjectUtils;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -97,19 +95,9 @@ public class FoldingDescriptor {
    * Returns the folded text range.
    * @return the folded text range.
    */
+  @NotNull
   public TextRange getRange() {
-    return getRange(myElement, myRange);
-  }
-
-  public static TextRange getRange(ASTNode node, TextRange range) {
-    PsiElement element = node.getPsi();
-    PsiFile containingFile = element.getContainingFile();
-    InjectedLanguageManager injectedManager = InjectedLanguageManager.getInstance(containingFile.getProject());
-    boolean isInjected = injectedManager.isInjectedFragment(containingFile);
-    if (isInjected) {
-      range = injectedManager.injectedToHost(element, range);
-    }
-    return range;
+    return myRange;
   }
 
   @Nullable
index a384d7d6e6b27465df9744bc4229d20ccade6765..e614dadde889a3ae2cdd176917538fa5a9f93b2d 100644 (file)
@@ -141,11 +141,11 @@ public class LibraryUtil {
   }
 
    @Nullable
-  public static LibraryOrderEntry findLibraryEntry(VirtualFile file, final Project project) {
+  public static OrderEntry findLibraryEntry(VirtualFile file, final Project project) {
     List<OrderEntry> entries = ProjectRootManager.getInstance(project).getFileIndex().getOrderEntriesForFile(file);
     for (OrderEntry entry : entries) {
-      if (entry instanceof LibraryOrderEntry) {
-        return (LibraryOrderEntry)entry;
+      if (entry instanceof LibraryOrderEntry || entry instanceof JdkOrderEntry) {
+        return entry;
       }
     }
     return null;
index 116ca1997fc37f0feed74f403078f7c970732814..168cbb89db6423455007bc251bbb4872273bc0e9 100644 (file)
@@ -375,6 +375,19 @@ public class CodeStyleSettings implements Cloneable, JDOMExternalizable {
 
   public boolean SPECIAL_ELSE_IF_TREATMENT = true;
 
+  /**
+   * Indicates if long sequence of chained method calls should be aligned.
+   * <p/>
+   * E.g. if statement like <code>'foo.bar().bar().bar();'</code> should be reformatted to the one below if,
+   * say, last <code>'bar()'</code> call exceeds right margin. The code looks as follows after reformatting
+   * if this property is <code>true</code>:
+   * <p/>
+   * <pre>
+   *     foo.bar().bar()
+   *        .bar();
+   * </pre>
+   */
+  public boolean ALIGN_MULTILINE_CHAINED_METHODS = false;
   public boolean ALIGN_MULTILINE_PARAMETERS = true;
   public boolean ALIGN_MULTILINE_PARAMETERS_IN_CALLS = false;
   public boolean ALIGN_MULTILINE_FOR = true;
index b623e9269d88ef36b19d85d21e3eaac5c7304d54..5cf631476812dcf1d088d0f9a71f766ef893d295 100644 (file)
@@ -80,6 +80,8 @@ public class FileContentUtil {
     }
     ApplicationManager.getApplication().runWriteAction(new Runnable() {
       public void run() {
+        ApplicationManager.getApplication().getMessageBus().syncPublisher(VirtualFileManager.VFS_CHANGES)
+            .before(new ArrayList<VFileEvent>(list));
         ApplicationManager.getApplication().getMessageBus().syncPublisher(VirtualFileManager.VFS_CHANGES)
             .after(new ArrayList<VFileEvent>(list));
       }
index 24fe62cab119458e6fb7f5b85c5cbc129a68c3f8..9d43f6eabdb8246c44dbaadc82dc70c56357861d 100644 (file)
@@ -18,7 +18,6 @@ package com.intellij.application.options.codeStyle;
 import com.intellij.openapi.application.ApplicationBundle;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.codeStyle.CodeStyleSettings;
-import com.intellij.ui.IdeBorderFactory;
 import com.intellij.ui.OptionGroup;
 
 import javax.swing.*;
@@ -71,6 +70,7 @@ public class CodeStyleIndentAndBracesPanel extends MultilanguageCodeStyleAbstrac
   private JComboBox myWhileForceCombo;
   private JComboBox myDoWhileForceCombo;
 
+  private JCheckBox myAlignChainedMethods;
   private JCheckBox myAlignDeclarationParameters;
   private JCheckBox myAlignCallParameters;
   private JCheckBox myAlignExtendsList;
@@ -92,7 +92,7 @@ public class CodeStyleIndentAndBracesPanel extends MultilanguageCodeStyleAbstrac
   public CodeStyleIndentAndBracesPanel(CodeStyleSettings settings) {
     super(settings);
 
-    myPanel.add(createKeepWhenReformatingPanel(),
+    myPanel.add(createKeepWhenReformattingPanel(),
                 new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL,
                                        new Insets(0, 4, 0, 4), 0, 0));
 
@@ -131,7 +131,7 @@ public class CodeStyleIndentAndBracesPanel extends MultilanguageCodeStyleAbstrac
     return LanguageCodeStyleSettingsProvider.SettingsType.INDENT_AND_BRACES_SETTINGS;
   }
 
-  private Component createKeepWhenReformatingPanel() {
+  private Component createKeepWhenReformattingPanel() {
     OptionGroup optionGroup = new OptionGroup(ApplicationBundle.message("title.keep.when.reformatting"));
 
     myKeepLineBreaks = createCheckBox(ApplicationBundle.message("checkbox.keep.when.reformatting.line.breaks"));
@@ -196,6 +196,9 @@ public class CodeStyleIndentAndBracesPanel extends MultilanguageCodeStyleAbstrac
   private JPanel createAlignmentsPanel() {
     OptionGroup optionGroup = new OptionGroup(ApplicationBundle.message("title.align.when.multiline"));
 
+    myAlignChainedMethods = createCheckBox(ApplicationBundle.message("checkbox.align.multiline.chained.methods"));
+    optionGroup.add(myAlignChainedMethods);
+
     myAlignDeclarationParameters = createCheckBox(ApplicationBundle.message("checkbox.align.multiline.method.parameters"));
     optionGroup.add(myAlignDeclarationParameters);
 
@@ -314,6 +317,7 @@ public class CodeStyleIndentAndBracesPanel extends MultilanguageCodeStyleAbstrac
     isModified |= settings.CLASS_BRACE_STYLE != getBraceComboValue(myClassDeclarationCombo);
     isModified |= settings.METHOD_BRACE_STYLE != getBraceComboValue(myMethodDeclarationCombo);
 
+    isModified |= isModified(myAlignChainedMethods, settings.ALIGN_MULTILINE_CHAINED_METHODS);
     isModified |= isModified(myAlignAssignment, settings.ALIGN_MULTILINE_ASSIGNMENT);
     isModified |= isModified(myAlignBinaryExpression, settings.ALIGN_MULTILINE_BINARY_OPERATION);
     isModified |= isModified(myAlignCallParameters, settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS);
@@ -361,6 +365,7 @@ public class CodeStyleIndentAndBracesPanel extends MultilanguageCodeStyleAbstrac
     myAlignAssignment.setSelected(settings.ALIGN_MULTILINE_ASSIGNMENT);
     myAlignBinaryExpression.setSelected(settings.ALIGN_MULTILINE_BINARY_OPERATION);
     myAlignCallParameters.setSelected(settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS);
+    myAlignChainedMethods.setSelected(settings.ALIGN_MULTILINE_CHAINED_METHODS);
     myAlignDeclarationParameters.setSelected(settings.ALIGN_MULTILINE_PARAMETERS);
     myAlignExtendsList.setSelected(settings.ALIGN_MULTILINE_EXTENDS_LIST);
     myAlignForStatement.setSelected(settings.ALIGN_MULTILINE_FOR);
@@ -399,6 +404,7 @@ public class CodeStyleIndentAndBracesPanel extends MultilanguageCodeStyleAbstrac
     settings.ALIGN_MULTILINE_ASSIGNMENT = myAlignAssignment.isSelected();
     settings.ALIGN_MULTILINE_BINARY_OPERATION = myAlignBinaryExpression.isSelected();
     settings.ALIGN_MULTILINE_PARAMETERS_IN_CALLS = myAlignCallParameters.isSelected();
+    settings.ALIGN_MULTILINE_CHAINED_METHODS = myAlignChainedMethods.isSelected();
     settings.ALIGN_MULTILINE_PARAMETERS = myAlignDeclarationParameters.isSelected();
     settings.ALIGN_MULTILINE_EXTENDS_LIST = myAlignExtendsList.isSelected();
     settings.ALIGN_MULTILINE_FOR = myAlignForStatement.isSelected();
index f79bb68ef46784d9c8ec8b2f258334cba490367b..e783f72ab887415732b515e75374dfc890da045f 100644 (file)
@@ -41,13 +41,22 @@ class CodeFoldingPass extends TextEditorHighlightingPass implements DumbAware {
   }
 
   public void doCollectInformation(ProgressIndicator progress) {
-    final boolean firstTime = myFile.getUserData(THE_FIRST_TIME) == null || myEditor.getUserData(THE_FIRST_TIME) == null;
+    final boolean firstTime = isFirstTime(myFile, myEditor, THE_FIRST_TIME);
     Runnable runnable = CodeFoldingManager.getInstance(myProject).updateFoldRegionsAsync(myEditor, firstTime);
     synchronized (this) {
       myRunnable = runnable;
     }
   }
 
+  static boolean isFirstTime(PsiFile file, Editor editor, Key<Boolean> key) {
+    return file.getUserData(key) == null || editor.getUserData(key) == null;
+  }
+
+  static void clearFirstTimeFlag(PsiFile file, Editor editor, Key<Boolean> key) {
+    file.putUserData(key, Boolean.FALSE);
+    editor.putUserData(key, Boolean.FALSE);
+  }
+
   public void doApplyInformationToEditor() {
     Runnable runnable;
     synchronized (this) {
@@ -57,13 +66,12 @@ class CodeFoldingPass extends TextEditorHighlightingPass implements DumbAware {
       try {
         runnable.run();
       }
-      catch (IndexNotReadyException e) {
+      catch (IndexNotReadyException ignored) {
       }
     }
 
     if (InjectedLanguageUtil.getTopLevelFile(myFile) == myFile) {
-      myFile.putUserData(THE_FIRST_TIME, Boolean.FALSE);
-      myEditor.putUserData(THE_FIRST_TIME, Boolean.FALSE);
+      clearFirstTimeFlag(myFile, myEditor, THE_FIRST_TIME);
     }
   }
 }
index a2bc456e2bd2d71cd3c8d740c744f445da60affe..6879d8b81949fb573fef4dc0d97b94fe9ced1368 100755 (executable)
@@ -23,10 +23,12 @@ import com.intellij.openapi.progress.ProgressIndicator;
 import com.intellij.openapi.project.DumbAware;
 import com.intellij.openapi.project.IndexNotReadyException;
 import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.Key;
 import com.intellij.psi.PsiFile;
 import org.jetbrains.annotations.NotNull;
 
 class InjectedCodeFoldingPass extends TextEditorHighlightingPass implements DumbAware {
+  private static final Key<Boolean> THE_FIRST_TIME_KEY = Key.create("FirstInjectedFoldingPass");
   private Runnable myRunnable;
   private final Editor myEditor;
   private final PsiFile myFile;
@@ -38,7 +40,8 @@ class InjectedCodeFoldingPass extends TextEditorHighlightingPass implements Dumb
   }
 
   public void doCollectInformation(ProgressIndicator progress) {
-    Runnable runnable = FoldingUpdate.updateInjectedFoldRegions(myEditor, myFile);
+    boolean firstTime = CodeFoldingPass.isFirstTime(myFile, myEditor, THE_FIRST_TIME_KEY);
+    Runnable runnable = FoldingUpdate.updateInjectedFoldRegions(myEditor, myFile, firstTime);
     synchronized (this) {
       myRunnable = runnable;
     }
@@ -53,8 +56,9 @@ class InjectedCodeFoldingPass extends TextEditorHighlightingPass implements Dumb
       try {
         runnable.run();
       }
-      catch (IndexNotReadyException e) {
+      catch (IndexNotReadyException ignored) {
       }
+      CodeFoldingPass.clearFirstTimeFlag(myFile, myEditor, THE_FIRST_TIME_KEY);
     }
   }
 }
\ No newline at end of file
index e25651a9547fe239518fe23a5aff0fb5953b115c..8e73be8d15a112454ecfd37fab010fc420f15263 100644 (file)
@@ -39,10 +39,11 @@ import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
 import com.intellij.openapi.actionSystem.ex.AnActionListener;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.components.ServiceManager;
+import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.project.IndexNotReadyException;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.roots.LibraryOrderEntry;
+import com.intellij.openapi.roots.OrderEntry;
 import com.intellij.openapi.roots.libraries.LibraryUtil;
 import com.intellij.openapi.roots.ui.configuration.ProjectSettingsService;
 import com.intellij.openapi.ui.popup.JBPopup;
@@ -81,6 +82,7 @@ import java.util.List;
 import java.util.Set;
 
 public class DocumentationManager {
+  private static final Logger LOG = Logger.getInstance("#" + DocumentationManager.class.getName());
   private static final String SHOW_DOCUMENTATION_IN_TOOL_WINDOW = "ShowDocumentationInToolWindow";
   private static final String DOCUMENTATION_AUTO_UPDATE_ENABLED = "DocumentationAutoUpdateEnabled";
   @NonNls public static final String JAVADOC_LOCATION_AND_SIZE = "javadoc.popup";
@@ -661,6 +663,7 @@ public class DocumentationManager {
           text = provider.getDocumentation();
         }
         catch (Throwable e) {
+          LOG.info(e);
           ex[0] = e;
         }
 
@@ -800,7 +803,7 @@ public class DocumentationManager {
       final PsiFile containingFile = psiElement.getContainingFile();
       if (containingFile != null) {
         final VirtualFile virtualFile = containingFile.getVirtualFile();
-        final LibraryOrderEntry libraryEntry = LibraryUtil.findLibraryEntry(virtualFile, myProject);
+        final OrderEntry libraryEntry = LibraryUtil.findLibraryEntry(virtualFile, myProject);
         if (libraryEntry != null) {
           ProjectSettingsService.getInstance(myProject).openProjectLibrarySettings(new NamedLibraryElement(libraryEntry.getOwnerModule(), libraryEntry));
         }
index beaed335d955897fa75fd533374775d045518138..890e15da09816912a4bba2e96abecd722bfa3b87 100644 (file)
@@ -228,8 +228,9 @@ public class CodeFoldingManagerImpl extends CodeFoldingManager implements Projec
     final FoldRegion[] regions = editor.getFoldingModel().getAllFoldRegions();
     editor.getFoldingModel().runBatchFoldingOperation(new Runnable() {
       public void run() {
+        EditorFoldingInfo foldingInfo = EditorFoldingInfo.get(editor);
         for (FoldRegion region : regions) {
-          PsiElement element = EditorFoldingInfo.get(editor).getPsiElement(region);
+          PsiElement element = foldingInfo.getPsiElement(region);
           if (element != null) {
             region.setExpanded(!FoldingPolicy.isCollapseByDefault(element));
           }
index 8f1cd78588a9ef0a17d840243d406598c6631133..406821455418e238c8c4c9ebfd6eadd6d8faf5fb 100644 (file)
@@ -26,7 +26,7 @@ import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.FoldRegion;
 import com.intellij.openapi.editor.RangeMarker;
-import com.intellij.openapi.editor.impl.FoldRegionImpl;
+import com.intellij.openapi.editor.ex.FoldingModelEx;
 import com.intellij.openapi.fileEditor.FileDocumentManager;
 import com.intellij.openapi.fileEditor.impl.text.CodeFoldingState;
 import com.intellij.openapi.project.Project;
@@ -126,7 +126,8 @@ public class DocumentFoldingInfo implements JDOMExternalizable, CodeFoldingState
         FoldRegion region = FoldingUtil.findFoldRegion(editor, marker.getStartOffset(), marker.getEndOffset());
         if (region == null) {
           String placeHolderText = myPlaceholderTexts.get(marker);
-          region = new FoldRegionImpl(editor, marker.getStartOffset(), marker.getEndOffset(), placeHolderText, null);  //may fail to add in case intersecting region exists
+          region = ((FoldingModelEx)editor.getFoldingModel()).createFoldRegion(marker.getStartOffset(), marker.getEndOffset(), placeHolderText, null);  
+          //may fail to add in case intersecting region exists
           if (!editor.getFoldingModel().addFoldRegion(region)) return;
         }
 
index 1b4797280f89737e99c90bd97c03f64a86620be8..2551e2a1c50c8836ea11705801711f95b843ae09 100644 (file)
@@ -17,6 +17,7 @@
 package com.intellij.codeInsight.folding.impl;
 
 import com.intellij.injected.editor.DocumentWindow;
+import com.intellij.injected.editor.EditorWindow;
 import com.intellij.lang.Language;
 import com.intellij.lang.folding.FoldingBuilder;
 import com.intellij.lang.folding.FoldingDescriptor;
@@ -87,8 +88,7 @@ public class FoldingUpdate {
     final TreeMap<PsiElement, FoldingDescriptor> elementsToFoldMap = new TreeMap<PsiElement, FoldingDescriptor>(COMPARE_BY_OFFSET);
     getFoldingsFor(file instanceof PsiCompiledElement ? (PsiFile)((PsiCompiledElement)file).getMirror() : file, document, elementsToFoldMap, quick);
 
-    final UpdateFoldRegionsOperation operation =
-      new UpdateFoldRegionsOperation(project, editor, elementsToFoldMap, applyDefaultState, false);
+    final UpdateFoldRegionsOperation operation = new UpdateFoldRegionsOperation(project, editor, elementsToFoldMap, applyDefaultState, false);
     Runnable runnable = new Runnable() {
       public void run() {
         editor.getFoldingModel().runBatchFoldingOperationDoNotCollapseCaret(operation);
@@ -104,7 +104,7 @@ public class FoldingUpdate {
 
   private static final Key<Object> LAST_UPDATE_INJECTED_STAMP_KEY = Key.create("LAST_UPDATE_INJECTED_STAMP_KEY");
   @Nullable
-  public static Runnable updateInjectedFoldRegions(@NotNull final Editor editor, @NotNull PsiFile file) {
+  public static Runnable updateInjectedFoldRegions(@NotNull final Editor editor, @NotNull PsiFile file, final boolean applyDefaultState) {
     if (file instanceof PsiCompiledElement) return null;
     ApplicationManager.getApplication().assertReadAccessAllowed();
 
@@ -116,17 +116,32 @@ public class FoldingUpdate {
     Object lastTimeStamp = editor.getUserData(LAST_UPDATE_INJECTED_STAMP_KEY);
     if (lastTimeStamp instanceof Long && ((Long)lastTimeStamp).longValue() == timeStamp) return null;
 
-    final TreeMap<PsiElement, FoldingDescriptor> elementsToFoldMap = new TreeMap<PsiElement, FoldingDescriptor>(COMPARE_BY_OFFSET);
-
     List<DocumentWindow> injectedDocuments = InjectedLanguageUtil.getCachedInjectedDocuments(file);
     if (injectedDocuments.isEmpty()) return null;
+    final List<EditorWindow> injectedEditors = new ArrayList<EditorWindow>();
+    final List<Map<PsiElement, FoldingDescriptor>> maps = new ArrayList<Map<PsiElement, FoldingDescriptor>>();
     for (DocumentWindow injectedDocument : injectedDocuments) {
-      PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(injectedDocument);
-      if (psiFile == null || !psiFile.isValid() || !injectedDocument.isValid()) continue;
-      getFoldingsFor(psiFile, injectedDocument, elementsToFoldMap, false);
+      PsiFile injectedFile = PsiDocumentManager.getInstance(project).getPsiFile(injectedDocument);
+      if (injectedFile == null || !injectedFile.isValid() || !injectedDocument.isValid()) continue;
+      Editor injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedFile);
+      if (!(injectedEditor instanceof EditorWindow)) continue;
+
+      injectedEditors.add((EditorWindow)injectedEditor);
+      Map<PsiElement, FoldingDescriptor> map = new TreeMap<PsiElement, FoldingDescriptor>(COMPARE_BY_OFFSET);
+      maps.add(map);
+      getFoldingsFor(injectedFile, injectedDocument, map, false);
     }
 
-    final Runnable operation = new UpdateFoldRegionsOperation(project, editor, elementsToFoldMap, false, true);
+
+    final Runnable operation = new Runnable() {
+      public void run() {
+        for (int i = 0; i < injectedEditors.size(); i++) {
+          EditorWindow injectedEditor = injectedEditors.get(i);
+          Map<PsiElement, FoldingDescriptor> map = maps.get(i);
+          new UpdateFoldRegionsOperation(project, injectedEditor, map, applyDefaultState, true).run();
+        }
+      }
+    };
     return new Runnable() {
       public void run() {
         editor.getFoldingModel().runBatchFoldingOperationDoNotCollapseCaret(operation);
@@ -135,7 +150,7 @@ public class FoldingUpdate {
     };
   }
 
-  private static void getFoldingsFor(PsiFile file, Document document, TreeMap<PsiElement, FoldingDescriptor> elementsToFoldMap, boolean quick) {
+  private static void getFoldingsFor(PsiFile file, Document document, Map<PsiElement, FoldingDescriptor> elementsToFoldMap, boolean quick) {
     final FileViewProvider viewProvider = file.getViewProvider();
     for (final Language language : viewProvider.getLanguages()) {
       final PsiFile psi = viewProvider.getPsi(language);