Skip to content

Commit 50393f8

Browse files
authored
Merge pull request #4974 from evolvedbinary/6.x.x/hotfix/java-lang-level-8
[6.x.x] Restore compatibility with Java language level 8
2 parents 37ff7d2 + 28011c5 commit 50393f8

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

exist-core/src/main/java/org/exist/xquery/functions/fn/transform/Options.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,11 @@ private Source resolvePossibleStylesheetLocation(final String location) throws X
528528
"Can not access '" + location + "'" + e.getMessage());
529529
}
530530
if (document != null && document.hasOne() && Type.subTypeOf(document.getItemType(), Type.NODE)) {
531-
if (document instanceof NodeProxy proxy) {
532-
return new DOMSource(proxy.getNode());
531+
if (document instanceof NodeProxy) {
532+
return new DOMSource(((NodeProxy) document).getNode());
533533
}
534-
else if (document.itemAt(0) instanceof Node node) {
535-
return new DOMSource(node);
534+
else if (document.itemAt(0) instanceof Node) {
535+
return new DOMSource((Node) document.itemAt(0));
536536
}
537537
}
538538
throw new XPathException(fnTransform, ErrorCodes.FODC0002,

exist-core/src/main/java/org/exist/xquery/functions/fn/transform/Transform.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private XsltExecutable compileExecutable(final Options options) throws XPathExce
222222
xsltCompiler.setURIResolver((href, base) -> {
223223
try {
224224
final URI hrefURI = URI.create(href);
225-
if (options.resolvedStylesheetBaseURI.isEmpty() && !hrefURI.isAbsolute() && StringUtils.isEmpty(base)) {
225+
if ((!options.resolvedStylesheetBaseURI.isPresent()) && !hrefURI.isAbsolute() && StringUtils.isEmpty(base)) {
226226
final XPathException resolutionException = new XPathException(fnTransform,
227227
ErrorCodes.XTSE0165,
228228
"transform using a relative href, \n" +
@@ -265,8 +265,8 @@ private XPathException originalXPathException(final String prefix, @Nonnull fina
265265

266266
cause = e;
267267
while (cause != null) {
268-
if (cause instanceof final net.sf.saxon.trans.XPathException xPathException) {
269-
final StructuredQName from = xPathException.getErrorCodeQName();
268+
if (cause instanceof net.sf.saxon.trans.XPathException) {
269+
final StructuredQName from = ((net.sf.saxon.trans.XPathException) cause).getErrorCodeQName();
270270
if (from != null) {
271271
final QName errorCodeQName = new QName(from.getLocalPart(), from.getURI(), from.getPrefix());
272272
final ErrorCodes.ErrorCode errorCode = new ErrorCodes.ErrorCode(errorCodeQName, cause.getMessage());

0 commit comments

Comments
 (0)