[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools] Re: DEFECT REPORT: compiler generating invalid bytecode
|
- From: Jim Sculley <niceguy@xxxxxxxxxxx>
- Date: Tue, 21 Aug 2001 11:06:23 -0400
- Newsgroups: eclipse.tools
- Organization: EclipseCorner
- User-agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.3) Gecko/20010801
Olivier Thomann wrote:
<snip>
I still have trouble to reproduce the problem. Something seems to be wrong
anyway. Could you please send me the .class files you got when it failed? I'd
like to have a look at them. Meanwhile I'll try to get the Sun 1.3.1 VM. With
the IBM 1.3 VM:
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cn130-20010609 (JIT enabled:
jitc))
I don't have any problem.
These are the VM's I've tried:
Java(tm) Runtime Loader Version 1.1.8_005
Classic VM (build JDK-1.2.2_005, native threads, symcjit)
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_01)
Java HotSpot(TM) Client VM (build 1.3.0_01, mixed mode)
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-rc1-b21)
Java HotSpot(TM) Client VM (build 1.3.1-rc1-b21, mixed mode)
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0)
Classic VM (build 1.3.0, J2RE 1.3.0 IBM build cn130-20000814 (JIT
enabled: jitc))
I consider that you compile this code:
public class LocalBug {
public static void main(String[] args) {
int foo;
for (int i = 0; i < 1; i++) {
try {
foo = 1;
} catch (Exception e) {
continue;
}
}
}
}
Aha! There's the problem. This code isn't quite right. Move the
declaration of 'foo' inside the 'for' loop like this:
public class LocalBug {
public static void main(String[] args) {
for (int i = 0; i < 1; i++) {
int foo;
try {
foo = 1;
} catch (Exception e) {
continue;
}
}
}
}
My apologies for the bad test case. It got scrambled somwhere along the
way, and this explains why it worked on my home machine as well, since I
cut and pasted my own incorrect test case. If this code doesn't fail,
please let me know and I will go ahead and send you my class file. Once
again, my apologies for wasting your time with the bad test case.
Jim S.