*/
public class AsmElementFormatter {
- private final static String ASPECTJ_ANNOTATION_PACKAGE = "org.aspectj.lang.annotation";
- private final static char PACKAGE_INITIAL_CHAR = ASPECTJ_ANNOTATION_PACKAGE.charAt(0);
-
public void genLabelAndKind(MethodDeclaration methodDeclaration, IProgramElement node) {
if (methodDeclaration instanceof AdviceDeclaration) {
// Note: AV: implicit single advice type support here (should be enforced somewhere as well (APT etc))
Annotation annotation = methodDeclaration.annotations[i];
String annotationSig = new String(annotation.type.getTypeBindingPublic(methodDeclaration.scope).signature());
- if (annotationSig.charAt(1) == PACKAGE_INITIAL_CHAR) {
+ if (annotationSig.charAt(1) == 'o') {
if ("Lorg/aspectj/lang/annotation/Pointcut;".equals(annotationSig)) {
node.setKind(IProgramElement.Kind.POINTCUT);
node.setAnnotationStyleDeclaration(true); // pointcuts don't seem to get handled quite right...
// TODO: fix this way of determing ajc-added arguments, make subtype of Argument with extra info
private boolean acceptArgument(String name, String type) {
- if (name.charAt(0) != 'a' && type.charAt(0) != PACKAGE_INITIAL_CHAR) {
+ if (name.charAt(0) != 'a' && type.charAt(0) != 'o') {
return true;
}
return !name.startsWith("ajc$this_") && !type.equals("org.aspectj.lang.JoinPoint.StaticPart")