--- glassfish-jaxb-2.1.9/runtime/src/com/sun/xml/bind/DatatypeConverterImpl.java.orig	2010-01-14 11:24:39.000000000 -0500
+++ glassfish-jaxb-2.1.9/runtime/src/com/sun/xml/bind/DatatypeConverterImpl.java	2010-01-14 11:44:42.000000000 -0500
@@ -100,40 +100,8 @@
         return _parseInt(s);
     }
 
-    /**
-     * Faster but less robust String->int conversion.
-     *
-     * Note that:
-     * <ol>
-     *  <li>XML Schema allows '+', but {@link Integer#valueOf(String)} is not.
-     *  <li>XML Schema allows leading and trailing (but not in-between) whitespaces..
-     *      {@link Integer#valueOf(String)} doesn't allow any.
-     * </ol>
-     */
     public static int _parseInt(CharSequence s) {
-        int len = s.length();
-        int sign = 1;
-
-        int r = 0;
-
-        for( int i=0; i<len; i++ ) {
-            char ch = s.charAt(i);
-            if(WhiteSpaceProcessor.isWhiteSpace(ch)) {
-                // skip whitespace
-            } else
-            if('0'<=ch && ch<='9') {
-                r = r*10 + (ch-'0');
-            } else
-            if(ch=='-') {
-                sign = -1;
-            } else
-            if(ch=='+') {
-                // noop
-            } else
-                throw new NumberFormatException("Not a number: "+s);
-        }
-
-        return r*sign;
+	return Integer.valueOf(removeOptionalPlus(WhiteSpaceProcessor.trim(s)).toString());
     }
 
     public long parseLong(String lexicalXSLong) {
