diff options
Diffstat (limited to 'org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java')
-rw-r--r-- | org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java | 240 |
1 files changed, 120 insertions, 120 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java index 7e360fe63a..a75d371e4a 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverterTestAST3_2.java @@ -4470,13 +4470,13 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { class Change14FieldAccessASTVisitor extends ASTVisitor { int counter; Change14FieldAccessASTVisitor() { - counter = 0; + this.counter = 0; } public void endVisit(QualifiedName qualifiedName) { IBinding i_binding = qualifiedName.getQualifier().resolveBinding(); ITypeBinding type_binding = qualifiedName.getQualifier().resolveTypeBinding(); if (i_binding == null || type_binding == null) { - counter++; + this.counter++; } } } @@ -7970,7 +7970,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { workingCopy.discardWorkingCopy(); } } - + /** * @bug 149126: IllegalArgumentException in ASTConverter * @see "https://bugs.eclipse.org/bugs/show_bug.cgi?id=149126" @@ -7998,77 +7998,77 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { " return null;\n" + " }\n" + "}"); - + assertASTResult( - "===== AST =====\n" + - "import java.nio.ByteBuffer;\n" + - "import java.nio.CharBuffer;\n" + - "import java.nio.charset.Charset;\n" + - "import java.nio.charset.CharsetDecoder;\n" + - "import java.nio.charset.CharsetEncoder;\n" + - "import java.nio.charset.CoderResult;\n" + - "public class TestCharset extends Charset {\n" + - " public CharsetDecoder newDecoder(){\n" + - " return new CharsetDecoder(this,2.0,2.0){\n" + - " void CharsetDecoder(){\n" + - " }\n" + - " protected CoderResult decodeLoop( ByteBuffer in, CharBuffer out){\n" + - " return null;\n" + - " }\n" + - " }\n" + - ";\n" + - " ;\n" + - " }\n" + - " public CharsetEncoder newEncoder(){\n" + - " return null;\n" + - " }\n" + - "}\n" + - "\n" + - "===== Details =====\n" + - "===== Problems =====\n" + - "1. ERROR in /Converter/src/TestCharset.java (at line 1)\n" + - " import java.nio.ByteBuffer;\n" + - " ^^^^^^^^\n" + - "The import java.nio cannot be resolved\n" + - "2. ERROR in /Converter/src/TestCharset.java (at line 2)\n" + - " import java.nio.CharBuffer;\n" + - " ^^^^^^^^\n" + - "The import java.nio cannot be resolved\n" + - "3. ERROR in /Converter/src/TestCharset.java (at line 3)\n" + - " import java.nio.charset.Charset;\n" + - " ^^^^^^^^\n" + - "The import java.nio cannot be resolved\n" + - "4. ERROR in /Converter/src/TestCharset.java (at line 4)\n" + - " import java.nio.charset.CharsetDecoder;\n" + - " ^^^^^^^^\n" + - "The import java.nio cannot be resolved\n" + - "5. ERROR in /Converter/src/TestCharset.java (at line 5)\n" + - " import java.nio.charset.CharsetEncoder;\n" + - " ^^^^^^^^\n" + - "The import java.nio cannot be resolved\n" + - "6. ERROR in /Converter/src/TestCharset.java (at line 6)\n" + - " import java.nio.charset.CoderResult;\n" + - " ^^^^^^^^\n" + - "The import java.nio cannot be resolved\n" + - "7. ERROR in /Converter/src/TestCharset.java (at line 7)\n" + - " public class TestCharset extends Charset {\n" + - " ^^^^^^^\n" + - "Charset cannot be resolved to a type\n" + - "8. ERROR in /Converter/src/TestCharset.java (at line 8)\n" + - " public CharsetDecoder newDecoder() {\n" + - " ^^^^^^^^^^^^^^\n" + - "CharsetDecoder cannot be resolved to a type\n" + - "9. ERROR in /Converter/src/TestCharset.java (at line 9)\n" + - " return new CharsetDecoder(this, 2.0, 2.0) {\n" + - " ^^^^^^^^^^^^^^\n" + - "CharsetDecoder cannot be resolved to a type\n" + - "10. ERROR in /Converter/src/TestCharset.java (at line 10)\n" + - " CharsetDecoder(CharSet\n" + - " ^^^^^^^^^^^^^^^^^^^^^^\n" + - "Syntax error on token(s), misplaced construct(s)\n" + - "11. ERROR in /Converter/src/TestCharset.java (at line 17)\n" + - " public CharsetEncoder newEncoder() {\n" + - " ^^^^^^^^^^^^^^\n" + + "===== AST =====\n" + + "import java.nio.ByteBuffer;\n" + + "import java.nio.CharBuffer;\n" + + "import java.nio.charset.Charset;\n" + + "import java.nio.charset.CharsetDecoder;\n" + + "import java.nio.charset.CharsetEncoder;\n" + + "import java.nio.charset.CoderResult;\n" + + "public class TestCharset extends Charset {\n" + + " public CharsetDecoder newDecoder(){\n" + + " return new CharsetDecoder(this,2.0,2.0){\n" + + " void CharsetDecoder(){\n" + + " }\n" + + " protected CoderResult decodeLoop( ByteBuffer in, CharBuffer out){\n" + + " return null;\n" + + " }\n" + + " }\n" + + ";\n" + + " ;\n" + + " }\n" + + " public CharsetEncoder newEncoder(){\n" + + " return null;\n" + + " }\n" + + "}\n" + + "\n" + + "===== Details =====\n" + + "===== Problems =====\n" + + "1. ERROR in /Converter/src/TestCharset.java (at line 1)\n" + + " import java.nio.ByteBuffer;\n" + + " ^^^^^^^^\n" + + "The import java.nio cannot be resolved\n" + + "2. ERROR in /Converter/src/TestCharset.java (at line 2)\n" + + " import java.nio.CharBuffer;\n" + + " ^^^^^^^^\n" + + "The import java.nio cannot be resolved\n" + + "3. ERROR in /Converter/src/TestCharset.java (at line 3)\n" + + " import java.nio.charset.Charset;\n" + + " ^^^^^^^^\n" + + "The import java.nio cannot be resolved\n" + + "4. ERROR in /Converter/src/TestCharset.java (at line 4)\n" + + " import java.nio.charset.CharsetDecoder;\n" + + " ^^^^^^^^\n" + + "The import java.nio cannot be resolved\n" + + "5. ERROR in /Converter/src/TestCharset.java (at line 5)\n" + + " import java.nio.charset.CharsetEncoder;\n" + + " ^^^^^^^^\n" + + "The import java.nio cannot be resolved\n" + + "6. ERROR in /Converter/src/TestCharset.java (at line 6)\n" + + " import java.nio.charset.CoderResult;\n" + + " ^^^^^^^^\n" + + "The import java.nio cannot be resolved\n" + + "7. ERROR in /Converter/src/TestCharset.java (at line 7)\n" + + " public class TestCharset extends Charset {\n" + + " ^^^^^^^\n" + + "Charset cannot be resolved to a type\n" + + "8. ERROR in /Converter/src/TestCharset.java (at line 8)\n" + + " public CharsetDecoder newDecoder() {\n" + + " ^^^^^^^^^^^^^^\n" + + "CharsetDecoder cannot be resolved to a type\n" + + "9. ERROR in /Converter/src/TestCharset.java (at line 9)\n" + + " return new CharsetDecoder(this, 2.0, 2.0) {\n" + + " ^^^^^^^^^^^^^^\n" + + "CharsetDecoder cannot be resolved to a type\n" + + "10. ERROR in /Converter/src/TestCharset.java (at line 10)\n" + + " CharsetDecoder(CharSet\n" + + " ^^^^^^^^^^^^^^^^^^^^^^\n" + + "Syntax error on token(s), misplaced construct(s)\n" + + "11. ERROR in /Converter/src/TestCharset.java (at line 17)\n" + + " public CharsetEncoder newEncoder() {\n" + + " ^^^^^^^^^^^^^^\n" + "CharsetEncoder cannot be resolved to a type\n", result); } @@ -8798,7 +8798,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { true); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit unit = (CompilationUnit) node; - String expectedError = + String expectedError = "List cannot be resolved to a type"; assertProblemsSize(unit, 1, expectedError); node = getASTNode(unit, 0, 0, 0); @@ -8841,7 +8841,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { false); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit unit = (CompilationUnit) node; - String expectedError = + String expectedError = "List cannot be resolved to a type"; assertProblemsSize(unit, 1, expectedError); node = getASTNode(unit, 0, 0, 0); @@ -8968,7 +8968,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ASTNode node = runConversion(AST.JLS3, workingCopy, true, true, true); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit unit = (CompilationUnit) node; - String expectedError = + String expectedError = "List cannot be resolved to a type"; assertProblemsSize(unit, 1, expectedError); node = getASTNode(unit, 0, 0, 0); @@ -9011,7 +9011,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ASTNode node = runConversion(AST.JLS3, workingCopy, true, true, true); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit unit = (CompilationUnit) node; - String expectedError = + String expectedError = "List cannot be resolved to a type" ; assertProblemsSize(unit, 1, expectedError); node = getASTNode(unit, 0, 0, 0); @@ -9081,7 +9081,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ASTNode node = runConversion(AST.JLS3, workingCopy, true, true, true); assertEquals("Not a compilation unit", ASTNode.COMPILATION_UNIT, node.getNodeType()); CompilationUnit unit = (CompilationUnit) node; - String expectedError = + String expectedError = "List cannot be resolved to a type"; assertProblemsSize(unit, 1, expectedError); assertTrue("No binding recovery", unit.getAST().hasBindingsRecovery()); @@ -9135,7 +9135,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { assertNotNull("No element type", elementType2); assertNotNull("No key", elementType.getKey()); assertTrue("Not equals", elementType2.isEqualTo(elementType)); - + node = getASTNode(unit, 0); assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); TypeDeclaration typeDeclaration = (TypeDeclaration) node; @@ -9155,7 +9155,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { workingCopy.discardWorkingCopy(); } } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=149567 * http://dev.eclipse.org/bugs/show_bug.cgi?id=180905 @@ -9164,9 +9164,9 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ICompilationUnit workingCopy = null; try { String contents = - "public class X {\n" + - " B foo() {\n" + - " }\n" + + "public class X {\n" + + " B foo() {\n" + + " }\n" + "}"; workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); workingCopy.getBuffer().setContents(contents); @@ -9200,7 +9200,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { assertNotNull("No element type", elementType); assertNotNull("No key", typeBinding.getKey()); assertTrue("Not equals", elementType.isEqualTo(typeBinding)); - + node = getASTNode(unit, 0); assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); TypeDeclaration typeDeclaration = (TypeDeclaration) node; @@ -9228,10 +9228,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ICompilationUnit workingCopy = null; try { String contents = - "public class X {\n" + + "public class X {\n" + " Object foo() {\n" + - " return new Object() {/*anon*/};\n" + - " }\n" + + " return new Object() {/*anon*/};\n" + + " }\n" + "}"; workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); workingCopy.getBuffer().setContents(contents); @@ -9264,14 +9264,14 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ICompilationUnit workingCopy = null; try { String contents = - "public class X {\n" + - " public X(String label) {}\n" + - " public X() {\n" + - " String s= \"foo\";\n" + - " System.out.println(s);\n" + - " this(s);\n" + - " System.out.println(s);\n" + - " }\n" + + "public class X {\n" + + " public X(String label) {}\n" + + " public X() {\n" + + " String s= \"foo\";\n" + + " System.out.println(s);\n" + + " this(s);\n" + + " System.out.println(s);\n" + + " }\n" + "}"; workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); workingCopy.getBuffer().setContents(contents); @@ -9295,7 +9295,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { workingCopy.discardWorkingCopy(); } } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=149567 * http://dev.eclipse.org/bugs/show_bug.cgi?id=180905 @@ -9333,7 +9333,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { assertNotNull("No element type", elementType); assertNotNull("No key", typeBinding.getKey()); assertTrue("Not equals", elementType.isEqualTo(typeBinding)); - + node = getASTNode(unit, 0); assertEquals("Not a type declaration", ASTNode.TYPE_DECLARATION, node.getNodeType()); TypeDeclaration typeDeclaration = (TypeDeclaration) node; @@ -9349,7 +9349,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { assertTrue("Not isAssignmentCompatible", typeBinding.isAssignmentCompatible(javaLangObject)); assertTrue("Not isAssignmentCompatible", typeBinding.isAssignmentCompatible(elementType)); } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=185306 */ @@ -9382,10 +9382,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ICompilationUnit workingCopy = null; try { String contents = - "public class X {\n" + - " public String foo() {\n" + - " return((true ? \"\" : (\"Hello\" + \" World\") + \"!\"));\n" + - " }\n" + + "public class X {\n" + + " public String foo() {\n" + + " return((true ? \"\" : (\"Hello\" + \" World\") + \"!\"));\n" + + " }\n" + "}"; workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); ASTNode node = buildAST( @@ -9441,8 +9441,8 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ICompilationUnit workingCopy = null; try { String contents = - "public class X {\n" + - " int i = 1 - 2 + 3 + 4 + 5;\n" + + "public class X {\n" + + " int i = 1 - 2 + 3 + 4 + 5;\n" + "}"; workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); ASTNode node = buildAST( @@ -9469,7 +9469,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { workingCopy.discardWorkingCopy(); } } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=196249 */ @@ -9486,7 +9486,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { final List modifiers = typeDeclaration.modifiers(); assertEquals("Wrong size", 1, modifiers.size()); } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=196354 */ @@ -9501,7 +9501,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { assertNotNull("No binding", packageBinding); assertEquals("Wrong name", "Sample", packageBinding.getName()); } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=196514 */ @@ -9513,7 +9513,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { assertProblemsSize( unit, 2, - "Variable must provide either dimension expressions or an array initializer\n" + + "Variable must provide either dimension expressions or an array initializer\n" + "Syntax error on token \"String\", [ expected after this token"); node = getASTNode(unit, 0, 1, 0); assertEquals("Not a expression statement", ASTNode.EXPRESSION_STATEMENT, node.getNodeType()); @@ -9529,7 +9529,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ArrayType arrayType = arrayCreation.getType(); checkSourceRange(arrayType, "String]", sourceUnit.getSource()); } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=196514 */ @@ -9561,7 +9561,7 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { arrayType = (ArrayType)node; checkSourceRange(arrayType, "String[0]", sourceUnit.getSource()); } - + /** * http://dev.eclipse.org/bugs/show_bug.cgi?id=201929 */ @@ -9618,12 +9618,12 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ICompilationUnit workingCopy = null; try { String contents = - "public class X {\n" + - " void foo() {\n" + - " int a , b ;\n" + - " for (int i , j ;;) {}\n" + - " }\n" + - " int n , m ;\n" + + "public class X {\n" + + " void foo() {\n" + + " int a , b ;\n" + + " for (int i , j ;;) {}\n" + + " }\n" + + " int n , m ;\n" + "}"; workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); ASTNode node = buildAST( @@ -9680,10 +9680,10 @@ public class ASTConverterTestAST3_2 extends ConverterTestSetup { ICompilationUnit workingCopy = null; try { String contents = - "public class X {\n" + - " protected String foo(String string) {\n" + - " return (\"\" + string + \"\") + (\"\");\n" + - " }\n" + + "public class X {\n" + + " protected String foo(String string) {\n" + + " return (\"\" + string + \"\") + (\"\");\n" + + " }\n" + "}"; workingCopy = getWorkingCopy("/Converter/src/X.java", true/*resolve*/); ASTNode node = buildAST( |