-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.3.0
-
x86
-
windows_nt
Name: sl110371 Date: 06/30/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)
/*
The dynamic proxy feature does not work correct with char types.
See the following program and output:
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 Bug.main(Bug.java:34)
java.lang.NoClassDefFoundError: java/lang/Char
at $Proxy1.get(Unknown Source)
at Bug.main(Bug.java:46)
*/
import java.lang.reflect.*;
public class Bug
{
public interface IPut
{
void put(char c);
}
public interface IGet
{
char get();
}
static private final InvocationHandler DummyInvocationHandler =
new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object
[] args)
throws Throwable
{
return null;
}
};
public static void main(String[] args)
{
try {
// instanciation of proxy does not work
Proxy.newProxyInstance(
ClassLoader.getSystemClassLoader(),
new Class[] {IPut.class},
DummyInvocationHandler
);
} catch (Throwable e) {
e.printStackTrace();
}
try {
// method call of proxy does not work
(
(IGet)Proxy.newProxyInstance(
ClassLoader.getSystemClassLoader(),
new Class[] {IGet.class},
DummyInvocationHandler
)
).get();
} catch (Throwable e) {
e.printStackTrace();
}
}
}
(Review ID: 106689)
======================================================================
- duplicates
-
JDK-4346224 a Proxy class references java/lang/Char instead of java/lang/Character
-
- Closed
-