The problem is fixed in #612. Thank you Jonas!
One caused by conditional expression as a switch argument.

Best regards,
Maxim Shafirov
IntelliJ Software, http://www.intellij.com/
"Develop with pleasure!"


----- Original Message -----
From: "Jonas Kvarnstr�m" <[EMAIL PROTECTED]>
To: "IDEA Early Access Program" <[EMAIL PROTECTED]>
Sent: Wednesday, March 13, 2002 1:38 AM
Subject: Re: [Eap-list] NPE in code inspection (611)


> On Tue, 2002-03-12 at 18:55, Maxim Shafirov wrote:
> > Jonas, would you please try to localize the problem. One caused by
"Constant
> > conditions and NPE's" and we need the method body.
>
> I've been trying to narrow it down.  It seems to be triggered by a
> specific method in a specific class, and I've removed as much code from
> the method as I can -- as a matter of fact, everything except a single
> switch statement.
>
>     public boolean apply(final Interpretation inter, final boolean
> maketrue)
> throws ContradictionException, NotWFFException
>     {
> switch (maketrue ? op : negop()) {
>     case AND:
>         return true;
> }
>     }
>
> It seems to have something to do with the argument to switch:  If I
> switch on "op" rather than "maketrue ? op : negop()", the bug isn't
> triggered.
>
> Here are the definitions of op and negop():
>
>     private final int op;
>     public /*accessor*/ int negop() {
> switch (op) {
> case AND: return NAND;
> case OR: return NOR;
> case IMP: return NIMP;
> case REVIMP: return NREVIMP;
> case NAND: return AND;
> case NOR: return OR;
> case NIMP: return IMP;
> case NREVIMP: return REVIMP;
> case EQ: return NEQ;
> case NEQ: return EQ;
> default: throw new ProgramError("Illegal operator: " + op);
> }
>     }
>
>
>
> _______________________________________________
> Eap-list mailing list
> [EMAIL PROTECTED]
> http://www.intellij.com/mailman/listinfo/eap-list


_______________________________________________
Eap-list mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-list

Reply via email to