xmlbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ce...@apache.org
Subject svn commit: r938531 - in /xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl: validator/Validator.java values/JavaIntegerHolderEx.java
Date Tue, 27 Apr 2010 16:00:47 GMT
Author: cezar
Date: Tue Apr 27 16:00:46 2010
New Revision: 938531

URL: http://svn.apache.org/viewvc?rev=938531&view=rev
Log:
Fix validation of integer value containing dot char.


Modified:
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
    xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java?rev=938531&r1=938530&r2=938531&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/validator/Validator.java Tue Apr
27 16:00:46 2010
@@ -1305,7 +1305,7 @@ public final class Validator
             // An additional rule states that if the type is xs:integer or derived from it,
             // then the decimal dot is not allowed.
             // verify that values extending xsd:integer don't have a decimal point
-            if ( _strict && derivedFromInteger( type ) && value.lastIndexOf('.')
>= 0 )
+            if ( derivedFromInteger( type ) && value.lastIndexOf('.') >= 0 )
             {
                 _vc.invalid(XmlErrorCodes.INTEGER, new Object[] { value });
             }

Modified: xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java
URL: http://svn.apache.org/viewvc/xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java?rev=938531&r1=938530&r2=938531&view=diff
==============================================================================
--- xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java (original)
+++ xmlbeans/trunk/src/typeimpl/org/apache/xmlbeans/impl/values/JavaIntegerHolderEx.java Tue
Apr 27 16:00:46 2010
@@ -59,6 +59,9 @@ public class JavaIntegerHolderEx extends
     public static void validateLexical(String v, SchemaType sType, ValidationContext context)
     {
         JavaDecimalHolder.validateLexical(v, context);
+        if ( v.lastIndexOf('.')>=0 )
+            context.invalid(XmlErrorCodes.INTEGER,
+                new Object[] { v });
 
         // check pattern
         if (sType.hasPatternFacet())



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


Mime
View raw message