Sun JDK 1.4.2 javac compiler bug

X

xarax

The following compiles cleanly with Sun JDK 1.4.1 javac,
but 1.4.2 elicits an error message about the variable
"xx" may have already been assigned:

=================================
public void fubar()
{
final int xx;
int jj;

jj = 0;
while(0 != jj)
{
final int nn;

nn = jj+1;
}
if(0 < jj)
{
xx = 1;
}
else
{
xx = 2;
}
}
=================================

Removing either "final" qualifier circumvents the
problem.

The compilers seems to be confused by the "final"
variable within the while() loop.

WindowsME.
 
A

Andy Flowers

What version of the JDK are you using. I have just downloaded 1.4.2
(1.4.2-b28) and tried this and it compiles with no error. I am using the
WIN32 version.

The version can be found by running 'java -version'.

What is the exact error message you see ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top