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/src/jam/org/apache/xmlbeans/impl/jam/internal BaseJAnnotation.java
Date Thu, 05 Feb 2004 21:59:12 GMT
pcal        2004/02/05 13:59:12

  Modified:    v2/src/binding/org/apache/xmlbeans/impl/binding/compile
                        Schema2Java.java
               v2/src/jam/org/apache/xmlbeans/impl/jam
                        JAnnotationMember.java
               v2/src/jam/org/apache/xmlbeans/impl/jam/internal
                        BaseJAnnotation.java
  Log:
  fix Schema2Java NPE, trimming on BaseJAnnotation
  
  Revision  Changes    Path
  1.12      +2 -2      xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Schema2Java.java
  
  Index: Schema2Java.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/binding/org/apache/xmlbeans/impl/binding/compile/Schema2Java.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Schema2Java.java	30 Jan 2004 18:35:19 -0000	1.11
  +++ Schema2Java.java	5 Feb 2004 21:59:11 -0000	1.12
  @@ -378,9 +378,9 @@
             logVerbose("processing element "+scratch.getXmlName());
             SchemaType contentType = scratch.getSchemaType().getProperties()[0].getType();
             logVerbose("content type is "+contentType.getName());
  -          if (contentType.isPrimitiveType() ||
  +          if (contentType.isPrimitiveType() /*||
                     //FIXME why is this not a primitive? gross hack to make things work for
now
  -                  contentType.getName().toString().equals("{http://www.w3.org/2001/XMLSchema}int"))
{
  +                  contentType.getName().toString().equals("{http://www.w3.org/2001/XMLSchema}int")*/)
{
               //REVIEW this is a quick bug fix for the case where an element
               //is of a primitive type.  I'm not completely sure it is the right
               //thing to do.  pcal
  
  
  
  1.2       +7 -0      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotationMember.java
  
  Index: JAnnotationMember.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/JAnnotationMember.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JAnnotationMember.java	4 Feb 2004 21:31:11 -0000	1.1
  +++ JAnnotationMember.java	5 Feb 2004 21:59:12 -0000	1.2
  @@ -107,6 +107,13 @@
     public JAnnotation getValueAsAnnotation();
   
     /**
  +   * Returns the value of this member as a JClass.  Returns null if the
  +   * value cannot be understood as a class name or if the type of the member
  +   * is known to be something other than java.lang.Class.
  +   */
  +  public JClass getValueAsClass();
  +
  +  /**
      * Returns the String value of the annotation.  Returns an empty string
      * by default.
      */
  
  
  
  1.6       +5 -7      xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/BaseJAnnotation.java
  
  Index: BaseJAnnotation.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/jam/org/apache/xmlbeans/impl/jam/internal/BaseJAnnotation.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BaseJAnnotation.java	4 Feb 2004 21:31:11 -0000	1.5
  +++ BaseJAnnotation.java	5 Feb 2004 21:59:12 -0000	1.6
  @@ -99,14 +99,12 @@
       mParent = parent;
       mName = name;
       mValue = value;  // ok to be null
  +    if (mValue != null) mValue = mValue.trim();
       if (STRIP_QUOTES){
  -      if (mValue != null) {
  -        mValue = mValue.trim();
  -        if (mValue.length() > 1) {
  -          if  (mValue.charAt(0) == '\"' &&
  -                  mValue.charAt(mValue.length()-1) == '\"') {
  -            mValue = mValue.substring(1,mValue.length()-1);
  -          }
  +      if (mValue.length() > 1) {
  +        if  (mValue.charAt(0) == '\"' &&
  +                mValue.charAt(mValue.length()-1) == '\"') {
  +          mValue = mValue.substring(1,mValue.length()-1);
           }
         }
       }
  
  
  

---------------------------------------------------------------------
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