#1502: XJC: fails to process XSD files without systemId

Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java
index 598a136..540d98b 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/api/impl/s2j/SchemaCompilerImpl.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -212,7 +212,7 @@
                         try {
                             // XSOM passes the namespace URI to the publicID parameter.
                             // we do the same here .
-                            InputSource is = opts.entityResolver.resolveEntity(namespaceURI, systemId);
+                            InputSource is = opts.entityResolver.resolveEntity(namespaceURI, systemId == null ? "" : systemId);
                             if (is == null) return null;
                             return new LSInputSAXWrapper(is);
                         } catch (SAXException e) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
index 4927ce7..fb55620 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/SchemaConstraintChecker.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -62,7 +62,7 @@
                     try {
                         // XSOM passes the namespace URI to the publicID parameter.
                         // we do the same here .
-                        InputSource is = entityResolver.resolveEntity(namespaceURI, systemId);
+                        InputSource is = entityResolver.resolveEntity(namespaceURI, systemId == null ? "" : systemId);
                         if(is==null)    return null;
                         return new LSInputSAXWrapper(is);
                     } catch (SAXException e) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java
index e0ce718..cb3bf06 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/util/ForkEntityResolver.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -31,9 +31,10 @@
     }
 
     public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
-        InputSource is = lhs.resolveEntity(publicId, systemId);
+        String sId = systemId == null ? "" : systemId;
+        InputSource is = lhs.resolveEntity(publicId, sId);
         if(is!=null)
             return is;
-        return rhs.resolveEntity(publicId,systemId);
+        return rhs.resolveEntity(publicId, sId);
     }
 }
diff --git a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/NGCCRuntimeEx.java b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/NGCCRuntimeEx.java
index e92197d..bd1d2ea 100644
--- a/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/NGCCRuntimeEx.java
+++ b/jaxb-ri/xsom/src/main/java/com/sun/xml/xsom/impl/parser/NGCCRuntimeEx.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2019 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2021 Oracle and/or its affiliates. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Distribution License v. 1.0, which is available at
@@ -175,7 +175,7 @@
                 baseUri=documentSystemId;
 
             EntityResolver er = parser.getEntityResolver();
-            String systemId = null;
+            String systemId = "";
 
             if (relativeUri!=null) {
                 if (isAbsolute(relativeUri)) {