xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r781219 - in /xmlbeans/trunk: src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java test/src/xmlobject/schematypes/checkin/GDateTests.java
Date Wed, 03 Jun 2009 00:13:04 GMT
Author: radup
Date: Wed Jun  3 00:13:04 2009
New Revision: 781219

URL: http://svn.apache.org/viewvc?rev=781219&view=rev
Log:
Checkintest fix and additional NOTATION checks

Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
    xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java?rev=781219&r1=781218&r2=781219&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
(original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/schema/StscSimpleTypeResolver.java
Wed Jun  3 00:13:04 2009
@@ -242,6 +242,9 @@
                 // fallthrough: nonlist unions are just like atomic items
             case SchemaType.ATOMIC:
                 sImpl.setListItemTypeRef(itemImpl.getRef());
+                // Check that the item type is not a plan NOTATION
+                if (sImpl.getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                    state.recover(XmlErrorCodes.DATATYPE_ENUM_NOTATION, null, errorLoc);
                 break;
             default:
                 assert(false);
@@ -377,6 +380,10 @@
             SchemaTypeImpl mImpl = (SchemaTypeImpl)memberImplList.get(i);
             if (mImpl.finalUnion())
                 state.error(XmlErrorCodes.SIMPLE_TYPE_PROPERTIES$UNION_FINAL, null, parseUnion);
+
+            // Check that the member type is not a plan NOTATION
+            if (mImpl.getBuiltinTypeCode() == SchemaType.BTC_NOTATION)
+                state.recover(XmlErrorCodes.DATATYPE_ENUM_NOTATION, null, parseUnion);
         }
 
         sImpl.setUnionOfLists(isUnionOfLists);
@@ -677,7 +684,8 @@
                         new Object[] { facetName, QNameHelper.pretty(baseImpl.getName())
}, facet);
                     continue;
                 }
-                else if (baseImpl.getPrimitiveType().getBuiltinTypeCode() == SchemaType.BTC_NOTATION
+                else if (baseImpl.getSimpleVariety() == SchemaType.ATOMIC &&
+                    baseImpl.getPrimitiveType().getBuiltinTypeCode() == SchemaType.BTC_NOTATION
                     && (code == SchemaType.FACET_LENGTH || code == SchemaType.FACET_MIN_LENGTH
||
                     code == SchemaType.FACET_MAX_LENGTH))
                 {

Modified: xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java?rev=781219&r1=781218&r2=781219&view=diff
==============================================================================
--- xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java (original)
+++ xmlbeans/trunk/test/src/xmlobject/schematypes/checkin/GDateTests.java Wed Jun  3 00:13:04
2009
@@ -576,9 +576,9 @@
                 Assert.fail("Problem with " + str + ": " + e.getMessage());
             }
 
-            if ( str.contains("24:00:00") && gdate.hasDay() )   // for 24h if hasDay
must be normalized, else has the same representation
+            if ( str.indexOf("24:00:00") >= 0 && gdate.hasDay() )   // for 24h
if hasDay must be normalized, else has the same representation
             {
-                Assert.assertTrue(str + " " + gdate.toString(), gdate.hasDay() &&
gdate.toString().contains("00:00:00"));
+                Assert.assertTrue(str + " " + gdate.toString(), gdate.hasDay() &&
gdate.toString().indexOf("00:00:00") >= 0);
             }
             else
                 // must round-trip to string



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


Mime
View raw message