Hello everybody,

It's not a bug related to IntelliJ, but related to Jikes 116. I wanted to
let you know that.
Here is the bug one of my colleagues discovered:

Guillaume

>Subject: [Bug #3134] Loop counter not incremented when for/while ends with
>catch
>
> Bug #3134 has been published.
> Here is a current snapshot of the bug.
>
> Project: Jikes
> Category: None
> Status: Open
> Resolution: None
> Bug Group: None
> Priority: 5
> Summary: Loop counter not incremented when for/while ends with catch
>
> Details: After spending ages trying to debug an infinite loop, I
discovered that the problem's due to Jikes (1.16).  The problem isn't there
if I switch over to Sun's "javac" (version 1.4.0_01, on Win2000).  First of
all, here's a code snippet that demonstrates the bug:
> ________________________________________
>
> public class JikesTest1
> {
>  public static void main(String args[])
>  {
>   int[] array = new int[]{0,1,2,3,4,5};
>   for (int i = 0, length = array.length; i < length; i++)
>   {
>    try
>    {
>     System.out.print(array[i] + ", ");
>    }
>    catch (RuntimeException rtex)
>    {
>     System.err.println(rtex.toString());
>     continue;
>    }
> // System.out.println(i);
>   }
>  }
> }
> ________________________________________
>
> The expected output is:
> 0, 1, 2, 3, 4, 5,
>
> When compiled with Javac, and run as "java JikesTest1", the output is as
expected.  When compiled with jikes 1.16 (command "jikes JikesTest1.java"),
the result is an infinite loop: "i" is never incremented.
>
> Now, if I uncomment the last "System.out.println(i);" line, suddenly it
all works as expected.  I can also make it work by commenting out the
"continue;" statement in the "catch" block.  Neither of these should make
any difference: I agree that the "continue" in the catch block is redundant
in this example (but isn't in more complex real-life code), but it
*shouldn't* be an error.  No warnings are generated anyway.
>
> The same thing can happen in "while" and "do...while" loops.  Some similar
"do...while" loops compiled by Jikes also cause VerifyErrors to be thrown
when the compiled code is run.
>
> - Chris B.
>
> For detailed info, follow this link:
> http:///developerworks/bugs/?func=detailbug&bug_id=3134&group_id=10
>
>


_______________________________________________
Eap-bugs mailing list
[EMAIL PROTECTED]
http://lists.jetbrains.com/mailman/listinfo/eap-bugs

Reply via email to