You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by da...@apache.org on 2003/09/26 03:28:47 UTC

cvs commit: xml-xmlbeans/v1/src/xmlcomp/org/apache/xmlbeans/impl/tool SchemaCodeGenerator.java

davidbau    2003/09/25 18:28:47

  Modified:    v1       build.xml
               v1/src/xmlcomp/org/apache/xmlbeans/impl/tool
                        SchemaCodeGenerator.java
  Removed:     v1/external/lib/jaxb-1.0 jaxb-api.jar
  Log:
  Practicing safe IP practices.  (Thanks robert for catching this!)
  
  Removed build-time dependency on Sun's JAXB API JAR, and deleting the
  JAR.  When we get into JAXB v2 we will check in a clean-room version
  of this API.
  
  (Infrastructure will still need to rm the jar from the repository,
  and we still need to remove the qname jar.)
  
  Code review: eric
  Regression tests: passed
  
  Revision  Changes    Path
  1.6       +1 -2      xml-xmlbeans/v1/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v1/build.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- build.xml	26 Sep 2003 00:40:04 -0000	1.5
  +++ build.xml	26 Sep 2003 01:28:47 -0000	1.6
  @@ -441,7 +441,7 @@
                    common.classes, typeimpl.classes, xmlcomp.classes,
                    xmlstore.classes,
                    oldxbean.jar, xsdschema.classes,
  -                 xmlinputstream.classes, jax-qname.classes, jaxb.classes">
  +                 xmlinputstream.classes, jax-qname.classes">
       <jar jarfile="build/lib/xbean.jar" index="true">
         <fileset dir="build/classes/xmlpublic"/>
         <fileset dir="build/classes/typestore"/>
  @@ -455,7 +455,6 @@
         <fileset dir="build/classes/xmlstore"/>
         <fileset dir="build/classes/xmlinputstream"/>
         <fileset dir="build/classes/jax-qname"/>
  -      <fileset dir="build/classes/jaxb"/>
         <fileset dir="build/classes/repackage"/>
         <fileset dir="src/license"/>
       </jar>
  
  
  
  1.3       +16 -13    xml-xmlbeans/v1/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java
  
  Index: SchemaCodeGenerator.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v1/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCodeGenerator.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SchemaCodeGenerator.java	24 Sep 2003 23:31:11 -0000	1.2
  +++ SchemaCodeGenerator.java	26 Sep 2003 01:28:47 -0000	1.3
  @@ -245,20 +245,23 @@
           return failure;
       }
   
  -    private static final Method _jaxbCodeGeneratorMethod = buildJaxbCodeGeneratorMethod();
  -
  -    private static Method buildJaxbCodeGeneratorMethod()
  +    private static class JaxbCodeGeneratorHolder
       {
  -        try
  -        {
  -            return Class.forName("org.apache.xmlbeans.impl.jaxb.compiler.JaxbCodeGenerator", false, SchemaCodeGenerator.class.getClassLoader())
  -                .getMethod("compile", new Class[] {SchemaTypeSystem.class, List.class, File.class, File.class, XmlErrorWatcher.class });
  -        }
  -        catch (Exception e)
  +        private static final Method _jaxbCodeGeneratorMethod = buildJaxbCodeGeneratorMethod();
  +    
  +        private static Method buildJaxbCodeGeneratorMethod()
           {
  -            IllegalStateException e2 =  new IllegalStateException("Cannot load JaxbCodeGenerator: verify that xbean.jar is on the classpath");
  -            e2.initCause(e);
  -            throw e2;
  +            try
  +            {
  +                return Class.forName("org.apache.xmlbeans.impl.jaxb.compiler.JaxbCodeGenerator", false, SchemaCodeGenerator.class.getClassLoader())
  +                    .getMethod("compile", new Class[] {SchemaTypeSystem.class, List.class, File.class, File.class, XmlErrorWatcher.class });
  +            }
  +            catch (Exception e)
  +            {
  +                IllegalStateException e2 =  new IllegalStateException("Cannot load JaxbCodeGenerator: verify that xbean.jar is on the classpath");
  +                e2.initCause(e);
  +                throw e2;
  +            }
           }
       }
   
  @@ -266,7 +269,7 @@
       {
           try
           {
  -            return ((Boolean)_jaxbCodeGeneratorMethod.invoke(null, new Object[] { saver, sourcefiles, sourcedir, classesdir, errors })).booleanValue();
  +            return ((Boolean)JaxbCodeGeneratorHolder._jaxbCodeGeneratorMethod.invoke(null, new Object[] { saver, sourcefiles, sourcedir, classesdir, errors })).booleanValue();
           }
           catch (InvocationTargetException e)
           {
  
  
  

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