-
Bug
-
Resolution: Fixed
-
P3
-
8u25
-
b46
-
x86_64
-
windows_7
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085311 | emb-9 | Maurizio Cimadamore | P3 | Resolved | Fixed | team |
JDK-8156452 | 8u111 | Ramanand Patil | P3 | Resolved | Fixed | b01 |
JDK-8151012 | 8u102 | Ramanand Patil | P3 | Resolved | Fixed | b01 |
JDK-8162328 | emb-8u111 | Ramanand Patil | P3 | Resolved | Fixed | b01 |
FULL PRODUCT VERSION :
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 64bit (Microsoft Windows [6.1.7601])
A DESCRIPTION OF THE PROBLEM :
After migration to java 1.8u25, it's impossible to run method containing local final String, used on setter method of some other class. Result of running such code is: "java.lang.VerifyError: Bad local variable type"
REGRESSION. Last worked in version 7u72
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compiling and running attached code ends with error.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Successful execution.
ACTUAL -
Error.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
FinalLocalStringUsedInSetter.test()V @9: aload_1
Reason:
Type top (current frame, locals[1]) is not assignable to reference type
Current Frame:
bci: @9
flags: { }
locals: { 'FinalLocalStringUsedInSetter', top, top, 'FinalLocalStringUsedInSetter$Tmp' }
stack: { 'FinalLocalStringUsedInSetter$Tmp' }
Bytecode:
0x0000000: bb00 0259 b700 034e 2d2b b600 04b1
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
at java.lang.Class.privateGetMethodRecursive(Class.java:3040)
at java.lang.Class.getMethod0(Class.java:3010)
at java.lang.Class.getMethod(Class.java:1776)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
[Loaded java.lang.Shutdown from c:\Program Files\Java\jdk1.8.0_25\jre\lib\rt.jar]
[Loaded java.lang.Shutdown$Lock from c:\Program Files\Java\jdk1.8.0_25\jre\lib\rt.jar]
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class FinalLocalStringUsedInSetter {
static class Tmp {
private String value;
public void setValue(String tmpStr) {
this.value = tmpStr;
}
}
public void test() {
final String y = "Y";
final String n = "N";
Tmp tmp = new Tmp();
tmp.setValue(true ? y : n);
}
public static void main(String[] args) {
new FinalLocalStringUsedInSetter().test();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Remove "final" from local variables.
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Windows 7 64bit (Microsoft Windows [6.1.7601])
A DESCRIPTION OF THE PROBLEM :
After migration to java 1.8u25, it's impossible to run method containing local final String, used on setter method of some other class. Result of running such code is: "java.lang.VerifyError: Bad local variable type"
REGRESSION. Last worked in version 7u72
ADDITIONAL REGRESSION INFORMATION:
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compiling and running attached code ends with error.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Successful execution.
ACTUAL -
Error.
ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
FinalLocalStringUsedInSetter.test()V @9: aload_1
Reason:
Type top (current frame, locals[1]) is not assignable to reference type
Current Frame:
bci: @9
flags: { }
locals: { 'FinalLocalStringUsedInSetter', top, top, 'FinalLocalStringUsedInSetter$Tmp' }
stack: { 'FinalLocalStringUsedInSetter$Tmp' }
Bytecode:
0x0000000: bb00 0259 b700 034e 2d2b b600 04b1
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2693)
at java.lang.Class.privateGetMethodRecursive(Class.java:3040)
at java.lang.Class.getMethod0(Class.java:3010)
at java.lang.Class.getMethod(Class.java:1776)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
[Loaded java.lang.Shutdown from c:\Program Files\Java\jdk1.8.0_25\jre\lib\rt.jar]
[Loaded java.lang.Shutdown$Lock from c:\Program Files\Java\jdk1.8.0_25\jre\lib\rt.jar]
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
public class FinalLocalStringUsedInSetter {
static class Tmp {
private String value;
public void setValue(String tmpStr) {
this.value = tmpStr;
}
}
public void test() {
final String y = "Y";
final String n = "N";
Tmp tmp = new Tmp();
tmp.setValue(true ? y : n);
}
public static void main(String[] args) {
new FinalLocalStringUsedInSetter().test();
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Remove "final" from local variables.
- backported by
-
JDK-8085311 java.lang.VerifyError: Bad local variable type - local final String
- Resolved
-
JDK-8151012 java.lang.VerifyError: Bad local variable type - local final String
- Resolved
-
JDK-8156452 java.lang.VerifyError: Bad local variable type - local final String
- Resolved
-
JDK-8162328 java.lang.VerifyError: Bad local variable type - local final String
- Resolved
- duplicates
-
JDK-8165750 Constant variable (type string) still referenced in code, violating JLS 13.1
- Closed
-
JDK-8149335 VerifyError with java/io/PrintStream println()
- Closed
(1 duplicates)