Skip to content

Commit a205f20

Browse files
author
Evgenii Grigorev
committed
Remove throws from getRDFNodeValue and its overrides signatures
1 parent f51e476 commit a205f20

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

s-pipes-core/src/main/java/cz/cvut/spipes/modules/handlers/BaseRDFNodeHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public RDFNode getEffectiveValue(Property property) {
4646
* @param node The RDF node to convert.
4747
* @return The converted value of type {@code T}.
4848
*/
49-
abstract T getRDFNodeValue(RDFNode node) throws Exception;
49+
abstract T getRDFNodeValue(RDFNode node);
5050

5151
/**
5252
* Checks if the given property is assigned a value in the current resource.

s-pipes-core/src/main/java/cz/cvut/spipes/modules/handlers/URLHandler.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ public URLHandler(Resource resource, ExecutionContext executionContext, Setter<?
1212
}
1313

1414
@Override
15-
URL getRDFNodeValue(RDFNode node) throws MalformedURLException {
16-
return new URL(node.toString());
15+
URL getRDFNodeValue(RDFNode node) {
16+
try {
17+
return new URL(node.toString());
18+
} catch (MalformedURLException e) {
19+
throw new IllegalArgumentException("Invalid RDFNode URL: " + node, e);
20+
}
1721
}
1822

1923
}

s-pipes-core/src/test/java/cz/cvut/spipes/modules/handlers/URLHandlerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void getRDFNodeValueWhenInvalidURLThrowsRuntimeError() {
4040

4141
RDFNode node = ResourceFactory.createPlainLiteral("invalid-url");
4242

43-
assertThrows(MalformedURLException.class, () -> urlHandler.getRDFNodeValue(node));
43+
assertThrows(IllegalArgumentException.class, () -> urlHandler.getRDFNodeValue(node));
4444
}
4545

4646
@Test

s-pipes-modules/module-tabular/src/main/java/cz/cvut/spipes/modules/handlers/ModeHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public ModeHandler(Resource resource, ExecutionContext executionContext, Setter<
1212
}
1313

1414
@Override
15-
Mode getRDFNodeValue(RDFNode node) throws Exception {
15+
Mode getRDFNodeValue(RDFNode node) {
1616
return Mode.fromResource(node.asResource());
1717
}
1818
}

0 commit comments

Comments
 (0)