Skip to content

Commit

Permalink
[refactor] Address further code-review from @reinhapa
Browse files Browse the repository at this point in the history
  • Loading branch information
adamretter committed Oct 30, 2023
1 parent 98accad commit 76fb045
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ public void analyze(final AnalyzeContextInfo contextInfo) throws XPathException

@Override
public Sequence postEval(Sequence seq) throws XPathException {
if (returnExpr instanceof FLWORClause) {
seq = ((FLWORClause)returnExpr).postEval(seq);
if (returnExpr instanceof FLWORClause flworClause) {
seq = flworClause.postEval(seq);
}
return super.postEval(seq);
}
Expand Down
6 changes: 3 additions & 3 deletions exist-core/src/main/java/org/exist/xquery/CountClause.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ private boolean hasPreviousOrderByDescending() {
case ORDERBY -> {
return isDescending(((OrderByClause) prev).getOrderSpecs());
}
default -> prev = prev.getPreviousClause();
}
prev = prev.getPreviousClause();
}
return true;
}
Expand Down Expand Up @@ -183,8 +183,8 @@ public Sequence eval(final Sequence contextSequence, final Item contextItem) thr

@Override
public Sequence postEval(Sequence seq) throws XPathException {
if (returnExpr instanceof FLWORClause) {
seq = ((FLWORClause)returnExpr).postEval(seq);
if (returnExpr instanceof FLWORClause flworClause) {
seq = flworClause.postEval(seq);
}
return super.postEval(seq);
}
Expand Down
4 changes: 2 additions & 2 deletions exist-core/src/main/java/org/exist/xquery/GroupByClause.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ public Sequence postEval(final Sequence seq) throws XPathException {
context.popLocalVariables(mark, result);
}

if (returnExpr instanceof FLWORClause) {
result = ((FLWORClause) returnExpr).postEval(result);
if (returnExpr instanceof FLWORClause flworClause) {
result = flworClause.postEval(result);
}
result = super.postEval(result);
return result;
Expand Down
4 changes: 2 additions & 2 deletions exist-core/src/main/java/org/exist/xquery/OrderByClause.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public Sequence postEval(Sequence seq) throws XPathException {
orderedResult.sort();
Sequence result = orderedResult;

if (getReturnExpression() instanceof FLWORClause) {
result = ((FLWORClause) getReturnExpression()).postEval(result);
if (getReturnExpression() instanceof FLWORClause flworClause) {
result = flworClause.postEval(result);
}
return super.postEval(result);
}
Expand Down
4 changes: 2 additions & 2 deletions exist-core/src/main/java/org/exist/xquery/WhereClause.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathExc
@Override
public Sequence postEval(Sequence seq) throws XPathException {
fastTrack = false;
if (returnExpr instanceof FLWORClause) {
seq = ((FLWORClause) returnExpr).postEval(seq);
if (returnExpr instanceof FLWORClause flworClause) {
seq = flworClause.postEval(seq);
}
return super.postEval(seq);
}
Expand Down

0 comments on commit 76fb045

Please sign in to comment.