Buggy code:
public static Element loadString ( String data , boolean validate ) throws IOException , JDOMException { } public static Element loadStream ( InputStream input ) throws IOException , JDOMException { } public static Element transform ( Element xml , Path styleSheetPath ) throws Exception { } public static Element transform ( Element xml , Path styleSheetPath , Map < String , Object > params ) throws Exception { } public static void transform ( Element xml , Path styleSheetPath , OutputStream out ) throws Exception { } public static void transform ( Element xml , String styleSheetPath , Result result ) throws Exception { } public static Element transformWithXmlParam ( Element xml , String styleSheetPath , String xmlParamName , String xmlParam ) throws Exception { } public static void transformWithXmlParam ( Element xml , Source xslt , Result result , String xmlParamName , String xmlParam ) throws Exception { } private static class JeevesURIResolver implements URIResolver { public Source resolve ( String href , String base ) throws TransformerException { } } protected static Path resolvePath ( Source s ) throws URISyntaxException { } public static void transform ( Element xml , Path styleSheetPath , Result result , Map < String , Object > params ) throws Exception { } public static void clearTransformerFactoryStylesheetCache ( ) { } public static Path transformFOP ( Path uploadDir , Element xml , String styleSheetPath ) throws Exception { } public static void writeResponse ( Document doc , OutputStream out ) throws IOException { } public static String getString ( Element data ) { } public static String getJSON ( Element xml ) throws IOException { } public static String getJSON ( String xml ) throws IOException { } public static String getString ( DocType data ) { } public static String getString ( Document data ) { } private static XPath prepareXPath ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static Object selectSingle ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static Element selectElement ( Element xml , String xpath ) throws JDOMException { } public static Element selectElement ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static List < ? > selectNodes ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static List < ? > selectDocumentNodes ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static List < ? > selectNodes ( Element xml , String xpath ) throws JDOMException { } public static String selectString ( Element xml , String xpath ) throws JDOMException { } public static String selectString ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static boolean selectBoolean ( Element xml , String xpath ) throws JDOMException { } public static boolean selectBoolean ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static Number selectNumber ( Element xml , String xpath ) throws JDOMException { } public static Number selectNumber ( Element xml , String xpath , List < Namespace > theNSs ) throws JDOMException { } public static Set < String > filterElementValues ( Element element , ElementFilter elementFilter , String elementName , Namespace elementNamespace , String attributeName ) { } public static class ErrorHandler extends DefaultHandler { private int errorCount = 0 ; private Element xpaths ; private Namespace ns = Namespace . NO_NAMESPACE ; private SAXOutputter so ; public void setSo ( SAXOutputter so ) { } public boolean errors ( ) { } public Element getXPaths ( ) { } public void addMessage ( SAXParseException exception , String typeOfError ) { } public void error ( SAXParseException parseException ) throws SAXException { } public void fatalError ( SAXParseException parseException ) throws SAXException { } public void warning ( SAXParseException parseException ) throws SAXException { } public void setNs ( Namespace ns ) { } public Namespace getNs ( ) { } } public static synchronized void validate ( Document doc ) throws Exception { } public static synchronized void validate ( Element xml ) throws Exception { } public static void validate ( Path schemaPath , Element xml ) throws Exception { } public static Element validateInfo ( Element xml ) throws Exception { } public static Element validateInfo ( Element xml , Xml . ErrorHandler eh ) throws Exception { } public static Element validateInfo ( Path schemaPath , Element xml ) throws Exception { } public static Element validateInfo ( Path schemaPath , Element xml , Xml . ErrorHandler eh ) throws Exception { } private static void validateGuts ( Path schemaPath , Element xml , Xml . ErrorHandler eh ) throws Exception { <START_BUG> PathInputSource schemaFile = new PathInputSource ( schemaPath ) ; <END_BUG> schemaFile . setSystemId ( schemaPath . toUri ( ) . toASCIIString ( ) ) ; final SchemaFactory factory = Xml . factory ( ) ; NioPathHolder . setBase ( schemaPath ) ; Resolver resolver = ResolverWrapper . getInstance ( ) ; factory . setResourceResolver ( resolver . getXmlResolver ( ) ) ; Schema schema = factory . newSchema ( schemaFile ) ; Xml . validateRealGuts ( schema , xml , eh ) ; } private static void validateRealGuts ( Schema schema , Element xml , Xml . ErrorHandler eh ) throws Exception { } private static SchemaFactory factory ( ) { } public static String getXPathExpr ( Content element ) { } public static String getXPathExpr ( Attribute attribute ) { } private static boolean doCreateXpathExpr ( Object content , StringBuilder builder ) { } private static void doCreateAttributesXpathExpr ( StringBuilder builder , List < Attribute > attributes ) { } }

Fix:
PathStreamSource schemaFile = new PathStreamSource ( schemaPath ) ;