Source:
public static Optional<XSModel> getXSModel(final RepositoryFileReference ref) { Objects.requireNonNull(ref); try (final InputStream is = RepositoryFactory.getRepository().newInputStream(ref)) { XSImplementation impl = new XSImplementationImpl(); XSLoader schemaLoader = impl.createXSLoader(null); LSInput input = new LSInput() { @Override public String getSystemId() { return null; } @Override public void setSystemId(String systemId) { } @Override public String getStringData() { return null; } @Override public void setStringData(String stringData) { } @Override public String getPublicId() { return BackendUtils.getPathInsideRepo(ref); } @Override public void setPublicId(String publicId) { } @Override public String getEncoding() { return "UTF-8"; } @Override public void setEncoding(String encoding) { } @Override public Reader getCharacterStream() { try { return new InputStreamReader(is, "UTF-8"); } catch (UnsupportedEncodingException e) { System.out.println("exeption"); throw new IllegalStateException("UTF-8 is unkown", e); } } @Override public void setCharacterStream(Reader characterStream) { } @Override public boolean getCertifiedText() { return false; } @Override public void setCertifiedText(boolean certifiedText) { } @Override public InputStream getByteStream() { return null; } @Override public void setByteStream(InputStream byteStream) { } @Override public String getBaseURI() { return null; } @Override public void setBaseURI(String baseURI) { } }; return Optional.ofNullable(schemaLoader.load(input)); } catch (IOException e) { BackendUtils.LOGGER.debug("Could not create input stream", e); return Optional.empty(); } }

Target:
public static Optional<XSModel> getXSModel(final RepositoryFileReference ref) { Objects.requireNonNull(ref); try (final InputStream is = RepositoryFactory.getRepository().newInputStream(ref)) { XSImplementation impl = new XSImplementationImpl(); XSLoader schemaLoader = impl.createXSLoader(null); LSInput input = new LSInput() { @Override public void setSystemId(String systemId) { } @Override public void setStringData(String stringData) { } @Override public void setPublicId(String publicId) { } @Override public void setEncoding(String encoding) { } @Override public void setCharacterStream(Reader characterStream) { } @Override public void setCertifiedText(boolean certifiedText) { } @Override public void setByteStream(InputStream byteStream) { } @Override public void setBaseURI(String baseURI) { } @Override public String getSystemId() { return null; } @Override public String getStringData() { return null; } @Override public String getPublicId() { return BackendUtils.getPathInsideRepo(ref); } @Override public String getEncoding() { return "UTF-8"; } @Override public Reader getCharacterStream() { try { return new InputStreamReader(is, "UTF-8"); } catch (UnsupportedEncodingException e) { System.out.println("exeption"); throw new IllegalStateException("UTF-8 is unkown", e); } } @Override public boolean getCertifiedText() { return false; } @Override public InputStream getByteStream() { return null; } @Override public String getBaseURI() { return null; } }; return Optional.ofNullable(schemaLoader.load(input)); } catch (IOException e) { BackendUtils.LOGGER.debug("Could not create input stream", e); return Optional.empty(); } }