Menu

#59 Using expressions to set static final variable can fail

closed-fixed
nobody
5
2004-09-17
2004-09-17
No

The following code doesn't compile. The error reported
is: <clinit>(): Unexamined code at offset 3

class Test1 {
static final boolean _true = true;
static final boolean _false = !_true;
}

Discussion

  • Chris Thiessen

    Chris Thiessen - 2004-09-17
    • labels: --> Software bugs
     
  • Arno Unkrig

    Arno Unkrig - 2004-09-17
    • status: open --> closed-fixed
     
  • Arno Unkrig

    Arno Unkrig - 2004-09-17

    Logged In: YES
    user_id=865893

    JANINO realized that "_true" is a constant value, but didn't
    realize that "!_true" is a constant value, too. This lead to
    an unconditional branch which left the opcode right behind
    it unexamined.
    Will release in 2.0.11.

     

Log in to post a comment.

MongoDB Logo MongoDB