Tanks for the reply,

First of all I'm not implying that it is a OJB bug since the Introspector is within 
the Sun's JDK but would the few lines be to harsh in performance and thus could not be 
integrated since I think that e.g.

--> setresembleValue 

is not equally readable as (in code perspecive, not e.g ide managed environments)

--> setResembleValue 

and thus gets more readable code. I won't challenge the java community with that and 
can accept such convention but I think latter method name for retrieving the property 
is far easer to read...

I just thought it was method names started with non capital letter in the sentence e.g.
removeAll, addTail and thus properties always begins with UC letter since getter and 
setter is
prepended e.g. setMachineConfig, getId....

Many Regards,
 Mario


-----Original Message-----
From: Charles Anthony [mailto:[EMAIL PROTECTED]
Sent: den 21 mars 2003 08:30
To: 'OJB Users List'
Subject: RE: Introspection error in PersistentFieldPropertyImpl ?


The Introspector and PropertyDescriptor are part of the JDK, not classes
specific to OJB. 

I haven't got the JavaBean spec to hand, so I cannot categorically confirm
that it is part of the JavaBean spec; however it is definitely a convention
(widely adhered to) that the member variable of a property has a lower case
first character. It is a little more complicated when both the the first
letter and second letter are upper case - you'd have to read up on beans the
Sun site.

However, I can definitely confirm that this behaviour is not a bug.

Cheers,

Charles.

>-----Original Message-----
>From: Mario Toffia [mailto:[EMAIL PROTECTED]
>Sent: 21 March 2003 07:19
>To: [EMAIL PROTECTED]
>Subject: Introspection error in PersistentFieldPropertyImpl ?
>
>
>Hi,
>I've got two methods (setter and getter) for a property in my 
>bean that is called 'EquipmentId' (setEquipmentId, 
>getEquipmentId) i.e. PersistentFieldPropertyImpl is used for 
>Introspection. Using the repository.xml to map it like:
>"
>  <field-descriptor id="3"
>    name="EquipmentId"
>    column="EQNUM"
>    jdbc-type="VARCHAR" indexed="true" nullable="false"
>  />
>"
>
>The code snippet in 
>PersistentFieldPropertyImpl.findPropertyDescriptor(Class 
>aClass, String aPropertyName) is doing the following.
>"
>                       info = Introspector.getBeanInfo(aClass);
>                       pd = info.getPropertyDescriptors();
>                       for (int i = 0; i < pd.length; i++)
>                       {
>                               if 
>(pd[i].getName().equals(aPropertyName))
>                               {
>                                       descriptor = pd[i];
>                                       break;
>                               }
>                       }
>"
>
>the getName returns the property of the bean but the first 
>letter is Lower Case! is it by convension or is it a bug since 
>setEquipmentId and getEquipmentId would yield a property named 
>EquipmentId not equipmentId. The more stranger is when all 
>letters in the setter and getter is UPPERCASE it would 
>correctly return the property name i.e. if setEQUIPMENTID and 
>getEQUIPMENTID is specified the p[i].getName() will return EQUIPMENTID!
>
>I've changed the code snippet to:
>"
>      String csWritePropertyName = "set" + aPropertyName;
>       for (int i = 0; i < pd.length; i++)
>       {
>        Method meth = pd[i].getWriteMethod();
>        if (null != meth)
>        {
>          if (true == meth.getName().equals(csWritePropertyName))
>          {
>            descriptor = pd[i];
>            break;
>          }
>        }
>       }
>
>
>      if (pd[i].getName().equals(aPropertyName))
>      {
>        descriptor = pd[i];
>        break;
>      }
>" 
>
>since Method.getName() correctly displays the method name (as 
>always). I've never used the Introspector but I think this is 
>a strange behaviour or?
>
>Many Regards,
> Mario
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>


This email and any attachments are strictly confidential and are intended
solely for the addressee. If you are not the intended recipient you must
not disclose, forward, copy or take any action in reliance on this message
or its attachments. If you have received this email in error please notify
the sender as soon as possible and delete it from your computer systems.
Any views or opinions presented are solely those of the author and do not
necessarily reflect those of HPD Software Limited or its affiliates.

 At present the integrity of email across the internet cannot be guaranteed
and messages sent via this medium are potentially at risk.  All liability
is excluded to the extent permitted by law for any claims arising as a re-
sult of the use of this medium to transmit information by or to 
HPD Software Limited or its affiliates.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to