xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject cvs commit: xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool XsbDumper.java
Date Wed, 24 Nov 2004 20:06:00 GMT
radup       2004/11/24 12:06:00

  Modified:    v2/src/typeimpl/org/apache/xmlbeans/impl/schema
                        SchemaTypeImpl.java
               v2/src/typeimpl/org/apache/xmlbeans/impl/validator
                        Validator.java
               v2/src/xmlcomp/org/apache/xmlbeans/impl/tool XsbDumper.java
  Log:
  Updated some reflection code in SchemaTypeImpl to use a protected constructor.
  Fixed an NPE in the validator.
  Updated XsbDumper to the latest version of the .xsb file format.
  
  Revision  Changes    Path
  1.18      +20 -2     xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java
  
  Index: SchemaTypeImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeImpl.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SchemaTypeImpl.java	19 Nov 2004 23:52:33 -0000	1.17
  +++ SchemaTypeImpl.java	24 Nov 2004 20:05:59 -0000	1.18
  @@ -1668,7 +1668,7 @@
               if (impl == null) return null;
               try
               {
  -                _javaImplConstructor2 = impl.getConstructor(new Class[] { SchemaType.class,
boolean.class });
  +                _javaImplConstructor2 = impl.getDeclaredConstructor(new Class[] { SchemaType.class,
boolean.class });
               }
               catch (NoSuchMethodException e)
               {
  @@ -1808,10 +1808,28 @@
               Constructor ctr = getJavaImplConstructor2();
               if (ctr != null)
               {
  +                boolean accessible = ctr.isAccessible();
                   try
                   {
  +                    ctr.setAccessible(true);
                       // System.out.println("Succeeded!");
  -                    return (XmlObject)ctr.newInstance(new Object[] { sType, sType.isSimpleType()
? Boolean.FALSE : Boolean.TRUE });
  +                    try
  +                    {
  +                        return (XmlObject)ctr.newInstance(new Object[] { sType, sType.isSimpleType()
? Boolean.FALSE : Boolean.TRUE });
  +                    }
  +                    catch (Exception e)
  +                    {
  +                        System.out.println("Exception trying to instantiate impl class.");
  +                        e.printStackTrace();
  +                    }
  +                    finally
  +                    {
  +                        // Make a best-effort try to set the accessibility back to what
it was
  +                        try
  +                        {   ctr.setAccessible(accessible); }
  +                        catch (SecurityException se)
  +                        { }
  +                    }
                   }
                   catch (Exception e)
                   {
  
  
  
  1.25      +2 -2      xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
  
  Index: Validator.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- Validator.java	19 Nov 2004 01:28:41 -0000	1.24
  +++ Validator.java	24 Nov 2004 20:05:59 -0000	1.25
  @@ -584,10 +584,10 @@
           }
   
           // note in schema spec 3.3.4, you're not even allowed to say xsi:nil="false" if
you're not nillable!
  -        if (hasNil && !elementField.isNillable())
  +        if (hasNil && (elementField == null || !elementField.isNillable()))
           {
               emitFieldError( event, XmlErrorCodes.ELEM_LOCALLY_VALID$NOT_NILLABLE, null,
  -                elementField.getName(), elementField.getType(), null,
  +                elementField == null ? null : elementField.getName(), elementType, null,
                   XmlValidationError.ELEMENT_TYPE_INVALID, (state == null ? null : state._type));
   
               _eatContent = 1;
  
  
  
  1.6       +3 -2      xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/XsbDumper.java
  
  Index: XsbDumper.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/xmlcomp/org/apache/xmlbeans/impl/tool/XsbDumper.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- XsbDumper.java	27 May 2004 18:37:48 -0000	1.5
  +++ XsbDumper.java	24 Nov 2004 20:05:59 -0000	1.6
  @@ -138,7 +138,7 @@
   
       public static final int DATA_BABE = 0xDA7ABABE;
       public static final int MAJOR_VERSION = 2;
  -    public static final int MINOR_VERSION = 19;
  +    public static final int MINOR_VERSION = 20;
   
       public static final int FILETYPE_SCHEMAINDEX = 1;
       public static final int FILETYPE_SCHEMATYPE = 2;
  @@ -1119,7 +1119,8 @@
           emit("Java prop name: " + readString());
           emit("Java type code: " + jtcString(readShort()));
           emit("Type for java signature: " + readType());
  -        emit("Java setter delimiter: " + qnameSetString(readQNameSet()));
  +        if (atMost(2, 19, 0))
  +            emit("Java setter delimiter: " + qnameSetString(readQNameSet()));
           if (atLeast(2, 16, 0))
               emit("Default value: " + readXmlValueObject());
           if (((propflags & FLAG_PROP_ISATTR) == 0) && atLeast(2, 17, 0))
  
  
  

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


Mime
View raw message