You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlbeans.apache.org by ra...@apache.org on 2005/03/19 00:09:14 UTC

svn commit: r158158 - in xmlbeans/trunk: bin/ src/tools/org/apache/xmlbeans/impl/xsd2inst/ src/typeimpl/org/apache/xmlbeans/impl/schema/ src/typeimpl/org/apache/xmlbeans/impl/values/ src/xmlcomp/org/apache/xmlbeans/impl/tool/ test/src/compile/scomp/checkin/

Author: radup
Date: Fri Mar 18 15:09:12 2005
New Revision: 158158

URL: http://svn.apache.org/viewcvs?view=rev&rev=158158
Log:
Misc fixes.

Modified:
    xmlbeans/trunk/bin/sfactor
    xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
    xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java
    xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java

Modified: xmlbeans/trunk/bin/sfactor
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/bin/sfactor?view=diff&r1=158157&r2=158158
==============================================================================
--- xmlbeans/trunk/bin/sfactor (original)
+++ xmlbeans/trunk/bin/sfactor Fri Mar 18 15:09:12 2005
@@ -1,34 +1,34 @@
-#!/bin/sh
-##
-##  Copyright 2004 The Apache Software Foundation
-##
-##  Licensed under the Apache License, Version 2.0 (the "License");
-##  you may not use this file except in compliance with the License.
-##  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-##  Unless required by applicable law or agreed to in writing, software
-##  distributed under the License is distributed on an "AS IS" BASIS,
-##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-##  See the License for the specific language governing permissions and
-##  limitations under the License.
-##
-
-## Schema Factoring tool
-##
-## Factors redundant definitions out of a set of schemas and 
-## uses imports instead.
-
-if [ -z $XMLBEANS_LIB ]; then . `dirname $0`/_setlib; fi
-
-cp=$XMLBEANS_LIB/xbean.jar:$XMLBEANS_LIB/jsr173_api.jar:$XMLBEANS_LIB/resolver.jar
-
-case "`uname`" in
-    CYGWIN*)
-        cp=`cygpath -w -p $cp`
-        ;;
-esac
-
-java -Xmx256m -classpath $cp org.apache.xmlbeans.impl.tool.FactorImports $*
-
+#!/bin/sh
+##
+##  Copyright 2004 The Apache Software Foundation
+##
+##  Licensed under the Apache License, Version 2.0 (the "License");
+##  you may not use this file except in compliance with the License.
+##  You may obtain a copy of the License at
+##
+##      http://www.apache.org/licenses/LICENSE-2.0
+##
+##  Unless required by applicable law or agreed to in writing, software
+##  distributed under the License is distributed on an "AS IS" BASIS,
+##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+##  See the License for the specific language governing permissions and
+##  limitations under the License.
+##
+
+## Schema Factoring tool
+##
+## Factors redundant definitions out of a set of schemas and 
+## uses imports instead.
+
+if [ -z $XMLBEANS_LIB ]; then . `dirname $0`/_setlib; fi
+
+cp=$XMLBEANS_LIB/xbean.jar:$XMLBEANS_LIB/jsr173_api.jar:$XMLBEANS_LIB/resolver.jar
+
+case "`uname`" in
+    CYGWIN*)
+        cp=`cygpath -w -p $cp`
+        ;;
+esac
+
+java -Xmx256m -classpath $cp org.apache.xmlbeans.impl.tool.FactorImports $*
+

Modified: xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java?view=diff&r1=158157&r2=158158
==============================================================================
--- xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java (original)
+++ xmlbeans/trunk/src/tools/org/apache/xmlbeans/impl/xsd2inst/SampleXmlUtil.java Fri Mar 18 15:09:12 2005
@@ -515,7 +515,7 @@
                 increment = new BigDecimal(sb.toString());
             }
             else
-                increment = new BigDecimal(1);
+                increment = new BigDecimal(1.0);
         }
 
         if (minOk && maxOk)

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java?view=diff&r1=158157&r2=158158
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemCompiler.java Fri Mar 18 15:09:12 2005
@@ -225,7 +225,7 @@
             throw new XmlException(errorWatcher.firstError());
         }
 
