[jboss-jira] [JBoss JIRA] Updated: (JBMICROCONT-95) Inconsistent JavaBean property introspection

Adrian Brock (JIRA) jira-events at jboss.com
Tue Jul 11 07:11:11 EDT 2006


     [ http://jira.jboss.com/jira/browse/JBMICROCONT-95?page=all ]

Adrian Brock updated JBMICROCONT-95:
------------------------------------

    Fix Version/s:  JBossMC_2_0_0M1
         Assignee: Adrian Brock

> Inconsistent JavaBean property introspection
> --------------------------------------------
>
>                 Key: JBMICROCONT-95
>                 URL: http://jira.jboss.com/jira/browse/JBMICROCONT-95
>             Project: JBoss MicroContainer
>          Issue Type: Bug
>          Components: Configurator
>         Environment: org.jboss.test.javabean.test.PropertyTestCase
>            Reporter: Scott M Stark
>         Assigned To: Adrian Brock
>             Fix For:  JBossMC_2_0_0M1
>
>
> There is an inconsistency between introspected bean properties relative to JavaBean conventions. The PropertyTestCase has a XYZ property in the SimpleBean that fails to parse with the following exception:
> Caused by: java.lang.IllegalArgumentException: No property 'XYZ' for AbstractBeanInfo at 6e293a{name=org.jboss.test.javabean.support.SimpleBean classInfo= properties=[aBoolean, achar, anObject, aShort, aString, aNumber, afloat, aLong, abyte, anint, aDate, aboolean, xYZ, along, aFloat, aDouble, class, constructorUsed, ashort, aByte, adouble, aCharacter, aBigInteger, overloadedProperty, aBigDecimal, abc, anInt] methods=[hashCode, getXYZ, getABoolean, getConstructorUsed, setAnObject, setAshort, setADouble, clone, setALong, setOverloadedProperty, setOverloadedProperty, setOverloadedProperty, getAbyte, getANumber, getAString, setAlong, setANumber, setAdouble, getOverloadedProperty, getABigDecimal, setAbc, setAnInt, setAFloat, setABoolean, getAFloat, getAbc, getABigInteger, setAbyte, getAnObject, setXYZ, setAnint, getAlong, getAchar, setAchar, getADouble, setABigDecimal, equals, getAfloat, setABigInteger, wait, wait, wait, registerNatives, getAByte, setAString, notify, setACharacter, getClass, getADate, toString, setAByte, getALong, setAShort, getAdouble, notifyAll, getAnInt, setAboolean, finalize, getAshort, getACharacter, getAnint, isAboolean, getAShort, setADate, setAfloat] constructors=[] events=}
> 	at org.jboss.kernel.plugins.config.xml.JavaBeanSchemaInitializer.getProperty(JavaBeanSchemaInitializer.java:231)
> The PropertyTestCase also has a testJavaBeanMatching that illustrates the default JavaBean introspection behavior for an XYZ property, and the 
> http://java.sun.com/products/javabeans/docs/spec.html talks about capitialization in section 8.8:
> 8.8 Capitalization of inferred names.
> When we use design patterns to infer a property or event name, we need to decide what rules
> to follow for capitalizing the inferred name. If we extract the name from the middle of a normal
> mixedCase style Java name then the name will, by default, begin with a capital letter.
> Java programmers are accustomed to having normal identifiers start with lower case letters.
> Vigorous reviewer input has convinced us that we should follow this same conventional rule
> for property and event names.
> Thus when we extract a property or event name from the middle of an existing Java name, we
> normally convert the first character to lower case. However to support the occasional use of all
> upper-case names, we check if the first two characters of the name are both upper case and if
> so leave it alone. So for example,
>    "FooBah" becomes "fooBah"
>    "Z" becomes "z"
>    "URL" becomes "URL"
> We provide a method Introspector.decapitalize which implements this conversion rule.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       




More information about the jboss-jira mailing list