private static Schema getSchema ( InputStream schemaStream ) throws SAXException { Schema result ; synchronized ( SCHEMA_FACTORY ) { result = SCHEMA_FACTORY . newSchema ( new StreamSource ( schemaStream ) ) ; } return result ; }
Schema Factory is not thread safe