From: aclement Date: Thu, 10 Mar 2005 17:30:41 +0000 (+0000) Subject: Declare annotation: creates DeclareAnnotations of the right types (using typesafeenum... X-Git-Tag: V1_5_0M2~74 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ff284d4bcf64076c85fb0eb4654f4a88342b965e;p=aspectj.git Declare annotation: creates DeclareAnnotations of the right types (using typesafeenum approach) --- diff --git a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java index 17b6388c2..c9ca1ccf6 100644 --- a/weaver/src/org/aspectj/weaver/patterns/PatternParser.java +++ b/weaver/src/org/aspectj/weaver/patterns/PatternParser.java @@ -150,7 +150,7 @@ public class PatternParser { } public DeclareAnnotation parseDeclareAtType() { - return new DeclareAnnotation("type",parseTypePattern()); + return new DeclareAnnotation(DeclareAnnotation.AT_TYPE,parseTypePattern()); } public DeclareAnnotation parseDeclareAtMethod(boolean isMethod) { @@ -162,11 +162,12 @@ public class PatternParser { if (!isMethod && !isConstructorPattern) { throw new ParserException("constructor signature pattern",tokenSource.peek(-1)); } - return new DeclareAnnotation("method",sp); // sp itself differentiates... + if (isConstructorPattern) return new DeclareAnnotation(DeclareAnnotation.AT_CONSTRUCTOR,sp); + else return new DeclareAnnotation(DeclareAnnotation.AT_METHOD,sp); } public DeclareAnnotation parseDeclareAtField() { - return new DeclareAnnotation("field",parseFieldSignaturePattern()); + return new DeclareAnnotation(DeclareAnnotation.AT_FIELD,parseFieldSignaturePattern()); } public DeclarePrecedence parseDominates() {