History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

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

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

Janino issues "Error: For update is unreachable" where JAVAC keeps compiling

Created: 11/May/06 04:14 PM   Updated: 16/May/06 03:34 PM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide
Arno

I have created a bunch of test cases related to loop
processing in Janino. I also created a patch that
seems to fix all the loop related bugs that I was
running into. The patch and test files can be
found here:

http://www.modejong.com/tcljava/janino/

This patch fixes almost every case where Janino
was incorrectly generating an error in my code.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Arno Unkrig - 11/May/06 04:26 PM
Thank you for the HUGE bunch of test cases. I agree with you: The FOR updates are definitely unreachable (so JANINO is right to issue an error), but JAVAC just kicks them out. I believe it is not a good idea to silently ignore code that the programmer has written, because this almost certainly a programming error.

I changed Janino's behavior such that it ignores the unreachable update, but issues a warning (use "-warn:*" to turn warnings on).

I checked the patch that you proposed, but found a much simpler solution for JANINO-54:

UnitCompiler.java
// Yes, compile rest of method to /dev/null.
throw UnitCompiler.STOP_COMPILING_CODE;

No more "keepCompiling" and "followingStatementsAreDead".


Arno Unkrig - 11/May/06 04:27 PM
Fix release in 2.4.3.

Arno Unkrig - 16/May/06 03:34 PM
Fix will be released in version 2.4.4 (not scheduled yet).