Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] constants in case expressions

So, is there a way around this for the time being until the bug is resolved.
thanks a lot.

Wes Isberg <wes@xxxxxxxxxxxxxx> wrote:
Good catch: https://bugs.eclipse.org/bugs/show_bug.cgi?id=87525

------------Original Message------------
From: Irum Godil
To: "AJDT USER"
Date: Sun, Mar-13-2005 7:51 PM
Subject: [aspectj-users] constants in case expressions
Hi,
I have the following code structure:

package a;

public class D {
static final int D_O = 1;

...}

In the same package A i have another class:

package A;
public class L {

boolean closeLog(int closemode) {
switch (closemode) {

case D.D_O :
lLog.shutdown();
break;
}
}
}
.. }

All is fine here when I compile. Now, I want to refactor the above closeLog method. I define an aspect as follows:

//The aspect is in a different package
package B

privileged aspect C {
//pointcut definitions...

boolean around(Logger l, int closemode): targetLogger(l) && closeLogExec(closemode)
{
...
switch (closemode) {
case Database.D_O :
l.lLog.shutdown();
break;
}
}

Now, when I compile I keep getting error:
"case expressions must be constant expressions" on the line: "case Database.D_O :"

I do not know what I am doing wrong. My _expression_ Database.D_O is final i.e. constant, then why am getting this error? I am using JDK 1.4 and Eclipse 3.0. Any help will be appreciated.

thanks.


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Back to the top