8173260: CatalogManager.catalogResolver should not fail when non-existing URI is passed to it
authordfuchs
Fri, 27 Jan 2017 20:33:34 +0000
changeset 43358 9e2d943b5b66
parent 43357 ef3ea67a2257
child 43359 269efd520e13
8173260: CatalogManager.catalogResolver should not fail when non-existing URI is passed to it Summary: removed the code that special cased file and jar and threw IAE if the file did not exist. Reviewed-by: alanb, lancea
jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java
jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogFileInputTest.java
--- a/jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java	Thu Jan 26 21:20:30 2017 +0000
+++ b/jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java	Fri Jan 27 20:33:34 2017 +0000
@@ -149,14 +149,6 @@
             CatalogMessages.reportIAE(CatalogMessages.ERR_URI_NOTVALIDURL,
                     new Object[]{uri}, null);
         }
-
-        // verify the resource exists where possible
-        if (isFileUri(uri)) {
-            if (!isFileUriExist(uri, false)) {
-                CatalogMessages.reportIAE(CatalogMessages.ERR_URI_NOTVALIDURL,
-                        new Object[]{uri}, null);
-            }
-        }
     }
 
     /**
--- a/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogFileInputTest.java	Thu Jan 26 21:20:30 2017 +0000
+++ b/jaxp/test/javax/xml/jaxp/unittest/catalog/CatalogFileInputTest.java	Fri Jan 27 20:33:34 2017 +0000
@@ -222,6 +222,8 @@
         String catalogUri = getClass().getResource("catalog_invalid.xml").toExternalForm();
         return new Object[][]{
             {catalogUri, "-//W3C//DTD XHTML 1.0 Strict//EN",
+                "The catalog is invalid, attempting to match the public entry shall return null."},
+            {"file:/../../..", "-//W3C//DTD XHTML 1.0 Strict//EN",
                 "The catalog is invalid, attempting to match the public entry shall return null."}
         };
     }
@@ -239,7 +241,6 @@
         return new Object[][]{
             {""},
             {"file:a/b\\c"},
-            {"file:/../../.."},
             {"c:/te:t"},
             {"c:/te?t"},
             {"c/te*t"},