diff options
| author | M N Palat | 2013-11-26 04:56:55 +0000 |
|---|---|---|
| committer | M N Palat | 2013-11-26 04:56:55 +0000 |
| commit | bea7b508525f70d680963772996546f2bcf8018f (patch) | |
| tree | 5f5a2886f58a21ea666866d221f7454e29e05843 | |
| parent | 6908ed269579bdf5bd73625206374e9ed19646b4 (diff) | |
| download | eclipse.jdt.core-bea7b508525f70d680963772996546f2bcf8018f.tar.gz eclipse.jdt.core-bea7b508525f70d680963772996546f2bcf8018f.tar.xz eclipse.jdt.core-bea7b508525f70d680963772996546f2bcf8018f.zip | |
Fix for Bug 417659
[dom][ast][1.8] test failures - ast structure - when debug tracing is on
2 files changed, 9 insertions, 17 deletions
diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java index beb13e5486..28d42c72dc 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter18Test.java @@ -305,7 +305,7 @@ public class ASTConverter18Test extends ConverterTestSetup { * * @throws JavaModelException */ - public void _test0004() throws JavaModelException { + public void test0004() throws JavaModelException { this.workingCopy = getWorkingCopy("/Converter18/src/test0004/X.java", true/* resolve */); String contents = "package test0004;" @@ -317,9 +317,7 @@ public class ASTConverter18Test extends ConverterTestSetup { + "@interface Marker1 {}\n" + "@Target (java.lang.annotation.ElementType.TYPE_USE)\n" + "@interface Marker2 {}\n"; - CompilationUnit cu = (CompilationUnit) buildAST(contents, this.workingCopy); - TypeDeclaration typedeclaration = (TypeDeclaration) getASTNode(cu, 0); - ArrayType type = (ArrayType) ((ParameterizedType) typedeclaration.superInterfaceTypes().get(0)).typeArguments().get(0); + ArrayType type = (ArrayType) buildAST(contents, this.workingCopy); assertNotNull("No annotation", type); ITypeBinding binding = type.resolveBinding(); assertNotNull("No binding", binding); diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java index a3f4a006bf..8b8ee0f4ca 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/rewrite/describing/ASTRewritingMethodDeclTest.java @@ -344,7 +344,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest { - public void _testMethodReturnTypeChanges_only_2() throws Exception { + public void testMethodReturnTypeChanges_only_2() throws Exception { IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test1;\n"); @@ -400,31 +400,28 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest { } - { // remove return type, add second modifier + { // add second modifier MethodDeclaration methodDecl= (MethodDeclaration) list.get(3); rewrite.set(methodDecl, INTERNAL_METHOD_MODIFIERS_PROPERTY, new Integer(Modifier.PUBLIC | Modifier.FINAL), null); // from method to constructor - rewrite.set(methodDecl, INTERNAL_METHOD_RETURN_TYPE_PROPERTY, null, null); rewrite.set(methodDecl, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.TRUE, null); } - { // remove return type, add (first) modifier + { // add (first) modifier MethodDeclaration methodDecl= (MethodDeclaration) list.get(4); rewrite.set(methodDecl, INTERNAL_METHOD_MODIFIERS_PROPERTY, new Integer(Modifier.FINAL), null); // from method to constructor - rewrite.set(methodDecl, INTERNAL_METHOD_RETURN_TYPE_PROPERTY, null, null); rewrite.set(methodDecl, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.TRUE, null); } - { // remove return type, add second modifier with comments + { // add second modifier with comments MethodDeclaration methodDecl= (MethodDeclaration) list.get(5); rewrite.set(methodDecl, INTERNAL_METHOD_MODIFIERS_PROPERTY, new Integer(Modifier.FINAL), null); // from method to constructor - rewrite.set(methodDecl, INTERNAL_METHOD_RETURN_TYPE_PROPERTY, null, null); rewrite.set(methodDecl, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.TRUE, null); } @@ -447,7 +444,7 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest { } - public void _testMethodReturnTypeChanges2_only_2() throws Exception { + public void testMethodReturnTypeChanges2_only_2() throws Exception { IPackageFragment pack1= this.sourceFolder.createPackageFragment("test1", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test1;\n"); @@ -503,21 +500,19 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest { } - { // remove return type, remove second modifier + { // remove second modifier MethodDeclaration methodDecl= (MethodDeclaration) list.get(3); rewrite.set(methodDecl, INTERNAL_METHOD_MODIFIERS_PROPERTY, new Integer(Modifier.PUBLIC), null); // from method to constructor - rewrite.set(methodDecl, INTERNAL_METHOD_RETURN_TYPE_PROPERTY, null, null); rewrite.set(methodDecl, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.TRUE, null); } - { // remove return type, remove (only) modifier + { // remove (only) modifier MethodDeclaration methodDecl= (MethodDeclaration) list.get(4); setModifiers(rewrite, methodDecl, 0); // from method to constructor - rewrite.set(methodDecl, INTERNAL_METHOD_RETURN_TYPE_PROPERTY, null, null); rewrite.set(methodDecl, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.TRUE, null); } @@ -527,7 +522,6 @@ public class ASTRewritingMethodDeclTest extends ASTRewritingTest { setModifiers(rewrite, methodDecl, 0); // from method to constructor - rewrite.set(methodDecl, INTERNAL_METHOD_RETURN_TYPE_PROPERTY, null, null); rewrite.set(methodDecl, MethodDeclaration.CONSTRUCTOR_PROPERTY, Boolean.TRUE, null); } |
