We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f70bda commit acbb1c0Copy full SHA for acbb1c0
1 file changed
src/main/java/org/mitre/stix/STIXSchema.java
@@ -256,8 +256,12 @@ public boolean validate(String xmlText) throws SAXException {
256
}
257
258
try {
259
- validator.validate(new StreamSource(new ByteArrayInputStream(
260
- xmlText.getBytes(StandardCharsets.UTF_8))));
+ // synchronized to avoid org.xml.sax.SAXException: FWK005 parse may
+ // not be called while parsing.
261
+ synchronized (this) {
262
+ validator.validate(new StreamSource(new ByteArrayInputStream(
263
+ xmlText.getBytes(StandardCharsets.UTF_8))));
264
+ }
265
} catch (IOException e) {
266
throw new RuntimeException(e);
267
} catch (SAXException e) {
0 commit comments