Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Excluding synthetic compiler methods


 
I've found that AspectJ is inlcuding synthetic methods generated by the Java compiler. In this case, it's the static methods created by the compiler to allow inner classes access to private members.

I'd like to be able to say:

    pointcut excludedMethods() :
        execution(* *()) ||
        execution(new()) ||
        execution(synthetic * *(..)) ||
        execution(boolean equals(Object));

But synthetic does not appear to be valid modifier.

I think it should be.

 
  I may be wrong, but don't think it is specified by the Java language specification what synthetic methods the compiler should generate, i.e. it is up to the compiler. That would make your aspect code fragile as depending on what compiler the woven classes were compiled w/ you'd have a different effect.
 
 
         -Antti-
 
 

Back to the top