diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/SimpleBindingSet.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/SimpleBindingSet.java index cde1a78ed1..09a11ede02 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/SimpleBindingSet.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/planNodes/SimpleBindingSet.java @@ -50,9 +50,7 @@ public SimpleBindingSet(Set bindingNamesSet, Binding[] bindings) { assert bindings.length > 0; this.bindingNamesSet = bindingNamesSet; this.bindings = bindings; - if (Arrays.stream(bindings).anyMatch(Objects::isNull)) { - throw new AssertionError(); - } + assert Arrays.stream(bindings).anyMatch(Objects::isNull); } @Override diff --git a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/EffectiveTarget.java b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/EffectiveTarget.java index d02567858d..f5adcaaeca 100644 --- a/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/EffectiveTarget.java +++ b/core/sail/shacl/src/main/java/org/eclipse/rdf4j/sail/shacl/ast/targets/EffectiveTarget.java @@ -465,15 +465,11 @@ public Stream getRoot(ConnectionsGroup connectionsGroup, R if (currentStatementMatcher == rootStatementMatcher) { return null; } else { - if (prev == null) { - throw new AssertionError(); - } + assert prev != null; if (this.target instanceof SimplePath) { - if (!currentStatementMatcher.hasSubset(rootStatementMatcher) && - !prev.var.getName().equals(currentStatementMatcher.getSubjectName()) && - !prev.var.getName().equals(currentStatementMatcher.getObjectName())) { - throw new AssertionError(); - } + assert currentStatementMatcher.hasSubset(rootStatementMatcher) || + prev.var.getName().equals(currentStatementMatcher.getSubjectName()) || + prev.var.getName().equals(currentStatementMatcher.getObjectName()); return null; }