Merge branch 'master' of git.labs.intellij.net:idea/community
authorKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Wed, 28 Jul 2010 07:55:29 +0000 (11:55 +0400)
committerKirill Likhodedov <kirill.likhodedov@jetbrains.com>
Wed, 28 Jul 2010 07:55:29 +0000 (11:55 +0400)
273 files changed:
.idea/dictionaries/kirillk.xml [new file with mode: 0644]
.idea/inspectionProfiles/idea_default.xml
.idea/libraries/Ant.xml
.idea/libraries/CGLIB.xml
.idea/libraries/DTDParser.xml
.idea/libraries/EasyMock.xml
.idea/libraries/Eclipse.xml
.idea/libraries/Gant.xml
.idea/libraries/Groovy.xml
.idea/libraries/JDOM.xml
.idea/libraries/JMock1.xml
.idea/libraries/JUnit3.xml
.idea/libraries/JUnit4.xml
.idea/libraries/JavaHelp.xml
.idea/libraries/Jaxen.xml
.idea/libraries/Log4J.xml
.idea/libraries/Mac.xml
.idea/libraries/Mocks.xml
.idea/libraries/NanoXML.xml
.idea/libraries/OroMatcher.xml
.idea/libraries/TestNG.xml
.idea/libraries/Trove4j.xml
.idea/libraries/Velocity.xml
.idea/libraries/XStream.xml
.idea/libraries/Xerces.xml
.idea/libraries/XmlBeans.xml
.idea/libraries/XmlRPC.xml
.idea/libraries/asm.xml
.idea/libraries/commons_codec.xml
.idea/libraries/commons_collections.xml
.idea/libraries/commons_lang.xml
.idea/libraries/commons_net.xml
.idea/libraries/jcip.xml
.idea/libraries/jgoodies_forms.xml
.idea/libraries/jna.xml
.idea/libraries/microba.xml
.idea/libraries/picocontainer.xml
.idea/libraries/tcServiceMessages.xml
.idea/modules.xml
.idea/projectCodeStyle.xml
.idea/runConfigurations/IDEA.xml
build/lib/gant/jps-sources.zip
build/lib/gant/lib/jps.jar
build/scripts/dist.gant
build/scripts/layouts.gant
build/scripts/utils.gant
java/compiler/impl/compiler-impl.iml
java/compiler/impl/src/com/intellij/compiler/DependencyProcessor.java [moved from java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/DependencyProcessor.java with 78% similarity]
java/compiler/impl/src/com/intellij/compiler/impl/CompileDriver.java
java/compiler/impl/src/com/intellij/compiler/impl/TranslatingCompilerFilesMonitor.java
java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompiler.java
java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java
java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/ExternalCompiler.java
java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/api/CompilerAPICompiler.java
java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/eclipse/EclipseEmbeddedCompiler.java
java/compiler/impl/src/com/intellij/compiler/make/CacheUtils.java
java/compiler/impl/src/com/intellij/compiler/make/DependencyCache.java
java/compiler/impl/src/com/intellij/packaging/impl/elements/ManifestFileUtil.java
java/compiler/javac2/src/com/intellij/ant/Javac2.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaSmartCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/actions/SuppressWarningsFoldingBuilder.java
java/java-impl/src/com/intellij/codeInsight/daemon/impl/quickfix/CreatePropertyFromUsageFix.java
java/java-impl/src/com/intellij/lang/java/JavaRefactoringSupportProvider.java
java/java-impl/src/com/intellij/lang/java/parser/DeclarationParser.java
java/java-impl/src/com/intellij/lang/java/parser/JavaParserUtil.java
java/java-impl/src/com/intellij/lang/java/parser/ReferenceParser.java
java/java-impl/src/com/intellij/lang/java/parser/StatementParser.java [new file with mode: 0644]
java/java-impl/src/com/intellij/psi/impl/source/parsing/DeclarationParsing.java
java/java-impl/src/com/intellij/psi/impl/source/parsing/StatementParsing.java
java/java-impl/src/com/intellij/psi/impl/source/tree/JavaElementType.java
java/java-impl/src/com/intellij/refactoring/inline/InlineConstantFieldProcessor.java
java/java-impl/src/com/intellij/refactoring/inline/InlineParameterHandler.java
java/java-impl/src/com/intellij/refactoring/inlineSuperClass/usageInfo/ReplaceExtendsListUsageInfo.java
java/java-impl/src/com/intellij/refactoring/introduceVariable/IntroduceVariableBase.java
java/java-impl/src/com/intellij/refactoring/safeDelete/JavaSafeDeleteProcessor.java
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterExistingField.java [new file with mode: 0644]
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeExistingField.java [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/CompletionHack0.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/CompletionHack1.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EmptyBody0.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EmptyBody1.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EnumBody0.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EnumBody1.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EnumBody2.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EnumBody3.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EnumBody4.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/EnumBody5.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/Errors.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/FieldMulti.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/FieldSimple.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/GenericMethod.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/GenericMethodErrors.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/MethodNormal0.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/MethodNormal1.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/MissingInitializer.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/MissingInitializerExpression.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/MultiLineUnclosed.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/Unclosed0.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/Unclosed1.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/Unclosed2.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/Unclosed3.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/Unclosed4.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/Unclosed5.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/UnclosedBracket.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/UnclosedComma.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/UnclosedSemicolon.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/declarations/WildcardParsing.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/references/Type5.txt [new file with mode: 0644]
java/java-tests/testData/psi/parser-partial/references/TypeParams5.txt
java/java-tests/testData/psi/parser-partial/references/TypeParams7.txt
java/java-tests/testData/refactoring/inlineConstantField/QualifiedConstantExpressionReplacedWithAnotherOne.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineConstantField/QualifiedConstantExpressionReplacedWithAnotherOne.java.after [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineParameter/CantInlineRecursive.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineParameter/InlineRecursive.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineParameter/InlineRecursive.java.after [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/ISuper.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/Test.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/Test1.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/ISuper.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Super.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Test.java [new file with mode: 0644]
java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Test1.java [new file with mode: 0644]
java/java-tests/testData/refactoring/introduceVariable/SubexpressionWithSpacesInSelection.after.java [new file with mode: 0644]
java/java-tests/testData/refactoring/introduceVariable/SubexpressionWithSpacesInSelection.java [new file with mode: 0644]
java/java-tests/testData/refactoring/safeDelete/methodDeepHierarchy/after/Super.java [new file with mode: 0644]
java/java-tests/testData/refactoring/safeDelete/methodDeepHierarchy/before/Super.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/lang/java/parser/partial/DeclarationParserTest.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/lang/java/parser/partial/ReferenceParserTest.java
java/java-tests/testSrc/com/intellij/refactoring/InlineSuperClassTest.java
java/java-tests/testSrc/com/intellij/refactoring/IntroduceVariableTest.java
java/java-tests/testSrc/com/intellij/refactoring/SafeDeleteTest.java
java/java-tests/testSrc/com/intellij/refactoring/inline/InlineConstantFieldTest.java
java/java-tests/testSrc/com/intellij/refactoring/inline/InlineParameterTest.java
java/java-tests/testSrc/com/intellij/roots/ModuleRootsExternalizationTest.java
java/java-tests/testSrc/com/intellij/roots/libraries/LibraryTest.java
java/jsp-base-openapi/src/com/intellij/lang/jsp/JspFileViewProvider.java
java/jsp-base-openapi/src/com/intellij/psi/jsp/BaseJspFile.java
java/openapi/src/com/intellij/psi/search/scope/packageSet/PatternPackageSet.java
platform/lang-api/src/com/intellij/codeInsight/template/TemplateBuilder.java
platform/lang-api/src/com/intellij/lang/refactoring/DefaultRefactoringSupportProvider.java
platform/lang-api/src/com/intellij/lang/refactoring/RefactoringSupportProvider.java
platform/lang-api/src/com/intellij/psi/PsiQualifiedNamedElement.java [moved from java/openapi/src/com/intellij/psi/PsiQualifiedNamedElement.java with 100% similarity]
platform/lang-api/src/com/intellij/psi/search/scope/packageSet/ComplementPackageSet.java
platform/lang-api/src/com/intellij/psi/search/scope/packageSet/FilePatternPackageSet.java
platform/lang-api/src/com/intellij/psi/search/scope/packageSet/IntersectionPackageSet.java
platform/lang-api/src/com/intellij/psi/search/scope/packageSet/PatternBasedPackageSet.java [new file with mode: 0644]
platform/lang-api/src/com/intellij/psi/search/scope/packageSet/UnionPackageSet.java
platform/lang-api/src/com/intellij/psi/templateLanguages/TemplateLanguageFileViewProvider.java
platform/lang-api/src/com/intellij/psi/util/PsiTreeUtil.java
platform/lang-api/src/com/intellij/refactoring/listeners/RefactoringElementListenerComposite.java [moved from java/openapi/src/com/intellij/refactoring/listeners/RefactoringElementListenerComposite.java with 100% similarity]
platform/lang-api/src/com/intellij/refactoring/rename/NameSuggestionProvider.java
platform/lang-impl/src/com/intellij/codeInsight/template/TemplateBuilderImpl.java
platform/lang-impl/src/com/intellij/execution/console/LanguageConsoleImpl.java
platform/lang-impl/src/com/intellij/ide/projectView/BaseProjectTreeBuilder.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/ProjectRootManagerImpl.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/libraries/LibraryImpl.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/storage/ClasspathStorage.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/storage/FileSet.java
platform/lang-impl/src/com/intellij/packageDependencies/ui/RefactoringScopeElementListenerProvider.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/psi/PsiReferenceProviderBean.java
platform/lang-impl/src/com/intellij/psi/impl/PsiCachedValueImpl.java
platform/lang-impl/src/com/intellij/psi/impl/PsiParameterizedCachedValue.java
platform/lang-impl/src/com/intellij/refactoring/actions/ExtractInterfaceAction.java [new file with mode: 0644]
platform/lang-impl/src/com/intellij/refactoring/actions/ExtractModuleAction.java [moved from java/java-impl/src/com/intellij/refactoring/extractInterface/ExtractInterfaceAction.java with 62% similarity]
platform/lang-impl/src/com/intellij/refactoring/actions/ExtractSuperActionBase.java [moved from platform/lang-impl/src/com/intellij/refactoring/actions/BaseExtractModuleAction.java with 62% similarity]
platform/lang-impl/src/com/intellij/refactoring/actions/ExtractSuperclassAction.java
platform/lang-impl/src/com/intellij/refactoring/rename/AutomaticRenamingDialog.java
platform/lang-impl/src/com/intellij/refactoring/rename/RenameProcessor.java
platform/lang-impl/src/com/intellij/util/indexing/FileBasedIndexProjectHandler.java
platform/platform-api/src/com/intellij/execution/process/ProcessHandler.java
platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeBuilder.java
platform/platform-api/src/com/intellij/ide/util/treeView/AbstractTreeUi.java
platform/platform-api/src/com/intellij/navigation/ItemPresentation.java
platform/platform-api/src/com/intellij/openapi/util/BusyObject.java
platform/platform-api/src/com/intellij/util/Alarm.java
platform/platform-impl/src/com/intellij/openapi/editor/actions/EditorActionUtil.java
platform/platform-impl/src/com/intellij/openapi/editor/ex/util/EditorUtil.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/CaretModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/DefaultEditorTextRepresentationHelper.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorTextRepresentationHelper.java [new file with mode: 0644]
platform/platform-impl/src/com/intellij/openapi/editor/impl/SoftWrapModelImpl.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/DefaultSoftWrapApplianceManager.java
platform/platform-impl/src/com/intellij/openapi/editor/impl/softwrap/SoftWrapDataMapper.java
platform/platform-impl/src/com/intellij/openapi/wm/impl/FocusManagerImpl.java
platform/platform-impl/src/com/intellij/util/CachedValueBase.java
platform/platform-impl/src/com/intellij/util/CachedValueImpl.java
platform/platform-impl/src/com/intellij/util/ParameterizedCachedValueImpl.java
platform/platform-impl/testSrc/com/intellij/ide/util/treeView/TreeUiTest.java
platform/platform-impl/testSrc/com/intellij/openapi/editor/impl/softwrap/SoftWrapDataMapperTest.java
platform/platform-resources-en/src/messages/ActionsBundle.properties
platform/platform-resources-en/src/messages/RefactoringBundle.properties
platform/platform-resources/src/META-INF/LangExtensions.xml
platform/platform-resources/src/idea/LangActions.xml
platform/testRunner/src/com/intellij/execution/testframework/AbstractTestProxy.java
platform/testRunner/src/com/intellij/execution/testframework/CompositePrintable.java
platform/testRunner/src/com/intellij/execution/testframework/TestTreeView.java
platform/util/src/com/intellij/openapi/util/NullableLazyKey.java
platform/util/src/com/intellij/util/ExceptionUtil.java [new file with mode: 0644]
platform/util/src/com/intellij/util/ObjectUtils.java
platform/util/src/com/intellij/util/concurrency/FutureResult.java
platform/util/src/com/intellij/util/containers/ContainerUtil.java
platform/util/src/com/intellij/util/containers/FactoryMap.java
platform/util/src/com/intellij/util/containers/MultiMap.java
platform/util/src/com/intellij/util/containers/SoftFactoryMap.java
platform/util/src/com/intellij/util/containers/WeakFactoryMap.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/AbstractVcsAction.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/DescindingFilesFilter.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangeListManagerImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/impl/ProjectLevelVcsManagerImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/update/AbstractCommonUpdateAction.java
plugins/IntelliLang/IntelliLang-java.iml
plugins/IntelliLang/IntelliLang-javaee.iml
plugins/IntelliLang/IntelliLang-standalone.iml [new file with mode: 0644]
plugins/IntelliLang/IntelliLang-standalone.ipr
plugins/IntelliLang/IntelliLang-xml.iml
plugins/IntelliLang/IntelliLang.iml
plugins/IntelliLang/IntelliLangJava.iml [deleted file]
plugins/cvs/cvs-core/cvs-core.iml
plugins/devkit/src/dom/impl/ExtensionDomExtender.java
plugins/eclipse/src/org/jetbrains/idea/eclipse/config/CachedXmlDocumentSet.java
plugins/eclipse/testData/iml/allProps/expected/expected.iml
plugins/eclipse/testData/iml/emptySrc/expected/expected.iml
plugins/eclipse/testData/iml/resolvedVariables/expected/expected.iml
plugins/eclipse/testData/modification/varAddJavadoc/expected/.classpath [new file with mode: 0644]
plugins/eclipse/testData/modification/varAddJavadoc/expected/ws-internals.eml [new file with mode: 0644]
plugins/eclipse/testData/modification/varAddJavadoc/jars/test.jar [new file with mode: 0644]
plugins/eclipse/testData/modification/varAddJavadoc/test/.classpath [new file with mode: 0644]
plugins/eclipse/testData/modification/varAddJavadoc/test/.project [new file with mode: 0644]
plugins/eclipse/testData/modification/varAddJavadoc/variableidea/test.jar [new file with mode: 0644]
plugins/eclipse/testSources/org/jetbrains/idea/eclipse/EclipseLibrariesModificationsTest.java
plugins/git4idea/git4idea.iml
plugins/git4idea/src/git4idea/history/browser/GitLogTreeFileSelector.java
plugins/groovy/jetgroovy.iml
plugins/groovy/src/org/jetbrains/plugins/groovy/annotator/GroovyAnnotator.java
plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/assignment/GroovyAssignabilityCheckInspection.java
plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/assignment/GroovyUncheckedAssignmentOfMemberOfRawTypeInspection.java
plugins/groovy/src/org/jetbrains/plugins/groovy/codeInspection/unusedDef/UnusedDefInspection.java
plugins/groovy/src/org/jetbrains/plugins/groovy/compiler/GroovyCompilerBase.java
plugins/groovy/src/org/jetbrains/plugins/groovy/config/GroovyConfigUtils.java
plugins/groovy/src/org/jetbrains/plugins/groovy/findUsages/GroovyConstructorUsagesSearchHelper.java
plugins/groovy/src/org/jetbrains/plugins/groovy/findUsages/GroovyWordsScanner.java
plugins/groovy/src/org/jetbrains/plugins/groovy/gpp/GppTypeConverter.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/GroovyTokenTypes.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/lexer/TokenSets.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/expressions/arguments/ArgumentList.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parser/parsing/statements/expressions/arithmetic/PathExpression.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/controlFlow/impl/ControlFlowBuilder.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/GrMapType.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/relational/GrEqualityExpressionImpl.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/util/PsiUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/resolve/ResolveUtil.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/GroovyNameSuggestionProvider.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/changeSignature/GrMethodCallUsageInfo.java
plugins/groovy/src/org/jetbrains/plugins/groovy/refactoring/rename/RenameAliasImportedFieldProcessor.java
plugins/groovy/test/org/jetbrains/plugins/groovy/compiler/GppCompilerTest.groovy
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/Groovy16HighlightingTest.java
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/GroovyHighlightingTest.java
plugins/groovy/test/org/jetbrains/plugins/groovy/lang/findUsages/FindUsagesTest.java
plugins/groovy/testdata/findUsages/constructorUsageInAnonymousClass/A.groovy [new file with mode: 0644]
plugins/groovy/testdata/highlighting/IfIncrementElseReturn.groovy
plugins/groovy/testdata/highlighting/MapNotAcceptedAsStringParameter.groovy [new file with mode: 0644]
plugins/groovy/testdata/highlighting/PrefixIncrementCfa.groovy
plugins/groovy/testdata/highlighting/UnusedVariable.groovy
plugins/groovy/testdata/resolve/method/mapNotAcceptedAsStringParameter/A.groovy [new file with mode: 0644]
plugins/maven/facade-api/maven-facade-api.iml
plugins/maven/facade-impl/maven-facade-impl.iml
plugins/relaxng/relaxng.iml
plugins/svn4idea/svn4idea-tests.iml
plugins/svn4idea/svn4idea.iml
plugins/ui-designer/src/com/intellij/uiDesigner/binding/FormReferenceProvider.java
resources/src/META-INF/IdeaPlugin.xml
resources/src/idea/IdeaActions.xml

diff --git a/.idea/dictionaries/kirillk.xml b/.idea/dictionaries/kirillk.xml
new file mode 100644 (file)
index 0000000..72509ca
--- /dev/null
@@ -0,0 +1,3 @@
+<component name="ProjectDictionaryState">
+  <dictionary name="kirillk" />
+</component>
\ No newline at end of file
index 46a1e1effbc3ff8536970681e67868d9afb7c3f6..555c24e353a0a03201a75b8ddeb78b80fd09ea38 100644 (file)
     <inspection_tool class="ObjectEqualsNull" enabled="false" level="WARNING" enabled_by_default="false" />
     <inspection_tool class="ObjectNotify" enabled="true" level="WARNING" enabled_by_default="true" />
     <inspection_tool class="ObsoleteCollection" enabled="true" level="WARNING" enabled_by_default="true">
-      <option name="ignoreLibraryArguments" value="false" />
+      <option name="ignoreRequiredObsoleteCollectionTypes" value="false" />
     </inspection_tool>
     <inspection_tool class="PointlessArithmeticExpression" enabled="true" level="WARNING" enabled_by_default="true">
       <option name="m_ignoreExpressionsContainingConstants" value="true" />
index 4d69c6899db3b22a6e38a81060db91e461b7383c..dfdd147fd7bcbe85782df099a843521352e7276a 100644 (file)
@@ -28,6 +28,7 @@
       <root url="jar://$PROJECT_DIR$/lib/ant/lib/ant-swing.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/ant/lib/ant-javamail.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/ant/src/bundled_ant_src.zip!/bundled_ant_src/main" />
     </SOURCES>
index b7e692fa647e347124947e3bed78611f97eafad7..061f6f213744ffff0a7f44b741ea4d08acda37e4 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/cglib-nodep-2.1_3.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/cglib-src-2.1_3.jar!/src/proxy" />
     </SOURCES>
index c40d012406c82755f1aa3c8a819f7edd96504099..dcc82b44e6279149d0281dbaa618ca27a39b05d7 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/dtdparser113.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index cc51a3eea9a6cfe18f8e2400f7f5abf52ccbc473..05648438f07acb132c4019f8fc5eac97aa54fbf7 100644 (file)
@@ -4,5 +4,7 @@
       <root url="jar://$PROJECT_DIR$/lib/dev/easymockclassextension.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/dev/easymock.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 7fa7c6724800b819aa534afa543ba1d36fb06756..09b7e2c73bd486edadec6d3e6759bda14cb7fdbc 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/org.eclipse.jdt.core_3.5.2.v_981_R35x.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/org.eclipse.jdt.core.source_3.5.2.v_981_R35x.jar!/" />
     </SOURCES>
index ccd8bf04bef7fef6e57f4f0b219906c8e8b9691d..ec46297abec37eb472b808df5380e6734cf4e403 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="file://$PROJECT_DIR$/build/lib/gant/lib" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/build/lib/gant/src.zip!/groovy" />
       <root url="jar://$PROJECT_DIR$/build/lib/gant/jps-sources.zip!/" />
index 39ef164c7fa7214da98e55e722c7468d3ceaf412..82c7bd9c0740970f58d7dab3ba36374964e94d94 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/groovy-all-1.7.3.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/groovy-src-1.7.3.zip!/" />
     </SOURCES>
index bce78cc5489e76e9c4a8f70f3e6578ca8f40dc3f..17d2e73367963de508ee4ebb94f48b9deb496674 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/jdom.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/jdom.zip!/" />
     </SOURCES>
index 28bec95a2700053bdde48775f34e75941be3c6e4..ca4dac06d5e26b33bc0e25608c12557eeaa439b7 100644 (file)
@@ -4,5 +4,7 @@
       <root url="jar://$PROJECT_DIR$/lib/dev/jmock-1.0.1.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/dev/jmock-cglib-1.0.1.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index c1b662d9bfb07828661fea2525a96d0c52de06b4..c8e5da0d1ec9d981570217c6ba734fef915c871a 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/junit.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 3293fe32308bef48553ddd8fe3e2cc72eac07289..6e7ba44fb1d057f2d40aefeb0b0203418d350b83 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/junit-4.7.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/junit-4.7-src.jar!/" />
     </SOURCES>
index a581fbd1d42b18d1db4acd74042f0213ed8abef6..458f035487508870a0d5790e430e18e02f5c4b7d 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/jh.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/jhsrc.jar!/src" />
     </SOURCES>
index 8c9fa7adb99c7dd0c246e61bc0c5257515b3191b..dd17c6df93a6373beacfb3827e0b183aab2dcafb 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/jaxen-1.1.1.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 3179b14707726ede27af3d39db73ae89f1e6f7ab..6e3948c15fc9f69571f69059601c37affa435e76 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/log4j.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/log4j.zip!/" />
     </SOURCES>
index a12291d435e55d325399999b44bdc271276767dd..256d4c9e54a9d1b52a63ba71a8b2a499e1cea6df 100644 (file)
@@ -4,6 +4,7 @@
       <root url="jar://$PROJECT_DIR$/build/conf/mac/lib/quaqua.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/eawtstub.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/eawtstub_src.zip!/src" />
     </SOURCES>
index e4bf218554bfc631b8d8c04b7076de489eec835d..5a52b9d163915adb7ea10b4ea8b46d4e5bcf20d0 100644 (file)
@@ -12,5 +12,7 @@
       <root url="jar://$PROJECT_DIR$/lib/dev/hamcrest-library-1.0.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/dev/hamcrest-api-1.0.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 0bb733ed732302aeb33c26ccd1640b7b8a8a7ebe..b189c1aeccf46cfa7bbcd806589ed2fb51c900d0 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/nanoxml-2.2.3.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/nanoxml.zip!/" />
     </SOURCES>
index 91713b2ea1e2d5c78e348f77231c80c09a1bed18..11cae893cfea1f82036f47c0a8a9380447fb69ce 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/oromatcher.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index a5778213fdef95d431ed12b1b7ce54c9381faf02..5ab2412b1a6e3944dd10c937ffd285b93ededb5e 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/plugins/testng/lib/testng-jdk15.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 3f41197d62e8260004c04c8752763adc37939213..ffb447bb506bea6c99848a9bcfbfef034b5d8301 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/trove4j.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/trove4j_src.jar!/util/src" />
       <root url="jar://$PROJECT_DIR$/lib/src/trove4j_src.jar!/src" />
index 3d7e67090fafd803fc1fa1160eed19070ffa6943..6af93284067869a2b3dfea19c99e4ca25a54bb79 100644 (file)
@@ -4,6 +4,7 @@
       <root url="jar://$PROJECT_DIR$/lib/velocity.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/commons-lang-2.4.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/velocity-1.5-src.zip!/java" />
     </SOURCES>
index d910ea261e1e8b88141d4e39a1fcaf26c183393f..1ae2bba6df3e8910a5eabf6e1f1edbae5019b387 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/xstream.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index c5dbcdcf4e97824e1de318e98d8349eda525a7cd..70f9b6a585a0239b54734dd7790f05817bd9a56a 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/xerces.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/Xerces-J-src.2.8.1.zip!/xerces-2_8_1/src" />
     </SOURCES>
index 77058a249a98cf0e503109d7f71dc1ed05e6f429..9ba2a85a0698fd2ae8b7f8e1a5255179f5922be7 100644 (file)
@@ -5,5 +5,7 @@
       <root url="jar://$PROJECT_DIR$/lib/xbean.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/resolver.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index ac9c9a5dbc945599a8d354715fa610ccf6783bfa..4dc45f5b4c2781e465b7ccfad3e52759337c05b4 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/xmlrpc-2.0.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/xmlrpc2.src.zip!/" />
     </SOURCES>
index 183a1bb65b0800f0adffa0af7a9105063f9e047f..449c600c9d8d5c391e0fdccf97affa1bf3a4a0bc 100644 (file)
@@ -4,6 +4,7 @@
       <root url="jar://$PROJECT_DIR$/lib/asm.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/asm-commons.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/asm-src.zip!/" />
     </SOURCES>
index edbee5956ef0cc5cd0adfece82e676c7c9f5b84d..3921ae1a33952282bcb9c9d1271c1fb7b05328d8 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/commons-codec-1.3.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 346eec1cf896407692f07936b2cafde95c135fc5..489c3f067ebf638b77fd2f5093a37f8ed17d055f 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/commons-collections.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/commons-collections-3.1-src.zip!/commons-collections-3.1/src/java" />
     </SOURCES>
index 735f56f94f1e5be070976c3ac01b7f5a546f85d0..ba16df792f70d1e6ca46b68883ddf69f56f15015 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/commons-lang-2.4.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index a67717822b3e1fe52a9e5b9a05c9be70d6ef84e9..73d5abb5afc107a1ee49a62b79075b4991ba4f29 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/commons-net-2.0-patched.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/commons-net-2.0-patched-src.zip!/commons-net-2.0-src/src/main/java" />
     </SOURCES>
index 1a6bfae9c4c1ed755b533d8673383376ec1f0a7d..5109f151a699c76db3c024d7a71c5dc3b2a8d05f 100644 (file)
@@ -3,5 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/jcip-annotations.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 6d2c19a1d4c8ea0b3de4877fdff191543295cde9..0acd33f16bd75b34449849277c7480f333c346cf 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/jgoodies-forms.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/jgoodies-forms-src.zip!/" />
     </SOURCES>
index 9fbb37eb48fce566115d0df3cad389f1c51251f4..8c0751775e1e287d62d110f3280af5cb1c48b939 100644 (file)
@@ -4,5 +4,7 @@
       <root url="jar://$PROJECT_DIR$/lib/jna-utils.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/jna.jar!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index 771a1df5a98fb26be834dbf78632f558a0bb1575..893e0dcc7f2a1a0fff66069b5a6dfa3278d8c32a 100644 (file)
@@ -4,5 +4,7 @@
       <root url="jar://$PROJECT_DIR$/lib/microba.jar!/" />
       <root url="jar://$PROJECT_DIR$/lib/src/microba-src.zip!/" />
     </CLASSES>
+    <JAVADOC />
+    <SOURCES />
   </library>
 </component>
\ No newline at end of file
index e07ed90f94b5ac3032ead001e4a7a67664fdebea..0850ebb24085b4cfbb40bb69d51b03a15296dca9 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/picocontainer.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/picocontainer-src.zip!/picocontainer-1_2/container/src/java" />
     </SOURCES>
index 2117ae66d48188443f63f6cb73c23cf130a671dc..e3cc93f1d7513ad0e55d0b27d3f2f165b0ffde00 100644 (file)
@@ -3,6 +3,7 @@
     <CLASSES>
       <root url="jar://$PROJECT_DIR$/lib/serviceMessages.jar!/" />
     </CLASSES>
+    <JAVADOC />
     <SOURCES>
       <root url="jar://$PROJECT_DIR$/lib/src/serviceMessages_201292_src.zip!/src" />
     </SOURCES>
index f5a152e858e60b60c1dce5d175c1daf08b7db670..6c7b87a32dd88b62f6d3265c0900809c4844d1b0 100644 (file)
@@ -3,15 +3,14 @@
   <component name="ProjectModuleManager">
     <modules>
       <module fileurl="file://$PROJECT_DIR$/plugins/InspectionGadgets/InspectionGadgetsPlugin.iml" filepath="$PROJECT_DIR$/plugins/InspectionGadgets/InspectionGadgetsPlugin.iml" group="plugins" />
+      <module fileurl="file://$PROJECT_DIR$/plugins/IntelliLang/IntelliLang.iml" filepath="$PROJECT_DIR$/plugins/IntelliLang/IntelliLang.iml" group="plugins/IntelliLang" />
       <module fileurl="file://$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-java.iml" filepath="$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-java.iml" group="plugins/IntelliLang" />
       <module fileurl="file://$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-javaee.iml" filepath="$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-javaee.iml" group="plugins/IntelliLang" />
       <module fileurl="file://$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-xml.iml" filepath="$PROJECT_DIR$/plugins/IntelliLang/IntelliLang-xml.iml" group="plugins/IntelliLang" />
-      <module fileurl="file://$PROJECT_DIR$/plugins/IntelliLang/IntelliLangJava.iml" filepath="$PROJECT_DIR$/plugins/IntelliLang/IntelliLangJava.iml" group="plugins/IntelliLang" />
       <module fileurl="file://$PROJECT_DIR$/plugins/IntentionPowerPak/IntentionPowerPackPlugin.iml" filepath="$PROJECT_DIR$/plugins/IntentionPowerPak/IntentionPowerPackPlugin.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/RegExpSupport/RegExpSupport.iml" filepath="$PROJECT_DIR$/RegExpSupport/RegExpSupport.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/annotations/annotations.iml" filepath="$PROJECT_DIR$/platform/annotations/annotations.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/plugins/ant/ant.iml" filepath="$PROJECT_DIR$/plugins/ant/ant.iml" group="plugins" />
-      <module fileurl="file://$PROJECT_DIR$/plugins/relaxng/relaxng.iml" filepath="$PROJECT_DIR$/plugins/relaxng/relaxng.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/platform/boot/boot.iml" filepath="$PROJECT_DIR$/platform/boot/boot.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/bootstrap/bootstrap.iml" filepath="$PROJECT_DIR$/platform/bootstrap/bootstrap.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/build/build.iml" filepath="$PROJECT_DIR$/build/build.iml" />
@@ -68,6 +67,7 @@
       <module fileurl="file://$PROJECT_DIR$/platform/platform-resources/platform-resources.iml" filepath="$PROJECT_DIR$/platform/platform-resources/platform-resources.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/platform-resources-en/platform-resources-en.iml" filepath="$PROJECT_DIR$/platform/platform-resources-en/platform-resources-en.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/plugins/properties/properties.iml" filepath="$PROJECT_DIR$/plugins/properties/properties.iml" group="plugins" />
+      <module fileurl="file://$PROJECT_DIR$/plugins/relaxng/relaxng.iml" filepath="$PROJECT_DIR$/plugins/relaxng/relaxng.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/resources/resources.iml" filepath="$PROJECT_DIR$/resources/resources.iml" />
       <module fileurl="file://$PROJECT_DIR$/resources-en/resources-en.iml" filepath="$PROJECT_DIR$/resources-en/resources-en.iml" />
       <module fileurl="file://$PROJECT_DIR$/platform/smRunner/smRunner.iml" filepath="$PROJECT_DIR$/platform/smRunner/smRunner.iml" group="platform" />
index 3c12c99e6c564c136a3edaf41433bd012a619570..f71917e9772dc63cfb6097b5b553d77247e93bd2 100644 (file)
@@ -15,6 +15,7 @@
             <option name="SMART_TABS" value="false" />
             <option name="LABEL_INDENT_SIZE" value="0" />
             <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+            <option name="USE_RELATIVE_INDENTS" value="false" />
           </value>
         </option>
         <option name="JSP_INDENT_OPTIONS">
@@ -26,6 +27,7 @@
             <option name="SMART_TABS" value="false" />
             <option name="LABEL_INDENT_SIZE" value="0" />
             <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+            <option name="USE_RELATIVE_INDENTS" value="false" />
           </value>
         </option>
         <option name="XML_INDENT_OPTIONS">
@@ -37,6 +39,7 @@
             <option name="SMART_TABS" value="false" />
             <option name="LABEL_INDENT_SIZE" value="0" />
             <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+            <option name="USE_RELATIVE_INDENTS" value="false" />
           </value>
         </option>
         <option name="OTHER_INDENT_OPTIONS">
@@ -48,6 +51,7 @@
             <option name="SMART_TABS" value="false" />
             <option name="LABEL_INDENT_SIZE" value="0" />
             <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+            <option name="USE_RELATIVE_INDENTS" value="false" />
           </value>
         </option>
         <option name="ELSE_ON_NEW_LINE" value="true" />
@@ -64,8 +68,6 @@
         <option name="SPACE_AFTER_TYPE_CAST" value="false" />
         <option name="FIELD_NAME_PREFIX" value="my" />
         <option name="STATIC_FIELD_NAME_PREFIX" value="our" />
-        <option name="OPTIMIZE_IMPORTS_ON_THE_FLY" value="true" />
-        <option name="ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY" value="true" />
         <option name="RIGHT_MARGIN" value="140" />
         <option name="CALL_PARAMETERS_WRAP" value="1" />
         <option name="METHOD_PARAMETERS_WRAP" value="5" />
@@ -93,6 +95,7 @@
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="groovy">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="gsp">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="haml">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="java">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="js">
           <option name="INDENT_SIZE" value="4" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="jsp">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="rb">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="sass">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="sql">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="txt">
           <option name="INDENT_SIZE" value="4" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="xml">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
         <ADDITIONAL_INDENT_OPTIONS fileType="yml">
           <option name="INDENT_SIZE" value="2" />
           <option name="SMART_TABS" value="false" />
           <option name="LABEL_INDENT_SIZE" value="0" />
           <option name="LABEL_INDENT_ABSOLUTE" value="false" />
+          <option name="USE_RELATIVE_INDENTS" value="false" />
         </ADDITIONAL_INDENT_OPTIONS>
       </value>
     </option>
index 75c3b359ab374130a083d4ad69f8e7978c8ea3bc..16d0af8f13ff3d97986cc4f500e72186843c6b73 100644 (file)
@@ -1,6 +1,6 @@
 <component name="ProjectRunConfigurationManager">
   <configuration default="false" name="IDEA" type="Application" factoryName="Application">
-    <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
+    <extension name="coverage" enabled="false" sample_coverage="true" runner="idea" merge="false" />
     <extension name="snapshooter" />
     <option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
     <option name="VM_PARAMETERS" value=" -ea -Xbootclasspath/p:../out/classes/production/boot  -Xmx192m -Didea.is.internal=true -XX:MaxPermSize=150m " />
index 156b692f32b023a9f6a1b26feef5351cb3f9e864..fdd2019888926a46841f5081ab84fd0246fd06ab 100644 (file)
Binary files a/build/lib/gant/jps-sources.zip and b/build/lib/gant/jps-sources.zip differ
index 258ade38632cbf52f1d84850cbbaf8e99ea67408..4a5b749b50e8020d1b66ee422c4122b74dc80ba0 100644 (file)
Binary files a/build/lib/gant/lib/jps.jar and b/build/lib/gant/lib/jps.jar differ
index 07e8849d3af96969aa59e94f27a2551c3ae8abae..2921df30192a754587a7dbe8d2b734713ca383df 100644 (file)
@@ -136,10 +136,12 @@ private def layoutWin(Map args, String home, Paths paths) {
   patchPropertiesFile(paths.distWin)
   ant.echo(file: "$paths.distWin/bin/idea.exe.vmoptions", message: args.vmoptions.replace(' ', '\n'))
 
-  ant.zip(zipfile: "$paths.artifacts/idea${args.buildNumber}.win.zip") {
+  def winZipPath = "$paths.artifacts/idea${args.buildNumber}.win.zip"
+  ant.zip(zipfile: winZipPath) {
     fileset(dir: paths.distAll)
     fileset(dir: paths.distWin)
   }
+  notifyArtifactBuilt(winZipPath)
 }
 
 private def layoutMac(Map args, String home, Paths paths) {
@@ -170,7 +172,8 @@ private def layoutMac(Map args, String home, Paths paths) {
 
   def root = isEap() ? "${version}-${args.buildNumber}.app" : "IntelliJ IDEA ${version} CE.app"
 
-  ant.zip(zipfile: "$paths.artifacts/idea${args.buildNumber}.mac.zip") {
+  def macZipPath = "$paths.artifacts/idea${args.buildNumber}.mac.zip"
+  ant.zip(zipfile: macZipPath) {
     [paths.distAll, paths.distMac].each {
       tarfileset(dir: it, prefix: root) {
         exclude(name: "bin/*.sh")
@@ -183,6 +186,7 @@ private def layoutMac(Map args, String home, Paths paths) {
       include(name: "Contents/MacOS/idea")
     }
   }
+  notifyArtifactBuilt(macZipPath)
 }
 
 def layoutLinux(Map args, String home, Paths paths) {
@@ -216,7 +220,9 @@ def layoutLinux(Map args, String home, Paths paths) {
     }
   }
 
-  ant.gzip(src: tarPath, zipfile: "${tarPath}.gz")
+  def gzPath = "${tarPath}.gz"
+  ant.gzip(src: tarPath, zipfile: gzPath)
   ant.delete(file: tarPath)
+  notifyArtifactBuilt(gzPath)
 }
 
index f61a8bd91d7e2fba1f39bebc4bc100cdf80d62e9..463a85a21bcfb87e92330b807b0834da259434dd 100644 (file)
@@ -159,7 +159,7 @@ def layoutFull(String home, String targetDirectory) {
       dir("IntelliLang") {
         dir("lib") {
           jar("IntelliLang.jar") {
-            module("IntelliLangJava")
+            module("IntelliLang")
             module("IntelliLang-java")
             module("IntelliLang-xml")
             module("IntelliLang-javaee")
index 8be15353d412539335952e92cd561017309469f4..5f46552722dc17d41a30a7aec71c5bd8f1971649 100644 (file)
@@ -88,3 +88,11 @@ binding.setVariable("loadProject", {
 requireProperty("home", guessHome())
 
 project.builder.buildInfoPrinter = new org.jetbrains.jps.teamcity.TeamcityBuildInfoPrinter()
+
+binding.setVariable("notifyArtifactBuilt", { String artifactPath ->
+  if (!artifactPath.startsWith(home)) {
+    project.error("Artifact path $artifactPath should start with $home")
+  }
+  def relativePath = artifactPath.substring(home.length())
+  project.info("##teamcity[publishArtifacts '$relativePath']")
+})
\ No newline at end of file
index 381f3496886b305090b4375104f33fbe35fa9595..4f7473c9ff2a75e913beeb769c497528fd077e28 100644 (file)
@@ -23,6 +23,8 @@
         <CLASSES>
           <root url="jar://$MODULE_DIR$/../../../lib/dev/compilerapi.jar!/" />
         </CLASSES>
+        <JAVADOC />
+        <SOURCES />
       </library>
     </orderEntry>
     <orderEntry type="module" module-name="lang-impl" />
similarity index 78%
rename from java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/DependencyProcessor.java
rename to java/compiler/impl/src/com/intellij/compiler/DependencyProcessor.java
index 5f09a8c25d53db58314e561362aec0db3ead0a84..dbf3703c2337d7e6f572e2e96147d4d7ecb469b2 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.intellij.compiler.impl.javaCompiler;
+package com.intellij.compiler;
 
 import com.intellij.openapi.compiler.CompileContext;
+import com.intellij.openapi.extensions.ExtensionPointName;
 
 /**
  * @author Eugene Zhuravlev
  *         Date: Aug 19, 2008
  */
 public interface DependencyProcessor {
+  ExtensionPointName<DependencyProcessor> EXTENSION_POINT_NAME = ExtensionPointName.create("com.intellij.compiler.makeDependencyProcessor");
+  
   void processDependencies(CompileContext context, int classQualifiedName);
 }
index b1f30cf4e2e57354cdddc5d125ab79e234aecfe9..230c9e999ec9fd72f9f231df4a722d2ed1d9a9dc 100644 (file)
@@ -77,15 +77,13 @@ import com.intellij.psi.PsiCompiledElement;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.PsiManager;
-import com.intellij.util.Chunk;
-import com.intellij.util.LocalTimeCounter;
-import com.intellij.util.StringBuilderSpinAllocator;
-import com.intellij.util.ThrowableRunnable;
+import com.intellij.util.*;
 import com.intellij.util.concurrency.Semaphore;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.containers.HashMap;
 import com.intellij.util.containers.MultiMap;
 import com.intellij.util.containers.OrderedSet;
+import gnu.trove.TIntHashSet;
 import gnu.trove.TObjectHashingStrategy;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
@@ -957,70 +955,149 @@ public class CompileDriver {
         final Set<FileType> generatedTypes = new HashSet<FileType>();
         Collection<VirtualFile> chunkFiles = chunkMap.get(currentChunk);
         try {
-          for (int currentCompiler = 0, translatorsLength = translators.length; currentCompiler < translatorsLength; currentCompiler++) {
-            sink.setCurrentCompilerIndex(currentCompiler);
-            final TranslatingCompiler compiler = translators[currentCompiler];
-            if (context.getProgressIndicator().isCanceled()) {
-              throw new ExitException(ExitStatus.CANCELLED);
+          int round = 0;
+          final Set<VirtualFile> filesToRecompile = new HashSet<VirtualFile>();
+          final Set<VirtualFile> allDependent = new HashSet<VirtualFile>();
+          Collection<VirtualFile> dependentFiles = Collections.emptyList();
+          final Function<Pair<int[], Set<VirtualFile>>, Pair<int[], Set<VirtualFile>>> dependencyFilter = new DependentClassesCumulativeFilter();
+          
+          do {
+            for (int currentCompiler = 0, translatorsLength = translators.length; currentCompiler < translatorsLength; currentCompiler++) {
+              sink.setCurrentCompilerIndex(currentCompiler);
+              final TranslatingCompiler compiler = translators[currentCompiler];
+              if (context.getProgressIndicator().isCanceled()) {
+                throw new ExitException(ExitStatus.CANCELLED);
+              }
+  
+              DumbService.getInstance(myProject).waitForSmartMode();
+  
+              if (round == 0) {
+                if (snapshot == null || ContainerUtil.intersects(generatedTypes, compilerManager.getRegisteredInputTypes(compiler))) {
+                  // rescan snapshot if previously generated files may influence the input of this compiler
+                  snapshot = ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile[]>() {
+                    public VirtualFile[] compute() {
+                      return context.getCompileScope().getFiles(null, true);
+                    }
+                  });
+                  recalculateChunkToFilesMap(context, sortedChunks, snapshot, chunkMap);
+                  chunkFiles = chunkMap.get(currentChunk);
+                  total = snapshot.length * translatorsLength;
+                }
+              }
+  
+              final CompileContextEx _context;
+              if (compiler instanceof IntermediateOutputCompiler) {
+                // wrap compile context so that output goes into intermediate directories
+                final IntermediateOutputCompiler _compiler = (IntermediateOutputCompiler)compiler;
+                _context = new CompileContextExProxy(context) {
+                  public VirtualFile getModuleOutputDirectory(final Module module) {
+                    return getGenerationOutputDir(_compiler, module, false);
+                  }
+  
+                  public VirtualFile getModuleOutputDirectoryForTests(final Module module) {
+                    return getGenerationOutputDir(_compiler, module, true);
+                  }
+                };
+              }
+              else {
+                _context = context;
+              }
+              final boolean compiledSomething =
+                compileSources(_context, currentChunk, compiler, chunkFiles, round == 0? forceCompile : true, isRebuild, trackDependencies, onlyCheckStatus, sink);
+  
+              processed += chunkFiles.size();
+              _context.getProgressIndicator().setFraction(((double)processed) / total);
+  
+              if (compiledSomething) {
+                generatedTypes.addAll(compilerManager.getRegisteredOutputTypes(compiler));
+              }
+  
+              if (_context.getMessageCount(CompilerMessageCategory.ERROR) > 0) {
+                throw new ExitException(ExitStatus.ERRORS);
+              }
+  
+              didSomething |= compiledSomething;
             }
 
-            DumbService.getInstance(myProject).waitForSmartMode();
+            final boolean hasUnprocessedTraverseRoots = context.getDependencyCache().hasUnprocessedTraverseRoots();
+            if (!isRebuild && (didSomething || hasUnprocessedTraverseRoots)) {
+              final Set<VirtualFile> compiledWithSuccess;
+              final Set<VirtualFile> compiledWithErrors = CacheUtils.getFilesCompiledWithErrors(context);
+              if (compiledWithErrors.isEmpty()) {
+                compiledWithSuccess = sink.getCompiledSources();
+              }
+              else {
+                compiledWithSuccess = new HashSet<VirtualFile>();
+                compiledWithSuccess.addAll(sink.getCompiledSources());
+                compiledWithSuccess.removeAll(compiledWithErrors);
+              }
+              filesToRecompile.removeAll(compiledWithSuccess);
+              filesToRecompile.addAll(compiledWithErrors);
 
-            if (snapshot == null || ContainerUtil.intersects(generatedTypes, compilerManager.getRegisteredInputTypes(compiler))) {
-              // rescan snapshot if previously generated files may influence the input of this compiler
-              snapshot = ApplicationManager.getApplication().runReadAction(new Computable<VirtualFile[]>() {
-                public VirtualFile[] compute() {
-                  return context.getCompileScope().getFiles(null, true);
-                }
-              });
-              final Map<Module, List<VirtualFile>> moduleToFilesMap = CompilerUtil.buildModuleToFilesMap(context, snapshot);
-              for (Chunk<Module> moduleChunk : sortedChunks) {
-                List<VirtualFile> files = Collections.emptyList();
-                for (Module module : moduleChunk.getNodes()) {
-                  final List<VirtualFile> moduleFiles = moduleToFilesMap.get(module);
-                  if (moduleFiles != null) {
-                    files = ContainerUtil.concat(files, moduleFiles);
+              dependentFiles = CacheUtils.findDependentFiles(context, compiledWithSuccess, dependencyFilter);
+
+              if (ourDebugMode) {
+                if (!dependentFiles.isEmpty()) {
+                  for (VirtualFile dependentFile : dependentFiles) {
+                    System.out.println("FOUND TO RECOMPILE: " + dependentFile.getPresentableUrl());
                   }
                 }
-                chunkMap.put(moduleChunk, files);
+                else {
+                  System.out.println("NO FILES TO RECOMPILE");
+                }
               }
-              total = snapshot.length * translatorsLength;
-              chunkFiles = chunkMap.get(currentChunk);
-            }
 
-            final CompileContextEx _context;
-            if (compiler instanceof IntermediateOutputCompiler) {
-              // wrap compile context so that output goes into intermediate directories
-              final IntermediateOutputCompiler _compiler = (IntermediateOutputCompiler)compiler;
-              _context = new CompileContextExProxy(context) {
-                public VirtualFile getModuleOutputDirectory(final Module module) {
-                  return getGenerationOutputDir(_compiler, module, false);
+              if (!dependentFiles.isEmpty()) {
+                filesToRecompile.addAll(dependentFiles);
+                allDependent.addAll(dependentFiles);
+                if (context.getProgressIndicator().isCanceled() || context.getMessageCount(CompilerMessageCategory.ERROR) > 0) {
+                  break;
                 }
-
-                public VirtualFile getModuleOutputDirectoryForTests(final Module module) {
-                  return getGenerationOutputDir(_compiler, module, true);
+                final List<VirtualFile> filesInScope = getFilesInScope(context, currentChunk, dependentFiles);
+                if (filesInScope.isEmpty()) {
+                  break;
                 }
-              };
-            }
-            else {
-              _context = context;
+                context.getDependencyCache().clearTraverseRoots();
+                chunkFiles = filesInScope;
+                total += chunkFiles.size() * translators.length;
+              }
+              
+              didSomething |= (hasUnprocessedTraverseRoots != context.getDependencyCache().hasUnprocessedTraverseRoots());
             }
-            final boolean compiledSomething =
-              compileSources(_context, currentChunk, compiler, chunkFiles, forceCompile, isRebuild, trackDependencies, onlyCheckStatus, sink);
 
-            processed += chunkFiles.size();
-            _context.getProgressIndicator().setFraction(((double)processed) / total);
+            round++;
+          }
+          while (!dependentFiles.isEmpty() && context.getMessageCount(CompilerMessageCategory.ERROR) == 0);
 
-            if (compiledSomething) {
-              generatedTypes.addAll(compilerManager.getRegisteredOutputTypes(compiler));
-            }
+          if (CompilerConfiguration.MAKE_ENABLED) {
+            if (!context.getProgressIndicator().isCanceled()) {
+              // when cancelled pretend nothing was compiled and next compile will compile everything from the scratch
+              final ProgressIndicator indicator = context.getProgressIndicator();
+              final DependencyCache cache = context.getDependencyCache();
 
-            if (_context.getMessageCount(CompilerMessageCategory.ERROR) > 0) {
-              throw new ExitException(ExitStatus.ERRORS);
-            }
+              indicator.pushState();
+              indicator.setText(CompilerBundle.message("progress.updating.caches"));
+              indicator.setText2("");
+
+              cache.update();
+
+              indicator.setText(CompilerBundle.message("progress.saving.caches"));
+              cache.resetState();
 
-            didSomething |= compiledSomething;
+              indicator.popState();
+            }
+          }
+          
+          if (context.getMessageCount(CompilerMessageCategory.ERROR) != 0) {
+            filesToRecompile.addAll(allDependent);
           }
+          if (filesToRecompile.size() > 0) {
+            sink.add(null, Collections.<TranslatingCompiler.OutputItem>emptyList(), VfsUtil.toVirtualFileArray(filesToRecompile));
+          }
+        }
+        catch (CacheCorruptedException e) {
+          LOG.info(e);
+          context.requestRebuildNextTime(e.getMessage());
         }
         finally {
           if (context.getMessageCount(CompilerMessageCategory.ERROR) == 0) {
@@ -1034,7 +1111,7 @@ public class CompileDriver {
       ProgressManager.getInstance().executeNonCancelableSection(new Runnable() {
         public void run() {
           try {
-            final Collection<VirtualFile> deps = CacheUtils.findDependentFiles(context, Collections.<VirtualFile>emptySet(), null, null);
+            final Collection<VirtualFile> deps = CacheUtils.findDependentFiles(context, Collections.<VirtualFile>emptySet(), null);
             if (deps.size() > 0) {
               TranslatingCompilerFilesMonitor.getInstance().update(context, null, Collections.<TranslatingCompiler.OutputItem>emptyList(),
                                                                    VfsUtil.toVirtualFileArray(deps));
@@ -1059,6 +1136,37 @@ public class CompileDriver {
     return didSomething;
   }
 
+  private static List<VirtualFile> getFilesInScope(final CompileContextEx context, final Chunk<Module> chunk, final Collection<VirtualFile> files) {
+    final List<VirtualFile> filesInScope = new ArrayList<VirtualFile>(files.size());
+    ApplicationManager.getApplication().runReadAction(new Runnable() {
+      public void run() {
+        for (VirtualFile file : files) {
+          if (context.getCompileScope().belongs(file.getUrl())) {
+            final Module module = context.getModuleByFile(file);
+            if (chunk.getNodes().contains(module)) {
+              filesInScope.add(file);
+            }
+          }
+        }
+      }
+    });
+    return filesInScope;
+  }
+
+  private static void recalculateChunkToFilesMap(CompileContextEx context, List<Chunk<Module>> allChunks, VirtualFile[] snapshot, Map<Chunk<Module>, Collection<VirtualFile>> chunkMap) {
+    final Map<Module, List<VirtualFile>> moduleToFilesMap = CompilerUtil.buildModuleToFilesMap(context, snapshot);
+    for (Chunk<Module> moduleChunk : allChunks) {
+      List<VirtualFile> files = Collections.emptyList();
+      for (Module module : moduleChunk.getNodes()) {
+        final List<VirtualFile> moduleFiles = moduleToFilesMap.get(module);
+        if (moduleFiles != null) {
+          files = ContainerUtil.concat(files, moduleFiles);
+        }
+      }
+      chunkMap.put(moduleChunk, files);
+    }
+  }
+
   private interface FileProcessingCompilerAdapterFactory {
     FileProcessingCompilerAdapter create(CompileContext context, FileProcessingCompiler compiler);
   }
@@ -1167,11 +1275,14 @@ public class CompileDriver {
                   final ArrayList<Trinity<File, String, Boolean>> toDelete = new ArrayList<Trinity<File, String, Boolean>>();
                   ApplicationManager.getApplication().runReadAction(new Runnable() {
                     public void run() {
-                      TranslatingCompilerFilesMonitor.getInstance()
-                        .collectFiles(context, (TranslatingCompiler)compiler, Arrays.<VirtualFile>asList(allSources).iterator(), true
-                                      /*pass true to make sure that every source in scope file is processed*/, false
-                                      /*important! should pass false to enable collection of files to delete*/,
-                                      new ArrayList<VirtualFile>(), toDelete);
+                      TranslatingCompilerFilesMonitor.getInstance().collectFiles(
+                        context, 
+                        (TranslatingCompiler)compiler, Arrays.<VirtualFile>asList(allSources).iterator(), 
+                        true /*pass true to make sure that every source in scope file is processed*/, 
+                        false /*important! should pass false to enable collection of files to delete*/,
+                        new ArrayList<VirtualFile>(), 
+                        toDelete
+                      );
                     }
                   });
                   for (Trinity<File, String, Boolean> trinity : toDelete) {
@@ -1532,7 +1643,6 @@ public class CompileDriver {
     context.getProgressIndicator().pushState();
 
     final boolean[] wereFilesDeleted = new boolean[]{false};
-    boolean traverseRootsProcessed = false;
     try {
       ApplicationManager.getApplication().runReadAction(new Runnable() {
         public void run() {
@@ -1589,16 +1699,14 @@ public class CompileDriver {
         }
       }
 
-      final boolean hadUnprocessedTraverseRoots = context.getDependencyCache().hasUnprocessedTraverseRoots();
-      if ((wereFilesDeleted[0] || hadUnprocessedTraverseRoots || !toCompile.isEmpty()) && context.getMessageCount(CompilerMessageCategory.ERROR) == 0) {
+      if ((wereFilesDeleted[0] || !toCompile.isEmpty()) && context.getMessageCount(CompilerMessageCategory.ERROR) == 0) {
         compiler.compile(context, moduleChunk, VfsUtil.toVirtualFileArray(toCompile), sink);
-        traverseRootsProcessed = hadUnprocessedTraverseRoots != context.getDependencyCache().hasUnprocessedTraverseRoots();
       }
     }
     finally {
       context.getProgressIndicator().popState();
     }
-    return !toCompile.isEmpty() || traverseRootsProcessed || wereFilesDeleted[0];
+    return !toCompile.isEmpty() || wereFilesDeleted[0];
   }
 
   private static boolean syncOutputDir(final CompileContextEx context, final Collection<Trinity<File, String, Boolean>> toDelete) throws CacheCorruptedException {
@@ -2277,6 +2385,7 @@ public class CompileDriver {
     private final CompileContextEx myContext;
     private final TranslatingCompiler[] myCompilers;
     private int myCurrentCompilerIdx;
+    private final Set<VirtualFile> myCompiledSources = new HashSet<VirtualFile>();
     //private LinkedBlockingQueue<Future> myFutures = new LinkedBlockingQueue<Future>();
 
     private TranslatorsOutputSink(CompileContextEx context, TranslatingCompiler[] compilers) {
@@ -2288,7 +2397,17 @@ public class CompileDriver {
       myCurrentCompilerIdx = index;
     }
 
+    public Set<VirtualFile> getCompiledSources() {
+      return Collections.unmodifiableSet(myCompiledSources);
+    }
+
     public void add(final String outputRoot, final Collection<TranslatingCompiler.OutputItem> items, final VirtualFile[] filesToRecompile) {
+      for (TranslatingCompiler.OutputItem item : items) {
+        final VirtualFile file = item.getSourceFile();
+        if (file != null) {
+          myCompiledSources.add(file);
+        }
+      }
       final TranslatingCompiler compiler = myCompilers[myCurrentCompilerIdx];
       if (compiler instanceof IntermediateOutputCompiler) {
         final LocalFileSystem lfs = LocalFileSystem.getInstance();
@@ -2368,7 +2487,7 @@ public class CompileDriver {
       }
     }
 
-    private void addItemToMap(Map<String, Collection<TranslatingCompiler.OutputItem>> map, String outputDir, TranslatingCompiler.OutputItem item) {
+    private static void addItemToMap(Map<String, Collection<TranslatingCompiler.OutputItem>> map, String outputDir, TranslatingCompiler.OutputItem item) {
       Collection<TranslatingCompiler.OutputItem> collection = map.get(outputDir);
       if (collection == null) {
         collection = new ArrayList<TranslatingCompiler.OutputItem>();
@@ -2392,4 +2511,21 @@ public class CompileDriver {
       }
     }
   }
+
+  private static class DependentClassesCumulativeFilter implements Function<Pair<int[], Set<VirtualFile>>, Pair<int[], Set<VirtualFile>>> {
+
+    private final TIntHashSet myProcessedNames = new TIntHashSet();
+    private final Set<VirtualFile> myProcessedFiles = new HashSet<VirtualFile>();
+
+    public Pair<int[], Set<VirtualFile>> fun(Pair<int[], Set<VirtualFile>> deps) {
+      final TIntHashSet currentDeps = new TIntHashSet(deps.getFirst());
+      currentDeps.removeAll(myProcessedNames.toArray());
+      myProcessedNames.addAll(deps.getFirst());
+
+      final Set<VirtualFile> depFiles = new HashSet<VirtualFile>(deps.getSecond());
+      depFiles.removeAll(myProcessedFiles);
+      myProcessedFiles.addAll(deps.getSecond());
+      return new Pair<int[], Set<VirtualFile>>(currentDeps.toArray(), depFiles);
+    }
+  }
 }
index 5c8a5679c08c213bb63e388b0dbd386eeb92172a..f4abe40f4b9d0aaeac5da295b40a9efd4dfc8e02 100644 (file)
@@ -1212,9 +1212,22 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
               if (srcFile != null) {
                 final SourceFileInfo srcInfo = loadSourceInfo(srcFile);
                 if (srcInfo != null) {
+                  final boolean srcWillBeDeleted = VfsUtil.isAncestor(eventFile, srcFile, false);
                   for (int projectId : srcInfo.getProjectIds().toArray()) {
                     if (srcInfo.isAssociated(projectId, filePath)) {
-                      addSourceForRecompilation(projectId, srcFile, srcInfo);
+                      if (srcWillBeDeleted) {
+                        if (LOG.isDebugEnabled() || ourDebugMode) {
+                          final String message = "Unschedule recompilation because of deletion " + srcFile.getPresentableUrl();
+                          LOG.debug(message);
+                          if (ourDebugMode) {
+                            System.out.println(message);
+                          }
+                        }
+                        removeSourceForRecompilation(projectId, Math.abs(getFileId(srcFile)));
+                      }
+                      else {
+                        addSourceForRecompilation(projectId, srcFile, srcInfo);
+                      }
                     }
                   }
                 }
@@ -1226,6 +1239,8 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
               final TIntHashSet projects = srcInfo.getProjectIds();
               if (!projects.isEmpty()) {
                 final ScheduleOutputsForDeletionProc deletionProc = new ScheduleOutputsForDeletionProc(file.getUrl());
+                deletionProc.setRootBeingDeleted(eventFile);
+                final int sourceFileId = Math.abs(getFileId(file));
                 for (int projectId : projects.toArray()) {
                   // mark associated outputs for deletion
                   srcInfo.processOutputPaths(projectId, deletionProc);
@@ -1236,7 +1251,7 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
                       System.out.println(message);
                     }
                   }
-                  removeSourceForRecompilation(projectId, Math.abs(getFileId(file)));
+                  removeSourceForRecompilation(projectId, sourceFileId);
                 }
               }
             }
@@ -1381,18 +1396,29 @@ public class TranslatingCompilerFilesMonitor implements ApplicationComponent {
   private class ScheduleOutputsForDeletionProc implements Proc {
     private final String mySrcUrl;
     private final LocalFileSystem myFileSystem;
+    @Nullable
+    private VirtualFile myRootBeingDeleted;
 
     private ScheduleOutputsForDeletionProc(final String srcUrl) {
       mySrcUrl = srcUrl;
       myFileSystem = LocalFileSystem.getInstance();
     }
 
+    public void setRootBeingDeleted(@Nullable VirtualFile rootBeingDeleted) {
+      myRootBeingDeleted = rootBeingDeleted;
+    }
+
     public boolean execute(final int projectId, String outputPath) {
       final VirtualFile outFile = myFileSystem.findFileByPath(outputPath);
       if (outFile != null) { // not deleted yet
-        final OutputFileInfo outputInfo = loadOutputInfo(outFile);
-        final String classname = outputInfo != null? outputInfo.getClassName() : null;
-        markOutputPathForDeletion(projectId, outputPath, classname, mySrcUrl);
+        if (myRootBeingDeleted != null && VfsUtil.isAncestor(myRootBeingDeleted, outFile, false)) {
+          unmarkOutputPathForDeletion(outputPath);
+        }
+        else {
+          final OutputFileInfo outputInfo = loadOutputInfo(outFile);
+          final String classname = outputInfo != null? outputInfo.getClassName() : null;
+          markOutputPathForDeletion(projectId, outputPath, classname, mySrcUrl);
+        }
       }
       return true;
     }
index 7659c56a39275768241295b3a839bad3da68326e..9da4a3952bafffe49a07f06a0a60cd156d28ada5 100644 (file)
@@ -47,6 +47,4 @@ public interface BackendCompiler {
 
   void compileFinished();
 
-  @Nullable
-  DependencyProcessor getDependencyProcessor();
 }
index ff0ee19259cbbe7ddfc48954f0c12c6b29dac049..3e41738c0d3ee5aa31686f336a758f9c8a920f88 100644 (file)
@@ -26,7 +26,10 @@ import com.intellij.compiler.*;
 import com.intellij.compiler.classParsing.AnnotationConstantValue;
 import com.intellij.compiler.classParsing.MethodInfo;
 import com.intellij.compiler.impl.CompilerUtil;
-import com.intellij.compiler.make.*;
+import com.intellij.compiler.make.Cache;
+import com.intellij.compiler.make.CacheCorruptedException;
+import com.intellij.compiler.make.DependencyCache;
+import com.intellij.compiler.make.MakeUtil;
 import com.intellij.compiler.notNullVerification.NotNullVerifyingInstrumenter;
 import com.intellij.ide.util.projectWizard.JavaModuleBuilder;
 import com.intellij.openapi.application.Application;
@@ -38,7 +41,6 @@ import com.intellij.openapi.fileTypes.FileTypeManager;
 import com.intellij.openapi.module.JavaModuleType;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleType;
-import com.intellij.openapi.progress.ProgressIndicator;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.projectRoots.JavaSdkType;
 import com.intellij.openapi.projectRoots.Sdk;
@@ -52,10 +54,8 @@ import com.intellij.openapi.vfs.LocalFileSystem;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.util.Chunk;
-import com.intellij.util.Function;
 import com.intellij.util.cls.ClsFormatException;
 import gnu.trove.THashMap;
-import gnu.trove.TIntHashSet;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
@@ -74,20 +74,18 @@ public class BackendCompilerWrapper {
   private static final Logger LOG = Logger.getInstance("#com.intellij.compiler.impl.javaCompiler.BackendCompilerWrapper");
 
   private final BackendCompiler myCompiler;
-  private final Set<VirtualFile> mySuccesfullyCompiledJavaFiles; // VirtualFile
 
   private final CompileContextEx myCompileContext;
   private final List<VirtualFile> myFilesToCompile;
   private final TranslatingCompiler.OutputSink mySink;
   private final Chunk<Module> myChunk;
   private final Project myProject;
-  private final Set<VirtualFile> myFilesToRecompile;
   private final Map<Module, VirtualFile> myModuleToTempDirMap = new THashMap<Module, VirtualFile>();
   private final ProjectFileIndex myProjectFileIndex;
   @NonNls private static final String PACKAGE_ANNOTATION_FILE_NAME = "package-info.java";
   private static final FileObject myStopThreadToken = new FileObject(new File(""), new byte[0]);
   public final Map<String, Set<CompiledClass>> myFileNameToSourceMap=  new THashMap<String, Set<CompiledClass>>();
-
+  private final Set<VirtualFile> myProcessedPackageInfos = new HashSet<VirtualFile>();
 
   public BackendCompilerWrapper(Chunk<Module> chunk, @NotNull final Project project,
                                 @NotNull List<VirtualFile> filesToCompile,
@@ -98,44 +96,19 @@ public class BackendCompilerWrapper {
     myCompiler = compiler;
     myCompileContext = compileContext;
     myFilesToCompile = filesToCompile;
-    myFilesToRecompile = new HashSet<VirtualFile>(filesToCompile);
     mySink = sink;
     myProjectFileIndex = ProjectRootManager.getInstance(myProject).getFileIndex();
-    mySuccesfullyCompiledJavaFiles = new HashSet<VirtualFile>(filesToCompile.size());
   }
 
   public void compile() throws CompilerException, CacheCorruptedException {
     Application application = ApplicationManager.getApplication();
-    final Set<VirtualFile> allDependent = new HashSet<VirtualFile>();
-    COMPILE:
     try {
       if (!myFilesToCompile.isEmpty()) {
         if (application.isUnitTestMode()) {
           saveTestData();
         }
-
         compileModules(buildModuleToFilesMap(myFilesToCompile));
       }
-
-      Collection<VirtualFile> dependentFiles;
-      do {
-        dependentFiles = CacheUtils.findDependentFiles(myCompileContext, mySuccesfullyCompiledJavaFiles, myCompiler.getDependencyProcessor(), DEPENDENCY_FILTER);
-
-        if (!dependentFiles.isEmpty()) {
-          myFilesToRecompile.addAll(dependentFiles);
-          allDependent.addAll(dependentFiles);
-          if (myCompileContext.getProgressIndicator().isCanceled() || myCompileContext.getMessageCount(CompilerMessageCategory.ERROR) > 0) {
-            break COMPILE;
-          }
-          final List<VirtualFile> filesInScope = getFilesInScope(dependentFiles);
-          if (filesInScope.isEmpty()) {
-            break;
-          }
-          myCompileContext.getDependencyCache().clearTraverseRoots();
-          compileModules(buildModuleToFilesMap(filesInScope));
-        }
-      }
-      while (!dependentFiles.isEmpty() && myCompileContext.getMessageCount(CompilerMessageCategory.ERROR) == 0);
     }
     catch (SecurityException e) {
       throw new CompilerException(CompilerBundle.message("error.compiler.process.not.started", e.getMessage()), e);
@@ -153,34 +126,22 @@ public class BackendCompilerWrapper {
       myModuleToTempDirMap.clear();
     }
 
-    // do not update caches if cancelled because there is a chance that they will be incomplete
-    if (CompilerConfiguration.MAKE_ENABLED) {
-      if (!myCompileContext.getProgressIndicator().isCanceled()) {
-        // when cancelled pretend nothing was compiled and next compile will compile everything from the scratch
-        final ProgressIndicator indicator = myCompileContext.getProgressIndicator();
-        final DependencyCache cache = myCompileContext.getDependencyCache();
-
-        indicator.pushState();
-        indicator.setText(CompilerBundle.message("progress.updating.caches"));
-        indicator.setText2("");
-
-        cache.update();
-
-        indicator.setText(CompilerBundle.message("progress.saving.caches"));
-        cache.resetState();
-
-        indicator.popState();
+    if (!myFilesToCompile.isEmpty() && myCompileContext.getMessageCount(CompilerMessageCategory.ERROR) == 0) {
+      // package-info.java hack
+      final List<TranslatingCompiler.OutputItem> outputs = new ArrayList<TranslatingCompiler.OutputItem>();
+      ApplicationManager.getApplication().runReadAction(new Runnable() {
+        public void run() {
+          for (final VirtualFile file : myFilesToCompile) {
+            if (PACKAGE_ANNOTATION_FILE_NAME.equals(file.getName()) && !myProcessedPackageInfos.contains(file)) {
+              outputs.add(new OutputItemImpl(file));
+            }
+          }
+        }
+      });
+      if (!outputs.isEmpty()) {
+        mySink.add(null, outputs, VirtualFile.EMPTY_ARRAY);
       }
     }
-
-    myFilesToRecompile.removeAll(mySuccesfullyCompiledJavaFiles);
-    if (myCompileContext.getMessageCount(CompilerMessageCategory.ERROR) != 0) {
-      myFilesToRecompile.addAll(allDependent);
-    }
-    final List<TranslatingCompiler.OutputItem> outputs = processPackageInfoFiles();
-    if (myFilesToRecompile.size() > 0 || outputs.size() > 0) {
-      mySink.add(null, outputs, VfsUtil.toVirtualFileArray(myFilesToRecompile));
-    }
   }
 
   private Map<Module, List<VirtualFile>> buildModuleToFilesMap(final List<VirtualFile> filesToCompile) {
@@ -190,51 +151,6 @@ public class BackendCompilerWrapper {
     return CompilerUtil.buildModuleToFilesMap(myCompileContext, filesToCompile);
   }
 
-  // package-info.java hack
-  private List<TranslatingCompiler.OutputItem> processPackageInfoFiles() {
-    if (myFilesToRecompile.isEmpty()) {
-      return Collections.emptyList();
-    }
-    final List<TranslatingCompiler.OutputItem> outputs = new ArrayList<TranslatingCompiler.OutputItem>();
-    ApplicationManager.getApplication().runReadAction(new Runnable() {
-      public void run() {
-        final List<VirtualFile> packageInfoFiles = new ArrayList<VirtualFile>(myFilesToRecompile.size());
-        for (final VirtualFile file : myFilesToRecompile) {
-          if (PACKAGE_ANNOTATION_FILE_NAME.equals(file.getName())) {
-            packageInfoFiles.add(file);
-          }
-        }
-        if (!packageInfoFiles.isEmpty()) {
-          final Set<VirtualFile> badFiles = getFilesCompiledWithErrors();
-          for (final VirtualFile packageInfoFile : packageInfoFiles) {
-            if (!badFiles.contains(packageInfoFile)) {
-              outputs.add(new OutputItemImpl(packageInfoFile));
-              myFilesToRecompile.remove(packageInfoFile);
-            }
-          }
-        }
-      }
-    });
-    return outputs;
-  }
-
-  private List<VirtualFile> getFilesInScope(final Collection<VirtualFile> files) {
-    final List<VirtualFile> filesInScope = new ArrayList<VirtualFile>(files.size());
-    ApplicationManager.getApplication().runReadAction(new Runnable() {
-      public void run() {
-        for (VirtualFile file : files) {
-          if (myCompileContext.getCompileScope().belongs(file.getUrl())) {
-            final Module module = myCompileContext.getModuleByFile(file);
-            if (myChunk.getNodes().contains(module)) {
-              filesInScope.add(file);
-            }
-          }
-        }
-      }
-    });
-    return filesInScope;
-  }
-
   private void compileModules(final Map<Module, List<VirtualFile>> moduleToFilesMap) throws CompilerException {
     myProcessedFilesCount = 0;
     try {
@@ -347,21 +263,6 @@ public class BackendCompilerWrapper {
     });
   }
 
-  private final TIntHashSet myProcessedNames = new TIntHashSet();
-  private final Set<VirtualFile> myProcessedFiles = new HashSet<VirtualFile>();
-  private final Function<Pair<int[], Set<VirtualFile>>, Pair<int[], Set<VirtualFile>>> DEPENDENCY_FILTER = new Function<Pair<int[], Set<VirtualFile>>, Pair<int[], Set<VirtualFile>>>() {
-    public Pair<int[], Set<VirtualFile>> fun(Pair<int[], Set<VirtualFile>> deps) {
-      final TIntHashSet currentDeps = new TIntHashSet(deps.getFirst());
-      currentDeps.removeAll(myProcessedNames.toArray());
-      myProcessedNames.addAll(deps.getFirst());
-
-      final Set<VirtualFile> depFiles = new HashSet<VirtualFile>(deps.getSecond());
-      depFiles.removeAll(myProcessedFiles);
-      myProcessedFiles.addAll(deps.getSecond());
-      return new Pair<int[], Set<VirtualFile>>(currentDeps.toArray(), depFiles);
-    }
-  };
-
   private final Object lock = new Object();
 
   private class SynchedCompilerParsing extends CompilerParsingThread {
@@ -599,8 +500,7 @@ public class BackendCompilerWrapper {
   }
 
   private void compileFinished(int exitValue, final ModuleChunk chunk, final String outputDir) {
-    if (exitValue != 0 && !myCompileContext.getProgressIndicator().isCanceled() &&
-        myCompileContext.getMessageCount(CompilerMessageCategory.ERROR) == 0) {
+    if (exitValue != 0 && !myCompileContext.getProgressIndicator().isCanceled() && myCompileContext.getMessageCount(CompilerMessageCategory.ERROR) == 0) {
       myCompileContext.addMessage(CompilerMessageCategory.ERROR, CompilerBundle.message("error.compiler.internal.error", exitValue), null, -1, -1);
     }
 
@@ -610,7 +510,6 @@ public class BackendCompilerWrapper {
     try {
       ApplicationManager.getApplication().runReadAction(new Runnable() {
         public void run() {
-          final Set<VirtualFile> compiledWithErrors = getFilesCompiledWithErrors();
           final FileTypeManager typeManager = FileTypeManager.getInstance();
           final String outputDirPath = outputDir.replace(File.separatorChar, '/');
           try {
@@ -620,7 +519,7 @@ public class BackendCompilerWrapper {
                 if (LOG.isDebugEnabled()) {
                   LOG.debug("Building output items for " + root.getPresentableUrl() + "; output dir = " + outputDirPath + "; packagePrefix = \"" + packagePrefix + "\"");
                 }
-                buildOutputItemsList(outputDirPath, module, root, typeManager, compiledWithErrors, root, packagePrefix, toRefresh, results);
+                buildOutputItemsList(outputDirPath, module, root, typeManager, root, packagePrefix, toRefresh, results);
               }
             }
           }
@@ -644,24 +543,8 @@ public class BackendCompilerWrapper {
     myFileNameToSourceMap.clear(); // clear the map before the next use
   }
 
-  private Set<VirtualFile> getFilesCompiledWithErrors() {
-    CompilerMessage[] messages = myCompileContext.getMessages(CompilerMessageCategory.ERROR);
-    Set<VirtualFile> compiledWithErrors = Collections.emptySet();
-    if (messages.length > 0) {
-      compiledWithErrors = new HashSet<VirtualFile>(messages.length);
-      for (CompilerMessage message : messages) {
-        final VirtualFile file = message.getVirtualFile();
-        if (file != null) {
-          compiledWithErrors.add(file);
-        }
-      }
-    }
-    return compiledWithErrors;
-  }
-
   private void buildOutputItemsList(final String outputDir, Module module, VirtualFile from,
                                     final FileTypeManager typeManager,
-                                    final Set<VirtualFile> compiledWithErrors,
                                     final VirtualFile sourceRoot,
                                     final String packagePrefix, final List<File> filesToRefresh, final Map<String, Collection<TranslatingCompiler.OutputItem>> results) throws CacheCorruptedException {
     final Ref<CacheCorruptedException> exRef = new Ref<CacheCorruptedException>(null);
@@ -671,7 +554,7 @@ public class BackendCompilerWrapper {
         try {
           assert child.isValid();
           if (!child.isDirectory() && myCompiler.getCompilableFileTypes().contains(typeManager.getFileTypeByFile(child))) {
-            updateOutputItemsList(outputDir, child, compiledWithErrors, sourceRoot, packagePrefix, filesToRefresh, results);
+            updateOutputItemsList(outputDir, child, sourceRoot, packagePrefix, filesToRefresh, results);
           }
           return true;
         }
@@ -720,7 +603,7 @@ public class BackendCompilerWrapper {
     paths.add(new CompiledClass(classQName, relativePathToSource, pathToClass));
   }
 
-  private void updateOutputItemsList(final String outputDir, VirtualFile srcFile, Set<VirtualFile> compiledWithErrors,
+  private void updateOutputItemsList(final String outputDir, VirtualFile srcFile,
                                      VirtualFile sourceRoot,
                                      final String packagePrefix, final List<File> filesToRefresh,
                                      Map<String, Collection<TranslatingCompiler.OutputItem>> results) throws CacheCorruptedException {
@@ -745,6 +628,9 @@ public class BackendCompilerWrapper {
             results.put(realLocation.getFirst(), outputs);
           }
           outputs.add(new OutputItemImpl(realLocation.getSecond(), srcFile));
+          if (PACKAGE_ANNOTATION_FILE_NAME.equals(srcFile.getName())) {
+            myProcessedPackageInfos.add(srcFile);
+          }
           if (CompilerConfiguration.MAKE_ENABLED) {
             newCache.setPath(cc.qName, realLocation.getSecond());
           }
@@ -752,9 +638,6 @@ public class BackendCompilerWrapper {
             LOG.debug("Added output item: [outputDir; outputPath; sourceFile]  = [" + realLocation.getFirst() + "; " +
                       realLocation.getSecond() + "; " + srcFile.getPresentableUrl() + "]");
           }
-          if (!compiledWithErrors.contains(srcFile)) {
-            mySuccesfullyCompiledJavaFiles.add(srcFile);
-          }
         }
         else {
           myCompileContext.addMessage(CompilerMessageCategory.ERROR, "Failed to copy from temporary location to output directory: " + outputPath + " (see idea.log for details)", null, -1, -1);
@@ -773,7 +656,7 @@ public class BackendCompilerWrapper {
    * @param packagePrefix
    * @return A 'package'-path to a given src file relative to a specified root. "/" slashes must be used
    */
-  protected String calcPackagePath(VirtualFile srcFile, VirtualFile sourceRoot, String packagePrefix) {
+  protected static String calcPackagePath(VirtualFile srcFile, VirtualFile sourceRoot, String packagePrefix) {
     final String prefix = packagePrefix != null && packagePrefix.length() > 0 ? packagePrefix.replace('.', '/') + "/" : "";
     return prefix + VfsUtil.getRelativePath(srcFile, sourceRoot, '/');
   }
index 22a9f66d715c7642468654bffb2f44bd56efa9e3..c882cc2c27de8825844b7b7fb66544e6fa43d125 100644 (file)
@@ -41,10 +41,6 @@ public abstract class ExternalCompiler implements BackendCompiler {
     return COMPILABLE_TYPES;
   }
 
-  public DependencyProcessor getDependencyProcessor() {
-    return null;
-  }
-
   @NotNull
   public Process launchProcess(@NotNull final ModuleChunk chunk, @NotNull final String outputDir, @NotNull final CompileContext compileContext) throws IOException {
     final String[] commands = createStartupCommand(chunk, compileContext, outputDir);
index a70bd9418afe875fc965bbce0b9af83a79c5b06f..110b05a05edccf7903f97a3c334f6c6a9d35a76e 100644 (file)
@@ -17,7 +17,6 @@ package com.intellij.compiler.impl.javaCompiler.api;
 
 import com.intellij.compiler.OutputParser;
 import com.intellij.compiler.impl.javaCompiler.BackendCompiler;
-import com.intellij.compiler.impl.javaCompiler.DependencyProcessor;
 import com.intellij.compiler.impl.javaCompiler.ModuleChunk;
 import com.intellij.compiler.impl.javaCompiler.javac.JavacCompiler;
 import com.intellij.compiler.impl.javaCompiler.javac.JavacConfigurable;
@@ -56,10 +55,6 @@ public class CompilerAPICompiler implements BackendCompiler {
     myProject = project;
   }
 
-  public DependencyProcessor getDependencyProcessor() {
-    return null;
-  }
-
   public boolean checkCompiler(final CompileScope scope) {
     return true;
   }
index 29febbecc1ea514eaa80cf6426cad7b1f7e51cb5..550543ec277998c112436dab8d6930846df0ebf7 100644 (file)
@@ -17,7 +17,6 @@ package com.intellij.compiler.impl.javaCompiler.eclipse;
 
 import com.intellij.compiler.OutputParser;
 import com.intellij.compiler.impl.javaCompiler.BackendCompiler;
-import com.intellij.compiler.impl.javaCompiler.DependencyProcessor;
 import com.intellij.compiler.impl.javaCompiler.ModuleChunk;
 import com.intellij.compiler.impl.javaCompiler.javac.JavacSettings;
 import com.intellij.openapi.application.ApplicationManager;
@@ -58,10 +57,6 @@ public class EclipseEmbeddedCompiler implements BackendCompiler {
     myEclipseCompilerDriver = new EclipseCompilerDriver();
   }
 
-  public DependencyProcessor getDependencyProcessor() {
-    return null;
-  }
-
   public boolean checkCompiler(final CompileScope scope) {
     return myEclipseCompilerDriver != null && myEclipseExternalCompiler.checkCompiler(scope);
   }
index e2ce0fa640d71d3ceabec6ee3fcc59d39ad32f5b..69bfd9d5254d5b14f94c1febb656bd52310fe3c1 100644 (file)
@@ -19,9 +19,10 @@ import com.intellij.compiler.CompilerConfiguration;
 import com.intellij.compiler.CompilerManagerImpl;
 import com.intellij.compiler.SymbolTable;
 import com.intellij.compiler.classParsing.MethodInfo;
-import com.intellij.compiler.impl.javaCompiler.DependencyProcessor;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.compiler.CompilerBundle;
+import com.intellij.openapi.compiler.CompilerMessage;
+import com.intellij.openapi.compiler.CompilerMessageCategory;
 import com.intellij.openapi.compiler.ex.CompileContextEx;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.Pair;
@@ -31,6 +32,7 @@ import com.intellij.util.ArrayUtil;
 import com.intellij.util.Function;
 import com.intellij.util.StringBuilderSpinAllocator;
 import gnu.trove.TIntHashSet;
+import org.jetbrains.annotations.NotNull;
 import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
@@ -126,9 +128,11 @@ public class CacheUtils {
     return true;
   }
 
-  public static Collection<VirtualFile> findDependentFiles(final CompileContextEx context, final Set<VirtualFile> succesfullyCompiledJavaFiles,
-                                                            final @Nullable DependencyProcessor additionalDependencyProcessor,
-                                                            final @Nullable Function<Pair<int[], Set<VirtualFile>>, Pair<int[], Set<VirtualFile>>> filter) throws CacheCorruptedException {
+  public static Collection<VirtualFile> findDependentFiles(
+    final CompileContextEx context, 
+    final Set<VirtualFile> succesfullyCompiledJavaFiles, 
+    final @Nullable Function<Pair<int[], Set<VirtualFile>>, Pair<int[], Set<VirtualFile>>> filter) throws CacheCorruptedException {
+    
     if (!CompilerConfiguration.MAKE_ENABLED) {
       return Collections.emptyList();
     }
@@ -137,7 +141,7 @@ public class CacheUtils {
     final DependencyCache dependencyCache = context.getDependencyCache();
 
     final Pair<int[], Set<VirtualFile>> deps =
-        dependencyCache.findDependentClasses(context, context.getProject(), succesfullyCompiledJavaFiles, additionalDependencyProcessor);
+        dependencyCache.findDependentClasses(context, context.getProject(), succesfullyCompiledJavaFiles);
     final Pair<int[], Set<VirtualFile>> filteredDeps = filter != null? filter.fun(deps) : deps;
 
     final Set<VirtualFile> dependentFiles = new HashSet<VirtualFile>();
@@ -187,4 +191,20 @@ public class CacheUtils {
 
     return dependentFiles;
   }
+
+  @NotNull
+  public static Set<VirtualFile> getFilesCompiledWithErrors(final CompileContextEx context) {
+    CompilerMessage[] messages = context.getMessages(CompilerMessageCategory.ERROR);
+    Set<VirtualFile> compiledWithErrors = Collections.emptySet();
+    if (messages.length > 0) {
+      compiledWithErrors = new HashSet<VirtualFile>(messages.length);
+      for (CompilerMessage message : messages) {
+        final VirtualFile file = message.getVirtualFile();
+        if (file != null) {
+          compiledWithErrors.add(file);
+        }
+      }
+    }
+    return compiledWithErrors;
+  }
 }
index f58f6b6df770f162a55bc912b2c2e8e16390a192..05fd4253179982fbd10c489fef0401920660ba0b 100644 (file)
@@ -20,9 +20,9 @@
  */
 package com.intellij.compiler.make;
 
+import com.intellij.compiler.DependencyProcessor;
 import com.intellij.compiler.SymbolTable;
 import com.intellij.compiler.classParsing.*;
-import com.intellij.compiler.impl.javaCompiler.DependencyProcessor;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.compiler.CompileContext;
 import com.intellij.openapi.diagnostic.Logger;
@@ -37,7 +37,6 @@ import com.intellij.util.cls.ClsUtil;
 import gnu.trove.TIntHashSet;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
 
 import java.io.File;
 import java.io.IOException;
@@ -390,15 +389,14 @@ public class DependencyCache {
   /**
    * @return qualified names of the classes that should be additionally recompiled
    */
-  public Pair<int[], Set<VirtualFile>> findDependentClasses(CompileContext context, Project project, Set<VirtualFile> successfullyCompiled, @Nullable final DependencyProcessor additionalProcessor)
-      throws CacheCorruptedException {
+  public Pair<int[], Set<VirtualFile>> findDependentClasses(CompileContext context, Project project, Set<VirtualFile> successfullyCompiled)
+    throws CacheCorruptedException {
 
-    markDependencies(context, project, successfullyCompiled, additionalProcessor);
+    markDependencies(context, project, successfullyCompiled);
     return new Pair<int[], Set<VirtualFile>>(myMarkedInfos.toArray(), Collections.unmodifiableSet(myMarkedFiles));
   }
 
-  private void markDependencies(CompileContext context, Project project, final Set<VirtualFile> successfullyCompiled,
-                                @Nullable final DependencyProcessor additionalProcessor) throws CacheCorruptedException {
+  private void markDependencies(CompileContext context, Project project, final Set<VirtualFile> successfullyCompiled) throws CacheCorruptedException {
     try {
       if (LOG.isDebugEnabled()) {
         LOG.debug("====================Marking dependent files=====================");
@@ -427,7 +425,7 @@ public class DependencyCache {
             ).run();
           }
           changedRetentionPolicyDependencyProcessor.checkAnnotationRetentionPolicyChanges(qName);
-          if (additionalProcessor != null) {
+          for (DependencyProcessor additionalProcessor : DependencyProcessor.EXTENSION_POINT_NAME.getExtensions()) {
             additionalProcessor.processDependencies(context, qName);
           }
         }
index f326e2f1e8313aa31b9a1b34d57c67eb1ea32f7d..21433a5e74e3aeb048aa51bb856ee97fbecfe895 100644 (file)
@@ -249,13 +249,19 @@ public class ManifestFileUtil {
         VirtualFile dir = files[0];
         try {
           if (!dir.getName().equals(MANIFEST_DIR_NAME)) {
-            VirtualFile newDir = dir.findChild(MANIFEST_DIR_NAME);
-            if (newDir == null) {
-              newDir = dir.createChildDirectory(this, MANIFEST_DIR_NAME);
-            }
-            dir = newDir;
+            dir = VfsUtil.createDirectoryIfMissing(dir, MANIFEST_DIR_NAME);
           }
-          result.setResult(dir.createChildData(this, MANIFEST_FILE_NAME));
+          final VirtualFile file = dir.createChildData(this, MANIFEST_FILE_NAME);
+          final OutputStream output = file.getOutputStream(this);
+          try {
+            final Manifest manifest = new Manifest();
+            ManifestBuilder.setVersionAttribute(manifest.getMainAttributes());
+            manifest.write(output);
+          }
+          finally {
+            output.close();
+          }
+          result.setResult(file);
         }
         catch (IOException e) {
           exc.set(e);
index 1eebd0171750950668bee77fb17d003bdd594288..aea6261e8f2f6366bdfb25df2a58917c936eb088 100644 (file)
@@ -516,12 +516,23 @@ public class Javac2 extends Javac {
                 }
             }
             if (myNestedFormDirs != null) {
-                for(Iterator it = myNestedFormDirs.iterator(); it.hasNext(); ) {
-                    String path = (String) it.next();
-                    if (path.replace(File.separatorChar, '/').toLowerCase().endsWith(formFileFullName)) {
-                        return loadForm(formFileName, new FileInputStream(path));
-                    }
+              String[] list = myNestedFormDirs.list();
+              for (int i = 0, listLength = list.length; i < listLength; i++) {
+                String formPath = list[i];
+                if (!formPath.endsWith("/")) {
+                  formPath += "/";
+                }
+                if (formFileFullName.startsWith("/")) {
+                  formPath += formFileName.substring(1);
+                }
+                else {
+                  formPath += formFileName;
+                }
+                File formFile = new File(formPath.replace('/', File.separatorChar));
+                if (formFile.isFile()) {
+                  return loadForm(formFileName, new FileInputStream(formFile));
                 }
+              }
             }
             InputStream resourceStream = myLoader.getResourceAsStream(formFileName);
             if (resourceStream != null) {
index e1c7d5cbba5d54c5a8210bf0ed16a561147bfff1..32808d2f7520738c0628064ef31b2758bd2f995f 100644 (file)
@@ -16,6 +16,7 @@
 package com.intellij.codeInsight.completion;
 
 import com.intellij.codeInsight.*;
+import com.intellij.codeInsight.ExceptionUtil;
 import com.intellij.codeInsight.lookup.*;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.util.Computable;
index 1f5e80ebcadb24ca05b9dfdaa1f16a7fdcb76d5c..0c90b896ece32547219d6db89ea8ab7794add8dc 100644 (file)
@@ -86,7 +86,7 @@ public class SuppressWarningsFoldingBuilder extends FoldingBuilderEx {
         return o.toString();
       }
     }
-    return memberValue.getText();
+    return memberValue != null ? memberValue.getText() : "";
   }
 
 
index 7315e1dcf7c16c440eeec3845a58c8072bf52e1c..229c972c126c129a5f9f7ee4f6d3a9fb86e0902c 100644 (file)
@@ -187,8 +187,9 @@ public class CreatePropertyFromUsageFix extends CreateFromUsageBaseFix {
     LOG.assertTrue(callText != null, myMethodCall.getMethodExpression());
     PsiType[] expectedTypes;
     PsiType type;
+    PsiField field = targetClass.findFieldByName(fieldName, true);
     if (callText.startsWith(GET_PREFIX)) {
-      expectedTypes = CreateFromUsageUtils.guessType(myMethodCall, false);
+      expectedTypes = field != null ? new PsiType[]{field.getType()} : CreateFromUsageUtils.guessType(myMethodCall, false);
       type = expectedTypes[0];
     }
     else if (callText.startsWith(IS_PREFIX)) {
@@ -206,7 +207,7 @@ public class CreatePropertyFromUsageFix extends CreateFromUsageBaseFix {
     IdeDocumentHistory.getInstance(project).includeCurrentPlaceAsChangePlace();
 
     try {
-      PsiField field = targetClass.findFieldByName(fieldName, true);
+
       if (field == null) {
         field = factory.createField(fieldName, type);
         PsiUtil.setModifierProperty(field, PsiModifier.STATIC, isStatic);
index 59dd9463b2d49cf339076bdcd457e6925fe6bfec..aa153df182abbe61349b06e381f5a9ffed72e506 100644 (file)
@@ -78,7 +78,7 @@ public class JavaRefactoringSupportProvider extends DefaultRefactoringSupportPro
     return new JavaPushDownHandler();
   }
 
-  public RefactoringActionHandler getExtractModuleHandler() {
+  public RefactoringActionHandler getExtractInterfaceHandler() {
     return new ExtractInterfaceHandler();
   }
 
index 268e9c2fd5acf42e402d04e581863f7630ac4e3e..63908d4e6e4ceaa7e352871f974c106f3cb940fe 100644 (file)
@@ -18,6 +18,8 @@ package com.intellij.lang.java.parser;
 import com.intellij.codeInsight.daemon.JavaErrorMessages;
 import com.intellij.lang.LighterASTNode;
 import com.intellij.lang.PsiBuilder;
+import com.intellij.openapi.diagnostic.Logger;
+import com.intellij.openapi.util.Pair;
 import com.intellij.psi.JavaTokenType;
 import com.intellij.psi.impl.source.tree.ElementType;
 import com.intellij.psi.impl.source.tree.JavaElementType;
@@ -36,6 +38,8 @@ public class DeclarationParser {
     FILE, CLASS, CODE_BLOCK, ANNOTATION_INTERFACE
   }
 
+  private static final Logger LOG = Logger.getInstance("#com.intellij.lang.java.parser.DeclarationParser");
+
   private static final TokenSet AFTER_END_DECLARATION_SET = TokenSet.create(JavaElementType.FIELD, JavaElementType.METHOD);
 
   private DeclarationParser() { }
@@ -48,10 +52,11 @@ public class DeclarationParser {
     marker.drop();
     builder.advanceLexer();
 
+    final PsiBuilder builderWrapper = braceMatchingBuilder(builder);
     if (isEnum) {
-      parseEnumConstants(builder);
+      parseEnumConstants(builderWrapper);
     }
-    parseClassBodyDeclarations(builder, isAnnotation);
+    parseClassBodyDeclarations(builderWrapper, isAnnotation);
 
     expectOrError(builder, JavaTokenType.RBRACE, JavaErrorMessages.message("expected.rbrace"));
 
@@ -186,10 +191,11 @@ public class DeclarationParser {
 
     final PsiBuilder.Marker declaration = builder.mark();
 
-    final PsiBuilder.Marker modList = parseModifierList(builder);
+    final Pair<PsiBuilder.Marker, Boolean> modListInfo = parseModifierList(builder);
+    final PsiBuilder.Marker modList = modListInfo.first;
 
     if (expect(builder, JavaTokenType.AT)) {
-      if (tokenType == JavaTokenType.INTERFACE_KEYWORD) {
+      if (builder.getTokenType() == JavaTokenType.INTERFACE_KEYWORD) {
         return parseClassFromKeyword(builder, declaration, true);
       }
       else {
@@ -197,9 +203,8 @@ public class DeclarationParser {
         return null;
       }
     }
-    else if (ElementType.CLASS_KEYWORD_BIT_SET.contains(tokenType)) {
+    else if (ElementType.CLASS_KEYWORD_BIT_SET.contains(builder.getTokenType())) {
       final PsiBuilder.Marker root = parseClassFromKeyword(builder, declaration, false);
-
       if (context == Context.FILE) {
         // todo: append following declarations to root
         boolean declarationsAfterEnd = false;
@@ -233,29 +238,113 @@ public class DeclarationParser {
     }
 
     if (context == Context.FILE) {
-      if (typeParams == null) {
-        error(builder, JavaErrorMessages.message("expected.class.or.interface"));
+      error(builder, JavaErrorMessages.message("expected.class.or.interface"), typeParams);
+      declaration.drop();
+      return modList;
+    }
+
+    PsiBuilder.Marker type;
+    if (ElementType.PRIMITIVE_TYPE_BIT_SET.contains(builder.getTokenType())) {
+      type = parseTypeNotNull(builder);
+    }
+    else if (builder.getTokenType() == JavaTokenType.IDENTIFIER) {
+      final PsiBuilder.Marker idPos = builder.mark();
+      type = parseTypeNotNull(builder);
+      if (builder.getTokenType() == JavaTokenType.LPARENTH) {  // constructor
+        if (context == Context.CODE_BLOCK) {
+          declaration.rollbackTo();
+          return null;
+        }
+        idPos.rollbackTo();
+        if (typeParams == null) {
+          emptyElement(builder, JavaElementType.TYPE_PARAMETER_LIST);
+        }
+        builder.advanceLexer();
+        if (builder.getTokenType() != JavaTokenType.LPARENTH) {
+          declaration.rollbackTo();
+          return null;
+        }
+        return parseMethodFromLeftParenth(builder, declaration, false);
+      }
+      idPos.drop();
+    }
+    else if (builder.getTokenType() == JavaTokenType.LBRACE) {
+      if (context == Context.CODE_BLOCK) {
+        error(builder, JavaErrorMessages.message("expected.identifier.or.type"), typeParams);
+        declaration.drop();
+        return modList;
+      }
+
+      final PsiBuilder.Marker codeBlock = StatementParser.parseCodeBlock(builder);
+      LOG.assertTrue(codeBlock != null);
+
+      if (typeParams != null) {
+        final PsiBuilder.Marker error = typeParams.precede();
+        error.errorBefore(JavaErrorMessages.message("unexpected.token"), codeBlock);
+      }
+      declaration.done(JavaElementType.CLASS_INITIALIZER);
+      return declaration;
+    }
+    else {
+      final PsiBuilder.Marker error;
+      if (typeParams != null) {
+        error = typeParams.precede();
       }
       else {
-        typeParams.precede().errorBefore(JavaErrorMessages.message("expected.class.or.interface"), typeParams);
+        error = builder.mark();
       }
-      declaration.drop();
+      error.error(JavaErrorMessages.message("expected.identifier.or.type"));
       return modList;
     }
 
-    // todo: implement
-    throw new UnsupportedOperationException(builder.toString() + context);
+    if (!expect(builder, JavaTokenType.IDENTIFIER)) {
+      if (context == Context.CODE_BLOCK && modListInfo.second) {
+        declaration.rollbackTo();
+        return null;
+      }
+      else {
+        if (typeParams != null) {
+          typeParams.precede().errorBefore(JavaErrorMessages.message("unexpected.token"), type);
+        }
+        builder.error(JavaErrorMessages.message("expected.identifier"));
+        declaration.drop();
+        return modList;
+      }
+    }
+
+    if (builder.getTokenType() == JavaTokenType.LPARENTH) {
+      if (context == Context.CLASS || context == Context.ANNOTATION_INTERFACE) {  // method
+        if (typeParams == null) {
+          emptyElement(type, JavaElementType.TYPE_PARAMETER_LIST);
+        }
+        return parseMethodFromLeftParenth(builder, declaration, (context == Context.ANNOTATION_INTERFACE));
+      }
+    }
+
+    if (typeParams != null) {
+      typeParams.precede().errorBefore(JavaErrorMessages.message("unexpected.token"), type);
+    }
+    return parseFieldOrLocalVariable(builder, declaration, context);
+  }
+
+  @NotNull
+  private static PsiBuilder.Marker parseTypeNotNull(final PsiBuilder builder) {
+    final ReferenceParser.TypeInfo typeInfo = ReferenceParser.parseType(builder);
+    assert typeInfo != null : builder.getOriginalText();
+    return typeInfo.marker;
   }
 
   @NotNull
-  private static PsiBuilder.Marker parseModifierList(final PsiBuilder builder) {
+  private static Pair<PsiBuilder.Marker, Boolean> parseModifierList(final PsiBuilder builder) {
     final PsiBuilder.Marker modList = builder.mark();
+    boolean isEmpty = true;
 
     while (true) {
       final IElementType tokenType = builder.getTokenType();
       if (tokenType == null) break;
       if (ElementType.MODIFIER_BIT_SET.contains(tokenType)) {
         builder.advanceLexer();
+        isEmpty = false;
       }
       else if (tokenType == JavaTokenType.AT) {
         final PsiBuilder.Marker pos = builder.mark();
@@ -266,6 +355,7 @@ public class DeclarationParser {
           break;
         }
         parseAnnotation(builder);
+        isEmpty = false;
       }
       else {
         break;
@@ -273,7 +363,225 @@ public class DeclarationParser {
     }
 
     modList.done(JavaElementType.MODIFIER_LIST);
-    return modList;
+    return Pair.create(modList, isEmpty);
+  }
+
+  private static PsiBuilder.Marker parseMethodFromLeftParenth(final PsiBuilder builder, final PsiBuilder.Marker declaration,
+                                                              final boolean anno) {
+    parseParameterList(builder);
+
+    eatBrackets(builder);
+
+    if (areTypeAnnotationsSupported(builder)) {
+      final PsiBuilder.Marker receiver = builder.mark();
+      final PsiBuilder.Marker annotations = parseAnnotations(builder);
+      if (annotations != null) {
+        receiver.done(JavaElementType.METHOD_RECEIVER);
+      }
+      else {
+        receiver.drop();
+      }
+    }
+
+    ReferenceParser.parseReferenceList(builder, JavaTokenType.THROWS_KEYWORD, JavaElementType.THROWS_LIST, JavaTokenType.COMMA);
+
+    if (anno && expect(builder, JavaTokenType.DEFAULT_KEYWORD)) {
+      parseAnnotationValue(builder);
+    }
+
+    final IElementType tokenType = builder.getTokenType();
+    if (tokenType == JavaTokenType.SEMICOLON) {
+      builder.advanceLexer();
+    }
+    else if (tokenType == JavaTokenType.LBRACE) {
+      StatementParser.parseCodeBlock(builder);
+    }
+    else {
+      error(builder, JavaErrorMessages.message("expected.lbrace.or.semicolon"));
+      // todo: special treatment - like in fields (DeclarationParserTest.testMultiLineUnclosed())
+    }
+
+    declaration.done(anno ? JavaElementType.ANNOTATION_METHOD : JavaElementType.METHOD);
+    return declaration;
+  }
+
+  @NotNull
+  private static PsiBuilder.Marker parseParameterList(final PsiBuilder builder) {
+    assert builder.getTokenType() == JavaTokenType.LPARENTH : builder.getTokenType();
+    final PsiBuilder.Marker paramList = builder.mark();
+    builder.advanceLexer();
+
+    PsiBuilder.Marker invalidElements = null;
+    boolean commaExpected = false;
+    int paramCount = 0;
+    while (true) {
+      final IElementType tokenType = builder.getTokenType();
+      if (tokenType == null || tokenType == JavaTokenType.RPARENTH) {
+        boolean noLastParam = !commaExpected && paramCount > 0;
+        if (noLastParam) {
+          error(builder, JavaErrorMessages.message("expected.identifier.or.type"));
+        }
+        if (!expect(builder, JavaTokenType.RPARENTH)) {
+          if (!noLastParam) {
+            error(builder, JavaErrorMessages.message("expected.rparen"));
+          }
+        }
+        break;
+      }
+
+      if (commaExpected) {
+        if (builder.getTokenType() == JavaTokenType.COMMA) {
+          commaExpected = false;
+          if (invalidElements != null) {
+            invalidElements.error(JavaErrorMessages.message("expected.parameter"));
+            invalidElements = null;
+          }
+          builder.advanceLexer();
+          continue;
+        }
+      }
+      else {
+        final PsiBuilder.Marker param = parseParameter(builder, true);
+        if (param != null) {
+          commaExpected = true;
+          if (invalidElements != null) {
+            invalidElements.errorBefore(JavaErrorMessages.message("expected.comma"), param);
+            invalidElements = null;
+          }
+          paramCount++;
+          continue;
+        }
+      }
+
+      if (invalidElements == null) {
+        if (builder.getTokenType() == JavaTokenType.COMMA) {
+          error(builder, JavaErrorMessages.message("expected.parameter"));
+          builder.advanceLexer();
+          continue;
+        }
+        else {
+          invalidElements = builder.mark();
+        }
+      }
+
+      // adding a reference, not simple tokens allows "Browse .." to work well
+      final PsiBuilder.Marker ref = ReferenceParser.parseJavaCodeReference(builder, true, true, false);
+      if (ref == null && builder.getTokenType() != null) {
+        builder.advanceLexer();
+      }
+    }
+
+    if (invalidElements != null) {
+      invalidElements.error(commaExpected ? JavaErrorMessages.message("expected.comma") : JavaErrorMessages.message("expected.parameter"));
+    }
+
+    paramList.done(JavaElementType.PARAMETER_LIST);
+    return paramList;
+  }
+
+  @Nullable
+  private static PsiBuilder.Marker parseParameter(final PsiBuilder builder, final boolean ellipsis) {
+    final PsiBuilder.Marker param = builder.mark();
+
+    final Pair<PsiBuilder.Marker, Boolean> modListInfo = parseModifierList(builder);
+    final PsiBuilder.Marker type = ellipsis ? ReferenceParser.parseTypeWithEllipsis(builder, true, true) :
+                                              ReferenceParser.parseType(builder, true, true);
+
+    if (type == null && modListInfo.second) {
+      param.rollbackTo();
+      return null;
+    }
+
+    if (type == null) {
+      error(builder, JavaErrorMessages.message("expected.type"));
+      emptyElement(builder, JavaElementType.TYPE);
+    }
+
+    if (expect(builder, JavaTokenType.IDENTIFIER)) {
+      eatBrackets(builder);
+    }
+    else {
+      error(builder, JavaErrorMessages.message("expected.identifier"));
+    }
+
+    param.done(JavaElementType.PARAMETER);
+    return param;
+  }
+
+  @Nullable
+  private static PsiBuilder.Marker parseFieldOrLocalVariable(final PsiBuilder builder, final PsiBuilder.Marker declaration,
+                                                             final Context context) {
+    final IElementType varType;
+    if (context == Context.CLASS || context == Context.ANNOTATION_INTERFACE) {
+      varType = JavaElementType.FIELD;
+    }
+    else if (context == Context.CODE_BLOCK) {
+      varType = JavaElementType.LOCAL_VARIABLE;
+    }
+    else {
+      LOG.error("Unexpected context: " + context);
+      declaration.drop();
+      return null;
+    }
+
+    PsiBuilder.Marker variable = declaration;
+    boolean openMarker = true;
+    boolean eatSemicolon = true;
+    boolean expectSemicolon = true;
+    while (true) {
+      if (!eatBrackets(builder)) {
+        expectSemicolon = false;
+      }
+
+      if (expect(builder, JavaTokenType.EQ)) {
+        final PsiBuilder.Marker expr = ExpressionParser.parse(builder);
+        if (expr == null) {
+          error(builder, JavaErrorMessages.message("expected.expression"));
+          expectSemicolon = false;
+          break;
+        }
+      }
+
+      if (builder.getTokenType() == JavaTokenType.COMMA) {
+        variable.done(varType);
+        builder.advanceLexer();
+        variable = builder.mark();
+      }
+      else {
+        break;
+      }
+
+      if (!expect(builder, JavaTokenType.IDENTIFIER)) {
+        variable.drop();
+        error(builder, JavaErrorMessages.message("expected.identifier"));
+        openMarker = false;
+        eatSemicolon = false;
+        break;
+      }
+    }
+
+    if (eatSemicolon) {
+      if (!expect(builder, JavaTokenType.SEMICOLON) && expectSemicolon) {
+        error(builder, JavaErrorMessages.message("expected.semicolon"));
+      }
+      // todo: special treatment - see DeclarationParserTest.testMultiLineUnclosed()
+    }
+
+    if (openMarker) {
+      variable.done(varType);
+    }
+
+    return declaration;
+  }
+
+  private static boolean eatBrackets(final PsiBuilder builder) {
+    while (expect(builder, JavaTokenType.LBRACKET)) {
+      if (!expect(builder, JavaTokenType.RBRACKET)) {
+        error(builder, JavaErrorMessages.message("expected.rbracket"));
+        return false;
+      }
+    }
+    return true;
   }
 
   @Nullable
@@ -290,6 +598,7 @@ public class DeclarationParser {
 
   @NotNull
   private static PsiBuilder.Marker parseAnnotation(final PsiBuilder builder) {
+    assert builder.getTokenType() == JavaTokenType.AT : builder.getTokenType();
     final PsiBuilder.Marker anno = builder.mark();
     builder.advanceLexer();
 
@@ -408,6 +717,7 @@ public class DeclarationParser {
 
   @NotNull
   private static PsiBuilder.Marker parseAnnotationArrayInitializer(final PsiBuilder builder) {
+    assert builder.getTokenType() == JavaTokenType.LBRACE : builder.getTokenType();
     final PsiBuilder.Marker annoArray = builder.mark();
     builder.advanceLexer();
 
index 73937f311f814834070424f3e37e2963f129c82d..6a3597e5f897398032d7e1c37e88b6c25b241873 100644 (file)
  */
 package com.intellij.lang.java.parser;
 
-import com.intellij.lang.PsiBuilder;
-import com.intellij.lang.PsiBuilderUtil;
+import com.intellij.lang.*;
 import com.intellij.openapi.util.Key;
 import com.intellij.pom.java.LanguageLevel;
+import com.intellij.psi.JavaTokenType;
 import com.intellij.psi.tree.IElementType;
+import com.intellij.psi.tree.TokenSet;
+import com.intellij.util.diff.FlyweightCapableTreeStructure;
+import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 
 public class JavaParserUtil {
@@ -40,7 +44,7 @@ public class JavaParserUtil {
   @NotNull
   private static LanguageLevel getLanguageLevel(final PsiBuilder builder) {
     final LanguageLevel level = builder.getUserData(LANG_LEVEL_KEY);
-    assert level != null;
+    assert level != null : builder;
     return level;
   }
 
@@ -49,6 +53,15 @@ public class JavaParserUtil {
     builder.mark().error(message);
   }
 
+  public static void error(final PsiBuilder builder, final String message, @Nullable final PsiBuilder.Marker before) {
+    if (before == null) {
+      error(builder, message);
+    }
+    else {
+      before.precede().errorBefore(message, before);
+    }
+  }
+
   public static boolean expectOrError(final PsiBuilder builder, final IElementType expectedType, final String errorMessage) {
     if (!PsiBuilderUtil.expect(builder, expectedType)) {
       error(builder, errorMessage);
@@ -60,4 +73,106 @@ public class JavaParserUtil {
   public static void emptyElement(final PsiBuilder builder, final IElementType type) {
     builder.mark().done(type);
   }
+
+  public static void emptyElement(final PsiBuilder.Marker before, final IElementType type) {
+    before.precede().doneBefore(type, before);
+  }
+
+  public static PsiBuilder braceMatchingBuilder(final PsiBuilder builder) {
+    return new PsiBuilderAdapter(builder) {
+      private int braceCount = 1;
+      private int lastOffset = -1;
+
+      @Override
+      public IElementType getTokenType() {
+        final IElementType tokenType = super.getTokenType();
+        if (getCurrentOffset() != lastOffset) {
+          if (tokenType == JavaTokenType.LBRACE) {
+            braceCount++;
+          }
+          else if (tokenType == JavaTokenType.RBRACE) {
+            braceCount--;
+          }
+          lastOffset = getCurrentOffset();
+        }
+        return (braceCount == 0 ? null : tokenType);
+      }
+    };
+  }
+
+  public static class PsiBuilderAdapter implements PsiBuilder {
+    protected final PsiBuilder myDelegate;
+
+    public PsiBuilderAdapter(final PsiBuilder delegate) {
+      myDelegate = delegate;
+    }
+
+    public CharSequence getOriginalText() {
+      return myDelegate.getOriginalText();
+    }
+
+    public void advanceLexer() {
+      myDelegate.advanceLexer();
+    }
+
+    @Nullable
+    public IElementType getTokenType() {
+      return myDelegate.getTokenType();
+    }
+
+    public void setTokenTypeRemapper(final ITokenTypeRemapper remapper) {
+      myDelegate.setTokenTypeRemapper(remapper);
+    }
+
+    @Nullable @NonNls
+    public String getTokenText() {
+      return myDelegate.getTokenText();
+    }
+
+    public int getCurrentOffset() {
+      return myDelegate.getCurrentOffset();
+    }
+
+    public Marker mark() {
+      return myDelegate.mark();
+    }
+
+    public void error(final String messageText) {
+      myDelegate.error(messageText);
+    }
+
+    public boolean eof() {
+      return myDelegate.eof();
+    }
+
+    public ASTNode getTreeBuilt() {
+      return myDelegate.getTreeBuilt();
+    }
+
+    public FlyweightCapableTreeStructure<LighterASTNode> getLightTree() {
+      return myDelegate.getLightTree();
+    }
+
+    public void setDebugMode(final boolean dbgMode) {
+      myDelegate.setDebugMode(dbgMode);
+    }
+
+    public void enforceCommentTokens(final TokenSet tokens) {
+      myDelegate.enforceCommentTokens(tokens);
+    }
+
+    @Nullable
+    public LighterASTNode getLatestDoneMarker() {
+      return myDelegate.getLatestDoneMarker();
+    }
+
+    @Nullable
+    public <T> T getUserData(@NotNull final Key<T> key) {
+      return myDelegate.getUserData(key);
+    }
+
+    public <T> void putUserData(@NotNull final Key<T> key, @Nullable final T value) {
+      myDelegate.putUserData(key, value);
+    }
+  }
 }
index 8831468fabe392d55cf8d93ac049ebe42d66cc4b..da8be88afb9ef1c8806a5820dcef39262f258c71 100644 (file)
@@ -53,6 +53,21 @@ public class ReferenceParser {
     return typeInfo != null ? typeInfo.marker : null;
   }
 
+  @Nullable
+  public static PsiBuilder.Marker parseTypeWithEllipsis(final PsiBuilder builder, final boolean eatLastDot, final boolean wildcard) {
+    final TypeInfo typeInfo = parseTypeWithInfo(builder, eatLastDot, wildcard);
+    if (typeInfo == null) return null;
+
+    PsiBuilder.Marker type = typeInfo.marker;
+    if (builder.getTokenType() == JavaTokenType.ELLIPSIS) {
+      type = typeInfo.marker.precede();
+      builder.advanceLexer();
+      type.done(JavaElementType.TYPE);
+    }
+
+    return type;
+  }
+
   @Nullable
   private static TypeInfo parseTypeWithInfo(final PsiBuilder builder, final boolean eatLastDot, final boolean wildcard) {
     if (builder.getTokenType() == null) return null;
@@ -263,28 +278,26 @@ public class ReferenceParser {
       return null;
     }
 
-    if (expect(builder, JavaTokenType.EXTENDS_KEYWORD)) {
-      parseReferenceList(builder, JavaElementType.EXTENDS_BOUND_LIST, JavaTokenType.AND);
-    }
-    else {
-      emptyElement(builder, JavaElementType.EXTENDS_BOUND_LIST);
-    }
+    parseReferenceList(builder, JavaTokenType.EXTENDS_KEYWORD, JavaElementType.EXTENDS_BOUND_LIST, JavaTokenType.AND);
 
     param.done(JavaElementType.TYPE_PARAMETER);
     return param;
   }
 
   @NotNull
-  private static PsiBuilder.Marker parseReferenceList(final PsiBuilder builder, final IElementType type, final IElementType delimiter) {
+  public static PsiBuilder.Marker parseReferenceList(final PsiBuilder builder, final IElementType start,
+                                                     final IElementType type, final IElementType delimiter) {
     final PsiBuilder.Marker element = builder.mark();
 
-    while (true) {
-      final PsiBuilder.Marker classReference = parseJavaCodeReference(builder, true, true, true);
-      if (classReference == null) {
-        error(builder, JavaErrorMessages.message("expected.identifier"));
-      }
-      if (!expect(builder, delimiter)) {
-        break;
+    if (expect(builder, start)) {
+      while (true) {
+        final PsiBuilder.Marker classReference = parseJavaCodeReference(builder, true, true, true);
+        if (classReference == null) {
+          error(builder, JavaErrorMessages.message("expected.identifier"));
+        }
+        if (!expect(builder, delimiter)) {
+          break;
+        }
       }
     }
 
diff --git a/java/java-impl/src/com/intellij/lang/java/parser/StatementParser.java b/java/java-impl/src/com/intellij/lang/java/parser/StatementParser.java
new file mode 100644 (file)
index 0000000..d08d0ff
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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.lang.java.parser;
+
+import com.intellij.lang.PsiBuilder;
+import com.intellij.psi.JavaTokenType;
+import com.intellij.psi.impl.source.tree.JavaElementType;
+import org.jetbrains.annotations.Nullable;
+
+
+public class StatementParser {
+  private StatementParser() { }
+
+  @Nullable
+  public static PsiBuilder.Marker parseCodeBlock(final PsiBuilder builder) {
+    if (builder.getTokenType() != JavaTokenType.LBRACE) return null;
+
+    final PsiBuilder.Marker codeBlock = builder.mark();
+    builder.advanceLexer();
+
+    // temp
+    if (builder.getTokenType() == JavaTokenType.RBRACE) {
+      builder.advanceLexer();
+      codeBlock.done(JavaElementType.CODE_BLOCK);
+      return codeBlock;
+    }
+
+    // todo: implement
+    throw new UnsupportedOperationException(builder.toString());
+  }
+}
index 95219c560609ed55b1daef0841ba7e51466963e0..4f8b677b1fc2f37312179790c6172e9e781b7f19 100644 (file)
@@ -705,8 +705,8 @@ public class DeclarationParsing extends Parsing {
       aClass.rawAddChildren(invalidElementsGroup);
       while (true) {
         IElementType tokenType = lexer.getTokenType();
-        if (tokenType == JavaTokenType.IDENTIFIER || tokenType == JavaTokenType.COMMA || tokenType == JavaTokenType.EXTENDS_KEYWORD || tokenType ==
-                                                                                                                                       JavaTokenType.IMPLEMENTS_KEYWORD) {
+        if (tokenType == JavaTokenType.IDENTIFIER || tokenType == JavaTokenType.COMMA || tokenType == JavaTokenType.EXTENDS_KEYWORD ||
+            tokenType == JavaTokenType.IMPLEMENTS_KEYWORD) {
           invalidElementsGroup.rawAddChildren(ParseUtil.createTokenElement(lexer, myContext.getCharTable()));
         }
         else {
@@ -1086,7 +1086,7 @@ public class DeclarationParsing extends Parsing {
 
     if (type == null) {
       type = ASTFactory.composite(JavaElementType.TYPE);
-      param.rawAddChildren(Factory.createErrorElement("Parameter type missing"));
+      param.rawAddChildren(Factory.createErrorElement(JavaErrorMessages.message("expected.type")));
     }
 
     param.rawAddChildren(type);
index 89c35b07456f1a4f2061ab0a51e2d8d46a41096a..c706eb3d1bb83459d359f0c1a24a0f259be326c7 100644 (file)
@@ -111,6 +111,7 @@ public class StatementParsing extends Parsing {
     return dummyRoot.getFirstChildNode();
   }
 
+  @Nullable
   public TreeElement parseCodeBlock(Lexer lexer, boolean deep) {
     if (lexer.getTokenType() != JavaTokenType.LBRACE) return null;
     Lexer badLexer = lexer instanceof StoppableLexerAdapter ? ((StoppableLexerAdapter)lexer).getDelegate() : lexer;
@@ -151,11 +152,10 @@ public class StatementParsing extends Parsing {
           List<IElementType> list = new SmartList<IElementType>();
           while (true) {
             final IElementType type = lexer.getTokenType();
-            if (ElementType.PRIMITIVE_TYPE_BIT_SET.contains(type) || type == JavaTokenType.IDENTIFIER || ElementType.MODIFIER_BIT_SET.contains(type) ||
-                   type == JavaTokenType.LT || type == JavaTokenType.GT || type == JavaTokenType.GTGT || type == JavaTokenType.GTGTGT || type ==
-                                                                                                                                         JavaTokenType.COMMA || type ==
-                                                                                                                                                                JavaTokenType.DOT ||
-                   type == JavaTokenType.EXTENDS_KEYWORD || type == JavaTokenType.IMPLEMENTS_KEYWORD) {
+            if (ElementType.PRIMITIVE_TYPE_BIT_SET.contains(type) || ElementType.MODIFIER_BIT_SET.contains(type) ||
+                type == JavaTokenType.IDENTIFIER || type == JavaTokenType.LT || type == JavaTokenType.GT ||
+                type == JavaTokenType.GTGT || type == JavaTokenType.GTGTGT || type == JavaTokenType.COMMA ||
+                type == JavaTokenType.DOT || type == JavaTokenType.EXTENDS_KEYWORD || type == JavaTokenType.IMPLEMENTS_KEYWORD) {
               list.add(type);
               lexer.advance();
             } else {
index b2968fa8dbef906a9b69690b0be9192a655dea05..c648d69da36623494cf0fe6863f1257fe2f876cd 100644 (file)
@@ -93,7 +93,7 @@ public interface JavaElementType {
   IElementType CLASS_OBJECT_ACCESS_EXPRESSION = new IJavaElementType("CLASS_OBJECT_ACCESS_EXPRESSION");
   IElementType EMPTY_EXPRESSION = new IJavaElementType("EMPTY_EXPRESSION");
 
-  IElementType EXPRESSION_LIST = new IJavaElementType("EXPRESSION_LIST");
+  IElementType EXPRESSION_LIST = new IJavaElementType("EXPRESSION_LIST", true);
 
   IElementType EMPTY_STATEMENT = new IJavaElementType("EMPTY_STATEMENT");
   IElementType BLOCK_STATEMENT = new IJavaElementType("BLOCK_STATEMENT");
index 0cc343e57b593cc5a6cc60a19de0541fe71470b9..f33755c9c1efa06966d424bea71933eb012dd9d3 100644 (file)
@@ -165,9 +165,15 @@ class InlineConstantFieldProcessor extends BaseRefactoringProcessor {
       PsiExpression qExpression = ((PsiReferenceExpression)expr).getQualifierExpression();
       if (qExpression != null) {
         if (initializer1 instanceof PsiMethodCallExpression) {
-          ((PsiMethodCallExpression)initializer1).getMethodExpression().setQualifierExpression(qExpression);
+          PsiReferenceExpression methodExpression = ((PsiMethodCallExpression)initializer1).getMethodExpression();
+          if (methodExpression.getQualifierExpression() == null) {
+            methodExpression.setQualifierExpression(qExpression);
+          }
         } else if (initializer1 instanceof PsiReferenceExpression) {
-          ((PsiReferenceExpression)initializer1).setQualifierExpression(qExpression);
+          PsiReferenceExpression referenceExpression = (PsiReferenceExpression)initializer1;
+          if (referenceExpression.getQualifierExpression() == null) {
+            referenceExpression.setQualifierExpression(qExpression);
+          }
         }
       }
     }
index d93340f4108dab5f59b000dc8db62a3a1ee420ca..6036192d350683b5a6421e05ca972c9a14777e3c 100644 (file)
@@ -99,8 +99,7 @@ public class InlineParameterHandler extends JavaInlineActionHandler {
             else if (!isSameConstant(argument, refConstantInitializer.get())) {
               return false;
             }
-          }
-          else {
+          } else if (!isRecursiveReferencedParameter(argument, psiParameter)) {
             if (!refConstantInitializer.isNull()) return false;
             refInitializer.set(argument);
             refMethodCall.set(methodCall);
@@ -228,6 +227,16 @@ public class InlineParameterHandler extends JavaInlineActionHandler {
     return null;
   }
 
+  private static boolean isRecursiveReferencedParameter(final PsiExpression argument, final PsiParameter param) {
+    if (argument instanceof PsiReferenceExpression) {
+      final PsiElement element = ((PsiReferenceExpression)argument).resolve();
+      if (element instanceof PsiParameter) {
+        return element.equals(param);
+      }
+    }
+    return false;
+  }
+
   private static boolean isSameConstant(final PsiExpression expr1, final PsiExpression expr2) {
     boolean expr1Null = InlineToAnonymousConstructorProcessor.ourNullPattern.accepts(expr1);
     boolean expr2Null = InlineToAnonymousConstructorProcessor.ourNullPattern.accepts(expr2);
index f9d28ac491b71df4f9f3e1b6d1fb5d7dcdd1f11c..686950aaba327e76a4b8d4fb880f10b50dd34f03 100644 (file)
 package com.intellij.refactoring.inlineSuperClass.usageInfo;
 
 import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiJavaCodeReferenceElement;
-import com.intellij.refactoring.safeDelete.usageInfo.SafeDeleteExtendsClassUsageInfo;
 import com.intellij.refactoring.util.FixableUsageInfo;
 import com.intellij.util.IncorrectOperationException;
 
 public class ReplaceExtendsListUsageInfo extends FixableUsageInfo {
-  private final SafeDeleteExtendsClassUsageInfo mySafeDeleteUsageInfo;
 
   public ReplaceExtendsListUsageInfo(PsiJavaCodeReferenceElement element, final PsiClass superClass, final PsiClass targetClass) {
     super(element);
-    mySafeDeleteUsageInfo = new SafeDeleteExtendsClassUsageInfo(element, superClass, targetClass);
+
   }
 
   public void fixUsage() throws IncorrectOperationException {
-    if (mySafeDeleteUsageInfo.isSafeDelete()) {
-      mySafeDeleteUsageInfo.deleteElement();
+    final PsiElement element = getElement();
+    if (element != null) {
+      element.delete();
     }
   }
 }
index 705c7f0e195adf0e7a2e465307875bff974a9cb3..e5eedc93225f7d22d0181b629e8368e0b957c2d1 100644 (file)
@@ -194,12 +194,20 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase impleme
     return tempExpr;
   }
 
-  public static PsiExpression getSelectedExpression(final Project project, final PsiFile file, final int startOffset, final int endOffset) {
+  public static PsiExpression getSelectedExpression(final Project project, final PsiFile file, int startOffset, int endOffset) {
 
-    final PsiElement elementAtStart = file.findElementAt(startOffset);
-    if (elementAtStart == null) return null;
-    final PsiElement elementAtEnd = file.findElementAt(endOffset - 1);
-    if (elementAtEnd == null) return null;
+    PsiElement elementAtStart = file.findElementAt(startOffset);
+    if (elementAtStart == null || elementAtStart instanceof PsiWhiteSpace || elementAtStart instanceof PsiComment) {
+      elementAtStart = PsiTreeUtil.skipSiblingsForward(elementAtStart, PsiWhiteSpace.class, PsiComment.class);
+      if (elementAtStart == null) return null;
+      startOffset = elementAtStart.getTextOffset();
+    }
+    PsiElement elementAtEnd = file.findElementAt(endOffset - 1);
+    if (elementAtEnd == null || elementAtEnd instanceof PsiWhiteSpace || elementAtEnd instanceof PsiComment) {
+      elementAtEnd = PsiTreeUtil.skipSiblingsBackward(elementAtEnd, PsiWhiteSpace.class, PsiComment.class);
+      if (elementAtEnd == null) return null;
+      endOffset = elementAtEnd.getTextRange().getEndOffset();
+    }
 
     PsiExpression tempExpr;
     PsiElement elementAt = PsiTreeUtil.findCommonParent(elementAtStart, elementAtEnd);
@@ -295,7 +303,9 @@ public abstract class IntroduceVariableBase extends IntroduceHandlerBase impleme
         tempExpr.putUserData(ElementToWorkOn.PARENT, parent);
       }
       else {
-        PsiErrorElement errorElement = PsiTreeUtil.getNextSiblingOfType(elementAtStart, PsiErrorElement.class);
+        PsiErrorElement errorElement = elementAtStart instanceof PsiErrorElement
+                                       ? (PsiErrorElement)elementAtStart
+                                       : PsiTreeUtil.getNextSiblingOfType(elementAtStart, PsiErrorElement.class);
         if (errorElement == null) {
           errorElement = PsiTreeUtil.getParentOfType(elementAtStart, PsiErrorElement.class);
         }
index ff55de6380158e207dc6192185189c31699289f7..84848acce9241c8f8ed82eb751047abb19478a5f 100644 (file)
@@ -427,7 +427,7 @@ public class JavaSafeDeleteProcessor implements SafeDeleteProcessorDelegate {
               break;
             }
           }
-          if (!anyOverridingRefs && isMultipleInterfacesImplementation(overridingMethod, allElementsToDelete)) {
+          if (!anyOverridingRefs && isMultipleInterfacesImplementation(overridingMethod, originalMethod, allElementsToDelete)) {
             anyOverridingRefs = true;
             multipleInterfaceImplementations.add(overridingMethod);
           }
@@ -468,10 +468,12 @@ public class JavaSafeDeleteProcessor implements SafeDeleteProcessorDelegate {
     return validOverriding;
   }
 
-  private static boolean isMultipleInterfacesImplementation(final PsiMethod method, final PsiElement[] allElementsToDelete) {
+  private static boolean isMultipleInterfacesImplementation(final PsiMethod method,
+                                                            PsiMethod originalMethod,
+                                                            final PsiElement[] allElementsToDelete) {
     final PsiMethod[] methods = method.findSuperMethods();
     for(PsiMethod superMethod: methods) {
-      if (ArrayUtil.find(allElementsToDelete, superMethod) < 0) {
+      if (ArrayUtil.find(allElementsToDelete, superMethod) < 0 && !MethodSignatureUtil.isSuperMethod(originalMethod, superMethod)) {
         return true;
       }
     }
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterExistingField.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/afterExistingField.java
new file mode 100644 (file)
index 0000000..0bf86ed
--- /dev/null
@@ -0,0 +1,11 @@
+// "Create Getter" "true"
+public class Test {
+    Integer field;
+    public foo() {
+        getField();
+    }
+
+    public Integer getField() {
+        return field;
+    }
+}
diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeExistingField.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/createMethodFromUsage/beforeExistingField.java
new file mode 100644 (file)
index 0000000..a1ca74e
--- /dev/null
@@ -0,0 +1,7 @@
+// "Create Getter" "true"
+public class Test {
+    Integer field;
+    public foo() {
+        get<caret>Field();
+    }
+}
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/CompletionHack0.txt b/java/java-tests/testData/psi/parser-partial/declarations/CompletionHack0.txt
new file mode 100644 (file)
index 0000000..7b9cfcc
--- /dev/null
@@ -0,0 +1,33 @@
+PsiJavaFile:CompletionHack0.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:s
+    PsiModifierList:
+      <empty list>
+    PsiErrorElement:Unexpected token
+      PsiTypeParameterList
+        PsiJavaToken:LT('<')
+        PsiTypeParameter:X
+          PsiIdentifier:X('X')
+          PsiElement(EXTENDS_BOUND_LIST)
+            <empty list>
+        PsiWhiteSpace(' ')
+        PsiErrorElement:Unexpected identifier
+          PsiIdentifier:IntelliJIdeaRulezz('IntelliJIdeaRulezz')
+        PsiJavaToken:GT('>')
+    PsiWhiteSpace('\n ')
+    PsiTypeElement:String
+      PsiJavaCodeReferenceElement:String
+        PsiIdentifier:String('String')
+        PsiReferenceParameterList
+          <empty list>
+    PsiWhiteSpace(' ')
+    PsiIdentifier:s('s')
+    PsiWhiteSpace(' ')
+    PsiJavaToken:EQ('=')
+    PsiWhiteSpace(' ')
+    PsiLiteralExpression:""
+      PsiJavaToken:STRING_LITERAL('""')
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/CompletionHack1.txt b/java/java-tests/testData/psi/parser-partial/declarations/CompletionHack1.txt
new file mode 100644 (file)
index 0000000..1278277
--- /dev/null
@@ -0,0 +1,31 @@
+PsiJavaFile:CompletionHack1.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:s
+    PsiModifierList:
+      <empty list>
+    PsiErrorElement:Unexpected token
+      PsiTypeParameterList
+        PsiJavaToken:LT('<')
+        PsiTypeParameter:X
+          PsiIdentifier:X('X')
+          PsiElement(EXTENDS_BOUND_LIST)
+            <empty list>
+        PsiErrorElement:'>' expected.
+          <empty list>
+    PsiWhiteSpace('\n ')
+    PsiTypeElement:String
+      PsiJavaCodeReferenceElement:String
+        PsiIdentifier:String('String')
+        PsiReferenceParameterList
+          <empty list>
+    PsiWhiteSpace(' ')
+    PsiIdentifier:s('s')
+    PsiWhiteSpace(' ')
+    PsiJavaToken:EQ('=')
+    PsiWhiteSpace(' ')
+    PsiLiteralExpression:""
+      PsiJavaToken:STRING_LITERAL('""')
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EmptyBody0.txt b/java/java-tests/testData/psi/parser-partial/declarations/EmptyBody0.txt
new file mode 100644 (file)
index 0000000..a831669
--- /dev/null
@@ -0,0 +1,4 @@
+PsiJavaFile:EmptyBody0.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EmptyBody1.txt b/java/java-tests/testData/psi/parser-partial/declarations/EmptyBody1.txt
new file mode 100644 (file)
index 0000000..60988ad
--- /dev/null
@@ -0,0 +1,5 @@
+PsiJavaFile:EmptyBody1.java
+  PsiJavaToken:LBRACE('{')
+  PsiErrorElement:'}' expected
+    <empty list>
+  PsiWhiteSpace(' ')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EnumBody0.txt b/java/java-tests/testData/psi/parser-partial/declarations/EnumBody0.txt
new file mode 100644 (file)
index 0000000..a221d65
--- /dev/null
@@ -0,0 +1,6 @@
+PsiJavaFile:EnumBody0.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EnumBody1.txt b/java/java-tests/testData/psi/parser-partial/declarations/EnumBody1.txt
new file mode 100644 (file)
index 0000000..04b16bc
--- /dev/null
@@ -0,0 +1,28 @@
+PsiJavaFile:EnumBody1.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:RED
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:RED('RED')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:GREEN
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:GREEN('GREEN')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:BLUE
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:BLUE('BLUE')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EnumBody2.txt b/java/java-tests/testData/psi/parser-partial/declarations/EnumBody2.txt
new file mode 100644 (file)
index 0000000..0e64713
--- /dev/null
@@ -0,0 +1,27 @@
+PsiJavaFile:EnumBody2.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:RED
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:RED('RED')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:GREEN
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:GREEN('GREEN')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:BLUE
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:BLUE('BLUE')
+    PsiExpressionList
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EnumBody3.txt b/java/java-tests/testData/psi/parser-partial/declarations/EnumBody3.txt
new file mode 100644 (file)
index 0000000..ea0d456
--- /dev/null
@@ -0,0 +1,28 @@
+PsiJavaFile:EnumBody3.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:RED
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:RED('RED')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:GREEN
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:GREEN('GREEN')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:BLUE
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:BLUE('BLUE')
+    PsiExpressionList
+      <empty list>
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EnumBody4.txt b/java/java-tests/testData/psi/parser-partial/declarations/EnumBody4.txt
new file mode 100644 (file)
index 0000000..f20ec90
--- /dev/null
@@ -0,0 +1,37 @@
+PsiJavaFile:EnumBody4.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:RED
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:RED('RED')
+    PsiExpressionList
+      PsiJavaToken:LPARENTH('(')
+      PsiLiteralExpression:0
+        PsiJavaToken:INTEGER_LITERAL('0')
+      PsiJavaToken:RPARENTH(')')
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:GREEN
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:GREEN('GREEN')
+    PsiExpressionList
+      PsiJavaToken:LPARENTH('(')
+      PsiLiteralExpression:1
+        PsiJavaToken:INTEGER_LITERAL('1')
+      PsiJavaToken:RPARENTH(')')
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:BLUE
+    PsiModifierList:
+      <empty list>
+    PsiIdentifier:BLUE('BLUE')
+    PsiExpressionList
+      PsiJavaToken:LPARENTH('(')
+      PsiLiteralExpression:2
+        PsiJavaToken:INTEGER_LITERAL('2')
+      PsiJavaToken:RPARENTH(')')
+  PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/EnumBody5.txt b/java/java-tests/testData/psi/parser-partial/declarations/EnumBody5.txt
new file mode 100644 (file)
index 0000000..573f347
--- /dev/null
@@ -0,0 +1,22 @@
+PsiJavaFile:EnumBody5.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiEnumConstant:A
+    PsiModifierList:@ANNOTATION
+      PsiAnnotation
+        PsiJavaToken:AT('@')
+        PsiJavaCodeReferenceElement:ANNOTATION
+          PsiIdentifier:ANNOTATION('ANNOTATION')
+          PsiReferenceParameterList
+            <empty list>
+        PsiAnnotationParameterList
+          <empty list>
+    PsiWhiteSpace(' ')
+    PsiIdentifier:A('A')
+    PsiExpressionList
+      PsiJavaToken:LPARENTH('(')
+      PsiLiteralExpression:10
+        PsiJavaToken:INTEGER_LITERAL('10')
+      PsiJavaToken:RPARENTH(')')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/Errors.txt b/java/java-tests/testData/psi/parser-partial/declarations/Errors.txt
new file mode 100644 (file)
index 0000000..609379f
--- /dev/null
@@ -0,0 +1,45 @@
+PsiJavaFile:Errors.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiModifierList:public static
+    PsiKeyword:public('public')
+    PsiWhiteSpace(' ')
+    PsiKeyword:static('static')
+  PsiWhiteSpace(' ')
+  PsiErrorElement:Unexpected token
+    PsiTypeParameterList
+      PsiJavaToken:LT('<')
+      PsiTypeParameter:error
+        PsiIdentifier:error('error')
+        PsiElement(EXTENDS_BOUND_LIST)
+          <empty list>
+      PsiErrorElement:'>' expected.
+        <empty list>
+  PsiWhiteSpace(' ')
+  PsiTypeElement:descr
+    PsiJavaCodeReferenceElement:descr
+      PsiIdentifier:descr('descr')
+      PsiReferenceParameterList
+        <empty list>
+  PsiErrorElement:Identifier expected
+    <empty list>
+  PsiErrorElement:Unexpected token
+    PsiJavaToken:EQ('=')
+    PsiJavaToken:STRING_LITERAL('"2"')
+    PsiJavaToken:GT('>')
+  PsiField:f1
+    PsiModifierList:protected
+      PsiKeyword:protected('protected')
+    PsiWhiteSpace(' ')
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f1('f1')
+    PsiWhiteSpace(' ')
+    PsiJavaToken:EQ('=')
+    PsiWhiteSpace(' ')
+    PsiLiteralExpression:0
+      PsiJavaToken:INTEGER_LITERAL('0')
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/FieldMulti.txt b/java/java-tests/testData/psi/parser-partial/declarations/FieldMulti.txt
new file mode 100644 (file)
index 0000000..22138d6
--- /dev/null
@@ -0,0 +1,22 @@
+PsiJavaFile:FieldMulti.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:field1
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:field1('field1')
+    PsiWhiteSpace(' ')
+    PsiJavaToken:EQ('=')
+    PsiWhiteSpace(' ')
+    PsiLiteralExpression:0
+      PsiJavaToken:INTEGER_LITERAL('0')
+  PsiJavaToken:COMMA(',')
+  PsiWhiteSpace(' ')
+  PsiField:field2
+    PsiIdentifier:field2('field2')
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/FieldSimple.txt b/java/java-tests/testData/psi/parser-partial/declarations/FieldSimple.txt
new file mode 100644 (file)
index 0000000..59dc28f
--- /dev/null
@@ -0,0 +1,18 @@
+PsiJavaFile:FieldSimple.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:field
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:field('field')
+    PsiWhiteSpace(' ')
+    PsiJavaToken:EQ('=')
+    PsiWhiteSpace(' ')
+    PsiLiteralExpression:0
+      PsiJavaToken:INTEGER_LITERAL('0')
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/GenericMethod.txt b/java/java-tests/testData/psi/parser-partial/declarations/GenericMethod.txt
new file mode 100644 (file)
index 0000000..7504f36
--- /dev/null
@@ -0,0 +1,91 @@
+PsiJavaFile:GenericMethod.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:test
+    PsiModifierList:public static
+      PsiKeyword:public('public')
+      PsiWhiteSpace(' ')
+      PsiKeyword:static('static')
+    PsiWhiteSpace(' ')
+    PsiTypeParameterList
+      PsiJavaToken:LT('<')
+      PsiTypeParameter:E
+        PsiIdentifier:E('E')
+        PsiElement(EXTENDS_BOUND_LIST)
+          <empty list>
+      PsiJavaToken:GT('>')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:test('test')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace('\n ')
+  PsiMethod:test1
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      PsiJavaToken:LT('<')
+      PsiTypeParameter:E
+        PsiIdentifier:E('E')
+        PsiElement(EXTENDS_BOUND_LIST)
+          <empty list>
+      PsiJavaToken:GT('>')
+    PsiWhiteSpace(' ')
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:test1('test1')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace('\n ')
+  PsiMethod:test2
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      PsiJavaToken:LT('<')
+      PsiTypeParameter:E1
+        PsiIdentifier:E1('E1')
+        PsiWhiteSpace(' ')
+        PsiElement(EXTENDS_BOUND_LIST)
+          PsiKeyword:extends('extends')
+          PsiWhiteSpace(' ')
+          PsiJavaCodeReferenceElement:Integer
+            PsiIdentifier:Integer('Integer')
+            PsiReferenceParameterList
+              <empty list>
+      PsiJavaToken:COMMA(',')
+      PsiWhiteSpace(' ')
+      PsiTypeParameter:E2
+        PsiIdentifier:E2('E2')
+        PsiWhiteSpace(' ')
+        PsiElement(EXTENDS_BOUND_LIST)
+          PsiKeyword:extends('extends')
+          PsiWhiteSpace(' ')
+          PsiJavaCodeReferenceElement:Runnable
+            PsiIdentifier:Runnable('Runnable')
+            PsiReferenceParameterList
+              <empty list>
+      PsiJavaToken:GT('>')
+    PsiWhiteSpace(' ')
+    PsiTypeElement:String
+      PsiJavaCodeReferenceElement:String
+        PsiIdentifier:String('String')
+        PsiReferenceParameterList
+          <empty list>
+    PsiWhiteSpace(' ')
+    PsiIdentifier:test2('test2')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/GenericMethodErrors.txt b/java/java-tests/testData/psi/parser-partial/declarations/GenericMethodErrors.txt
new file mode 100644 (file)
index 0000000..5be5047
--- /dev/null
@@ -0,0 +1,43 @@
+PsiJavaFile:GenericMethodErrors.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiModifierList:
+    <empty list>
+  PsiErrorElement:Unexpected token
+    PsiTypeParameterList
+      PsiJavaToken:LT('<')
+      PsiTypeParameter:Error
+        PsiIdentifier:Error('Error')
+        PsiElement(EXTENDS_BOUND_LIST)
+          <empty list>
+      PsiErrorElement:'>' expected.
+        <empty list>
+  PsiWhiteSpace(' ')
+  PsiTypeElement:sss
+    PsiJavaCodeReferenceElement:sss
+      PsiIdentifier:sss('sss')
+      PsiReferenceParameterList
+        <empty list>
+  PsiErrorElement:Identifier expected
+    <empty list>
+  PsiWhiteSpace(' ')
+  PsiErrorElement:Unexpected token
+    PsiJavaToken:DIV('/')
+    PsiJavaToken:GT('>')
+    PsiWhiteSpace(' ')
+    PsiJavaCodeReferenceElement:test <error>
+      PsiIdentifier:test('test')
+      PsiWhiteSpace(' ')
+      PsiReferenceParameterList
+        PsiJavaToken:LT('<')
+        PsiTypeElement:error
+          PsiJavaCodeReferenceElement:error
+            PsiIdentifier:error('error')
+            PsiReferenceParameterList
+              <empty list>
+        PsiJavaToken:GT('>')
+    PsiJavaToken:LPARENTH('(')
+    PsiJavaToken:RPARENTH(')')
+  PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/MethodNormal0.txt b/java/java-tests/testData/psi/parser-partial/declarations/MethodNormal0.txt
new file mode 100644 (file)
index 0000000..f2383f5
--- /dev/null
@@ -0,0 +1,24 @@
+PsiJavaFile:MethodNormal0.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiWhiteSpace(' ')
+    PsiCodeBlock
+      PsiJavaToken:LBRACE('{')
+      PsiWhiteSpace(' ')
+      PsiJavaToken:RBRACE('}')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/MethodNormal1.txt b/java/java-tests/testData/psi/parser-partial/declarations/MethodNormal1.txt
new file mode 100644 (file)
index 0000000..b146b9b
--- /dev/null
@@ -0,0 +1,20 @@
+PsiJavaFile:MethodNormal1.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/MissingInitializer.txt b/java/java-tests/testData/psi/parser-partial/declarations/MissingInitializer.txt
new file mode 100644 (file)
index 0000000..ad9b3b2
--- /dev/null
@@ -0,0 +1,16 @@
+PsiJavaFile:MissingInitializer.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:field
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:field('field')
+    PsiWhiteSpace(' ')
+    PsiJavaToken:EQ('=')
+    PsiErrorElement:Expression expected
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/MissingInitializerExpression.txt b/java/java-tests/testData/psi/parser-partial/declarations/MissingInitializerExpression.txt
new file mode 100644 (file)
index 0000000..e7dac65
--- /dev/null
@@ -0,0 +1,16 @@
+PsiJavaFile:MissingInitializerExpression.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:field
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:field('field')
+    PsiJavaToken:EQ('=')
+    PsiErrorElement:Expression expected
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/MultiLineUnclosed.txt b/java/java-tests/testData/psi/parser-partial/declarations/MultiLineUnclosed.txt
new file mode 100644 (file)
index 0000000..d44d891
--- /dev/null
@@ -0,0 +1,23 @@
+PsiJavaFile:MultiLineUnclosed.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiModifierList:
+    <empty list>
+  PsiTypeElement:int
+    PsiKeyword:int('int')
+  PsiErrorElement:Identifier expected
+    <empty list>
+  PsiWhiteSpace(' \n  ')
+  PsiField:o
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:Object
+      PsiJavaCodeReferenceElement:Object
+        PsiIdentifier:Object('Object')
+        PsiReferenceParameterList
+          <empty list>
+    PsiWhiteSpace(' ')
+    PsiIdentifier:o('o')
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/Unclosed0.txt b/java/java-tests/testData/psi/parser-partial/declarations/Unclosed0.txt
new file mode 100644 (file)
index 0000000..9353f05
--- /dev/null
@@ -0,0 +1,21 @@
+PsiJavaFile:Unclosed0.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiErrorElement:'{' or ';' expected
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/Unclosed1.txt b/java/java-tests/testData/psi/parser-partial/declarations/Unclosed1.txt
new file mode 100644 (file)
index 0000000..c7b4159
--- /dev/null
@@ -0,0 +1,22 @@
+PsiJavaFile:Unclosed1.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:(
+      PsiJavaToken:LPARENTH('(')
+      PsiErrorElement:')' expected
+        <empty list>
+    PsiReferenceList
+      <empty list>
+    PsiErrorElement:'{' or ';' expected
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/Unclosed2.txt b/java/java-tests/testData/psi/parser-partial/declarations/Unclosed2.txt
new file mode 100644 (file)
index 0000000..b2a0dfe
--- /dev/null
@@ -0,0 +1,37 @@
+PsiJavaFile:Unclosed2.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiErrorElement:'{' or ';' expected
+      <empty list>
+  PsiWhiteSpace('\n ')
+  PsiMethod:g
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:g('g')
+    PsiParameterList:()
+      PsiJavaToken:LPARENTH('(')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/Unclosed3.txt b/java/java-tests/testData/psi/parser-partial/declarations/Unclosed3.txt
new file mode 100644 (file)
index 0000000..82caa1c
--- /dev/null
@@ -0,0 +1,29 @@
+PsiJavaFile:Unclosed3.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:(int a
+      PsiJavaToken:LPARENTH('(')
+      PsiParameter:a
+        PsiModifierList:
+          <empty list>
+        PsiTypeElement:int
+          PsiKeyword:int('int')
+        PsiWhiteSpace(' ')
+        PsiIdentifier:a('a')
+      PsiErrorElement:')' expected
+        <empty list>
+    PsiReferenceList
+      <empty list>
+    PsiErrorElement:'{' or ';' expected
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/Unclosed4.txt b/java/java-tests/testData/psi/parser-partial/declarations/Unclosed4.txt
new file mode 100644 (file)
index 0000000..d7ffeea
--- /dev/null
@@ -0,0 +1,33 @@
+PsiJavaFile:Unclosed4.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:(int a,,
+      PsiJavaToken:LPARENTH('(')
+      PsiParameter:a
+        PsiModifierList:
+          <empty list>
+        PsiTypeElement:int
+          PsiKeyword:int('int')
+        PsiWhiteSpace(' ')
+        PsiIdentifier:a('a')
+      PsiJavaToken:COMMA(',')
+      PsiErrorElement:Parameter expected
+        <empty list>
+      PsiJavaToken:COMMA(',')
+      PsiErrorElement:Identifier or type expected
+        <empty list>
+    PsiReferenceList
+      <empty list>
+    PsiErrorElement:'{' or ';' expected
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/Unclosed5.txt b/java/java-tests/testData/psi/parser-partial/declarations/Unclosed5.txt
new file mode 100644 (file)
index 0000000..a0166d8
--- /dev/null
@@ -0,0 +1,30 @@
+PsiJavaFile:Unclosed5.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:f
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:void
+      PsiKeyword:void('void')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:f('f')
+    PsiParameterList:(int a,)
+      PsiJavaToken:LPARENTH('(')
+      PsiParameter:a
+        PsiModifierList:
+          <empty list>
+        PsiTypeElement:int
+          PsiKeyword:int('int')
+        PsiWhiteSpace(' ')
+        PsiIdentifier:a('a')
+      PsiJavaToken:COMMA(',')
+      PsiErrorElement:Identifier or type expected
+        <empty list>
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/UnclosedBracket.txt b/java/java-tests/testData/psi/parser-partial/declarations/UnclosedBracket.txt
new file mode 100644 (file)
index 0000000..e17119c
--- /dev/null
@@ -0,0 +1,15 @@
+PsiJavaFile:UnclosedBracket.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:field
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:field('field')
+    PsiJavaToken:LBRACKET('[')
+    PsiErrorElement:']' expected
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/UnclosedComma.txt b/java/java-tests/testData/psi/parser-partial/declarations/UnclosedComma.txt
new file mode 100644 (file)
index 0000000..83f9e32
--- /dev/null
@@ -0,0 +1,15 @@
+PsiJavaFile:UnclosedComma.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:field
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:field('field')
+  PsiJavaToken:COMMA(',')
+  PsiErrorElement:Identifier expected
+    <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/UnclosedSemicolon.txt b/java/java-tests/testData/psi/parser-partial/declarations/UnclosedSemicolon.txt
new file mode 100644 (file)
index 0000000..f185e98
--- /dev/null
@@ -0,0 +1,14 @@
+PsiJavaFile:UnclosedSemicolon.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiField:field
+    PsiModifierList:
+      <empty list>
+    PsiTypeElement:int
+      PsiKeyword:int('int')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:field('field')
+    PsiErrorElement:';' expected
+      <empty list>
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
diff --git a/java/java-tests/testData/psi/parser-partial/declarations/WildcardParsing.txt b/java/java-tests/testData/psi/parser-partial/declarations/WildcardParsing.txt
new file mode 100644 (file)
index 0000000..b433896
--- /dev/null
@@ -0,0 +1,55 @@
+PsiJavaFile:WildcardParsing.java
+  PsiJavaToken:LBRACE('{')
+  PsiWhiteSpace(' ')
+  PsiMethod:x
+    PsiModifierList:
+      <empty list>
+    PsiTypeParameterList
+      <empty list>
+    PsiTypeElement:List<? extends B>
+      PsiJavaCodeReferenceElement:List<? extends B>
+        PsiIdentifier:List('List')
+        PsiReferenceParameterList
+          PsiJavaToken:LT('<')
+          PsiTypeElement:? extends B
+            PsiJavaToken:QUEST('?')
+            PsiWhiteSpace(' ')
+            PsiKeyword:extends('extends')
+            PsiWhiteSpace(' ')
+            PsiTypeElement:B
+              PsiJavaCodeReferenceElement:B
+                PsiIdentifier:B('B')
+                PsiReferenceParameterList
+                  <empty list>
+          PsiJavaToken:GT('>')
+    PsiWhiteSpace(' ')
+    PsiIdentifier:x('x')
+    PsiParameterList:(Collection<? super B> x)
+      PsiJavaToken:LPARENTH('(')
+      PsiParameter:x
+        PsiModifierList:
+          <empty list>
+        PsiTypeElement:Collection<? super B>
+          PsiJavaCodeReferenceElement:Collection<? super B>
+            PsiIdentifier:Collection('Collection')
+            PsiReferenceParameterList
+              PsiJavaToken:LT('<')
+              PsiTypeElement:? super B
+                PsiJavaToken:QUEST('?')
+                PsiWhiteSpace(' ')
+                PsiKeyword:super('super')
+                PsiWhiteSpace(' ')
+                PsiTypeElement:B
+                  PsiJavaCodeReferenceElement:B
+                    PsiIdentifier:B('B')
+                    PsiReferenceParameterList
+                      <empty list>
+              PsiJavaToken:GT('>')
+        PsiWhiteSpace(' ')
+        PsiIdentifier:x('x')
+      PsiJavaToken:RPARENTH(')')
+    PsiReferenceList
+      <empty list>
+    PsiJavaToken:SEMICOLON(';')
+  PsiWhiteSpace(' ')
+  PsiJavaToken:RBRACE('}')
\ No newline at end of file
diff --git a/java/java-tests/testData/psi/parser-partial/references/Type5.txt b/java/java-tests/testData/psi/parser-partial/references/Type5.txt
new file mode 100644 (file)
index 0000000..74a43fc
--- /dev/null
@@ -0,0 +1,11 @@
+PsiJavaFile:Type5.java
+  PsiTypeElement:Object[]...
+    PsiTypeElement:Object[]
+      PsiTypeElement:Object
+        PsiJavaCodeReferenceElement:Object
+          PsiIdentifier:Object('Object')
+          PsiReferenceParameterList
+            <empty list>
+      PsiJavaToken:LBRACKET('[')
+      PsiJavaToken:RBRACKET(']')
+    PsiJavaToken:ELLIPSIS('...')
\ No newline at end of file
index 51d776e6a39e2f641ef4c0822f55b158eeef59ba..a7329da61f08eba21e6586d44025c9577b705ce8 100644 (file)
@@ -4,9 +4,9 @@ PsiJavaFile:TypeParams5.java
     PsiTypeParameter:T
       PsiIdentifier:T('T')
       PsiWhiteSpace(' ')
-      PsiKeyword:extends('extends')
-      PsiWhiteSpace(' ')
       PsiElement(EXTENDS_BOUND_LIST)
+        PsiKeyword:extends('extends')
+        PsiWhiteSpace(' ')
         PsiJavaCodeReferenceElement:X
           PsiIdentifier:X('X')
           PsiReferenceParameterList
index f3cf0196d19af551206632238de74310758c2349..aaea7b8c3d5d731d71395c3ffaf88dfa0489777c 100644 (file)
@@ -4,9 +4,9 @@ PsiJavaFile:TypeParams7.java
     PsiTypeParameter:T
       PsiIdentifier:T('T')
       PsiWhiteSpace(' ')
-      PsiKeyword:extends('extends')
-      PsiWhiteSpace(' ')
       PsiElement(EXTENDS_BOUND_LIST)
+        PsiKeyword:extends('extends')
+        PsiWhiteSpace(' ')
         PsiJavaCodeReferenceElement:X
           PsiIdentifier:X('X')
           PsiReferenceParameterList
diff --git a/java/java-tests/testData/refactoring/inlineConstantField/QualifiedConstantExpressionReplacedWithAnotherOne.java b/java/java-tests/testData/refactoring/inlineConstantField/QualifiedConstantExpressionReplacedWithAnotherOne.java
new file mode 100644 (file)
index 0000000..69dad46
--- /dev/null
@@ -0,0 +1,10 @@
+class QTest {
+  final int myI = Source.CONST;
+  public static void main(String[] args) {
+    System.out.println(new QTest().my<caret>I);
+  }
+}
+
+class Source {
+  int CONST = 0;
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineConstantField/QualifiedConstantExpressionReplacedWithAnotherOne.java.after b/java/java-tests/testData/refactoring/inlineConstantField/QualifiedConstantExpressionReplacedWithAnotherOne.java.after
new file mode 100644 (file)
index 0000000..c9d9be2
--- /dev/null
@@ -0,0 +1,9 @@
+class QTest {
+    public static void main(String[] args) {
+    System.out.println(Source.CONST);
+  }
+}
+
+class Source {
+  int CONST = 0;
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineParameter/CantInlineRecursive.java b/java/java-tests/testData/refactoring/inlineParameter/CantInlineRecursive.java
new file mode 100644 (file)
index 0000000..5c7474f
--- /dev/null
@@ -0,0 +1,18 @@
+import java.lang.Integer;
+import java.util.*;
+import java.util.ArrayList;
+
+public class ExpData {
+   private final List<Integer> myResult = new ArrayList<Integer>();
+  {
+    m(10, myResult);
+  }
+
+  private void m(int i, List<Integer> re<caret>sult) {
+    if (i > 0) {
+      m(i - 1, result);
+    }
+    result.add(i);
+    m(2, new ArrayList<Integer>());
+  }
+}
diff --git a/java/java-tests/testData/refactoring/inlineParameter/InlineRecursive.java b/java/java-tests/testData/refactoring/inlineParameter/InlineRecursive.java
new file mode 100644 (file)
index 0000000..88fb548
--- /dev/null
@@ -0,0 +1,15 @@
+import java.util.*;
+
+public class ExpData {
+   private final List<Integer> myResult = new ArrayList<Integer>();
+  {
+    m(10, myResult);
+  }
+
+  private void m(int i, List<Integer> re<caret>sult) {
+    if (i > 0) {
+      m(i - 1, result);
+    }
+    result.add(i);
+  }
+}
diff --git a/java/java-tests/testData/refactoring/inlineParameter/InlineRecursive.java.after b/java/java-tests/testData/refactoring/inlineParameter/InlineRecursive.java.after
new file mode 100644 (file)
index 0000000..ef341a3
--- /dev/null
@@ -0,0 +1,15 @@
+import java.util.*;
+
+public class ExpData {
+   private final List<Integer> myResult = new ArrayList<Integer>();
+  {
+    m(10);
+  }
+
+  private void m(int i) {
+    if (i > 0) {
+      m(i - 1);
+    }
+    myResult.add(i);
+  }
+}
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/ISuper.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/ISuper.java
new file mode 100644 (file)
index 0000000..42f94cf
--- /dev/null
@@ -0,0 +1 @@
+interface ISuper {}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/Test.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/Test.java
new file mode 100644 (file)
index 0000000..0988603
--- /dev/null
@@ -0,0 +1 @@
+class Test implements ISuper {}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/Test1.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/after/Test1.java
new file mode 100644 (file)
index 0000000..b312de8
--- /dev/null
@@ -0,0 +1,2 @@
+class Test1 implements ISuper {
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/ISuper.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/ISuper.java
new file mode 100644 (file)
index 0000000..42f94cf
--- /dev/null
@@ -0,0 +1 @@
+interface ISuper {}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Super.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Super.java
new file mode 100644 (file)
index 0000000..7d430e3
--- /dev/null
@@ -0,0 +1 @@
+public interface Super extends ISuper{}
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Test.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Test.java
new file mode 100644 (file)
index 0000000..22d8cb1
--- /dev/null
@@ -0,0 +1 @@
+class Test implements Super {}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Test1.java b/java/java-tests/testData/refactoring/inlineSuperClass/multipleSubclassesInheritsOneBaseBase/before/Test1.java
new file mode 100644 (file)
index 0000000..8bcdbac
--- /dev/null
@@ -0,0 +1,2 @@
+class Test1 implements Super{
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubexpressionWithSpacesInSelection.after.java b/java/java-tests/testData/refactoring/introduceVariable/SubexpressionWithSpacesInSelection.after.java
new file mode 100644 (file)
index 0000000..8d577b1
--- /dev/null
@@ -0,0 +1,10 @@
+class A {
+    public void test(boolean a, boolean b) {
+        final boolean ab = a &&
+                b;
+        if (true && ab
+//some comment
+
+      );
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/introduceVariable/SubexpressionWithSpacesInSelection.java b/java/java-tests/testData/refactoring/introduceVariable/SubexpressionWithSpacesInSelection.java
new file mode 100644 (file)
index 0000000..f0475fa
--- /dev/null
@@ -0,0 +1,9 @@
+class A {
+    public void test(boolean a, boolean b) {
+        if (true && <selection>a &&
+                     b
+//some comment
+</selection>
+      );
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/safeDelete/methodDeepHierarchy/after/Super.java b/java/java-tests/testData/refactoring/safeDelete/methodDeepHierarchy/after/Super.java
new file mode 100644 (file)
index 0000000..c8d653a
--- /dev/null
@@ -0,0 +1,9 @@
+public class Super {
+
+}
+
+class Child extends Super {
+    }
+
+class ChildChild extends Child {
+    }
\ No newline at end of file
diff --git a/java/java-tests/testData/refactoring/safeDelete/methodDeepHierarchy/before/Super.java b/java/java-tests/testData/refactoring/safeDelete/methodDeepHierarchy/before/Super.java
new file mode 100644 (file)
index 0000000..ee8fa04
--- /dev/null
@@ -0,0 +1,19 @@
+public class Super {
+    void f<caret>oo() {
+    }
+
+}
+
+class Child extends Super {
+    void foo(){
+      super.foo();
+      System.out.println("do some staff");
+    }
+}
+
+class ChildChild extends Child {
+    void foo(){
+      super.foo();
+      System.out.println("here do smth else");
+    }
+}
\ No newline at end of file
diff --git a/java/java-tests/testSrc/com/intellij/lang/java/parser/partial/DeclarationParserTest.java b/java/java-tests/testSrc/com/intellij/lang/java/parser/partial/DeclarationParserTest.java
new file mode 100644 (file)
index 0000000..577e74a
--- /dev/null
@@ -0,0 +1,71 @@
+/*
+ * 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.lang.java.parser.partial;
+
+import com.intellij.lang.PsiBuilder;
+import com.intellij.lang.java.parser.DeclarationParser;
+import com.intellij.lang.java.parser.JavaParsingTestCase;
+
+
+public class DeclarationParserTest extends JavaParsingTestCase {
+  public DeclarationParserTest() {
+    super("parser-partial/declarations");
+  }
+
+  public void testEmptyBody0() { doParserTest("{ }", false, false); }
+  public void testEmptyBody1() { doParserTest("{ ", false, false); }
+
+  public void testEnumBody0() { doParserTest("{ ; }", false, true); }
+  public void testEnumBody1() { doParserTest("{ RED, GREEN, BLUE; }", false, true); }
+  public void testEnumBody2() { doParserTest("{ RED, GREEN, BLUE }", false, true); }
+  public void testEnumBody3() { doParserTest("{ RED, GREEN, BLUE, }", false, true); }
+  public void testEnumBody4() { doParserTest("{ RED(0), GREEN(1), BLUE(2); }", false, true); }
+  public void testEnumBody5() { doParserTest("{ @ANNOTATION A(10) }", false, true); }
+
+  public void testFieldSimple() { doParserTest("{ int field = 0; }", false, false); }
+  public void testFieldMulti() { doParserTest("{ int field1 = 0, field2; }", false, false); }
+  public void testUnclosedBracket() { doParserTest("{ int field[ }", false, false); }
+  public void testMissingInitializer() { doParserTest("{ int field = }", false, false); }
+  public void testUnclosedComma() { doParserTest("{ int field, }", false, false); }
+  public void testUnclosedSemicolon() { doParserTest("{ int field }", false, false); }
+  public void testMissingInitializerExpression() { doParserTest("{ int field=; }", false, false); }
+  //public void testMultiLineUnclosed() { doParserTest("{ int \n  Object o; }", false, false); }  // todo: implement
+
+  //public void testMethodNormal0() { doParserTest("{ void f() { } }", false, false); }  // todo: parse code block correctly
+  public void testMethodNormal1() { doParserTest("{ void f(); }", false, false); }
+  public void testUnclosed0() { doParserTest("{ void f() }", false, false); }
+  public void testUnclosed1() { doParserTest("{ void f( }", false, false); }
+  public void testUnclosed2() { doParserTest("{ void f()\n void g(); }", false, false); }
+  public void testUnclosed3() { doParserTest("{ void f(int a }", false, false); }
+  public void testUnclosed4() { doParserTest("{ void f(int a,, }", false, false); }
+  public void testUnclosed5() { doParserTest("{ void f(int a,); }", false, false); }
+  public void testGenericMethod() { doParserTest("{ public static <E> test();\n" +
+                                                 " <E> void test1();\n" +
+                                                 " <E1 extends Integer, E2 extends Runnable> String test2(); }", false, false); }
+  public void testGenericMethodErrors() { doParserTest("{ <Error sss /> test <error>(); }", false, false); }
+  public void testErrors() { doParserTest("{ public static <error descr=\"2\">protected int f1 = 0; }", false, false); }
+  public void testCompletionHack0() { doParserTest("{ <X IntelliJIdeaRulezz>\n String s = \"\"; }", false, false); }
+  public void testCompletionHack1() { doParserTest("{ <X\n String s = \"\"; }", false, false); }
+  public void testWildcardParsing() { doParserTest("{ List<? extends B> x(Collection<? super B> x); }", false, false); }
+
+  private void doParserTest(final String text, final boolean isAnnotation, final boolean isEnum) {
+    doParserTest(text, new Parser() {
+      public void parse(final PsiBuilder builder) {
+        DeclarationParser.parseClassBodyWithBraces(builder, isAnnotation, isEnum);
+      }
+    });
+  }
+}
index da5651bf4eb9103c6dec013e3b587cd8d0b40fe9..77e1e8cb3f1e662447b4ebf73088be5df3db62ef 100644 (file)
@@ -34,6 +34,7 @@ public class ReferenceParserTest extends JavaParsingTestCase {
   public void testType2() { doTypeParserTest("int[]", false); }
   public void testType3() { doTypeParserTest("int[][", false); }
   public void testType4() { doTypeParserTest("Map<String,List<String>>", false); }
+  public void testType5() { doTypeParserTest("Object[]...", false); }
 
   public void testTypeParams0() { doTypeParamsParserTest("<T>"); }
   public void testTypeParams1() { doTypeParamsParserTest("<T, U>"); }
@@ -55,7 +56,7 @@ public class ReferenceParserTest extends JavaParsingTestCase {
   private void doTypeParserTest(final String text, final boolean incomplete) {
     doParserTest(text, new Parser() {
       public void parse(final PsiBuilder builder) {
-        ReferenceParser.parseType(builder, incomplete, false);
+        ReferenceParser.parseTypeWithEllipsis(builder, incomplete, false);
       }
     });
   }
index 81df809876c2c652a19a7e031cc8ec4094f5af22..7b61e89605bde7e7eb0527e1a617587d7a6c8e61 100644 (file)
@@ -168,6 +168,10 @@ public class InlineSuperClassTest extends MultiFileTestCase {
     doTestMultipleSubclasses();
   }
 
+  public void testMultipleSubclassesInheritsOneBaseBase() throws Exception {
+    doTestMultipleSubclasses();
+  }
+
   private void doTestMultipleSubclasses() throws Exception {
     doTest(new PerformAction() {
       public void performAction(final VirtualFile rootDir, final VirtualFile rootAfter) throws Exception {
index 1db6d6e7e10020ed09ee3520873df84de7b11f0c..e2fccd3b84a2c98b89503c033028f87c946c2b60 100644 (file)
@@ -198,6 +198,10 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
   public void testAndAndSubexpression() throws Exception {
     doTest(new MockIntroduceVariableHandler("ab", true, true, false, "boolean"));
   }
+  
+  public void testSubexpressionWithSpacesInSelection() throws Exception {
+    doTest(new MockIntroduceVariableHandler("ab", true, true, false, "boolean"));
+  }
 
   public void testDuplicatesAnonymousClassCreationWithSimilarParameters () throws Exception {
     doTest(new MockIntroduceVariableHandler("foo1", true, true, false, "Foo"));
index 499e9a281a3251c94a1bc79fcc426093d8fe6b50..add28931cb5b68a55769cde35f98ffca85a79c84 100644 (file)
@@ -82,6 +82,11 @@ public class SafeDeleteTest extends MultiFileTestCase {
     doTest("Super");
   }
 
+  public void testMethodDeepHierarchy() throws Exception {
+    myDoCompare = false;
+    doTest("Super");
+  }
+
   public void testLocalVariableSideEffect() throws Exception {
     myDoCompare = false;
     try {
index 9257fd73d8b4aea3ce5af91606c949aab345cc77..a27675020e98070def470ba43a0dd6a2fe30407b 100644 (file)
@@ -25,6 +25,10 @@ public class InlineConstantFieldTest extends LightCodeInsightTestCase {
     doTest();
   }
 
+   public void testQualifiedConstantExpressionReplacedWithAnotherOne() throws Exception {
+    doTest();
+  }
+
   @Override
   protected Sdk getProjectJDK() {
     return JavaSdkImpl.getMockJdk17("java 1.5");
index 4e58558adc28bb4d3095cab64fdce516f030809f..7c24c6971926960a52ba99162bda8973ea9b0753 100644 (file)
@@ -250,6 +250,21 @@ public class InlineParameterTest extends LightCodeInsightTestCase {
     doTest(false);
   }
 
+  public void testInlineRecursive() throws Exception {
+    doTest(false);
+  }
+
+  public void testCantInlineRecursive() throws Exception {
+    try {
+      doTest(false);
+    }
+    catch (CommonRefactoringUtil.RefactoringErrorHintException e) {
+      assertEquals("Cannot find constant initializer for parameter", e.getMessage());
+      return;
+    }
+    fail("Initializer shoul not be found");
+  }
+
   public void testParameterDefWithWriteAccess()  throws Exception {
     try {
       doTest(false);
index a8b32cbc3614ae36b3caf52bd1f5d993c8527380..3850ea4052e6ea277d1f99c0bf3b291907663414 100644 (file)
@@ -159,11 +159,15 @@ public class ModuleRootsExternalizationTest extends ModuleTestCase {
                         "<orderEntry type=\"module-library\">" +
                         "<library>" +
                         "<CLASSES><root url=\"file://$MODULE_DIR$/unnamedLibClasses\" /></CLASSES>" +
+                        "<JAVADOC />" +
+                        "<SOURCES />" +
                         "</library>" +
                         "</orderEntry>" +
                         "<orderEntry type=\"module-library\">" +
                         "<library name=\"namedLibrary\">" +
                         "<CLASSES><root url=\"file://$MODULE_DIR$/namedLibClasses\" /></CLASSES>" +
+                        "<JAVADOC />" +
+                        "<SOURCES />" +
                         "</library>" +
                         "</orderEntry>" +
                         "</root>", module);
index b1bbd7a29e749d3b1ad5813fdc12847f674104e1..a9578c24654ea7c529ddf39a9a59d83120d934d6 100644 (file)
@@ -47,7 +47,7 @@ public class LibraryTest extends IdeaTestCase {
 
     final Element element = new Element("root");
     library.writeExternal(element);
-    assertEquals("<root><library name=\"library\"><CLASSES><root url=\"file://x.jar\" /></CLASSES><SOURCES><root url=\"file://x-src.jar\" /></SOURCES></library></root>",
+    assertEquals("<root><library name=\"library\"><CLASSES><root url=\"file://x.jar\" /></CLASSES><JAVADOC /><SOURCES><root url=\"file://x-src.jar\" /></SOURCES></library></root>",
             new XMLOutputter().outputString(element));
 
     ApplicationManager.getApplication().runWriteAction(new Runnable() {
index d0bb429508c0ed048275eb96ba9a3e7257a01979..b92a311519b42f31de82d38c68e5493aefc670b6 100644 (file)
 
 package com.intellij.lang.jsp;
 
-import com.intellij.lang.Language;
-import org.jetbrains.annotations.NotNull;
-
 import java.util.Set;
 
 /**
  * @author ik
  */
 public interface JspFileViewProvider extends JspxFileViewProvider {
-  @NotNull
-  Language getTemplateDataLanguage();
 
   Set<String> getKnownTaglibPrefixes();
 }
index 08e182bfc84269cfe5e3fad682fd0f2a554d51fc..4b39c8b346d93c556f718b93699d41040141ed56 100644 (file)
@@ -34,6 +34,10 @@ public interface BaseJspFile extends XmlFile {
   XmlTag[] getDirectiveTags(JspDirectiveKind directiveKind, final boolean searchInIncludes);
   XmlTag createDirective(XmlTag context, JspDirectiveKind directiveKind);
 
+  /**
+   * Method with a bad name. Returns file corresponding to getTemplateDataLanguage() method of ViewProvider
+   * @see com.intellij.psi.templateLanguages.TemplateLanguageFileViewProvider#getTemplateDataLanguage()
+   */
   PsiFile getBaseLanguageRoot();
   /**
    * @return file which the errorPage directive references,
index 9bb1209cf342dd272eb358aa781a77a7633075fc..9631b4f90b0acd067619e500d52cae93ab7bd84a 100644 (file)
@@ -18,17 +18,18 @@ package com.intellij.psi.search.scope.packageSet;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.ProjectFileIndex;
 import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.problems.WolfTheProblemSolver;
 import com.intellij.psi.*;
 import org.jetbrains.annotations.NonNls;
-import org.jetbrains.annotations.Nullable;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 
 import java.util.regex.Pattern;
 
-public class PatternPackageSet implements PackageSet {
+public class PatternPackageSet implements PatternBasedPackageSet {
   @NonNls public static final String SCOPE_TEST = "test";
   @NonNls public static final String SCOPE_SOURCE = "src";
   @NonNls public static final String SCOPE_LIBRARY = "lib";
@@ -136,4 +137,20 @@ public class PatternPackageSet implements PackageSet {
     return buf.toString();
   }
 
+  @Override
+  public String getModulePattern() {
+    return myModulePatternText;
+  }
+
+  @Override
+  public boolean isOn(String oldQName) {
+    return Comparing.strEqual(oldQName, myAspectJSyntaxPattern) || //class qname
+           Comparing.strEqual(oldQName + "..*", myAspectJSyntaxPattern) || //package req
+           Comparing.strEqual(oldQName + ".*", myAspectJSyntaxPattern); //package
+  }
+
+  @Override
+  public String getPattern() {
+    return myAspectJSyntaxPattern;
+  }
 }
\ No newline at end of file
index 565e50870ac1d45ece3832721f02d436693e0e2e..c921ac1da354f69901572b900cce213e7efd49e3 100644 (file)
@@ -53,6 +53,13 @@ public interface TemplateBuilder {
    */
   void replaceRange(TextRange rangeWithinElement, String replacementText);
 
+  /**
+   * Creates a replacement box for the specified text range within the container element.
+   * @param rangeWithinElement range within the container element.
+   * @param expression the replacement expression.
+   */
+  public void replaceRange(TextRange rangeWithinElement, Expression expression);
+
   /**
    * Shows the live template and initiates editing process.
    */
index 3db3337d1493930debc921c8788ca818b9270dc0..5a4cb9c1b0772bbdbf92b88b9218cb93aae36ddb 100644 (file)
@@ -59,6 +59,10 @@ public class DefaultRefactoringSupportProvider implements RefactoringSupportProv
     return null;
   }
 
+  public RefactoringActionHandler getExtractInterfaceHandler() {
+    return null;
+  }
+
   public RefactoringActionHandler getExtractModuleHandler() {
     return null;
   }
index 7aa9480d5e7ba9679d86045874d0df09c32992fb..ac244743397b5ebf1de5a1e0ed0a3d6423e979d3 100644 (file)
@@ -80,6 +80,12 @@ public interface RefactoringSupportProvider {
    */
   @Nullable RefactoringActionHandler getPushDownHandler();
 
+  /**
+   * @return  handler for extracting members to an interface in this language
+   * @see com.intellij.refactoring.RefactoringActionHandler
+   */
+  @Nullable RefactoringActionHandler getExtractInterfaceHandler();
+
   /**
    * @return  handler for extracting members to some module in this language
    * @see com.intellij.refactoring.RefactoringActionHandler
index 010707b85741656248e77518340b62712caebad4..f9536b1887f8f9029859432432295b5bbd665cda 100644 (file)
@@ -45,4 +45,8 @@ public class ComplementPackageSet implements PackageSet {
   public int getNodePriority() {
     return 1;
   }
+
+  public PackageSet getComplementarySet() {
+    return myComplementarySet;
+  }
 }
index 2ad0fe15b41fa7e36d051b35bc76189264c6ab45..b1824bf43a5462b1bd8a3416138ed7417ee92514 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.openapi.module.ModuleManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.roots.ProjectFileIndex;
 import com.intellij.openapi.roots.ProjectRootManager;
+import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.openapi.vfs.VfsUtil;
 import com.intellij.openapi.vfs.VirtualFile;
@@ -34,7 +35,7 @@ import org.jetbrains.annotations.NonNls;
 
 import java.util.regex.Pattern;
 
-public class FilePatternPackageSet implements PackageSet {
+public class FilePatternPackageSet implements PatternBasedPackageSet {
   public static final @NonNls String SCOPE_FILE = "file";
   private Pattern myModulePattern;
   private Pattern myModuleGroupPattern;
@@ -169,6 +170,21 @@ public class FilePatternPackageSet implements PackageSet {
     return buf.toString();
   }
 
+  @Override
+  public String getPattern() {
+    return myPathPattern;
+  }
+
+  @Override
+  public String getModulePattern() {
+    return myModulePatternText;
+  }
+
+  @Override
+  public boolean isOn(String oldQName) {
+    return Comparing.strEqual(myPathPattern, oldQName);
+  }
+
   public static String getRelativePath(final VirtualFile virtualFile, final ProjectFileIndex index, final boolean useFQName) {
     final Module module = index.getModuleForFile(virtualFile);
     if (module != null) {
index f9a96d092cfd00a99009a31c64681bd459cabdd5..11526b528efb6a75783d47297b9c26f878ab36bc 100644 (file)
@@ -52,4 +52,12 @@ public class IntersectionPackageSet implements PackageSet {
 
     return buf.toString();
   }
+
+  public PackageSet getFirstSet() {
+    return myFirstSet;
+  }
+
+  public PackageSet getSecondSet() {
+    return mySecondSet;
+  }
 }
diff --git a/platform/lang-api/src/com/intellij/psi/search/scope/packageSet/PatternBasedPackageSet.java b/platform/lang-api/src/com/intellij/psi/search/scope/packageSet/PatternBasedPackageSet.java
new file mode 100644 (file)
index 0000000..34aaace
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * 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.psi.search.scope.packageSet;
+
+/**
+ * User: anna
+ * Date: Jul 26, 2010
+ */
+public interface PatternBasedPackageSet extends PackageSet{
+  String getPattern();
+  String getModulePattern();
+
+  boolean isOn(String oldQName);
+}
index b47609873ccb531bf688d9e70a28ab65c5ed6651..8a227836c8812692cddd73cd4570bbf36fd61545 100644 (file)
@@ -42,4 +42,12 @@ public class UnionPackageSet implements PackageSet {
   public String getText() {
     return myFirstSet.getText() + "||" + mySecondSet.getText();
   }
+
+  public PackageSet getFirstSet() {
+    return myFirstSet;
+  }
+
+  public PackageSet getSecondSet() {
+    return mySecondSet;
+  }
 }
\ No newline at end of file
index f14a9f662771021020ace284e68311a6c4c526f6..9ba8f9191692fe32d2cb04f6c79d04b9eb95dea7 100644 (file)
@@ -25,12 +25,14 @@ import org.jetbrains.annotations.NotNull;
 public interface TemplateLanguageFileViewProvider extends FileViewProvider {
 
   /**
+   * e.g. JSP
    * @return instanceof {@link com.intellij.psi.templateLanguages.TemplateLanguage}
    */
   @NotNull
   Language getBaseLanguage();
 
   /**
+   * e.g. HTML for JSP files
    * @return not instanceof {@link com.intellij.lang.DependentLanguage}
    */
   @NotNull
index f20559eef3fdbb85def5f60f6812fb74c4480a4d..f5c174dea4b5c52c0439184236e52e9daa40a3a9 100644 (file)
@@ -180,12 +180,22 @@ public class PsiTreeUtil {
   }
 
   @Nullable public static <T extends PsiElement> T findChildOfType(@NotNull final PsiElement element, @NotNull final Class<T> aClass, final boolean strict) {
+    return findChildOfAnyType(element, strict, aClass);
+  }
+
+  @Nullable public static <T extends PsiElement> T findChildOfAnyType(@NotNull final PsiElement element, @NotNull final Class<T>... classes) {
+    return findChildOfAnyType(element, true, classes);
+  }
+
+  @Nullable public static <T extends PsiElement> T findChildOfAnyType(@NotNull final PsiElement element, final boolean strict, @NotNull final Class<T>... classes) {
     PsiElementProcessor.FindElement<PsiElement> processor = new PsiElementProcessor.FindElement<PsiElement>() {
       @Override
       public boolean execute(PsiElement each) {
         if (strict && each == element) return true;
-        if (instanceOf(aClass, each)) {
-          return setFound(each);
+        for (Class<T> eachClass : classes) {
+          if (instanceOf(eachClass, each)) {
+            return setFound(each);
+          }
         }
         return true;
       }
index 456d583038c6da8978a262628061be6e2b4d3c7a..21e8ed12dc362f7c9a92676065fca8d92c623dc3 100644 (file)
@@ -32,8 +32,8 @@ public interface NameSuggestionProvider {
   ExtensionPointName<NameSuggestionProvider> EP_NAME = ExtensionPointName.create("com.intellij.nameSuggestionProvider");
 
   @Nullable
-  SuggestedNameInfo getSuggestedNames(PsiElement element, PsiElement nameSuggestionContext, Set<String> result);
+  SuggestedNameInfo getSuggestedNames(PsiElement element, @Nullable PsiElement nameSuggestionContext, Set<String> result);
 
   @Nullable
-  Collection<LookupElement> completeName(PsiElement element, final PsiElement nameSuggestionContext, final String prefix);
+  Collection<LookupElement> completeName(PsiElement element, @Nullable final PsiElement nameSuggestionContext, final String prefix);
 }
index 3f50d8b4642f8b42c8b43643edd9a53d04ee9aa5..1b2fb89b798f713f0588e5e7a29fec8d587f71f3 100644 (file)
@@ -123,6 +123,12 @@ public class TemplateBuilderImpl implements TemplateBuilder {
     myElements.add(key);
   }
 
+  public void replaceRange(TextRange rangeWithinElement, Expression expression) {
+    final RangeMarker key = myDocument.createRangeMarker(rangeWithinElement);
+    myExpressions.put(key, expression);
+    myElements.add(key);
+  }
+
   /**
    * Adds end variable after the specified element
    */
index 640621cae453f081c025ac67789fd34cf5ca84ad..ef73b1c4530f6e2a88b2f63b7d137508724057a5 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.openapi.editor.*;
 import com.intellij.openapi.editor.actions.EditorActionUtil;
 import com.intellij.openapi.editor.colors.EditorColors;
 import com.intellij.openapi.editor.colors.EditorColorsManager;
+import com.intellij.openapi.editor.colors.EditorColorsScheme;
 import com.intellij.openapi.editor.event.*;
 import com.intellij.openapi.editor.ex.EditorEx;
 import com.intellij.openapi.editor.ex.RangeHighlighterEx;
@@ -109,8 +110,10 @@ public class LanguageConsoleImpl implements Disposable, TypeSafeDataProvider {
     myEditorDocument = editorFactory.createDocument("");
     setLanguage(language);
     myConsoleEditor = (EditorEx)editorFactory.createEditor(myEditorDocument, myProject);
+    myConsoleEditor.setBackgroundColor(myConsoleEditor.getColorsScheme().getColor(ConsoleViewContentType.CONSOLE_BACKGROUND_KEY));
     myCurrentEditor = myConsoleEditor;
     myHistoryViewer = (EditorEx)editorFactory.createViewer(((EditorFactoryImpl)editorFactory).createDocument(true), myProject);
+    myHistoryViewer.setBackgroundColor(myHistoryViewer.getColorsScheme().getColor(ConsoleViewContentType.CONSOLE_BACKGROUND_KEY));
     myPanel.add(myHistoryViewer.getComponent(), BorderLayout.NORTH);
     myPanel.add(myConsoleEditor.getComponent(), BorderLayout.CENTER);
     setupComponents();
index f5c15a694989e264db9beb3232dcac10e48caed6..417d402b37fe8ef227d5f950089fcb86a7a51ce3 100644 (file)
@@ -81,7 +81,7 @@ public abstract class BaseProjectTreeBuilder extends AbstractTreeBuilder {
       batch(new Progressive() {
         public void run(@NotNull ProgressIndicator indicator) {
           final Ref<Object> target = new Ref<Object>();
-          _select(value, finalVFile, false, Conditions.<AbstractTreeNode>alwaysTrue(), cb, indicator, target, focusRequestor);
+          _select(value, finalVFile, false, Conditions.<AbstractTreeNode>alwaysTrue(), cb, indicator, target, focusRequestor, false);
           cb.doWhenDone(new Runnable() {
             public void run() {
               result.setDone(target.get());
@@ -178,7 +178,7 @@ public abstract class BaseProjectTreeBuilder extends AbstractTreeBuilder {
       public void run() {
         batch(new Progressive() {
           public void run(@NotNull ProgressIndicator indicator) {
-            _select(element, file, requestFocus, nonStopCondition, result, indicator, null, requestor);
+            _select(element, file, requestFocus, nonStopCondition, result, indicator, null, requestor, false);
           }
         });
       }
@@ -190,13 +190,14 @@ public abstract class BaseProjectTreeBuilder extends AbstractTreeBuilder {
   }
 
   private void _select(Object element,
-                       VirtualFile file,
+                       final VirtualFile file,
                        final boolean requestFocus,
                        final Condition<AbstractTreeNode> nonStopCondition,
                        final ActionCallback result,
-                       ProgressIndicator indicator,
+                       final ProgressIndicator indicator,
                        @Nullable final Ref<Object> virtualSelectTarget,
-                       final FocusRequestor focusRequestor) {
+                       final FocusRequestor focusRequestor,
+                       final boolean isSecondAttempt) {
     AbstractTreeNode alreadySelected = alreadySelectedNode(element);
 
     final Runnable onDone = new Runnable() {
@@ -226,7 +227,16 @@ public abstract class BaseProjectTreeBuilder extends AbstractTreeBuilder {
               onDone.run();
             }
           }
-        }).notifyWhenRejected(result);
+        }).doWhenRejected(new Runnable() {
+        @Override
+        public void run() {
+          if (isSecondAttempt) {
+            result.setRejected();
+          } else {
+            _select(file, file, requestFocus, nonStopCondition, result, indicator, virtualSelectTarget, focusRequestor, true);
+          }
+        }
+      });
     }
     else {
       if (virtualSelectTarget == null) {
index 39d89a5f576e027f01a0d236a3ec49bde6859961..1034ec9e6e20fdf446252435665a319200202d99 100644 (file)
@@ -35,7 +35,6 @@ import com.intellij.openapi.module.ModuleManager;
 import com.intellij.openapi.module.impl.ModuleImpl;
 import com.intellij.openapi.module.impl.scopes.JdkScope;
 import com.intellij.openapi.module.impl.scopes.LibraryRuntimeClasspathScope;
-import com.intellij.openapi.project.DumbAwareRunnable;
 import com.intellij.openapi.project.DumbServiceImpl;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.project.ex.ProjectEx;
@@ -619,11 +618,7 @@ public class ProjectRootManagerImpl extends ProjectRootManagerEx implements Proj
         return; // in test mode suppress addition to a queue unless project is properly initialized
       }
     }
-    myStartupManager.runWhenProjectIsInitialized(new DumbAwareRunnable() {
-      public void run() {
-        DumbServiceImpl.getInstance(myProject).queueCacheUpdate(myRefreshCacheUpdaters);
-      }
-    });
+    DumbServiceImpl.getInstance(myProject).queueCacheUpdate(myRefreshCacheUpdaters);
   }
 
   private void addRootsToWatch() {
index 762e7b6bd738d65433dd100bd897b36878c70500..091ccf348d86c8951c9a7e7276e95192698eb3eb 100644 (file)
@@ -277,7 +277,7 @@ public class LibraryImpl implements LibraryEx.ModifiableModelEx, LibraryEx {
       if (roots.size() == 0 && rootType.skipWriteIfEmpty()) continue; //compatibility iml/ipr
       final Element rootTypeElement = new Element(rootType.name());
       roots.writeExternal(rootTypeElement, ROOT_PATH_ELEMENT);
-      if (rootTypeElement.getAttributes().size() > 0 || rootTypeElement.getContent().size() > 0) element.addContent(rootTypeElement);
+      element.addContent(rootTypeElement);
     }
     List<String> urls = new ArrayList<String>(myJarDirectories.keySet());
     Collections.sort(urls, new Comparator<String>() {