xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject cvs commit: xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/visitor PropertyInitializer.java
Date Mon, 19 Jul 2004 06:34:50 GMT
pcal        2004/07/18 23:34:50

  Modified:    v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements
                        ClassImpl.java PropertyImpl.java
               v2/jam/src/org/apache/xmlbeans/impl/jam/visitor
                        PropertyInitializer.java
  Log:
  jam: fix problem with setter/getter ordering
  
  Revision  Changes    Path
  1.24      +8 -4      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/ClassImpl.java
  
  Index: ClassImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/ClassImpl.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ClassImpl.java	22 Jun 2004 21:45:57 -0000	1.23
  +++ ClassImpl.java	19 Jul 2004 06:34:50 -0000	1.24
  @@ -490,8 +490,10 @@
   
     public JProperty addNewProperty(String name, JMethod getter, JMethod setter) {
       if (mProperties == null) mProperties = new ArrayList();
  -    JProperty out = new PropertyImpl(name,getter,setter,
  -                                     getter.getReturnType().getFieldDescriptor());
  +    String typeName = (getter != null) ?
  +      getter.getReturnType().getFieldDescriptor() :
  +      setter.getParameters()[0].getType().getFieldDescriptor();
  +    JProperty out = new PropertyImpl(name,getter,setter,typeName);
       mProperties.add(out);
       return out;
     }
  @@ -502,8 +504,10 @@
   
     public JProperty addNewDeclaredProperty(String name, JMethod getter, JMethod setter)
{
       if (mDeclaredProperties == null) mDeclaredProperties = new ArrayList();
  -    JProperty out = new PropertyImpl(name,getter,setter,
  -                                     getter.getReturnType().getFieldDescriptor());
  +    String typeName = (getter != null) ?
  +      getter.getReturnType().getFieldDescriptor() :
  +      setter.getParameters()[0].getType().getFieldDescriptor();
  +    JProperty out = new PropertyImpl(name,getter,setter,typeName);
       mDeclaredProperties.add(out);
       return out;
     }
  
  
  
  1.6       +4 -2      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/PropertyImpl.java
  
  Index: PropertyImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/internal/elements/PropertyImpl.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- PropertyImpl.java	28 May 2004 17:02:51 -0000	1.5
  +++ PropertyImpl.java	19 Jul 2004 06:34:50 -0000	1.6
  @@ -46,6 +46,7 @@
      * is exposed just in case the default rules in the factory method
      * for identifying properties are insufficient for some use
      * case.</p>
  +   *
      */
     public PropertyImpl(String name,
                         JMethod getter,
  @@ -58,8 +59,9 @@
       mName = name;
       mGetter = getter;
       mSetter = setter;
  -    mTypeRef = QualifiedJClassRef.create
  -      (qualifiedTypeName,((ClassImpl)getter.getContainingClass()));
  +    ClassImpl cont = (ClassImpl)((getter != null) ?
  +      getter.getContainingClass() : setter.getContainingClass());
  +    mTypeRef = QualifiedJClassRef.create(qualifiedTypeName,cont);
       initAnnotations();
     }
   
  
  
  
  1.8       +2 -2      xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/visitor/PropertyInitializer.java
  
  Index: PropertyInitializer.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/jam/src/org/apache/xmlbeans/impl/jam/visitor/PropertyInitializer.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PropertyInitializer.java	15 Apr 2004 01:50:06 -0000	1.7
  +++ PropertyInitializer.java	19 Jul 2004 06:34:50 -0000	1.8
  @@ -81,8 +81,8 @@
           name = name.substring(3);
           JProperty prop = (JProperty)name2prop.get(name);
           if (prop == null) {
  -          prop = declared ? clazz.addNewDeclaredProperty(name,methods[i],null) :
  -            clazz.addNewProperty(name,methods[i],null);
  +          prop = declared ? clazz.addNewDeclaredProperty(name,null,methods[i]) :
  +            clazz.addNewProperty(name,null,methods[i]);
             name2prop.put(name,prop);
           } else {
             if (type.equals(prop.getType())) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xmlbeans-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-cvs-help@xml.apache.org


Mime
View raw message