-
Bug
-
Resolution: Fixed
-
P2
-
13
-
b26
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8241340 | 11.0.8 | Harold Seigel | P2 | Resolved | Fixed | b01 |
Below code snippet is expected to generate ClassFormatError on class loading. Instead we observe java.lang.NoClassDefFoundError.
Parameter to method 'func' here is a reference to empty class name ie, "L;". As per JVMS: "4.2.1 Binary Class and Interface Names", individual identifiers of the binary class name should be minimum 1 unicode character. Hence a class loading error is more apt for this scenario.
--------------------------------------------------
super public class method_param
version 56:0
{
public Method "<init>":"()V"
stack 1 locals 1
{
aload_0;
invokespecial Method java/lang/Object."<init>":"()V";
return;
}
public static Method main:"([Ljava/lang/String;)V"
stack 2 locals 1
{
getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
ldc String "Testing method param types";
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
return;
}
public static Method func:"(L;)V"
stack 0 locals 1
{
return;
}
} // end Class method_param
-----------------------------------------
Parameter to method 'func' here is a reference to empty class name ie, "L;". As per JVMS: "4.2.1 Binary Class and Interface Names", individual identifiers of the binary class name should be minimum 1 unicode character. Hence a class loading error is more apt for this scenario.
--------------------------------------------------
super public class method_param
version 56:0
{
public Method "<init>":"()V"
stack 1 locals 1
{
aload_0;
invokespecial Method java/lang/Object."<init>":"()V";
return;
}
public static Method main:"([Ljava/lang/String;)V"
stack 2 locals 1
{
getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
ldc String "Testing method param types";
invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
return;
}
public static Method func:"(L;)V"
stack 0 locals 1
{
return;
}
} // end Class method_param
-----------------------------------------
- backported by
-
JDK-8241340 Empty method parameter type should generate ClassFormatError
- Resolved
- duplicates
-
JDK-8227510 [JCK-runtime] vm/classfmt/cpl/cplsym001/cplsym00103m025/cplsym00103m025.html test is failing with jdk 13.0.1 1
- Closed
- relates to
-
JDK-8227510 [JCK-runtime] vm/classfmt/cpl/cplsym001/cplsym00103m025/cplsym00103m025.html test is failing with jdk 13.0.1 1
- Closed