[117424] update test case to avoid passing null args into API that assumes non-null args. Added Assert to code to make assumption more explicit.
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
index 9b74bde..0a24f26 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
@@ -15,6 +15,7 @@
import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
+import org.eclipse.wst.sse.core.internal.util.Assert;
import org.eclipse.wst.sse.core.internal.util.URIResolver;
import org.eclipse.wst.xml.core.internal.Logger;
@@ -59,14 +60,14 @@
public String resolve(String base, String publicId, String systemId) {
String result = systemId;
-
if (base == null) {
- base = getResourceLocation();
- // bug 117320, ensure base URI is 'protocal' qualified before passing it thru to URIResolver
- base= URIHelper.addImpliedFileProtocol(base);
+ base = getResourceLocation();
+ // bug 117320, ensure base URI is 'protocal' qualified before passing it thru to URIResolver
+ // bug 117424, we should be able to assume that the base location is non-null
+ Assert.isNotNull(base, "Base location is expected to be non null.");
+ base = URIHelper.addImpliedFileProtocol(base);
}
-
- result = URIResolverPlugin.createResolver().resolve(base, publicId, systemId);
+ result = URIResolverPlugin.createResolver().resolve(base, publicId, systemId);
return result;
}