Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Audel2004-12-08 17:02:20 +0000
committerDavid Audel2004-12-08 17:02:20 +0000
commit445188c88d04c21eb75ec390fedf8ca63140d7dd (patch)
treee7728cd4c8eea53fe88b4e3233a2b459b2166457 /org.eclipse.jdt.core/compiler/org
parent02c268a4d3cda9d82648fb2a27d6f6a49334a9c9 (diff)
downloadeclipse.jdt.core-445188c88d04c21eb75ec390fedf8ca63140d7dd.tar.gz
eclipse.jdt.core-445188c88d04c21eb75ec390fedf8ca63140d7dd.tar.xz
eclipse.jdt.core-445188c88d04c21eb75ec390fedf8ca63140d7dd.zip
code select for annotations
Diffstat (limited to 'org.eclipse.jdt.core/compiler/org')
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java9
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java1
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java1
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java2
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java2
7 files changed, 20 insertions, 1 deletions
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
index 3303cd604e..919443d0a6 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ASTNode.java
@@ -314,6 +314,15 @@ public abstract class ASTNode implements BaseTypes, CompilerModifiers, TypeConst
public abstract StringBuffer print(int indent, StringBuffer output);
+ public static StringBuffer printAnnotations(Annotation[] annotations, StringBuffer output) {
+ int length = annotations.length;
+ for (int i = 0; i < length; i++) {
+ annotations[i].print(0, output);
+ output.append(" "); //$NON-NLS-1$
+ }
+ return output;
+ }
+
public static StringBuffer printIndent(int indent, StringBuffer output) {
for (int i = indent; i > 0; i--) output.append(" "); //$NON-NLS-1$
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
index db3291a4ed..985a97d97e 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractMethodDeclaration.java
@@ -320,6 +320,7 @@ public abstract class AbstractMethodDeclaration
printIndent(tab, output);
printModifiers(this.modifiers, output);
+ if (this.annotations != null) printAnnotations(this.annotations, output);
TypeParameter[] typeParams = typeParameters();
if (typeParams != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
index 3e953d2915..ec0803957f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AbstractVariableDeclaration.java
@@ -73,6 +73,8 @@ public abstract class AbstractVariableDeclaration extends Statement implements I
printIndent(indent, output);
printModifiers(this.modifiers, output);
+ if (this.annotations != null) printAnnotations(this.annotations, output);
+
if (type != null) {
type.print(0, output).append(' ');
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
index 4899d5433c..c7ef29fe98 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/AnnotationMethodDeclaration.java
@@ -55,6 +55,7 @@ public class AnnotationMethodDeclaration extends MethodDeclaration {
printIndent(tab, output);
printModifiers(this.modifiers, output);
+ if (this.annotations != null) printAnnotations(this.annotations, output);
TypeParameter[] typeParams = typeParameters();
if (typeParams != null) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
index 2c837d573b..4a75e07e20 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Argument.java
@@ -79,6 +79,8 @@ public class Argument extends LocalDeclaration {
printIndent(indent, output);
printModifiers(this.modifiers, output);
+ if (this.annotations != null) printAnnotations(this.annotations, output);
+
if (type == null) {
output.append("<no type> "); //$NON-NLS-1$
} else {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
index 2a250e4dcb..987149f8a9 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/Initializer.java
@@ -82,7 +82,9 @@ public class Initializer extends FieldDeclaration {
if (modifiers != 0) {
printIndent(indent, output);
- printModifiers(modifiers, output).append("{\n"); //$NON-NLS-1$
+ printModifiers(modifiers, output);
+ if (this.annotations != null) printAnnotations(this.annotations, output);
+ output.append("{\n"); //$NON-NLS-1$
block.printBody(indent, output);
printIndent(indent, output).append('}');
return output;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
index 8689c5bf08..580877d87b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/TypeDeclaration.java
@@ -864,6 +864,8 @@ public class TypeDeclaration
public StringBuffer printHeader(int indent, StringBuffer output) {
printModifiers(this.modifiers, output);
+ if (this.annotations != null) printAnnotations(this.annotations, output);
+
switch (kind()) {
case IGenericType.CLASS_DECL :
output.append("class "); //$NON-NLS-1$

Back to the top