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

REGRESSION:Ctor IndexedPropertyDescriptor works incorrectly

XMLWordPrintable

    • 11
    • sparc
    • solaris_2.6
    • Verified



        Name: dsR10051 Date: 11/20/2003


        Filed By : SPB JCK team (###@###.###)
        JDK : java full version "1.5.0-beta-b28"
        JCK : 1.5
        Platform[s] : Solaris
        switch/Mode :
        JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
        Failing Test [s] :
            api/java_beans/IndexedPropertyDescriptor/descriptions.html#Ctor2[IndexedPropertyDescriptor0005]


        Problem description
        ===================
        public IndexedPropertyDescriptor(String propertyName,
                                         Class beanClass,
                                         String readMethodName,
                                         String writeMethodName,
                                         String indexedReadMethodName,
                                         String indexedWriteMethodName)
                                  throws IntrospectionException

        throws unexpected IntrospectionException if indexedReadMethodName is null.
        Minimized test demonstrates this bug.
            
        Minimized test:
        ===============
        ------- Test.java -------
        import java.beans.*;

        public class IndexedPropertyDescriptorTest03 {

            public static void main(String[] args) {
                IndexedPropertyDescriptor ipd = null;
                String propertyName = "a";
                Class beanClass = Wombat.class;
                String readMethodName = "getChild";
                String writeMethodName = "setChild";
                String indexedReadMethodName = null;
                String indexedWriteMethodName = "setChild";

                try {
                    ipd = new IndexedPropertyDescriptor(propertyName, beanClass,
                            readMethodName, writeMethodName,
                            indexedReadMethodName, indexedWriteMethodName);
                } catch (IntrospectionException ie) {
                    System.err.println("Unexpected exception");
                    ie.printStackTrace();
                    System.exit(1);
                }
                System.out.println("OKAY");
            }
        }
        Wombat.java
        public class Wombat {

            Wombat[] child = new Wombat[10];

            public Wombat getChild(int index) {
                return child[index];
            }

            public void setChild(int index, Wombat w) {
                child[index] = w;
            }

            public Wombat[] getChild() {
                return child;
            }

            public void setChild(Wombat[] child) {
                this.child = child;
            }

        }

        ------- end-of-Test.java -------

        Minimized test output:
        ======================
        /set/jdk-builds/JDK1.5.0b28/solaris-sparc/bin/java IndexedPropertyDescriptorTest03
        Unexpected exception
        java.beans.IntrospectionException: Method not found: setChild
                at java.beans.IndexedPropertyDescriptor.<init>(IndexedPropertyDescriptor.java:92)
                at IndexedPropertyDescriptorTest03.main(IndexedPropertyDescriptorTest03.java:15)


        JCK test source location:
        ==========================
        /java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests

        Additional comments:
        ====================
        Minimized test passed under JDK1.5.0b26

        ======================================================================

              mdavidsosunw Mark Davidson (Inactive)
              sdasunw Sda Sda (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: