-
Bug
-
Resolution: Cannot Reproduce
-
P4
-
None
-
6u22
-
x86
-
windows_7
FULL PRODUCT VERSION :
java version "1.6.0_20"
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7600]
Linux 2.6.32-25-generic Ubuntu x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
I habe written a source code, that complains abount a final variable, that might already have been assigned.
If I change something (delete a line or change the order) it compiles.
I cutted the code to this small version, to improve readability.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just compile
ACTUAL -
Compiler-Error:
ERROR MESSAGES/STACK TRACES THAT OCCUR :
"variable x might already have been assigned"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
private final Object x;
private Test() {
{
int inx = 0;
for(int i = 0; i < 5; i++) {
}
}
for(String am: new String[1]) {
final String mode = am;
}
x = null;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Change anything.
java version "1.6.0_20"
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7600]
Linux 2.6.32-25-generic Ubuntu x86_64 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
I habe written a source code, that complains abount a final variable, that might already have been assigned.
If I change something (delete a line or change the order) it compiles.
I cutted the code to this small version, to improve readability.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Just compile
ACTUAL -
Compiler-Error:
ERROR MESSAGES/STACK TRACES THAT OCCUR :
"variable x might already have been assigned"
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class Test {
private final Object x;
private Test() {
{
int inx = 0;
for(int i = 0; i < 5; i++) {
}
}
for(String am: new String[1]) {
final String mode = am;
}
x = null;
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Change anything.
- relates to
-
JDK-7003744 Compiler error concerning final variables
-
- Closed
-