Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] A switch oddity

Hi, I inter-type declared a constant in a class "Test" as follows:
public final static int Test.CASE1 = 1;
Then in my aspect code, I write a switch block:
switch(option)
case Test.CASE1:
//do something

I got a compiler error "case expressions must be constant expressions"

However, if I declare "CASE1" inside the java class, everything is fine.
Something special needs to be done in aspects? I read the documentation
and find no clue. Maybe it is because it is getting really late. Can
someone shed some light? Thanks a lot.

Charles


Back to the top