Janino

continue statement not enclosed bug

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    WinXP
  • Testcase included:
    yes
  • Number of attachments :
    3

Description

I recently tried to update to Janino 2.4.5, but ran into a new regression. As a result, I have to keep using
a very old 2.3.18 release. I have included a small test case that shows the error:

$ janinoc Loop22.java
File Loop22.java, Line 12, Column 21: "continue" statement is not enclosed by a continuable statement
org.codehaus.janino.CompileException: 1 errors while compiling unit "Loop22.java
"

  1. Loop22.java
    13/Jul/06 6:46 PM
    0.5 kB
    Mo DeJong
  2. scope_iterator.patch
    17/Jul/06 7:57 PM
    3 kB
    Mo DeJong
  3. ScopeIterator.java
    17/Jul/06 7:57 PM
    2 kB
    Mo DeJong

Activity

Hide
Mo DeJong added a comment -

Save as:

janino\src\org\codehaus\janino\util\iterator\ScopeIterator.java

and:

janino\src\org\codehaus\janino\scope_iterator.patch

Then apply scope_iterator.patch to UnitCompiler.java.

This fixes up the ugly scope iteration issues for the break
and continue statements in try blocks.

Show
Mo DeJong added a comment - Save as: janino\src\org\codehaus\janino\util\iterator\ScopeIterator.java and: janino\src\org\codehaus\janino\scope_iterator.patch Then apply scope_iterator.patch to UnitCompiler.java. This fixes up the ugly scope iteration issues for the break and continue statements in try blocks.
Hide
Arno Unkrig added a comment -

Sorry for the late response.

The fix will go into 2.4.6.

The concept of your "ScopeIterator" is nice but not completely correct: It is not correct to iterate while "s instanceof Scope", but actually the conditions of when to terminate the iteration is very different depending on what you do (look up a type, a local variable, a breakable statement...). That's why I have not isolated that functionality in a "ScopeIterator" or alike.

However I am confident that now most of all bugs related to the introduction of the CatchClause (if not all) are now fixed.

CU

Arno

Show
Arno Unkrig added a comment - Sorry for the late response. The fix will go into 2.4.6. The concept of your "ScopeIterator" is nice but not completely correct: It is not correct to iterate while "s instanceof Scope", but actually the conditions of when to terminate the iteration is very different depending on what you do (look up a type, a local variable, a breakable statement...). That's why I have not isolated that functionality in a "ScopeIterator" or alike. However I am confident that now most of all bugs related to the introduction of the CatchClause (if not all) are now fixed. CU Arno
Hide
Arno Unkrig added a comment -

Fixed with JANINO 2.4.6.

Show
Arno Unkrig added a comment - Fixed with JANINO 2.4.6.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: