JDK-4926562 : REGRESSION: 4 JCK1.5-runtime api/java_beans/IndexedPropertyDescriptor tests fail
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.beans
  • Affected Version: 5.0
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-09-23
  • Updated: 2003-11-14
  • Resolved: 2003-11-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b28Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description

Name: mmR10223			Date: 09/23/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.5.0-b20 (passes using JDK1.5.0-b14, JDK1.4.2-b28 )
JCK            : JCK1.5-runtime
Platform[s]    : all
switch/Mode    : default
JCK test owner : http://javaweb.eng/jck/usr/owners.jto
Falling test[s]: 
        api/java_beans/IndexedPropertyDescriptor/descriptions.html#Ctor1 [IndexedPropertyDescriptor2002, IndexedPropertyDescriptor2003, IndexedPropertyDescriptor2004, IndexedPropertyDescriptor2005, IndexedPropertyDescriptor2006, IndexedPropertyDescriptor2007, IndexedPropertyDescriptor2008, IndexedPropertyDescriptor2009, IndexedPropertyDescriptor2010, IndexedPropertyDescriptor2011, IndexedPropertyDescriptor2012, IndexedPropertyDescriptor2013]
        api/java_beans/IndexedPropertyDescriptor/descriptions.html#Ctor2 [ IndexedPropertyDescriptor0007, IndexedPropertyDescriptor2023, IndexedPropertyDescriptor2024, IndexedPropertyDescriptor2025, IndexedPropertyDescriptor2026, IndexedPropertyDescriptor2027, IndexedPropertyDescriptor2028, IndexedPropertyDescriptor2029, IndexedPropertyDescriptor2030, IndexedPropertyDescriptor2031, IndexedPropertyDescriptor2032, IndexedPropertyDescriptor2033, IndexedPropertyDescriptor2034, IndexedPropertyDescriptor1006, IndexedPropertyDescriptor1007]
	api/java_beans/IndexedPropertyDescriptor/descriptions.html#Ctor3 [IndexedPropertyDescriptor0015, IndexedPropertyDescriptor2044, IndexedPropertyDescriptor2045, IndexedPropertyDescriptor2046, IndexedPropertyDescriptor2047, IndexedPropertyDescriptor2048, IndexedPropertyDescriptor2049, IndexedPropertyDescriptor2050, IndexedPropertyDescriptor2051]
	api/java_beans/IndexedPropertyDescriptor/descriptions.html#setget [IndexedPropertyDescriptor0017, IndexedPropertyDescriptor2053, IndexedPropertyDescriptor2054, IndexedPropertyDescriptor2055, IndexedPropertyDescriptor2056, IndexedPropertyDescriptor0019, IndexedPropertyDescriptor2058, IndexedPropertyDescriptor2059, IndexedPropertyDescriptor2060]

This failure looks like the bug 4910242 which is integrated and verified.


Also there are test cases which fail by reason of the bug 4641084:
api/java_beans/IndexedPropertyDescriptor/descriptions.html#Ctor2 [IndexedPropertyDescriptor0005]
api/java_beans/IndexedPropertyDescriptor/descriptions.html#Ctor3 [IndexedPropertyDescriptor0013]
api/java_beans/IndexedPropertyDescriptor/descriptions.html#setget [IndexedPropertyDescriptor0016]


Please, see also 4641084, 4619536.

Test source location:
=====================
/java/re/jck/1.5/promoted/latest/binaries/JCK-runtime-15/tests/api/java_beans/IndexedPropertyDescriptor/Ctor1Tests.java
/java/re/jck/1.5/promoted/latest/binaries/JCK-runtime-15/tests/api/java_beans/IndexedPropertyDescriptor/Ctor2Tests.java
/java/re/jck/1.5/promoted/latest/binaries/JCK-runtime-15/tests/api/java_beans/IndexedPropertyDescriptor/Ctor3Tests.java
/java/re/jck/1.5/promoted/latest/binaries/JCK-runtime-15/tests/api/java_beans/IndexedPropertyDescriptor/setgetTests.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b20/jck15/sparc/sol9_sparc_gnome_client_concgc_X--UseParNewGC_novo48/workDir/api/java_beans/IndexedPropertyDescriptor/descriptions_Ctor1.jtr
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b20/jck15/sparc/sol9_sparc_gnome_client_concgc_X--UseParNewGC_novo48/workDir/api/java_beans/IndexedPropertyDescriptor/descriptions_Ctor2.jtr
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b20/jck15/sparc/sol9_sparc_gnome_client_concgc_X--UseParNewGC_novo48/workDir/api/java_beans/IndexedPropertyDescriptor/descriptions_Ctor3.jtr
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b20/jck15/sparc/sol9_sparc_gnome_client_concgc_X--UseParNewGC_novo48/workDir/api/java_beans/IndexedPropertyDescriptor/descriptions_setget.jtr


How to reproduce:
=================
Run the following script (you may need to change its variables)
 
--- script start ---
#!/bin/bash

#KOORI_ONESTOP is your path to koori.sfbay/onestop (/net/koori/onestop, /java/re)
KOORI_ONESTOP="/java/re"

#JCK="/net/linux-15/export/home/java/jck1.5/JCK-runtime-15"
JCK="$KOORI_ONESTOP/jck/1.5/promoted/beta/b04/binaries/JCK-runtime-15"
#JDK="/net/linux-15/export/home/java/jdk1.5.0/sparc"
JDK="$KOORI_ONESTOP/jdk/1.5.0/promoted/all/b20/binaries/solaris-sparc"

CLASSPATH="$JCK/classes:$JCK/lib/javatest.jar"
 
$JDK/bin/java $switches -cp $CLASSPATH javasoft.sqe.tests.api.java.beans.IndexedPropertyDescriptor.Ctor1Tests -TestCaseID IndexedPropertyDescriptor2002 IndexedPropertyDescriptor2003 IndexedPropertyDescriptor2004 IndexedPropertyDescriptor2005 IndexedPropertyDescriptor2006 IndexedPropertyDescriptor2007 IndexedPropertyDescriptor2008 IndexedPropertyDescriptor2009 IndexedPropertyDescriptor2010 IndexedPropertyDescriptor2011 IndexedPropertyDescriptor2012 IndexedPropertyDescriptor2013

--- script end ---

Test output:
============
IndexedPropertyDescriptor2002: Failed. IndexedPropertyDescriptor2002 failed
IndexedPropertyDescriptor2003: Failed. IndexedPropertyDescriptor2003 failed
IndexedPropertyDescriptor2004: Failed. IndexedPropertyDescriptor2004 failed
IndexedPropertyDescriptor2005: Failed. IndexedPropertyDescriptor2005 failed
IndexedPropertyDescriptor2006: Failed. IndexedPropertyDescriptor2006 failed
IndexedPropertyDescriptor2007: Failed. IndexedPropertyDescriptor2007 failed
IndexedPropertyDescriptor2008: Failed. IndexedPropertyDescriptor2008 failed
IndexedPropertyDescriptor2009: Failed. IndexedPropertyDescriptor2009 failed
IndexedPropertyDescriptor2010: Failed. IndexedPropertyDescriptor2010 failed
IndexedPropertyDescriptor2011: Failed. IndexedPropertyDescriptor2011 failed
IndexedPropertyDescriptor2012: Failed. IndexedPropertyDescriptor2012 failed
IndexedPropertyDescriptor2013: Failed. IndexedPropertyDescriptor2013 failed


Specific machine info:
======================
Hostname: novo48
OS: Solaris 9 (sparc) (GNOME)


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

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b28 tiger-beta VERIFIED IN: tiger-beta
14-06-2004

EVALUATION Very similar to 4910242. In fact, that bug mentions these same test failures - which were not fixed in the noise. Many of these issues can be resolved by placing type checking in findPropertyType in the constructors and the setIndexedReadMethod, setIndexedWritedMethod. Note: the baseline of test failures in 1.4.2: 1.4.2: *** Running test javasoft.sqe.tests.api.java.beans.IndexedPropertyDescriptor.Ctor2Tests IndexedPropertyDescriptor0005: Failed. Test case throws exception: java.lang.NullPointerException *** Running test javasoft.sqe.tests.api.java.beans.IndexedPropertyDescriptor.Ctor3Tests IndexedPropertyDescriptor0013: Failed. Test case throws exception: java.lang.NullPointerException *** Running test javasoft.sqe.tests.api.java.beans.IndexedPropertyDescriptor.EqualsTests IndexedPropertyDescriptor0023: Failed. IndexedPropertyDescriptor0023 failed IndexedPropertyDescriptor0024: Failed. IndexedPropertyDescriptor0024 failed *** Running test javasoft.sqe.tests.api.java.beans.IndexedPropertyDescriptor.setgetTests IndexedPropertyDescriptor0016: Failed. Test case throws exception: java.lang.NullPointerException Another note: test 0023 in the EqualsTest is invalid: For an IndexedPropertyDescriptor (ipd) and a PropertyDescriptor (pd) which uses the same 2 arg ctor of the same class and property. The test claims that this expression should fail: ipd.equals(pd) == false, pd.euals(ipd) == true. The second clause is true and it should be. An IndexedPropertyDescriptor should be logically equivalent to a PropertyDescriptor. Hmmm... perhaps the first class should also be true? ###@###.### 2003-09-26
26-09-2003

SUGGESTED FIX *** /tmp/geta11915 2003-09-26 16:26:52.000000000 -0700 --- IndexedPropertyDescriptor.java 2003-09-26 15:23:09.000000000 -0700 *************** *** 84,98 **** String indexedReadMethodName, String indexedWriteMethodName) throws IntrospectionException { super(propertyName, beanClass, readMethodName, writeMethodName); this.indexedReadMethodName = indexedReadMethodName; this.indexedWriteMethodName = indexedWriteMethodName; } /** * This constructor takes the name of a simple property, and Method * objects for reading and writing the property. * ! * @param propertyName The programmatic name of the property. * @param readMethod The method used for reading the property values as an array. * May be null if the property is write-only or must be indexed. * @param writeMethod The method used for writing the property values as an array. --- 84,109 ---- String indexedReadMethodName, String indexedWriteMethodName) throws IntrospectionException { super(propertyName, beanClass, readMethodName, writeMethodName); + this.indexedReadMethodName = indexedReadMethodName; + if (indexedReadMethodName != null && getIndexedReadMethod() == null) { + throw new IntrospectionException("Method not found: " + indexedReadMethodName); + } + this.indexedWriteMethodName = indexedWriteMethodName; + if (indexedWriteMethodName != null && getIndexedWriteMethod() == null) { + throw new IntrospectionException("Method not found: " + indexedWriteMethodName); + } + // Implemented only for type checking. + findIndexedPropertyType(getIndexedReadMethod(), getIndexedWriteMethod()); } /** * This constructor takes the name of a simple property, and Method * objects for reading and writing the property. * ! * @param propertyName The programmatic name of the pro ! perty. * @param readMethod The method used for reading the property values as an array. * May be null if the property is write-only or must be indexed. * @param writeMethod The method used for writing the property values as an array. *************** *** 108,115 **** Method indexedReadMethod, Method indexedWriteMethod) throws IntrospectionException { super(propertyName, readMethod, writeMethod); ! setIndexedReadMethod(indexedReadMethod); ! setIndexedWriteMethod(indexedWriteMethod); } /** --- 119,130 ---- Method indexedReadMethod, Method indexedWriteMethod) throws IntrospectionException { super(propertyName, readMethod, writeMethod); ! ! setIndexedReadMethod0(indexedReadMethod); ! setIndexedWriteMethod0(indexedWriteMethod); ! ! // Implemented only for type checking. ! findIndexedPropertyType(indexedReadMethod, indexedWriteMethod); } /** *************** *** 123,129 **** public synchronized Method getIndexedReadMethod() { Method indexedReadMethod = getIndexedReadMethod0(); if (indexedReadMethod == null) { ! Class cls = getClass0(); if (cls == null || (indexedReadMethodName == null && indexedReadMethodRef == null)) { // the Indexed readMethod was explicitly set to null. --- 138,147 ---- public synchronized Method getIndexedReadMethod() { Method indexedReadMethod = getIndexedReadMethod0(); if (indexedReadMethod == null) { ! Class cls = getReadClass0(); ! if (cls == null) { ! cls = getClass0(); ! } if (cls == null || (indexedReadMethodName == null && indexedReadMethodRef == null)) { // the Indexed readMethod was explicitly set to null. *************** *** 148,158 **** indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args); } ! try { ! setIndexedReadMethod(indexedReadMethod); ! } catch (IntrospectionException ex) { ! // fall through. ! } } return indexedReadMethod; } --- 166,172 ---- indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args); } ! setIndexedReadMethod0(indexedReadMethod); } return indexedReadMethod; } *************** *** 164,183 **** */ public synchronized void setIndexedReadMethod(Method readMethod) throws IntrospectionException { if (readMethod == null) { indexedReadMethodName = null; indexedReadMethodRef = null; return; } ! if (getClass0() == null) { ! setClass0(readMethod.getDeclaringClass()); ! } indexedReadMethodName = readMethod.getName(); indexedReadMethodRef = createReference(readMethod); - // the indexed property type is set by the reader. - setIndexedPropertyType(readMethod.getReturnType()); } /** * Gets the method that should be used to write an indexed property value. * --- 178,203 ---- */ public synchronized void setIndexedReadMethod(Method readMethod) throws IntrospectionException { + + // the indexed property type is set by the reader. + setIndexedPropertyType(findIndexedPropertyType(readMethod, + getIndexedWriteMethod0())); + setIndexedReadMethod0(readMethod); + } + + private void setIndexedReadMethod0(Method readMethod) { if (readMethod == null) { indexedReadMethodName = null; indexedReadMethodRef = null; return; } ! setReadClass0(readMethod.getDeclaringClass()); ! indexedReadMethodName = readMethod.getName(); indexedReadMethodRef = createReference(readMethod); } + /** * Gets the method that should be used to write an indexed property value. * *************** *** 188,194 **** public synchronized Method getIndexedWriteMethod() { Method indexedWriteMethod = getIndexedWriteMethod0(); if (indexedWriteMethod == null) { ! Class cls = getClass0(); if (cls == null || (indexedWriteMethodName == null && indexedWriteMethodRef == null)) { // the Indexed writeMethod was explicitly set to null. --- 208,217 ---- public synchronized Method getIndexedWriteMethod() { Method indexedWriteMethod = getIndexedWriteMethod0(); if (indexedWriteMethod == null) { ! Class cls = getWriteClass0(); ! if (cls == null) { ! cls = getClass0(); ! } if (cls == null || (indexedWriteMethodName == null && indexedWriteMethodRef == null)) { // the Indexed writeMethod was explicitly set to null. *************** *** 215,227 **** } Class[] args = { int.class, type }; ! try { ! indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName, ! 2, args); ! setIndexedWriteMethod(indexedWriteMethod); ! } catch (IntrospectionException ex) { ! // fall through ! } } return indexedWriteMethod; } --- 238,246 ---- } Class[] args = { int.class, type }; ! indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName, ! 2, args); ! setIndexedWriteMethod0(indexedWriteMethod); } return indexedWriteMethod; } *************** *** 233,255 **** */ public synchronized void setIndexedWriteMethod(Method writeMethod) throws IntrospectionException { if (writeMethod == null) { indexedWriteMethodName = null; indexedWriteMethodRef = null; return; } ! if (getClass0() == null) { ! setClass0(writeMethod.getDeclaringClass()); ! } indexedWriteMethodName = writeMethod.getName(); indexedWriteMethodRef = createReference(writeMethod); - - Class type = getIndexedPropertyType0(); - // If the indexed property type has not been set, then set it. - if (type == null) { - type = findIndexedPropertyType(null, writeMethod); - setIndexedPropertyType(type); - } } /** --- 252,274 ---- */ public synchronized void setIndexedWriteMethod(Method writeMethod) throws IntrospectionException { + + // If the indexed property type has not been set, then set it. + setIndexedPropertyType(findIndexedPropertyType(getIndexedReadMethod(), + writeMethod)); + setIndexedWriteMethod0(writeMethod); + } + + private void setIndexedWriteMethod0(Method writeMethod) { if (writeMethod == null) { indexedWriteMethodName = null; indexedWriteMethodRef = null; return; } ! setWriteClass0(writeMethod.getDeclaringClass()); ! indexedWriteMethodName = writeMethod.getName(); indexedWriteMethodRef = createReference(writeMethod); } /** ###@###.### 2003-09-26
26-09-2003