diff options
author | aclement <aclement> | 2009-02-04 20:30:38 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-02-04 20:30:38 +0000 |
commit | d8a9b17f4540c876d68b1bd5cf28a43054a9379d (patch) | |
tree | 81ee1dc8d41339126b7f66d0ed204093fb4a8f8d /org.aspectj.ajdt.core | |
parent | 55dacf6126a9ffa4b67b40da90d1200525bce779 (diff) | |
download | aspectj-d8a9b17f4540c876d68b1bd5cf28a43054a9379d.tar.gz aspectj-d8a9b17f4540c876d68b1bd5cf28a43054a9379d.zip |
257277: Incorrect generated Source Signature for FieldDeclarations
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java index 3fc568ce5..07a5c1d0a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java @@ -47,12 +47,13 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractVariableDeclara import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Annotation; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ConstructorDeclaration; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ImportReference; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Initializer; +import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Literal; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MethodDeclaration; -import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedAllocationExpression; +import org.aspectj.org.eclipse.jdt.internal.compiler.ast.OperatorExpression; +import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Reference; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeParameter; import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BlockScope; @@ -878,17 +879,15 @@ public class AsmHierarchyBuilder extends ASTVisitor { fieldDeclaration.type.print(0, output).append(' ').append(fieldDeclaration.name); } - if (fieldDeclaration.initialization != null && !(fieldDeclaration.initialization instanceof QualifiedAllocationExpression)) { - output.append(" = "); //$NON-NLS-1$ + output.append(" = "); + if (fieldDeclaration.initialization != null && + ( fieldDeclaration.initialization instanceof Literal + || fieldDeclaration.initialization instanceof OperatorExpression + || fieldDeclaration.initialization instanceof Reference)) { fieldDeclaration.initialization.printExpression(0, output); - } else if (fieldDeclaration.initialization instanceof QualifiedAllocationExpression) { - QualifiedAllocationExpression qae = (QualifiedAllocationExpression) fieldDeclaration.initialization; - StringBuffer sb = new StringBuffer(); - qae.printExpression(0, sb); - if (sb.toString().indexOf("new ") != 0) { - output.append(" = "); //$NON-NLS-1$ - output.append(sb.toString()); - } + } + else { + output.append("null"); } output.append(";\n"); return output.toString(); |