-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.3.0
-
x86
-
linux
Name: kaC94536 Date: 05/05/2000
java version "1.3.0beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0beta-b03)
Java HotSpot(TM) Client VM (build 1.3.0beta-b01, mixed mode)
The VM specification reads:
...
new
Operation
...
Otherwise, if the symbolic reference to the class, array, or interface
type resolves to an interface or is an abstract class, "new" throws an
InstantiationError.
...
The following test shows that instruction "new" being invoked for an interface
throws InstantiationException instead of InstantiationError.
------------------ test.java (should be compiled first) ---------------
class test {
public static void main(String a[]) {
new i();
}
}
class i {}
------------------- i.java (should be compiled second) -----------------
interface i {}
-------------------------- output --------------------------------------
Exception in thread "main" java.lang.InstantiationException: i
at test.main(test.java:3)
------------------------------------------------------------------------
The following JCK test fails due to this bug:
vm/classfmt/ins/instr_020/instr_02001m1/instr_02001m1.html
======================================================================
======================================================================
- duplicates
-
JDK-4331554 [sparc/b11] 6 JCK tests failed. java.lang.InstantiationException
- Closed