Using AspectJ with enums I get the next results:
public enum EnumName { B, L, A }
EnumName.class.isEnum() : true
EnumName.class.getEnumConstants() : null
If I don’t wave (at compile time) my project, getEnumConstants() works as expected.
Why is this happening? I didn’t found any information on google about this, I’ve tried to decompile the generated classes, but I didn’t got any info from there. This makes me stop using AspectJ if it keeps messing around things.
I’ve got my answer again from AspectJ’s mailing list.
The problem was that I had a NPE exception in my Advice due to a call to joinPoint.getThis().getName(), getThis() on static methods returns null.
getEnumConstants() swallowed the exception and just returned null.