Skip to content

Commit d733dd6

Browse files
committed
cleanup
1 parent be1aae4 commit d733dd6

8 files changed

Lines changed: 21 additions & 21 deletions

File tree

core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/FilterOptimizerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public double estimateFilterPassRatio(Filter filter) {
386386
}
387387

388388
private boolean isNameFilter(Filter filter) {
389-
if (!(filter.getArg()instanceof StatementPattern statementPattern)) {
389+
if (!(filter.getArg() instanceof StatementPattern statementPattern)) {
390390
return false;
391391
}
392392
return statementPattern.getPredicateVar() != null

core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/QueryJoinOptimizerGreedyOuterBindingsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ public boolean supportsJoinEstimation() {
461461

462462
@Override
463463
public double getCardinality(TupleExpr expr) {
464-
if (expr instanceof Filter filter && filter.getArg()instanceof StatementPattern statementPattern) {
464+
if (expr instanceof Filter filter && filter.getArg() instanceof StatementPattern statementPattern) {
465465
if (predicate(statementPattern).equals(ex("recordedOn"))) {
466466
return 0.1d;
467467
}
@@ -500,7 +500,7 @@ public double getCardinality(TupleExpr expr) {
500500

501501
@Override
502502
public double estimateFilterPassRatio(Filter filter) {
503-
return filter.getArg()instanceof StatementPattern statementPattern
503+
return filter.getArg() instanceof StatementPattern statementPattern
504504
&& predicate(statementPattern).equals(ex("recordedOn")) ? 0.01d : -1.0d;
505505
}
506506
}

core/queryalgebra/evaluation/src/test/java/org/eclipse/rdf4j/query/algebra/evaluation/impl/QueryJoinOptimizerTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -790,8 +790,8 @@ public void optimizeDoesNotAddValuesAnchorForUnknownTypeValueEqualityInFilter()
790790
" ?s ex:type ?type .",
791791
" FILTER (?value IN (1, 2.0))",
792792
"}"), new EvaluationStatistics()), "value"))
793-
.as("Numeric IN equality can match non-identical RDF terms, so same-term VALUES is unsafe")
794-
.isEmpty();
793+
.as("Numeric IN equality can match non-identical RDF terms, so same-term VALUES is unsafe")
794+
.isEmpty();
795795

796796
assertThat(bindingSetAssignments(optimizeWithStatistics(String.join("\n",
797797
"PREFIX ex: <http://example.com/>",
@@ -800,8 +800,8 @@ public void optimizeDoesNotAddValuesAnchorForUnknownTypeValueEqualityInFilter()
800800
" ?s ex:type ?type .",
801801
" FILTER (?value IN (\"true\"^^<http://www.w3.org/2001/XMLSchema#boolean>))",
802802
"}"), new EvaluationStatistics()), "value"))
803-
.as("Boolean IN equality is value equality, not RDF-term identity")
804-
.isEmpty();
803+
.as("Boolean IN equality is value equality, not RDF-term identity")
804+
.isEmpty();
805805

806806
assertThat(bindingSetAssignments(optimizeWithStatistics(String.join("\n",
807807
"PREFIX ex: <http://example.com/>",
@@ -810,8 +810,8 @@ public void optimizeDoesNotAddValuesAnchorForUnknownTypeValueEqualityInFilter()
810810
" ?s ex:type ?type .",
811811
" FILTER (?value IN (\"2020-01-01T00:00:00Z\"^^<http://www.w3.org/2001/XMLSchema#dateTime>))",
812812
"}"), new EvaluationStatistics()), "value"))
813-
.as("dateTime IN equality is value equality, not RDF-term identity")
814-
.isEmpty();
813+
.as("dateTime IN equality is value equality, not RDF-term identity")
814+
.isEmpty();
815815
}
816816

817817
@Test

core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SketchBasedJoinEstimator.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5768,7 +5768,7 @@ private double cardinalityWithInitiallyBoundVars(List<TupleExpr> tupleExprs, Set
57685768
: JoinOrderPlanner.Algorithm.GREEDY;
57695769
SketchJoinOrderPlanner.PlanOutcome outcome = new SketchJoinOrderPlanner(this, JoinOrderWorkAdjuster.NO_OP,
57705770
tupleExprs, bound)
5771-
.plan(algorithm);
5771+
.plan(algorithm);
57725772
recordRobustCardinalityPath(outcome.path());
57735773
return outcome.plan()
57745774
.map(JoinOrderPlanner.JoinOrderPlan::getEstimatedFinalRows)
@@ -6568,14 +6568,14 @@ private Resource exactBoundResource(Var var) {
65686568
if (var == null || !var.hasValue() || var.getValue() == null) {
65696569
return null;
65706570
}
6571-
return var.getValue()instanceof Resource resource ? resource : null;
6571+
return var.getValue() instanceof Resource resource ? resource : null;
65726572
}
65736573

65746574
private IRI exactBoundIri(Var var) {
65756575
if (var == null || !var.hasValue() || var.getValue() == null) {
65766576
return null;
65776577
}
6578-
return var.getValue()instanceof IRI iri ? iri : null;
6578+
return var.getValue() instanceof IRI iri ? iri : null;
65796579
}
65806580

65816581
private Value exactBoundValue(Var var) {
@@ -6592,7 +6592,7 @@ private Resource[] exactBoundContexts(Var contextVar) {
65926592
if (contextVar.getValue() == null) {
65936593
return new Resource[] { null };
65946594
}
6595-
if (!(contextVar.getValue()instanceof Resource resource)) {
6595+
if (!(contextVar.getValue() instanceof Resource resource)) {
65966596
return null;
65976597
}
65986598
return new Resource[] { resource };
@@ -6697,7 +6697,7 @@ private double estimatePatternRows(StatementPattern pattern) {
66976697
getValueOrNull(pattern.getPredicateVar()),
66986698
getValueOrNull(pattern.getObjectVar()),
66996699
getValueOrNull(pattern.getContextVar()))
6700-
.estimate();
6700+
.estimate();
67016701
}
67026702

67036703
private Component resolveJoinComponent(StatementPattern pattern) {
@@ -7264,7 +7264,7 @@ private LookupAnalysis analyzeListMemberLookup(StatementPattern pattern, ValueEx
72647264
}
72657265

72667266
List<ValueExpr> arguments = ((ListMemberOperator) condition).getArguments();
7267-
if (arguments == null || arguments.size() < 2 || !(arguments.get(0)instanceof Var listedVar)
7267+
if (arguments == null || arguments.size() < 2 || !(arguments.get(0) instanceof Var listedVar)
72687268
|| listedVar.getName() == null) {
72697269
return LookupAnalysis.none();
72707270
}
@@ -7295,7 +7295,7 @@ private LookupAnalysis analyzeListMemberLookup(StatementPattern pattern, ValueEx
72957295
}
72967296

72977297
List<ValueExpr> arguments = ((ListMemberOperator) condition).getArguments();
7298-
if (arguments == null || arguments.size() < 2 || !(arguments.get(0)instanceof Var listedVar)
7298+
if (arguments == null || arguments.size() < 2 || !(arguments.get(0) instanceof Var listedVar)
72997299
|| listedVar.getName() == null) {
73007300
return LookupAnalysis.none();
73017301
}

core/sail/base/src/main/java/org/eclipse/rdf4j/sail/base/SketchJoinOrderReorderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ JoinOrderPlanner.PlanningAttempt planAttempt(List<TupleExpr> args, Set<String> i
9797

9898
SketchJoinOrderPlanner.PlanOutcome outcome = new SketchJoinOrderPlanner(estimator, workAdjuster,
9999
plannedExpressions, plannedBound, deferredFilters)
100-
.plan(algorithm);
100+
.plan(algorithm);
101101
estimator.recordJoinOrderPlannerPath(outcome.path());
102102
if (outcome.plan().isEmpty()) {
103103
List<String> diagnostics = new ArrayList<>(inputDiagnostics.size() + outcome.diagnostics().size());

core/sail/lmdb/src/test/java/org/eclipse/rdf4j/sail/lmdb/LmdbSketchAwareFilterPlacementTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,15 @@ private static void collectMandatoryLeafOrder(TupleExpr tupleExpr, List<String>
383383
}
384384

385385
private static boolean isRecordedOnFilter(Filter filter) {
386-
if (!(filter.getArg()instanceof StatementPattern statementPattern)) {
386+
if (!(filter.getArg() instanceof StatementPattern statementPattern)) {
387387
return false;
388388
}
389389
return MEDICAL_RECORDED_ON.equals(statementPattern.getPredicateVar().getValue())
390390
&& VarNameCollector.process(filter.getCondition()).contains("date");
391391
}
392392

393393
private static boolean isSubstationNameFilter(Filter filter) {
394-
if (!(filter.getArg()instanceof StatementPattern statementPattern)) {
394+
if (!(filter.getArg() instanceof StatementPattern statementPattern)) {
395395
return false;
396396
}
397397
return GRID_NAME.equals(statementPattern.getPredicateVar().getValue())

core/sail/lmdb/src/test/java/org/eclipse/rdf4j/sail/lmdb/SketchEstimatorThemeJoinAccuracyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ private static long exactJoinRowsForLocatedAtName(SailRepository repository) {
480480
long total = 0L;
481481
while (locatedAtStatements.hasNext()) {
482482
Statement statement = locatedAtStatements.next();
483-
if (statement.getObject()instanceof Resource branch) {
483+
if (statement.getObject() instanceof Resource branch) {
484484
total += branchNameRows.getOrDefault(branch, 0);
485485
}
486486
}

core/sail/lmdb/src/test/java/org/eclipse/rdf4j/sail/lmdb/benchmark/ThemeQueryBenchmarkSmokeTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ private static void collectMandatoryLeafOrder(TupleExpr tupleExpr, List<String>
184184
}
185185

186186
private static boolean isRecordedOnFilter(Filter filter) {
187-
if (!(filter.getArg()instanceof StatementPattern statementPattern)) {
187+
if (!(filter.getArg() instanceof StatementPattern statementPattern)) {
188188
return false;
189189
}
190190
return MEDICAL_RECORDED_ON.equals(statementPattern.getPredicateVar().getValue().stringValue())

0 commit comments

Comments
 (0)