aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2009-03-27 17:35:00 +0000
committeraclement <aclement>2009-03-27 17:35:00 +0000
commit127e468b74f1c1a99ae1917f64b5f251c45c4520 (patch)
tree11bb96ecb82bf0e6036123568b1b6789edcde22b
parenta2703cf03d909a2dbc78f5b169225270f8308606 (diff)
downloadaspectj-127e468b74f1c1a99ae1917f64b5f251c45c4520.tar.gz
aspectj-127e468b74f1c1a99ae1917f64b5f251c45c4520.zip
269286: handles for anno style elements: less than optimal fix but need something quick
-rw-r--r--asm/src/org/aspectj/asm/IProgramElement.java3
-rw-r--r--asm/src/org/aspectj/asm/internal/HandleProviderDelimiter.java18
-rw-r--r--asm/src/org/aspectj/asm/internal/ProgramElement.java13
3 files changed, 31 insertions, 3 deletions
diff --git a/asm/src/org/aspectj/asm/IProgramElement.java b/asm/src/org/aspectj/asm/IProgramElement.java
index f13759b12..9e077cf56 100644
--- a/asm/src/org/aspectj/asm/IProgramElement.java
+++ b/asm/src/org/aspectj/asm/IProgramElement.java
@@ -395,4 +395,7 @@ public interface IProgramElement extends Serializable {
return this == PACKAGE_DECLARATION;
}
}
+
+ public void setAnnotationStyleDeclaration(boolean b);
+ public boolean isAnnotationStyleDeclaration();
} \ No newline at end of file
diff --git a/asm/src/org/aspectj/asm/internal/HandleProviderDelimiter.java b/asm/src/org/aspectj/asm/internal/HandleProviderDelimiter.java
index 33152f4b8..a187e2f0c 100644
--- a/asm/src/org/aspectj/asm/internal/HandleProviderDelimiter.java
+++ b/asm/src/org/aspectj/asm/internal/HandleProviderDelimiter.java
@@ -88,7 +88,11 @@ public class HandleProviderDelimiter {
|| kind.equals(IProgramElement.Kind.ENUM) || kind.equals(IProgramElement.Kind.ANNOTATION)) {
return TYPE.getDelimiter();
} else if (kind.equals(IProgramElement.Kind.ASPECT)) {
- return ASPECT_TYPE.getDelimiter();
+ if (ipe.isAnnotationStyleDeclaration()) {
+ return TYPE.getDelimiter();
+ } else {
+ return ASPECT_TYPE.getDelimiter();
+ }
} else if (kind.equals(IProgramElement.Kind.INITIALIZER)) {
return INITIALIZER.getDelimiter();
} else if (kind.equals(IProgramElement.Kind.INTER_TYPE_FIELD) || kind.equals(IProgramElement.Kind.INTER_TYPE_METHOD)
@@ -99,9 +103,17 @@ public class HandleProviderDelimiter {
} else if (kind.equals(IProgramElement.Kind.FIELD) || kind.equals(IProgramElement.Kind.ENUM_VALUE)) {
return FIELD.getDelimiter();
} else if (kind.equals(IProgramElement.Kind.POINTCUT)) {
- return POINTCUT.getDelimiter();
+ if (ipe.isAnnotationStyleDeclaration()) {
+ return METHOD.getDelimiter();
+ } else {
+ return POINTCUT.getDelimiter();
+ }
} else if (kind.equals(IProgramElement.Kind.ADVICE)) {
- return ADVICE.getDelimiter();
+ if (ipe.isAnnotationStyleDeclaration()) {
+ return METHOD.getDelimiter();
+ } else {
+ return ADVICE.getDelimiter();
+ }
} else if (kind.equals(IProgramElement.Kind.DECLARE_PARENTS) || kind.equals(IProgramElement.Kind.DECLARE_WARNING)
|| kind.equals(IProgramElement.Kind.DECLARE_ERROR) || kind.equals(IProgramElement.Kind.DECLARE_SOFT)
|| kind.equals(IProgramElement.Kind.DECLARE_PRECEDENCE)
diff --git a/asm/src/org/aspectj/asm/internal/ProgramElement.java b/asm/src/org/aspectj/asm/internal/ProgramElement.java
index 4c6bcd37b..537b8254c 100644
--- a/asm/src/org/aspectj/asm/internal/ProgramElement.java
+++ b/asm/src/org/aspectj/asm/internal/ProgramElement.java
@@ -646,4 +646,17 @@ public class ProgramElement implements IProgramElement {
public ExtraInformation getExtraInfo() {
return (ExtraInformation) kvpairs.get("ExtraInformation");
}
+
+ public boolean isAnnotationStyleDeclaration() {
+ return kvpairs.get("annotationStyleDeclaration")!=null;
+ }
+
+ public void setAnnotationStyleDeclaration(boolean b) {
+ if (b) {
+ if (kvpairs == Collections.EMPTY_MAP) {
+ kvpairs = new HashMap();
+ }
+ kvpairs.put("annotationStyleDeclaration", "true");
+ }
+ }
}