diff --git a/java/java-impl/src/com/intellij/psi/filters/AnnotationParameterFilter.java b/java/java-impl/src/com/intellij/psi/filters/AnnotationParameterFilter.java deleted file mode 100644 index b7a6eab9f908..000000000000 --- a/java/java-impl/src/com/intellij/psi/filters/AnnotationParameterFilter.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.intellij.psi.filters; - -import com.intellij.psi.PsiAnnotation; -import com.intellij.psi.PsiAnnotationParameterList; -import com.intellij.psi.PsiElement; -import com.intellij.psi.PsiNameValuePair; -import com.intellij.util.ReflectionCache; -import org.jetbrains.annotations.NonNls; - -/** - * @author peter - */ -public class AnnotationParameterFilter implements ElementFilter{ - private final Class myClass; - @NonNls private final String myParameterName; - private final String myAnnotationQualifiedName; - - - public AnnotationParameterFilter(final Class elementClass, - final String annotationQualifiedName, - @NonNls final String parameterName) { - myAnnotationQualifiedName = annotationQualifiedName; - myClass = elementClass; - myParameterName = parameterName; - } - - @Override - public boolean isAcceptable(Object element, PsiElement context) { - final PsiElement parent = ((PsiElement)element).getParent(); - if (parent instanceof PsiNameValuePair) { - final PsiNameValuePair pair = (PsiNameValuePair)parent; - final String name = pair.getName(); - if (myParameterName.equals(name) || name == null && "value".equals(myParameterName)) { - final PsiElement psiElement = pair.getParent(); - if (psiElement instanceof PsiAnnotationParameterList) { - final PsiElement grandParent = psiElement.getParent(); - if (grandParent instanceof PsiAnnotation) { - if (myAnnotationQualifiedName.equals(((PsiAnnotation)grandParent).getQualifiedName())) { - return true; - } - } - } - } - } - return false; - } - - @Override - public boolean isClassAcceptable(Class hintClass) { - return ReflectionCache.isAssignable(myClass, hintClass); - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInCastTypeParameters-out.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInCastTypeParameters-out.java deleted file mode 100644 index 789404f0e818..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInCastTypeParameters-out.java +++ /dev/null @@ -1,7 +0,0 @@ - -public class Main { - - public static void main() { - x = (ProceedingJoinPoint> - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInCastTypeParameters.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInCastTypeParameters.java deleted file mode 100644 index 8f5880237eb2..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInCastTypeParameters.java +++ /dev/null @@ -1,7 +0,0 @@ - -public class Main { - - public static void main() { - x = (ProceedingJoinPoint> - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInMethodParameters-out.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInMethodParameters-out.java deleted file mode 100644 index 0fae50dd0fcc..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInMethodParameters-out.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Xxx { - - - -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInMethodParameters.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInMethodParameters.java deleted file mode 100644 index 3feb13009ce7..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsInMethodParameters.java +++ /dev/null @@ -1,5 +0,0 @@ -public class Xxx { - - - -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsWithRightContextInClassTypeParameters-out.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtendsWithRightContextInClassTypeParameters-out.java deleted file mode 100644 index 26c81ac928a3..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsWithRightContextInClassTypeParameters-out.java +++ /dev/null @@ -1,3 +0,0 @@ -class Foo A> { - -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsWithRightContextInClassTypeParameters.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtendsWithRightContextInClassTypeParameters.java deleted file mode 100644 index c90ad3278973..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtendsWithRightContextInClassTypeParameters.java +++ /dev/null @@ -1,3 +0,0 @@ -class Foo A> { - -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally-out.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally-out.java deleted file mode 100644 index 674fc428c5d9..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally-out.java +++ /dev/null @@ -1,12 +0,0 @@ - -public class Main { - - public static void main() { - try { - - } finally { - - } - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally.java deleted file mode 100644 index 81df57df6185..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally.java +++ /dev/null @@ -1,12 +0,0 @@ - -public class Main { - - public static void main() { - try { - - } final { - - } - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally1-out.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally1-out.java deleted file mode 100644 index edb1b9a8e4f9..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally1-out.java +++ /dev/null @@ -1,12 +0,0 @@ - -public class Main { - - public static void main() { - try { - - } finally { - - } - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally1.java b/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally1.java deleted file mode 100644 index 1cd4a6d72590..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/ExtraBracketAfterFinally1.java +++ /dev/null @@ -1,10 +0,0 @@ - -public class Main { - - public static void main() { - try { - - } final - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInIf-out.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInIf-out.java deleted file mode 100644 index 9fd613410a95..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInIf-out.java +++ /dev/null @@ -1,8 +0,0 @@ - -public class Main { - - public static void main() { - if (null) - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInIf.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInIf.java deleted file mode 100644 index 421cf16e078d..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInIf.java +++ /dev/null @@ -1,8 +0,0 @@ - -public class Main { - - public static void main() { - if (nu) - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall.java deleted file mode 100644 index be803489e216..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall.java +++ /dev/null @@ -1,7 +0,0 @@ -class Null { - public static void main(String[] argv) { - StringBuffer buf = new StringBuffer(); - - buf.append(nu); - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall2.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall2.java deleted file mode 100644 index 2233039cc872..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall2.java +++ /dev/null @@ -1,7 +0,0 @@ -class Null { - public static void main(String[] argv) { - StringBuffer buf = new StringBuffer(); - - buf.append(Null.nu); - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall2_After.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall2_After.java deleted file mode 100644 index 2233039cc872..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall2_After.java +++ /dev/null @@ -1,7 +0,0 @@ -class Null { - public static void main(String[] argv) { - StringBuffer buf = new StringBuffer(); - - buf.append(Null.nu); - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall_After.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall_After.java deleted file mode 100644 index 46fa66446e35..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInMethodCall_After.java +++ /dev/null @@ -1,7 +0,0 @@ -class Null { - public static void main(String[] argv) { - StringBuffer buf = new StringBuffer(); - - buf.append(null); - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInReturn-out.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInReturn-out.java deleted file mode 100644 index 69f514804340..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInReturn-out.java +++ /dev/null @@ -1,8 +0,0 @@ - -public class Main { - - public static Object main() { - return null - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/NullInReturn.java b/java/java-tests/testData/codeInsight/completion/keywords/NullInReturn.java deleted file mode 100644 index 503614beb68a..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/NullInReturn.java +++ /dev/null @@ -1,8 +0,0 @@ - -public class Main { - - public static Object main() { - return nu - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/TrueInVariableDeclaration-out.java b/java/java-tests/testData/codeInsight/completion/keywords/TrueInVariableDeclaration-out.java deleted file mode 100644 index c2f393fad7f6..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/TrueInVariableDeclaration-out.java +++ /dev/null @@ -1,8 +0,0 @@ - -public class Main { - - public static void main() { - boolean b = true - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/TrueInVariableDeclaration.java b/java/java-tests/testData/codeInsight/completion/keywords/TrueInVariableDeclaration.java deleted file mode 100644 index 13ee5ed52f3b..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/TrueInVariableDeclaration.java +++ /dev/null @@ -1,8 +0,0 @@ - -public class Main { - - public static void main() { - boolean b = tr - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/catch-1.java b/java/java-tests/testData/codeInsight/completion/keywords/catch-1.java deleted file mode 100644 index ba5ce5703432..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/catch-1.java +++ /dev/null @@ -1,8 +0,0 @@ -public class A{ - public void method(){ - try{ - String str = ""; - } - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/catchFinally.java b/java/java-tests/testData/codeInsight/completion/keywords/catchFinally.java new file mode 100644 index 000000000000..f724d93396b2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/catchFinally.java @@ -0,0 +1,23 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + try{ + String str = ""; + } + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/classScope-4.java b/java/java-tests/testData/codeInsight/completion/keywords/classScope-4.java deleted file mode 100644 index 0f6c3fdac00e..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/classScope-4.java +++ /dev/null @@ -1,3 +0,0 @@ -class A{ - -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/classScope-1.java b/java/java-tests/testData/codeInsight/completion/keywords/classScope1.java similarity index 100% rename from java/java-tests/testData/codeInsight/completion/keywords/classScope-1.java rename to java/java-tests/testData/codeInsight/completion/keywords/classScope1.java diff --git a/java/java-tests/testData/codeInsight/completion/keywords/classScope-2.java b/java/java-tests/testData/codeInsight/completion/keywords/classScope2.java similarity index 100% rename from java/java-tests/testData/codeInsight/completion/keywords/classScope-2.java rename to java/java-tests/testData/codeInsight/completion/keywords/classScope2.java diff --git a/java/java-tests/testData/codeInsight/completion/keywords/classScope-3.java b/java/java-tests/testData/codeInsight/completion/keywords/classScope3.java similarity index 100% rename from java/java-tests/testData/codeInsight/completion/keywords/classScope-3.java rename to java/java-tests/testData/codeInsight/completion/keywords/classScope3.java diff --git a/java/java-tests/testData/codeInsight/completion/keywords/classScope4.java b/java/java-tests/testData/codeInsight/completion/keywords/classScope4.java new file mode 100644 index 000000000000..24e7bfbbaea6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/classScope4.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-1.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-1.java deleted file mode 100644 index a928948d81c7..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-1.java +++ /dev/null @@ -1 +0,0 @@ -class x3 diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-10-result.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-10-result.java deleted file mode 100644 index 9a954ae8b337..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-10-result.java +++ /dev/null @@ -1,3 +0,0 @@ -class A{ - void >foo(){} -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-10.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-10.java deleted file mode 100644 index 68da0e944b46..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-10.java +++ /dev/null @@ -1,3 +0,0 @@ -class A{ - void >foo(){} -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-11-result.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-11-result.java deleted file mode 100644 index 87e818a076c7..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-11-result.java +++ /dev/null @@ -1,3 +0,0 @@ -class A{ - void >foo(){} -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-11.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-11.java deleted file mode 100644 index a8e5fc0e9df5..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-11.java +++ /dev/null @@ -1,3 +0,0 @@ -class A{ - void >foo(){} -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-12-result.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-12-result.java deleted file mode 100644 index 7127a5250e35..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-12-result.java +++ /dev/null @@ -1,5 +0,0 @@ -class A{ - { - Collection> - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-12.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-12.java deleted file mode 100644 index 2cc23359731c..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-12.java +++ /dev/null @@ -1,5 +0,0 @@ -class A{ - { - Collection> - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-2.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-2.java deleted file mode 100644 index 41399187fe37..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-2.java +++ /dev/null @@ -1,3 +0,0 @@ -class AAA{} - -class BBB extends diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-3.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-3.java deleted file mode 100644 index ce7fb1225cdc..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-3.java +++ /dev/null @@ -1,5 +0,0 @@ -class AAA{} - -interface CCC{} - -class BBB extends diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-4.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-4.java deleted file mode 100644 index ac0b51bfe351..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-4.java +++ /dev/null @@ -1,5 +0,0 @@ -class AAA{} - -interface CCC{} - -class BBB implements diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-5.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-5.java deleted file mode 100644 index ca5ec8e7c471..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-5.java +++ /dev/null @@ -1,3 +0,0 @@ -class AAA{} - -interface BBB extends diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-6.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-6.java deleted file mode 100644 index 4308b6710ec4..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-6.java +++ /dev/null @@ -1,3 +0,0 @@ -interface AAA{} - -interface BBB extends Runnable, diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-7-result.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-7-result.java deleted file mode 100644 index e768367d0430..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-7-result.java +++ /dev/null @@ -1,3 +0,0 @@ -class AAA{} - -class BBB extends AAA implements diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-7.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-7.java deleted file mode 100644 index 20b561ac6ce6..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-7.java +++ /dev/null @@ -1,3 +0,0 @@ -class AAA{} - -class BBB extends AAA i diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-8-result.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-8-result.java deleted file mode 100644 index 46fe4caea6dc..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-8-result.java +++ /dev/null @@ -1,4 +0,0 @@ -class AAA{} - -class BBB extends AAA implements { -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-8.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-8.java deleted file mode 100644 index 80dbed368970..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-8.java +++ /dev/null @@ -1,4 +0,0 @@ -class AAA{} - -class BBB extends AAA i { -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-9-result.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-9-result.java deleted file mode 100644 index 0a95953cba7d..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-9-result.java +++ /dev/null @@ -1 +0,0 @@ -interface AAAA extends \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends-9.java b/java/java-tests/testData/codeInsight/completion/keywords/extends-9.java deleted file mode 100644 index bd85a41f7537..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/extends-9.java +++ /dev/null @@ -1 +0,0 @@ -interface AAAA e \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends1.java b/java/java-tests/testData/codeInsight/completion/keywords/extends1.java new file mode 100644 index 000000000000..f3a5b845b5e5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends1.java @@ -0,0 +1,16 @@ +/* + * Copyright 2000-2012 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. + */ +class x3 diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends10.java b/java/java-tests/testData/codeInsight/completion/keywords/extends10.java new file mode 100644 index 000000000000..3e32612445b9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends10.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + void >foo(){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends10_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extends10_after.java new file mode 100644 index 000000000000..ad63c3ba7526 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends10_after.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + void >foo(){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends11.java b/java/java-tests/testData/codeInsight/completion/keywords/extends11.java new file mode 100644 index 000000000000..a7cd5d64107c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends11.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + void >foo(){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends11_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extends11_after.java new file mode 100644 index 000000000000..201aa5f1bd61 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends11_after.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + void >foo(){} +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends12.java b/java/java-tests/testData/codeInsight/completion/keywords/extends12.java new file mode 100644 index 000000000000..880b0ebb132a --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends12.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + { + Collection> + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends12_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extends12_after.java new file mode 100644 index 000000000000..7cf4bae3bd8c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends12_after.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + { + Collection> + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends2.java b/java/java-tests/testData/codeInsight/completion/keywords/extends2.java new file mode 100644 index 000000000000..e00ac4c968aa --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends2.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +class BBB extends diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends3.java b/java/java-tests/testData/codeInsight/completion/keywords/extends3.java new file mode 100644 index 000000000000..00e012ba9122 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends3.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +interface CCC{} + +class BBB extends diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends4.java b/java/java-tests/testData/codeInsight/completion/keywords/extends4.java new file mode 100644 index 000000000000..0e7697bab3d7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends4.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +interface CCC{} + +class BBB implements diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends5.java b/java/java-tests/testData/codeInsight/completion/keywords/extends5.java new file mode 100644 index 000000000000..cfec9d75e436 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends5.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +interface BBB extends diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends6.java b/java/java-tests/testData/codeInsight/completion/keywords/extends6.java new file mode 100644 index 000000000000..cfffdb15a989 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends6.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +interface AAA{} + +interface BBB extends Runnable, diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends7.java b/java/java-tests/testData/codeInsight/completion/keywords/extends7.java new file mode 100644 index 000000000000..3fb696c697b6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends7.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +class BBB extends AAA i diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends7_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extends7_after.java new file mode 100644 index 000000000000..3788648411f3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends7_after.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +class BBB extends AAA implements diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends8.java b/java/java-tests/testData/codeInsight/completion/keywords/extends8.java new file mode 100644 index 000000000000..867fef89c73e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends8.java @@ -0,0 +1,19 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +class BBB extends AAA i { +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends8_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extends8_after.java new file mode 100644 index 000000000000..ea7a94e5fbd8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends8_after.java @@ -0,0 +1,19 @@ +/* + * Copyright 2000-2012 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. + */ +class AAA{} + +class BBB extends AAA implements { +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends9.java b/java/java-tests/testData/codeInsight/completion/keywords/extends9.java new file mode 100644 index 000000000000..37cf1f210eb9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends9.java @@ -0,0 +1,16 @@ +/* + * Copyright 2000-2012 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. + */ +interface AAAA e \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extends9_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extends9_after.java new file mode 100644 index 000000000000..71f1777543af --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extends9_after.java @@ -0,0 +1,16 @@ +/* + * Copyright 2000-2012 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. + */ +interface AAAA extends \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extendsInCastTypeParameters.java b/java/java-tests/testData/codeInsight/completion/keywords/extendsInCastTypeParameters.java new file mode 100644 index 000000000000..78fb3e9f244f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extendsInCastTypeParameters.java @@ -0,0 +1,22 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + x = (ProceedingJoinPoint> + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extendsInCastTypeParameters_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extendsInCastTypeParameters_after.java new file mode 100644 index 000000000000..4a001127b4c4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extendsInCastTypeParameters_after.java @@ -0,0 +1,22 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + x = (ProceedingJoinPoint> + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extendsInMethodParameters.java b/java/java-tests/testData/codeInsight/completion/keywords/extendsInMethodParameters.java new file mode 100644 index 000000000000..6c467e38d4b4 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extendsInMethodParameters.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class Xxx { + + + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extendsInMethodParameters_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extendsInMethodParameters_after.java new file mode 100644 index 000000000000..694dba7dfe6d --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extendsInMethodParameters_after.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class Xxx { + + + +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extendsWithRightContextInClassTypeParameters.java b/java/java-tests/testData/codeInsight/completion/keywords/extendsWithRightContextInClassTypeParameters.java new file mode 100644 index 000000000000..30922b7a97ee --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extendsWithRightContextInClassTypeParameters.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class Foo A> { + +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extendsWithRightContextInClassTypeParameters_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extendsWithRightContextInClassTypeParameters_after.java new file mode 100644 index 000000000000..ef03219243ba --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extendsWithRightContextInClassTypeParameters_after.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +class Foo A> { + +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally1.java b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally1.java new file mode 100644 index 000000000000..6a9f7502fbf0 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally1.java @@ -0,0 +1,27 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + try { + + } final { + + } + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally1_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally1_after.java new file mode 100644 index 000000000000..43512dd5bbd9 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally1_after.java @@ -0,0 +1,27 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + try { + + } finally { + + } + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally2.java b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally2.java new file mode 100644 index 000000000000..f1e428987e7c --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally2.java @@ -0,0 +1,25 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + try { + + } final + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally2_after.java b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally2_after.java new file mode 100644 index 000000000000..b99df3c0b2bb --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/extraBracketAfterFinally2_after.java @@ -0,0 +1,27 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + try { + + } finally { + + } + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/fileScope-2.java b/java/java-tests/testData/codeInsight/completion/keywords/fileScope-2.java deleted file mode 100644 index faee6dcb6f1d..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/fileScope-2.java +++ /dev/null @@ -1,3 +0,0 @@ -package myPackage; - - diff --git a/java/java-tests/testData/codeInsight/completion/keywords/fileScope-1.java b/java/java-tests/testData/codeInsight/completion/keywords/fileScope1.java similarity index 100% rename from java/java-tests/testData/codeInsight/completion/keywords/fileScope-1.java rename to java/java-tests/testData/codeInsight/completion/keywords/fileScope1.java diff --git a/java/java-tests/testData/codeInsight/completion/keywords/fileScope2.java b/java/java-tests/testData/codeInsight/completion/keywords/fileScope2.java new file mode 100644 index 000000000000..e70c35c71309 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/fileScope2.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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 myPackage; + + diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceOf1.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf1.java new file mode 100644 index 000000000000..c4ef6c7c1fc8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf1.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + boolean x = this i + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceOf1_after.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf1_after.java new file mode 100644 index 000000000000..344f74e8f6ed --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf1_after.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + boolean x = this instanceof + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceOf2.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf2.java new file mode 100644 index 000000000000..a60c70ad806e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf2.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + boolean x = super + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceOf2_after.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf2_after.java new file mode 100644 index 000000000000..a60c70ad806e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf2_after.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + boolean x = super + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceOf3.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf3.java new file mode 100644 index 000000000000..fd6e661eb147 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf3.java @@ -0,0 +1,21 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + String str = ""; + boolean x = str i + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceOf3_after.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf3_after.java new file mode 100644 index 000000000000..a2bac477b6b5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/instanceOf3_after.java @@ -0,0 +1,21 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + String str = ""; + boolean x = str instanceof + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-1-result.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceof-1-result.java deleted file mode 100644 index b86936886d2b..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-1-result.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(){ - boolean x = this instanceof - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-1.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceof-1.java deleted file mode 100644 index 0204407f2cb8..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-1.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(){ - boolean x = this i - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-2-result.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceof-2-result.java deleted file mode 100644 index b42010d5d531..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-2-result.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(){ - boolean x = super - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-2.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceof-2.java deleted file mode 100644 index b42010d5d531..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-2.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(){ - boolean x = super - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-3-result.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceof-3-result.java deleted file mode 100644 index 9bc7e1cd03ba..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-3-result.java +++ /dev/null @@ -1,6 +0,0 @@ -public class A{ - public void method(){ - String str = ""; - boolean x = str instanceof - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-3.java b/java/java-tests/testData/codeInsight/completion/keywords/instanceof-3.java deleted file mode 100644 index 4cb057454774..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/instanceof-3.java +++ /dev/null @@ -1,6 +0,0 @@ -public class A{ - public void method(){ - String str = ""; - boolean x = str i - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-1.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope-1.java deleted file mode 100644 index 640faaa19d11..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-1.java +++ /dev/null @@ -1,3 +0,0 @@ -public class A{ - public void method() {} -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-2.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope-2.java deleted file mode 100644 index 965cfb800962..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-2.java +++ /dev/null @@ -1,4 +0,0 @@ -public class A{ - public void method(){ - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-3.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope-3.java deleted file mode 100644 index dd99cb703a23..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-3.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(){ - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-4.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope-4.java deleted file mode 100644 index dd99cb703a23..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-4.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(){ - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-5-out.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope-5-out.java deleted file mode 100644 index 5ee694dc44d2..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-5-out.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(final String){ - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-5.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope-5.java deleted file mode 100644 index 93adde13ad59..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/methodScope-5.java +++ /dev/null @@ -1,5 +0,0 @@ -public class A{ - public void method(fi String){ - - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope1.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope1.java new file mode 100644 index 000000000000..1afc320d3736 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/methodScope1.java @@ -0,0 +1,18 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method() {} +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope2.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope2.java new file mode 100644 index 000000000000..e6492ad07981 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/methodScope2.java @@ -0,0 +1,19 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope3.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope3.java new file mode 100644 index 000000000000..b7dc464e92a8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/methodScope3.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope4.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope4.java new file mode 100644 index 000000000000..b7dc464e92a8 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/methodScope4.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(){ + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope5.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope5.java new file mode 100644 index 000000000000..685c9f478ad6 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/methodScope5.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(fi String){ + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/methodScope5_after.java b/java/java-tests/testData/codeInsight/completion/keywords/methodScope5_after.java new file mode 100644 index 000000000000..a270c75c12f5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/methodScope5_after.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +public class A{ + public void method(final String){ + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInIf.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInIf.java new file mode 100644 index 000000000000..92a0dfedc82b --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInIf.java @@ -0,0 +1,23 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + if (nu) + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInIf_after.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInIf_after.java new file mode 100644 index 000000000000..b538755def32 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInIf_after.java @@ -0,0 +1,23 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + if (null) + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall.java new file mode 100644 index 000000000000..665f58fd6db3 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall.java @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2012 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. + */ +class Null { + public static void main(String[] argv) { + StringBuffer buf = new StringBuffer(); + + buf.append(nu); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall2.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall2.java new file mode 100644 index 000000000000..bd1e40d515d5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall2.java @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2012 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. + */ +class Null { + public static void main(String[] argv) { + StringBuffer buf = new StringBuffer(); + + buf.append(Null.nu); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall2_after.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall2_after.java new file mode 100644 index 000000000000..bd1e40d515d5 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall2_after.java @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2012 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. + */ +class Null { + public static void main(String[] argv) { + StringBuffer buf = new StringBuffer(); + + buf.append(Null.nu); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall_after.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall_after.java new file mode 100644 index 000000000000..53129988b57e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInMethodCall_after.java @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2012 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. + */ +class Null { + public static void main(String[] argv) { + StringBuffer buf = new StringBuffer(); + + buf.append(null); + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInReturn.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInReturn.java new file mode 100644 index 000000000000..79fdea866365 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInReturn.java @@ -0,0 +1,23 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static Object main() { + return nu + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/nullInReturn_after.java b/java/java-tests/testData/codeInsight/completion/keywords/nullInReturn_after.java new file mode 100644 index 000000000000..465b5e7a0067 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/nullInReturn_after.java @@ -0,0 +1,23 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static Object main() { + return null + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/super-1.java b/java/java-tests/testData/codeInsight/completion/keywords/super-1.java deleted file mode 100644 index 4450560b5f94..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/super-1.java +++ /dev/null @@ -1,7 +0,0 @@ -class B{ - class A{ - { - B. - } - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/super-2.java b/java/java-tests/testData/codeInsight/completion/keywords/super-2.java deleted file mode 100644 index 390b24a570d5..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/super-2.java +++ /dev/null @@ -1,5 +0,0 @@ -class A{ - { - String. - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/super1.java b/java/java-tests/testData/codeInsight/completion/keywords/super1.java new file mode 100644 index 000000000000..43c488caa888 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/super1.java @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2012 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. + */ +class B{ + class A{ + { + B. + } + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/super2.java b/java/java-tests/testData/codeInsight/completion/keywords/super2.java new file mode 100644 index 000000000000..1780ecb2ef57 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/super2.java @@ -0,0 +1,20 @@ +/* + * Copyright 2000-2012 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. + */ +class A{ + { + String. + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-1-result.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized-1-result.java deleted file mode 100644 index f9fb47045945..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-1-result.java +++ /dev/null @@ -1,7 +0,0 @@ -class A { - void foo () { - new Runnable () { - public synchronized - }; - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-1.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized-1.java deleted file mode 100644 index 692b71b7b8d1..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-1.java +++ /dev/null @@ -1,7 +0,0 @@ -class A { - void foo () { - new Runnable () { - public synch - }; - } -} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-2-result.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized-2-result.java deleted file mode 100644 index 859333d08a32..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-2-result.java +++ /dev/null @@ -1,6 +0,0 @@ -class Test { - void foo() { - if (true) { - } else synchronized() - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-2.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized-2.java deleted file mode 100644 index e2e5fe775cfb..000000000000 --- a/java/java-tests/testData/codeInsight/completion/keywords/synchronized-2.java +++ /dev/null @@ -1,6 +0,0 @@ -class Test { - void foo() { - if (true) { - } else syn - } -} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized1.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized1.java new file mode 100644 index 000000000000..e00064cce802 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/synchronized1.java @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2012 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. + */ +class A { + void foo () { + new Runnable () { + public synch + }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized1_after.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized1_after.java new file mode 100644 index 000000000000..519a52c66ec7 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/synchronized1_after.java @@ -0,0 +1,22 @@ +/* + * Copyright 2000-2012 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. + */ +class A { + void foo () { + new Runnable () { + public synchronized + }; + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized2.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized2.java new file mode 100644 index 000000000000..d3ae6e142650 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/synchronized2.java @@ -0,0 +1,21 @@ +/* + * Copyright 2000-2012 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. + */ +class Test { + void foo() { + if (true) { + } else syn + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/synchronized2_after.java b/java/java-tests/testData/codeInsight/completion/keywords/synchronized2_after.java new file mode 100644 index 000000000000..ef913dbd183e --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/synchronized2_after.java @@ -0,0 +1,21 @@ +/* + * Copyright 2000-2012 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. + */ +class Test { + void foo() { + if (true) { + } else synchronized() + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/trueInVariableDeclaration.java b/java/java-tests/testData/codeInsight/completion/keywords/trueInVariableDeclaration.java new file mode 100644 index 000000000000..2a64ecfaf2c2 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/trueInVariableDeclaration.java @@ -0,0 +1,23 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + boolean b = tr + + } +} diff --git a/java/java-tests/testData/codeInsight/completion/keywords/trueInVariableDeclaration_after.java b/java/java-tests/testData/codeInsight/completion/keywords/trueInVariableDeclaration_after.java new file mode 100644 index 000000000000..f202474e1e6f --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/keywords/trueInVariableDeclaration_after.java @@ -0,0 +1,23 @@ + +/* + * Copyright 2000-2012 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. + */ +public class Main { + + public static void main() { + boolean b = true + + } +} diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java b/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java index 5885f56d7787..26aca320322a 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/KeywordCompletionTest.java @@ -1,244 +1,109 @@ +/* + * Copyright 2000-2012 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.intellij.codeInsight.completion; import com.intellij.JavaTestUtil; import com.intellij.psi.codeStyle.CodeStyleSettingsManager; +import org.jetbrains.annotations.NonNls; /** - * Created by IntelliJ IDEA. - * User: ik - * Date: 20.02.2003 - * Time: 15:49:56 - * To change this template use Options | File Templates. + * @author ik + * @since 20.02.2003 */ public class KeywordCompletionTest extends LightCompletionTestCase { private static final String BASE_PATH = "/codeInsight/completion/keywords"; + private static final String[] FILE_SCOPE_KEYWORDS = new String[]{ + "package", "public", "private", "import", "final", "class", "interface", "abstract", "enum", null}; + private static final String[] CLASS_SCOPE_KEYWORDS = new String[]{ + "public", "private", "protected", "import", "final", "class", "interface", "abstract", "enum", null}; + private static final String[] CLASS_SCOPE_KEYWORDS_2 = new String[]{ + "package", "public", "private", "protected", "transient", "volatile", "static", "import", "final", "class", "interface", "abstract"}; + @Override protected String getTestDataPath() { return JavaTestUtil.getJavaTestDataPath(); } - private static final String[] ourPackageScopeKeywords = - new String[]{"package", "public", "private", "import", "final", "class", "interface", "abstract", "enum", null}; + public void testFileScope1() throws Exception { doTest(8, FILE_SCOPE_KEYWORDS); } + public void testFileScope2() throws Exception { doTest(7, CLASS_SCOPE_KEYWORDS); } + public void testClassScope1() throws Exception { doTest(5, CLASS_SCOPE_KEYWORDS); } + public void testClassScope2() throws Exception { doTest(4, CLASS_SCOPE_KEYWORDS); } + public void testClassScope3() throws Exception { doTest(0, CLASS_SCOPE_KEYWORDS); } + public void testClassScope4() throws Exception { doTest(10, CLASS_SCOPE_KEYWORDS_2); } + public void testAfterAnnotations() throws Exception { doTest(6, "public", "final", "class", "interface", "abstract", "enum", null); } + public void testExtends1() throws Exception { doTest(2, "extends", "implements", null); } + public void testExtends2() throws Exception { doTest(1, "extends", "implements", "AAA", "BBB", "instanceof"); } + public void testExtends3() throws Exception { doTest(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); } + public void testExtends4() throws Exception { doTest(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); } + public void testExtends5() throws Exception { doTest(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); } + public void testExtends6() throws Exception { doTest(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); } + public void testExtends7() throws Exception { doTest(false); } + public void testExtends8() throws Exception { doTest(false); } + public void testExtends9() throws Exception { doTest(false); } + public void testExtends10() throws Exception { doTest(false); } + public void testExtends11() throws Exception { doTest(false); } + public void testExtends12() throws Exception { doTest(false); } + public void testSynchronized1() throws Exception { doTest(false); } - public void testModifiersFileScope_1() throws Exception { - configureByFile(BASE_PATH + "/fileScope-1.java"); - testByCount(8, ourPackageScopeKeywords); - } - - private static final String[] ourClassScopeKeywords = - new String[]{"public", "private", "protected", "import", "final", "class", "interface", "abstract", "enum", null}; - - public void testModifiersFileScope_2() throws Exception { - configureByFile(BASE_PATH + "/fileScope-2.java"); - testByCount(7, ourClassScopeKeywords); - } - - public void testModifiersClassScope_1() throws Exception { - configureByFile(BASE_PATH + "/classScope-1.java"); - testByCount(5, ourClassScopeKeywords); - } - - public void testModifiersClassScope_2() throws Exception { - configureByFile(BASE_PATH + "/classScope-2.java"); - testByCount(4, ourClassScopeKeywords); - } - - public void testModifiersClassScope_3() throws Exception { - configureByFile(BASE_PATH + "/classScope-3.java"); - testByCount(0, ourClassScopeKeywords); - } - - public void testAfterAnnotations() throws Exception { - configureByFile(BASE_PATH + "/afterAnnotations.java"); - testByCount(6, "public", "final", "class", "interface", "abstract", "enum", null); - } - - public void testExtends_1() throws Exception { - configureByFile(BASE_PATH + "/extends-1.java"); - testByCount(2, "extends", "implements", null); - } - - public void testExtends_2() throws Exception { - configureByFile(BASE_PATH + "/extends-2.java"); - testByCount(1, "extends", "implements", "AAA", "BBB", "instanceof"); - } - - public void testExtends_3() throws Exception { - configureByFile(BASE_PATH + "/extends-3.java"); - testByCount(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); - } - - public void testExtends_4() throws Exception { - configureByFile(BASE_PATH + "/extends-4.java"); - testByCount(2, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); - } - - public void testExtends_5() throws Exception { - configureByFile(BASE_PATH + "/extends-5.java"); - testByCount(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); - } - - public void testExtends_6() throws Exception { - configureByFile(BASE_PATH + "/extends-6.java"); - testByCount(1, "extends", "implements", "AAA", "BBB", "CCC", "instanceof"); - } - - public void testExtends_7() throws Exception { - configureByFile(BASE_PATH + "/extends-7.java"); - checkResultByFile(BASE_PATH + "/extends-7-result.java"); - } - - public void testExtends_8() throws Exception { - configureByFile(BASE_PATH + "/extends-8.java"); - checkResultByFile(BASE_PATH + "/extends-8-result.java"); - } - - public void testExtends_9() throws Exception { - configureByFile(BASE_PATH + "/extends-9.java"); - checkResultByFile(BASE_PATH + "/extends-9-result.java"); - } - - public void testExtends_10() throws Exception { - configureByFile(BASE_PATH + "/extends-10.java"); - checkResultByFile(BASE_PATH + "/extends-10-result.java"); - } - - public void testExtends_11() throws Exception { - configureByFile(BASE_PATH + "/extends-11.java"); - checkResultByFile(BASE_PATH + "/extends-11-result.java"); - } - - public void testExtends_12() throws Exception { - configureByFile(BASE_PATH + "/extends-12.java"); - checkResultByFile(BASE_PATH + "/extends-12-result.java"); - } - - public void testSynchronized_1() throws Exception { - configureByFile(BASE_PATH + "/synchronized-1.java"); - checkResultByFile(BASE_PATH + "/synchronized-1-result.java"); - } - - public void testSynchronized_2() throws Exception { + public void testSynchronized2() throws Exception { CodeStyleSettingsManager.getSettings(getProject()).SPACE_BEFORE_SYNCHRONIZED_PARENTHESES = false; - configureByFile(BASE_PATH + "/synchronized-2.java"); - checkResultByFile(BASE_PATH + "/synchronized-2-result.java"); + doTest(false); } - public void testModifiersClassScope() throws Exception{ - configureByFile(BASE_PATH + "/classScope-4.java"); - testByCount(10, "package", "public", "private", "protected", "transient", "volatile", "static", "import", "final", "class", "interface", - "abstract"); - } + public void testMethodScope1() throws Exception { doTest(1, "throws"); } + public void testMethodScope2() throws Exception { doTest(1, "final", "public", "static", "volatile", "abstract"); } + public void testMethodScope3() throws Exception { doTest(1, "final", "public", "static", "volatile", "abstract", "throws", "instanceof"); } + public void testMethodScope4() throws Exception { doTest(6, "final", "try", "for", "while", "return", "throw"); } + public void testMethodScope5() throws Exception { doTest(false); } + public void testExtraBracketAfterFinally1() throws Exception { doTest(true); } + public void testExtraBracketAfterFinally2() throws Exception { doTest(true); } + public void testExtendsInCastTypeParameters() throws Exception { doTest(false); } + public void testExtendsWithRightContextInClassTypeParameters() throws Exception { doTest(false); } + public void testTrueInVariableDeclaration() throws Exception { doTest(false); } + public void testNullInIf() throws Exception { doTest(false); } + public void testNullInReturn() throws Exception { doTest(false); } + public void testExtendsInMethodParameters() throws Exception { doTest(false); } + public void testInstanceOf1() throws Exception { doTest(false); } + public void testInstanceOf2() throws Exception { doTest(false); } + public void testInstanceOf3() throws Exception { doTest(false); } + public void testCatchFinally() throws Exception { doTest(2, "catch", "finally"); } + public void testSuper1() throws Exception { doTest(1, "super"); } + public void testSuper2() throws Exception { doTest(0, "super"); } + public void testContinue() throws Exception { doTest(false); } + public void testThrowsOnSeparateLine() throws Exception { doTest(false); } + public void testDefaultInAnno() throws Exception { doTest(false); } + public void testNullInMethodCall() throws Exception { doTest(false); } + public void testNullInMethodCall2() throws Exception { doTest(false); } - public void testMethodThrows() throws Exception{ - configureByFile(BASE_PATH + "/methodScope-1.java"); - testByCount(1, "throws"); - } - - public void testModifiersInMethodScope_1() throws Exception{ - configureByFile(BASE_PATH + "/methodScope-2.java"); - testByCount(1, "final", "public", "static", "volatile", "abstract"); - } - - public void testModifiersInMethodScope_2() throws Exception{ - configureByFile(BASE_PATH + "/methodScope-3.java"); - testByCount(1, "final", "public", "static", "volatile", "abstract", "throws", "instanceof"); - } - - public void testModifiersInMethodScope_3() throws Exception{ - configureByFile(BASE_PATH + "/methodScope-4.java"); - testByCount(6, "final", "try", "for", "while", "return", "throw"); - } - - public void testModifiersInMethodScope_5() throws Exception{ - configureByFile(BASE_PATH + "/methodScope-5.java"); - checkResultByFile(BASE_PATH + "/methodScope-5-out.java"); - } - - public void testExtendsInCastTypeParameters() throws Throwable { doTest(); } - public void testExtendsWithRightContextInClassTypeParameters() throws Throwable { doTest(); } - - public void testExtraBracketAfterFinally() throws Throwable { - configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); - selectItem(myItems[1]); - checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); - } - - public void testExtraBracketAfterFinally1() throws Throwable { - configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); - selectItem(myItems[1]); - checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); - } - - public void testTrueInVariableDeclaration() throws Throwable { doTest(); } - public void testNullInIf() throws Throwable { doTest(); } - public void testNullInReturn() throws Throwable { doTest(); } - - public void testExtendsInMethodParameters() throws Throwable { doTest(); } - - private void doTest() throws Exception { - configureByFile(BASE_PATH + "/" + getTestName(false) + ".java"); - checkResultByFile(BASE_PATH + "/" + getTestName(false) + "-out.java"); - } - - public void testInstanceOf_1() throws Exception{ - configureByFile(BASE_PATH + "/instanceof-1.java"); - checkResultByFile(BASE_PATH + "/instanceof-1-result.java"); - //testByCount(new String[]{"instanceof"}, 1); - } - - public void testInstanceOf_2() throws Exception{ - configureByFile(BASE_PATH + "/instanceof-2.java"); - checkResultByFile(BASE_PATH + "/instanceof-2-result.java"); - //testByCount(new String[]{"instanceof"}, 1); - } - - public void testInstanceOf_3() throws Exception{ - configureByFile(BASE_PATH + "/instanceof-3.java"); - checkResultByFile(BASE_PATH + "/instanceof-3-result.java"); - //testByCount(new String[]{"instanceof"}, 1); - } - - public void testCatchFinally() throws Exception{ - configureByFile(BASE_PATH + "/catch-1.java"); - testByCount(2, "catch", "finally"); - } - - public void testSuper1() throws Exception{ - configureByFile(BASE_PATH + "/super-1.java"); - testByCount(1, "super"); - } - - public void testSuper2() throws Exception{ - configureByFile(BASE_PATH + "/super-2.java"); - testByCount(0, "super"); - } - - public void testContinue() throws Exception{ - configureByFile(BASE_PATH + "/continue.java"); - checkResultByFile(BASE_PATH + "/continue_after.java"); - } - - public void testThrowsOnSeparateLine() throws Exception{ - configureByFile(BASE_PATH + "/throwsOnSeparateLine.java"); - checkResultByFile(BASE_PATH + "/throwsOnSeparateLine_after.java"); - } - - public void testDefaultInAnno() throws Exception{ - configureByFile(BASE_PATH + "/" + getTestName(true) + ".java"); - checkResultByFile(BASE_PATH + "/" + getTestName(true) + "_after.java"); - } - - public void testTryInExpression() throws Throwable { + public void testTryInExpression() throws Exception { configureByFile(BASE_PATH + "/" + getTestName(true) + ".java"); assertStringItems("toString", "this"); } - public void testNull() throws Exception{ - configureByFile(BASE_PATH + "/NullInMethodCall.java"); - checkResultByFile(BASE_PATH + "/NullInMethodCall_After.java"); - configureByFile(BASE_PATH + "/NullInMethodCall2.java"); - checkResultByFile(BASE_PATH + "/NullInMethodCall2_After.java"); + private void doTest(boolean select) throws Exception { + configureByFile(BASE_PATH + "/" + getTestName(true) + ".java"); + if (select) { + selectItem(myItems[1]); + } + checkResultByFile(BASE_PATH + "/" + getTestName(true) + "_after.java"); + } + + protected void doTest(int finalCount, @NonNls String... values) { + configureByFile(BASE_PATH + "/" + getTestName(true) + ".java"); + testByCount(finalCount, values); } } \ No newline at end of file diff --git a/java/openapi/src/com/intellij/patterns/PsiJavaPatterns.java b/java/openapi/src/com/intellij/patterns/PsiJavaPatterns.java index 2da9c756a728..3de211add605 100644 --- a/java/openapi/src/com/intellij/patterns/PsiJavaPatterns.java +++ b/java/openapi/src/com/intellij/patterns/PsiJavaPatterns.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2009 JetBrains s.r.o. + * Copyright 2000-2012 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. @@ -71,7 +71,7 @@ public class PsiJavaPatterns extends StandardPatterns{ return psiLiteral(null); } - public static PsiJavaElementPattern.Capture psiLiteral(final ElementPattern value) { + public static PsiJavaElementPattern.Capture psiLiteral(@Nullable final ElementPattern value) { return new PsiJavaElementPattern.Capture(new InitialPatternConditionPlus(PsiLiteral.class) { public boolean accepts(@Nullable final Object o, final ProcessingContext context) { return o instanceof PsiLiteral && (value == null || value.accepts(((PsiLiteral)o).getValue(), context)); @@ -100,12 +100,10 @@ public class PsiJavaPatterns extends StandardPatterns{ }); } - - public static PsiJavaElementPattern.Capture literalExpression(final ElementPattern value) { + public static PsiJavaElementPattern.Capture literalExpression(@Nullable final ElementPattern value) { return new PsiJavaElementPattern.Capture(new InitialPatternConditionPlus(PsiLiteralExpression.class) { public boolean accepts(@Nullable final Object o, final ProcessingContext context) { - return o instanceof PsiLiteralExpression - && (value == null || value.accepts(((PsiLiteralExpression)o).getValue(), context)); + return o instanceof PsiLiteralExpression && (value == null || value.accepts(((PsiLiteralExpression)o).getValue(), context)); } @Override