diff options
-rw-r--r-- | asm/src/org/aspectj/asm/IProgramElement.java | 3 | ||||
-rw-r--r-- | asm/src/org/aspectj/asm/internal/HandleProviderDelimiter.java | 18 | ||||
-rw-r--r-- | asm/src/org/aspectj/asm/internal/ProgramElement.java | 13 |
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"); + } + } } |