Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-dev] Enums and AspectJ - getEnumConstants() returns null

I forgot, please uncomment from the project test-aspectj, in the file pom.xml 
         <!--build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>


On Mon, May 30, 2011 at 10:49 PM, Cosmin Nicolae Vacaroiu <cosminvacaroiu@xxxxxxxxx> wrote:
Hello,

I've tested again and it's the same result.
I've attached a zip with 2 projects. The Aspect and The Enum with a simple class with a main method.
Ps: I'm compiling and waving with a maven plugin.
If you use Eclipse please use mvn eclipse:eclipse so that you can import the projects. 

Thanks.




On Mon, May 30, 2011 at 7:03 PM, Andy Clement <andrew.clement@xxxxxxxxx> wrote:
Hi,

I can't seem to recreate this problem.  I probably need to know what
you are weaving into what.

I tried weaving at every joinpoint other than my aspect:
---
enum EnumName { B, L, A }

public class A {
 public static void main(String[]argv) {
   System.out.println(EnumName.class.isEnum());
   System.out.println(EnumName.class.getEnumConstants());
 }
}

aspect X {
 before(): !within(X) {}
}
---
But I still don't get null from getEnumConstants().  Are you able to
share the aspect with me that gives rise to this?

cheers
Andy

On 27 May 2011 11:11, Cosmin Nicolae Vacaroiu <cosminvacaroiu@xxxxxxxxx> wrote:
> 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.
>
> _______________________________________________
> aspectj-dev mailing list
> aspectj-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-dev
>
>
_______________________________________________
aspectj-dev mailing list
aspectj-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-dev



Back to the top