Skip to content

Commit 8689280

Browse files
committed
[ignore] Code Cleanup
1 parent ad6a38b commit 8689280

File tree

1 file changed

+29
-36
lines changed

1 file changed

+29
-36
lines changed

exist-core/src/main/java/org/exist/xquery/BindingExpression.java

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
import org.exist.xquery.value.*;
3131

3232
/**
33-
* Abstract superclass for the variable binding expressions "for" and "let".
33+
* Abstract superclass for the variable binding expressions "for", "let", and "count".
3434
*
3535
* @author <a href="mailto:[email protected]">Wolfgang Meier</a>
3636
*/
@@ -45,11 +45,9 @@ public abstract class BindingExpression extends AbstractFLWORClause implements R
4545
protected QName varName;
4646
protected SequenceType sequenceType = null;
4747
protected Expression inputSequence;
48-
4948
private ExprUpdateListener listener;
5049

51-
52-
public BindingExpression(XQueryContext context) {
50+
public BindingExpression(final XQueryContext context) {
5351
super(context);
5452
}
5553

@@ -78,10 +76,8 @@ public Expression getInputSequence() {
7876
return this.inputSequence;
7977
}
8078

81-
/* (non-Javadoc)
82-
* @see org.exist.xquery.Expression#analyze(org.exist.xquery.Expression, int)
83-
*/
84-
public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
79+
@Override
80+
public void analyze(final AnalyzeContextInfo contextInfo) throws XPathException {
8581
unordered = (contextInfo.getFlags() & UNORDERED) > 0;
8682
}
8783

@@ -93,37 +89,32 @@ public Sequence postEval(Sequence seq) throws XPathException {
9389
return super.postEval(seq);
9490
}
9591

96-
/* (non-Javadoc)
97-
* @see org.exist.xquery.Expression#preselect(org.exist.dom.persistent.DocumentSet, org.exist.xquery.StaticContext)
98-
*/
99-
public DocumentSet preselect(DocumentSet in_docs) throws XPathException {
100-
return in_docs;
92+
public DocumentSet preselect(final DocumentSet docs) throws XPathException {
93+
return docs;
10194
}
10295

103-
/* (non-Javadoc)
104-
* @see org.exist.xquery.AbstractExpression#resetState()
105-
*/
106-
public void resetState(boolean postOptimization) {
96+
@Override
97+
public void resetState(final boolean postOptimization) {
10798
super.resetState(postOptimization);
10899
inputSequence.resetState(postOptimization);
109100
returnExpr.resetState(postOptimization);
110101
}
111102

112-
public final static void setContext(int contextId, Sequence seq) throws XPathException {
103+
public static void setContext(final int contextId, final Sequence seq) throws XPathException {
113104
if (seq instanceof VirtualNodeSet) {
114105
((VirtualNodeSet)seq).setInPredicate(true);
115106
((VirtualNodeSet)seq).setSelfIsContext();
116107
} else {
117-
Item next;
118-
for (final SequenceIterator i = seq.unorderedIterator(); i.hasNext();) {
119-
next = i.nextItem();
120-
if (next instanceof NodeProxy)
121-
{((NodeProxy) next).addContextNode(contextId, (NodeProxy) next);}
108+
for (final SequenceIterator i = seq.unorderedIterator(); i.hasNext(); ) {
109+
final Item next = i.nextItem();
110+
if (next instanceof NodeProxy) {
111+
((NodeProxy) next).addContextNode(contextId, (NodeProxy) next);
112+
}
122113
}
123114
}
124115
}
125116

126-
public final static void clearContext(int contextId, Sequence seq) throws XPathException {
117+
public final static void clearContext(final int contextId, final Sequence seq) throws XPathException {
127118
if (seq != null && !(seq instanceof VirtualNodeSet)) {
128119
seq.clearContext(contextId);
129120
}
@@ -133,27 +124,28 @@ protected void registerUpdateListener(final Sequence sequence) {
133124
if (listener == null) {
134125
listener = new ExprUpdateListener(sequence);
135126
context.registerUpdateListener(listener);
136-
} else
137-
{listener.setSequence(sequence);}
127+
} else {
128+
listener.setSequence(sequence);
129+
}
138130
}
139131

140132
private class ExprUpdateListener implements UpdateListener {
141133
private Sequence sequence;
142134

143-
public ExprUpdateListener(Sequence sequence) {
135+
public ExprUpdateListener(final Sequence sequence) {
144136
this.sequence = sequence;
145137
}
146138

147-
public void setSequence(Sequence sequence) {
139+
public void setSequence(final Sequence sequence) {
148140
this.sequence = sequence;
149141
}
150142

151143
@Override
152-
public void documentUpdated(DocumentImpl document, int event) {
144+
public void documentUpdated(final DocumentImpl document, final int event) {
153145
}
154146

155147
@Override
156-
public void nodeMoved(NodeId oldNodeId, NodeHandle newNode) {
148+
public void nodeMoved(final NodeId oldNodeId, final NodeHandle newNode) {
157149
sequence.nodeMoved(oldNodeId, newNode);
158150
}
159151

@@ -179,11 +171,12 @@ public int returnsType() {
179171
/* RewritableExpression API */
180172

181173
@Override
182-
public void replace(Expression oldExpr, Expression newExpr) {
183-
if (inputSequence == oldExpr)
184-
{inputSequence = newExpr;}
185-
else if (returnExpr == oldExpr)
186-
{returnExpr = newExpr;}
174+
public void replace(final Expression oldExpr, final Expression newExpr) {
175+
if (inputSequence == oldExpr) {
176+
inputSequence = newExpr;
177+
} else if (returnExpr == oldExpr) {
178+
returnExpr = newExpr;
179+
}
187180
}
188181

189182
@Override
@@ -197,7 +190,7 @@ public Expression getFirst() {
197190
}
198191

199192
@Override
200-
public void remove(Expression oldExpr) throws XPathException {
193+
public void remove(final Expression oldExpr) throws XPathException {
201194
}
202195

203196
/* END RewritableExpression API */

0 commit comments

Comments
 (0)