Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4346224

a Proxy class references java/lang/Char instead of java/lang/Character

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.3.1
    • 1.3.0
    • core-libs
    • ladybird
    • x86
    • windows_nt, windows_2000
    • Verified



        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)
        ======================================================================

              zlisunw Zhenghua Li (Inactive)
              skondamasunw Suresh Kondamareddy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: