From 05027a22f6a25a30ba7ec04ce77bad441efae2dc Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Wed, 2 Jan 2019 16:32:47 +0100 Subject: [PATCH] light resolve tests when applicable --- ...dSubstitutionDuringOverloadResolution.java | 2 +- .../lambda/resolve/IDEA122406.java | 2 +- .../LambdaChainConflictResolution.java | 2 +- .../resolve/SecondConflictResolution.java | 2 +- .../resolve/SecondConflictResolution1.java | 2 +- .../resolve/SecondConflictResolution2.java | 2 +- .../resolve/class/ClassExtendsItsInner.java | 2 +- .../resolve/class/ClassExtendsItsInner1.java | 2 +- .../resolve/class/ClassExtendsItsInner2.java | 2 +- .../testData/psi/resolve/class/FQName.java | 2 +- .../psi/resolve/class/ImportConflict1.java | 2 +- .../psi/resolve/class/ImportConflict2.java | 2 +- .../resolve/class/InnerPrivateMember1.java | 2 +- .../testData/psi/resolve/class/Locals1.java | 2 +- .../testData/psi/resolve/class/Locals2.java | 2 +- .../psi/resolve/class/PrivateInExtends.java | 2 +- .../testData/psi/resolve/class/QNew1.java | 2 +- .../testData/psi/resolve/class/QNew2.java | 2 +- .../class/QualifiedAnonymousClass.java | 2 +- .../testData/psi/resolve/class/SCR40332.java | 2 +- .../testData/psi/resolve/class/Shadowing.java | 2 +- .../resolve/class/StaticImportVsImplicit.java | 2 +- .../testData/psi/resolve/class/VarInNew.java | 2 +- .../testData/psi/resolve/class/VarInNew1.java | 2 +- .../resolve/codeFragment/LocalVariable.java | 2 +- ...solveFieldInInnerWithVisiblityChecker.java | 2 +- ...ieldInStaticInnerWithVisiblityChecker.java | 2 +- ...solveFieldVsLocalWithVisiblityChecker.java | 2 +- ...solveFieldVsParamWithVisiblityChecker.java | 2 +- .../resolve/inference/BoundComposition.java | 2 +- .../psi/resolve/inference/InferAutoboxed.java | 2 +- .../psi/resolve/inference/InferInAssign1.java | 2 +- .../psi/resolve/inference/InferInAssign2.java | 2 +- .../psi/resolve/inference/InferInCall1.java | 2 +- .../psi/resolve/inference/InferInCast.java | 2 +- .../resolve/inference/InferInParamsOnly.java | 2 +- .../psi/resolve/inference/InferInReturn.java | 2 +- .../inference/InferInSuperAssignment.java | 2 +- .../psi/resolve/inference/InferNotNull.java | 2 +- .../inference/InferPrimitiveArray.java | 2 +- .../psi/resolve/inference/InferRawType.java | 2 +- .../psi/resolve/inference/InferUnchecked.java | 2 +- .../resolve/inference/InferWithBounds.java | 2 +- .../resolve/inference/InferWithBounds1.java | 2 +- .../resolve/inference/InferWithVarargs1.java | 2 +- .../resolve/inference/InferWithVarargs2.java | 2 +- .../resolve/inference/InferWithVarargs3.java | 2 +- .../resolve/inference/InferWithVarargs4.java | 2 +- .../resolve/inference/InferWithVarargs5.java | 2 +- .../resolve/inference/InferWithVarargs6.java | 2 +- .../resolve/inference/InferWithWildcards.java | 2 +- .../inference/InferWithWildcards1.java | 2 +- .../inference/InferWithWildcards2.java | 2 +- .../inference/InferWithWildcards3.java | 2 +- .../inference/InferWithWildcards4.java | 2 +- .../inference/InferWithWildcards5.java | 2 +- .../psi/resolve/inference/SCR41031.java | 2 +- .../psi/resolve/method/AnonymousSuper1.java | 2 +- .../testData/psi/resolve/method/Array1.java | 2 +- .../testData/psi/resolve/method/Bug7968.java | 2 +- .../testData/psi/resolve/method/Clone.java | 2 +- .../testData/psi/resolve/method/Cycle1.java | 2 +- .../psi/resolve/method/EmptyConstructor.java | 2 +- .../psi/resolve/method/ImplementOrder.java | 2 +- .../testData/psi/resolve/method/IndexOf.java | 2 +- .../method/InheranceWithExtendsConflict.java | 2 +- .../testData/psi/resolve/method/Inherit1.java | 2 +- .../psi/resolve/method/InnerClass.java | 2 +- .../psi/resolve/method/MethodConflict1.java | 2 +- .../resolve/method/MethodFromAnonBase.java | 2 +- .../MultipleInheritancePathsToMethod.java | 2 +- .../psi/resolve/method/NextMethod.java | 2 +- .../method/NotAccessibleAccessClass.java | 2 +- .../psi/resolve/method/ObjectVsInterface.java | 2 +- .../psi/resolve/method/PartlyImplement1.java | 2 +- .../psi/resolve/method/PreferPublic.java | 2 +- .../resolve/method/PrivateInSuperInner.java | 2 +- .../resolve/method/PrivateInSuperInner1.java | 2 +- .../psi/resolve/method/ProtectedM.java | 2 +- .../testData/psi/resolve/method/Remove1.java | 2 +- .../testData/psi/resolve/method/Remove2.java | 2 +- .../testData/psi/resolve/method/Remove3.java | 2 +- .../testData/psi/resolve/method/Remove4.java | 4 - .../testData/psi/resolve/method/SCR5134.java | 2 +- .../testData/psi/resolve/method/SCR5859.java | 2 +- .../psi/resolve/method/ShortVsInt.java | 2 +- .../testData/psi/resolve/method/Simple.java | 2 +- .../testData/psi/resolve/method/Sout.java | 2 +- .../psi/resolve/method/StaticVSNonStatic.java | 2 +- .../testData/psi/resolve/method/Super1.java | 2 +- .../psi/resolve/method/SuperOfObject.java | 2 +- .../psi/resolve/method/TestOverloading1.java | 2 +- .../psi/resolve/method/ThrowWithoutNew.java | 2 +- .../psi/resolve/method/ThrowWithoutNew2.java | 2 +- .../testData/psi/resolve/method/ValueOf.java | 2 +- .../method/generics/AmbiguousBoxing.java | 2 +- .../generics/AutoboxingAndWidening.java | 2 +- .../generics/ConstructorExplicitParams.java | 2 +- .../CovariantReturnTypeAnonymous.java | 2 +- .../method/generics/CovariantReturnTypes.java | 2 +- .../method/generics/DependingParams2.java | 2 +- .../method/generics/ExplicitParams1.java | 2 +- .../method/generics/ExplicitParams2.java | 2 +- .../psi/resolve/method/generics/Extends1.java | 2 +- .../method/generics/FilterBoxing1.java | 2 +- .../generics/FilterFixedVsVarargs1.java | 2 +- .../generics/FilterFixedVsVarargs2.java | 2 +- .../generics/FilterFixedVsVarargs3.java | 2 +- .../generics/FilterFixedVsVarargs4.java | 2 +- .../generics/FilterFixedVsVarargs5.java | 2 +- .../generics/FilterFixedVsVarargs6.java | 2 +- .../generics/FilterFixedVsVarargs7.java | 2 +- .../generics/FilterFixedVsVarargs8.java | 2 +- .../generics/FilterFixedVsVarargs9.java | 2 +- .../generics/FilterVarargsVsVarargs1.java | 2 +- .../generics/FilterVarargsVsVarargs2.java | 2 +- .../generics/FilterVarargsVsVarargs3.java | 2 +- .../generics/FilterVarargsVsVarargs4.java | 2 +- .../method/generics/GenericClass1.java | 2 +- .../method/generics/GenericClass2.java | 2 +- .../method/generics/GenericMethods1.java | 2 +- .../method/generics/GenericMethods2.java | 2 +- .../method/generics/GenericMethods3.java | 2 +- .../method/generics/GenericMethods4.java | 2 +- .../method/generics/GenericMethods5.java | 2 +- .../method/generics/GenericMethods6.java | 2 +- .../GenericsAndVarargsNoConflict.java | 2 +- .../psi/resolve/method/generics/GetClass.java | 2 +- .../method/generics/HidingSuperPrivate.java | 2 +- .../resolve/method/generics/Inheritance1.java | 2 +- .../resolve/method/generics/Inheritance2.java | 2 +- .../resolve/method/generics/Inheritance3.java | 2 +- .../resolve/method/generics/Inheritance4.java | 2 +- .../resolve/method/generics/ListEquals.java | 2 +- .../psi/resolve/method/generics/Merge1.java | 2 +- .../generics/MoreSpecificSameErasure.java | 2 +- .../method/generics/NestedTypeParams.java | 2 +- .../method/generics/NonPublicAnonymous.java | 2 +- .../generics/PreferArrayTypeToObject.java | 2 +- .../generics/RawInheritanceConflict.java | 2 +- .../resolve/method/generics/RawMethod1.java | 2 +- .../method/generics/RawVsGenericConflict.java | 2 +- .../RawVsGenericConflictInCaseOfOverride.java | 2 +- ...RawVsGenericConflictInCaseOfOverride2.java | 2 +- .../psi/resolve/method/generics/SOE.java | 2 +- .../method/generics/StaticImportConflict.java | 2 +- .../generics/StaticImportConflict1.java | 2 +- .../generics/StaticImportConflict3.java | 2 +- .../method/generics/StaticImportDirect.java | 2 +- .../method/generics/StaticImportHidden.java | 2 +- .../method/generics/StaticImportOnDemand.java | 2 +- .../generics/StaticMethodInSubclass.java | 2 +- .../TestGenericMethodOverloading1.java | 2 +- .../TestGenericMethodOverloading2.java | 2 +- .../TestGenericMethodOverloading3.java | 2 +- .../TestGenericMethodOverloading4.java | 2 +- .../method/generics/TestReturnType1.java | 2 +- .../method/generics/TestReturnType2.java | 2 +- .../method/generics/TestThisExpression.java | 2 +- .../psi/resolve/method/generics/ToString.java | 2 +- .../method/generics/TypeInference1.java | 2 +- .../generics/TypeParamBoundConflict.java | 2 +- .../resolve/method/varargs/ObjectObject.java | 2 +- .../method/varargs/ObjectObjectObject.java | 2 +- .../method/varargs/PrimitiveObject.java | 2 +- .../method/varargs/PrimitiveString.java | 2 +- .../resolve/method/varargs/StringObject.java | 2 +- .../method/varargs/StringObjectString.java | 2 +- .../method/varargs/StringStringString.java | 2 +- .../resolve/var/AnonymousConstructorArg.java | 2 +- .../testData/psi/resolve/var/Array1.java | 2 +- .../testData/psi/resolve/var/Bug7869.java | 2 +- .../psi/resolve/var/FieldConflict.java | 2 +- .../psi/resolve/var/FieldFromInterface.java | 2 +- .../psi/resolve/var/FieldsAndLocals.java | 2 +- .../psi/resolve/var/ForeachParameter.java | 2 +- .../psi/resolve/var/InheritedOuter.java | 2 +- .../testData/psi/resolve/var/Inner1.java | 2 +- .../psi/resolve/var/InnerPrivates1.java | 2 +- .../psi/resolve/var/InterfaceConflict1.java | 2 +- .../psi/resolve/var/InterfaceConflict10.java | 2 +- .../psi/resolve/var/InterfaceConflict11.java | 2 +- .../psi/resolve/var/InterfaceConflict2.java | 2 +- .../psi/resolve/var/InterfaceConflict3.java | 2 +- .../psi/resolve/var/InterfaceConflict4.java | 2 +- .../psi/resolve/var/InterfaceConflict5.java | 2 +- .../psi/resolve/var/InterfaceConflict6.java | 2 +- .../psi/resolve/var/InterfaceConflict7.java | 2 +- .../psi/resolve/var/InterfaceConflict8.java | 2 +- .../psi/resolve/var/InterfaceConflict9.java | 2 +- .../psi/resolve/var/LocalVariable1.java | 2 +- .../psi/resolve/var/PrivateOverloading.java | 2 +- .../testData/psi/resolve/var/Qualified1.java | 2 +- .../testData/psi/resolve/var/Qualified2.java | 2 +- .../testData/psi/resolve/var/Qualified3.java | 2 +- .../testData/psi/resolve/var/Qualified4.java | 2 +- .../testData/psi/resolve/var/RefInOuter.java | 2 +- .../testData/psi/resolve/var/RefInSuper.java | 2 +- .../resolve/var/ShadowFieldsInHierarchy.java | 2 +- .../resolve/var/ShadowFieldsInHierarchy2.java | 2 +- .../testData/psi/resolve/var/Unresolved1.java | 2 +- .../testData/psi/resolve/var/Visibility1.java | 2 +- .../testData/psi/resolve/var/Visibility2.java | 2 +- .../testData/psi/resolve/var/Visibility3.java | 2 +- .../testData/psi/resolve/var/Visibility4.java | 2 +- .../testData/psi/resolve/var/Visibility5.java | 2 +- .../testData/psi/resolve/var/Visibility6.java | 2 +- .../resolve/var15/DuplicateStaticImport.java | 2 +- .../resolve/var15/NavigateToEnumFunction.java | 2 +- .../psi/resolve/var15/RhombExtending.java | 2 +- .../daemon/lambda/TypeInference18Test.java | 45 +-- .../java/psi/resolve/Resolve15TestCase.java | 50 --- .../java/psi/resolve/ResolveClass2Test.java | 158 +++++++++ ...lveClassInModulesWithDependenciesTest.java | 143 ++++++++ .../java/psi/resolve/ResolveClassTest.java | 326 ------------------ .../resolve/ResolveInCodeFragmentTest.java | 40 +-- .../java/psi/resolve/ResolveMethod15Test.java | 13 +- .../java/psi/resolve/ResolveMethodTest.java | 110 +++--- .../psi/resolve/ResolvePerformanceTest.java | 50 ++- .../psi/resolve/ResolveVarargsMethodTest.java | 12 +- .../psi/resolve/ResolveVariable15Test.java | 12 +- .../java/psi/resolve/ResolveVariableTest.java | 108 +++--- .../java/psi/resolve/TypeInferenceTest.java | 75 ++-- .../testFramework/LightResolveTestCase.java | 20 ++ 224 files changed, 785 insertions(+), 799 deletions(-) delete mode 100644 java/java-tests/testData/psi/resolve/method/Remove4.java delete mode 100644 java/java-tests/testSrc/com/intellij/java/psi/resolve/Resolve15TestCase.java create mode 100644 java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClass2Test.java create mode 100644 java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassInModulesWithDependenciesTest.java delete mode 100644 java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassTest.java create mode 100644 java/testFramework/src/com/intellij/testFramework/LightResolveTestCase.java diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/CachedSubstitutionDuringOverloadResolution.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/CachedSubstitutionDuringOverloadResolution.java index 8c020ce0bfdb..df5964a16f06 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/CachedSubstitutionDuringOverloadResolution.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/CachedSubstitutionDuringOverloadResolution.java @@ -9,7 +9,7 @@ class Test { } public static void main(Stream stream) { - stream.map(s -> Inner.of(Test::getKey, s)); + stream.map(s -> Inner.of(Test::getKey, s)); } public static final class Inner { diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/IDEA122406.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/IDEA122406.java index b40ccbcd5c56..bdbee0de6ef2 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/IDEA122406.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/IDEA122406.java @@ -12,7 +12,7 @@ abstract class Test { } } - final ArrayList guavaList = newArrayList(filter(tweetList, new Predicate() { + final ArrayList guavaList = newArrayList(filter(tweetList, new Predicate() { @Override public boolean test(String tweet) { return false; diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/LambdaChainConflictResolution.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/LambdaChainConflictResolution.java index 3f94c927f603..fc674e2f5fe4 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/LambdaChainConflictResolution.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/LambdaChainConflictResolution.java @@ -17,6 +17,6 @@ class MyTest { List baz(Iterator s, Iterator i) {return null;} { - List l = foo(a -> bar(b -> baz(a, b))); + List l = foo(a -> bar(b -> baz(a, b))); } } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution.java index ac48bcb9dc8b..0ba2086c9634 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution.java @@ -11,7 +11,7 @@ abstract class Token { private static B getMode(Optional> max){ return max - .flatMap(e -> Optional.of(new B<>(Long.valueOf(e.getValue().longValue())))) + .flatMap(e -> Optional.of(new B<>(Long.valueOf(e.getValue().longValue())))) .get(); } diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution1.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution1.java index 8143a66b6d66..978eb24db8aa 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution1.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution1.java @@ -7,7 +7,7 @@ class Test { { Set> sort3 = new TreeSet<>((x, y) -> { - return Integer.compare(x.getValue(), y.getValue()); + return Integer.compare(x.getValue(), y.getValue()); }); } } \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution2.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution2.java index bff874469cb5..87f5b5539b0d 100644 --- a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution2.java +++ b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/resolve/SecondConflictResolution2.java @@ -16,6 +16,6 @@ class MyTest { List baz(Iterator s, Iterator i) {return null;} { - List l = foo(a -> bar(baz(a.iterator(), a.iterator()))); + List l = foo(a -> bar(baz(a.iterator(), a.iterator()))); } } diff --git a/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner.java b/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner.java index 439c5594258c..4ef287864843 100644 --- a/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner.java +++ b/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner.java @@ -1,4 +1,4 @@ -class A extends A.Foo, B{ +class A extends A.Foo, B{ } interface B{ diff --git a/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner1.java b/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner1.java index c5e0f4f9391e..1f658f1f0356 100644 --- a/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner1.java +++ b/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner1.java @@ -1,4 +1,4 @@ -class A extends B.Foo implements B{ +class A extends B.Foo implements B{ } interface B{ diff --git a/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner2.java b/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner2.java index 025240313ab4..83e8c1066930 100644 --- a/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner2.java +++ b/java/java-tests/testData/psi/resolve/class/ClassExtendsItsInner2.java @@ -1,3 +1,3 @@ -public class TTT implements Bar{ +public class TTT implements Bar{ static interface Bar{} } diff --git a/java/java-tests/testData/psi/resolve/class/FQName.java b/java/java-tests/testData/psi/resolve/class/FQName.java index ba3bc1da9440..351e08ecb027 100644 --- a/java/java-tests/testData/psi/resolve/class/FQName.java +++ b/java/java-tests/testData/psi/resolve/class/FQName.java @@ -1,3 +1,3 @@ class Test{ - void foo() throws java.io.IOException{} + void foo() throws java.io.IOException{} } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/class/ImportConflict1.java b/java/java-tests/testData/psi/resolve/class/ImportConflict1.java index 73ea67d423bf..23e725afd622 100644 --- a/java/java-tests/testData/psi/resolve/class/ImportConflict1.java +++ b/java/java-tests/testData/psi/resolve/class/ImportConflict1.java @@ -3,6 +3,6 @@ import java.util.*; public class ImpmortConflict1{ public static void main(String[] args){ - Date d = new Date(); + Date d = new Date(); } } diff --git a/java/java-tests/testData/psi/resolve/class/ImportConflict2.java b/java/java-tests/testData/psi/resolve/class/ImportConflict2.java index 653cf13eb838..4ff2c58c3443 100644 --- a/java/java-tests/testData/psi/resolve/class/ImportConflict2.java +++ b/java/java-tests/testData/psi/resolve/class/ImportConflict2.java @@ -3,6 +3,6 @@ import java.util.Date; public class ImportConflict2{ public static void main(String[] args){ - Date d = new Date(); + Date d = new Date(); } } diff --git a/java/java-tests/testData/psi/resolve/class/InnerPrivateMember1.java b/java/java-tests/testData/psi/resolve/class/InnerPrivateMember1.java index 8d8728153b07..d61f4c0b733e 100644 --- a/java/java-tests/testData/psi/resolve/class/InnerPrivateMember1.java +++ b/java/java-tests/testData/psi/resolve/class/InnerPrivateMember1.java @@ -1,7 +1,7 @@ class C{ void foo(){ class A{ - B b = null; + B b = null; private class B{}; } } diff --git a/java/java-tests/testData/psi/resolve/class/Locals1.java b/java/java-tests/testData/psi/resolve/class/Locals1.java index 53f53d580261..e25185713585 100644 --- a/java/java-tests/testData/psi/resolve/class/Locals1.java +++ b/java/java-tests/testData/psi/resolve/class/Locals1.java @@ -2,6 +2,6 @@ class A{ { class B{} - new B(); + new B(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/class/Locals2.java b/java/java-tests/testData/psi/resolve/class/Locals2.java index e300f31e14d8..993657c234d3 100644 --- a/java/java-tests/testData/psi/resolve/class/Locals2.java +++ b/java/java-tests/testData/psi/resolve/class/Locals2.java @@ -1,7 +1,7 @@ class A{ { class B{ - B b; + B b; } new B(); diff --git a/java/java-tests/testData/psi/resolve/class/PrivateInExtends.java b/java/java-tests/testData/psi/resolve/class/PrivateInExtends.java index 1a9e8680db9f..8b3835e56000 100644 --- a/java/java-tests/testData/psi/resolve/class/PrivateInExtends.java +++ b/java/java-tests/testData/psi/resolve/class/PrivateInExtends.java @@ -2,4 +2,4 @@ class A{ private static class B{} } -class C extends A.B{} \ No newline at end of file +class C extends A.B{} \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/class/QNew1.java b/java/java-tests/testData/psi/resolve/class/QNew1.java index c79784a8b7dc..7e59e0b28b39 100644 --- a/java/java-tests/testData/psi/resolve/class/QNew1.java +++ b/java/java-tests/testData/psi/resolve/class/QNew1.java @@ -1,7 +1,7 @@ class A { { Outer outer; - outer.new Inner(); + outer.new Inner(); } } diff --git a/java/java-tests/testData/psi/resolve/class/QNew2.java b/java/java-tests/testData/psi/resolve/class/QNew2.java index 537bc12407f7..56a23f6f2f94 100644 --- a/java/java-tests/testData/psi/resolve/class/QNew2.java +++ b/java/java-tests/testData/psi/resolve/class/QNew2.java @@ -1,7 +1,7 @@ class A { { Outer outer; - outer.new Inner(){}; + outer.new Inner(){}; } } diff --git a/java/java-tests/testData/psi/resolve/class/QualifiedAnonymousClass.java b/java/java-tests/testData/psi/resolve/class/QualifiedAnonymousClass.java index 83bb3663f21c..0b77e540dd5b 100644 --- a/java/java-tests/testData/psi/resolve/class/QualifiedAnonymousClass.java +++ b/java/java-tests/testData/psi/resolve/class/QualifiedAnonymousClass.java @@ -2,7 +2,7 @@ import foo.Outer; class Foo { { - new Outer.Inner() { }; + new Outer.Inner() { }; } } diff --git a/java/java-tests/testData/psi/resolve/class/SCR40332.java b/java/java-tests/testData/psi/resolve/class/SCR40332.java index 034275bc29d2..c095eee4712f 100644 --- a/java/java-tests/testData/psi/resolve/class/SCR40332.java +++ b/java/java-tests/testData/psi/resolve/class/SCR40332.java @@ -1,4 +1,4 @@ class C {} -class CC extends C<Inner> { +class CC extends C<Inner> { static class Inner { } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/class/Shadowing.java b/java/java-tests/testData/psi/resolve/class/Shadowing.java index 831de207eeae..07aa1cfc9625 100644 --- a/java/java-tests/testData/psi/resolve/class/Shadowing.java +++ b/java/java-tests/testData/psi/resolve/class/Shadowing.java @@ -8,6 +8,6 @@ class B implements A { class C extends B { - static void foo(Entry e){ + static void foo(Entry e){ } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/class/StaticImportVsImplicit.java b/java/java-tests/testData/psi/resolve/class/StaticImportVsImplicit.java index 52aacf19183c..625c285e1264 100644 --- a/java/java-tests/testData/psi/resolve/class/StaticImportVsImplicit.java +++ b/java/java-tests/testData/psi/resolve/class/StaticImportVsImplicit.java @@ -7,6 +7,6 @@ class Outer { class StaticImportTest { public static void main(String[] args) { - Double d; + Double d; } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/class/VarInNew.java b/java/java-tests/testData/psi/resolve/class/VarInNew.java index 97e57a47b059..4896c35793d7 100644 --- a/java/java-tests/testData/psi/resolve/class/VarInNew.java +++ b/java/java-tests/testData/psi/resolve/class/VarInNew.java @@ -1,5 +1,5 @@ class s { - public static final repeat REPEAT = new repeat(); + public static final repeat REPEAT = new repeat(); boolean repeat = false; static class repeat {} } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/class/VarInNew1.java b/java/java-tests/testData/psi/resolve/class/VarInNew1.java index 03d4582c1462..4d9277551a6b 100644 --- a/java/java-tests/testData/psi/resolve/class/VarInNew1.java +++ b/java/java-tests/testData/psi/resolve/class/VarInNew1.java @@ -1,5 +1,5 @@ class s { - public static final repeat REPEAT = new repeat(){}; + public static final repeat REPEAT = new repeat(){}; boolean repeat = false; static class repeat {} } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/codeFragment/LocalVariable.java b/java/java-tests/testData/psi/resolve/codeFragment/LocalVariable.java index 12ee72b66e8f..76335a22dce1 100644 --- a/java/java-tests/testData/psi/resolve/codeFragment/LocalVariable.java +++ b/java/java-tests/testData/psi/resolve/codeFragment/LocalVariable.java @@ -1,6 +1,6 @@ public class Test { public void foo() { int i = 0; - System.out.println(i); + System.out.println(i); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInInnerWithVisiblityChecker.java b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInInnerWithVisiblityChecker.java index 581c706939c9..81fcad7775ed 100644 --- a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInInnerWithVisiblityChecker.java +++ b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInInnerWithVisiblityChecker.java @@ -5,7 +5,7 @@ public class FieldVsOuter2 { public final String field = "yyy"; public void foo() { - System.out.println(field); + System.out.println(field); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInStaticInnerWithVisiblityChecker.java b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInStaticInnerWithVisiblityChecker.java index 115b1a737ac5..b21423db13a4 100644 --- a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInStaticInnerWithVisiblityChecker.java +++ b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldInStaticInnerWithVisiblityChecker.java @@ -5,7 +5,7 @@ public class FieldVsOuter { public final String field = "yyy"; public void foo() { - System.out.println(field); + System.out.println(field); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsLocalWithVisiblityChecker.java b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsLocalWithVisiblityChecker.java index 772066823a3f..c9fa403963f5 100644 --- a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsLocalWithVisiblityChecker.java +++ b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsLocalWithVisiblityChecker.java @@ -9,7 +9,7 @@ public class AnonField { new AnonField() { @Override public void foo() { - System.out.println(xxx); + System.out.println(xxx); } }.foo(); } diff --git a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsParamWithVisiblityChecker.java b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsParamWithVisiblityChecker.java index b826534799f7..6aab13644543 100644 --- a/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsParamWithVisiblityChecker.java +++ b/java/java-tests/testData/psi/resolve/codeFragment/ResolveFieldVsParamWithVisiblityChecker.java @@ -7,7 +7,7 @@ public class PrivateFieldVsParam { new Cls() { @Override void foo() { - System.out.println(field); + System.out.println(field); } }.foo(); } diff --git a/java/java-tests/testData/psi/resolve/inference/BoundComposition.java b/java/java-tests/testData/psi/resolve/inference/BoundComposition.java index ab504e5f3626..d77008e6393e 100644 --- a/java/java-tests/testData/psi/resolve/inference/BoundComposition.java +++ b/java/java-tests/testData/psi/resolve/inference/BoundComposition.java @@ -2,6 +2,6 @@ class Test { private static void p( Class cl ) { - cl.getSuperclass(); + cl.getSuperclass(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferAutoboxed.java b/java/java-tests/testData/psi/resolve/inference/InferAutoboxed.java index 9ec0914bd9b7..49780dbea63f 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferAutoboxed.java +++ b/java/java-tests/testData/psi/resolve/inference/InferAutoboxed.java @@ -4,6 +4,6 @@ class C { } void n () { - m(10); + m(10); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferInAssign1.java b/java/java-tests/testData/psi/resolve/inference/InferInAssign1.java index 31da41a0f0cc..aef6716f1285 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferInAssign1.java +++ b/java/java-tests/testData/psi/resolve/inference/InferInAssign1.java @@ -13,6 +13,6 @@ public class Seq { } static void foo() { - Seq n = nil(); + Seq n = nil(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferInAssign2.java b/java/java-tests/testData/psi/resolve/inference/InferInAssign2.java index c4bc740dc1a2..526b53ccaafb 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferInAssign2.java +++ b/java/java-tests/testData/psi/resolve/inference/InferInAssign2.java @@ -13,6 +13,6 @@ public class Seq { } static void foo() { - Seq s = cons("abc", nil()); + Seq s = cons("abc", nil()); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferInCall1.java b/java/java-tests/testData/psi/resolve/inference/InferInCall1.java index 8ee070f3ef92..167a74c9c66d 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferInCall1.java +++ b/java/java-tests/testData/psi/resolve/inference/InferInCall1.java @@ -15,6 +15,6 @@ public class Seq { static void foo (Seq seq) {} static void foo() { - foo(nil()); + foo(nil()); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferInCast.java b/java/java-tests/testData/psi/resolve/inference/InferInCast.java index 50f770c79d40..04c0c8cb0b59 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferInCast.java +++ b/java/java-tests/testData/psi/resolve/inference/InferInCast.java @@ -13,6 +13,6 @@ public class Seq { } static void foo() { - (Seq)nil(); + (Seq)nil(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferInParamsOnly.java b/java/java-tests/testData/psi/resolve/inference/InferInParamsOnly.java index dc2dda377419..a4929379c44f 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferInParamsOnly.java +++ b/java/java-tests/testData/psi/resolve/inference/InferInParamsOnly.java @@ -6,6 +6,6 @@ class C { T f(T t1, T t2) {return null;} void foo () { - Object o = f (new A(), new B ()); + Object o = f (new A(), new B ()); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferInReturn.java b/java/java-tests/testData/psi/resolve/inference/InferInReturn.java index da9098d5ffb6..7a6fb91859fa 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferInReturn.java +++ b/java/java-tests/testData/psi/resolve/inference/InferInReturn.java @@ -3,7 +3,7 @@ public class C { class Sub { T foo () { - return C.this.foo(); + return C.this.foo(); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferInSuperAssignment.java b/java/java-tests/testData/psi/resolve/inference/InferInSuperAssignment.java index c79bc77a205c..511040dce181 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferInSuperAssignment.java +++ b/java/java-tests/testData/psi/resolve/inference/InferInSuperAssignment.java @@ -5,6 +5,6 @@ class C { B f() {return null;} void bar () { - A a = f(); + A a = f(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferNotNull.java b/java/java-tests/testData/psi/resolve/inference/InferNotNull.java index 4e4cbae20035..5c0073db0f03 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferNotNull.java +++ b/java/java-tests/testData/psi/resolve/inference/InferNotNull.java @@ -8,6 +8,6 @@ class SortedList extends ArrayList } public boolean add(E e){ - binarySearch(this,e); //infer E + binarySearch(this,e); //infer E } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferPrimitiveArray.java b/java/java-tests/testData/psi/resolve/inference/InferPrimitiveArray.java index 2c2fc6645d02..1adba24109ca 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferPrimitiveArray.java +++ b/java/java-tests/testData/psi/resolve/inference/InferPrimitiveArray.java @@ -6,7 +6,7 @@ class Test { } void foo (List l) { - extract(l); + extract(l); } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferRawType.java b/java/java-tests/testData/psi/resolve/inference/InferRawType.java index 3252e813a9cb..112e43d9485e 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferRawType.java +++ b/java/java-tests/testData/psi/resolve/inference/InferRawType.java @@ -5,6 +5,6 @@ public class C { T f (G l) { return null;} void foo (G l) { - String s = f(l); + String s = f(l); } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferUnchecked.java b/java/java-tests/testData/psi/resolve/inference/InferUnchecked.java index 613fba51310a..6b08eba23a49 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferUnchecked.java +++ b/java/java-tests/testData/psi/resolve/inference/InferUnchecked.java @@ -9,6 +9,6 @@ public class TokenStreamRewriteEngine { protected void addToSortedRewriteList(String programName, String op, Comparator comparator) { List rewrites = new ArrayList(); - binarySearch(rewrites, op, comparator); + binarySearch(rewrites, op, comparator); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithBounds.java b/java/java-tests/testData/psi/resolve/inference/InferWithBounds.java index 86c70b4437a4..5a81255022c4 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithBounds.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithBounds.java @@ -3,6 +3,6 @@ class C { T f() {return null;} void bar () { - Object o = f(); + Object o = f(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithBounds1.java b/java/java-tests/testData/psi/resolve/inference/InferWithBounds1.java index 8a18221840a6..a343b6b7eaf3 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithBounds1.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithBounds1.java @@ -4,6 +4,6 @@ class Test { } void cc() { - getValue(); + getValue(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs1.java b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs1.java index f6a45fc879a8..4056c19d33c8 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs1.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs1.java @@ -5,6 +5,6 @@ class C { T foo (T... ts) { return null; } void bar () { - foo(new C2()); + foo(new C2()); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs2.java b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs2.java index 04fb22e30ac0..f8db981d968d 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs2.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs2.java @@ -5,6 +5,6 @@ class C { T foo (T... ts) { return null; } void bar () { - foo(new C2(), new C1()); + foo(new C2(), new C1()); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs3.java b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs3.java index 1e77a7dc3944..d44e5a3e737c 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs3.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs3.java @@ -5,6 +5,6 @@ class Test { return null; } void foo () { - asList(new int[0]); + asList(new int[0]); } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs4.java b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs4.java index fb144b66b191..6924cc07a1a5 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs4.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs4.java @@ -5,6 +5,6 @@ class Test { return null; } void foo () { - asList(new int[0], new int[0]); + asList(new int[0], new int[0]); } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs5.java b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs5.java index 2a801d7c8258..110166df928e 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs5.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs5.java @@ -5,6 +5,6 @@ class Test { return null; } void foo () { - asList(new Integer[0]); + asList(new Integer[0]); } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs6.java b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs6.java index 8eed10afdadf..d9146e8054b6 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithVarargs6.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithVarargs6.java @@ -5,6 +5,6 @@ class Test { return null; } void foo () { - asList(new Integer[0], new Integer[0]); + asList(new Integer[0], new Integer[0]); } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards.java b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards.java index bbc8f8f9c359..4dad8c599adf 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards.java @@ -4,7 +4,7 @@ class Comparator {} public class Collections { public static T min(Collection coll, Comparator comp) { if (comp==null) - return (T)min((Collection) (Collection) coll); + return (T)min((Collection) (Collection) coll); return null; } diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards1.java b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards1.java index e13f6ca53cd2..8579a7e869b2 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards1.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards1.java @@ -2,6 +2,6 @@ class C { T foo (C c) {return null;} void bar (C c) { - foo(c); + foo(c); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards2.java b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards2.java index 8e316f01d75c..4dd0abf62412 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards2.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards2.java @@ -20,6 +20,6 @@ public class Bazz { } public static void failure(final Collection foos) { - getElements(foos); + getElements(foos); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards3.java b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards3.java index b163814708f1..0bec82176d52 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards3.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards3.java @@ -9,7 +9,7 @@ class X { { Y y1 = null; - X.x(y1); + X.x(y1); } } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards4.java b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards4.java index 9691d67adc38..732e7088a305 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards4.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards4.java @@ -9,7 +9,7 @@ class X { { Y y1 = null; - X.x(y1); + X.x(y1); } } } diff --git a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards5.java b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards5.java index c4b6760e5854..9a4f58f98bbc 100644 --- a/java/java-tests/testData/psi/resolve/inference/InferWithWildcards5.java +++ b/java/java-tests/testData/psi/resolve/inference/InferWithWildcards5.java @@ -9,7 +9,7 @@ class X { { Y> y1 = null; - X.x(y1); + X.x(y1); } } } diff --git a/java/java-tests/testData/psi/resolve/inference/SCR41031.java b/java/java-tests/testData/psi/resolve/inference/SCR41031.java index 1da05cbda57c..4273af993983 100644 --- a/java/java-tests/testData/psi/resolve/inference/SCR41031.java +++ b/java/java-tests/testData/psi/resolve/inference/SCR41031.java @@ -6,7 +6,7 @@ class CaptureTest { private List> listOfSets; private void foo() { - doGenericThing(listOfSets.get()); + doGenericThing(listOfSets.get()); } public List doGenericThing(List set) { diff --git a/java/java-tests/testData/psi/resolve/method/AnonymousSuper1.java b/java/java-tests/testData/psi/resolve/method/AnonymousSuper1.java index cf66fbc51aae..fa29fba3f253 100644 --- a/java/java-tests/testData/psi/resolve/method/AnonymousSuper1.java +++ b/java/java-tests/testData/psi/resolve/method/AnonymousSuper1.java @@ -6,7 +6,7 @@ public class Test1 { public static void main(String[] args){ new A(){ protected void foo(){ - super.foo(); + super.foo(); } }; } diff --git a/java/java-tests/testData/psi/resolve/method/Array1.java b/java/java-tests/testData/psi/resolve/method/Array1.java index a7e828947be4..13be5a54c1db 100644 --- a/java/java-tests/testData/psi/resolve/method/Array1.java +++ b/java/java-tests/testData/psi/resolve/method/Array1.java @@ -1,6 +1,6 @@ class Array{ void foo(){ int[] array; - array.clone(); + array.clone(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/Bug7968.java b/java/java-tests/testData/psi/resolve/method/Bug7968.java index f840f1eac1a6..506e58585ff1 100644 --- a/java/java-tests/testData/psi/resolve/method/Bug7968.java +++ b/java/java-tests/testData/psi/resolve/method/Bug7968.java @@ -2,7 +2,7 @@ public class Bug7968 { public static void foo (String s, String s1, String s2, Object[] oa) { - Bar.bar (s, s1, s2, oa); + Bar.bar (s, s1, s2, oa); } class Bar { diff --git a/java/java-tests/testData/psi/resolve/method/Clone.java b/java/java-tests/testData/psi/resolve/method/Clone.java index 6f77c23d7da8..be6115a58442 100644 --- a/java/java-tests/testData/psi/resolve/method/Clone.java +++ b/java/java-tests/testData/psi/resolve/method/Clone.java @@ -10,7 +10,7 @@ class Z{ Object clone() { C c = new C(); ((A) c).clone(); - ((B) c).clone(); + ((B) c).clone(); return c.clone(); } } diff --git a/java/java-tests/testData/psi/resolve/method/Cycle1.java b/java/java-tests/testData/psi/resolve/method/Cycle1.java index aaa54e1d0163..1b89a60d3abd 100644 --- a/java/java-tests/testData/psi/resolve/method/Cycle1.java +++ b/java/java-tests/testData/psi/resolve/method/Cycle1.java @@ -17,7 +17,7 @@ public class Cycle1{ void foo(int ggg){} void foo1(){ - foo(); + foo(); } } } diff --git a/java/java-tests/testData/psi/resolve/method/EmptyConstructor.java b/java/java-tests/testData/psi/resolve/method/EmptyConstructor.java index 652070ee8eda..67c3bf4ab978 100644 --- a/java/java-tests/testData/psi/resolve/method/EmptyConstructor.java +++ b/java/java-tests/testData/psi/resolve/method/EmptyConstructor.java @@ -1,5 +1,5 @@ class A{ A(){ - super(); + super(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/ImplementOrder.java b/java/java-tests/testData/psi/resolve/method/ImplementOrder.java index 5d61f06a8867..7b7a152c9595 100644 --- a/java/java-tests/testData/psi/resolve/method/ImplementOrder.java +++ b/java/java-tests/testData/psi/resolve/method/ImplementOrder.java @@ -1,6 +1,6 @@ abstract public class YYY implements I,II{ private void f(YYY y) { - II i = y.foo(); + II i = y.foo(); } } interface I { diff --git a/java/java-tests/testData/psi/resolve/method/IndexOf.java b/java/java-tests/testData/psi/resolve/method/IndexOf.java index 7b095dfc5030..dbb3c4f9611c 100644 --- a/java/java-tests/testData/psi/resolve/method/IndexOf.java +++ b/java/java-tests/testData/psi/resolve/method/IndexOf.java @@ -1,5 +1,5 @@ class A{ { - "aaa".indexOf('a'); + "aaa".indexOf('a'); } } diff --git a/java/java-tests/testData/psi/resolve/method/InheranceWithExtendsConflict.java b/java/java-tests/testData/psi/resolve/method/InheranceWithExtendsConflict.java index e33e1834a4e8..8e20ccef06ce 100644 --- a/java/java-tests/testData/psi/resolve/method/InheranceWithExtendsConflict.java +++ b/java/java-tests/testData/psi/resolve/method/InheranceWithExtendsConflict.java @@ -5,7 +5,7 @@ public class Inner1 { private class A extends B{ { - int j = a(); + int j = a(); } } } diff --git a/java/java-tests/testData/psi/resolve/method/Inherit1.java b/java/java-tests/testData/psi/resolve/method/Inherit1.java index 168db98c4f0f..5db09f042c37 100644 --- a/java/java-tests/testData/psi/resolve/method/Inherit1.java +++ b/java/java-tests/testData/psi/resolve/method/Inherit1.java @@ -12,6 +12,6 @@ class B extends A{ class Super1 extends B{ { - super.askdh(); + super.askdh(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/InnerClass.java b/java/java-tests/testData/psi/resolve/method/InnerClass.java index 5846ded7141a..140d25d8bc5b 100644 --- a/java/java-tests/testData/psi/resolve/method/InnerClass.java +++ b/java/java-tests/testData/psi/resolve/method/InnerClass.java @@ -5,7 +5,7 @@ public class InnerClass { void foo(int i) {} void bar() { - foo(); + foo(); } } diff --git a/java/java-tests/testData/psi/resolve/method/MethodConflict1.java b/java/java-tests/testData/psi/resolve/method/MethodConflict1.java index 07eaeca3e58d..4f5f9632e622 100644 --- a/java/java-tests/testData/psi/resolve/method/MethodConflict1.java +++ b/java/java-tests/testData/psi/resolve/method/MethodConflict1.java @@ -7,6 +7,6 @@ class A{ void foo(B b){} } { - new C().foo(new C()) + new C().foo(new C()) } } diff --git a/java/java-tests/testData/psi/resolve/method/MethodFromAnonBase.java b/java/java-tests/testData/psi/resolve/method/MethodFromAnonBase.java index 9ab99d5e6a03..d5a310332ee3 100644 --- a/java/java-tests/testData/psi/resolve/method/MethodFromAnonBase.java +++ b/java/java-tests/testData/psi/resolve/method/MethodFromAnonBase.java @@ -2,7 +2,7 @@ class Test{ { new Runnable(){ { - run(); + run(); } } } diff --git a/java/java-tests/testData/psi/resolve/method/MultipleInheritancePathsToMethod.java b/java/java-tests/testData/psi/resolve/method/MultipleInheritancePathsToMethod.java index 3fea76f410e8..69371a95f42b 100644 --- a/java/java-tests/testData/psi/resolve/method/MultipleInheritancePathsToMethod.java +++ b/java/java-tests/testData/psi/resolve/method/MultipleInheritancePathsToMethod.java @@ -14,7 +14,7 @@ interface VeryNamed extends NN, N2, N3, N1 {} class MyClass { void foo(VeryNamed f) { - f.getName(); + f.getName(); } } diff --git a/java/java-tests/testData/psi/resolve/method/NextMethod.java b/java/java-tests/testData/psi/resolve/method/NextMethod.java index 65711f26769a..c4f76284f7a6 100644 --- a/java/java-tests/testData/psi/resolve/method/NextMethod.java +++ b/java/java-tests/testData/psi/resolve/method/NextMethod.java @@ -3,7 +3,7 @@ class A{ } void foo(){ - foo("aaa", true); + foo("aaa", true); } void foo(String a, boolean b){ diff --git a/java/java-tests/testData/psi/resolve/method/NotAccessibleAccessClass.java b/java/java-tests/testData/psi/resolve/method/NotAccessibleAccessClass.java index c47e519a1074..a5e00dafa5f8 100644 --- a/java/java-tests/testData/psi/resolve/method/NotAccessibleAccessClass.java +++ b/java/java-tests/testData/psi/resolve/method/NotAccessibleAccessClass.java @@ -12,6 +12,6 @@ class A { class C extends A { { - b1.f(); + b1.f(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/ObjectVsInterface.java b/java/java-tests/testData/psi/resolve/method/ObjectVsInterface.java index da5d26b12155..ad84c5048a7f 100644 --- a/java/java-tests/testData/psi/resolve/method/ObjectVsInterface.java +++ b/java/java-tests/testData/psi/resolve/method/ObjectVsInterface.java @@ -6,6 +6,6 @@ interface PublicCloneable { interface Extension extends Serializable, PublicCloneable {} class Test { void foo(Extension bar) { - bar.clone(); + bar.clone(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/PartlyImplement1.java b/java/java-tests/testData/psi/resolve/method/PartlyImplement1.java index 4dc62090273d..f6c0ea1ec9ac 100644 --- a/java/java-tests/testData/psi/resolve/method/PartlyImplement1.java +++ b/java/java-tests/testData/psi/resolve/method/PartlyImplement1.java @@ -1,7 +1,7 @@ class A{ public abstract class IntegerPredicateBase implements Predicate{ public boolean applies(Object obj){ - return applies((Integer)obj); + return applies((Integer)obj); } } public interface Predicate{ diff --git a/java/java-tests/testData/psi/resolve/method/PreferPublic.java b/java/java-tests/testData/psi/resolve/method/PreferPublic.java index 3408dcf20ab5..6b33a6a63cfa 100644 --- a/java/java-tests/testData/psi/resolve/method/PreferPublic.java +++ b/java/java-tests/testData/psi/resolve/method/PreferPublic.java @@ -5,6 +5,6 @@ class A{ class B{ { - new A().foo("a"); + new A().foo("a"); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner.java b/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner.java index 839af0ca8536..0c41bdc92a23 100644 --- a/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner.java +++ b/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner.java @@ -3,7 +3,7 @@ class Outer { static class Inner extends Outer { void bar() { - foo(); + foo(); } } diff --git a/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner1.java b/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner1.java index 6c0fd5e11dbf..36c4e71e6f9a 100644 --- a/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner1.java +++ b/java/java-tests/testData/psi/resolve/method/PrivateInSuperInner1.java @@ -3,7 +3,7 @@ class Outer { class Inner extends Outer { void bar() { - foo(); + foo(); } } diff --git a/java/java-tests/testData/psi/resolve/method/ProtectedM.java b/java/java-tests/testData/psi/resolve/method/ProtectedM.java index b95f2ac9aeda..4ad48f3c85bf 100644 --- a/java/java-tests/testData/psi/resolve/method/ProtectedM.java +++ b/java/java-tests/testData/psi/resolve/method/ProtectedM.java @@ -5,6 +5,6 @@ class Xc extends JComponent { JComponent component; protected void paintComponent(final Graphics g) { - component.paintComponent(g); + component.paintComponent(g); } } diff --git a/java/java-tests/testData/psi/resolve/method/Remove1.java b/java/java-tests/testData/psi/resolve/method/Remove1.java index 246ae13516f4..5c7ce1baf8e2 100644 --- a/java/java-tests/testData/psi/resolve/method/Remove1.java +++ b/java/java-tests/testData/psi/resolve/method/Remove1.java @@ -9,6 +9,6 @@ public class Remove1{ } public static void main(){ - new A().foo("aaa"); + new A().foo("aaa"); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/Remove2.java b/java/java-tests/testData/psi/resolve/method/Remove2.java index 4aca68e5a1a6..a95742270260 100644 --- a/java/java-tests/testData/psi/resolve/method/Remove2.java +++ b/java/java-tests/testData/psi/resolve/method/Remove2.java @@ -2,6 +2,6 @@ import java.util.ArrayList; public class Remove2{ private static ArrayList lst = new ArrayList(); public static void main(){ - lst.remove("aaa"); + lst.remove("aaa"); } } diff --git a/java/java-tests/testData/psi/resolve/method/Remove3.java b/java/java-tests/testData/psi/resolve/method/Remove3.java index 967e6986e996..13088135fb5a 100644 --- a/java/java-tests/testData/psi/resolve/method/Remove3.java +++ b/java/java-tests/testData/psi/resolve/method/Remove3.java @@ -6,6 +6,6 @@ public class Remove3{ THashMap map = new THashMap(); void foo(){ - map.size(); + map.size(); } } diff --git a/java/java-tests/testData/psi/resolve/method/Remove4.java b/java/java-tests/testData/psi/resolve/method/Remove4.java deleted file mode 100644 index 9464fae3af46..000000000000 --- a/java/java-tests/testData/psi/resolve/method/Remove4.java +++ /dev/null @@ -1,4 +0,0 @@ -package ; - -public class Remove4 { -} diff --git a/java/java-tests/testData/psi/resolve/method/SCR5134.java b/java/java-tests/testData/psi/resolve/method/SCR5134.java index b180b6eb62c4..1eb88d788610 100644 --- a/java/java-tests/testData/psi/resolve/method/SCR5134.java +++ b/java/java-tests/testData/psi/resolve/method/SCR5134.java @@ -6,6 +6,6 @@ interface I { abstract class C implements I { public boolean foo(Object obj) { - return foo((Integer)obj); + return foo((Integer)obj); } } diff --git a/java/java-tests/testData/psi/resolve/method/SCR5859.java b/java/java-tests/testData/psi/resolve/method/SCR5859.java index 3fe506e51da9..93febbdb7b36 100644 --- a/java/java-tests/testData/psi/resolve/method/SCR5859.java +++ b/java/java-tests/testData/psi/resolve/method/SCR5859.java @@ -22,6 +22,6 @@ class Server { class Client { { Derived arg = null; - Server.sub(arg, arg); + Server.sub(arg, arg); } } diff --git a/java/java-tests/testData/psi/resolve/method/ShortVsInt.java b/java/java-tests/testData/psi/resolve/method/ShortVsInt.java index 1abf64b0c6d9..d71a74ffd386 100644 --- a/java/java-tests/testData/psi/resolve/method/ShortVsInt.java +++ b/java/java-tests/testData/psi/resolve/method/ShortVsInt.java @@ -3,6 +3,6 @@ class A{ String toHex(short i) {} void f(){ - toHex('i'); + toHex('i'); } } diff --git a/java/java-tests/testData/psi/resolve/method/Simple.java b/java/java-tests/testData/psi/resolve/method/Simple.java index 8109ff99e9c7..2da5334ba0d5 100644 --- a/java/java-tests/testData/psi/resolve/method/Simple.java +++ b/java/java-tests/testData/psi/resolve/method/Simple.java @@ -4,6 +4,6 @@ public class Simple { static { Simple a = new Simple(); - a.method("blah"); + a.method("blah"); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/Sout.java b/java/java-tests/testData/psi/resolve/method/Sout.java index e9f8799fc6b2..d11091eee8b4 100644 --- a/java/java-tests/testData/psi/resolve/method/Sout.java +++ b/java/java-tests/testData/psi/resolve/method/Sout.java @@ -1,5 +1,5 @@ class Sout { static { - System.out.println(); + System.out.println(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/StaticVSNonStatic.java b/java/java-tests/testData/psi/resolve/method/StaticVSNonStatic.java index 55c966d88083..ea626c5efb2a 100644 --- a/java/java-tests/testData/psi/resolve/method/StaticVSNonStatic.java +++ b/java/java-tests/testData/psi/resolve/method/StaticVSNonStatic.java @@ -6,6 +6,6 @@ class A{ { - Foo.foo(); + Foo.foo(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/Super1.java b/java/java-tests/testData/psi/resolve/method/Super1.java index 9ea317a40945..15a4bba8c613 100644 --- a/java/java-tests/testData/psi/resolve/method/Super1.java +++ b/java/java-tests/testData/psi/resolve/method/Super1.java @@ -5,6 +5,6 @@ class A{ class Super1 extends A{ { - super.askdh(); + super.askdh(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/SuperOfObject.java b/java/java-tests/testData/psi/resolve/method/SuperOfObject.java index 3793a9b1d275..532243f4e04c 100644 --- a/java/java-tests/testData/psi/resolve/method/SuperOfObject.java +++ b/java/java-tests/testData/psi/resolve/method/SuperOfObject.java @@ -10,6 +10,6 @@ class CBase implements I { class C extends CBase implements J { { - super.clone(); + super.clone(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/TestOverloading1.java b/java/java-tests/testData/psi/resolve/method/TestOverloading1.java index f363ec64e14e..1fb1e8391d1a 100644 --- a/java/java-tests/testData/psi/resolve/method/TestOverloading1.java +++ b/java/java-tests/testData/psi/resolve/method/TestOverloading1.java @@ -8,6 +8,6 @@ public class TestOverloading1 { } { - new B().foo(1); + new B().foo(1); } } diff --git a/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew.java b/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew.java index 71baf795c785..25da60ba4949 100644 --- a/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew.java +++ b/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew.java @@ -1,5 +1,5 @@ class A{ void foo() throws Exception{ - throw Exception(); + throw Exception(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew2.java b/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew2.java index 71baf795c785..25da60ba4949 100644 --- a/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew2.java +++ b/java/java-tests/testData/psi/resolve/method/ThrowWithoutNew2.java @@ -1,5 +1,5 @@ class A{ void foo() throws Exception{ - throw Exception(); + throw Exception(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/ValueOf.java b/java/java-tests/testData/psi/resolve/method/ValueOf.java index 0292b5871408..dae06b5bc8ec 100644 --- a/java/java-tests/testData/psi/resolve/method/ValueOf.java +++ b/java/java-tests/testData/psi/resolve/method/ValueOf.java @@ -1,5 +1,5 @@ class A{ void foo(){ - String.valueOf(1); + String.valueOf(1); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/AmbiguousBoxing.java b/java/java-tests/testData/psi/resolve/method/generics/AmbiguousBoxing.java index 2b565f7dbfba..a16bba2bd45c 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/AmbiguousBoxing.java +++ b/java/java-tests/testData/psi/resolve/method/generics/AmbiguousBoxing.java @@ -4,6 +4,6 @@ public class Ambiguous { void g(Integer i) { - f(1, i); + f(1, i); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/AutoboxingAndWidening.java b/java/java-tests/testData/psi/resolve/method/generics/AutoboxingAndWidening.java index bd0fd5ee0a56..e4bbbfbbd3de 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/AutoboxingAndWidening.java +++ b/java/java-tests/testData/psi/resolve/method/generics/AutoboxingAndWidening.java @@ -5,7 +5,7 @@ public class Foo { { - foo(1L); + foo(1L); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/ConstructorExplicitParams.java b/java/java-tests/testData/psi/resolve/method/generics/ConstructorExplicitParams.java index 6de818552a09..e51ebd7ad4e4 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/ConstructorExplicitParams.java +++ b/java/java-tests/testData/psi/resolve/method/generics/ConstructorExplicitParams.java @@ -4,6 +4,6 @@ class Foo { } static { - Foo f = new Foo(); + Foo f = new Foo(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypeAnonymous.java b/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypeAnonymous.java index b487a309af24..b9e6fe09dd67 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypeAnonymous.java +++ b/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypeAnonymous.java @@ -15,6 +15,6 @@ class C { }; B[] bar() { - return x.foo(); + return x.foo(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypes.java b/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypes.java index 095f908e21c7..53ae5f6822d4 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypes.java +++ b/java/java-tests/testData/psi/resolve/method/generics/CovariantReturnTypes.java @@ -8,6 +8,6 @@ interface B extends E,F { } class User { void x(B a) { - String o = a.o(); + String o = a.o(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/DependingParams2.java b/java/java-tests/testData/psi/resolve/method/generics/DependingParams2.java index ccff1ff4e762..c320127c3568 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/DependingParams2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/DependingParams2.java @@ -9,6 +9,6 @@ public class Foo implements Runnable{ } { - foo(new Class(){}, this); + foo(new Class(){}, this); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams1.java b/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams1.java index f9c022ebd47b..f22f24092181 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams1.java @@ -3,6 +3,6 @@ class Foo { } { - this.f(); + this.f(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams2.java b/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams2.java index 33a9cf6bc406..2b905c264b2b 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/ExplicitParams2.java @@ -3,6 +3,6 @@ class Foo { } static { - new Foo().f(); + new Foo().f(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/Extends1.java b/java/java-tests/testData/psi/resolve/method/generics/Extends1.java index ddf45a8a857f..31fb56b6ede5 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/Extends1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/Extends1.java @@ -9,6 +9,6 @@ class Test{ { HashMap map = new HashMap(); - map.put(new Integer(1), new Integer(1)).byteValue(); + map.put(new Integer(1), new Integer(1)).byteValue(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterBoxing1.java b/java/java-tests/testData/psi/resolve/method/generics/FilterBoxing1.java index cb4517f9c828..d5a77e3d9eaf 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterBoxing1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterBoxing1.java @@ -8,7 +8,7 @@ class Test1 { } public static void main(String[] args) { - method("Hello, World", false); + method("Hello, World", false); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs1.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs1.java index e875b2ee5616..fb36f76f86b4 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs1.java @@ -9,6 +9,6 @@ public void g() { // Code is green - but we need a cast here - f(null, null); + f(null, null); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs2.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs2.java index eb38a09fc109..bf22715a26ed 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs2.java @@ -9,6 +9,6 @@ public void g() { // Code is green - but we need a cast here - f(null); + f(null); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs3.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs3.java index 5156f69a043e..4d83a104825e 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs3.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs3.java @@ -11,6 +11,6 @@ class Cast { public void g() { // Code is green - but we need a cast here - f(null); + f(null); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs4.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs4.java index 87d51f04fefe..c1176d463ad5 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs4.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs4.java @@ -11,6 +11,6 @@ class Cast { public void g() { // Casts ensures correct candidates filtering - f((A) null); + f((A) null); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs5.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs5.java index ccb839da3346..1a10357c0ceb 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs5.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs5.java @@ -13,6 +13,6 @@ class A { public static void main(String[] args) { //resolves to nonvarargs method - List uhoh = listOf(""); + List uhoh = listOf(""); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs6.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs6.java index 8d0eb4fb8e6b..6876c7350981 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs6.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs6.java @@ -14,6 +14,6 @@ class A { public static void main(String[] args) { String[] array = {"foo", "bar"}; //resolves to varargs method - List uhoh = listOf(array); + List uhoh = listOf(array); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs7.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs7.java index 3492c46470aa..53a13c4fe145 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs7.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs7.java @@ -14,6 +14,6 @@ import java.util.List; public static void main(String[] args) { String[] array = {"foo", "bar"}; //resolves to nonvarargs method - List listOfString = listOf(array); + List listOfString = listOf(array); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs8.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs8.java index 509e6fd0d39b..83357792d774 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs8.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs8.java @@ -1,6 +1,6 @@ class HH { HH(Object o1, Object o2) { - this(o1, o2); + this(o1, o2); } diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs9.java b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs9.java index 90d83fac4196..c8864bb0688b 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs9.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterFixedVsVarargs9.java @@ -7,7 +7,7 @@ } void f(PsiElement e) { - getParentOfType(e, PsiElement.class, PsiElement.class); + getParentOfType(e, PsiElement.class, PsiElement.class); } static class PsiElement {} diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs1.java b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs1.java index 67c854ba4654..bda79bfc3f50 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs1.java @@ -10,6 +10,6 @@ class XY { } public static void main(String[] args) { - getLocalizedObject(null, ""); + getLocalizedObject(null, ""); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs2.java b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs2.java index 0c19a2a3e4ae..27710473967f 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs2.java @@ -4,6 +4,6 @@ class XY { private void f(int... is) {} public static void main(String[] args) { - f((byte)0, (byte)1); + f((byte)0, (byte)1); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs3.java b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs3.java index e3066fbf0477..e40c1e7147e0 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs3.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs3.java @@ -4,6 +4,6 @@ class XY { private void f(int... is) {} public static void main(String[] args) { - f(); + f(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs4.java b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs4.java index 600fb3dfcdb8..2a0c34d7f632 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs4.java +++ b/java/java-tests/testData/psi/resolve/method/generics/FilterVarargsVsVarargs4.java @@ -4,6 +4,6 @@ class XY { private void f(int... is) {} public static void main(String[] args) { - f(); + f(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericClass1.java b/java/java-tests/testData/psi/resolve/method/generics/GenericClass1.java index d21803b47af9..b0909d341b1b 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericClass1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericClass1.java @@ -4,6 +4,6 @@ interface Foo extends Comparable { class User { void foo (Foo foo) { - foo.compareTo(foo); + foo.compareTo(foo); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericClass2.java b/java/java-tests/testData/psi/resolve/method/generics/GenericClass2.java index 229778721f30..78514f8f2317 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericClass2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericClass2.java @@ -7,6 +7,6 @@ class Foo { class User { void foo (Foo foo) { - foo.f(new ArrayList()); + foo.f(new ArrayList()); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods1.java b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods1.java index 232c243fb358..acccb31fd813 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods1.java @@ -8,6 +8,6 @@ public class AAA { } void y(List strings) { - f(strings); + f(strings); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods2.java b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods2.java index 8393aa1ebbb1..27627b5d5c9d 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods2.java @@ -8,6 +8,6 @@ public class AAA { } void y(List strings) { - f(strings); + f(strings); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods3.java b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods3.java index fef01026b6de..1dacefaff217 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods3.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods3.java @@ -6,6 +6,6 @@ public class AAA { } { - g(""); + g(""); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods4.java b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods4.java index 4ee6cbf62129..8fe92b39c466 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods4.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods4.java @@ -6,6 +6,6 @@ public class AAA { } { - g(""); + g(""); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods5.java b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods5.java index bec86bed5860..1023b5d65d86 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods5.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods5.java @@ -14,6 +14,6 @@ class IBug { WKey sk = new WKey(); - items.addItem(sk, ""); + items.addItem(sk, ""); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods6.java b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods6.java index cb97bc81c2fc..9852c65fd502 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericMethods6.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericMethods6.java @@ -4,7 +4,7 @@ class ContainerUtil { } public static T find(Iterable iterable, final T equalTo) { - return find(iterable, new Condition() { + return find(iterable, new Condition() { public boolean value(final T object) { return equalTo == object || equalTo.equals(object); } diff --git a/java/java-tests/testData/psi/resolve/method/generics/GenericsAndVarargsNoConflict.java b/java/java-tests/testData/psi/resolve/method/generics/GenericsAndVarargsNoConflict.java index 9513d380cdbd..3fa18e22824c 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GenericsAndVarargsNoConflict.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GenericsAndVarargsNoConflict.java @@ -1,7 +1,7 @@ class Test { public static void main(String[] args) { - method("a", "b", "c"); + method("a", "b", "c"); } public static T method(T... a) { diff --git a/java/java-tests/testData/psi/resolve/method/generics/GetClass.java b/java/java-tests/testData/psi/resolve/method/generics/GetClass.java index 301849469213..5331d3cac7b1 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/GetClass.java +++ b/java/java-tests/testData/psi/resolve/method/generics/GetClass.java @@ -1,5 +1,5 @@ class Test { public static void main(String[] args) { - "sss".getClass(); + "sss".getClass(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/HidingSuperPrivate.java b/java/java-tests/testData/psi/resolve/method/generics/HidingSuperPrivate.java index 9e3aa1f6091b..c9e99e1748bf 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/HidingSuperPrivate.java +++ b/java/java-tests/testData/psi/resolve/method/generics/HidingSuperPrivate.java @@ -9,7 +9,7 @@ private Object f() { new BaseTest() { { - f(); + f(); } }; diff --git a/java/java-tests/testData/psi/resolve/method/generics/Inheritance1.java b/java/java-tests/testData/psi/resolve/method/generics/Inheritance1.java index 35b4e4b48417..05cdb6b9b92c 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/Inheritance1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/Inheritance1.java @@ -11,6 +11,6 @@ class Test{ } { - new A().x.getT().byteValue(); + new A().x.getT().byteValue(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/Inheritance2.java b/java/java-tests/testData/psi/resolve/method/generics/Inheritance2.java index 574b1fd16a01..544cb597abb7 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/Inheritance2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/Inheritance2.java @@ -11,6 +11,6 @@ class Test{ } { - new A().new B().getZ().booleanValue(); + new A().new B().getZ().booleanValue(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/Inheritance3.java b/java/java-tests/testData/psi/resolve/method/generics/Inheritance3.java index 08ac65fa9b3b..de5ddc94fd45 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/Inheritance3.java +++ b/java/java-tests/testData/psi/resolve/method/generics/Inheritance3.java @@ -11,6 +11,6 @@ class Test{ } { - new A().new B().getT().byteValue(); + new A().new B().getT().byteValue(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/Inheritance4.java b/java/java-tests/testData/psi/resolve/method/generics/Inheritance4.java index 0b81ca901d7a..ff4f17495dc5 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/Inheritance4.java +++ b/java/java-tests/testData/psi/resolve/method/generics/Inheritance4.java @@ -13,6 +13,6 @@ class Test{ class C extends A{} { - new C().new B().getT().byteValue(); + new C().new B().getT().byteValue(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/ListEquals.java b/java/java-tests/testData/psi/resolve/method/generics/ListEquals.java index 73948effcbd6..686022385cf6 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/ListEquals.java +++ b/java/java-tests/testData/psi/resolve/method/generics/ListEquals.java @@ -2,6 +2,6 @@ import java.util.List; class SomeClass { private void method(List var, List bar) { - var.equals(bar); + var.equals(bar); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/Merge1.java b/java/java-tests/testData/psi/resolve/method/generics/Merge1.java index 5029c30a7ba8..f38cf9c3766b 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/Merge1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/Merge1.java @@ -4,7 +4,7 @@ class Test { { test.put(""); { - test.get().get().get().get(); + test.get().get().get().get(); } } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/MoreSpecificSameErasure.java b/java/java-tests/testData/psi/resolve/method/generics/MoreSpecificSameErasure.java index 71694b126e40..b036e35ba3ab 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/MoreSpecificSameErasure.java +++ b/java/java-tests/testData/psi/resolve/method/generics/MoreSpecificSameErasure.java @@ -14,7 +14,7 @@ class SSS { return null; } void f() { - x(any(Long.class)); + x(any(Long.class)); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/NestedTypeParams.java b/java/java-tests/testData/psi/resolve/method/generics/NestedTypeParams.java index 27ec7bde066d..2096e26806c5 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/NestedTypeParams.java +++ b/java/java-tests/testData/psi/resolve/method/generics/NestedTypeParams.java @@ -17,6 +17,6 @@ enum TestEnum { class Testx { public void doTest(){ TestImpl impl = new TestImpl(); - impl.doStuff(TestEnum.THING); + impl.doStuff(TestEnum.THING); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/NonPublicAnonymous.java b/java/java-tests/testData/psi/resolve/method/generics/NonPublicAnonymous.java index f8ad6d1d1f48..202f8bae6a1e 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/NonPublicAnonymous.java +++ b/java/java-tests/testData/psi/resolve/method/generics/NonPublicAnonymous.java @@ -9,6 +9,6 @@ class C { }; { - a.foo(); + a.foo(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/PreferArrayTypeToObject.java b/java/java-tests/testData/psi/resolve/method/generics/PreferArrayTypeToObject.java index 74a844f4411a..ba06e5934d39 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/PreferArrayTypeToObject.java +++ b/java/java-tests/testData/psi/resolve/method/generics/PreferArrayTypeToObject.java @@ -16,6 +16,6 @@ public class MyClass { String[] myArray = new String[] { "a", "b", "c" }; - process(myArray); // Ctr-Left-Click on "process" takes me to the wrong method!!! + process(myArray); // Ctr-Left-Click on "process" takes me to the wrong method!!! } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/RawInheritanceConflict.java b/java/java-tests/testData/psi/resolve/method/generics/RawInheritanceConflict.java index 8a6de04eff10..083bee3d9db8 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/RawInheritanceConflict.java +++ b/java/java-tests/testData/psi/resolve/method/generics/RawInheritanceConflict.java @@ -5,6 +5,6 @@ class XX { class UU { void bar() { Properties p = new Properties(); - XX.foo(p, "xxx", false); + XX.foo(p, "xxx", false); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/RawMethod1.java b/java/java-tests/testData/psi/resolve/method/generics/RawMethod1.java index 621b5377f5e8..31476bbccc22 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/RawMethod1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/RawMethod1.java @@ -3,6 +3,6 @@ class A{ void foo(T a, B b){} { - foo("", new B()); + foo("", new B()); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflict.java b/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflict.java index c39659e0144f..cd52795d7464 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflict.java +++ b/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflict.java @@ -1,6 +1,6 @@ class TestClassT { static { - B.foo(TestClassT.class); + B.foo(TestClassT.class); } public static class A { diff --git a/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride.java b/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride.java index 47eed87e38af..fcd162765f75 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride.java +++ b/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride.java @@ -1,6 +1,6 @@ class TestClassT { static { - new B().foo(TestClassT.class); + new B().foo(TestClassT.class); } public static class A { diff --git a/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride2.java b/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride2.java index d92ab9a7b3a3..fc5fbef0ff42 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/RawVsGenericConflictInCaseOfOverride2.java @@ -16,6 +16,6 @@ class C { public static void main(String[] args) { final TestProcessor testProcessor = new TestProcessor(); - testProcessor.processMap(new HashMap()); + testProcessor.processMap(new HashMap()); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/SOE.java b/java/java-tests/testData/psi/resolve/method/generics/SOE.java index ed304ff7d71f..53eda0a5db2d 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/SOE.java +++ b/java/java-tests/testData/psi/resolve/method/generics/SOE.java @@ -1,6 +1,6 @@ import java.util.Comparator; abstract class Z implements Comparator { - static abstract class NameRef implements java.lang.ComparableNameRef> { + static abstract class NameRef implements java.lang.ComparableNameRef> { } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict.java b/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict.java index d3d87cb499d9..104d4f75b1f9 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict.java +++ b/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict.java @@ -4,6 +4,6 @@ import static java.util.Collections.sort; class C { { int[] array = null; - sort(array); + sort(array); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict1.java b/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict1.java index e76994e684e8..3a0e8446e9d5 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict1.java @@ -10,7 +10,7 @@ public class X { public int parseInt(){ //The following line is rejected by the compiler but not by IntelliJ. - return parseInt(str); + return parseInt(str); } public static void main(String[] args) { diff --git a/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict3.java b/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict3.java index 2c08d1599da0..faa34cb3d9b3 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict3.java +++ b/java/java-tests/testData/psi/resolve/method/generics/StaticImportConflict3.java @@ -6,7 +6,7 @@ import static p.ToImportX2.fff; //IDEA-64926 public class AppTest { public static void main(String[] args) { - fff(); + fff(); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/StaticImportDirect.java b/java/java-tests/testData/psi/resolve/method/generics/StaticImportDirect.java index 8c7db21ba5e9..7a46b6aed18e 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/StaticImportDirect.java +++ b/java/java-tests/testData/psi/resolve/method/generics/StaticImportDirect.java @@ -3,6 +3,6 @@ import java.util.*; class C { { - List s = asList(new String[0]); + List s = asList(new String[0]); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/StaticImportHidden.java b/java/java-tests/testData/psi/resolve/method/generics/StaticImportHidden.java index bb88280c2fad..e31e98939438 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/StaticImportHidden.java +++ b/java/java-tests/testData/psi/resolve/method/generics/StaticImportHidden.java @@ -6,6 +6,6 @@ class ImportDuty { } void printArgs(Object... args) { - System.out.println(toString(args)); + System.out.println(toString(args)); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/StaticImportOnDemand.java b/java/java-tests/testData/psi/resolve/method/generics/StaticImportOnDemand.java index 2dcc100d4c2d..1915c8cc5b35 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/StaticImportOnDemand.java +++ b/java/java-tests/testData/psi/resolve/method/generics/StaticImportOnDemand.java @@ -3,6 +3,6 @@ import java.util.*; class C { { - List s = asList(new String[0]); + List s = asList(new String[0]); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/StaticMethodInSubclass.java b/java/java-tests/testData/psi/resolve/method/generics/StaticMethodInSubclass.java index 125295077743..ff21dd461d67 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/StaticMethodInSubclass.java +++ b/java/java-tests/testData/psi/resolve/method/generics/StaticMethodInSubclass.java @@ -17,7 +17,7 @@ public class SomeClass { Object criteria = null; // IntelliJ finds the find(Collection, Object) method, and reports a non-existent compile error. - T someInstance = SomeSubClass.find(c, criteria); + T someInstance = SomeSubClass.find(c, criteria); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading1.java b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading1.java index 5963aca3c5f8..5adb042947f7 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading1.java @@ -8,6 +8,6 @@ public class TestGenericMethodOverloading1 { } } { - new A().equals(new Object()); + new A().equals(new Object()); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading2.java b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading2.java index 954b561f7347..1fc27e1bb061 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading2.java @@ -5,6 +5,6 @@ public class TestGenericMethodOverloading2 { } } { - new A().equals(new Object()); + new A().equals(new Object()); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading3.java b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading3.java index c40a4d18e31e..7e8b6efc3145 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading3.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading3.java @@ -5,6 +5,6 @@ public class TestGenericMethodOverloading3 { } } { - new A().equals(new Object()); + new A().equals(new Object()); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading4.java b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading4.java index c0e86cde6dba..6ae8720e76ce 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading4.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TestGenericMethodOverloading4.java @@ -5,6 +5,6 @@ public class TestGenericMethodOverloading4 { } } { - new A().equals(new String()); + new A().equals(new String()); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/TestReturnType1.java b/java/java-tests/testData/psi/resolve/method/generics/TestReturnType1.java index b8fc528ec1bf..18b0e909a15e 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TestReturnType1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TestReturnType1.java @@ -5,6 +5,6 @@ public class TestReturnType1 { } } { - new A().foo(new String()).toCharArray(); + new A().foo(new String()).toCharArray(); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/TestReturnType2.java b/java/java-tests/testData/psi/resolve/method/generics/TestReturnType2.java index 2a22f6e53d37..b4b045e8f713 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TestReturnType2.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TestReturnType2.java @@ -5,6 +5,6 @@ public class TestReturnType2 { } } { - new A().foo(new String()).toCharArray(); + new A().foo(new String()).toCharArray(); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/TestThisExpression.java b/java/java-tests/testData/psi/resolve/method/generics/TestThisExpression.java index 8ae922ac6ee3..03844dc58dcd 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TestThisExpression.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TestThisExpression.java @@ -5,7 +5,7 @@ public class WithInner { class Inner { T foo () { - return WithInner.this.foo(); + return WithInner.this.foo(); } } diff --git a/java/java-tests/testData/psi/resolve/method/generics/ToString.java b/java/java-tests/testData/psi/resolve/method/generics/ToString.java index a0d05e166e18..46e8c2fd19c7 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/ToString.java +++ b/java/java-tests/testData/psi/resolve/method/generics/ToString.java @@ -6,6 +6,6 @@ class SomeClass { }; public String get() { - return OBJECT_OVERRIDDEN.toString(); + return OBJECT_OVERRIDDEN.toString(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/TypeInference1.java b/java/java-tests/testData/psi/resolve/method/generics/TypeInference1.java index 603959deba30..eacf1dffacbf 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TypeInference1.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TypeInference1.java @@ -20,6 +20,6 @@ class A{ T foo(T t, A a){ return null; } { - foo(new C(), new A()).b(); + foo(new C(), new A()).b(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/method/generics/TypeParamBoundConflict.java b/java/java-tests/testData/psi/resolve/method/generics/TypeParamBoundConflict.java index 53577e9b74fe..bb60816751ba 100644 --- a/java/java-tests/testData/psi/resolve/method/generics/TypeParamBoundConflict.java +++ b/java/java-tests/testData/psi/resolve/method/generics/TypeParamBoundConflict.java @@ -15,7 +15,7 @@ class TestergenUser { public void context(Testergen test) { // the error is shown when x is called: Collection t = null; - test.x(t); + test.x(t); } } diff --git a/java/java-tests/testData/psi/resolve/method/varargs/ObjectObject.java b/java/java-tests/testData/psi/resolve/method/varargs/ObjectObject.java index 85d6f56f8737..2f9fc108cffe 100644 --- a/java/java-tests/testData/psi/resolve/method/varargs/ObjectObject.java +++ b/java/java-tests/testData/psi/resolve/method/varargs/ObjectObject.java @@ -3,6 +3,6 @@ class XY { public static void foo(Object a, Object... x) { } public static void main(String[] args) { - foo("a"); + foo("a"); } } diff --git a/java/java-tests/testData/psi/resolve/method/varargs/ObjectObjectObject.java b/java/java-tests/testData/psi/resolve/method/varargs/ObjectObjectObject.java index 7a4aeb72b70b..b15b5ef967ff 100644 --- a/java/java-tests/testData/psi/resolve/method/varargs/ObjectObjectObject.java +++ b/java/java-tests/testData/psi/resolve/method/varargs/ObjectObjectObject.java @@ -3,6 +3,6 @@ class XY { public static void foo(Object a, Object o, Object... x) { } public static void main(String[] args) { - foo("a", "b"); + foo("a", "b"); } } diff --git a/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveObject.java b/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveObject.java index 025f6a78522d..9a4c5d916936 100644 --- a/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveObject.java +++ b/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveObject.java @@ -4,6 +4,6 @@ class XY { private void f(int... is) {} public static void main(String[] args) { - f(); + f(); } } diff --git a/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveString.java b/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveString.java index 3a74b80404c0..d4cbda5f0196 100644 --- a/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveString.java +++ b/java/java-tests/testData/psi/resolve/method/varargs/PrimitiveString.java @@ -4,6 +4,6 @@ class XY { private void f(int... is) {} public static void main(String[] args) { - f(); + f(); } } diff --git a/java/java-tests/testData/psi/resolve/method/varargs/StringObject.java b/java/java-tests/testData/psi/resolve/method/varargs/StringObject.java index 91c0930d05ff..da631b7caa65 100644 --- a/java/java-tests/testData/psi/resolve/method/varargs/StringObject.java +++ b/java/java-tests/testData/psi/resolve/method/varargs/StringObject.java @@ -4,6 +4,6 @@ class XY { public static void foo(Object a, Object... x) { } public static void main(String[] args) { - foo("a"); + foo("a"); } } diff --git a/java/java-tests/testData/psi/resolve/method/varargs/StringObjectString.java b/java/java-tests/testData/psi/resolve/method/varargs/StringObjectString.java index fc802d9b0938..cad14965720b 100644 --- a/java/java-tests/testData/psi/resolve/method/varargs/StringObjectString.java +++ b/java/java-tests/testData/psi/resolve/method/varargs/StringObjectString.java @@ -3,6 +3,6 @@ class XY { public static void foo(Object a, String... x) { } public static void main(String[] args) { - foo("a"); + foo("a"); } } diff --git a/java/java-tests/testData/psi/resolve/method/varargs/StringStringString.java b/java/java-tests/testData/psi/resolve/method/varargs/StringStringString.java index 300ec694596d..a4de5d207154 100644 --- a/java/java-tests/testData/psi/resolve/method/varargs/StringStringString.java +++ b/java/java-tests/testData/psi/resolve/method/varargs/StringStringString.java @@ -3,6 +3,6 @@ class XY { public static void foo(String a, String... x) { } public static void main(String[] args) { - foo("a"); + foo("a"); } } diff --git a/java/java-tests/testData/psi/resolve/var/AnonymousConstructorArg.java b/java/java-tests/testData/psi/resolve/var/AnonymousConstructorArg.java index f5a325f41e80..a0fdee2e8d53 100644 --- a/java/java-tests/testData/psi/resolve/var/AnonymousConstructorArg.java +++ b/java/java-tests/testData/psi/resolve/var/AnonymousConstructorArg.java @@ -1,6 +1,6 @@ class Test { static Test createTest(int value) { - return new Test(value) {}; + return new Test(value) {}; } int value; diff --git a/java/java-tests/testData/psi/resolve/var/Array1.java b/java/java-tests/testData/psi/resolve/var/Array1.java index 6acbad6f44d2..2a8afc547de1 100644 --- a/java/java-tests/testData/psi/resolve/var/Array1.java +++ b/java/java-tests/testData/psi/resolve/var/Array1.java @@ -1,6 +1,6 @@ public class Array1 { void foo(){ int value[] = {}; - int val = value.length; + int val = value.length; } } diff --git a/java/java-tests/testData/psi/resolve/var/Bug7869.java b/java/java-tests/testData/psi/resolve/var/Bug7869.java index e9f27798d30b..494d944c68a5 100644 --- a/java/java-tests/testData/psi/resolve/var/Bug7869.java +++ b/java/java-tests/testData/psi/resolve/var/Bug7869.java @@ -1,5 +1,5 @@ public class Bug7869 { public static void main(String[] args){ - String str = (str = String.valueOf(123.456d)) != null ? str : "default"; + String str = (str = String.valueOf(123.456d)) != null ? str : "default"; } } diff --git a/java/java-tests/testData/psi/resolve/var/FieldConflict.java b/java/java-tests/testData/psi/resolve/var/FieldConflict.java index de9f28a61d04..462fea8cb3d2 100644 --- a/java/java-tests/testData/psi/resolve/var/FieldConflict.java +++ b/java/java-tests/testData/psi/resolve/var/FieldConflict.java @@ -11,6 +11,6 @@ interface Derived2 extends Base { class Implementor implements Derived1, Derived2 { //Implementor[] EMPTY_ARRAY = new Implementor[0]; Derived2[] f() { - return EMPTY_ARRAY; //conflict + return EMPTY_ARRAY; //conflict } } diff --git a/java/java-tests/testData/psi/resolve/var/FieldFromInterface.java b/java/java-tests/testData/psi/resolve/var/FieldFromInterface.java index 91589f5ea372..822cd6e4bfe9 100644 --- a/java/java-tests/testData/psi/resolve/var/FieldFromInterface.java +++ b/java/java-tests/testData/psi/resolve/var/FieldFromInterface.java @@ -1,6 +1,6 @@ class Client { int foo(){ - return A.FIELD; + return A.FIELD; } } diff --git a/java/java-tests/testData/psi/resolve/var/FieldsAndLocals.java b/java/java-tests/testData/psi/resolve/var/FieldsAndLocals.java index df0f4849c086..b04ae0a0625a 100644 --- a/java/java-tests/testData/psi/resolve/var/FieldsAndLocals.java +++ b/java/java-tests/testData/psi/resolve/var/FieldsAndLocals.java @@ -4,7 +4,7 @@ public class FieldsAndLocals { int a = -1; new B(){ public void run(){ - int b = a + int b = a } } } diff --git a/java/java-tests/testData/psi/resolve/var/ForeachParameter.java b/java/java-tests/testData/psi/resolve/var/ForeachParameter.java index 197dfb53a74a..507d59681302 100644 --- a/java/java-tests/testData/psi/resolve/var/ForeachParameter.java +++ b/java/java-tests/testData/psi/resolve/var/ForeachParameter.java @@ -1,7 +1,7 @@ class Foo { { for(Object o : collection) { - System.out.println(o); + System.out.println(o); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InheritedOuter.java b/java/java-tests/testData/psi/resolve/var/InheritedOuter.java index e18dea3fe3dc..5fce74e8cd8a 100644 --- a/java/java-tests/testData/psi/resolve/var/InheritedOuter.java +++ b/java/java-tests/testData/psi/resolve/var/InheritedOuter.java @@ -3,7 +3,7 @@ class Outer { class Inner extends Outer { void test() { - System.out.println(string); + System.out.println(string); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/Inner1.java b/java/java-tests/testData/psi/resolve/var/Inner1.java index c48d7ab3d93a..d3271e35a386 100644 --- a/java/java-tests/testData/psi/resolve/var/Inner1.java +++ b/java/java-tests/testData/psi/resolve/var/Inner1.java @@ -2,7 +2,7 @@ public class Inner1 { private int a = 0; private class A extends B{ { - int j = a; + int j = a; } } } diff --git a/java/java-tests/testData/psi/resolve/var/InnerPrivates1.java b/java/java-tests/testData/psi/resolve/var/InnerPrivates1.java index 500b5ee2e8a9..70069580375e 100644 --- a/java/java-tests/testData/psi/resolve/var/InnerPrivates1.java +++ b/java/java-tests/testData/psi/resolve/var/InnerPrivates1.java @@ -1,6 +1,6 @@ class A{ { - new B().b = 0; + new B().b = 0; } class B{ diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict1.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict1.java index 23e2fd304d20..22db1659c740 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict1.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict1.java @@ -10,7 +10,7 @@ public class InterfaceConflict1{ public static class C implements A, B{ static{ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict10.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict10.java index 4c3e6a3c3de1..a79f01edf0c1 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict10.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict10.java @@ -14,7 +14,7 @@ public class InterfaceConflict10{ public static class D extends A implements A, C{ void foo(){ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict11.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict11.java index 99b0a0226db8..23fb62c3e545 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict11.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict11.java @@ -9,7 +9,7 @@ public class InterfaceConflict11{ public static class C extends B{ static void foo(){ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict2.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict2.java index 7b978c17fcb4..7833c6628ef7 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict2.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict2.java @@ -13,7 +13,7 @@ public class InterfaceConflict2{ public static class C implements E, B{ static{ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict3.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict3.java index 2a56e3e55b41..944b8cc22ab2 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict3.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict3.java @@ -13,7 +13,7 @@ public class InterfaceConflict3{ public static class C extends E implements B{ static{ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict4.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict4.java index c3392b386b77..b06e94ade310 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict4.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict4.java @@ -11,7 +11,7 @@ public class InterfaceConflict4{ public static class C extends B implements A{ static{ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict5.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict5.java index 17b39e8a627e..3d93ee4fea74 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict5.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict5.java @@ -11,7 +11,7 @@ public class InterfaceConflict5{ public static class C extends B implements A{ void foo(){ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict6.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict6.java index eaec8f9bad7f..9aafadaadc6f 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict6.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict6.java @@ -11,7 +11,7 @@ public class InterfaceConflict6{ public static class C extends B implements A{ void foo(){ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict7.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict7.java index 74a16765340d..e73a04aca06a 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict7.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict7.java @@ -10,7 +10,7 @@ public class InterfaceConflict7{ public static class C extends B{ void foo(){ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict8.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict8.java index 70051c721c92..60ec4f0bbff3 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict8.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict8.java @@ -10,7 +10,7 @@ public class InterfaceConflict8{ public static class C extends B implements A{ void foo(){ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/InterfaceConflict9.java b/java/java-tests/testData/psi/resolve/var/InterfaceConflict9.java index 17d2df5eba62..ce4c26740f18 100644 --- a/java/java-tests/testData/psi/resolve/var/InterfaceConflict9.java +++ b/java/java-tests/testData/psi/resolve/var/InterfaceConflict9.java @@ -14,7 +14,7 @@ public class InterfaceConflict9{ public static class D implements A, B, C{ void foo(){ - System.out.println("" + a); + System.out.println("" + a); } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/LocalVariable1.java b/java/java-tests/testData/psi/resolve/var/LocalVariable1.java index fcc1f3b60cf3..cd4da337d893 100644 --- a/java/java-tests/testData/psi/resolve/var/LocalVariable1.java +++ b/java/java-tests/testData/psi/resolve/var/LocalVariable1.java @@ -1,6 +1,6 @@ class Test { void foo(){ int value; - int val1 = value; + int val1 = value; } } diff --git a/java/java-tests/testData/psi/resolve/var/PrivateOverloading.java b/java/java-tests/testData/psi/resolve/var/PrivateOverloading.java index 7b6612a53bf1..ce069c38c74b 100644 --- a/java/java-tests/testData/psi/resolve/var/PrivateOverloading.java +++ b/java/java-tests/testData/psi/resolve/var/PrivateOverloading.java @@ -15,6 +15,6 @@ class A { class C extends B { public void method() { - i = 10; + i = 10; } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/Qualified1.java b/java/java-tests/testData/psi/resolve/var/Qualified1.java index 48920facbe2b..7289fae30baa 100644 --- a/java/java-tests/testData/psi/resolve/var/Qualified1.java +++ b/java/java-tests/testData/psi/resolve/var/Qualified1.java @@ -5,6 +5,6 @@ public class Test{ class Test1 { static Test test = new Test(); static { - System.out.println("" + test.a); + System.out.println("" + test.a); } } diff --git a/java/java-tests/testData/psi/resolve/var/Qualified2.java b/java/java-tests/testData/psi/resolve/var/Qualified2.java index 898b933ef70c..55a44c584bdd 100644 --- a/java/java-tests/testData/psi/resolve/var/Qualified2.java +++ b/java/java-tests/testData/psi/resolve/var/Qualified2.java @@ -2,6 +2,6 @@ public class Test{ static int a = 0; public int foo(){ - return Test.a; + return Test.a; } } diff --git a/java/java-tests/testData/psi/resolve/var/Qualified3.java b/java/java-tests/testData/psi/resolve/var/Qualified3.java index b2fe726cdc0c..5fd22bcac891 100644 --- a/java/java-tests/testData/psi/resolve/var/Qualified3.java +++ b/java/java-tests/testData/psi/resolve/var/Qualified3.java @@ -2,6 +2,6 @@ public class Test{ static int a = 0; public int foo(){ - return new Test().a; + return new Test().a; } } diff --git a/java/java-tests/testData/psi/resolve/var/Qualified4.java b/java/java-tests/testData/psi/resolve/var/Qualified4.java index 6fa0a320a0db..1b6ff40cfa46 100644 --- a/java/java-tests/testData/psi/resolve/var/Qualified4.java +++ b/java/java-tests/testData/psi/resolve/var/Qualified4.java @@ -4,6 +4,6 @@ class A{ } { - System.out.println("" + A.B.a); + System.out.println("" + A.B.a); } } diff --git a/java/java-tests/testData/psi/resolve/var/RefInOuter.java b/java/java-tests/testData/psi/resolve/var/RefInOuter.java index 24029c51993b..78277fa251c5 100644 --- a/java/java-tests/testData/psi/resolve/var/RefInOuter.java +++ b/java/java-tests/testData/psi/resolve/var/RefInOuter.java @@ -2,7 +2,7 @@ class Outer { int i; class Inner { { - int j = i; + int j = i; } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/RefInSuper.java b/java/java-tests/testData/psi/resolve/var/RefInSuper.java index 1f7ce6553281..40af17a8b15b 100644 --- a/java/java-tests/testData/psi/resolve/var/RefInSuper.java +++ b/java/java-tests/testData/psi/resolve/var/RefInSuper.java @@ -2,7 +2,7 @@ class Outer { int i; class Inner extends Outer { { - int j = i; + int j = i; } } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy.java b/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy.java index d77f4da01af7..1a639e93487d 100644 --- a/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy.java +++ b/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy.java @@ -3,7 +3,7 @@ class TestPage extends WWW { static class B extends W3 { public B() { - log.hashCode(); + log.hashCode(); } } } diff --git a/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy2.java b/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy2.java index 123cf095ff16..bd58f4cedad6 100644 --- a/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy2.java +++ b/java/java-tests/testData/psi/resolve/var/ShadowFieldsInHierarchy2.java @@ -11,7 +11,7 @@ class S { private void h() { new E() { { - int o = EXIT_ON_CLOSE; + int o = EXIT_ON_CLOSE; } }.show(); } diff --git a/java/java-tests/testData/psi/resolve/var/Unresolved1.java b/java/java-tests/testData/psi/resolve/var/Unresolved1.java index 5b1f0ef0aefd..56c471f4e0e9 100644 --- a/java/java-tests/testData/psi/resolve/var/Unresolved1.java +++ b/java/java-tests/testData/psi/resolve/var/Unresolved1.java @@ -1,5 +1,5 @@ public class Test{ public static void foo() {} int a = 0; - int b = foo; + int b = foo; } diff --git a/java/java-tests/testData/psi/resolve/var/Visibility1.java b/java/java-tests/testData/psi/resolve/var/Visibility1.java index fa8646ff9433..64cc6199f63d 100644 --- a/java/java-tests/testData/psi/resolve/var/Visibility1.java +++ b/java/java-tests/testData/psi/resolve/var/Visibility1.java @@ -3,7 +3,7 @@ class Test { static class Inner{ int variable = 0; static void foo(){ - int val1 = variable; + int val1 = variable; } } } diff --git a/java/java-tests/testData/psi/resolve/var/Visibility2.java b/java/java-tests/testData/psi/resolve/var/Visibility2.java index f25e2c70fe25..b7d3a936e29d 100644 --- a/java/java-tests/testData/psi/resolve/var/Visibility2.java +++ b/java/java-tests/testData/psi/resolve/var/Visibility2.java @@ -1,3 +1,3 @@ class Test { - int a = 1 + a; + int a = 1 + a; } diff --git a/java/java-tests/testData/psi/resolve/var/Visibility3.java b/java/java-tests/testData/psi/resolve/var/Visibility3.java index d9b85ba85a19..8e12096e33d8 100644 --- a/java/java-tests/testData/psi/resolve/var/Visibility3.java +++ b/java/java-tests/testData/psi/resolve/var/Visibility3.java @@ -3,7 +3,7 @@ class Test { public int i = 0; } static { - System.out.println("" + getABC().i); + System.out.println("" + getABC().i); } static ABC getABC(){ diff --git a/java/java-tests/testData/psi/resolve/var/Visibility4.java b/java/java-tests/testData/psi/resolve/var/Visibility4.java index 958a628d3dde..91f5da8534ae 100644 --- a/java/java-tests/testData/psi/resolve/var/Visibility4.java +++ b/java/java-tests/testData/psi/resolve/var/Visibility4.java @@ -1,5 +1,5 @@ class Test { static { - int a = 1 + a; + int a = 1 + a; } } diff --git a/java/java-tests/testData/psi/resolve/var/Visibility5.java b/java/java-tests/testData/psi/resolve/var/Visibility5.java index 958a628d3dde..91f5da8534ae 100644 --- a/java/java-tests/testData/psi/resolve/var/Visibility5.java +++ b/java/java-tests/testData/psi/resolve/var/Visibility5.java @@ -1,5 +1,5 @@ class Test { static { - int a = 1 + a; + int a = 1 + a; } } diff --git a/java/java-tests/testData/psi/resolve/var/Visibility6.java b/java/java-tests/testData/psi/resolve/var/Visibility6.java index b2ed7a5375e5..b19c22c4c331 100644 --- a/java/java-tests/testData/psi/resolve/var/Visibility6.java +++ b/java/java-tests/testData/psi/resolve/var/Visibility6.java @@ -1,7 +1,7 @@ class Foo { private void f() { Bar bar=null; - bar.f(); + bar.f(); } void g() { f(); diff --git a/java/java-tests/testData/psi/resolve/var15/DuplicateStaticImport.java b/java/java-tests/testData/psi/resolve/var15/DuplicateStaticImport.java index 6c740052a09e..6cf276090ecc 100644 --- a/java/java-tests/testData/psi/resolve/var15/DuplicateStaticImport.java +++ b/java/java-tests/testData/psi/resolve/var15/DuplicateStaticImport.java @@ -3,6 +3,6 @@ import static java.lang.System.out; class DuplicateStaticImport { public static void main(String[] args) { - out.println(""); // cannot resolve symbol 'out' + out.println(""); // cannot resolve symbol 'out' } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var15/NavigateToEnumFunction.java b/java/java-tests/testData/psi/resolve/var15/NavigateToEnumFunction.java index dff8d5ff23ec..5d1a151f0323 100644 --- a/java/java-tests/testData/psi/resolve/var15/NavigateToEnumFunction.java +++ b/java/java-tests/testData/psi/resolve/var15/NavigateToEnumFunction.java @@ -7,6 +7,6 @@ enum E { class Bar { { - E.A.foo(); + E.A.foo(); } } \ No newline at end of file diff --git a/java/java-tests/testData/psi/resolve/var15/RhombExtending.java b/java/java-tests/testData/psi/resolve/var15/RhombExtending.java index 7a1d4995ad77..cb7933c2ec91 100644 --- a/java/java-tests/testData/psi/resolve/var15/RhombExtending.java +++ b/java/java-tests/testData/psi/resolve/var15/RhombExtending.java @@ -10,6 +10,6 @@ class A implements I {} /** @noinspection UnusedDeclaration*/ class AA extends A implements II { public static void f() { - String s = SSS; //this is not ambigous reference + String s = SSS; //this is not ambigous reference } } diff --git a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java index baec321c3c4f..ee86be72f1e0 100644 --- a/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java +++ b/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/lambda/TypeInference18Test.java @@ -16,18 +16,15 @@ package com.intellij.java.codeInsight.daemon.lambda; import com.intellij.JavaTestUtil; -import com.intellij.openapi.projectRoots.JavaSdkVersion; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.roots.LanguageLevelProjectExtension; -import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.PsiMethodCallExpression; import com.intellij.psi.PsiMethodReferenceExpression; import com.intellij.psi.PsiReference; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.testFramework.ResolveTestCase; +import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.LightResolveTestCase; +import org.jetbrains.annotations.NotNull; -public class TypeInference18Test extends ResolveTestCase { +public class TypeInference18Test extends LightResolveTestCase { public void testIDEA122406() throws Exception { doTest(); @@ -50,38 +47,21 @@ public class TypeInference18Test extends ResolveTestCase { } public void testCachedSubstitutionDuringOverloadResolution() throws Exception { - PsiReference ref = configureByFile("/codeInsight/daemonCodeAnalyzer/lambda/resolve/" + getTestName(false) + ".java"); + PsiReference ref = findReferenceAtCaret("/codeInsight/daemonCodeAnalyzer/lambda/resolve/" + getTestName(false) + ".java"); assertNotNull(ref); PsiMethodReferenceExpression methodCallExpression = PsiTreeUtil.getParentOfType(ref.getElement(), PsiMethodReferenceExpression.class, false); assertNotNull(methodCallExpression); assertNotNull(methodCallExpression.resolve()); } - private LanguageLevel myOldLanguageLevel; - + @NotNull @Override - protected void setUp() throws Exception { - super.setUp(); - myOldLanguageLevel = LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).getLanguageLevel(); - LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_8); - IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_8, getModule(), getTestRootDisposable()); - } - - @Override - protected void tearDown() throws Exception { - try { - LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(myOldLanguageLevel); - } - catch (Throwable e) { - addSuppressedException(e); - } - finally { - super.tearDown(); - } + protected LightProjectDescriptor getProjectDescriptor() { + return JAVA_8; } private void doTestMethodCall() throws Exception { - PsiReference ref = configureByFile("/codeInsight/daemonCodeAnalyzer/lambda/resolve/" + getTestName(false) + ".java"); + PsiReference ref = findReferenceAtCaret("/codeInsight/daemonCodeAnalyzer/lambda/resolve/" + getTestName(false) + ".java"); assertNotNull(ref); PsiMethodCallExpression methodCallExpression = PsiTreeUtil.getParentOfType(ref.getElement(), PsiMethodCallExpression.class); assertNotNull(methodCallExpression); @@ -89,16 +69,11 @@ public class TypeInference18Test extends ResolveTestCase { } private void doTest() throws Exception { - PsiReference ref = configureByFile("/codeInsight/daemonCodeAnalyzer/lambda/resolve/" + getTestName(false) + ".java"); + PsiReference ref = findReferenceAtCaret("/codeInsight/daemonCodeAnalyzer/lambda/resolve/" + getTestName(false) + ".java"); assertNotNull(ref); assertNotNull(ref.resolve()); } - @Override - protected Sdk getTestProjectJdk() { - return IdeaTestUtil.getMockJdk18(); - } - @Override protected String getTestDataPath() { return JavaTestUtil.getJavaTestDataPath(); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/Resolve15TestCase.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/Resolve15TestCase.java deleted file mode 100644 index 76aca5c00896..000000000000 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/Resolve15TestCase.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2000-2018 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.java.psi.resolve; - -import com.intellij.openapi.projectRoots.JavaSdkVersion; -import com.intellij.openapi.roots.LanguageLevelProjectExtension; -import com.intellij.pom.java.LanguageLevel; -import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.testFramework.ResolveTestCase; - -/** - * @author ven - */ -public abstract class Resolve15TestCase extends ResolveTestCase { - private LanguageLevel myOldLanguageLevel; - - @Override - protected void setUp() throws Exception { - super.setUp(); - myOldLanguageLevel = LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).getLanguageLevel(); - LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); - IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_5, getModule(), getTestRootDisposable()); - } - - @Override - protected void tearDown() throws Exception { - try { - LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(myOldLanguageLevel); - } - catch (Throwable e) { - addSuppressedException(e); - } - finally { - super.tearDown(); - } - } -} diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClass2Test.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClass2Test.java new file mode 100644 index 000000000000..ea8761d0d87c --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClass2Test.java @@ -0,0 +1,158 @@ +/* + * Copyright 2000-2017 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.java.psi.resolve; + +import com.intellij.psi.*; +import com.intellij.testFramework.LightResolveTestCase; + +public class ResolveClass2Test extends LightResolveTestCase { + public void testFQName() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + } + + public void testVarInNew() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + } + + public void testVarInNew1() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + } + + public void testPrivateInExtends() { + PsiReference ref = configure(); + final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); + PsiElement target = result.getElement(); + assertTrue(target instanceof PsiClass); + assertFalse(result.isAccessible()); + } + + public void testQNew1() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + } + + public void testInnerPrivateMember1() { + PsiReference ref = configure(); + final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); + PsiElement target = result.getElement(); + assertTrue(target instanceof PsiClass); + assertTrue(result.isValidResult()); + } + + + public void testQNew2() { + PsiJavaCodeReferenceElement ref = (PsiJavaCodeReferenceElement)configure(); + PsiElement target = ref.advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + + PsiElement parent = ref.getParent(); + assertTrue(parent instanceof PsiAnonymousClass); + ((PsiAnonymousClass)parent).getBaseClassType().resolve(); + + assertEquals(target, ((PsiAnonymousClass)parent).getBaseClassType().resolve()); + } + + public void testClassExtendsItsInner1() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + assertEquals("B.Foo", ((PsiClass)target).getQualifiedName()); + + PsiReference refCopy = ref.getElement().copy().getReference(); + assert refCopy != null; + PsiElement target1 = ((PsiJavaReference)refCopy).advancedResolve(true).getElement(); + assertTrue(target1 instanceof PsiClass); + //assertNull(target1.getContainingFile().getVirtualFile()); + assertEquals("B.Foo", ((PsiClass)target1).getQualifiedName()); + } + + public void testClassExtendsItsInner2() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertNull(target); //[ven] this should not be resolved + /*assertTrue(target instanceof PsiClass); + assertEquals("TTT.Bar", ((PsiClass)target).getQualifiedName());*/ + } + + public void testSCR40332() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertNull(target); + } + + public void testImportConflict1() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertNull(target); + } + + public void testImportConflict2() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + assertEquals("java.util.Date", ((PsiClass)target).getQualifiedName()); + } + + public void testLocals1() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + // local class + assertNull(((PsiClass)target).getQualifiedName()); + } + + public void testLocals2() { + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(target instanceof PsiClass); + // local class + assertNull(((PsiClass)target).getQualifiedName()); + } + + public void testShadowing() { + PsiReference ref = configure(); + JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); + assertTrue(result.getElement() instanceof PsiClass); + assertFalse(result.isValidResult()); + assertFalse(result.isAccessible()); + } + + public void testStaticImportVsImplicit() { + PsiReference ref = configure(); + JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); + final PsiElement element = result.getElement(); + assertTrue(element instanceof PsiClass); + assertEquals("Outer.Double", ((PsiClass)element).getQualifiedName()); + } + + public void testQualifiedAnonymousClass() { + myFixture.addClass("package foo; public class Outer { protected static class Inner { protected Inner() {} } }"); + PsiReference ref = configure(); + + assertEquals("Inner", assertInstanceOf(ref.resolve(), PsiClass.class).getName()); + } + + private PsiReference configure() { + return findReferenceAtCaret("class/" + getTestName(false) + ".java"); + } +} diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassInModulesWithDependenciesTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassInModulesWithDependenciesTest.java new file mode 100644 index 000000000000..850b97b17dd0 --- /dev/null +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassInModulesWithDependenciesTest.java @@ -0,0 +1,143 @@ +/* + * Copyright 2000-2017 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.java.psi.resolve; + +import com.intellij.openapi.application.ApplicationManager; +import com.intellij.openapi.extensions.Extensions; +import com.intellij.openapi.module.ModifiableModuleModel; +import com.intellij.openapi.module.Module; +import com.intellij.openapi.module.ModuleManager; +import com.intellij.openapi.module.StdModuleTypes; +import com.intellij.openapi.roots.ModuleRootModificationUtil; +import com.intellij.openapi.vfs.LocalFileSystem; +import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.packageDependencies.DependenciesBuilder; +import com.intellij.psi.*; +import com.intellij.testFramework.PlatformTestUtil; +import com.intellij.testFramework.PsiTestUtil; +import com.intellij.testFramework.ResolveTestCase; +import com.intellij.util.containers.ContainerUtil; +import org.easymock.IArgumentMatcher; + +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.Set; + +import static org.easymock.EasyMock.*; + +public class ResolveClassInModulesWithDependenciesTest extends ResolveTestCase { + public void testTwoModules() throws Exception { + configureDependency(); + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertTrue(String.valueOf(target), target instanceof PsiClass); + } + + public void testTwoModules2() throws Exception { + configureDependency(); + PsiReference ref = configure(); + PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); + assertNull(target); + } + + public void testModuleSourceAsLibrarySource() throws Exception { + VirtualFile dir = createTempVfsDirectory(); + ModuleRootModificationUtil.addModuleLibrary(myModule, "lib", Collections.emptyList(), Collections.singletonList(dir.getUrl())); + + final PsiReference ref = configureByFile("class/" + getTestName(false) + ".java", dir); + final VirtualFile file = ref.getElement().getContainingFile().getVirtualFile(); + assertNotNull(file); + createFile(myModule, file.getParent(), "ModuleSourceAsLibrarySourceDep.java", loadFile("class/ModuleSourceAsLibrarySourceDep.java")); + + assertInstanceOf(ref.resolve(), PsiClass.class); + } + + public void testModuleSourceAsLibraryClasses() throws Exception { + VirtualFile dir = createTempVfsDirectory(); + ModuleRootModificationUtil.addModuleLibrary(myModule, "lib", Collections.singletonList(dir.getUrl()), Collections.emptyList()); + + PsiReference ref = configureByFile("class/" + getTestName(false) + ".java", dir); + PsiFile psiFile = ref.getElement().getContainingFile(); + final VirtualFile file = psiFile.getVirtualFile(); + assertNotNull(file); + createFile(myModule, dir, "ModuleSourceAsLibraryClassesDep.java", loadFile("class/ModuleSourceAsLibraryClassesDep.java")); + //need this to ensure that PsiJavaFileBaseImpl.myResolveCache is filled to reproduce IDEA-91309 + DependenciesBuilder.analyzeFileDependencies(psiFile, new DependenciesBuilder.DependencyProcessor() { + @Override + public void process(PsiElement place, PsiElement dependency) { + } + }); + assertInstanceOf(ref.resolve(), PsiClass.class); + } + + private void configureDependency() { + ApplicationManager.getApplication().runWriteAction(() -> { + ModifiableModuleModel modifiableModel = ModuleManager.getInstance(getProject()).getModifiableModel(); + Module module = modifiableModel.newModule("a.iml", StdModuleTypes.JAVA.getId()); + modifiableModel.commit(); + + VirtualFile root = LocalFileSystem.getInstance().refreshAndFindFileByPath(getTestDataPath() + "/class/dependentModule"); + assert root != null; + + PsiTestUtil.addContentRoot(module, root); + PsiTestUtil.addSourceRoot(module, root.findChild("src")); + PsiTestUtil.addSourceRoot(module, root.findChild("test"), true); + + ModuleRootModificationUtil.addDependency(getModule(), module); + }); + } + + private PsiReference configure() throws Exception { + return configureByFile("class/" + getTestName(false) + ".java"); + } + + public void testNoSubpackagesAccess() throws Exception { + PsiElementFinder mock = createMockFinder(); + PlatformTestUtil.registerExtension(Extensions.getArea(getProject()), PsiElementFinder.EP_NAME, mock, getTestRootDisposable()); + + PsiReference reference = configure(); + assertNull(reference.resolve()); + reference.getVariants(); + + verify(mock); + } + + private static PsiElementFinder createMockFinder() { + Set ignoredMethods = ContainerUtil.newHashSet("getClassesFilter", "processPackageDirectories", "getClasses"); + Method[] methods = ContainerUtil.findAllAsArray(PsiElementFinder.class.getDeclaredMethods(), m -> !ignoredMethods.contains(m.getName())); + PsiElementFinder mock = createMockBuilder(PsiElementFinder.class).addMockedMethods(methods).createMock(); + expect(mock.findClasses(anyObject(), anyObject())).andReturn(PsiClass.EMPTY_ARRAY).anyTimes(); + expect(mock.findPackage(eq("foo"))).andReturn(null); + expect(mock.getSubPackages(rootPackage(), anyObject())).andReturn(PsiPackage.EMPTY_ARRAY); + replay(mock); + return mock; + } + + private static PsiPackage rootPackage() { + reportMatcher(new IArgumentMatcher() { + @Override + public boolean matches(Object argument) { + return "PsiPackage:".equals(String.valueOf(argument)); + } + + @Override + public void appendTo(StringBuffer buffer) { + buffer.append("PsiPackage:"); + } + }); + return null; + } +} diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassTest.java deleted file mode 100644 index 340490079bf1..000000000000 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveClassTest.java +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright 2000-2017 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.java.psi.resolve; - -import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.application.WriteAction; -import com.intellij.openapi.extensions.Extensions; -import com.intellij.openapi.module.ModifiableModuleModel; -import com.intellij.openapi.module.Module; -import com.intellij.openapi.module.ModuleManager; -import com.intellij.openapi.module.StdModuleTypes; -import com.intellij.openapi.roots.ModuleRootModificationUtil; -import com.intellij.openapi.util.RecursionManager; -import com.intellij.openapi.vfs.LocalFileSystem; -import com.intellij.openapi.vfs.VirtualFile; -import com.intellij.packageDependencies.DependenciesBuilder; -import com.intellij.psi.*; -import com.intellij.psi.search.GlobalSearchScope; -import com.intellij.testFramework.PlatformTestUtil; -import com.intellij.testFramework.PsiTestUtil; -import com.intellij.testFramework.ResolveTestCase; -import com.intellij.util.containers.ContainerUtil; -import org.easymock.IArgumentMatcher; - -import java.lang.reflect.Method; -import java.util.Collections; -import java.util.Set; - -import static org.easymock.EasyMock.*; - -public class ResolveClassTest extends ResolveTestCase { - public void testFQName() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - } - - public void testVarInNew() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - } - - public void testVarInNew1() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - } - - public void testPrivateInExtends() throws Exception { - PsiReference ref = configure(); - final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); - PsiElement target = result.getElement(); - assertTrue(target instanceof PsiClass); - assertFalse(result.isAccessible()); - } - - public void testQNew1() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - } - - public void testInnerPrivateMember1() throws Exception { - PsiReference ref = configure(); - final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); - PsiElement target = result.getElement(); - assertTrue(target instanceof PsiClass); - assertTrue(result.isValidResult()); - } - - - public void testQNew2() throws Exception { - PsiJavaCodeReferenceElement ref = (PsiJavaCodeReferenceElement)configure(); - PsiElement target = ref.advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - - PsiElement parent = ref.getParent(); - assertTrue(parent instanceof PsiAnonymousClass); - ((PsiAnonymousClass)parent).getBaseClassType().resolve(); - - assertEquals(target, ((PsiAnonymousClass)parent).getBaseClassType().resolve()); - } - - public void testClassExtendsItsInner1() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - assertEquals("B.Foo", ((PsiClass)target).getQualifiedName()); - - PsiReference refCopy = ref.getElement().copy().getReference(); - assert refCopy != null; - PsiElement target1 = ((PsiJavaReference)refCopy).advancedResolve(true).getElement(); - assertTrue(target1 instanceof PsiClass); - //assertNull(target1.getContainingFile().getVirtualFile()); - assertEquals("B.Foo", ((PsiClass)target1).getQualifiedName()); - } - - public void testClassExtendsItsInner2() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertNull(target); //[ven] this should not be resolved - /*assertTrue(target instanceof PsiClass); - assertEquals("TTT.Bar", ((PsiClass)target).getQualifiedName());*/ - } - - public void testSCR40332() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertNull(target); - } - - public void testImportConflict1() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertNull(target); - } - - public void testImportConflict2() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - assertEquals("java.util.Date", ((PsiClass)target).getQualifiedName()); - } - - public void testLocals1() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - // local class - assertNull(((PsiClass)target).getQualifiedName()); - } - - public void testLocals2() throws Exception { - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(target instanceof PsiClass); - // local class - assertNull(((PsiClass)target).getQualifiedName()); - } - - public void testShadowing() throws Exception { - PsiReference ref = configure(); - JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); - assertTrue(result.getElement() instanceof PsiClass); - assertFalse(result.isValidResult()); - assertFalse(result.isAccessible()); - } - - public void testStaticImportVsImplicit() throws Exception { - PsiReference ref = configure(); - JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); - final PsiElement element = result.getElement(); - assertTrue(element instanceof PsiClass); - assertEquals("Outer.Double", ((PsiClass)element).getQualifiedName()); - } - - public void testTwoModules() throws Exception { - configureDependency(); - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertTrue(String.valueOf(target), target instanceof PsiClass); - } - - public void testTwoModules2() throws Exception { - configureDependency(); - PsiReference ref = configure(); - PsiElement target = ((PsiJavaReference)ref).advancedResolve(true).getElement(); - assertNull(target); - } - - public void testModuleSourceAsLibrarySource() throws Exception { - VirtualFile dir = createTempVfsDirectory(); - ModuleRootModificationUtil.addModuleLibrary(myModule, "lib", Collections.emptyList(), Collections.singletonList(dir.getUrl())); - - final PsiReference ref = configureByFile("class/" + getTestName(false) + ".java", dir); - final VirtualFile file = ref.getElement().getContainingFile().getVirtualFile(); - assertNotNull(file); - createFile(myModule, file.getParent(), "ModuleSourceAsLibrarySourceDep.java", loadFile("class/ModuleSourceAsLibrarySourceDep.java")); - - assertInstanceOf(ref.resolve(), PsiClass.class); - } - - public void testModuleSourceAsLibraryClasses() throws Exception { - VirtualFile dir = createTempVfsDirectory(); - ModuleRootModificationUtil.addModuleLibrary(myModule, "lib", Collections.singletonList(dir.getUrl()), Collections.emptyList()); - - PsiReference ref = configureByFile("class/" + getTestName(false) + ".java", dir); - PsiFile psiFile = ref.getElement().getContainingFile(); - final VirtualFile file = psiFile.getVirtualFile(); - assertNotNull(file); - createFile(myModule, dir, "ModuleSourceAsLibraryClassesDep.java", loadFile("class/ModuleSourceAsLibraryClassesDep.java")); - //need this to ensure that PsiJavaFileBaseImpl.myResolveCache is filled to reproduce IDEA-91309 - DependenciesBuilder.analyzeFileDependencies(psiFile, new DependenciesBuilder.DependencyProcessor() { - @Override - public void process(PsiElement place, PsiElement dependency) { - } - }); - assertInstanceOf(ref.resolve(), PsiClass.class); - } - - public void testStaticImportInTheSameClassPerformance() throws Exception { - warmUpResolve(); - - PsiReference ref = configure(); - ensureIndexUpToDate(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 60, () -> assertNull(ref.resolve())) - .attempts(1).assertTiming(); - } - - private void ensureIndexUpToDate() { - getJavaFacade().findClass(CommonClassNames.JAVA_UTIL_LIST, GlobalSearchScope.allScope(myProject)); - } - - private void warmUpResolve() { - PsiJavaCodeReferenceElement ref = JavaPsiFacade.getElementFactory(myProject).createReferenceFromText("java.util.List", null); - JavaResolveResult result = ref.advancedResolve(false); - assertNotNull(result.getElement()); - assertSize(1, result.getSubstitutor().getSubstitutionMap().keySet()); - } - - public void testStaticImportNetworkPerformance() throws Exception { - warmUpResolve(); - - VirtualFile dir = createTempVfsDirectory(); - - PsiReference ref = configureByFile("class/" + getTestName(false) + ".java", dir); - int count = 15; - - String imports = ""; - for (int i = 0; i < count; i++) { - imports += "import static Foo" + i + ".*;\n"; - } - - for (int i = 0; i < count; i++) { - createFile(myModule, dir, "Foo" + i + ".java", imports + "class Foo" + i + " extends Bar1, Bar2, Bar3 {}"); - } - - ensureIndexUpToDate(); - PlatformTestUtil.startPerformanceTest(getTestName(false), 800, () -> assertNull(ref.resolve())) - .attempts(1).assertTiming(); - } - - public void testQualifiedAnonymousClass() throws Exception { - RecursionManager.assertOnRecursionPrevention(getTestRootDisposable()); - - PsiReference ref = configure(); - VirtualFile file = ref.getElement().getContainingFile().getVirtualFile(); - assertNotNull(file); - VirtualFile pkg = WriteAction.compute(() -> file.getParent().createChildDirectory(this, "foo")); - createFile(myModule, pkg, "Outer.java", "package foo; public class Outer { protected static class Inner { protected Inner() {} } }"); - - assertEquals("Inner", assertInstanceOf(ref.resolve(), PsiClass.class).getName()); - } - - private void configureDependency() { - ApplicationManager.getApplication().runWriteAction(() -> { - ModifiableModuleModel modifiableModel = ModuleManager.getInstance(getProject()).getModifiableModel(); - Module module = modifiableModel.newModule("a.iml", StdModuleTypes.JAVA.getId()); - modifiableModel.commit(); - - VirtualFile root = LocalFileSystem.getInstance().refreshAndFindFileByPath(getTestDataPath() + "/class/dependentModule"); - assert root != null; - - PsiTestUtil.addContentRoot(module, root); - PsiTestUtil.addSourceRoot(module, root.findChild("src")); - PsiTestUtil.addSourceRoot(module, root.findChild("test"), true); - - ModuleRootModificationUtil.addDependency(getModule(), module); - }); - } - - private PsiReference configure() throws Exception { - return configureByFile("class/" + getTestName(false) + ".java"); - } - - public void testNoSubpackagesAccess() throws Exception { - PsiElementFinder mock = createMockFinder(); - PlatformTestUtil.registerExtension(Extensions.getArea(getProject()), PsiElementFinder.EP_NAME, mock, getTestRootDisposable()); - - PsiReference reference = configure(); - assertNull(reference.resolve()); - reference.getVariants(); - - verify(mock); - } - - private static PsiElementFinder createMockFinder() { - Set ignoredMethods = ContainerUtil.newHashSet("getClassesFilter", "processPackageDirectories", "getClasses"); - Method[] methods = ContainerUtil.findAllAsArray(PsiElementFinder.class.getDeclaredMethods(), m -> !ignoredMethods.contains(m.getName())); - PsiElementFinder mock = createMockBuilder(PsiElementFinder.class).addMockedMethods(methods).createMock(); - expect(mock.findClasses(anyObject(), anyObject())).andReturn(PsiClass.EMPTY_ARRAY).anyTimes(); - expect(mock.findPackage(eq("foo"))).andReturn(null); - expect(mock.getSubPackages(rootPackage(), anyObject())).andReturn(PsiPackage.EMPTY_ARRAY); - replay(mock); - return mock; - } - - private static PsiPackage rootPackage() { - reportMatcher(new IArgumentMatcher() { - @Override - public boolean matches(Object argument) { - return "PsiPackage:".equals(String.valueOf(argument)); - } - - @Override - public void appendTo(StringBuffer buffer) { - buffer.append("PsiPackage:"); - } - }); - return null; - } -} diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveInCodeFragmentTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveInCodeFragmentTest.java index afec9ee17c8a..0f16fbb425a1 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveInCodeFragmentTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveInCodeFragmentTest.java @@ -10,19 +10,19 @@ import com.intellij.psi.impl.PsiElementFactoryImpl; import com.intellij.psi.impl.search.JavaSourceFilterScope; import com.intellij.psi.impl.source.tree.java.PsiReferenceExpressionImpl; import com.intellij.psi.util.PsiTreeUtil; -import com.intellij.testFramework.ResolveTestCase; +import com.intellij.testFramework.LightResolveTestCase; import java.util.function.Consumer; /** * @author max */ -public class ResolveInCodeFragmentTest extends ResolveTestCase { - public void testLocalVariable() throws Exception { +public class ResolveInCodeFragmentTest extends LightResolveTestCase { + public void testLocalVariable() { final PsiReference iRef = configure(); PsiElement context = PsiTreeUtil.getParentOfType(iRef.getElement(), PsiCodeBlock.class); - JavaCodeFragment codeFragment = JavaCodeFragmentFactory.getInstance(myProject) + JavaCodeFragment codeFragment = JavaCodeFragmentFactory.getInstance(getProject()) .createExpressionCodeFragment(iRef.getElement().getText(), context, null, true); codeFragment.setVisibilityChecker(JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE); @@ -40,7 +40,7 @@ public class ResolveInCodeFragmentTest extends ResolveTestCase { } public void testjavaLangClass() { - PsiCodeFragment codeFragment = JavaCodeFragmentFactory.getInstance(myProject).createExpressionCodeFragment( + PsiCodeFragment codeFragment = JavaCodeFragmentFactory.getInstance(getProject()).createExpressionCodeFragment( "Boolean.getBoolean(\"true\")", null, null, true); PsiElement[] fileContent = codeFragment.getChildren(); @@ -52,32 +52,32 @@ public class ResolveInCodeFragmentTest extends ResolveTestCase { assertEquals("boolean", expr.getType().getCanonicalText()); } - public void testResolveFieldVsLocalWithVisiblityChecker() throws Exception { + public void testResolveFieldVsLocalWithVisiblityChecker() { doTestResolveWithVisibilityChecker("xxx", e -> assertInstanceOf(e, PsiLocalVariable.class)); } - public void testResolveFieldVsParamWithVisiblityChecker() throws Exception { + public void testResolveFieldVsParamWithVisiblityChecker() { doTestResolveWithVisibilityChecker("field", e -> assertInstanceOf(e, PsiParameter.class)); } - public void testResolveFieldInStaticInnerWithVisiblityChecker() throws Exception { + public void testResolveFieldInStaticInnerWithVisiblityChecker() { doTestResolveWithVisibilityChecker("field", e -> { assertInstanceOf(e, PsiField.class); assertEquals("Inner", ((PsiField)e).getContainingClass().getName()); }); } - public void testResolveFieldInInnerWithVisiblityChecker() throws Exception { + public void testResolveFieldInInnerWithVisiblityChecker() { doTestResolveWithVisibilityChecker("field", e -> { assertInstanceOf(e, PsiField.class); assertEquals("Inner", ((PsiField)e).getContainingClass().getName()); }); } - private void doTestResolveWithVisibilityChecker(String field, Consumer checker) throws Exception { + private void doTestResolveWithVisibilityChecker(String field, Consumer checker) { PsiReference iRef = configure(); - JavaCodeFragment codeFragment = JavaCodeFragmentFactory.getInstance(myProject).createExpressionCodeFragment( + JavaCodeFragment codeFragment = JavaCodeFragmentFactory.getInstance(getProject()).createExpressionCodeFragment( field, iRef.getElement(), null, true); codeFragment.setVisibilityChecker(JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE); @@ -91,23 +91,23 @@ public class ResolveInCodeFragmentTest extends ResolveTestCase { checker.accept(results[0].getElement()); } - private PsiReference configure() throws Exception { - return configureByFile("codeFragment/" + getTestName(false) + ".java"); + private PsiReference configure() { + return findReferenceAtCaret("codeFragment/" + getTestName(false) + ".java"); } - public void testResolveScopeWithFragmentContext() throws Exception { - PsiElement physical = configureByFile("codeFragment/LocalVariable.java").getElement(); - JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(myProject) + public void testResolveScopeWithFragmentContext() { + PsiElement physical = findReferenceAtCaret("codeFragment/LocalVariable.java").getElement(); + JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(getProject()) .createExpressionCodeFragment("ref", physical, null, true); fragment.forceResolveScope(new JavaSourceFilterScope(physical.getResolveScope())); - assertFalse(fragment.getResolveScope().equals(physical.getResolveScope())); + assertNotSame(fragment.getResolveScope(), physical.getResolveScope()); - PsiExpression lightExpr = JavaPsiFacade.getElementFactory(myProject).createExpressionFromText("xxx.xxx", fragment); + PsiExpression lightExpr = JavaPsiFacade.getElementFactory(getProject()).createExpressionFromText("xxx.xxx", fragment); assertEquals(lightExpr.getResolveScope(), fragment.getResolveScope()); } public void testClassHierarchyInNonPhysicalFile() { - PsiFile file = PsiFileFactory.getInstance(myProject).createFileFromText("a.java", JavaFileType.INSTANCE, + PsiFile file = PsiFileFactory.getInstance(getProject()).createFileFromText("a.java", JavaFileType.INSTANCE, "class Parent { void foo( ); }\n" + "class Child extends Parent { }\n" + "class User {\n" + @@ -128,7 +128,7 @@ public class ResolveInCodeFragmentTest extends ResolveTestCase { public void testDropCachesOnNonPhysicalContextChange() { PsiElementFactoryImpl factory = (PsiElementFactoryImpl)JavaPsiFacade.getElementFactory(getProject()); - PsiClass superClass = ((PsiJavaFile) PsiFileFactory.getInstance(myProject).createFileFromText("a.java", JavaFileType.INSTANCE, "class Super { @Deprecated void foo(){} }")).getClasses()[0]; + PsiClass superClass = ((PsiJavaFile) PsiFileFactory.getInstance(getProject()).createFileFromText("a.java", JavaFileType.INSTANCE, "class Super { @Deprecated void foo(){} }")).getClasses()[0]; PsiClass subClass = ((PsiNewExpression)factory.createExpressionFromText("new Super() { void foo(){} }", superClass)).getAnonymousClass(); assertNotNull(AnnotationUtil.findAnnotationInHierarchy(subClass.getMethods()[0], Deprecated.class)); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethod15Test.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethod15Test.java index 1142e4f48b3f..7de698085492 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethod15Test.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethod15Test.java @@ -21,7 +21,10 @@ import com.intellij.openapi.util.RecursionManager; import com.intellij.psi.*; import com.intellij.psi.infos.MethodCandidateInfo; import com.intellij.psi.util.PsiTreeUtil; +import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.LightResolveTestCase; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import java.util.Collection; @@ -31,7 +34,13 @@ import static org.junit.Assert.assertThat; /** * @author dsl */ -public class ResolveMethod15Test extends Resolve15TestCase { +public class ResolveMethod15Test extends LightResolveTestCase { + @NotNull + @Override + protected LightProjectDescriptor getProjectDescriptor() { + return JAVA_1_5; + } + public void testStaticImportOnDemand() throws Exception { final PsiReference ref = configureByFile(); final PsiElement element = ref.resolve(); @@ -410,7 +419,7 @@ public class ResolveMethod15Test extends Resolve15TestCase { } private PsiReference configureByFile() throws Exception { - return configureByFile("method/generics/" + getTestName(false) + ".java"); + return findReferenceAtCaret("method/generics/" + getTestName(false) + ".java"); } private static PsiMethod checkResolvesUnique(final PsiReference ref) { assertThat(ref, instanceOf(PsiReferenceExpression.class)); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethodTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethodTest.java index bf495e0e1fa6..c54f61737e98 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethodTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveMethodTest.java @@ -15,91 +15,85 @@ */ package com.intellij.java.psi.resolve; -import com.intellij.openapi.projectRoots.Sdk; -import com.intellij.openapi.roots.LanguageLevelProjectExtension; -import com.intellij.pom.java.LanguageLevel; import com.intellij.psi.*; import com.intellij.psi.infos.MethodCandidateInfo; -import com.intellij.testFramework.IdeaTestUtil; -import com.intellij.testFramework.ResolveTestCase; +import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.LightResolveTestCase; +import org.jetbrains.annotations.NotNull; -public class ResolveMethodTest extends ResolveTestCase { +public class ResolveMethodTest extends LightResolveTestCase { + + @NotNull @Override - protected void setUp() throws Exception { - super.setUp(); - LanguageLevelProjectExtension.getInstance(myJavaFacade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5); + protected LightProjectDescriptor getProjectDescriptor() { + return JAVA_1_4; } - @Override - protected Sdk getTestProjectJdk() { - return IdeaTestUtil.getMockJdk14(); - } - - private PsiElement resolve() throws Exception { - PsiReference ref = configureByFile("method/" + getTestName(false) + ".java"); + private PsiElement resolve() { + PsiReference ref = findReferenceAtCaret("method/" + getTestName(false) + ".java"); return ref.resolve(); } - private JavaResolveResult advancedResolve() throws Exception { - PsiJavaCodeReferenceElement ref = (PsiJavaCodeReferenceElement)configureByFile("method/" + getTestName(false) + ".java"); + private JavaResolveResult advancedResolve() { + PsiJavaCodeReferenceElement ref = (PsiJavaCodeReferenceElement)findReferenceAtCaret("method/" + getTestName(false) + ".java"); return ref.advancedResolve(true); } - public void testShortVsInt() throws Exception { + public void testShortVsInt() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); PsiParameter parm = ((PsiMethod)target).getParameterList().getParameters()[0]; assertEquals(PsiType.INT, parm.getType()); } - public void testSimple() throws Exception { + public void testSimple() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertEquals("method", ((PsiMethod) target).getName()); } - public void testIndexOf() throws Exception{ + public void testIndexOf() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); PsiParameter parm = ((PsiMethod)target).getParameterList().getParameters()[0]; assertEquals(PsiType.INT, parm.getType()); } - public void testSuper1() throws Exception{ + public void testSuper1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); } - public void testInherit1() throws Exception{ + public void testInherit1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("B", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testNextMethod() throws Exception{ + public void testNextMethod() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertEquals(PsiType.BOOLEAN, ((PsiMethod)target).getParameterList().getParameters()[1].getType()); } - public void testMethodConflict1() throws Exception{ + public void testMethodConflict1() { PsiElement target = resolve(); assertNull(target); } - public void testValueOf() throws Exception{ + public void testValueOf() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertEquals(PsiType.INT, ((PsiMethod)target).getParameterList().getParameters()[0].getType()); } - public void testMethodFromAnonBase() throws Exception{ + public void testMethodFromAnonBase() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); } - public void testSCR5859() throws Exception{ + public void testSCR5859() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); PsiParameter[] parms = ((PsiMethod)target).getParameterList().getParameters(); @@ -107,60 +101,60 @@ public class ResolveMethodTest extends ResolveTestCase { assertEquals("Derived", parms[1].getType().getPresentableText()); } - public void testPreferPublic() throws Exception{ + public void testPreferPublic() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(((PsiMethod)target).hasModifierProperty(PsiModifier.PUBLIC)); } - public void testRemove1() throws Exception{ + public void testRemove1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("Remove1.A", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testRemove2() throws Exception{ + public void testRemove2() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("java.util.AbstractCollection", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testArray1() throws Exception{ + public void testArray1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); } - public void testCycle1() throws Exception{ + public void testCycle1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("Cycle1.C", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testAnonymousSuper1() throws Exception{ + public void testAnonymousSuper1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("Test1.A", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testBug7968() throws Exception{ + public void testBug7968() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("Bug7968.Bar", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testInheranceWithExtendsConflict() throws Exception{ + public void testInheranceWithExtendsConflict() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("B", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testSout() throws Exception { + public void testSout() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertEquals("println", ((PsiMethod)target).getName()); @@ -176,14 +170,14 @@ public class ResolveMethodTest extends ResolveTestCase { } */ - public void testPartlyImplement1() throws Exception{ + public void testPartlyImplement1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); assertEquals("A.Predicate", ((PsiClass)target.getParent()).getQualifiedName()); } - public void testTestOverloading1() throws Exception{ + public void testTestOverloading1() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); assertTrue(target.getParent() instanceof PsiClass); @@ -191,7 +185,7 @@ public class ResolveMethodTest extends ResolveTestCase { } - public void testSuperOfObject() throws Exception { + public void testSuperOfObject() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); final PsiMethod method = (PsiMethod)target; @@ -200,59 +194,59 @@ public class ResolveMethodTest extends ResolveTestCase { } - public void testStaticVSNonStatic() throws Exception{ + public void testStaticVSNonStatic() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); PsiMethod method = (PsiMethod) target; assertEquals(0, method.getParameterList().getParametersCount()); } - public void testClone() throws Exception{ + public void testClone() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); } - public void testThrowWithoutNew() throws Exception{ + public void testThrowWithoutNew() { PsiElement target = resolve(); assertNull(target); } - public void testThrowWithoutNew2() throws Exception { + public void testThrowWithoutNew2() { PsiElement target = advancedResolve().getElement(); assertTrue(target instanceof PsiClass); } - public void testNotAccessibleAccessClass() throws Exception{ + public void testNotAccessibleAccessClass() { JavaResolveResult result = advancedResolve(); assertFalse(result.isAccessible()); } - public void testInnerClass() throws Exception{ + public void testInnerClass() { JavaResolveResult result = advancedResolve(); assertNotNull(result.getElement()); assertTrue(result instanceof MethodCandidateInfo); - assertTrue(!result.isValidResult()); - assertTrue(!((MethodCandidateInfo)result).isApplicable()); + assertFalse(result.isValidResult()); + assertFalse(((MethodCandidateInfo)result).isApplicable()); final PsiClass aClass = ((PsiMethod)result.getElement()).getContainingClass(); assertNotNull(aClass.getContainingClass()); } - public void testPrivateInSuperInner() throws Exception{ + public void testPrivateInSuperInner() { JavaResolveResult result = advancedResolve(); assertNotNull(result.getElement()); assertTrue(result instanceof MethodCandidateInfo); - assertTrue(!result.isValidResult()); - assertTrue(!result.isStaticsScopeCorrect()); + assertFalse(result.isValidResult()); + assertFalse(result.isStaticsScopeCorrect()); } - public void testPrivateInSuperInner1() throws Exception{ + public void testPrivateInSuperInner1() { JavaResolveResult result = advancedResolve(); assertNotNull(result.getElement()); assertTrue(result instanceof MethodCandidateInfo); assertTrue(result.isValidResult()); } - public void testProtectedM() throws Exception { + public void testProtectedM() { JavaResolveResult result = advancedResolve(); assertTrue(result.getElement() instanceof PsiMethod); assertFalse(result.isAccessible()); @@ -265,25 +259,25 @@ public class ResolveMethodTest extends ResolveTestCase { // assertTrue(result.isValidResult()); //} - public void testImplementOrder() throws Exception { + public void testImplementOrder() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); PsiMethod method = (PsiMethod) target; assertEquals("II", method.getContainingClass().getName()); } - public void testObjectVsInterface() throws Exception { + public void testObjectVsInterface() { PsiElement target = resolve(); assertTrue(target instanceof PsiMethod); PsiMethod method = (PsiMethod) target; assertEquals("PublicCloneable", method.getContainingClass().getName()); } - public void testMultipleInheritancePathsToMethod() throws Exception { - PsiReference ref = configureByFile("method/" + getTestName(false) + ".java"); + public void testMultipleInheritancePathsToMethod() { + PsiReference ref = findReferenceAtCaret("method/" + getTestName(false) + ".java"); // just assume this is called by some highlighting inspection/intention/pass before the resolve - getJavaFacade().findClass("NN").getAllMethods(); + myFixture.findClass("NN").getAllMethods(); PsiElement target = ref.resolve(); assertInstanceOf(target, PsiMethod.class); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java index dd9aa81426a0..0b56b238c24a 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolvePerformanceTest.java @@ -19,11 +19,13 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ex.PathManagerEx; import com.intellij.openapi.util.text.StringUtil; import com.intellij.openapi.vfs.LocalFileSystem; -import com.intellij.openapi.vfs.VfsUtil; +import com.intellij.openapi.vfs.VfsUtilCore; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.*; import com.intellij.psi.impl.source.resolve.ResolveCache; +import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.xml.XmlAttributeValue; +import com.intellij.testFramework.PlatformTestUtil; import com.intellij.testFramework.ResolveTestCase; import com.intellij.util.containers.ContainerUtil; @@ -40,7 +42,7 @@ public class ResolvePerformanceTest extends ResolveTestCase { //final int[] ints = new int[10000000]; System.gc(); - String fileText = StringUtil.convertLineSeparators(VfsUtil.loadText(vFile)); + String fileText = StringUtil.convertLineSeparators(VfsUtilCore.loadText(vFile)); myFile = createFile(vFile.getName(), fileText); myFile.accept(new JavaRecursiveElementWalkingVisitor(){ @Override public void visitReferenceExpression(PsiReferenceExpression expression){ @@ -75,7 +77,7 @@ public class ResolvePerformanceTest extends ResolveTestCase { final List references = new ArrayList<>(); assertNotNull("file " + fullPath + " not found", vFile); - String fileText = VfsUtil.loadText(vFile); + String fileText = VfsUtilCore.loadText(vFile); fileText = StringUtil.convertLineSeparators(fileText); myFile = createFile(vFile.getName(), fileText); myFile.accept(new XmlRecursiveElementVisitor(){ @@ -108,4 +110,46 @@ public class ResolvePerformanceTest extends ResolveTestCase { } } } + + public void testStaticImportInTheSameClassPerformance() throws Exception { + warmUpResolve(); + + PsiReference ref = configureByFile("class/" + getTestName(false) + ".java"); + ensureIndexUpToDate(); + PlatformTestUtil.startPerformanceTest(getTestName(false), 60, () -> assertNull(ref.resolve())) + .attempts(1).assertTiming(); + } + + private void ensureIndexUpToDate() { + getJavaFacade().findClass(CommonClassNames.JAVA_UTIL_LIST, GlobalSearchScope.allScope(myProject)); + } + + private void warmUpResolve() { + PsiJavaCodeReferenceElement ref = JavaPsiFacade.getElementFactory(myProject).createReferenceFromText("java.util.List", null); + JavaResolveResult result = ref.advancedResolve(false); + assertNotNull(result.getElement()); + assertSize(1, result.getSubstitutor().getSubstitutionMap().keySet()); + } + + public void testStaticImportNetworkPerformance() throws Exception { + warmUpResolve(); + + VirtualFile dir = createTempVfsDirectory(); + + PsiReference ref = configureByFile("class/" + getTestName(false) + ".java", dir); + int count = 15; + + StringBuilder imports = new StringBuilder(); + for (int i = 0; i < count; i++) { + imports.append("import static Foo").append(i).append(".*;\n"); + } + + for (int i = 0; i < count; i++) { + createFile(myModule, dir, "Foo" + i + ".java", imports + "class Foo" + i + " extends Bar1, Bar2, Bar3 {}"); + } + + ensureIndexUpToDate(); + PlatformTestUtil.startPerformanceTest(getTestName(false), 800, () -> assertNull(ref.resolve())) + .attempts(1).assertTiming(); + } } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVarargsMethodTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVarargsMethodTest.java index 98edbfbfaaa1..47dae051139b 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVarargsMethodTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVarargsMethodTest.java @@ -16,12 +16,20 @@ package com.intellij.java.psi.resolve; import com.intellij.psi.*; +import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.LightResolveTestCase; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; import static org.hamcrest.core.IsInstanceOf.instanceOf; import static org.junit.Assert.assertThat; -public class ResolveVarargsMethodTest extends Resolve15TestCase { +public class ResolveVarargsMethodTest extends LightResolveTestCase { + @NotNull + @Override + protected LightProjectDescriptor getProjectDescriptor() { + return JAVA_1_5; + } public void testPrimitiveObject() throws Exception { doTest(1); @@ -69,7 +77,7 @@ public class ResolveVarargsMethodTest extends Resolve15TestCase { } private PsiReference configureByFile() throws Exception { - return configureByFile("method/varargs/" + getTestName(false) + ".java"); + return findReferenceAtCaret("method/varargs/" + getTestName(false) + ".java"); } private static PsiMethod checkResolvesUnique(final PsiReference ref) { assertThat(ref, instanceOf(PsiReferenceExpression.class)); diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariable15Test.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariable15Test.java index ab40cb600e67..6a7ac50cdb28 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariable15Test.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariable15Test.java @@ -18,11 +18,19 @@ package com.intellij.java.psi.resolve; import com.intellij.psi.*; import com.intellij.psi.search.LocalSearchScope; import com.intellij.psi.search.SearchScope; +import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.LightResolveTestCase; +import org.jetbrains.annotations.NotNull; /** * @author ven */ -public class ResolveVariable15Test extends Resolve15TestCase { +public class ResolveVariable15Test extends LightResolveTestCase { + @NotNull + @Override + protected LightProjectDescriptor getProjectDescriptor() { + return JAVA_1_5; + } public void testDuplicateStaticImport() throws Exception { resolveTarget(); @@ -51,6 +59,6 @@ public class ResolveVariable15Test extends Resolve15TestCase { } private PsiReference configure() throws Exception { - return configureByFile("var15/" + getTestName(false) + ".java"); + return findReferenceAtCaret("var15/" + getTestName(false) + ".java"); } } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariableTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariableTest.java index 30788fbcc710..81dd0b63052c 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariableTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/ResolveVariableTest.java @@ -16,202 +16,200 @@ package com.intellij.java.psi.resolve; import com.intellij.psi.*; -import com.intellij.psi.search.GlobalSearchScope; +import com.intellij.testFramework.LightResolveTestCase; import com.intellij.testFramework.PlatformTestCase; -import com.intellij.testFramework.ResolveTestCase; @PlatformTestCase.WrapInCommand -public class ResolveVariableTest extends ResolveTestCase { - public void testAnonymousConstructorArg() throws Exception { +public class ResolveVariableTest extends LightResolveTestCase { + public void testAnonymousConstructorArg() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiParameter); assertEquals("value", ((PsiParameter)target).getName()); } - public void testLocalVariable1() throws Exception { + public void testLocalVariable1() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiLocalVariable); assertEquals("value", ((PsiLocalVariable)target).getName()); } - public void testVisibility1() throws Exception { + public void testVisibility1() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); assertEquals("variable", ((PsiField)target).getName()); } - public void testVisibility2() throws Exception { + public void testVisibility2() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); assertEquals("a", ((PsiField)target).getName()); } - private PsiElement configureAndResolve() throws Exception { + private PsiElement configureAndResolve() { PsiReference ref = configure(); - PsiElement target = ref.resolve(); - return target; + return ref.resolve(); } - public void testVisibility3() throws Exception { + public void testVisibility3() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); assertEquals("i", ((PsiField)target).getName()); } - public void testVisibility4() throws Exception { + public void testVisibility4() { PsiElement target = configureAndResolve(); assertEquals("a", ((PsiLocalVariable)target).getName()); assertTrue(target instanceof PsiLocalVariable); } - public void testQualified1() throws Exception { + public void testQualified1() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); assertEquals("a", ((PsiField)target).getName()); } - public void testQualified2() throws Exception { + public void testQualified2() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); assertEquals("a", ((PsiField)target).getName()); } - public void testQualified3() throws Exception { + public void testQualified3() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); assertEquals("a", ((PsiField)target).getName()); } - public void testQualified4() throws Exception { + public void testQualified4() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); assertEquals("a", ((PsiField)target).getName()); } - public void testUnresolved1() throws Exception { + public void testUnresolved1() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testFieldFromInterface() throws Exception { + public void testFieldFromInterface() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiField); } - public void testInterfaceConflict1() throws Exception { + public void testInterfaceConflict1() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testInterfaceConflict2() throws Exception { + public void testInterfaceConflict2() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testInterfaceConflict3() throws Exception { + public void testInterfaceConflict3() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testInterfaceConflict4() throws Exception { + public void testInterfaceConflict4() { PsiElement target = configureAndResolve(); assertNull(target); } // This is a bug but it's too hard to fix this :( // TODO: try to fix - public void dontTestInterfaceConflict5() throws Exception { + public void dontTestInterfaceConflict5() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testInterfaceConflict6() throws Exception { + public void testInterfaceConflict6() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testInterfaceConflict7() throws Exception { + public void testInterfaceConflict7() { PsiElement target = configureAndResolve(); assertNotNull(target); } - public void testInterfaceConflict8() throws Exception { + public void testInterfaceConflict8() { PsiElement target = configureAndResolve(); assertNotNull(target); } - public void testInterfaceConflict9() throws Exception { + public void testInterfaceConflict9() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testInterfaceConflict10() throws Exception { + public void testInterfaceConflict10() { PsiElement target = configureAndResolve(); assertNull(target); } - public void testArray1() throws Exception { + public void testArray1() { PsiElement target = configureAndResolve(); assertNotNull(target); } - public void testInterfaceConflict11() throws Exception { + public void testInterfaceConflict11() { PsiElement target = configureAndResolve(); assertNotNull(target); assertTrue(target instanceof PsiField); assertEquals("B", ((PsiField)target).getContainingClass().getName()); } - public void testBug7869() throws Exception { + public void testBug7869() { PsiElement target = configureAndResolve(); assertNotNull(target); } - public void testInner1() throws Exception { + public void testInner1() { PsiElement target = configureAndResolve(); assertNotNull(target); assertEquals("Inner1", ((PsiField)target).getContainingClass().getName()); } - public void testFieldsAndLocals() throws Exception { + public void testFieldsAndLocals() { PsiElement target = configureAndResolve(); assertTrue(target instanceof PsiLocalVariable); } - public void testPrivateOverloading() throws Exception { - PsiReference ref = configureByFile("var/PrivateOverloading.java"); + public void testPrivateOverloading() { + PsiReference ref = findReferenceAtCaret("var/PrivateOverloading.java"); final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); PsiElement target = result.getElement(); assertNotNull(target); assertFalse(result.isValidResult()); } - public void testVisibility6() throws Exception { - PsiReference ref = configureByFile("var/Visibility6.java"); + public void testVisibility6() { + PsiReference ref = findReferenceAtCaret("var/Visibility6.java"); final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); PsiElement target = result.getElement(); assertNotNull(target); assertFalse(result.isValidResult()); } - public void testVisibility7() throws Exception { - PsiReference ref = configureByFile("var/InnerPrivates1.java"); + public void testVisibility7() { + PsiReference ref = findReferenceAtCaret("var/InnerPrivates1.java"); final JavaResolveResult result = ((PsiJavaReference)ref).advancedResolve(true); PsiElement target = result.getElement(); assertNotNull(target); assertTrue(result.isValidResult()); } - public void testForeachParameter() throws Exception { - final PsiReference ref = configureByFile("var/ForeachParameter.java"); + public void testForeachParameter() { + final PsiReference ref = findReferenceAtCaret("var/ForeachParameter.java"); final PsiElement element = ref.resolve(); assertTrue(element instanceof PsiParameter); assertEquals("o", ((PsiParameter)element).getName()); assertTrue(element.getParent() instanceof PsiForeachStatement); } - public void testRefInSuper() throws Exception { - final PsiJavaReference ref = (PsiJavaReference)configureByFile("var/RefInSuper.java"); + public void testRefInSuper() { + final PsiJavaReference ref = (PsiJavaReference)findReferenceAtCaret("var/RefInSuper.java"); final JavaResolveResult resolveResult = ref.advancedResolve(false); assertTrue(resolveResult.isValidResult()); PsiElement currentFileResolveScope = resolveResult.getCurrentFileResolveScope(); @@ -222,8 +220,8 @@ public class ResolveVariableTest extends ResolveTestCase { assertEquals("i", ((PsiField)element).getName()); } - public void testRefInOuter() throws Exception { - final PsiJavaReference ref = (PsiJavaReference)configureByFile("var/RefInOuter.java"); + public void testRefInOuter() { + final PsiJavaReference ref = (PsiJavaReference)findReferenceAtCaret("var/RefInOuter.java"); final JavaResolveResult resolveResult = ref.advancedResolve(false); assertTrue(resolveResult.isValidResult()); PsiElement currentFileResolveScope = resolveResult.getCurrentFileResolveScope(); @@ -234,35 +232,35 @@ public class ResolveVariableTest extends ResolveTestCase { assertEquals("i", ((PsiField)element).getName()); } - public void testInheritedOuter() throws Exception { - final PsiJavaReference ref = (PsiJavaReference)configureByFile("var/InheritedOuter.java"); + public void testInheritedOuter() { + final PsiJavaReference ref = (PsiJavaReference)findReferenceAtCaret("var/InheritedOuter.java"); final JavaResolveResult resolveResult = ref.advancedResolve(false); assertTrue(resolveResult.isValidResult()); } - public void testStaticFieldsInInterfacesConflict() throws Exception { - final PsiJavaReference ref = (PsiJavaReference)configureByFile("var/FieldConflict.java"); + public void testStaticFieldsInInterfacesConflict() { + final PsiJavaReference ref = (PsiJavaReference)findReferenceAtCaret("var/FieldConflict.java"); final JavaResolveResult resolveResult = ref.advancedResolve(false); - assertTrue(!resolveResult.isValidResult()); + assertFalse(resolveResult.isValidResult()); final JavaResolveResult[] results = ref.multiResolve(false); assertEquals(2, results.length); } - public void testShadowFieldsInHierarchy() throws Exception { + public void testShadowFieldsInHierarchy() { final PsiJavaReference ref = (PsiJavaReference)configure(); final JavaResolveResult resolveResult = ref.advancedResolve(false); assertTrue(resolveResult.isValidResult()); - PsiField field = myJavaFacade.findClass("TestPage", GlobalSearchScope.allScope(getProject())).getFields()[0]; + PsiField field = myFixture.findClass("TestPage").getFields()[0]; assertEquals(field, resolveResult.getElement()); } - public void testShadowFieldsInHierarchy2() throws Exception { + public void testShadowFieldsInHierarchy2() { PsiElement ref = configureAndResolve(); assertTrue(ref instanceof PsiField); assertEquals("E", ((PsiField)ref).getContainingClass().getName()); } - private PsiReference configure() throws Exception { - return configureByFile("var/" + getTestName(false) + ".java"); + private PsiReference configure() { + return findReferenceAtCaret("var/" + getTestName(false) + ".java"); } } diff --git a/java/java-tests/testSrc/com/intellij/java/psi/resolve/TypeInferenceTest.java b/java/java-tests/testSrc/com/intellij/java/psi/resolve/TypeInferenceTest.java index 77035b83163e..bd15a081c635 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/resolve/TypeInferenceTest.java +++ b/java/java-tests/testSrc/com/intellij/java/psi/resolve/TypeInferenceTest.java @@ -16,17 +16,26 @@ package com.intellij.java.psi.resolve; import com.intellij.psi.*; +import com.intellij.testFramework.LightProjectDescriptor; +import com.intellij.testFramework.LightResolveTestCase; import org.jetbrains.annotations.NonNls; +import org.jetbrains.annotations.NotNull; /** * @author ven */ -public class TypeInferenceTest extends Resolve15TestCase { - public void testInferInCall1 () throws Exception { +public class TypeInferenceTest extends LightResolveTestCase { + @NotNull + @Override + protected LightProjectDescriptor getProjectDescriptor() { + return JAVA_1_5; + } + + public void testInferInCall1 () { doTestObject(); } - private void doTestObject() throws Exception { + private void doTestObject() { PsiReferenceExpression ref = configure(); PsiType type = ref.getType(); assertTrue(type instanceof PsiClassType); @@ -35,7 +44,7 @@ public class TypeInferenceTest extends Resolve15TestCase { assertEquals(CommonClassNames.JAVA_LANG_OBJECT, paramTypes[0].getCanonicalText()); } - public void testInferInAssign1 () throws Exception { + public void testInferInAssign1 () { PsiReferenceExpression ref = configure(); PsiType type = ref.getType(); assertTrue(type instanceof PsiClassType); @@ -44,19 +53,19 @@ public class TypeInferenceTest extends Resolve15TestCase { assertEquals( "java.lang.String", paramTypes[0].getCanonicalText()); } - public void testInferInAssign2() throws Exception { + public void testInferInAssign2() { doTestObject(); } - public void testInferInCast () throws Exception { + public void testInferInCast () { doTestObject(); } - public void testInferWithBounds () throws Exception { + public void testInferWithBounds () { checkResolvesTo("C.Inner"); } - public void testInferWithBounds1 () throws Exception { + public void testInferWithBounds1 () { PsiReferenceExpression ref = configure(); JavaResolveResult resolveResult = ref.advancedResolve(false); PsiSubstitutor substitutor = resolveResult.getSubstitutor(); @@ -65,102 +74,102 @@ public class TypeInferenceTest extends Resolve15TestCase { assertEquals("java.lang.String", type.getCanonicalText()); } - private PsiReferenceExpression configure() throws Exception { - return (PsiReferenceExpression)configureByFile("inference/" + getTestName(false) + ".java"); + private PsiReferenceExpression configure() { + return (PsiReferenceExpression)findReferenceAtCaret("inference/" + getTestName(false) + ".java"); } - public void testInferInParamsOnly () throws Exception { + public void testInferInParamsOnly () { checkResolvesTo("C.I"); } - public void testInferRawType () throws Exception { + public void testInferRawType () { checkResolvesTo(CommonClassNames.JAVA_LANG_OBJECT); } - private void checkResolvesTo(@NonNls String typeName) throws Exception { + private void checkResolvesTo(@NonNls String typeName) { PsiReferenceExpression ref = configure(); PsiType type = ref.getType(); assertNotNull(type); assertEquals(typeName, type.getCanonicalText()); } - public void testInferInSuperAssignment () throws Exception { + public void testInferInSuperAssignment () { checkResolvesTo("B"); } - public void testInferWithWildcards () throws Exception { + public void testInferWithWildcards () { checkResolvesTo("Collections.SelfComparable"); } - public void testInferWithWildcards1 () throws Exception { + public void testInferWithWildcards1 () { checkResolvesTo("java.lang.String"); } - public void testInferWithWildcards2 () throws Exception { + public void testInferWithWildcards2 () { checkResolvesTo("Collection"); } - public void testInferWithWildcards3 () throws Exception { + public void testInferWithWildcards3 () { checkResolvesTo("X.Y"); } - public void testInferWithWildcards4 () throws Exception { + public void testInferWithWildcards4 () { checkResolvesTo("X.Y"); } - public void testInferWithWildcards5 () throws Exception { + public void testInferWithWildcards5 () { checkResolvesTo("X.Y"); } - public void testInferInReturn () throws Exception { + public void testInferInReturn () { checkResolvesTo("T"); } - public void testInferAutoboxed () throws Exception { + public void testInferAutoboxed () { checkResolvesTo("java.lang.Integer"); } - public void testInferWithVarargs1 () throws Exception { + public void testInferWithVarargs1 () { checkResolvesTo("C2"); } - public void testInferWithVarargs2 () throws Exception { + public void testInferWithVarargs2 () { checkResolvesTo("C1"); } - public void testInferWithVarargs3 () throws Exception { + public void testInferWithVarargs3 () { checkResolvesTo("List"); } - public void testInferWithVarargs4 () throws Exception { + public void testInferWithVarargs4 () { checkResolvesTo("List"); } - public void testInferWithVarargs5 () throws Exception { + public void testInferWithVarargs5 () { checkResolvesTo("List"); } - public void testInferWithVarargs6 () throws Exception { + public void testInferWithVarargs6 () { checkResolvesTo("List"); } - public void testInferPrimitiveArray () throws Exception { + public void testInferPrimitiveArray () { checkResolvesTo("double[]"); } - public void testSCR41031 () throws Exception { + public void testSCR41031 () { checkResolvesTo("List"); } - public void testInferUnchecked () throws Exception { + public void testInferUnchecked () { checkResolvesTo(CommonClassNames.JAVA_LANG_OBJECT); } - public void testInferNotNull () throws Exception { + public void testInferNotNull () { checkResolvesTo("E"); } - public void testBoundComposition() throws Exception { + public void testBoundComposition() { checkResolvesTo("java.lang.Class"); } } diff --git a/java/testFramework/src/com/intellij/testFramework/LightResolveTestCase.java b/java/testFramework/src/com/intellij/testFramework/LightResolveTestCase.java new file mode 100644 index 000000000000..2fe40cdd22b3 --- /dev/null +++ b/java/testFramework/src/com/intellij/testFramework/LightResolveTestCase.java @@ -0,0 +1,20 @@ +// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +package com.intellij.testFramework; + +import com.intellij.openapi.application.ex.PathManagerEx; +import com.intellij.psi.PsiFile; +import com.intellij.psi.PsiReference; +import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase; +import org.jetbrains.annotations.NotNull; + +public abstract class LightResolveTestCase extends LightCodeInsightFixtureTestCase { + protected PsiReference findReferenceAtCaret(@NotNull String filePath) { + PsiFile file = myFixture.configureByFile(filePath); + return file.findReferenceAt(myFixture.getEditor().getCaretModel().getOffset()); + } + + @Override + protected String getTestDataPath() { + return PathManagerEx.getTestDataPath() + "/psi/resolve/"; + } +} \ No newline at end of file