changeset 856:e200ce7cc24b

8015243: SchemaFactory does not catch enum. value that is not in the value space of the base type, anyURI Reviewed-by: lancea
author joehw
date Thu, 17 Oct 2013 16:59:05 -0700
parents 0115f26bcecd
children c0727f8c3ea8
files src/com/sun/org/apache/xerces/internal/util/URI.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/com/sun/org/apache/xerces/internal/util/URI.java	Tue Oct 15 14:48:17 2013 +0400
+++ b/src/com/sun/org/apache/xerces/internal/util/URI.java	Thu Oct 17 16:59:05 2013 -0700
@@ -689,9 +689,13 @@
         if (!initializeAuthority(uriSpec.substring(startPos, index))) {
           index = startPos - 2;
         }
-      }
-      else {
+      } else if (index < uriSpecLen) {
+        //Same as java.net.URI:
+        // DEVIATION: Allow empty authority prior to non-empty
+        // path, query component or fragment identifier
         m_host = "";
+      } else {
+        throw new MalformedURIException("Expected authority.");
       }
     }