Janino

compilation of overridden static methods done as invokevirtual

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    2

Description

Decompiling Bug.class after compiling the attached patch, with org.codehaus.janino.Compiler Bug.java. In Bug.bug(), the call to call(String)) is compiled as INVOKEVIRTUAL; it should be compiled as INVOKESTATIC.

If I explicitly do BaseTwo.call(String), then instead of a runtime error, I get a compile time error; the message being: 'Instance method "call" cannot be called in a static context.'

  1. Bug.java
    29/Jul/07 8:41 PM
    0.5 kB
    Adam Heath
  2. foo.patch
    30/Jul/07 12:17 AM
    1 kB
    Adam Heath

Activity

Hide
Adam Heath added a comment -

This patch fixes the problem. findMostSpecificIInvocable() returns a new IMethod, with a new set of thrown exceptions; however, it always hard-codes isAbstract and isStatic.

Show
Adam Heath added a comment - This patch fixes the problem. findMostSpecificIInvocable() returns a new IMethod, with a new set of thrown exceptions; however, it always hard-codes isAbstract and isStatic.
Hide
Arno Unkrig added a comment -

Thank you! Tested the patch against the regression test suite... works like a breeze.

Will go out in the next release (2.5.10, not scheduled yet).

CU

Arno

Show
Arno Unkrig added a comment - Thank you! Tested the patch against the regression test suite... works like a breeze. Will go out in the next release (2.5.10, not scheduled yet). CU Arno

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: