Merge commit 'origin/master'
authorMaxim Medvedev <maxim.medvedev@jetbrains.com>
Sat, 27 Nov 2010 18:50:41 +0000 (21:50 +0300)
committerMaxim Medvedev <maxim.medvedev@jetbrains.com>
Sat, 27 Nov 2010 18:50:41 +0000 (21:50 +0300)
573 files changed:
java/compiler/forms-compiler/forms-compiler.iml
java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/CodeGenerationException.java
java/compiler/forms-compiler/src/com/intellij/uiDesigner/compiler/Utils.java
java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
java/compiler/impl/src/com/intellij/compiler/impl/CompilerCacheManager.java
java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactUtil.java
java/compiler/impl/src/com/intellij/packaging/impl/compiler/ArtifactCompileScope.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/EvaluatorBuilderImpl.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/Breakpoint.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointWithHighlighter.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/ExceptionBreakpointPropertiesPanel.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/FieldBreakpointPropertiesPanel.java
java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/MethodBreakpointPropertiesPanel.java
java/debugger/openapi/src/com/intellij/debugger/PositionManager.java
java/execution/impl/src/com/intellij/execution/applet/AppletConfigurationProducer.java
java/execution/impl/src/com/intellij/execution/junit/JUnitUtil.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/classpath/ClasspathPanelImpl.java
java/java-impl/src/com/intellij/codeInsight/completion/AbstractBasicToClassNameDelegator.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/FocusInJavadoc.java [new file with mode: 0644]
java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java [new file with mode: 0644]
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionUtil.java
java/java-impl/src/com/intellij/codeInsight/completion/StaticMembersWeigher.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/PostHighlightingPass.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/ChangeNewOperatorTypeFix.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateLocalVarFromInstanceofAction.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreateMethodFromUsageFix.java
java/java-impl/src/com/intellij/codeInsight/generation/GenerateConstructorHandler.java
java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocExternalFilter.java
java/java-impl/src/com/intellij/codeInsight/javadoc/JavaDocInfoGenerator.java
java/java-impl/src/com/intellij/codeInspection/concurrencyAnnotations/FieldAccessNotGuardedInspection.java
java/java-impl/src/com/intellij/codeInspection/emptyMethod/EmptyMethodInspection.java
java/java-impl/src/com/intellij/codeInspection/ex/EntryPointsManagerImpl.java
java/java-impl/src/com/intellij/codeInspection/reference/RefFieldImpl.java
java/java-impl/src/com/intellij/codeInspection/reference/RefMethodImpl.java
java/java-impl/src/com/intellij/codeInspection/util/SpecialAnnotationsUtil.java
java/java-impl/src/com/intellij/codeInspection/varScopeCanBeNarrowed/FieldCanBeLocalInspection.java
java/java-impl/src/com/intellij/ide/projectView/impl/PackageViewPane.java
java/java-impl/src/com/intellij/javadoc/JavadocConfiguration.java
java/java-impl/src/com/intellij/lang/java/JavaDocumentationProvider.java
java/java-impl/src/com/intellij/psi/impl/source/PsiClassImpl.java
java/java-impl/src/com/intellij/psi/scope/conflictResolvers/JavaMethodsConflictResolver.java
java/java-impl/src/com/intellij/psi/scope/util/PsiScopesUtil.java
java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodHandler.java
java/java-impl/src/com/intellij/refactoring/inline/InlineConstantFieldProcessor.java
java/java-impl/src/com/intellij/refactoring/inline/InlineMethodProcessor.java
java/java-impl/src/com/intellij/refactoring/introduceField/ElementToWorkOn.java
java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceFieldDialog.java
java/java-impl/src/com/intellij/refactoring/introduceField/IntroduceFieldHandler.java
java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java
java/java-impl/src/com/intellij/refactoring/replaceConstructorWithBuilder/ParameterData.java
java/java-impl/src/com/intellij/refactoring/replaceConstructorWithBuilder/ReplaceConstructorWithBuilderDialog.java
java/java-tests/java-tests.iml
java/java-tests/testData/codeInsight/completion/normal/ClassNameWithGenericsTab.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/ClassNameWithGenericsTab_after.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/ClassNameWithInnersTab.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/ClassNameWithInnersTab_after.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/FieldWithCastingCaret.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normal/FieldWithCastingCaret_after.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normalSorting/PreferOwnInnerClasses.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/normalSorting/PreferTopLevelClasses.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/smartTypeSorting/PrefixOutweighsGenericity.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/completion/style/after15.java
java/java-tests/testData/codeInsight/completion/style/after17.java
java/java-tests/testData/codeInsight/javadocIG/classTypeParameter.html
java/java-tests/testData/codeInsight/javadocIG/fieldValue.html
java/java-tests/testData/codeInsight/javadocIG/ideadev2326.html
java/java-tests/testData/codeInsight/javadocIG/methodTypeParameter.html
java/java-tests/testData/codeInsight/javadocIG/packageInfo/packageInfo.html
java/java-tests/testData/codeInsight/javadocIG/simpleField.html
java/java-tests/testData/codeInsight/javadocIG/valueInMethod.html
java/java-tests/testData/inspection/fieldCanBeLocal/ignoreAnnotated/expected.xml [new file with mode: 0644]
java/java-tests/testData/inspection/fieldCanBeLocal/ignoreAnnotated/src/Test.java [new file with mode: 0644]
java/java-tests/testData/psi/generics22/collect-2.2.jar [new file with mode: 0644]
java/java-tests/testData/psi/stub/StubPerformanceTest.java [new file with mode: 0644]
java/java-tests/testData/refactoring/introduceField/afterBeforeNotExist.java
java/java-tests/testData/refactoring/introduceField/afterBeforeNotExist1.java
java/java-tests/testData/refactoring/introduceField/afterInSetUp.java
java/java-tests/testData/refactoring/introduceField/afterPublicBaseClassSetUp.java
java/java-tests/testData/refactoring/replaceConstructorWithBuilder/constructorChainWithoutDefaults/after/Builder.java [new file with mode: 0644]
java/java-tests/testData/refactoring/replaceConstructorWithBuilder/constructorChainWithoutDefaults/after/Test.java [new file with mode: 0644]
java/java-tests/testData/refactoring/replaceConstructorWithBuilder/constructorChainWithoutDefaults/before/Test.java [new file with mode: 0644]
java/java-tests/testData/vfs/changes/PsiChangesTest.java [new file with mode: 0644]
java/java-tests/testData/vfs/changes/PsiChangesTest_changed.java [new file with mode: 0644]
java/java-tests/testData/vfs/changes/results/fields.txt [new file with mode: 0644]
java/java-tests/testData/vfs/changes/results/methods.txt [new file with mode: 0644]
java/java-tests/testData/vfs/findFileByUrl/1.txt [new file with mode: 0644]
java/java-tests/testData/vfs/findFileByUrl/test.zip [new file with mode: 0644]
java/java-tests/testData/vfs/relativePath/subDir/subSubDir/empty.txt [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/completion/JavaAutoPopupTest.groovy
java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionOrderingTest.java
java/java-tests/testSrc/com/intellij/codeInsight/completion/NormalCompletionTest.groovy
java/java-tests/testSrc/com/intellij/codeInsight/completion/SmartTypeCompletionOrderingTest.java
java/java-tests/testSrc/com/intellij/codeInsight/daemon/quickFix/Suppress15InspectionsTest.java
java/java-tests/testSrc/com/intellij/codeInspection/FieldCanBeLocalTest.java
java/java-tests/testSrc/com/intellij/codeInspection/InspectionProfileTest.java
java/java-tests/testSrc/com/intellij/openapi/vfs/DummyFileSystemTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/openapi/vfs/GetPathPerformanceTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/openapi/vfs/JarFileSystemTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/openapi/vfs/LocalFileSystemTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/openapi/vfs/RefreshChildrenTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/openapi/vfs/VfsUtilTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/openapi/vfs/VirtualFilePointerTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/openapi/vfs/changes/PsiChangeTrackerTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/psi/JavaStubBuilderTest.java
java/java-tests/testSrc/com/intellij/refactoring/ReplaceConstructorWithBuilderTest.java
java/openapi/src/com/intellij/codeInsight/TestUtil.java
java/openapi/src/com/intellij/psi/util/PsiExpressionTrimRenderer.java [moved from java/java-impl/src/com/intellij/refactoring/introduceVariable/PsiExpressionTrimRenderer.java with 96% similarity]
java/openapi/src/com/intellij/psi/util/PsiFormatUtil.java
java/testFramework/src/com/intellij/testFramework/fixtures/JavaCodeInsightTestUtil.java [new file with mode: 0644]
java/testFramework/src/com/intellij/testFramework/fixtures/impl/JavaCodeInsightTestFixtureImpl.java
platform/lang-api/src/com/intellij/codeInsight/completion/CompletionParameters.java
platform/lang-api/src/com/intellij/codeInspection/reference/RefManager.java
platform/lang-api/src/com/intellij/psi/ReferenceRange.java
platform/lang-api/src/com/intellij/psi/stubs/LightStubBuilder.java
platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractConfigurable.java
platform/lang-impl/src/com/intellij/application/options/CodeStyleAbstractPanel.java
platform/lang-impl/src/com/intellij/application/options/CodeStyleSchemesConfigurable.java
platform/lang-impl/src/com/intellij/application/options/codeStyle/CodeStyleMainPanel.java
platform/lang-impl/src/com/intellij/application/options/codeStyle/NewCodeStyleSettingsPanel.java
platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java
platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTreeWithPreviewPanel.java
platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionProgressIndicator.java
platform/lang-impl/src/com/intellij/codeInsight/completion/PrefixMatchingWeigher.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfo.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/HighlightInfoType.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/IdentifierHighlighterPass.java
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/LocalInspectionsPass.java
platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java
platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationManager.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/actions/FoldingActionGroup.java [deleted file]
platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupImpl.java
platform/lang-impl/src/com/intellij/codeInsight/template/actions/SaveAsTemplateAction.java
platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateState.java
platform/lang-impl/src/com/intellij/codeInspection/actions/CodeInspectionAction.java
platform/lang-impl/src/com/intellij/codeInspection/actions/GotoInspectionModel.java
platform/lang-impl/src/com/intellij/codeInspection/ex/InspectionProfileImpl.java
platform/lang-impl/src/com/intellij/codeInspection/reference/RefManagerImpl.java
platform/lang-impl/src/com/intellij/diagnostic/logging/EditLogPatternDialog.java
platform/lang-impl/src/com/intellij/diagnostic/logging/LogConsoleBase.java
platform/lang-impl/src/com/intellij/execution/actions/RunConfigurationAction.java
platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java
platform/lang-impl/src/com/intellij/execution/runners/AbstractConsoleRunnerWithHistory.java
platform/lang-impl/src/com/intellij/execution/ui/RunContentManagerImpl.java
platform/lang-impl/src/com/intellij/find/FindUtil.java
platform/lang-impl/src/com/intellij/formatting/BlockDebugUtil.java
platform/lang-impl/src/com/intellij/ide/actions/PasteReferenceProvider.java
platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarPanel.java
platform/lang-impl/src/com/intellij/ide/navigationToolbar/NavBarRootPaneExtension.java
platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkRootAction.java
platform/lang-impl/src/com/intellij/ide/projectView/actions/MarkRootGroup.java
platform/lang-impl/src/com/intellij/ide/projectView/actions/ProjectViewActionGroup.java [deleted file]
platform/lang-impl/src/com/intellij/ide/projectView/actions/UnmarkRootAction.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewDropTarget.java
platform/lang-impl/src/com/intellij/ide/structureView/newStructureView/StructureViewComponent.java
platform/lang-impl/src/com/intellij/ide/todo/TodoTreeBuilder.java
platform/lang-impl/src/com/intellij/ide/todo/nodes/TodoFileNode.java
platform/lang-impl/src/com/intellij/ide/ui/search/TraverseUIStarter.java
platform/lang-impl/src/com/intellij/ide/util/FileStructureDialog.java
platform/lang-impl/src/com/intellij/injected/editor/CaretModelWindow.java
platform/lang-impl/src/com/intellij/injected/editor/DocumentWindowImpl.java
platform/lang-impl/src/com/intellij/injected/editor/MarkupModelWindow.java
platform/lang-impl/src/com/intellij/openapi/paths/GlobalPathReferenceProvider.java
platform/lang-impl/src/com/intellij/psi/PsiAnchor.java
platform/lang-impl/src/com/intellij/psi/SingleRootFileViewProvider.java
platform/lang-impl/src/com/intellij/psi/impl/PsiDocumentManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/SharedPsiElementImplUtil.java
platform/lang-impl/src/com/intellij/psi/impl/source/PsiFileImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleSchemesImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/text/BlockSupportImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/tree/LazyParseableElement.java
platform/lang-impl/src/com/intellij/psi/impl/source/tree/injected/MultiHostRegistrarImpl.java
platform/lang-impl/src/com/intellij/psi/stubs/StubTree.java
platform/lang-impl/src/com/intellij/psi/util/proximity/OpenedInEditorWeigher.java
platform/lang-impl/src/com/intellij/psi/util/proximity/SameModuleWeigher.java
platform/lang-impl/src/com/intellij/refactoring/rename/RenameDialog.java
platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java
platform/lang-impl/src/com/intellij/semantic/SemServiceImpl.java
platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndex.java
platform/lvcs-impl/src/com/intellij/history/integration/ui/views/HistoryDialog.java
platform/platform-api/src/com/intellij/codeHighlighting/HighlightDisplayLevel.java
platform/platform-api/src/com/intellij/execution/configurations/GeneralCommandLine.java
platform/platform-api/src/com/intellij/execution/process/OSProcessHandler.java
platform/platform-api/src/com/intellij/ide/plugins/PluginManager.java
platform/platform-api/src/com/intellij/ide/ui/LafManager.java
platform/platform-api/src/com/intellij/lang/Language.java
platform/platform-api/src/com/intellij/notification/NotificationListener.java
platform/platform-api/src/com/intellij/openapi/editor/CaretModel.java
platform/platform-api/src/com/intellij/openapi/editor/EditorModificationUtil.java
platform/platform-api/src/com/intellij/openapi/editor/markup/MarkupModel.java
platform/platform-api/src/com/intellij/openapi/fileEditor/FileEditorManager.java
platform/platform-api/src/com/intellij/openapi/progress/ProgressFunComponentProvider.java
platform/platform-api/src/com/intellij/openapi/progress/ProgressManager.java
platform/platform-api/src/com/intellij/openapi/progress/Task.java
platform/platform-api/src/com/intellij/openapi/progress/TaskInfo.java
platform/platform-api/src/com/intellij/openapi/project/DumbService.java
platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java
platform/platform-api/src/com/intellij/openapi/ui/popup/Balloon.java
platform/platform-api/src/com/intellij/openapi/vfs/newvfs/NewVirtualFileSystem.java
platform/platform-api/src/com/intellij/openapi/wm/FocusCommand.java
platform/platform-api/src/com/intellij/openapi/wm/IdeFocusManager.java
platform/platform-api/src/com/intellij/openapi/wm/IdeFrame.java
platform/platform-api/src/com/intellij/openapi/wm/PassThroughtIdeFocusManager.java
platform/platform-api/src/com/intellij/ui/ScreenUtil.java
platform/platform-api/src/com/intellij/ui/components/JBScrollPane.java
platform/platform-api/src/com/intellij/util/ui/ButtonlessScrollBarUI.java
platform/platform-impl/src/com/intellij/codeInsight/hint/HintManagerImpl.java
platform/platform-impl/src/com/intellij/diagnostic/IdeErrorsDialog.java
platform/platform-impl/src/com/intellij/execution/process/ConsoleHistoryModel.java
platform/platform-impl/src/com/intellij/featureStatistics/ProgressFunProvider.java
platform/platform-impl/src/com/intellij/ide/CopyPasteManagerEx.java
platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java
platform/platform-impl/src/com/intellij/ide/RecentProjectsManagerBase.java
platform/platform-impl/src/com/intellij/ide/actions/AboutAction.java
platform/platform-impl/src/com/intellij/ide/actions/BaseShowRecentFilesAction.java
platform/platform-impl/src/com/intellij/ide/actions/CodeEditorActionGroup.java [deleted file]
platform/platform-impl/src/com/intellij/ide/actions/Switcher.java
platform/platform-impl/src/com/intellij/ide/actions/WindowAction.java
platform/platform-impl/src/com/intellij/ide/plugins/InstalledPluginsTableModel.java
platform/platform-impl/src/com/intellij/ide/plugins/PluginManagerMain.java
platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java
platform/platform-impl/src/com/intellij/ide/ui/HeadlessLafManagerImpl.java
platform/platform-impl/src/com/intellij/ide/ui/LafManagerImpl.java
platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizableActionsPanel.form
platform/platform-impl/src/com/intellij/ide/ui/customization/CustomizableActionsPanel.java
platform/platform-impl/src/com/intellij/ide/ui/search/SearchableOptionsRegistrarImpl.java
platform/platform-impl/src/com/intellij/idea/CommandLineApplication.java
platform/platform-impl/src/com/intellij/idea/IdeaLogger.java
platform/platform-impl/src/com/intellij/openapi/application/ConfigImportHelper.java
platform/platform-impl/src/com/intellij/openapi/application/ex/ApplicationEx.java
platform/platform-impl/src/com/intellij/openapi/application/ex/ApplicationManagerEx.java
platform/platform-impl/src/com/intellij/openapi/application/impl/ApplicationImpl.java
platform/platform-impl/src/com/intellij/openapi/application/impl/Win32Restarter.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/external/DiffManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/ex/MarkupModelEx.java
platform/platform-impl/src/com/intellij/openapi/editor/ex/util/SegmentArray.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/DocumentImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorGutterComponentImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorMarkupModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EmptyMarkupModel.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/MarkupModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/CachingSoftWrapDataMapper.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/MappingUtil.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceManager.java
platform/platform-impl/src/com/intellij/openapi/editor/textarea/TextComponentCaretModel.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/ex/FileEditorManagerEx.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/FileEditorManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/IdeDocumentHistoryImpl.java
platform/platform-impl/src/com/intellij/openapi/options/ex/ConfigurablesGroupBase.java
platform/platform-impl/src/com/intellij/openapi/options/ex/IdeConfigurablesGroup.java
platform/platform-impl/src/com/intellij/openapi/options/ex/ProjectConfigurablesGroup.java
platform/platform-impl/src/com/intellij/openapi/progress/impl/BackgroundableProcessIndicator.java
platform/platform-impl/src/com/intellij/openapi/progress/impl/ProgressManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressWindow.java
platform/platform-impl/src/com/intellij/openapi/ui/FrameWrapper.java
platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/UpdateChecker.java
platform/platform-impl/src/com/intellij/openapi/vfs/VirtualFileUrlChangeAdapter.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/FileWatcher.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/impl/VirtualDirectoryImpl.java
platform/platform-impl/src/com/intellij/openapi/vfs/newvfs/persistent/FSRecords.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/FocusManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeFocusManagerHeadless.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeFocusManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/IdeFrameImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/InternalDecorator.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowManagerImpl.java
platform/platform-impl/src/com/intellij/ui/AbstractExpandableItemsHandler.java
platform/platform-impl/src/com/intellij/ui/BalloonImpl.java
platform/platform-impl/src/com/intellij/ui/FocusTrackback.java
platform/platform-impl/src/com/intellij/ui/Splash.java
platform/platform-impl/src/com/intellij/ui/docking/impl/DockManagerImpl.java
platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java
platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/mapping/SoftWrapApplianceOnDocumentModificationTest.java
platform/platform-resources-en/src/messages/ActionsBundle.properties
platform/platform-resources-en/src/messages/IdeBundle.properties
platform/platform-resources-en/src/messages/InspectionsBundle.properties
platform/platform-resources-en/src/messages/XmlBundle.properties
platform/platform-resources-en/src/misc/registry.properties
platform/platform-resources/src/idea/LangActions.xml
platform/testFramework/src/com/intellij/idea/IdeaTestApplication.java [moved from platform/platform-impl/src/com/intellij/idea/IdeaTestApplication.java with 100% similarity]
platform/testFramework/src/com/intellij/mock/MockApplication.java
platform/testFramework/src/com/intellij/testFramework/TestEditorManagerImpl.java
platform/testFramework/src/com/intellij/testFramework/fixtures/CodeInsightTestUtil.java
platform/testFramework/src/com/intellij/testFramework/fixtures/impl/CodeInsightTestFixtureImpl.java
platform/testRunner/src/com/intellij/execution/testframework/export/ExportTestResultsAction.java
platform/util/src/com/intellij/CommonBundle.java
platform/util/src/com/intellij/execution/rmi/RemoteServer.java
platform/util/src/com/intellij/openapi/util/Comparing.java
platform/util/src/com/intellij/openapi/util/LowMemoryWatcher.java
platform/util/src/com/intellij/openapi/util/TextRange.java
platform/util/src/com/intellij/util/io/PersistentEnumerator.java
platform/util/testSrc/com/intellij/util/io/PagedFileStorageTest.java
platform/vcs-api/src/com/intellij/openapi/vcs/GroupingMerger.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesCommitExecutor.java
platform/xdebugger-api/src/com/intellij/xdebugger/evaluation/XDebuggerEvaluator.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/DebuggerActionHandler.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/XDebuggerActionBase.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/actions/handlers/XDebuggerPauseActionHandler.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointImpl.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/breakpoints/XLineBreakpointManager.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/TreeInplaceEditor.java
platform/xdebugger-impl/testSrc/com/intellij/xdebugger/UpdateBreakpointsAfterRenameTest.java [new file with mode: 0644]
platform/xdebugger-impl/testSrc/com/intellij/xdebugger/XDebuggerTestCase.java
platform/xdebugger-impl/xdebugger-impl.iml
plugins/InspectionGadgets/InspectionGadgetsPlugin.iml
plugins/InspectionGadgets/src/com/siyeh/InspectionGadgetsBundle.properties
plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/InstanceofChainInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/OverlyStrongTypeCastInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/PublicMethodNotExposedInInterfaceInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/TypeMayBeWeakenedInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/assignment/AssignmentToDateFieldFromParameterInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bitwise/PointlessBitwiseExpressionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ArchaicSystemPropertyAccessInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ClassNewInstanceInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CollectionAddedToSelfInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ComparableImplementedButEqualsNotOverriddenInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ComparatorMethodParameterNotUsedInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CovariantCompareToInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/FormatDecode.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ImplicitArrayToStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/MalformedFormatStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/MalformedRegexInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/MalformedXPathInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/NewStringBufferWithCharArgumentInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/NumberEqualityInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ObjectEqualityInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ObjectToStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ParameterClassCheckVisitor.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ReplaceAllDotInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/SuspiciousToArrayCallInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/ThrowableResultOfMethodCallIgnoredInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/bugs/UseOfPropertiesAsHashtableInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/classlayout/MissingDeprecatedAnnotationInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/classmetrics/AnonymousClassMethodCountInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/classmetrics/ConstructorCountInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/controlflow/ForLoopWithMissingComponentInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/controlflow/IfMayBeConditionalInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/controlflow/PointlessBooleanExpressionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/encapsulation/ReturnOfCollectionFieldInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/encapsulation/ReturnOfDateFieldInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/CheckedExceptionClassInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/ErrorRethrownInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/NonFinalFieldOfExceptionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/TooBroadCatchInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/errorhandling/UncheckedExceptionClassInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/finalization/FinalizeCallsSuperFinalizeInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/MakeCloneableFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/MakeSerializableFix.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/MemberSignature.java
plugins/InspectionGadgets/src/com/siyeh/ig/fixes/SerialVersionUIDBuilder.java
plugins/InspectionGadgets/src/com/siyeh/ig/inheritance/AbstractClassExtendsConcreteClassInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/inheritance/AbstractMethodOverridesConcreteMethodInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/inheritance/RefusedBequestInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/internationalization/CharacterComparisonInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/internationalization/DateToStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/internationalization/StringCompareToInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/internationalization/StringEqualsIgnoreCaseInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/internationalization/StringEqualsInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/internationalization/StringToUpperWithoutLocaleInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk/AutoBoxingInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk/AutoUnboxingInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/CollectionsFieldAccessReplaceableByMethodCallInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/ForCanBeForeachInspection.form [deleted file]
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/ForCanBeForeachInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/IndexOfReplaceableByContainsInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/UnnecessaryBoxingInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/UnnecessaryUnboxingInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/jdk15/WhileCanBeForeachInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/junit/AssertEqualsBetweenInconvertibleTypesInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/junit/AssertEqualsMayBeAssertSameInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/junit/ExpectedExceptionNeverThrownInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/junit/MultipleExceptionsDeclaredOnTestMethodInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/junit/UnconstructableTestCaseInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/memory/StringBufferFieldInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/BooleanMethodNameMustStartWithQuestionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/ConfusingMainMethodInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/ExceptionNameDoesntEndWithExceptionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/NonBooleanMethodNameMayNotStartWithQuestionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/NonExceptionNameEndsWithExceptionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/naming/StandardVariableNamesInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/numeric/CachedNumberConstructorCallInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/numeric/CharUsedInArithmeticContextInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/numeric/ImplicitNumericConversionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/numeric/IntegerDivisionInFloatingPointContextInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/numeric/PointlessArithmeticExpressionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/BooleanConstructorInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/CollectionContainsUrlInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/ConstantStringInternInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/DynamicRegexReplaceableByCompiledPatternInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/KeySetIterationMayUseEntrySetInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/LengthOneStringInIndexOfInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/LengthOneStringsInConcatenationInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/ManualArrayToCollectionCopyInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/MapReplaceableByEnumMapInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/RedundantStringFormatCallInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/SetReplaceableByEnumSetInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringBufferMustHaveInitialCapacityInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringBufferReplaceableByStringBuilderInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringBufferReplaceableByStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringBufferToStringInConcatenationInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringConcatenationInsideStringBufferAppendInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringConstructorInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringEqualsEmptyStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringReplaceableByStringBufferInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/StringToStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/SubstringZeroInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/ToArrayCallWithZeroLengthArrayArgumentInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/TrivialStringConcatenationInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/UnnecessaryTemporaryOnConversionFromStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/performance/UnnecessaryTemporaryOnConversionToStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/ClassUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/CloneUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/CollectionUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/ExceptionUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/ExpectedTypeUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/ExpressionUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/ImportUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/InheritanceUtil.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/MethodCallUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/SerializationUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/TypeUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/VariableAccessUtils.java
plugins/InspectionGadgets/src/com/siyeh/ig/psiutils/WeakestTypeFinder.java
plugins/InspectionGadgets/src/com/siyeh/ig/security/JDBCExecuteWithNonConstantStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/security/JDBCPrepareStatementWithNonConstantStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/security/LoadLibraryWithNonConstantStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/security/RuntimeExecWithNonConstantStringInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/security/SystemPropertiesInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/serialization/ComparatorNotSerializableInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/serialization/NonSerializableObjectBoundToHttpSessionInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/serialization/NonSerializableObjectPassedToObjectStreamInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/serialization/SerializableWithUnconstructableAncestorInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/CallToStringConcatCanBeReplacedByOperatorInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/ConfusingOctalEscapeInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/EqualsCalledOnEnumConstantInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/ExtendsObjectInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/ImplicitCallToSuperInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/ListIndexOfReplaceableByContainsInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/RedundantImplementsInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/TypeParameterExtendsObjectInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/UnnecessarilyQualifiedStaticallyImportedElementInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/style/UnnecessaryCallToStringValueOfInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/threading/AccessToNonThreadSafeStaticFieldFromInstanceInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/threading/CallToNativeMethodWhileLockedInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/threading/SynchronizedOnLiteralObjectInspection.java
plugins/InspectionGadgets/src/com/siyeh/ig/threading/WaitNotInSynchronizedContextInspection.java
plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/TooBroadCatchBlock.java
plugins/InspectionGadgets/test/com/siyeh/igtest/errorhandling/toobroadcatch/expected.xml
plugins/InspectionGadgets/test/com/siyeh/igtest/jdk15/foreach/ForCanBeForEach.java
plugins/InspectionGadgets/test/com/siyeh/igtest/jdk15/foreach/expected.xml
plugins/android/android.iml
plugins/android/resources/messages/AndroidBundle.properties
plugins/android/src/META-INF/plugin.xml
plugins/android/src/org/jetbrains/android/AndroidDocumentationProvider.java [new file with mode: 0644]
plugins/android/src/org/jetbrains/android/AndroidRenameResourceProcessor.java
plugins/android/src/org/jetbrains/android/dom/AndroidDomExtender.java
plugins/android/src/org/jetbrains/android/exportSignedPackage/ApkStep.java
plugins/android/src/org/jetbrains/android/exportSignedPackage/ChooseModuleStep.java
plugins/android/src/org/jetbrains/android/exportSignedPackage/ExportSignedPackageWizard.java
plugins/android/src/org/jetbrains/android/exportSignedPackage/ExportSignedPackageWizardStep.java
plugins/android/src/org/jetbrains/android/exportSignedPackage/InitialKeyStep.java
plugins/android/src/org/jetbrains/android/exportSignedPackage/KeystoreStep.java
plugins/android/src/org/jetbrains/android/exportSignedPackage/NewKeyStep.java
plugins/android/src/org/jetbrains/android/facet/AndroidFacet.java
plugins/android/src/org/jetbrains/android/logcat/AndroidLogcatToolWindowFactory.java
plugins/android/src/org/jetbrains/android/logcat/AndroidLogcatToolWindowView.java
plugins/android/src/org/jetbrains/android/logcat/AndroidLogcatUtil.java
plugins/android/src/org/jetbrains/android/util/AndroidUtils.java
plugins/android/testData/dom/layout/layoutAttrs2.xml [new file with mode: 0644]
plugins/android/testSrc/org/jetbrains/android/dom/AndroidLayoutDomTest.java
plugins/ant/ant.iml
plugins/ant/src/com/intellij/lang/ant/AntDefaultNSProvider.java
plugins/ant/src/com/intellij/lang/ant/config/AntBuildFile.java
plugins/ant/src/com/intellij/lang/ant/config/AntConfigurationBase.java
plugins/ant/src/com/intellij/lang/ant/config/actions/AddAntBuildFile.java
plugins/ant/src/com/intellij/lang/ant/config/impl/AntBuildFileImpl.java
plugins/ant/src/com/intellij/lang/ant/config/impl/AntConfigurationImpl.java
plugins/ant/src/com/intellij/lang/ant/dom/AntDomProject.java
plugins/ant/src/com/intellij/lang/ant/psi/impl/AntFileImpl.java
plugins/ant/src/com/intellij/lang/ant/psi/impl/AntIntrospector.java
plugins/devkit/devkit.iml
plugins/devkit/src/dom/impl/IdeaPluginConverter.java
plugins/eclipse/eclipse.iml
plugins/generate-tostring/src/org/jetbrains/generate/tostring/GenerateToStringUtils.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/GenerateToStringWorker.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/element/ClassElement.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/element/ElementFactory.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/element/FieldElement.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/element/MethodElement.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/inspection/ClassHasNoToStringMethodInspection.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/inspection/GenerateToStringQuickFix.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/psi/PsiAdapter.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/psi/PsiAdapterFactory.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/psi/idea7/PsiAdapter7.java [deleted file]
plugins/generate-tostring/src/org/jetbrains/generate/tostring/util/FileUtil.java
plugins/generate-tostring/src/org/jetbrains/generate/tostring/util/StringUtil.java
plugins/git4idea/src/git4idea/history/browser/GitProjectLogManager.java
plugins/git4idea/src/git4idea/history/wholeTree/BigTableTableModel.java
plugins/git4idea/src/git4idea/history/wholeTree/GitLogUI.java
plugins/git4idea/src/git4idea/history/wholeTree/LoadAlgorithm.java
plugins/git4idea/src/git4idea/history/wholeTree/LoadController.java
plugins/git4idea/src/git4idea/history/wholeTree/LoaderAndRefresherImpl.java
plugins/git4idea/src/git4idea/history/wholeTree/SelectorList.java [moved from plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltStandardResourceProvider.java with 59% similarity]
plugins/groovy/jetgroovy.iml
plugins/groovy/src/org/intellij/plugins/intelliLang/inject/groovy/PatternEditorContextMembersProvider.java
plugins/groovy/src/org/jetbrains/plugins/groovy/findUsages/GroovyConstructorUsagesSearchHelper.java [deleted file]
plugins/groovy/src/org/jetbrains/plugins/groovy/grape/GrabDependencies.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyClassNameInsertHandler.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/completion/GroovyCompletionUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/patterns/GroovyElementPattern.java
plugins/groovy/src/org/jetbrains/plugins/groovy/runner/GroovyScriptRunner.java
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyInjectionTest.java [new file with mode: 0644]
plugins/junit/src/com/intellij/execution/junit/JUnit3Framework.java
plugins/junit/src/com/intellij/execution/junit/JUnit4Framework.java
plugins/junit/src/com/intellij/execution/junit2/configuration/JUnitConfigurationModel.java
plugins/junit/src/com/intellij/execution/junit2/ui/StatisticsPanel.java
plugins/maven/maven.iml
plugins/maven/src/main/java/org/jetbrains/idea/maven/compiler/MavenResourceCompiler.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenArtifactCoordinatesVersionConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenGotoFileContributor.java [new file with mode: 0644]
plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenGotoSettingsFileContributor.java [moved from plugins/maven/src/main/java/org/jetbrains/idea/maven/utils/MavenGotoSettingsFileContibutor.java with 95% similarity]
plugins/maven/src/main/java/org/jetbrains/idea/maven/vfs/MavenGotoPropertyFileContributor.java [moved from plugins/maven/src/main/java/org/jetbrains/idea/maven/vfs/MavenGotoPropertyFileContibutor.java with 95% similarity]
plugins/maven/src/main/java/org/jetbrains/idea/maven/wizards/MavenProjectBuilder.java
plugins/maven/src/main/resources/META-INF/plugin.xml
plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenDependencySpecialVersionsCompletionAndResolutionTest.java
plugins/relaxng/src/org/intellij/plugins/relaxNG/references/PrefixReferenceProvider.java
plugins/testng/src/com/theoryinpractice/testng/TestNGFramework.java
plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormReferencesSearcher.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/XPathLanguage.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/context/ContextProvider.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/psi/impl/XPathVariableReferenceImpl.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/context/XsltContextProvider.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/context/XsltNamespaceContext.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltConfigImpl.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/XsltResourceProvider.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/psi/impl/XsltLanguage.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/HookedAction.java [deleted file]
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/VariableInlineHandler.java [new file with mode: 0644]
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/XPathRefactoringSupportProvider.java [new file with mode: 0644]
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/XsltInlineAction.java [deleted file]
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/XsltRefactoringActionBase.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/XsltRefactoringSupport.java [deleted file]
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/XsltRefactoringSupportProvider.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/refactoring/extractTemplate/XsltExtractTemplateAction.java
plugins/xpath/xpath-lang/test/org/intellij/lang/xpath/xslt/XsltRefactoringTest.java
plugins/xpath/xpath-lang/testData/xslt/refactoring/inlineVariable.xsl [new file with mode: 0644]
plugins/xpath/xpath-lang/testData/xslt/refactoring/inlineVariableOnDecl.xsl [new file with mode: 0644]
plugins/xpath/xpath-lang/testData/xslt/refactoring/inlineVariableOnDecl_after.xsl [new file with mode: 0644]
plugins/xpath/xpath-lang/testData/xslt/refactoring/inlineVariable_after.xsl [new file with mode: 0644]
plugins/xpath/xpath-view/src/META-INF/plugin.xml
resources/src/META-INF/IdeaPlugin.xml
xml/dom-impl/src/com/intellij/util/xml/highlighting/DomElementProblemDescriptorImpl.java
xml/dom-impl/src/com/intellij/util/xml/impl/PhysicalDomParentStrategy.java
xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/CreateNSDeclarationIntentionFix.java
xml/impl/src/com/intellij/codeInsight/daemon/impl/analysis/XmlUnboundNsPrefixInspection.java
xml/impl/src/com/intellij/codeInspection/htmlInspections/HtmlUnknownTagInspection.java
xml/impl/src/com/intellij/xml/actions/xmlbeans/GenerateInstanceDocumentFromSchemaDialog.java
xml/impl/src/com/intellij/xml/impl/schema/ComplexTypeDescriptor.java
xml/impl/src/com/intellij/xml/impl/schema/XmlAttributeDescriptorImpl.java
xml/impl/src/com/intellij/xml/impl/schema/XmlElementDescriptorImpl.java

index 3f6ac0d8aecab1167e6aa6290258b4222cd63cca..ce591cf3173e7d56388487fb66c3e8a1fb238415 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <module relativePaths="true" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_3" inherit-compiler-output="true">
+  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_4" inherit-compiler-output="true">
     <exclude-output />
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
index 9dbc40efb3be3cb752b2adc52c599b02f0cf7c1d..e4009deac3c461f240b89bd41d9cedd85dfa2e9f 100644 (file)
@@ -23,6 +23,11 @@ public class CodeGenerationException extends Exception{
     myComponentId = componentId;
   }
 
+  public CodeGenerationException(final String componentId, final String message, final Throwable cause) {
+    super(message, cause);
+    myComponentId = componentId;
+  }
+
   public String getComponentId() {
     return myComponentId;
   }
index 50575a6918afd257ed0b6eba6c813d81f3e1fc8e..e93b9698a3764c20b0642ee980135d150242c69b 100644 (file)
@@ -211,7 +211,7 @@ public final class Utils {
             rootContainer = nestedFormLoader.loadForm(formName);
         }
         catch (Exception e) {
-            throw new CodeGenerationException(null, "Error loading nested form: " + e.getMessage());
+            throw new CodeGenerationException(null, "Error loading nested form: " + e.getMessage(), e);
         }
         final Set thisFormNestedForms = new HashSet();
         final CodeGenerationException[] validateExceptions = new CodeGenerationException[1];
index dbdb99cf8bcf502e393e30fa764d44adaafae49b..ed620fa7b229b051bf393bef468da4631a0ac173 100644 (file)
@@ -228,6 +228,7 @@ public class CompileDriver {
         }
         finally {
           compileContext.commitZipFiles(); // just to be on the safe side; normally should do nothing if called in isUpToDate()
+          CompilerCacheManager.getInstance(myProject).flushCaches();
         }
       }
     }, null);
