Skip to content

Commit e7d1ee4

Browse files
committed
[bugfix] codacy checks in fn:transform uri resn.
1 parent 4e2ef38 commit e7d1ee4

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ protected Source resolveDocument(final String location) throws XPathException {
108108
* @return the resolved stylesheet as a source
109109
* @throws org.exist.xquery.XPathException if the item does not exist, or is not a document
110110
*/
111-
static Source resolveDocument(final String location, final XQueryContext xQueryContext, Expression containingExpression) throws org.exist.xquery.XPathException {
111+
static Source resolveDocument(final String location, final XQueryContext xQueryContext, Expression containingExpression) throws XPathException {
112112

113113
final Sequence document;
114114
try {
115115
document = DocUtils.getDocument(xQueryContext, location);
116116
} catch (final PermissionDeniedException e) {
117-
throw new org.exist.xquery.XPathException(containingExpression, ErrorCodes.FODC0002,
117+
throw new XPathException(containingExpression, ErrorCodes.FODC0002,
118118
"Can not access '" + location + "'" + e.getMessage());
119119
}
120120
if (document == null || document.isEmpty()) {
121-
throw new org.exist.xquery.XPathException(containingExpression, ErrorCodes.FODC0002,
121+
throw new XPathException(containingExpression, ErrorCodes.FODC0002,
122122
"No document found at location '"+ location);
123123
}
124124
if (document.hasOne() && Type.subTypeOf(document.getItemType(), Type.NODE)) {
@@ -129,7 +129,7 @@ else if (document.itemAt(0) instanceof Node node) {
129129
return new DOMSource(node);
130130
}
131131
}
132-
throw new org.exist.xquery.XPathException(containingExpression, ErrorCodes.FODC0002,
132+
throw new XPathException(containingExpression, ErrorCodes.FODC0002,
133133
"Location '"+ location + "' returns an item which is not a document node");
134134
}
135135
}

exist-core/src/test/java/org/exist/xquery/functions/fn/transform/FunTransformTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ private static class SourceWithLocation implements Source {
166166
this.location = location;
167167
}
168168

169-
// implementation solely to conform to interface for test use
169+
/**
170+
* implementation solely to conform to interface for test use
171+
*
172+
* @param systemId The system identifier as a URL string.
173+
*/
170174
@Override
171175
public void setSystemId(String systemId) {
172176
}

0 commit comments

Comments
 (0)