import org.aspectj.org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Argument;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FalseLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.FieldDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.IntLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.QualifiedNameReference;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TrueLiteral;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.internal.compiler.impl.IntConstant;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.Binding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.FieldBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.MethodBinding;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.SourceTypeBinding;
import org.aspectj.weaver.AnnotationX;
+import org.aspectj.weaver.BCException;
import org.aspectj.weaver.MemberKind;
import org.aspectj.weaver.ResolvedMemberImpl;
import org.aspectj.weaver.ResolvedType;
sb.append(fb.name);
return sb.toString();
}
+ } else if (e instanceof TrueLiteral) {
+ return "true";
+ } else if (e instanceof FalseLiteral) {
+ return "false";
+ } else if (e instanceof IntLiteral) {
+ return Integer.toString(((IntConstant)e.constant).intValue());
+ } else {
+ throw new BCException("EclipseResolvedMember.getAnnotationDefaultValue() not implemented for value of type '"+e.getClass()+"' - raise an AspectJ bug !");
}
}
}
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.ArrayInitializer;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.Expression;
+import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MarkerAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.MemberValuePair;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NameReference;
import org.aspectj.org.eclipse.jdt.internal.compiler.ast.NormalAnnotation;
}
}
return false;
- }
+ }
/** Returns "" if there is a problem */
private String getPointcutStringFromAnnotationStylePointcut(AbstractMethodDeclaration amd) {
annotationAJ.addNameValuePair(
new AnnotationNameValuePair(new String(singleMemberAnnotation.memberValuePairs()[0].name),av));
}
+ } else if (annotation instanceof MarkerAnnotation) {
+ return;
} else {
- // this is a marker annotation (no member value pairs)
+ // this is something else...
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation ["+annotation+"]");
}
}
} else {
if (constant != null && constant != Constant.NotAConstant) {
- throw new MissingImplementationException(
- "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
+ AnnotationValue av = EclipseAnnotationConvertor.generateElementValueForConstantExpression(defaultValue,defaultValueBinding);
+ if (av==null) {
+ throw new MissingImplementationException(
+ "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
+ }
+ return av;
// generateElementValue(attributeOffset, defaultValue, constant, memberValuePairReturnType.leafComponentType());
} else {
AnnotationValue av = generateElementValueForNonConstantExpression(defaultValue, defaultValueBinding);
throw new MissingImplementationException(
"Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
}
+// } else if (defaultValue instanceof MagicLiteral) {
+// if (defaultValue instanceof FalseLiteral) {
+// new AnnotationValue
+// } else if (defaultValue instanceof TrueLiteral) {
+//
+// } else {
+// throw new MissingImplementationException(
+// "Please raise an AspectJ bug. AspectJ does not know how to convert this annotation value ["+defaultValue+"]");
+// }
} else {
// class type
throw new MissingImplementationException(