-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
ladybird
-
x86
-
windows_nt, windows_2000
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2034878 | 1.4.0 | Zhenghua Li | P3 | Closed | Fixed | beta |
Name: skT45625 Date: 06/16/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
following source crashes when executed
/*
* InvalidProxy.java
*
* Created on June 16, 2000, 10:04 AM
*/
import java.lang.reflect.*;
/**
*
* @author anovak
* @version
*/
public class InvalidProxy extends Object {
/** Creates new InvalidProxy */
public InvalidProxy() {
}
/**
* @param args the command line arguments
*/
public static void main (String args[]) {
Proxy.newProxyInstance(CharMethod.class.getClassLoader(), new Class[] {
CharMethod.class }, new H());
System.out.println("OK");
}
static interface CharMethod {
void setChar(char c);
}
static class H implements InvocationHandler {
public Object invoke(Object o, Method m, Object[] arr) {
return null;
}
}
}
the exception:
Exception in thread "main" java.lang.NoClassDefFoundError: java/lang/Char
at $Proxy0.<clinit>(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:562)
at InvalidProxy.main(InvalidProxy.java:24)
problem is in
sun.misc.ProxyGenerator.PrimitiveTypeInfo
static {
table = new HashMap(11);
...
table.put(Character.TYPE, new PrimitiveTypeInfo("C", "java/lang/Char", "(C)
V", "charValue", "()C"));
...
}
it works if I change it to java/lang/Character...
(Review ID: 106233)
======================================================================
- backported by
-
JDK-2034878 a Proxy class references java/lang/Char instead of java/lang/Character
-
- Closed
-
- duplicates
-
JDK-4349880 The dynamic proxy feature does not work correct with char types.
-
- Closed
-