parse annotations in implements declarations
diff --git a/javaparser-core/src/main/javacc/java_1_8.jj b/javaparser-core/src/main/javacc/java_1_8.jj
index ac450d8..7834b06 100644
--- a/javaparser-core/src/main/javacc/java_1_8.jj
+++ b/javaparser-core/src/main/javacc/java_1_8.jj
@@ -1302,12 +1302,10 @@
{
List ret = new LinkedList();
ClassOrInterfaceType cit;
- AnnotationExpr ann;
- List annotations = null;
}
{
- "implements" (ann = Annotation() { annotations = add(annotations, ann);})* cit = ClassOrInterfaceType() { cit.setAnnotations(annotations); ret.add(cit); }
- ( "," cit = ClassOrInterfaceType() { ret.add(cit); } )*
+ "implements" cit = ClassOrInterfaceTypeWithAnnotations() { ret.add(cit); }
+ ( "," cit = ClassOrInterfaceTypeWithAnnotations() { ret.add(cit); } )*
{
if (isInterface)
throwParseException(token, "An interface cannot implement other interfaces");
@@ -1814,6 +1812,24 @@
{ return ret; }
}
+ClassOrInterfaceType ClassOrInterfaceTypeWithAnnotations():
+{
+ List annotations = new ArrayList();
+ AnnotationExpr annotation = null;
+ ClassOrInterfaceType type;
+}
+{
+ (annotation = Annotation() { annotations = add(annotations, annotation); } )* type = ClassOrInterfaceType() {
+ if (type.getAnnotations() != null) {
+ type.getAnnotations().addAll(annotations);
+ } else {
+ type.setAnnotations(annotations);
+ }
+ return type;
+ }
+}
+
+
List TypeArguments():
{
List ret = new LinkedList();