@@ -455,6 +456,7 @@ public class CompileDriver {
             compileContext.getMessageCount(CompilerMessageCategory.WARNING),
             finish - start
           );
+          CompilerCacheManager.getInstance(myProject).flushCaches();
           //if (LOG.isDebugEnabled()) {
           //  LOG.debug("COMPILATION FINISHED");
           //}
@@ -792,7 +794,6 @@ public class CompileDriver {
       finally {
         // drop in case it has not been dropped yet.
         dropDependencyCache(context);
-
         final VirtualFile[] allOutputDirs = context.getAllOutputDirectories();
 
         if (didSomething && GENERATE_CLASSPATH_INDEX) {
index d0b12ee1362a26b28a2e4c28d150b0f58f190746..5c147ee644a150df5c47c5bd6b0d2e0998bb3c58 100644 (file)
@@ -23,8 +23,6 @@ import com.intellij.openapi.compiler.generic.GenericCompiler;
 import com.intellij.openapi.components.ProjectComponent;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.LowMemoryWatcher;
-import com.intellij.openapi.util.ShutDownTracker;
 import com.intellij.openapi.util.io.FileUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -48,14 +46,6 @@ public class CompilerCacheManager implements ProjectComponent {
   private final Map<GenericCompiler<?,?,?>, GenericCompilerCache<?,?,?>> myGenericCachesMap = new HashMap<GenericCompiler<?,?,?>, GenericCompilerCache<?,?,?>>();
   private final List<Disposable> myCacheDisposables = new ArrayList<Disposable>();
   private final File myCachesRoot;
-  private LowMemoryWatcher myMemWatcher;
-  
-  private final Runnable myShutdownTask = new Runnable() {
-    public void run() {
-      flushCaches();
-    }
-  };
-  
   private final Project myProject;
 
   public CompilerCacheManager(Project project) {
@@ -68,18 +58,9 @@ public class CompilerCacheManager implements ProjectComponent {
   }
   
   public void projectOpened() {
-    myMemWatcher = LowMemoryWatcher.register(new LowMemoryWatcher.ForceableAdapter() {
-      public void force() {
-        flushCaches();
-      }
-    });
-    ShutDownTracker.getInstance().registerShutdownTask(myShutdownTask);
   }
 
   public void projectClosed() {
-    myMemWatcher.stop();
-    ShutDownTracker.getInstance().unregisterShutdownTask(myShutdownTask);
-    flushCaches();
   }
 
   @NotNull
index f9a512ffbb7322a5edaa886a67a642835e8b9a16..e666636192ea5013eb3e92e29292973a6671dfc2 100644 (file)
@@ -535,5 +535,20 @@ public class ArtifactUtil {
     final String outputPath = artifact.getOutputPath();
     return !StringUtil.isEmpty(outputPath) && artifact.getRootElement() instanceof ArtifactRootElement<?>;
   }
+
+  public static Set<Module> getModulesIncludedInArtifacts(final @NotNull Collection<? extends Artifact> artifacts, final @NotNull Project project) {
+    final Set<Module> modules = new HashSet<Module>();
+    final PackagingElementResolvingContext resolvingContext = ArtifactManager.getInstance(project).getResolvingContext();
+    for (Artifact artifact : artifacts) {
+      processPackagingElements(artifact, ModuleOutputElementType.MODULE_OUTPUT_ELEMENT_TYPE, new Processor<ModuleOutputPackagingElement>() {
+        @Override
+        public boolean process(ModuleOutputPackagingElement moduleOutputPackagingElement) {
+          ContainerUtil.addIfNotNull(modules, moduleOutputPackagingElement.findModule(resolvingContext));
+          return true;
+        }
+      }, resolvingContext, true);
+    }
+    return modules;
+  }
 }
 
index bf3a135445247c3a5a0bec833b8354b5ad41f181..5497a3dc192f3e28b965693f8eb1544e4a9f4ab6 100644 (file)
@@ -46,20 +46,7 @@ public class ArtifactCompileScope {
   }
 
   public static ModuleCompileScope createScopeForModulesInArtifacts(@NotNull Project project, @NotNull Collection<? extends Artifact> artifacts) {
-    final Set<Module> modules = new HashSet<Module>();
-    final PackagingElementResolvingContext context = ArtifactManager.getInstance(project).getResolvingContext();
-    for (Artifact artifact : artifacts) {
-      ArtifactUtil.processPackagingElements(artifact, ModuleOutputElementType.MODULE_OUTPUT_ELEMENT_TYPE, new Processor<ModuleOutputPackagingElement>() {
-        public boolean process(ModuleOutputPackagingElement moduleOutputPackagingElement) {
-          final Module module = moduleOutputPackagingElement.findModule(context);
-          if (module != null) {
-            modules.add(module);
-          }
-          return true;
-        }
-      }, context, true);
-    }
-
+    final Set<Module> modules = ArtifactUtil.getModulesIncludedInArtifacts(artifacts, project);
     return new ModuleCompileScope(project, modules.toArray(new Module[modules.size()]), true);
   }
 
index bd6c2d4f52d5410c7dcacdc99e50ae8517c3c137..236aedce2581c23c9c12aaf6886268a4d02d02de 100644 (file)
@@ -1058,7 +1058,7 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
     }
 
     @Override
-    public void visitNewExpression(PsiNewExpression expression) {
+    public void visitNewExpression(final PsiNewExpression expression) {
       PsiType expressionPsiType = expression.getType();
       if (expressionPsiType instanceof PsiArrayType) {
         Evaluator dimensionEvaluator = null;
@@ -1115,8 +1115,7 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
           initializerEvaluator
         );
       }
-      else { // must be a class ref
-        LOG.assertTrue(expressionPsiType instanceof PsiClassType);
+      else if (expressionPsiType instanceof PsiClassType){ // must be a class ref
         PsiClass aClass = ((PsiClassType)expressionPsiType).resolve();
         if(aClass instanceof PsiAnonymousClass) {
           throwEvaluateException(DebuggerBundle.message("evaluation.error.anonymous.class.evaluation.not.supported"));
@@ -1151,6 +1150,14 @@ public class EvaluatorBuilderImpl implements EvaluatorBuilder {
           argumentEvaluators
         );
       }
+      else {
+        if (expressionPsiType != null) {
+          throwEvaluateException("Unsupported expression type: " + expressionPsiType.getPresentableText());
+        }
+        else {
+          throwEvaluateException("Unknown type for expression: " + expression.getText());
+        }
+      }
     }
 
     @Override
index 600d362a80943115141fd5f64ea481b31386f289..0dafd39824e546e47cd7d9e03f5b0722919303f6 100644 (file)
@@ -31,7 +31,6 @@ import com.intellij.debugger.jdi.StackFrameProxyImpl;
 import com.intellij.debugger.jdi.ThreadReferenceProxyImpl;
 import com.intellij.debugger.requests.ClassPrepareRequestor;
 import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.*;
 import com.intellij.psi.PsiClass;
@@ -41,14 +40,13 @@ import com.sun.jdi.ReferenceType;
 import com.sun.jdi.event.LocatableEvent;
 import org.jdom.Element;
 import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
 import java.util.List;
 
 public abstract class Breakpoint extends FilteredRequestor implements ClassPrepareRequestor {
-  private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.ui.breakpoints.Breakpoint");
-
   public boolean ENABLED = true;
   public boolean LOG_ENABLED = false;
   public boolean LOG_EXPRESSION_ENABLED = false;
@@ -134,7 +132,7 @@ public abstract class Breakpoint extends FilteredRequestor implements ClassPrepa
   }
 
   protected void createOrWaitPrepare(final DebugProcessImpl debugProcess, final SourcePosition classPosition) {
-    debugProcess.getRequestsManager().callbackOnPrepareClasses(Breakpoint.this, classPosition);
+    debugProcess.getRequestsManager().callbackOnPrepareClasses(this, classPosition);
 
     List list = debugProcess.getPositionManager().getAllClasses(classPosition);
     for (final Object aList : list) {
@@ -163,7 +161,7 @@ public abstract class Breakpoint extends FilteredRequestor implements ClassPrepa
       return false;
     }
 
-    final String[] title = new String[] {DebuggerBundle.message("title.error.evaluating.breakpoint.condition") };
+    final String[] title = {DebuggerBundle.message("title.error.evaluating.breakpoint.condition") };
 
     try {
       final StackFrameProxyImpl frameProxy = context.getThread().frame(0);
@@ -245,7 +243,7 @@ public abstract class Breakpoint extends FilteredRequestor implements ClassPrepa
     updateUI(EmptyRunnable.getInstance());
   }
 
-  public void updateUI(final Runnable afterUpdate) {
+  public void updateUI(@NotNull Runnable afterUpdate) {
   }
 
   public void delete() {
index 48527a7e4c766229b6a1e3ce6779dbb815a8a972..4eff6bc5adcff0d2e019d4acdb63c73156a9b002 100644 (file)
@@ -36,6 +36,7 @@ import com.intellij.openapi.ui.ComboBox;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.FixedSizeButton;
 import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiElement;
 import com.intellij.ui.FieldPanel;
@@ -90,7 +91,7 @@ public abstract class BreakpointPropertiesPanel {
   private JButton myMakeDefaultButton;
 
   ButtonGroup mySuspendPolicyGroup;
-  public static final @NonNls String CONTROL_LOG_MESSAGE = "logMessage";
+  @NonNls public static final String CONTROL_LOG_MESSAGE = "logMessage";
   private BreakpointComboboxHandler myBreakpointComboboxHandler;
   private static final int MAX_COMBO_WIDTH = 300;
   private final FixedSizeButton myConditionMagnifierButton;
@@ -220,8 +221,7 @@ public abstract class BreakpointPropertiesPanel {
       public void actionPerformed(ActionEvent e) {
         reloadClassFilters();
 
-        ClassFilter classFilter;
-        classFilter = createClassConditionFilter();
+        ClassFilter classFilter = createClassConditionFilter();
 
         EditClassFiltersDialog _dialog = new EditClassFiltersDialog(myProject, classFilter);
         _dialog.setFilters(myClassFilters, myClassExclusionFilters);
@@ -321,7 +321,7 @@ public abstract class BreakpointPropertiesPanel {
    */
   public void initFrom(Breakpoint breakpoint) {
     myBreakpointComboboxHandler.initFrom(breakpoint);
-    myPassCountField.setText((breakpoint.COUNT_FILTER > 0)? Integer.toString(breakpoint.COUNT_FILTER) : "");
+    myPassCountField.setText(breakpoint.COUNT_FILTER > 0 ? Integer.toString(breakpoint.COUNT_FILTER) : "");
 
     PsiElement context = breakpoint.getEvaluationElement();
     myPassCountCheckbox.setSelected(breakpoint.COUNT_FILTER_ENABLED);
@@ -367,7 +367,7 @@ public abstract class BreakpointPropertiesPanel {
   /**
    * Save values in the UI components to the breakpoint object
    */
-  public void saveTo(Breakpoint breakpoint, Runnable afterUpdate) {
+  public void saveTo(Breakpoint breakpoint, @NotNull Runnable afterUpdate) {
     myBreakpointComboboxHandler.saveTo(breakpoint, myLeaveEnabledRadioButton.isSelected());
     try {
       String text = myPassCountField.getText().trim();
@@ -379,11 +379,11 @@ public abstract class BreakpointPropertiesPanel {
     }
     catch (Exception e) {
     }
-    breakpoint.COUNT_FILTER_ENABLED = breakpoint.COUNT_FILTER > 0? myPassCountCheckbox.isSelected() : false;
+    breakpoint.COUNT_FILTER_ENABLED = breakpoint.COUNT_FILTER > 0 && myPassCountCheckbox.isSelected();
     breakpoint.setCondition(myConditionCombo.getText());
-    breakpoint.CONDITION_ENABLED = !breakpoint.getCondition().isEmpty() ? myConditionCheckbox.isSelected() : false;
+    breakpoint.CONDITION_ENABLED = !breakpoint.getCondition().isEmpty() && myConditionCheckbox.isSelected();
     breakpoint.setLogMessage(myLogExpressionCombo.getText());
-    breakpoint.LOG_EXPRESSION_ENABLED = !breakpoint.getLogMessage().isEmpty()? myLogExpressionCheckBox.isSelected() : false;
+    breakpoint.LOG_EXPRESSION_ENABLED = !breakpoint.getLogMessage().isEmpty() && myLogExpressionCheckBox.isSelected();
     breakpoint.LOG_ENABLED = myLogMessageCheckBox.isSelected();
     breakpoint.SUSPEND_POLICY = getSelectedSuspendPolicy();
     reloadInstanceFilters();
@@ -391,8 +391,8 @@ public abstract class BreakpointPropertiesPanel {
     updateInstanceFilterEditor(true);
     updateClassFilterEditor(true);
 
-    breakpoint.INSTANCE_FILTERS_ENABLED = myInstanceFiltersField.getText().length() > 0 ? myInstanceFiltersCheckBox.isSelected() : false;
-    breakpoint.CLASS_FILTERS_ENABLED = myClassFiltersField.getText().length() > 0 ? myClassFiltersCheckBox.isSelected() : false;
+    breakpoint.INSTANCE_FILTERS_ENABLED = myInstanceFiltersField.getText().length() > 0 && myInstanceFiltersCheckBox.isSelected();
+    breakpoint.CLASS_FILTERS_ENABLED = myClassFiltersField.getText().length() > 0 && myClassFiltersCheckBox.isSelected();
     breakpoint.setClassFilters(myClassFilters);
     breakpoint.setClassExclusionFilters(myClassExclusionFilters);
     breakpoint.setInstanceFilters(myInstanceFilters);
@@ -402,21 +402,11 @@ public abstract class BreakpointPropertiesPanel {
     breakpoint.updateUI(afterUpdate);
   }
 
-  private String concatWith(List<String> s, String concator) {
-    String result = "";
-    for (Iterator iterator = s.iterator(); iterator.hasNext();) {
-      String str = (String) iterator.next();
-      result += str + concator;
-    }
-    if (result.length() > 0) {
-      return result.substring(0, result.length() - concator.length());
-    }
-    else {
-      return "";
-    }
+  private static String concatWith(List<String> s, String concator) {
+    return StringUtil.join(s, concator);
   }
 
-  private String concatWithEx(List<String> s, String concator, int N, String NthConcator) {
+  private static String concatWithEx(List<String> s, String concator, int N, String NthConcator) {
     String result = "";
     int i = 1;
     for (Iterator iterator = s.iterator(); iterator.hasNext(); i++) {
@@ -435,9 +425,8 @@ public abstract class BreakpointPropertiesPanel {
 
   private void updateInstanceFilterEditor(boolean updateText) {
     List<String> filters = new ArrayList<String>();
-    for (int i = 0; i < myInstanceFilters.length; i++) {
-      InstanceFilter instanceFilter = myInstanceFilters[i];
-      if(instanceFilter.isEnabled()) {
+    for (InstanceFilter instanceFilter : myInstanceFilters) {
+      if (instanceFilter.isEnabled()) {
         filters.add(Long.toString(instanceFilter.getId()));
       }
     }
@@ -465,38 +454,35 @@ public abstract class BreakpointPropertiesPanel {
         }
       }
     }
-    for (int i = 0; i < myInstanceFilters.length; i++) {
-      InstanceFilter instanceFilter = myInstanceFilters[i];
-      if(!instanceFilter.isEnabled()) idxs.add(instanceFilter);
+    for (InstanceFilter instanceFilter : myInstanceFilters) {
+      if (!instanceFilter.isEnabled()) idxs.add(instanceFilter);
     }
     myInstanceFilters = idxs.toArray(new InstanceFilter[idxs.size()]);
   }
 
   private void updateClassFilterEditor(boolean updateText) {
     List<String> filters = new ArrayList<String>();
-    for (int i = 0; i < myClassFilters.length; i++) {
-      com.intellij.ui.classFilter.ClassFilter classFilter = myClassFilters[i];
-      if(classFilter.isEnabled()) {
+    for (com.intellij.ui.classFilter.ClassFilter classFilter : myClassFilters) {
+      if (classFilter.isEnabled()) {
         filters.add(classFilter.getPattern());
       }
     }
     List<String> excludeFilters = new ArrayList<String>();
-    for (int i = 0; i < myClassExclusionFilters.length; i++) {
-      com.intellij.ui.classFilter.ClassFilter classFilter = myClassExclusionFilters[i];
-      if(classFilter.isEnabled()) {
+    for (com.intellij.ui.classFilter.ClassFilter classFilter : myClassExclusionFilters) {
+      if (classFilter.isEnabled()) {
         excludeFilters.add("-" + classFilter.getPattern());
       }
     }
     if (updateText) {
       String editorText = concatWith(filters, " ");
-      if(filters.size() > 0) editorText += " ";
+      if(!filters.isEmpty()) editorText += " ";
       editorText += concatWith(excludeFilters, " ");
       myClassFiltersField.setText(editorText);
     }
 
     int width = (int)Math.sqrt(myClassExclusionFilters.length + myClassFilters.length) + 1;
     String tipText = concatWithEx(filters, " ", width, "\n");
-    if(filters.size() > 0) tipText += "\n";
+    if(!filters.isEmpty()) tipText += "\n";
     tipText += concatWithEx(excludeFilters, " ", width, "\n");
     myClassFiltersField.getTextField().setToolTipText(tipText);
 
@@ -522,13 +508,11 @@ public abstract class BreakpointPropertiesPanel {
         }
       }
     }
-    for (int i = 0; i < myClassFilters.length; i++) {
-      com.intellij.ui.classFilter.ClassFilter classFilter = myClassFilters[i];
-      if(!classFilter.isEnabled()) classFilters.add(classFilter);
+    for (com.intellij.ui.classFilter.ClassFilter classFilter : myClassFilters) {
+      if (!classFilter.isEnabled()) classFilters.add(classFilter);
     }
-    for (int i = 0; i < myClassExclusionFilters.length; i++) {
-      com.intellij.ui.classFilter.ClassFilter classFilter = myClassExclusionFilters[i];
-      if(!classFilter.isEnabled()) exclusionFilters.add(classFilter);
+    for (com.intellij.ui.classFilter.ClassFilter classFilter : myClassExclusionFilters) {
+      if (!classFilter.isEnabled()) exclusionFilters.add(classFilter);
     }
     myClassFilters          = classFilters    .toArray(new com.intellij.ui.classFilter.ClassFilter[classFilters    .size()]);
     myClassExclusionFilters = exclusionFilters.toArray(new com.intellij.ui.classFilter.ClassFilter[exclusionFilters.size()]);
@@ -537,18 +521,17 @@ public abstract class BreakpointPropertiesPanel {
   public void setEnabled(boolean enabled) {
     myPanel.setEnabled(enabled);
     Component[] components = myPanel.getComponents();
-    for (int i = 0; i < components.length; i++) {
-      Component component = components[i];
+    for (Component component : components) {
       component.setEnabled(enabled);
     }
   }
 
   protected void updateCheckboxes() {
-    JCheckBox [] checkBoxes = new JCheckBox[] { myConditionCheckbox, myInstanceFiltersCheckBox, myClassFiltersCheckBox};
+    JCheckBox [] checkBoxes = { myConditionCheckbox, myInstanceFiltersCheckBox, myClassFiltersCheckBox };
     JCheckBox    selected   = null;
-    for(int i =0; i < checkBoxes.length; i++) {
-      if(checkBoxes[i].isSelected()) {
-        selected = checkBoxes[i];
+    for (JCheckBox checkBoxe : checkBoxes) {
+      if (checkBoxe.isSelected()) {
+        selected = checkBoxe;
         break;
       }
     }
@@ -559,8 +542,8 @@ public abstract class BreakpointPropertiesPanel {
       myPassCountCheckbox.setEnabled(true);
     }
 
-    for(int i =0; i < checkBoxes.length; i++) {
-      checkBoxes[i].setEnabled (!myPassCountCheckbox.isSelected());
+    for (JCheckBox checkBoxe : checkBoxes) {
+      checkBoxe.setEnabled(!myPassCountCheckbox.isSelected());
     }
 
     myPassCountField.setEditable(myPassCountCheckbox.isSelected());
@@ -597,9 +580,8 @@ public abstract class BreakpointPropertiesPanel {
     }
 
     public void selectBreakpoint(Breakpoint breakpoint) {
-      for (int idx = 0; idx < myItems.length; idx++) {
-        final ComboboxItem item = myItems[idx];
-        if (breakpoint == null? item.getBreakpoint() == null : breakpoint.equals(item.getBreakpoint())) {
+      for (final ComboboxItem item : myItems) {
+        if (breakpoint == null ? item.getBreakpoint() == null : breakpoint.equals(item.getBreakpoint())) {
           if (!item.equals(getSelectedItem())) {
             setSelectedItem(item);
           }
@@ -636,7 +618,7 @@ public abstract class BreakpointPropertiesPanel {
     }
 
     public int hashCode() {
-      return (breakpoint != null ? breakpoint.hashCode() : 0);
+      return breakpoint != null ? breakpoint.hashCode() : 0;
     }
   }
   
@@ -705,8 +687,9 @@ public abstract class BreakpointPropertiesPanel {
       setText(text);
       final Icon icon;
       if (breakpoint != null) {
-        icon = (breakpoint instanceof BreakpointWithHighlighter)?
-                          breakpoint.ENABLED? ((BreakpointWithHighlighter)breakpoint).getSetIcon(false) : ((BreakpointWithHighlighter)breakpoint).getDisabledIcon(false) : breakpoint.getIcon();
+        icon = breakpoint instanceof BreakpointWithHighlighter ?
+                          breakpoint.ENABLED? ((BreakpointWithHighlighter)breakpoint).getSetIcon(false) : ((BreakpointWithHighlighter)breakpoint)
+                            .getDisabledIcon(false) : breakpoint.getIcon();
       }
       else {
         icon = null;
index e7344f03245df56c22ac03be2bd22265163aba95..45e9f5bdc89fb19d82dd3dbfeb71cc5d84b62347 100644 (file)
@@ -69,7 +69,7 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
   private SourcePosition mySourcePosition;
 
   private boolean myVisible = true;
-  private Icon myIcon = getSetIcon(false);
+  private volatile Icon myIcon = getSetIcon(false);
   @Nullable private String myClassName;
   @Nullable private String myPackageName;
   @Nullable private String myInvalidMessage;
@@ -317,7 +317,7 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
   /**
    * updates the state of breakpoint and all the related UI widgets etc
    */
-  public final void updateUI(final Runnable afterUpdate) {
+  public final void updateUI(@NotNull final Runnable afterUpdate) {
     if (ApplicationManager.getApplication().isUnitTestMode()) {
       return;
     }
@@ -359,8 +359,9 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
 
   private void updateGutter() {
     if(myVisible) {
-      if (getHighlighter() != null && getHighlighter().isValid() && isValid()) {
-        setupGutterRenderer();
+      RangeHighlighter highlighter = getHighlighter();
+      if (highlighter != null && highlighter.isValid() && isValid()) {
+        setupGutterRenderer(highlighter);
       }
       else {
         DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().removeBreakpoint(this);
@@ -369,7 +370,7 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
   }
 
   /**
-   * called by BreakpointManeger when destroying the breakpoint
+   * called by BreakpointManager when destroying the breakpoint
    */
   public void delete() {
     if (isVisible()) {
@@ -414,9 +415,9 @@ public abstract class BreakpointWithHighlighter extends Breakpoint {
     });
   }
 
-  private void setupGutterRenderer() {
+  private void setupGutterRenderer(@NotNull RangeHighlighter highlighter) {
     MyGutterIconRenderer renderer = new MyGutterIconRenderer(getIcon(), getDescription());
-    getHighlighter().setGutterIconRenderer(renderer);
+    highlighter.setGutterIconRenderer(renderer);
   }
 
   public abstract Key<? extends BreakpointWithHighlighter> getCategory();
index 9de67e05caa9723410493086a5cc5f435bfd2fd7..5f55eb9c5ea63fd4e310c53ac288948e5d50cdee 100644 (file)
@@ -23,6 +23,7 @@ package com.intellij.debugger.ui.breakpoints;
 import com.intellij.debugger.DebuggerBundle;
 import com.intellij.ide.util.ClassFilter;
 import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
 import java.awt.*;
@@ -99,7 +100,7 @@ public class ExceptionBreakpointPropertiesPanel extends BreakpointPropertiesPane
     myNotifyUncaughtCheckBox.setSelected(exceptionBreakpoint.NOTIFY_UNCAUGHT);
   }
 
-  public void saveTo(Breakpoint breakpoint, Runnable afterUpdate) {
+  public void saveTo(Breakpoint breakpoint, @NotNull Runnable afterUpdate) {
     ExceptionBreakpoint exceptionBreakpoint = (ExceptionBreakpoint)breakpoint;
     exceptionBreakpoint.NOTIFY_CAUGHT = myNotifyCaughtCheckBox.isSelected();
     exceptionBreakpoint.NOTIFY_UNCAUGHT = myNotifyUncaughtCheckBox.isSelected();
index 4627d9317a323d90ac6b122d99b1e30860ce3fd8..476b47988e99ecf756001316f49805029816700a 100644 (file)
@@ -22,6 +22,7 @@ package com.intellij.debugger.ui.breakpoints;
 
 import com.intellij.debugger.DebuggerBundle;
 import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
 import java.awt.*;
@@ -90,7 +91,7 @@ public class FieldBreakpointPropertiesPanel extends BreakpointPropertiesPanel {
     myWatchModificationCheckBox.setSelected(fieldBreakpoint.WATCH_MODIFICATION);
   }
 
-  public void saveTo(Breakpoint breakpoint, Runnable afterUpdate) {
+  public void saveTo(Breakpoint breakpoint, @NotNull Runnable afterUpdate) {
     FieldBreakpoint fieldBreakpoint = (FieldBreakpoint)breakpoint;
 
     fieldBreakpoint.WATCH_ACCESS = myWatchAccessCheckBox.isSelected();
index 65b0541cb3c7295a5dd9080c68aaa7a26938b3c7..d09bcd2443a89fda4d16c6447c4e7277494e6189 100644 (file)
@@ -22,6 +22,7 @@ package com.intellij.debugger.ui.breakpoints;
 
 import com.intellij.debugger.DebuggerBundle;
 import com.intellij.openapi.project.Project;
+import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
 import java.awt.*;
@@ -95,7 +96,7 @@ public class MethodBreakpointPropertiesPanel extends BreakpointPropertiesPanel {
     }
   }
 
-  public void saveTo(Breakpoint breakpoint, Runnable afterUpdate) {
+  public void saveTo(Breakpoint breakpoint, @NotNull Runnable afterUpdate) {
     if (breakpoint instanceof MethodBreakpoint) {
       MethodBreakpoint methodBreakpoint = (MethodBreakpoint)breakpoint;
       methodBreakpoint.WATCH_ENTRY = myWatchEntryCheckBox.isSelected();
index 9abc634e8fe6512232e0efe9d7bb1e23fbfd98fe..86c3d1cbde5cab911373bf3d810ba7553e10149e 100644 (file)
@@ -26,7 +26,7 @@ import java.util.List;
 
 public interface PositionManager {
   @Nullable
-  SourcePosition getSourcePosition(Location location) throws NoDataException;
+  SourcePosition getSourcePosition(@Nullable Location location) throws NoDataException;
 
   @NotNull
   List<ReferenceType> getAllClasses(SourcePosition classPosition) throws NoDataException;
index 1c10dbb303b33a117bd0a9b13752cddb2a48e6b0..3ddddf466c231ca92055bcaebf873b9706c78bec 100644 (file)
@@ -52,6 +52,7 @@ public class AppletConfigurationProducer extends JavaRuntimeConfigurationProduce
   @Override
   protected RunnerAndConfigurationSettings createConfigurationByElement(Location location, ConfigurationContext context) {
     location = JavaExecutionUtil.stepIntoSingleClass(location);
+    if (location == null) return null;
     final Project project = location.getProject();
     final PsiElement element = location.getPsiElement();
     myPsiClass = getAppletClass(element, PsiManager.getInstance(project));
index 1ea21942f526d6bb3ecc2ba8950f2acf27e11353..d1f3a87c5633a051bf742b447111bf67bfd32546 100644 (file)
@@ -31,6 +31,7 @@ import com.intellij.psi.util.TypeConversionUtil;
 import com.intellij.util.containers.Convertor;
 import junit.runner.BaseTestRunner;
 import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.Nullable;
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
@@ -209,6 +210,18 @@ public class JUnitUtil {
     return false;
   }
 
+  @Nullable
+  protected static PsiMethod findFirstTestMethod(PsiClass clazz) {
+    PsiMethod testMethod = null;
+    for (PsiMethod method : clazz.getMethods()) {
+      if (isTestMethod(MethodLocation.elementInClass(method, clazz)) || isSuiteMethod(method)) {
+        testMethod = method;
+        break;
+      }
+    }
+    return testMethod;
+  }
+
   public static class  TestMethodFilter implements Condition<PsiMethod> {
     private final PsiClass myClass;
 
index fe9bb3a0fea8341b3d6b4a7235f63642fe9a76c2..f6b4bcbd6f246134e60f066873426d51a21f46dc 100644 (file)
@@ -39,6 +39,7 @@ import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.ProjectStr
 import com.intellij.openapi.roots.ui.configuration.projectRoot.daemon.SdkProjectStructureElement;
 import com.intellij.openapi.roots.ui.util.CellAppearance;
 import com.intellij.openapi.roots.ui.util.OrderEntryCellAppearanceUtils;
+import com.intellij.openapi.ui.ComboBoxTableRenderer;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.ui.popup.JBPopup;
 import com.intellij.openapi.ui.popup.JBPopupFactory;
@@ -89,6 +90,13 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
 
     JComboBox scopeEditor = new JComboBox(new EnumComboBoxModel<DependencyScope>(DependencyScope.class));
     myEntryTable.setDefaultEditor(DependencyScope.class, new DefaultCellEditor(scopeEditor));
+    myEntryTable.setDefaultRenderer(DependencyScope.class, new ComboBoxTableRenderer<DependencyScope>(DependencyScope.values()) {
+        @Override
+        protected String getTextFor(@NotNull final DependencyScope value) {
+          return value.getDisplayName();
+        }
+      });
+
     myEntryTable.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
 
     new SpeedSearchBase<Table>(myEntryTable) {
@@ -187,7 +195,8 @@ public class ClasspathPanelImpl extends JPanel implements ClasspathPanel {
         }
       }
     };
-    navigateAction.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE).getShortcutSet(), myEntryTable);
+    navigateAction.registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE).getShortcutSet(),
+                                             myEntryTable);
     actionGroup.add(navigateAction);
     actionGroup.add(new MyFindUsagesAction());
     PopupHandler.installPopupHandler(myEntryTable, actionGroup, ActionPlaces.UNKNOWN, ActionManager.getInstance());
index ceb7fe720286a0932002261a56278a5f68c80aae..486bc4229a68618b5bd9333d4c86275c185b915e 100644 (file)
@@ -49,12 +49,11 @@ public abstract class AbstractBasicToClassNameDelegator extends CompletionContri
     final CompletionParameters classParams;
 
     final int invocationCount = parameters.getInvocationCount();
-    final int offset = parameters.getOffset();
     if (empty.get().booleanValue()) {
-      classParams = new CompletionParameters(position, file, CompletionType.CLASS_NAME, offset, invocationCount);
+      classParams = parameters.withType(CompletionType.CLASS_NAME);
     }
     else if (invocationCount > 1) {
-      classParams = new CompletionParameters(position, file, CompletionType.CLASS_NAME, offset, invocationCount - 1);
+      classParams = parameters.withType(CompletionType.CLASS_NAME).withInvocationCount(invocationCount - 1);
     } else {
       return;
     }
index 3e13df602b5ac7c486c02f261b9f587736e9e6cc..d10cce47486d0f08e23b60199531043c57ffaa6d 100644 (file)
@@ -83,7 +83,7 @@ class ConstructorInsertHandler implements InsertHandler<LookupElementDecorator<L
     }
   }
 
-  public static void insertParentheses(InsertionContext context, LookupItem delegate, final PsiClass psiClass) {
+  public static boolean insertParentheses(InsertionContext context, LookupItem delegate, final PsiClass psiClass) {
     final PsiElement place = context.getFile().findElementAt(context.getStartOffset());
     final PsiResolveHelper resolveHelper = JavaPsiFacade.getInstance(context.getProject()).getResolveHelper();
     assert place != null;
@@ -97,6 +97,7 @@ class ConstructorInsertHandler implements InsertHandler<LookupElementDecorator<L
     }
 
     JavaCompletionUtil.insertParentheses(context, delegate, false, hasParams);
+    return hasParams;
   }
 
   private static Runnable generateAnonymousBody(final Editor editor, final PsiFile file) {
index 1c8c9c4f8613d808c0446121aa8007757f1996be..0a83bde18556d8dc23e0b6cf7b303434b2357fa6 100644 (file)
@@ -24,8 +24,6 @@ import com.intellij.featureStatistics.FeatureUsageTracker;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.Editor;
-import com.intellij.openapi.editor.ex.EditorEx;
-import com.intellij.openapi.editor.highlighter.HighlighterIterator;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.*;
@@ -63,17 +61,14 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
 
     InsertHandlerState state = new InsertHandlerState(context.getSelectionEndOffset(), context.getSelectionEndOffset());
 
-    final boolean needLeftParenth = isToInsertParenth(context, item);
-    final boolean hasParams = needLeftParenth && hasParams(context, item);
-
     if (CompletionUtil.isOverwrite(item, completionChar)) {
-      removeEndOfIdentifier(needLeftParenth && hasParams, context);
+      removeEndOfIdentifier(context);
     }
     else if(context.getOffsetMap().getOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET) != context.getSelectionEndOffset()) {
       JavaCompletionUtil.resetParensInfo(context.getOffsetMap());
     }
 
-    handleParentheses(hasParams, needLeftParenth, tailType, context, state);
+    handleParentheses(false, false, tailType, context, state);
     handleBrackets(item, document, state);
 
     if (item.getObject() instanceof PsiVariable) {
@@ -97,37 +92,10 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
     qualifyIfNeeded(context, item);
 
 
-    if (needLeftParenth && hasParams){
-      // Invoke parameters popup
-      AutoPopupController.getInstance(project).autoPopupParameterInfo(editor, null);
-    }
-
-    if (tailType == TailType.DOT && !(item.getObject() instanceof PsiClass)) {
+    if (tailType == TailType.DOT) {
       AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null);
     }
 
-    if (completionChar == '#') {
-      context.setLaterRunnable(new Runnable() {
-        public void run() {
-           new CodeCompletionHandlerBase(CompletionType.BASIC).invoke(project, editor, file);
-        }
-      });
-    }
-
-    if (insertingAnnotation(context, item)) {
-      // Check if someone inserts annotation class that require @
-      PsiElement elementAt = file.findElementAt(context.getStartOffset());
-      final PsiElement parentElement = elementAt != null ? elementAt.getParent():null;
-
-      if (elementAt instanceof PsiIdentifier &&
-          (PsiTreeUtil.getParentOfType(elementAt, PsiAnnotationParameterList.class) != null ||
-           parentElement instanceof PsiErrorElement && parentElement.getParent() instanceof PsiJavaFile // top level annotation without @
-          )
-          && isAtTokenNeeded(context)) {
-        int expectedOffsetForAtToken = elementAt.getTextRange().getStartOffset();
-        document.insertString(expectedOffsetForAtToken, "@");
-      }
-    }
   }
 
   private static void qualifyIfNeeded(InsertionContext context, LookupElement item) {
@@ -158,14 +126,6 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
     }                                                                       
   }
 
-  private static boolean isAtTokenNeeded(InsertionContext myContext) {
-    HighlighterIterator iterator = ((EditorEx)myContext.getEditor()).getHighlighter().createIterator(myContext.getStartOffset());
-    LOG.assertTrue(iterator.getTokenType() == JavaTokenType.IDENTIFIER);
-    iterator.retreat();
-    if (iterator.getTokenType() == TokenType.WHITE_SPACE) iterator.retreat();
-    return iterator.getTokenType() != JavaTokenType.AT && iterator.getTokenType() != JavaTokenType.DOT;
-  }
-
   private static void handleBrackets(LookupElement item, Document document, InsertHandlerState myState){
     // brackets
     final Integer bracketsAttr = (Integer)item.getUserData(LookupItem.BRACKETS_COUNT_ATTR);
@@ -242,71 +202,11 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
     }
   }
 
-  protected static boolean isToInsertParenth(InsertionContext context, LookupElement item){
-    return insertingAnnotationWithParameters(context, item);
-  }
-
-  private static boolean hasParams(InsertionContext context, LookupElement item){
-    final String lookupString = item.getLookupString();
-    if (PsiKeyword.SYNCHRONIZED.equals(lookupString)) {
-      final PsiElement place = context.getFile().findElementAt(context.getStartOffset());
-      return PsiTreeUtil.getParentOfType(place, PsiMember.class, PsiCodeBlock.class) instanceof PsiCodeBlock;
-    }
-    else if(PsiKeyword.CATCH.equals(lookupString) ||
-            PsiKeyword.SWITCH.equals(lookupString) ||
-            PsiKeyword.WHILE.equals(lookupString) ||
-            PsiKeyword.FOR.equals(lookupString))
-      return true;
-    else if (insertingAnnotationWithParameters(context, item)) {
-      return true;
-    }
-    return false;
-  }
-
-  private static boolean insertingAnnotationWithParameters(InsertionContext context, LookupElement item) {
-    if(insertingAnnotation(context, item)) {
-      final Document document = context.getEditor().getDocument();
-      PsiDocumentManager.getInstance(context.getProject()).commitDocument(document);
-      PsiElement elementAt = context.getFile().findElementAt(context.getStartOffset());
-      if (elementAt instanceof PsiIdentifier) {
-        final PsiModifierListOwner parent = PsiTreeUtil.getParentOfType(elementAt, PsiModifierListOwner.class, false, PsiCodeBlock.class);
-        if (parent != null) {
-          for (PsiMethod m : ((PsiClass)item.getObject()).getMethods()) {
-            if (!(m instanceof PsiAnnotationMethod)) continue;
-            final PsiAnnotationMemberValue defaultValue = ((PsiAnnotationMethod)m).getDefaultValue();
-            if (defaultValue == null) return true;
-          }
-        }
-      }
-    }
-    return false;
-  }
-
-  private static boolean insertingAnnotation(InsertionContext context, LookupElement item) {
-    final Object obj = item.getObject();
-    if (!(obj instanceof PsiClass) || !((PsiClass)obj).isAnnotationType()) return false;
-
-    final Document document = context.getEditor().getDocument();
-    PsiDocumentManager.getInstance(context.getProject()).commitDocument(document);
-    final int offset = context.getStartOffset();
-
-    final PsiFile file = context.getFile();
-
-    if (PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiImportStatement.class, false) != null) return false;
-
-    //outside of any class: we are surely inserting an annotation
-    if (PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiClass.class, false) == null) return true;
-
-    //the easiest check that there's a @ before the identifier
-    return PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiAnnotation.class, false) != null;
-
-  }
-
-  protected static void removeEndOfIdentifier(boolean needParenth, InsertionContext context){
+  private static void removeEndOfIdentifier(InsertionContext context){
     final Document document = context.getEditor().getDocument();
     JavaCompletionUtil.initOffsets(context.getFile(), context.getProject(), context.getOffsetMap());
     document.deleteString(context.getSelectionEndOffset(), context.getOffsetMap().getOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET));
-    if(context.getOffsetMap().getOffset(JavaCompletionUtil.LPAREN_OFFSET) > 0 && !needParenth){
+    if(context.getOffsetMap().getOffset(JavaCompletionUtil.LPAREN_OFFSET) > 0){
       document.deleteString(context.getOffsetMap().getOffset(JavaCompletionUtil.LPAREN_OFFSET),
                               context.getOffsetMap().getOffset(JavaCompletionUtil.ARG_LIST_END_OFFSET));
       JavaCompletionUtil.resetParensInfo(context.getOffsetMap());
@@ -323,7 +223,6 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
       case ':': return TailType.CASE_COLON; //?
       case '<':
       case '>':
-      case '#':
       case '\"':
       case '[': return TailType.createSimpleTailType(completionChar);
     }
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/FocusInJavadoc.java b/java/java-impl/src/com/intellij/codeInsight/completion/FocusInJavadoc.java
new file mode 100644 (file)
index 0000000..95a99a3
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.psi.javadoc.PsiDocTag;
+import com.intellij.psi.util.PsiTreeUtil;
+import com.intellij.util.ThreeState;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * @author peter
+ */
+public class FocusInJavadoc extends CompletionConfidence {
+  @NotNull
+  @Override
+  public ThreeState shouldFocusLookup(@NotNull CompletionParameters parameters) {
+    if (PsiTreeUtil.getParentOfType(parameters.getPosition(), PsiDocTag.class) != null) {
+      return ThreeState.YES;
+    }
+    return ThreeState.UNSURE;
+  }
+}
index 2a487a5ae0691340a3f807ed99dcfe64fe7f13cc..556158f8a05205bbfbcea7d7f314200b7b607612 100644 (file)
@@ -27,7 +27,6 @@ import com.intellij.patterns.PsiJavaPatterns;
 import com.intellij.psi.*;
 import com.intellij.psi.filters.ClassFilter;
 import com.intellij.psi.filters.ElementFilter;
-import com.intellij.psi.filters.FilterPositionUtil;
 import com.intellij.psi.filters.TrueFilter;
 import com.intellij.psi.filters.classes.ThisOrAnyInnerFilter;
 import com.intellij.psi.filters.element.ExcludeDeclaredFilter;
@@ -52,49 +51,6 @@ public class JavaClassNameCompletionContributor extends CompletionContributor {
           psiElement(PsiReferenceList.class).withParent(PsiTypeParameter.class));
   private static final PsiJavaElementPattern.Capture<PsiElement> INSIDE_METHOD_THROWS_CLAUSE = psiElement().afterLeaf(PsiKeyword.THROWS, ",").inside(
       PsiMethod.class).andNot(psiElement().inside(PsiCodeBlock.class)).andNot(psiElement().inside(PsiParameterList.class));
-  private static final InsertHandler<JavaPsiClassReferenceElement> JAVA_CLASS_INSERT_HANDLER = new InsertHandler<JavaPsiClassReferenceElement>() {
-    public void handleInsert(final InsertionContext context, final JavaPsiClassReferenceElement item) {
-      context.setAddCompletionChar(false);
-      int offset = context.getTailOffset() - 1;
-      final PsiFile file = context.getFile();
-      if (PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiImportStatementBase.class, false) != null) {
-        final PsiJavaCodeReferenceElement ref = PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiJavaCodeReferenceElement.class, false);
-        final String qname = item.getQualifiedName();
-        if (qname != null && (ref == null || !qname.equals(ref.getCanonicalText()))) {
-          AllClassesGetter.INSERT_FQN.handleInsert(context, item);
-        }
-        return;
-      }
-
-      if (completingRawConstructor(context, item) && !JavaCompletionUtil.hasAccessibleInnerClass(item.getObject(), file)) {
-        ConstructorInsertHandler.insertParentheses(context, item, item.getObject());
-        DefaultInsertHandler.addImportForItem(context.getFile(), context.getStartOffset(), item);
-      } else {
-        new DefaultInsertHandler().handleInsert(context, item);
-      }
-    }
-
-    private boolean completingRawConstructor(InsertionContext context, JavaPsiClassReferenceElement item) {
-      final PsiJavaCodeReferenceElement ref = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiJavaCodeReferenceElement.class, false);
-      final PsiElement prevElement = FilterPositionUtil.searchNonSpaceNonCommentBack(ref);
-      if (prevElement != null && prevElement.getParent() instanceof PsiNewExpression) {
-        PsiTypeParameter[] typeParameters = item.getObject().getTypeParameters();
-        for (ExpectedTypeInfo info : ExpectedTypesProvider.getExpectedTypes((PsiExpression) prevElement.getParent(), true)) {
-          final PsiType type = info.getType();
-
-          if (info.isArrayTypeInfo()) {
-            return false;
-          }
-          if (typeParameters.length > 0 && type instanceof PsiClassType && !((PsiClassType)type).isRaw()) {
-            return false;
-          }
-        }
-        return true;
-      }
-
-      return false;
-    }
-  };
 
   public JavaClassNameCompletionContributor() {
     extend(CompletionType.CLASS_NAME, psiElement(), new CompletionProvider<CompletionParameters>() {
@@ -150,7 +106,7 @@ public class JavaClassNameCompletionContributor extends CompletionContributor {
   }
 
   public static JavaPsiClassReferenceElement createClassLookupItem(final PsiClass psiClass, final boolean inJavaContext) {
-    return AllClassesGetter.createLookupItem(psiClass, inJavaContext ? JAVA_CLASS_INSERT_HANDLER : AllClassesGetter.TRY_SHORTENING);
+    return AllClassesGetter.createLookupItem(psiClass, inJavaContext ? JavaClassNameInsertHandler.JAVA_CLASS_INSERT_HANDLER : AllClassesGetter.TRY_SHORTENING);
   }
 
   @Override
diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java b/java/java-impl/src/com/intellij/codeInsight/completion/JavaClassNameInsertHandler.java
new file mode 100644 (file)
index 0000000..1ad49a9
--- /dev/null
@@ -0,0 +1,183 @@
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.intellij.codeInsight.completion;
+
+import com.intellij.codeInsight.AutoPopupController;
+import com.intellij.codeInsight.ExpectedTypeInfo;
+import com.intellij.codeInsight.ExpectedTypesProvider;
+import com.intellij.codeInsight.lookup.LookupElement;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.editor.Document;
+import com.intellij.openapi.editor.Editor;
+import com.intellij.openapi.editor.ex.EditorEx;
+import com.intellij.openapi.editor.highlighter.HighlighterIterator;
+import com.intellij.openapi.project.Project;
+import com.intellij.psi.*;
+import com.intellij.psi.filters.FilterPositionUtil;
+import com.intellij.psi.javadoc.PsiDocTag;
+import com.intellij.psi.util.PsiTreeUtil;
+
+/**
+* @author peter
+*/
+class JavaClassNameInsertHandler implements InsertHandler<JavaPsiClassReferenceElement> {
+  private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.completion.JavaClassNameInsertHandler");
+  static final InsertHandler<JavaPsiClassReferenceElement> JAVA_CLASS_INSERT_HANDLER = new JavaClassNameInsertHandler();
+
+  public void handleInsert(final InsertionContext context, final JavaPsiClassReferenceElement item) {
+    final char c = context.getCompletionChar();
+
+    if (c != '.' && c != ' ' && c != '#') {
+      context.setAddCompletionChar(false);
+    }
+
+    int offset = context.getTailOffset() - 1;
+    final PsiFile file = context.getFile();
+    if (PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiImportStatementBase.class, false) != null) {
+      final PsiJavaCodeReferenceElement ref = PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiJavaCodeReferenceElement.class, false);
+      final String qname = item.getQualifiedName();
+      if (qname != null && (ref == null || !qname.equals(ref.getCanonicalText()))) {
+        AllClassesGetter.INSERT_FQN.handleInsert(context, item);
+      }
+      return;
+    }
+
+    PsiElement position = file.findElementAt(offset);
+    PsiClass psiClass = item.getObject();
+    final Project project = context.getProject();
+    final boolean annotation = insertingAnnotation(context, item);
+
+    final Editor editor = context.getEditor();
+    if (c == '#') {
+      context.setLaterRunnable(new Runnable() {
+        public void run() {
+          new CodeCompletionHandlerBase(CompletionType.BASIC).invoke(project, editor, file);
+        }
+      });
+    }
+
+    if (position != null) {
+      PsiElement parent = position.getParent();
+      if (parent instanceof PsiJavaCodeReferenceElement) {
+        final PsiJavaCodeReferenceElement ref = (PsiJavaCodeReferenceElement)parent;
+        if (PsiTreeUtil.getParentOfType(position, PsiDocTag.class) != null) {
+          if (ref.isReferenceTo(psiClass)) {
+            return;
+          }
+        }
+        final PsiReferenceParameterList parameterList = ref.getParameterList();
+        if (parameterList != null && parameterList.getTextLength() > 0) {
+          return;
+        }
+      }
+    }
+
+    if (completingRawConstructor(context, item) && !JavaCompletionUtil.hasAccessibleInnerClass(psiClass, file)) {
+      if (ConstructorInsertHandler.insertParentheses(context, item, psiClass)) {
+        AutoPopupController.getInstance(project).autoPopupParameterInfo(editor, null);
+      }
+    }
+    else if (insertingAnnotationWithParameters(context, item)) {
+      JavaCompletionUtil.insertParentheses(context, item, false, true);
+      AutoPopupController.getInstance(project).autoPopupParameterInfo(editor, null);
+    }
+    DefaultInsertHandler.addImportForItem(context.getFile(), context.getStartOffset(), item);
+
+    if (annotation) {
+      // Check if someone inserts annotation class that require @
+      PsiElement elementAt = file.findElementAt(context.getStartOffset());
+      final PsiElement parentElement = elementAt != null ? elementAt.getParent():null;
+
+      if (elementAt instanceof PsiIdentifier &&
+          (PsiTreeUtil.getParentOfType(elementAt, PsiAnnotationParameterList.class) != null ||
+           parentElement instanceof PsiErrorElement && parentElement.getParent() instanceof PsiJavaFile // top level annotation without @
+          )
+          && isAtTokenNeeded(context)) {
+        int expectedOffsetForAtToken = elementAt.getTextRange().getStartOffset();
+        context.getDocument().insertString(expectedOffsetForAtToken, "@");
+      }
+    }
+
+  }
+
+  private static boolean completingRawConstructor(InsertionContext context, JavaPsiClassReferenceElement item) {
+    final PsiJavaCodeReferenceElement ref = PsiTreeUtil.findElementOfClassAtOffset(context.getFile(), context.getStartOffset(), PsiJavaCodeReferenceElement.class, false);
+    final PsiElement prevElement = FilterPositionUtil.searchNonSpaceNonCommentBack(ref);
+    if (prevElement != null && prevElement.getParent() instanceof PsiNewExpression) {
+      PsiTypeParameter[] typeParameters = item.getObject().getTypeParameters();
+      for (ExpectedTypeInfo info : ExpectedTypesProvider.getExpectedTypes((PsiExpression)prevElement.getParent(), true)) {
+        final PsiType type = info.getType();
+
+        if (info.isArrayTypeInfo()) {
+          return false;
+        }
+        if (typeParameters.length > 0 && type instanceof PsiClassType && !((PsiClassType)type).isRaw()) {
+          return false;
+        }
+      }
+      return true;
+    }
+
+    return false;
+  }
+
+  private static boolean insertingAnnotationWithParameters(InsertionContext context, LookupElement item) {
+    if(insertingAnnotation(context, item)) {
+      final Document document = context.getEditor().getDocument();
+      PsiDocumentManager.getInstance(context.getProject()).commitDocument(document);
+      PsiElement elementAt = context.getFile().findElementAt(context.getStartOffset());
+      if (elementAt instanceof PsiIdentifier) {
+        final PsiModifierListOwner parent = PsiTreeUtil.getParentOfType(elementAt, PsiModifierListOwner.class, false, PsiCodeBlock.class);
+        if (parent != null) {
+          for (PsiMethod m : ((PsiClass)item.getObject()).getMethods()) {
+            if (!(m instanceof PsiAnnotationMethod)) continue;
+            final PsiAnnotationMemberValue defaultValue = ((PsiAnnotationMethod)m).getDefaultValue();
+            if (defaultValue == null) return true;
+          }
+        }
+      }
+    }
+    return false;
+  }
+
+  private static boolean insertingAnnotation(InsertionContext context, LookupElement item) {
+    final Object obj = item.getObject();
+    if (!(obj instanceof PsiClass) || !((PsiClass)obj).isAnnotationType()) return false;
+
+    final Document document = context.getEditor().getDocument();
+    PsiDocumentManager.getInstance(context.getProject()).commitDocument(document);
+    final int offset = context.getStartOffset();
+
+    final PsiFile file = context.getFile();
+
+    if (PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiImportStatement.class, false) != null) return false;
+
+    //outside of any class: we are surely inserting an annotation
+    if (PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiClass.class, false) == null) return true;
+
+    //the easiest check that there's a @ before the identifier
+    return PsiTreeUtil.findElementOfClassAtOffset(file, offset, PsiAnnotation.class, false) != null;
+
+  }
+
+  private static boolean isAtTokenNeeded(InsertionContext myContext) {
+    HighlighterIterator iterator = ((EditorEx)myContext.getEditor()).getHighlighter().createIterator(myContext.getStartOffset());
+    LOG.assertTrue(iterator.getTokenType() == JavaTokenType.IDENTIFIER);
+    iterator.retreat();
+    if (iterator.getTokenType() == TokenType.WHITE_SPACE) iterator.retreat();
+    return iterator.getTokenType() != JavaTokenType.AT && iterator.getTokenType() != JavaTokenType.DOT;
+  }
+}
index 5ff788e71fbee6ed22f719a90dce64637f11c044..6392f64629b69a8fd9323712f75bc7b12be94e66 100644 (file)
@@ -193,8 +193,7 @@ public class JavaCompletionContributor extends CompletionContributor {
     addKeywords(parameters, result);
 
     if (shouldRunClassNameCompletion(result, position)) {
-      result.runRemainingContributors(
-        new CompletionParameters(position, parameters.getOriginalFile(), CompletionType.CLASS_NAME, parameters.getOffset(), parameters.getInvocationCount()),
+      result.runRemainingContributors(parameters.withType(CompletionType.CLASS_NAME),
         new Consumer<LookupElement>() {
           @Override
           public void consume(LookupElement lookupElement) {
index 8b07edc1ab5b795b09284e0f0e67ae9e40bcc0d2..72914bc2a6c58cbbe199a68b3c76b5d8b531cd4d 100644 (file)
@@ -318,23 +318,27 @@ public class JavaCompletionUtil {
 
     final PsiReference reference = file.findReferenceAt(selectionEndOffset);
     if(reference != null) {
+      /*
       if(reference instanceof PsiJavaCodeReferenceElement){
         offsetMap.addOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET, element.getParent().getTextRange().getEndOffset());
       }
       else{
-        offsetMap.addOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET,
-                                 reference.getElement().getTextRange().getStartOffset() + reference.getRangeInElement().getEndOffset());
       }
+      */
+      offsetMap.addOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET,
+                          reference.getElement().getTextRange().getStartOffset() + reference.getRangeInElement().getEndOffset());
 
       element = file.findElementAt(offsetMap.getOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET));
     }
     else if (isWord(element)){
+      /*
       if(element instanceof PsiIdentifier && element.getParent() instanceof PsiJavaCodeReferenceElement){
         offsetMap.addOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET, element.getParent().getTextRange().getEndOffset());
       }
       else{
-        offsetMap.addOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET, element.getTextRange().getEndOffset());
       }
+      */
+      offsetMap.addOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET, element.getTextRange().getEndOffset());
 
       element = file.findElementAt(offsetMap.getOffset(CompletionInitializationContext.IDENTIFIER_END_OFFSET));
       if (element == null) return;
@@ -683,6 +687,7 @@ public class JavaCompletionUtil {
             document.insertString(exprStart, prefix + spaceWithin + ")" + spaceAfter);
 
             CompletionUtil.emulateInsertion(context, exprStart + prefix.length(), to);
+            context.getEditor().getCaretModel().moveToOffset(context.getTailOffset());
           }
         }
 
index a152036ff12e241137bffd2c61b14c7468e8ffa8..1ae1ce9513ff3dca05cfba93c9c3d04157e9640a 100644 (file)
@@ -20,24 +20,19 @@ import com.intellij.psi.*;
 import com.intellij.psi.javadoc.PsiDocComment;
 import com.intellij.psi.util.PsiTreeUtil;
 import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
 
 /**
  * @author peter
  */
 public class StaticMembersWeigher extends CompletionWeigher {
   public Comparable weigh(@NotNull LookupElement element, @NotNull CompletionLocation loc) {
-    if (loc == null) {
-      return null;
-    }
     if (loc.getCompletionType() != CompletionType.BASIC) return 0;
 
-    final PsiElement position = loc.getCompletionParameters().getPosition();
-
     // cheap weigher applicability goes first
     final Object o = element.getObject();
     if (!(o instanceof PsiMember)) return 0;
-    
+
+    final PsiElement position = loc.getCompletionParameters().getPosition();
     if (PsiTreeUtil.getParentOfType(position, PsiDocComment.class) != null) return 0;
     if (position.getParent() instanceof PsiReferenceExpression) {
       final PsiReferenceExpression refExpr = (PsiReferenceExpression)position.getParent();
@@ -55,7 +50,8 @@ public class StaticMembersWeigher extends CompletionWeigher {
       if (o instanceof PsiField) return 4;
     }
 
-    if (o instanceof PsiClass && ((PsiClass) o).getContainingClass() != null) {
+    if (o instanceof PsiClass) {
+      //if (((PsiClass) o).getContainingClass() != null) return 2;
       return 3;
     }
 
index 5049e9da92351abf676b3fa73f478f6929a19660..f4a06332f0f1be33763ea7e77b5ca3fb9e485086 100644 (file)
@@ -28,9 +28,13 @@ import com.intellij.codeInsight.daemon.impl.analysis.HighlightMethodUtil;
 import com.intellij.codeInsight.daemon.impl.analysis.HighlightUtil;
 import com.intellij.codeInsight.daemon.impl.quickfix.*;
 import com.intellij.codeInsight.intention.EmptyIntentionAction;
+import com.intellij.codeInsight.intention.IntentionAction;
+import com.intellij.codeInsight.intention.IntentionManager;
 import com.intellij.codeInspection.InspectionProfile;
+import com.intellij.codeInspection.InspectionProfileEntry;
 import com.intellij.codeInspection.InspectionsBundle;
 import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
+import com.intellij.codeInspection.ex.GlobalInspectionToolWrapper;
 import com.intellij.codeInspection.ex.InspectionManagerEx;
 import com.intellij.codeInspection.ex.LocalInspectionToolWrapper;
 import com.intellij.codeInspection.unusedImport.UnusedImportLocalInspection;
@@ -77,10 +81,7 @@ import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.annotations.PropertyKey;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 public class PostHighlightingPass extends TextEditorHighlightingPass {
   private static final Logger LOG = Logger.getInstance("#com.intellij.codeInsight.daemon.impl.PostHighlightingPass");
@@ -103,6 +104,7 @@ public class PostHighlightingPass extends TextEditorHighlightingPass {
   private boolean myInLibrary;
   private HighlightDisplayKey myDeadCodeKey;
   private HighlightInfoType myDeadCodeInfoType;
+  private UnusedParametersInspection myUnusedParametersInspection;
 
   PostHighlightingPass(@NotNull Project project,
                        @NotNull PsiFile file,
@@ -220,6 +222,10 @@ public class PostHighlightingPass extends TextEditorHighlightingPass {
     myDeadCodeKey = HighlightDisplayKey.find(UnusedDeclarationInspection.SHORT_NAME);
     myDeadCodeInspection = (UnusedDeclarationInspection)profile.getInspectionTool(UnusedDeclarationInspection.SHORT_NAME, myFile);
     myDeadCodeEnabled = profile.isToolEnabled(myDeadCodeKey, myFile);
+
+    final InspectionProfileEntry inspectionTool = profile.getInspectionTool(UnusedParametersInspection.SHORT_NAME, myFile);
+    myUnusedParametersInspection = inspectionTool != null ?  (UnusedParametersInspection)((GlobalInspectionToolWrapper)inspectionTool).getTool() : null;
+    LOG.assertTrue(ApplicationManager.getApplication().isUnitTestMode() || myUnusedParametersInspection != null);
     if (unusedImportEnabled && JspPsiUtil.isInJspFile(myFile)) {
       final JspFile jspFile = JspPsiUtil.getJspFile(myFile);
       if (jspFile != null) {
@@ -430,7 +436,14 @@ public class PostHighlightingPass extends TextEditorHighlightingPass {
           !PsiClassImplUtil.isMainMethod(method)) {
         HighlightInfo highlightInfo = checkUnusedParameter(parameter, progress);
         if (highlightInfo != null) {
-          QuickFixAction.registerQuickFixAction(highlightInfo, new RemoveUnusedParameterFix(parameter), myUnusedSymbolKey);
+          final ArrayList<IntentionAction> options = new ArrayList<IntentionAction>();
+          options.addAll(IntentionManager.getInstance().getStandardIntentionOptions(myUnusedSymbolKey, myFile));
+          if (myUnusedParametersInspection != null) {
+            Collections.addAll(options, myUnusedParametersInspection.getSuppressActions(parameter));
+          }
+          //need suppress from Unused Parameters but settings from Unused Symbol
+          QuickFixAction.registerQuickFixAction(highlightInfo, new RemoveUnusedParameterFix(parameter),
+                                                options, HighlightDisplayKey.getDisplayNameByKey(myUnusedSymbolKey));
           return highlightInfo;
         }
       }
index b1bcb2f2c529a3c116efac4093a509f010591ba6..0cf6aa37bedfeefab512567e145b8ef13a129c02 100644 (file)
@@ -26,7 +26,7 @@ import com.intellij.openapi.util.TextRange;
 import com.intellij.psi.*;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.psi.util.TypeConversionUtil;
-import com.intellij.refactoring.introduceVariable.PsiExpressionTrimRenderer;
+import com.intellij.psi.util.PsiExpressionTrimRenderer;
 import com.intellij.util.IncorrectOperationException;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
index 9e80437e43a9e8990779fe7a3d790f9cf31619d1..c81b0044d9292443e5b0dfed56d9207c96a904db 100644 (file)
@@ -36,6 +36,7 @@ import com.intellij.psi.codeStyle.SuggestedNameInfo;
 import com.intellij.psi.codeStyle.VariableKind;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
+import com.intellij.refactoring.JavaRefactoringSettings;
 import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
 import org.jetbrains.annotations.NotNull;
@@ -196,6 +197,15 @@ public class CreateLocalVarFromInstanceofAction extends BaseIntentionAction {
     cast.getCastType().replace(factory.createTypeElement(castType));
     cast.getOperand().replace(instanceOfExpression.getOperand());
     PsiDeclarationStatement decl = factory.createVariableDeclarationStatement("xxx", castType, cast);
+    final Boolean createFinals = JavaRefactoringSettings.getInstance().INTRODUCE_LOCAL_CREATE_FINALS;
+    if (createFinals != null) {
+      final PsiElement[] declaredElements = decl.getDeclaredElements();
+      LOG.assertTrue(declaredElements.length == 1);
+      LOG.assertTrue(declaredElements[0] instanceof PsiLocalVariable);
+      final PsiModifierList modifierList = ((PsiLocalVariable)declaredElements[0]).getModifierList();
+      LOG.assertTrue(modifierList != null);
+      modifierList.setModifierProperty(PsiModifier.FINAL, createFinals.booleanValue());
+    }
     PsiDeclarationStatement element = (PsiDeclarationStatement)insertAtAnchor(instanceOfExpression, decl);
     return CodeInsightUtilBase.forcePsiPostprocessAndRestoreElement(element);
   }
index 081d6a4d70e25bf956da9e4cd872ce7f65d36a93..306bc2aa43c798f05ddaddaf722b4b681160f6d3 100644 (file)
@@ -29,7 +29,6 @@ import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Document;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.RangeMarker;
-import com.intellij.openapi.editor.ex.RangeMarkerEx;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.Pair;
@@ -38,7 +37,6 @@ import com.intellij.psi.*;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.util.PsiUtil;
 import com.intellij.refactoring.util.FieldConflictsResolver;
-import com.intellij.refactoring.util.RefactoringUtil;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.Processor;
 import com.intellij.util.containers.ContainerUtil;
@@ -214,6 +212,7 @@ public class CreateMethodFromUsageFix extends CreateFromUsageBaseFix {
     final Project project = targetClass.getProject();
     final PsiFile targetFile = targetClass.getContainingFile();
     Document document = PsiDocumentManager.getInstance(project).getDocument(targetFile);
+    if (document == null) return;
 
     TemplateBuilderImpl builder = new TemplateBuilderImpl(method);
 
@@ -225,7 +224,6 @@ public class CreateMethodFromUsageFix extends CreateFromUsageBaseFix {
     method = CodeInsightUtilBase.forcePsiPostprocessAndRestoreElement(method);
     if (method == null) return;
 
-    assert document != null;
     RangeMarker rangeMarker = document.createRangeMarker(method.getTextRange());
     final Editor newEditor = positionCursor(project, targetFile, method);
     Template template = builder.buildTemplate();
index cb10963d4a2c79db04fe0ba151fa6b01b823eb95..4ca1412a9e6fd00249a8114e2d94b2a8704ae3c6 100644 (file)
@@ -82,12 +82,9 @@ public class GenerateConstructorHandler extends GenerateMembersHandlerBase {
     PsiClass baseClass = aClass.getSuperClass();
     if (baseClass != null){
       ArrayList<PsiMethod> array = new ArrayList<PsiMethod>();
-      PsiMethod[] methods = baseClass.getMethods();
-      for (PsiMethod method : methods) {
-        if (method.isConstructor()) {
-          if (JavaPsiFacade.getInstance(method.getProject()).getResolveHelper().isAccessible(method, aClass, aClass)) {
-            array.add(method);
-          }
+      for (PsiMethod method : baseClass.getConstructors()) {
+        if (JavaPsiFacade.getInstance(method.getProject()).getResolveHelper().isAccessible(method, aClass, aClass)) {
+          array.add(method);
         }
       }
       if (!array.isEmpty()){
index 842201b24bed16b28c84fc5036ff693d1ca9d1c8..a5b07554a1309ff999f5afe2c78544e4b44197ac 100644 (file)
@@ -74,7 +74,7 @@ public class JavaDocExternalFilter {
   @NonNls private static final String HR = "<HR>";
   @NonNls private static final String P = "<P>";
   @NonNls private static final String DL = "<DL>";
-  @NonNls private static final String H2 = "</H2>";
+  @NonNls protected static final String H2 = "</H2>";
   @NonNls protected static final String HTML_CLOSE = "</HTML>";
   @NonNls protected static final String HTML = "<HTML>";
   @NonNls private static final String BR = "<BR>";
index 8580bec1c3989721c21b725e4b01779a73fdfdf1..6f56bc39b7f0d429f544e71f2b9f3a31e38848f6 100644 (file)
@@ -807,6 +807,9 @@ public class JavaDocInfoGenerator {
                   "            background-color: #eeeeee;" +
                   "            margin-bottom: 10px;" +
                   "        }" +
+                  "        p {" +
+                  "            margin: 5px 0;" +
+                  "        }" +
                   "    </style>" +
                   "</head><body>");
   }
index 9b7400e96b3266d02769ae2c799fef4e9913ce30..a5a2dbe3f58e4427a49cde85f1c9bf839b527366 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.psi.*;
 import com.intellij.psi.util.PsiTreeUtil;
 import org.jetbrains.annotations.Nls;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 public class FieldAccessNotGuardedInspection extends BaseJavaLocalInspectionTool {
 
@@ -68,11 +69,25 @@ public class FieldAccessNotGuardedInspection extends BaseJavaLocalInspectionTool
       if (containingMethod != null && JCiPUtil.isGuardedBy(containingMethod, guard)) {
         return;
       }
+      if (containingMethod != null && containingMethod.isConstructor()) {
+        return;
+      }
       if ("this".equals(guard)) {
         if (containingMethod != null && containingMethod.hasModifierProperty(PsiModifier.SYNCHRONIZED)) {
           return;
         }
       }
+
+      PsiElement lockExpr = findLockTryStatement(expression, guard);
+      while (lockExpr != null) {
+        PsiElement child = lockExpr;
+        while (child != null) {
+          if (isLockGuardStatement(guard, child, "lock")) return;
+          child = child.getPrevSibling();
+        }
+        lockExpr = lockExpr.getParent();
+      }
+
       PsiElement check = expression;
       while (true) {
         final PsiSynchronizedStatement syncStatement = PsiTreeUtil.getParentOfType(check, PsiSynchronizedStatement.class);
@@ -86,8 +101,41 @@ public class FieldAccessNotGuardedInspection extends BaseJavaLocalInspectionTool
         }
         check = syncStatement;
       }
-      //TODO: see if there is a lock via a .lock* call
       myHolder.registerProblem(expression, "Access to field <code>#ref</code> outside of declared guards #loc");
     }
+
+    @Nullable
+    private static PsiTryStatement findLockTryStatement(PsiReferenceExpression expression, String guard) {
+      PsiTryStatement tryStatement = PsiTreeUtil.getParentOfType(expression, PsiTryStatement.class);
+      while (tryStatement != null) {
+        PsiCodeBlock finallyBlock = tryStatement.getFinallyBlock();
+        if (finallyBlock != null) {
+          for (PsiStatement psiStatement : finallyBlock.getStatements()) {
+            if (isLockGuardStatement(guard, psiStatement, "unlock")) {
+              return tryStatement;
+            }
+          }
+        }
+        tryStatement = PsiTreeUtil.getParentOfType(tryStatement, PsiTryStatement.class);
+      }
+      return tryStatement;
+    }
+
+    private static boolean isLockGuardStatement(String guard, PsiElement element, final String lockMethodStart) {
+      if (element instanceof PsiExpressionStatement) {
+        final PsiExpression psiExpression = ((PsiExpressionStatement)element).getExpression();
+        if (psiExpression instanceof PsiMethodCallExpression) {
+          final PsiReferenceExpression methodExpression = ((PsiMethodCallExpression)psiExpression).getMethodExpression();
+          final PsiExpression qualifierExpression = methodExpression.getQualifierExpression();
+          if (qualifierExpression != null && qualifierExpression.getText().equals(guard)) {
+            final PsiElement resolve = methodExpression.resolve();
+            if (resolve instanceof PsiMethod && ((PsiMethod)resolve).getName().startsWith(lockMethodStart)) {
+              return true;
+            }
+          }
+        }
+      }
+      return false;
+    }
   }
 }
\ No newline at end of file
index f6856f608435dbd4d2d2427db8bb36fdffc2f6d0..1e8bec0b4067a0ab2f491823d7196bfc15efc230 100644 (file)
@@ -29,10 +29,7 @@ import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Comparing;
-import com.intellij.openapi.util.Condition;
-import com.intellij.openapi.util.JDOMExternalizableStringList;
-import com.intellij.openapi.util.Pair;
+import com.intellij.openapi.util.*;
 import com.intellij.psi.*;
 import com.intellij.psi.search.searches.AllOverridingMethodsSearch;
 import com.intellij.psi.util.PsiTreeUtil;
@@ -40,6 +37,7 @@ import com.intellij.refactoring.safeDelete.SafeDeleteHandler;
 import com.intellij.util.Processor;
 import com.intellij.util.Query;
 import com.intellij.util.containers.BidirectionalMap;
+import org.jdom.Element;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -59,7 +57,7 @@ public class EmptyMethodInspection extends GlobalJavaInspectionTool {
 
   private final BidirectionalMap<Boolean, QuickFix> myQuickFixes = new BidirectionalMap<Boolean, QuickFix>();
 
-  private final JDOMExternalizableStringList EXCLUDE_ANNOS = new JDOMExternalizableStringList();
+  public final JDOMExternalizableStringList EXCLUDE_ANNOS = new JDOMExternalizableStringList();
   @NonNls private static final String QUICK_FIX_NAME = InspectionsBundle.message("inspection.empty.method.delete.quickfix");
   private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.emptyMethod.EmptyMethodInspection");
 
@@ -239,6 +237,13 @@ public class EmptyMethodInspection extends GlobalJavaInspectionTool {
     return SHORT_NAME;
   }
 
+  @Override
+  public void writeSettings(Element node) throws WriteExternalException {
+    if (!EXCLUDE_ANNOS.isEmpty()) {
+      super.writeSettings(node);
+    }
+  }
+
   private LocalQuickFix getFix(final ProblemDescriptionsProcessor processor, final boolean needToDeleteHierarchy) {
     QuickFix fix = myQuickFixes.get(needToDeleteHierarchy);
     if (fix == null) {
index 4bcff1c8454b6872e13141dc235ff3d60efeb03e..15d5d90eda14d7d307ac048d01d9caa342ad5eb7 100644 (file)
@@ -129,17 +129,19 @@ public class EntryPointsManagerImpl implements PersistentStateComponent<Element>
   @SuppressWarnings({"HardCodedStringLiteral"})
   public void loadState(Element element) {
     Element entryPointsElement = element.getChild("entry_points");
-    final String version = entryPointsElement.getAttributeValue(VERSION_ATTR);
-    if (!Comparing.strEqual(version, VERSION)) {
-      convert(entryPointsElement, myPersistentEntryPoints);
-    }
-    else {
-      List content = entryPointsElement.getChildren();
-      for (final Object aContent : content) {
-        Element entryElement = (Element)aContent;
-        if (ENTRY_POINT_ATTR.equals(entryElement.getName())) {
-          SmartRefElementPointerImpl entryPoint = new SmartRefElementPointerImpl(entryElement);
-          myPersistentEntryPoints.put(entryPoint.getFQName(), entryPoint);
+    if (entryPointsElement != null) {
+      final String version = entryPointsElement.getAttributeValue(VERSION_ATTR);
+      if (!Comparing.strEqual(version, VERSION)) {
+        convert(entryPointsElement, myPersistentEntryPoints);
+      }
+      else {
+        List content = entryPointsElement.getChildren();
+        for (final Object aContent : content) {
+          Element entryElement = (Element)aContent;
+          if (ENTRY_POINT_ATTR.equals(entryElement.getName())) {
+            SmartRefElementPointerImpl entryPoint = new SmartRefElementPointerImpl(entryElement);
+            myPersistentEntryPoints.put(entryPoint.getFQName(), entryPoint);
+          }
         }
       }
     }
@@ -342,7 +344,7 @@ public class EntryPointsManagerImpl implements PersistentStateComponent<Element>
 
   @Override
   public void configureAnnotations() {
-    final JPanel listPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(ADDITIONAL_ANNOTATIONS, "Do not check if annotated by");
+    final JPanel listPanel = SpecialAnnotationsUtil.createSpecialAnnotationsListControl(ADDITIONAL_ANNOTATIONS, "Do not check if annotated by", true);
     new DialogWrapper(myProject) {
       {
         init();
index 533ef29deeb0def56f476c599799af880d686e29..0e71f8d95d437d2f9ef4d07e7f28230ff2f774ea 100644 (file)
@@ -38,7 +38,7 @@ public class RefFieldImpl extends RefJavaElementImpl implements RefField {
   private static final int ASSIGNED_ONLY_IN_INITIALIZER = 0x40000;
 
   RefFieldImpl(PsiField field, RefManager manager) {
-      this((RefClass) manager.getReference(field.getContainingClass()), field, manager);
+    this((RefClass)((RefManagerImpl)manager).getReference(field.getContainingClass(), true), field, manager);
   }
 
   RefFieldImpl(RefClass ownerClass, PsiField field, RefManager manager) {
index babae2d55058c9cf5cfb55a81b0c880f20b5a08c..28f1f4878ac80163628373f22d6dd692c39201c7 100644 (file)
@@ -63,7 +63,7 @@ public class RefMethodImpl extends RefJavaElementImpl implements RefMethod {
   protected final RefClass myOwnerClass;
 
   RefMethodImpl(PsiMethod method, RefManager manager) {
-      this((RefClass) manager.getReference(method.getContainingClass()), method,  manager);
+    this((RefClass)((RefManagerImpl)manager).getReference(method.getContainingClass(), true), method, manager);
   }
 
   RefMethodImpl(RefClass ownerClass, PsiMethod method, RefManager manager) {
index 18a90051681589c80f8dfb80bbd35e4438884627..2d89664d95683259d3498309b5798dacb99a4176 100644 (file)
@@ -24,17 +24,21 @@ import com.intellij.codeInspection.LocalQuickFix;
 import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.ex.InspectionProfileImpl;
 import com.intellij.codeInspection.unusedSymbol.UnusedSymbolLocalInspection;
-import com.intellij.openapi.actionSystem.ActionManager;
-import com.intellij.openapi.actionSystem.ActionPlaces;
-import com.intellij.openapi.actionSystem.ActionToolbar;
-import com.intellij.openapi.actionSystem.DefaultActionGroup;
+import com.intellij.ide.DataManager;
+import com.intellij.ide.util.ClassFilter;
+import com.intellij.ide.util.TreeClassChooser;
+import com.intellij.ide.util.TreeClassChooserFactory;
+import com.intellij.openapi.actionSystem.*;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.project.Project;
+import com.intellij.openapi.project.ProjectManager;
 import com.intellij.openapi.ui.Messages;
 import com.intellij.openapi.util.Factory;
+import com.intellij.openapi.util.IconLoader;
 import com.intellij.profile.codeInspection.InspectionProfileManager;
 import com.intellij.profile.codeInspection.InspectionProjectProfileManager;
 import com.intellij.psi.*;
+import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.ui.ReorderableListController;
 import com.intellij.ui.ScrollPaneFactory;
 import com.intellij.ui.SeparatorFactory;
@@ -58,6 +62,10 @@ import java.util.List;
  */
 public class SpecialAnnotationsUtil {
   public static JPanel createSpecialAnnotationsListControl(final List<String> list, final String borderTitle) {
+    return createSpecialAnnotationsListControl(list, borderTitle, false);
+  }
+
+  public static JPanel createSpecialAnnotationsListControl(final List<String> list, final String borderTitle, final boolean acceptPatterns) {
     final SortedListModel<String> listModel = new SortedListModel<String>(new Comparator<String>() {
       public int compare(final String o1, final String o2) {
         return o1.compareTo(o2);
@@ -72,11 +80,36 @@ public class SpecialAnnotationsUtil {
     final ReorderableListController<String> controller = ReorderableListController.create(injectionList, actionGroup);
     controller.addAddAction(InspectionsBundle.message("special.annotations.list.add.annotation.class"), new Factory<String>() {
       public String create() {
-        return Messages.showInputDialog(InspectionsBundle.message("special.annotations.list.annotation.class"),
-                                        InspectionsBundle.message("special.annotations.list.add.annotation.class"),
-                                        Messages.getQuestionIcon());
+        Project project = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(injectionList));
+        if (project == null) project = ProjectManager.getInstance().getDefaultProject();
+        TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
+          .createWithInnerClassesScopeChooser(InspectionsBundle.message("special.annotations.list.annotation.class"),
+                                              GlobalSearchScope.allScope(project), new ClassFilter() {
+              @Override
+              public boolean isAccepted(PsiClass aClass) {
+                return aClass.isAnnotationType();
+              }
+            }, null);
+        chooser.showDialog();
+        final PsiClass selected = chooser.getSelected();
+        return selected != null ? selected.getQualifiedName() : null;
       }
     }, true);
+    if (acceptPatterns) {
+      controller.addAction(new AnAction(InspectionsBundle.message("special.annotations.list.annotation.pattern"),
+                                        InspectionsBundle.message("special.annotations.list.annotation.pattern"),
+                                        IconLoader.getIcon("/general/add.png")) {
+        @Override
+        public void actionPerformed(AnActionEvent e) {
+          String selectedPattern = Messages.showInputDialog(InspectionsBundle.message("special.annotations.list.annotation.pattern"),
+                                              InspectionsBundle.message("special.annotations.list.annotation.pattern"),
+                                              Messages.getQuestionIcon());
+          if (selectedPattern != null) {
+            listModel.add(selectedPattern);
+          }
+        }
+      });
+    }
     controller.addRemoveAction(InspectionsBundle.message("special.annotations.list.remove.annotation.class"));
     injectionList.getModel().addListDataListener(new ListDataListener() {
       public void intervalAdded(ListDataEvent e) {
@@ -86,7 +119,7 @@ public class SpecialAnnotationsUtil {
       private void listChanged() {
         list.clear();
         for (int i = 0; i < listModel.getSize(); i++) {
-            list.add((String)listModel.getElementAt(i));
+          list.add((String)listModel.getElementAt(i));
         }
       }
 
index c22da9f943d15fb6e076e0d3c824f88367b96ee0..cecb8c7231d54be9a371aa1e4f22e8b305723465 100644 (file)
@@ -15,6 +15,7 @@
  */
 package com.intellij.codeInspection.varScopeCanBeNarrowed;
 
+import com.intellij.codeInsight.AnnotationUtil;
 import com.intellij.codeInsight.CodeInsightUtil;
 import com.intellij.codeInsight.daemon.GroupNames;
 import com.intellij.codeInsight.daemon.ImplicitUsageProvider;
@@ -23,13 +24,16 @@ import com.intellij.codeInspection.LocalQuickFix;
 import com.intellij.codeInspection.ProblemDescriptor;
 import com.intellij.codeInspection.ProblemsHolder;
 import com.intellij.codeInspection.ex.BaseLocalInspectionTool;
+import com.intellij.codeInspection.util.SpecialAnnotationsUtil;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.editor.Editor;
 import com.intellij.openapi.editor.ScrollType;
 import com.intellij.openapi.extensions.Extensions;
 import com.intellij.openapi.fileEditor.FileEditorManager;
 import com.intellij.openapi.project.Project;
+import com.intellij.openapi.util.JDOMExternalizableStringList;
 import com.intellij.openapi.util.Ref;
+import com.intellij.openapi.util.WriteExternalException;
 import com.intellij.psi.*;
 import com.intellij.psi.codeStyle.JavaCodeStyleManager;
 import com.intellij.psi.codeStyle.VariableKind;
@@ -42,9 +46,13 @@ import com.intellij.util.IJSwingUtilities;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.util.containers.HashSet;
 import gnu.trove.THashSet;
+import org.jdom.Element;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
+import javax.swing.*;
+import java.awt.*;
 import java.util.Collection;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -57,6 +65,7 @@ public class FieldCanBeLocalInspection extends BaseLocalInspectionTool {
   private static final Logger LOG = Logger.getInstance("#com.intellij.codeInspection.varScopeCanBeNarrowed.FieldCanBeLocalInspection");
 
   @NonNls public static final String SHORT_NAME = "FieldCanBeLocal";
+  public final JDOMExternalizableStringList EXCLUDE_ANNOS = new JDOMExternalizableStringList();
 
   @NotNull
   public String getGroupDisplayName() {
@@ -73,6 +82,24 @@ public class FieldCanBeLocalInspection extends BaseLocalInspectionTool {
     return SHORT_NAME;
   }
 
+  @Override
+  public void writeSettings(Element node) throws WriteExternalException {
+    if (!EXCLUDE_ANNOS.isEmpty()) {
+      super.writeSettings(node);
+    }
+  }
+
+  @Nullable
+  @Override
+  public JComponent createOptionsPanel() {
+    final JPanel listPanel = SpecialAnnotationsUtil
+      .createSpecialAnnotationsListControl(EXCLUDE_ANNOS, InspectionsBundle.message("special.annotations.annotations.list"));
+
+    final JPanel panel = new JPanel(new BorderLayout(2, 2));
+    panel.add(listPanel, BorderLayout.NORTH);
+    return panel;
+  }
+
   @NotNull
   @Override
   public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder holder, final boolean isOnTheFly) {
@@ -84,17 +111,20 @@ public class FieldCanBeLocalInspection extends BaseLocalInspectionTool {
       @Override
       public void visitJavaFile(PsiJavaFile file) {
         for (PsiClass aClass : file.getClasses()) {
-          docheckClass(aClass, holder);
+          docheckClass(aClass, holder, EXCLUDE_ANNOS);
         }
       }
     };
   }
 
-  private static void docheckClass(final PsiClass aClass, ProblemsHolder holder) {
+  private static void docheckClass(final PsiClass aClass, ProblemsHolder holder, final List<String> excludeAnnos) {
     if (aClass.isInterface()) return;
     final PsiField[] fields = aClass.getFields();
     final Set<PsiField> candidates = new LinkedHashSet<PsiField>();
     for (PsiField field : fields) {
+      if (AnnotationUtil.isAnnotated(field, excludeAnnos)) {
+        continue;
+      }
       if (field.hasModifierProperty(PsiModifier.PRIVATE) && !(field.hasModifierProperty(PsiModifier.STATIC) && field.hasModifierProperty(PsiModifier.FINAL))) {
         candidates.add(field);
       }
index 3069e3852d43575b843dd0e99a6d3bb181884fd7..89fd090a246138c35954288e14ffac62b12b570f 100644 (file)
@@ -19,6 +19,9 @@
  */
 package com.intellij.ide.projectView.impl;
 
+import com.intellij.history.LocalHistory;
+import com.intellij.history.LocalHistoryAction;
+import com.intellij.ide.DeleteProvider;
 import com.intellij.ide.IdeBundle;
 import com.intellij.ide.SelectInTarget;
 import com.intellij.ide.impl.PackagesPaneSelectInTarget;
@@ -27,6 +30,7 @@ import com.intellij.ide.projectView.ViewSettings;
 import com.intellij.ide.projectView.impl.nodes.PackageElement;
 import com.intellij.ide.projectView.impl.nodes.PackageUtil;
 import com.intellij.ide.projectView.impl.nodes.PackageViewProjectNode;
+import com.intellij.ide.util.DeleteHandler;
 import com.intellij.ide.util.treeView.AbstractTreeBuilder;
 import com.intellij.ide.util.treeView.AbstractTreeNode;
 import com.intellij.ide.util.treeView.AbstractTreeStructure;
@@ -51,13 +55,12 @@ import org.jetbrains.annotations.Nullable;
 import javax.swing.*;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
+import java.util.*;
 
 public final class PackageViewPane extends AbstractProjectViewPSIPane {
   @NonNls public static final String ID = "PackagesPane";
   public static final Icon ICON = IconLoader.getIcon("/general/packagesTab.png");
+  private MyDeletePSIElementProvider myDeletePSIElementProvider = new MyDeletePSIElementProvider();
 
   public PackageViewPane(Project project) {
     super(project);
@@ -91,6 +94,12 @@ public final class PackageViewPane extends AbstractProjectViewPSIPane {
 
   @Override
   public Object getData(final String dataId) {
+    if (PlatformDataKeys.DELETE_ELEMENT_PROVIDER.is(dataId)) {
+      final PackageElement selectedPackageElement = getSelectedPackageElement();
+      if (selectedPackageElement != null) {
+        return myDeletePSIElementProvider;
+      }
+    }
     if (PackageElement.DATA_KEY.is(dataId)) {
       final PackageElement packageElement = getSelectedPackageElement();
     }
@@ -290,4 +299,30 @@ public final class PackageViewPane extends AbstractProjectViewPSIPane {
       return modules.toArray(new Module[modules.size()]);
     }
   }
+
+  private final class MyDeletePSIElementProvider implements DeleteProvider {
+    public boolean canDeleteElement(DataContext dataContext) {
+      for (PsiDirectory directory : getSelectedDirectories()) {
+        if (!directory.getManager().isInProject(directory)) return false;
+      }
+      return true;
+    }
+
+    public void deleteElement(DataContext dataContext) {
+      List<PsiDirectory> allElements = Arrays.asList(getSelectedDirectories());
+      List<PsiElement> validElements = new ArrayList<PsiElement>();
+      for (PsiElement psiElement : allElements) {
+        if (psiElement != null && psiElement.isValid()) validElements.add(psiElement);
+      }
+      final PsiElement[] elements = validElements.toArray(new PsiElement[validElements.size()]);
+
+      LocalHistoryAction a = LocalHistory.getInstance().startAction(IdeBundle.message("progress.deleting"));
+      try {
+        DeleteHandler.deletePsiElement(elements, myProject);
+      }
+      finally {
+        a.finish();
+      }
+    }
+  }
 }
index db305fd58e56f062807ef7e8363ecd2ed922c353..f5cefb78f7eef2804c00b40f22f58de151749920 100644 (file)
@@ -257,7 +257,7 @@ public class JavadocConfiguration implements ModuleRunProfile, JDOMExternalizabl
         final PrintWriter writer = new PrintWriter(new FileWriter(sourcepathTempFile));
         try {
           writer.println("-sourcepath");
-          writer.println(OrderEnumerator.orderEntries(myProject).withoutSdk().withoutLibraries().getSourcePathsList().getPathsString());
+          writer.println(GeneralCommandLine.quote(OrderEnumerator.orderEntries(myProject).withoutSdk().withoutLibraries().getSourcePathsList().getPathsString()));
           final Collection<String> packages = new HashSet<String>();
           final Collection<String> sources = new HashSet<String>();
           final Runnable findRunnable = new Runnable() {
index 628718201660c097d91451ca7803fbf59a88b62f..fdbcf5cc0ad55c591b5d727ff3736060257bfee2 100644 (file)
@@ -49,6 +49,7 @@ import com.intellij.psi.util.PsiFormatUtil;
 import com.intellij.util.StringBuilderSpinAllocator;
 import com.intellij.util.containers.HashMap;
 import org.jetbrains.annotations.NonNls;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.ArrayList;
@@ -213,9 +214,20 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
     if (aClass instanceof PsiAnonymousClass) return LangBundle.message("java.terms.anonymous.class");
 
     PsiFile file = aClass.getContainingFile();
-    final Module module = ModuleUtil.findModuleForPsiElement(file);
-    if (module != null) {
-      buffer.append('[').append(module.getName()).append("] ");
+    final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(aClass.getProject()).getFileIndex();
+    VirtualFile vFile = file.getVirtualFile();
+    if (vFile != null && (fileIndex.isInLibrarySource(vFile) || fileIndex.isInLibraryClasses(vFile))) {
+      final List<OrderEntry> orderEntries = fileIndex.getOrderEntriesForFile(vFile);
+      if (orderEntries.size() > 0) {
+        final OrderEntry orderEntry = orderEntries.get(0);
+        buffer.append("[").append(orderEntry.getPresentableName()).append("] ");
+      }
+    }
+    else {
+      final Module module = ModuleUtil.findModuleForPsiElement(file);
+      if (module != null) {
+        buffer.append('[').append(module.getName()).append("] ");
+      }
     }
 
     if (file instanceof PsiJavaFile) {
@@ -763,6 +775,10 @@ public class JavaDocumentationProvider implements CodeDocumentationProvider, Ext
   public static String fetchExternalJavadoc(PsiElement element, final Project project, final List<String> docURLs) {
     final JavaDocExternalFilter docFilter = new JavaDocExternalFilter(project);
 
+    return fetchExternalJavadoc(element, docURLs, docFilter);
+  }
+
+  public static String fetchExternalJavadoc(PsiElement element, List<String> docURLs, @NotNull JavaDocExternalFilter docFilter) {
     if (docURLs != null) {
       for (String docURL : docURLs) {
         try {
index 22026d4953311fd4ddcda04beb672bfa2bc7bbb9..e11fd84687df776038f3ac81815d0f936715c7dd 100644 (file)
@@ -506,9 +506,8 @@ public class PsiClassImpl extends JavaStubPsiElement<PsiClassStub<?>> implements
     }
 
     // rename constructors
-    PsiMethod[] methods = getMethods();
-    for (PsiMethod method : methods) {
-      if (method.isConstructor() && method.getName().equals(oldName)) {
+    for (PsiMethod method : getConstructors()) {
+      if (method.getName().equals(oldName)) {
         method.setName(newName);
       }
     }
index a712d909d37f6a533654f2750c4cdff4f3f9e33d..cf95704cc1e7fa527cdd3623ed84891625fca3a3 100644 (file)
@@ -197,16 +197,26 @@ public class JavaMethodsConflictResolver implements PsiConflictResolver{
         continue;
       }
 
-      PsiType returnType1 = method.getReturnType();
-      PsiType returnType2 = existingMethod.getReturnType();
-      if (returnType1 != null && returnType2 != null) {
-        returnType1 = infoSubstitutor.substitute(returnType1);
-        returnType2 = existing.getSubstitutor().substitute(returnType2);
-        if (returnType1.isAssignableFrom(returnType2) &&
-            (InheritanceUtil.isInheritorOrSelf(class1, existingClass, true) ||
-             InheritanceUtil.isInheritorOrSelf(existingClass, class1, true))) {
-          conflicts.remove(i);
-          i--;
+      if (InheritanceUtil.isInheritorOrSelf(class1, existingClass, true) ||
+          InheritanceUtil.isInheritorOrSelf(existingClass, class1, true)) {
+        PsiParameter[] parameters = method.getParameterList().getParameters();
+        final PsiParameter[] existingParameters = existingMethod.getParameterList().getParameters();
+        for (int i1 = 0, parametersLength = parameters.length; i1 < parametersLength; i1++) {
+          if (parameters[i1].getType() instanceof PsiArrayType &&
+              !(existingParameters[i1].getType() instanceof PsiArrayType)) {//prefer more specific type
+            signatures.put(signature, info);
+            continue nextConflict;
+          }
+        }
+        PsiType returnType1 = method.getReturnType();
+        PsiType returnType2 = existingMethod.getReturnType();
+        if (returnType1 != null && returnType2 != null) {
+          returnType1 = infoSubstitutor.substitute(returnType1);
+          returnType2 = existing.getSubstitutor().substitute(returnType2);
+          if (returnType1.isAssignableFrom(returnType2)) {
+            conflicts.remove(i);
+            i--;
+          }
         }
       }
     }
index 9b3393724e634ad6e14fae060c9aa83797adcc65..c342219e611c554d8a5198f140009fef7d2c2a43 100644 (file)
@@ -24,6 +24,7 @@
 package com.intellij.psi.scope.util;
 
 import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.pom.java.LanguageLevel;
 import com.intellij.psi.*;
 import com.intellij.psi.infos.ClassCandidateInfo;
@@ -47,27 +48,31 @@ public class PsiScopesUtil {
   private PsiScopesUtil() {
   }
 
-  public static boolean treeWalkUp(@NotNull PsiScopeProcessor processor, @NotNull PsiElement entrance, @Nullable PsiElement maxScope) {
+  public static boolean treeWalkUp(@NotNull PsiScopeProcessor processor,
+                                   @NotNull PsiElement entrance,
+                                   @Nullable PsiElement maxScope) {
     return treeWalkUp(processor, entrance, maxScope, ResolveState.initial());
   }
 
-  public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor, @NotNull final PsiElement entrance,
-                                    @Nullable final PsiElement maxScope,
-                                    @NotNull final ResolveState state) {
+  public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor,
+                                   @NotNull final PsiElement entrance,
+                                   @Nullable final PsiElement maxScope,
+                                   @NotNull final ResolveState state) {
     PsiElement prevParent = entrance;
     PsiElement scope = entrance;
 
-    while(scope != null){
-      if(scope instanceof PsiClass){
+    while (scope != null) {
+      ProgressManager.checkCanceled();
+      if (scope instanceof PsiClass) {
         processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, scope);
       }
       if (!scope.processDeclarations(processor, state, prevParent, entrance)) {
         return false; // resolved
       }
 
-      if (scope instanceof PsiModifierListOwner && !(scope instanceof PsiParameter/* important for not loading tree! */)){
+      if (scope instanceof PsiModifierListOwner && !(scope instanceof PsiParameter/* important for not loading tree! */)) {
         PsiModifierList modifierList = ((PsiModifierListOwner)scope).getModifierList();
-        if (modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC)){
+        if (modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC)) {
           processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null);
         }
       }
@@ -80,18 +85,22 @@ public class PsiScopesUtil {
     return true;
   }
 
-  public static boolean walkChildrenScopes(PsiElement thisElement, PsiScopeProcessor processor, ResolveState state, PsiElement lastParent, PsiElement place) {
+  public static boolean walkChildrenScopes(@NotNull PsiElement thisElement,
+                                           @NotNull PsiScopeProcessor processor,
+                                           @NotNull ResolveState state,
+                                           PsiElement lastParent,
+                                           PsiElement place) {
     PsiElement child = null;
-    if (lastParent != null && lastParent.getParent() == thisElement){
+    if (lastParent != null && lastParent.getParent() == thisElement) {
       child = lastParent.getPrevSibling();
       if (child == null) return true; // first element
     }
 
-    if (child == null){
+    if (child == null) {
       child = thisElement.getLastChild();
     }
 
-    while(child != null){
+    while (child != null) {
       if (!child.processDeclarations(processor, state, null, place)) return false;
       child = child.getPrevSibling();
     }
@@ -103,18 +112,20 @@ public class PsiScopesUtil {
     return resolveAndWalk(processor, ref, maxScope, false);
   }
 
-  public static boolean resolveAndWalk(PsiScopeProcessor processor, PsiJavaCodeReferenceElement ref, PsiElement maxScope, boolean incompleteCode) {
+  public static boolean resolveAndWalk(PsiScopeProcessor processor,
+                                       PsiJavaCodeReferenceElement ref,
+                                       PsiElement maxScope,
+                                       boolean incompleteCode) {
     final PsiElement qualifier = ref.getQualifier();
     final PsiElement classNameElement = ref.getReferenceNameElement();
-    if(classNameElement == null) return true;
-    if (qualifier != null){
+    if (classNameElement == null) return true;
+    if (qualifier != null) {
       // Composite expression
-      final PsiElementFactory factory = JavaPsiFacade.getInstance(ref.getProject()).getElementFactory();
       PsiElement target = null;
       PsiSubstitutor substitutor = PsiSubstitutor.EMPTY;
-      if (qualifier instanceof PsiExpression || qualifier instanceof PsiJavaCodeReferenceElement){
+      if (qualifier instanceof PsiExpression || qualifier instanceof PsiJavaCodeReferenceElement) {
         PsiType type = null;
-        if(qualifier instanceof PsiExpression){
+        if (qualifier instanceof PsiExpression) {
           type = ((PsiExpression)qualifier).getType();
           final ClassCandidateInfo result = TypeConversionUtil.splitType(type, qualifier);
           if (result != null) {
@@ -123,44 +134,50 @@ public class PsiScopesUtil {
           }
         }
 
-        if(type == null && qualifier instanceof PsiJavaCodeReferenceElement) {
+        if (type == null && qualifier instanceof PsiJavaCodeReferenceElement) {
           // In case of class qualifier
           final PsiJavaCodeReferenceElement referenceElement = (PsiJavaCodeReferenceElement)qualifier;
           final JavaResolveResult result = referenceElement.advancedResolve(incompleteCode);
           target = result.getElement();
           substitutor = result.getSubstitutor();
 
-          if(target instanceof PsiVariable){
-            type = substitutor.substitute(((PsiVariable) target).getType());
-            if(type instanceof PsiClassType){
-              final JavaResolveResult typeResult = ((PsiClassType) type).resolveGenerics();
+          if (target instanceof PsiVariable) {
+            type = substitutor.substitute(((PsiVariable)target).getType());
+            if (type instanceof PsiClassType) {
+              final JavaResolveResult typeResult = ((PsiClassType)type).resolveGenerics();
               target = typeResult.getElement();
               substitutor = substitutor.putAll(typeResult.getSubstitutor());
             }
-            else target = null;
+            else {
+              target = null;
+            }
           }
-          else if(target instanceof PsiMethod){
-            type = substitutor.substitute(((PsiMethod) target).getReturnType());
-            if(type instanceof PsiClassType){
-              final JavaResolveResult typeResult = ((PsiClassType) type).resolveGenerics();
+          else if (target instanceof PsiMethod) {
+            type = substitutor.substitute(((PsiMethod)target).getReturnType());
+            if (type instanceof PsiClassType) {
+              final JavaResolveResult typeResult = ((PsiClassType)type).resolveGenerics();
               target = typeResult.getElement();
               substitutor = substitutor.putAll(typeResult.getSubstitutor());
             }
-            else target = null;
+            else {
+              target = null;
+            }
             final PsiType[] types = referenceElement.getTypeParameters();
-            if(target instanceof PsiClass) {
+            if (target instanceof PsiClass) {
               substitutor = substitutor.putAll((PsiClass)target, types);
             }
           }
-          else if(target instanceof PsiClass){
+          else if (target instanceof PsiClass) {
             processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null);
           }
         }
       }
 
-      if(target != null) return target.processDeclarations(processor, ResolveState.initial().put(PsiSubstitutor.KEY, substitutor), target, ref);
+      if (target != null) {
+        return target.processDeclarations(processor, ResolveState.initial().put(PsiSubstitutor.KEY, substitutor), target, ref);
+      }
     }
-    else{
+    else {
       // simple expression -> trying to resolve variable or method
       return treeWalkUp(processor, ref, maxScope);
     }
@@ -169,20 +186,20 @@ public class PsiScopesUtil {
   }
 
   public static void setupAndRunProcessor(MethodsProcessor processor, PsiCallExpression call, boolean dummyImplicitConstructor)
-  throws MethodProcessorSetupFailedException{
-    if (call instanceof PsiMethodCallExpression){
+    throws MethodProcessorSetupFailedException {
+    if (call instanceof PsiMethodCallExpression) {
       final PsiMethodCallExpression methodCall = (PsiMethodCallExpression)call;
       final PsiJavaCodeReferenceElement ref = methodCall.getMethodExpression();
 
       processor.setArgumentList(methodCall.getArgumentList());
       processor.obtainTypeArguments(methodCall);
-      if (!ref.isQualified() || ref.getReferenceNameElement() instanceof PsiKeyword){
+      if (!ref.isQualified() || ref.getReferenceNameElement() instanceof PsiKeyword) {
         final PsiElement referenceNameElement = ref.getReferenceNameElement();
         if (referenceNameElement == null) return;
-        if (referenceNameElement instanceof PsiKeyword){
+        if (referenceNameElement instanceof PsiKeyword) {
           final PsiKeyword keyword = (PsiKeyword)referenceNameElement;
 
-          if (keyword.getTokenType() == JavaTokenType.THIS_KEYWORD){
+          if (keyword.getTokenType() == JavaTokenType.THIS_KEYWORD) {
             final PsiClass aClass = JavaResolveUtil.getContextClass(methodCall);
             if (aClass == null) {
               throw new MethodProcessorSetupFailedException("Can't resolve class for this expression");
@@ -192,11 +209,11 @@ public class PsiScopesUtil {
             processor.setAccessClass(aClass);
             aClass.processDeclarations(processor, ResolveState.initial(), null, call);
 
-            if (dummyImplicitConstructor){
+            if (dummyImplicitConstructor) {
               processDummyConstructor(processor, aClass);
             }
           }
-          else if (keyword.getTokenType() == JavaTokenType.SUPER_KEYWORD){
+          else if (keyword.getTokenType() == JavaTokenType.SUPER_KEYWORD) {
             PsiClass aClass = JavaResolveUtil.getContextClass(methodCall);
             if (aClass == null) {
               throw new MethodProcessorSetupFailedException("Can't resolve class for super expression");
@@ -218,7 +235,7 @@ public class PsiScopesUtil {
               }
               while (aClass != null);
               //apply substitutors in 'outer classes down to inner classes' order because inner class subst take precedence
-              for (int i = contextSubstitutors.size()-1; i>=0; i--) {
+              for (int i = contextSubstitutors.size() - 1; i >= 0; i--) {
                 PsiSubstitutor contextSubstitutor = contextSubstitutors.get(i);
                 substitutor = substitutor.putAll(contextSubstitutor);
               }
@@ -234,31 +251,31 @@ public class PsiScopesUtil {
               if (dummyImplicitConstructor) processDummyConstructor(processor, superClass);
             }
           }
-          else{
+          else {
             LOG.error("Unknown name element " + referenceNameElement + " in reference " + ref.getText() + "(" + ref + ")");
           }
         }
-        else if (referenceNameElement instanceof PsiIdentifier){
+        else if (referenceNameElement instanceof PsiIdentifier) {
           processor.setIsConstructor(false);
           processor.setName(referenceNameElement.getText());
           processor.setAccessClass(null);
           resolveAndWalk(processor, ref, null);
         }
-        else{
+        else {
           LOG.error("Unknown name element " + referenceNameElement + " in reference " + ref.getText() + "(" + ref + ")");
         }
       }
-      else{
+      else {
         // Complex expression
         final PsiElement referenceName = methodCall.getMethodExpression().getReferenceNameElement();
         final PsiManager manager = call.getManager();
         final PsiElement qualifier = ref.getQualifier();
 
-        if (referenceName instanceof PsiIdentifier && qualifier instanceof PsiExpression){
-          PsiType type = ((PsiExpression) qualifier).getType();
+        if (referenceName instanceof PsiIdentifier && qualifier instanceof PsiExpression) {
+          PsiType type = ((PsiExpression)qualifier).getType();
           if (type == null) {
             if (qualifier instanceof PsiJavaCodeReferenceElement) {
-              final JavaResolveResult result = ((PsiJavaCodeReferenceElement) qualifier).advancedResolve(false);
+              final JavaResolveResult result = ((PsiJavaCodeReferenceElement)qualifier).advancedResolve(false);
               if (result.getElement() instanceof PsiClass) {
                 processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null);
                 processQualifierResult(result, processor, methodCall);
@@ -267,20 +284,23 @@ public class PsiScopesUtil {
             else {
               throw new MethodProcessorSetupFailedException("Cant determine qualifier type!");
             }
-          } else if (type instanceof PsiIntersectionType) {
+          }
+          else if (type instanceof PsiIntersectionType) {
             final PsiType[] conjuncts = ((PsiIntersectionType)type).getConjuncts();
             for (PsiType conjunct : conjuncts) {
               if (!processQualifierType(conjunct, processor, manager, methodCall)) break;
             }
-          } else {
+          }
+          else {
             processQualifierType(type, processor, manager, methodCall);
           }
         }
-        else{
+        else {
           LOG.assertTrue(false);
         }
       }
-    } else{
+    }
+    else {
       LOG.assertTrue(call instanceof PsiNewExpression);
       PsiNewExpression newExpr = (PsiNewExpression)call;
       PsiJavaCodeReferenceElement classRef = newExpr.getClassOrAnonymousClassReference();
@@ -289,33 +309,35 @@ public class PsiScopesUtil {
       }
 
       final JavaResolveResult result = classRef.advancedResolve(false);
-      PsiClass aClass = (PsiClass) result.getElement();
-      if (aClass == null)
+      PsiClass aClass = (PsiClass)result.getElement();
+      if (aClass == null) {
         throw new MethodProcessorSetupFailedException("Cant resolve class in new expression");
+      }
       processor.setIsConstructor(true);
       processor.setAccessClass(aClass);
       processor.setArgumentList(newExpr.getArgumentList());
       processor.obtainTypeArguments(newExpr);
       aClass.processDeclarations(processor, ResolveState.initial().put(PsiSubstitutor.KEY, result.getSubstitutor()), null, call);
 
-      if (dummyImplicitConstructor){
+      if (dummyImplicitConstructor) {
         processDummyConstructor(processor, aClass);
       }
     }
   }
 
   private static boolean processQualifierType(final PsiType type,
-                                         final MethodsProcessor processor,
-                                         PsiManager manager,
-                                         PsiMethodCallExpression call) throws MethodProcessorSetupFailedException {
+                                              final MethodsProcessor processor,
+                                              PsiManager manager,
+                                              PsiMethodCallExpression call) throws MethodProcessorSetupFailedException {
     if (type instanceof PsiClassType) {
       JavaResolveResult qualifierResult = ((PsiClassType)type).resolveGenerics();
       return processQualifierResult(qualifierResult, processor, call);
     }
     else if (type instanceof PsiArrayType) {
       LanguageLevel languageLevel = PsiUtil.getLanguageLevel(call);
-      JavaResolveResult qualifierResult = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().getArrayClassType(((PsiArrayType)type).getComponentType(),
-                                                                                        languageLevel).resolveGenerics();
+      PsiElementFactory factory = JavaPsiFacade.getInstance(manager.getProject()).getElementFactory();
+      JavaResolveResult qualifierResult =
+        factory.getArrayClassType(((PsiArrayType)type).getComponentType(), languageLevel).resolveGenerics();
       return processQualifierResult(qualifierResult, processor, call);
     }
     else if (type instanceof PsiIntersectionType) {
@@ -328,12 +350,13 @@ public class PsiScopesUtil {
   }
 
   private static boolean processQualifierResult(JavaResolveResult qualifierResult,
-                                           final MethodsProcessor processor,
-                                           PsiMethodCallExpression methodCall) throws MethodProcessorSetupFailedException {
+                                                final MethodsProcessor processor,
+                                                PsiMethodCallExpression methodCall) throws MethodProcessorSetupFailedException {
     PsiElement resolve = qualifierResult.getElement();
 
-    if (resolve == null)
+    if (resolve == null) {
       throw new MethodProcessorSetupFailedException("Cant determine qualifier class!");
+    }
 
     if (resolve instanceof PsiTypeParameter) {
       processor.setAccessClass((PsiClass)resolve);
@@ -347,26 +370,26 @@ public class PsiScopesUtil {
 
     processor.setIsConstructor(false);
     processor.setName(methodCall.getMethodExpression().getReferenceName());
-    return resolve.processDeclarations(processor, ResolveState.initial().put(PsiSubstitutor.KEY, qualifierResult.getSubstitutor()), methodCall, methodCall);
+    ResolveState state = ResolveState.initial().put(PsiSubstitutor.KEY, qualifierResult.getSubstitutor());
+    return resolve.processDeclarations(processor, state, methodCall, methodCall);
   }
 
   private static void processDummyConstructor(MethodsProcessor processor, PsiClass aClass) {
     if (aClass instanceof PsiAnonymousClass) return;
-    try{
-      PsiMethod[] methods = aClass.getMethods();
-      for (PsiMethod method : methods) {
-        if (method.isConstructor()) {
-          return;
-        }
+    try {
+      PsiMethod[] constructors = aClass.getConstructors();
+      if (constructors.length != 0) {
+        return;
       }
       final PsiElementFactory factory = JavaPsiFacade.getInstance(aClass.getProject()).getElementFactory();
       final PsiMethod dummyConstructor = factory.createConstructor();
-      if(aClass.getNameIdentifier() != null){
-        dummyConstructor.getNameIdentifier().replace(aClass.getNameIdentifier());
+      PsiIdentifier nameIdentifier = aClass.getNameIdentifier();
+      if (nameIdentifier != null) {
+        dummyConstructor.getNameIdentifier().replace(nameIdentifier);
       }
       processor.forceAddResult(dummyConstructor);
     }
-    catch(IncorrectOperationException e){
+    catch (IncorrectOperationException e) {
       LOG.error(e);
     }
   }
index ae2aec793470de2147bec5e503e6995eee6ba753..f543ebcc32b127c17f055f8c479a523b5815b377 100644 (file)
@@ -37,12 +37,12 @@ import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.openapi.wm.WindowManager;
 import com.intellij.psi.*;
 import com.intellij.psi.impl.source.PostprocessReformattingAspect;
+import com.intellij.psi.util.PsiExpressionTrimRenderer;
 import com.intellij.refactoring.HelpID;
 import com.intellij.refactoring.IntroduceTargetChooser;
 import com.intellij.refactoring.RefactoringActionHandler;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.introduceVariable.IntroduceVariableBase;
-import com.intellij.refactoring.introduceVariable.PsiExpressionTrimRenderer;
 import com.intellij.refactoring.util.CommonRefactoringUtil;
 import com.intellij.refactoring.util.RefactoringUtil;
 import com.intellij.refactoring.util.duplicates.DuplicatesImpl;
index f33755c9c1efa06966d424bea71933eb012dd9d3..179f9be4e53a701fc74de14d2dfceadd5dde6575 100644 (file)
@@ -40,13 +40,13 @@ import java.util.HashSet;
 /**
  * @author ven
  */
-class InlineConstantFieldProcessor extends BaseRefactoringProcessor {
+public class InlineConstantFieldProcessor extends BaseRefactoringProcessor {
   private static final Logger LOG = Logger.getInstance("#com.intellij.refactoring.inline.InlineConstantFieldProcessor");
   private PsiField myField;
   private final PsiReferenceExpression myRefExpr;
   private final boolean myInlineThisOnly;
 
-  InlineConstantFieldProcessor(PsiField field, Project project, PsiReferenceExpression ref, boolean isInlineThisOnly) {
+  public InlineConstantFieldProcessor(PsiField field, Project project, PsiReferenceExpression ref, boolean isInlineThisOnly) {
     super(project);
     myField = field;
     myRefExpr = ref;
index 69f3b958cc476aa9cb7c063dbfe37a43b5b025aa..bcde92bdaffe8353d9739ec4228419eb02bde789 100644 (file)
@@ -719,11 +719,12 @@ public class InlineMethodProcessor extends BaseRefactoringProcessor {
     if (blockData.thisVar != null) {
       PsiExpression qualifier = methodCall.getMethodExpression().getQualifierExpression();
       if (qualifier == null) {
-        PsiElement parent = methodCall.getParent();
+        PsiElement parent = methodCall.getContext();
         while (true) {
           if (parent instanceof PsiClass) break;
           if (parent instanceof PsiFile) break;
-          parent = parent.getParent();
+          assert parent != null : methodCall;
+          parent = parent.getContext();
         }
         if (parent instanceof PsiClass) {
           PsiClass parentClass = (PsiClass)parent;
index 984f10e4415222701b0505df418c16905a228864..45d2ff6a7be79d04e45d48b7b4425a5be0fb6cfb 100644 (file)
@@ -28,7 +28,7 @@ import com.intellij.psi.util.PsiUtil;
 import com.intellij.refactoring.IntroduceTargetChooser;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.introduceVariable.IntroduceVariableBase;
-import com.intellij.refactoring.introduceVariable.PsiExpressionTrimRenderer;
+import com.intellij.psi.util.PsiExpressionTrimRenderer;
 import com.intellij.refactoring.util.CommonRefactoringUtil;
 
 import java.util.List;
index 830fac8953be6f60fab34e998e6cd8e9fd31cab9..c3a2c42ca1f7054da45f9b7f8c5a9d80bc245a00 100644 (file)
@@ -120,7 +120,12 @@ class IntroduceFieldDialog extends DialogWrapper {
       if (myRbInSetUp != null) myRbInSetUp.setEnabled(false);
     }
 
-    if (ourLastInitializerPlace == IN_CONSTRUCTOR) {
+    final PsiMethod setUpMethod = TestUtil.findSetUpMethod(myParentClass);
+    if (myInitializerExpression != null && PsiTreeUtil.isAncestor(setUpMethod, myInitializerExpression, false) && myRbInSetUp.isEnabled() ||
+        ourLastInitializerPlace == IN_SETUP_METHOD && TestUtil.isTestClass(myParentClass) && myRbInSetUp.isEnabled()) {
+      myRbInSetUp.setSelected(true);
+    }
+    else if (ourLastInitializerPlace == IN_CONSTRUCTOR) {
       if (myRbInConstructor.isEnabled()) {
         myRbInConstructor.setSelected(true);
       } else {
@@ -132,8 +137,6 @@ class IntroduceFieldDialog extends DialogWrapper {
       } else {
         selectInCurrentMethod();
       }
-    } else if (ourLastInitializerPlace == IN_SETUP_METHOD && TestUtil.isTestClass(myParentClass) && myRbInSetUp.isEnabled()) {
-      myRbInSetUp.setSelected(true);
     } else {
       selectInCurrentMethod();
     }
@@ -144,8 +147,6 @@ class IntroduceFieldDialog extends DialogWrapper {
       myRbProtected.setSelected(true);
     } else if (PsiModifier.PACKAGE_LOCAL.equals(ourLastVisibility)) {
       myRbPackageLocal.setSelected(true);
-    } else if (PsiModifier.PRIVATE.equals(ourLastVisibility)) {
-      myRbPrivate.setSelected(true);
     } else {
       myRbPrivate.setSelected(true);
     }
index 0b07c76b4088714014f5c2064753928793edc976..2351b4a6c8cd9ad1aadfd4048dac0a161f7af2fe 100644 (file)
@@ -94,12 +94,12 @@ public class IntroduceFieldHandler extends BaseExpressionToFieldHandler {
 
     int occurencesNumber = occurences.length;
     final boolean currentMethodConstructor = containingMethod != null && containingMethod.isConstructor();
-    final boolean allowInitInMethod = (!currentMethodConstructor || !isInSuperOrThis) && anchorElement instanceof PsiLocalVariable;
+    final boolean allowInitInMethod = (!currentMethodConstructor || !isInSuperOrThis) && (anchorElement instanceof PsiLocalVariable || anchorElement instanceof PsiStatement);
     final boolean allowInitInMethodIfAll = (!currentMethodConstructor || !isInSuperOrThis) && anchorElementIfAll instanceof PsiStatement;
     IntroduceFieldDialog dialog = new IntroduceFieldDialog(
       project, parentClass, expr, localVariable,
       currentMethodConstructor,
-      false, declareStatic, occurencesNumber,
+      localVariable != null, declareStatic, occurencesNumber,
       allowInitInMethod, allowInitInMethodIfAll,
       new TypeSelectorManagerImpl(project, type, containingMethod, expr, occurences)
     );