-        if (stsi != null && !stsi.isPartial() && filer != null)
+        if (stsi != null && !stsi.isIncomplete() && filer != null)
         {
             stsi.save(filer);
             generateTypes(stsi, filer, options);
@@ -322,7 +322,7 @@
                 if (state.allowPartial() && state.getRecovered() == errorWatcher.size())
                 {
                     // if partial type system allowed and all errors were recovered
-                    state.get().sts().setPartial(true);
+                    state.get().sts().setIncomplete(true);
                 }
                 else
                 {
@@ -331,6 +331,9 @@
                 }
             }
 
+            if (system != null)
+                ((SchemaTypeSystemImpl) system).setIncomplete(true);
+
             return state.get().sts();
         }
         finally
@@ -424,7 +427,7 @@
     public static boolean generateTypes(SchemaTypeSystem system, Filer filer, XmlOptions options)
     {
         // partial type systems not allowed to be saved
-        if (system instanceof SchemaTypeSystemImpl && ((SchemaTypeSystemImpl)system).isPartial())
+        if (system instanceof SchemaTypeSystemImpl && ((SchemaTypeSystemImpl)system).isIncomplete())
             return false;
         
         boolean success = true;

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java?view=diff&r1=158157&r2=158158
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeSystemImpl.java Fri Mar 18 15:09:12 2005
@@ -963,10 +963,10 @@
     {   return _deps; }
     
     // EXPERIMENTAL
-    public boolean isPartial() { return _partial; }
+    public boolean isIncomplete() { return _incomplete; }
     
     // EXPERIMENTAL
-    void setPartial(boolean partial) { _partial = partial; }
+    void setIncomplete(boolean incomplete) { _incomplete = incomplete; }
 
     static class StringPool
     {
@@ -1232,7 +1232,7 @@
     private String _basePackage;
     
     // EXPERIMENTAL: recovery from compilation errors and partial type systems
-    private boolean _partial = false;
+    private boolean _incomplete = false;
 
     // classloader is available for sts's that were compiled and loaded, not dynamic ones
     private ClassLoader _classloader;
@@ -1285,9 +1285,9 @@
 
     public void save(Filer filer)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
-        
+        if (_incomplete)
+            throw new IllegalStateException("Incomplete SchemaTypeSystems cannot be saved.");
+
         if (filer == null)
             throw new IllegalArgumentException("filer must not be null");
         _filer = filer;
@@ -1325,8 +1325,8 @@
 
     public void saveGlobalElements(SchemaGlobalElement[] elts)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         for (int i = 0; i < elts.length; i++)
         {
             saveGlobalElement(elts[i]);
@@ -1335,8 +1335,8 @@
 
     public void saveGlobalAttributes(SchemaGlobalAttribute[] attrs)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         for (int i = 0; i < attrs.length; i++)
         {
             saveGlobalAttribute(attrs[i]);
@@ -1345,8 +1345,8 @@
 
     public void saveModelGroups(SchemaModelGroup[] groups)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         for (int i = 0; i < groups.length; i++)
         {
             saveModelGroup(groups[i]);
@@ -1355,8 +1355,8 @@
 
     public void saveAttributeGroups(SchemaAttributeGroup[] groups)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         for (int i = 0; i < groups.length; i++)
         {
             saveAttributeGroup(groups[i]);
@@ -1365,8 +1365,8 @@
 
     public void saveIdentityConstraints(SchemaIdentityConstraint[] idcs)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         for (int i = 0; i < idcs.length; i++)
         {
             saveIdentityConstraint(idcs[i]);
@@ -1375,8 +1375,8 @@
 
     public void saveGlobalElement(SchemaGlobalElement elt)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         String handle = _localHandles.handleForElement(elt);
         XsbReader saver = new XsbReader(handle);
         saver.writeParticleData((SchemaParticle)elt);
@@ -1389,8 +1389,8 @@
 
     public void saveGlobalAttribute(SchemaGlobalAttribute attr)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         String handle = _localHandles.handleForAttribute(attr);
         XsbReader saver = new XsbReader(handle);
         saver.writeAttributeData(attr);
@@ -1403,8 +1403,8 @@
 
     public void saveModelGroup(SchemaModelGroup grp)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         String handle = _localHandles.handleForModelGroup(grp);
         XsbReader saver = new XsbReader(handle);
         saver.writeModelGroupData(grp);
@@ -1415,8 +1415,8 @@
 
     public void saveAttributeGroup(SchemaAttributeGroup grp)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         String handle = _localHandles.handleForAttributeGroup(grp);
         XsbReader saver = new XsbReader(handle);
         saver.writeAttributeGroupData(grp);
@@ -1427,8 +1427,8 @@
 
     public void saveIdentityConstraint(SchemaIdentityConstraint idc)
     {
-        if (_partial)
-            throw new IllegalStateException("Partial SchemaTypeSystems cannot be saved.");
+        if (_incomplete)
+            throw new IllegalStateException("This SchemaTypeSystem cannot be saved.");
         String handle = _localHandles.handleForIdentityConstraint(idc);
         XsbReader saver = new XsbReader(handle);
         saver.writeIdConstraintData(idc);

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java?view=diff&r1=158157&r2=158158
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/XmlObjectBase.java Fri Mar 18 15:09:12 2005
@@ -674,7 +674,8 @@
             set_prepare();
 
             // if we're not nillable, throw exception on setNil(true)
-            if ((_flags & FLAG_NILLABLE) == 0)
+            if ((_flags & FLAG_NILLABLE) == 0 &&
+                (_flags & FLAG_VALIDATE_ON_SET) != 0)
                 throw new XmlValueNotNillableException();
 
             // the implementation should zero the value to reflect nil

Modified: xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java?view=diff&r1=158157&r2=158158
==============================================================================
--- xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java (original)
+++ xmlbeans/trunk/src/xmlcomp/org/apache/xmlbeans/impl/tool/SchemaCompiler.java Fri Mar 18 15:09:12 2005
@@ -85,7 +85,7 @@
         System.out.println("    -verbose - print more informational messages");
         System.out.println("    -version - prints version information");
         System.out.println("    -license - prints license information");
-        System.out.println("    -allowmdef \"[ns] [ns] [ns]\" - ignores multiple defs in given namespaces");
+        System.out.println("    -allowmdef \"[ns] [ns] [ns]\" - ignores multiple defs in given namespaces (use ##local for no-namespace)");
         System.out.println("    -catalog [file] -  catalog file for org.apache.xml.resolver.tools.CatalogResolver. (Note: needs resolver.jar from http://xml.apache.org/commons/components/resolver/index.html)");
         /* Undocumented feature - pass in one schema compiler extension and related parameters
         System.out.println("    -repackage - repackage specification");
@@ -322,8 +322,8 @@
 
         if (xsdFiles.length + wsdlFiles.length + urlFiles.length == 0)
         {
-            System.err.println("Could not find any xsd or wsdl files to process.");
-            System.exit(1);
+            System.out.println("Could not find any xsd or wsdl files to process.");
+            System.exit(0);
         }
         File baseDir = cl.getBaseDir();
         URI baseURI = baseDir == null ? null : baseDir.toURI();

Modified: xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java
URL: http://svn.apache.org/viewcvs/xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java?view=diff&r1=158157&r2=158158
==============================================================================
--- xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java (original)
+++ xmlbeans/trunk/test/src/compile/scomp/checkin/XmlBeansCompCheckinTests.java Fri Mar 18 15:09:12 2005
@@ -161,7 +161,7 @@
             throw e;
         }
         
-        Assert.assertTrue("Expected partial schema type system", ((SchemaTypeSystemImpl)sts).isPartial());
+        Assert.assertTrue("Expected partial schema type system", ((SchemaTypeSystemImpl)sts).isIncomplete());
 
 
         //call some stupid methods on STS



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