mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
IJPL-160786 Creating XML from XSD fails with the "Cannot invoke java.util.Collection.iterator()" error
GitOrigin-RevId: 2fb750ca2f741446a540b4a0f480057ec5a93d01
This commit is contained in:
committed by
intellij-monorepo-bot
parent
36f8052ed8
commit
bfe75a78d3
@@ -19,6 +19,7 @@ import com.intellij.xml.impl.schema.XmlNSDescriptorImpl;
|
||||
import com.intellij.xml.util.XmlUtil;
|
||||
import org.apache.xmlbeans.*;
|
||||
import org.apache.xmlbeans.impl.tool.CommandLine;
|
||||
import org.apache.xmlbeans.impl.xb.xsdschema.SchemaDocument;
|
||||
import org.apache.xmlbeans.impl.xsd2inst.SampleXmlUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -68,7 +69,7 @@ final class Xsd2InstanceUtils {
|
||||
var sdocs = new ArrayList<XmlObject>();
|
||||
for (File schemaFile : schemaFiles) {
|
||||
try {
|
||||
sdocs.add(XmlObject.Factory.parse(schemaFile,
|
||||
sdocs.add(SchemaDocument.Factory.parse(schemaFile,
|
||||
(new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest()));
|
||||
}
|
||||
catch (Exception e) {
|
||||
@@ -97,8 +98,13 @@ final class Xsd2InstanceUtils {
|
||||
catch (XmlException e) {
|
||||
StringBuilder out = new StringBuilder("Schema compilation errors: ");
|
||||
var errors = e.getErrors();
|
||||
for (Object error : errors) {
|
||||
out.append("\n").append(error);
|
||||
if (errors != null) {
|
||||
for (Object error : errors) {
|
||||
out.append("\n").append(error);
|
||||
}
|
||||
}
|
||||
else {
|
||||
out.append(e.getMessage());
|
||||
}
|
||||
throw new IllegalArgumentException(out.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user