Issue Details (XML | Word | Printable)

Key: JANINO-98
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Arno Unkrig
Reporter: Adam Heath
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Janino

compilation of overridden static methods done as invokevirtual

Created: 29/Jul/07 08:41 PM   Updated: 30/Jul/07 03:58 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Java Source File Bug.java (0.5 kB)
2. Text File foo.patch (1 kB)



 Description  « Hide
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.'



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Adam Heath added a comment - 30/Jul/07 12:17 AM
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.

Arno Unkrig added a comment - 30/Jul/07 03:58 PM
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