Skip to content

Commit 1321dba

Browse files
[MIN] Cleanups
1 parent e447a3e commit 1321dba

40 files changed

+81
-96
lines changed

basex-api/basex-api.iml

+17-17
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020
<orderEntry type="library" scope="RUNTIME" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
2121
<orderEntry type="library" scope="RUNTIME" name="Maven: xpp3:xpp3_min:1.1.4c" level="project" />
2222
<orderEntry type="library" name="Maven: org.xmldb:xmldb-api:1.0" level="project" />
23-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-server:9.4.48.v20220622" level="project" />
23+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-server:9.4.50.v20221201" level="project" />
2424
<orderEntry type="library" scope="PROVIDED" name="Maven: javax.servlet:javax.servlet-api:3.1.0" level="project" />
25-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-http:9.4.48.v20220622" level="project" />
26-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-io:9.4.48.v20220622" level="project" />
27-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-servlet:9.4.48.v20220622" level="project" />
28-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-security:9.4.48.v20220622" level="project" />
29-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-util-ajax:9.4.48.v20220622" level="project" />
30-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-servlets:9.4.48.v20220622" level="project" />
31-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-continuation:9.4.48.v20220622" level="project" />
32-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-util:9.4.48.v20220622" level="project" />
33-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-webapp:9.4.48.v20220622" level="project" />
34-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-xml:9.4.48.v20220622" level="project" />
35-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-server:9.4.48.v20220622" level="project" />
36-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-common:9.4.48.v20220622" level="project" />
37-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-api:9.4.48.v20220622" level="project" />
38-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-client:9.4.48.v20220622" level="project" />
39-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-client:9.4.48.v20220622" level="project" />
40-
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-servlet:9.4.48.v20220622" level="project" />
25+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-http:9.4.50.v20221201" level="project" />
26+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-io:9.4.50.v20221201" level="project" />
27+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-servlet:9.4.50.v20221201" level="project" />
28+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-security:9.4.50.v20221201" level="project" />
29+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-util-ajax:9.4.50.v20221201" level="project" />
30+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-servlets:9.4.50.v20221201" level="project" />
31+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-continuation:9.4.50.v20221201" level="project" />
32+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-util:9.4.50.v20221201" level="project" />
33+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-webapp:9.4.50.v20221201" level="project" />
34+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-xml:9.4.50.v20221201" level="project" />
35+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-server:9.4.50.v20221201" level="project" />
36+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-common:9.4.50.v20221201" level="project" />
37+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-api:9.4.50.v20221201" level="project" />
38+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-client:9.4.50.v20221201" level="project" />
39+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty:jetty-client:9.4.50.v20221201" level="project" />
40+
<orderEntry type="library" scope="PROVIDED" name="Maven: org.eclipse.jetty.websocket:websocket-servlet:9.4.50.v20221201" level="project" />
4141
<orderEntry type="library" name="Maven: com.ettrema:milton-api:1.8.1.4" level="project" />
4242
<orderEntry type="library" name="Maven: org.jdom:jdom:1.1" level="project" />
4343
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.4" level="project" />

basex-api/src/main/java/org/basex/query/func/sessions/SessionsIds.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
public final class SessionsIds extends SessionsFn {
1515
@Override
16-
public Value value(final QueryContext qc) throws QueryException {
16+
public Value value(final QueryContext qc) {
1717
return StrSeq.get(SessionListener.ids());
1818
}
1919
}

basex-core/src/main/java/org/basex/core/Sandbox.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ protected static void compare(final String query, final String result, final Obj
116116
final String res = normNL(result), exp = expected.toString();
117117
if(OUTPUT) {
118118
Util.errln(query.strip());
119-
Util.errln(res.replaceAll("\n", ","));
119+
Util.errln(res.replace('\n', ','));
120120
}
121121
if(!res.equals(exp)) throw Util.notExpected("\n" + query +
122122
"\nEXPECTED: [" + exp + "]\nRETURNED: [" + res + "]\n" + serialize(plan));

basex-core/src/main/java/org/basex/core/cmd/Delete.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public Delete(final String target) {
2727
@Override
2828
protected boolean run() {
2929
final Data data = context.data();
30-
String path = MetaData.normPath(args[0]);
30+
final String path = MetaData.normPath(args[0]);
3131
if(path == null) return error(PATH_INVALID_X, args[0]);
3232

3333
return update(data, () -> {

basex-core/src/main/java/org/basex/data/Data.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public final int dist(final int pre, final int kind) {
339339
case ATTR:
340340
int d = table.read1(pre, 0) >> 3 & IO.MAXATTS;
341341
// skip additional attributes if value is larger than maximum range
342-
if(d >= IO.MAXATTS) while(d < pre && kind(pre - d) == ATTR) d++;
342+
if(d == IO.MAXATTS) while(d < pre && kind(pre - d) == ATTR) d++;
343343
return d;
344344
default:
345345
return pre + 1;
@@ -365,7 +365,7 @@ public final int size(final int pre, final int kind) {
365365
public final int attSize(final int pre, final int kind) {
366366
int s = kind == ELEM ? table.read1(pre, 0) >> 3 & IO.MAXATTS : 1;
367367
// skip additional attributes if value is larger than maximum range
368-
if(s >= IO.MAXATTS) while(s < meta.size - pre && kind(pre + s) == ATTR) s++;
368+
if(s == IO.MAXATTS) while(s < meta.size - pre && kind(pre + s) == ATTR) s++;
369369
return s;
370370
}
371371

basex-core/src/main/java/org/basex/index/value/UpdatableDiskValues.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private void size(final int sz) {
239239
*/
240240
private static int[] prepare(final IntList ids, final IntList pos) {
241241
final int is = ids.size();
242-
final IntList result = new IntList(pos == null ? is : is << 1);
242+
final IntList result = new IntList(pos == null ? is : (long) is << 1);
243243
int[] order = null;
244244
if(pos == null) {
245245
// no token index: simple sort

basex-core/src/main/java/org/basex/io/random/TableMemAccess.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,28 @@ public long read5(final int pre, final int offset) {
6969
@Override
7070
public void write1(final int pre, final int offset, final int value) {
7171
final TableMemBlock block = block(pre);
72-
final long d = (offset < 8 ? 7 : 15) - offset << 3;
72+
final long d = (long) (offset < 8 ? 7 : 15) - offset << 3;
7373
block.value(pre, offset, block.value(pre, offset) & ~(0xFFL << d) | (long) value << d);
7474
}
7575

7676
@Override
7777
public void write2(final int pre, final int offset, final int value) {
7878
final TableMemBlock block = block(pre);
79-
final long d = (offset < 8 ? 6 : 14) - offset << 3;
79+
final long d = (long) (offset < 8 ? 6 : 14) - offset << 3;
8080
block.value(pre, offset, block.value(pre, offset) & ~(0xFFFFL << d) | (long) value << d);
8181
}
8282

8383
@Override
8484
public void write4(final int pre, final int offset, final int value) {
8585
final TableMemBlock block = block(pre);
86-
final long d = (offset < 8 ? 4 : 12) - offset << 3;
86+
final long d = (long) (offset < 8 ? 4 : 12) - offset << 3;
8787
block.value(pre, offset, block.value(pre, offset) & ~(0xFFFFFFFFL << d) | (long) value << d);
8888
}
8989

9090
@Override
9191
public void write5(final int pre, final int offset, final long value) {
9292
final TableMemBlock block = block(pre);
93-
final long d = (offset < 8 ? 3 : 11) - offset << 3;
93+
final long d = (long) (offset < 8 ? 3 : 11) - offset << 3;
9494
block.value(pre, offset, block.value(pre, offset) & ~(0xFFFFFFFFFFL << d) | value << d);
9595
}
9696

basex-core/src/main/java/org/basex/io/random/TableMemBlock.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ ArrayList<TableMemBlock> insert(final int pre, final int count, final int nextPr
114114

115115
// check if entries can be inserted into existing block
116116
if(count <= remaining) {
117-
resize((last + copy) << 1);
117+
resize(last + copy << 1);
118118
System.arraycopy(data, first << 1, data, last << 1, copy << 1);
119119
return null;
120120
}

basex-core/src/main/java/org/basex/io/serial/MarkupSerializer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ protected MarkupSerializer(final OutputStream os, final SerializerOptions sopts,
110110
@Override
111111
public void serialize(final Item item) throws IOException {
112112
if(item instanceof XQArray) {
113-
for(Item it : flatten((XQArray) item)) super.serialize(it);
113+
for(final Item it : flatten((XQArray) item)) super.serialize(it);
114114
} else {
115115
super.serialize(item);
116116
}

basex-core/src/main/java/org/basex/io/serial/StandardSerializer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ protected final boolean characterMap(final int cp) throws IOException {
169169
static ItemList flatten(final XQArray array) {
170170
final ItemList list = new ItemList();
171171
for(final Value value : array.members()) {
172-
for(Item item : value) {
172+
for(final Item item : value) {
173173
if(item instanceof XQArray) {
174174
list.add(flatten((XQArray) item));
175175
} else {

basex-core/src/main/java/org/basex/io/serial/TextSerializer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class TextSerializer extends StandardSerializer {
2626
@Override
2727
public void serialize(final Item item) throws IOException {
2828
if(item instanceof XQArray) {
29-
for(Item it : flatten((XQArray) item)) super.serialize(it);
29+
for(final Item it : flatten((XQArray) item)) super.serialize(it);
3030
} else {
3131
super.serialize(item);
3232
}

basex-core/src/main/java/org/basex/query/QueryContext.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public void addLocks() {
396396
if(local && contextScope != null) {
397397
// check if scope may still be overwritten by dynamic context
398398
if(!finalContext) list.add(Locking.CONTEXT);
399-
local &= contextScope.databases(new LockVisitor(list, true));
399+
local = contextScope.databases(new LockVisitor(list, true));
400400
}
401401
if(local) {
402402
list.add(locks);

basex-core/src/main/java/org/basex/query/QueryParser.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -3144,7 +3144,7 @@ private SeqType itemType() throws QueryException {
31443144

31453145
// parse type
31463146
SeqType st = null;
3147-
Type type = null;
3147+
Type type;
31483148
if(wsConsume(PAREN1)) {
31493149
// function type
31503150
type = FuncType.find(name);
@@ -4134,7 +4134,7 @@ private boolean skipWs() throws QueryException {
41344134
if(ch == '(' && next() == ':') {
41354135
comment();
41364136
} else {
4137-
if(ch <= 0 || ch > ' ') return i != pos;
4137+
if(ch == 0 || ch > ' ') return i != pos;
41384138
++pos;
41394139
}
41404140
}
@@ -4190,7 +4190,7 @@ private boolean consumeWS() {
41904190
final int i = pos;
41914191
while(more()) {
41924192
final char ch = curr();
4193-
if(ch <= 0 || ch > ' ') return i != pos;
4193+
if(ch == 0 || ch > ' ') return i != pos;
41944194
++pos;
41954195
}
41964196
return true;

basex-core/src/main/java/org/basex/query/expr/CmpR.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,10 @@ public boolean indexAccessible(final IndexInfo ii) throws QueryException {
218218
// skip if numbers are negative, doubles, or of different string length
219219
final int mnl = min >= 0 && (long) min == min ? Token.token(min).length : -1;
220220
final int mxl = max >= 0 && (long) max == max ? Token.token(max).length : -1;
221-
if(mnl != mxl || mnl == -1) return false;
221+
if(mnl == -1 || mnl != mxl) return false;
222222

223223
// don't use index if min/max values are infinite
224-
if(min == NEGATIVE_INFINITY && max == POSITIVE_INFINITY ||
225-
Token.token((int) nr.min).length != Token.token((int) nr.max).length) return false;
224+
if(Token.token((int) nr.min).length != Token.token((int) nr.max).length) return false;
226225

227226
final TokenBuilder tb = new TokenBuilder();
228227
tb.add('[').add(min).add(',').add(max).add(']');

basex-core/src/main/java/org/basex/query/expr/Otherwise.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public Expr compile(final CompileContext cc) throws QueryException {
7575
}
7676

7777
@Override
78-
public Expr optimize(final CompileContext cc) throws QueryException {
78+
public Expr optimize(final CompileContext cc) {
7979
flatten(cc);
8080
removeEmpty(cc);
8181

basex-core/src/main/java/org/basex/query/expr/Range.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public Expr optimizePos(final OpV op, final CompileContext cc) throws QueryExcep
8888
};
8989
if(!type.test(exprs[0]) || !type.test(exprs[1])) return this;
9090

91-
Expr[] minMax = exprs.clone();
91+
final Expr[] minMax = exprs.clone();
9292
final double mn = pos(minMax[0]), mx = pos(minMax[1]);
9393
if(mx < mn) return Bln.FALSE;
9494

basex-core/src/main/java/org/basex/query/expr/Typeswitch.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public Expr optimize(final CompileContext cc) throws QueryException {
9191
boolean branch = false;
9292
for(int h = 0; !branch && h < g; h++) {
9393
for(final SeqType st : groups[h].seqTypes) {
94-
if(((Checks<SeqType>) match -> st.instanceOf(match)).any(matching)) {
94+
if(((Checks<SeqType>) st::instanceOf).any(matching)) {
9595
branch = true;
9696
break;
9797
}

basex-core/src/main/java/org/basex/query/expr/path/Path.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ final ArrayList<PathNode> pathNodes(final ArrayList<PathNode> nodes, final boole
373373
if(ex instanceof AxisPath) {
374374
final AxisPath path = (AxisPath) ex;
375375
if(path.root == null) {
376-
final ArrayList<PathNode> tmp = path.pathNodes(pn, stats);
376+
final ArrayList<PathNode> tmp = path.pathNodes(pn, false);
377377
if(tmp != null && tmp.isEmpty()) return tmp;
378378
}
379379
}

basex-core/src/main/java/org/basex/query/func/StandardFunc.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,8 @@ protected Expr embed(final CompileContext cc, final boolean skip) throws QueryEx
281281
protected long countInputDiff(final int i) {
282282
if(exprs.length > i) {
283283
final Expr input = exprs[0], end = exprs[i];
284-
final Predicate<Expr> countInput = e -> {
285-
return Function.COUNT.is(e) && e.arg(0).equals(input) && !e.has(Flag.NDT);
286-
};
284+
final Predicate<Expr> countInput = e ->
285+
Function.COUNT.is(e) && e.arg(0).equals(input) && !e.has(Flag.NDT);
287286
// function(E, count(E)) -> 0
288287
if(countInput.test(end)) return 0;
289288
// function(E, count(E) - 1) -> -1
@@ -320,7 +319,7 @@ protected final ADate toDate(final Item item, final AtomType type, final QueryCo
320319
protected final DBNode toDBNode(final Item item, final boolean mainmem) throws QueryException {
321320
if(checkNoEmpty(item, NodeType.NODE) instanceof DBNode &&
322321
(mainmem || !item.data().inMemory())) return (DBNode) item;
323-
throw DB_NODE_X.get(info, item);
322+
throw DB_NODE_X.get(info, item);
324323
}
325324

326325
/**

basex-core/src/main/java/org/basex/query/func/crypto/DigitalSignature.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,10 @@ Item generate(final ANode node, final byte[] can, final byte[] dig, final byte[]
263263
/**
264264
* Validates a signature.
265265
* @param node input node
266-
*
267-
* @return true if signature valid
266+
* @return boolean result of validation
268267
* @throws QueryException query exception
269268
*/
270-
Item validateSignature(final ANode node) throws QueryException {
269+
Bln validateSignature(final ANode node) throws QueryException {
271270
try {
272271
final Document doc = toDOMNode(node);
273272
final DOMValidateContext valContext = new DOMValidateContext(new MyKeySelector(), doc);

basex-core/src/main/java/org/basex/query/func/fn/FnAll.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final Bln item(final QueryContext qc, final InputInfo ii) throws QueryExc
2828
final boolean some = some();
2929
for(Item item; (item = input.next()) != null;) {
3030
final Item it = predicate != null ? predicate.invoke(qc, info, item).item(qc, info) : item;
31-
if(toBoolean(it) ^ !some) return Bln.get(some);
31+
if(toBoolean(it) == some) return Bln.get(some);
3232
}
3333
return Bln.get(!some);
3434
}

basex-core/src/main/java/org/basex/query/func/fn/FnContainsSequence.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ public final Item item(final QueryContext qc, final InputInfo ii) throws QueryEx
2424
final FItem compare = toFunction(exprs[2], 2, qc);
2525
cmp = (item1, item2) -> toBoolean(compare.invoke(qc, info, item1, item2).item(qc, info));
2626
} else {
27-
final DeepEqual de = new DeepEqual(info).collation(sc.collation);
28-
cmp = (item1, item2) -> de.equal(item1, item2);
27+
cmp = new DeepEqual(info).collation(sc.collation)::equal;
2928
}
3029
return Bln.get(compare(input, subsequence, cmp));
3130
}

basex-core/src/main/java/org/basex/query/func/fn/FnLast.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public boolean accept(final ASTVisitor visitor) {
2727
}
2828

2929
@Override
30-
protected Expr opt(final CompileContext cc) throws QueryException {
30+
protected Expr opt(final CompileContext cc) {
3131
final long size = cc.qc.focus.size;
3232
return size > 1 ? Int.get(size) : this;
3333
}

basex-core/src/main/java/org/basex/query/func/fn/FnPosition.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public Expr simplifyFor(final Simplify mode, final CompileContext cc) throws Que
3535
}
3636

3737
@Override
38-
public Expr optimizePos(final OpV op, final CompileContext cc) throws QueryException {
38+
public Expr optimizePos(final OpV op, final CompileContext cc) {
3939
return Bln.TRUE;
4040
}
4141
}

basex-core/src/main/java/org/basex/query/func/fn/FnResolveUri.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public final class FnResolveUri extends StandardFunc {
2020
@Override
2121
public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
2222
final byte[] relative = toTokenOrNull(exprs[0], qc);
23-
final byte[] base = exprs.length > 1 ? toTokenOrNull(exprs[1], qc) : null;;
23+
final byte[] base = exprs.length > 1 ? toTokenOrNull(exprs[1], qc) : null;
2424
if(relative == null) return Empty.VALUE;
2525

2626
// check relative uri

basex-core/src/main/java/org/basex/query/up/expr/TransformWith.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public Value value(final QueryContext qc) throws QueryException {
8888
public boolean has(final Flag... flags) {
8989
// Context dependency, positional access: only check first expression.
9090
// Example: . update { delete node a }
91-
return Flag.CNS.in(flags) || Flag.CNS.in(flags) ||
91+
return Flag.CNS.in(flags) ||
9292
Flag.CTX.in(flags) && result().has(Flag.CTX) ||
9393
Flag.POS.in(flags) && result().has(Flag.POS) ||
9494
super.has(Flag.UPD.remove(Flag.POS.remove(Flag.CTX.remove(flags))));

basex-core/src/main/java/org/basex/query/util/format/FormatterFR.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private static void word(final TokenBuilder tb, final long n, final byte[] ordin
155155
tb.add(WORDS1000000[w]);
156156
final long r = n % f;
157157
if(ordinal != null && r == 0) tb.add(ORDINAL).add(ordinal);
158-
else if(i > 1 && (ordinal == null || r == 0)) tb.add("s");
158+
else if(i > 1 && ordinal == null) tb.add("s");
159159
if(r != 0) {
160160
tb.add(' ');
161161
word(tb, r, ordinal, last);

basex-core/src/main/java/org/basex/query/util/regex/parse/Token.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ public String toString() {
118118
* @return token
119119
*/
120120
private static Token newToken(final int k, final String img) {
121-
switch(k) {
122-
default : return new Token(k, img);
123-
}
121+
return new Token(k, img);
124122
}
125123

126124
/**

basex-core/src/main/java/org/basex/query/value/item/ANum.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public final Expr simplifyFor(final Simplify mode, final CompileContext cc)
130130
}
131131

132132
@Override
133-
public final Expr optimizePos(final OpV op, final CompileContext cc) throws QueryException {
133+
public final Expr optimizePos(final OpV op, final CompileContext cc) {
134134
final double d = dbl();
135135
final long l = (long) d;
136136
final boolean fractional = d != l;

basex-core/src/main/java/org/basex/query/value/item/FuncItem.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final class FuncItem extends FItem implements Scope {
4242
private final InputInfo info;
4343

4444
/** Query focus. */
45-
private QueryFocus focus;
45+
private final QueryFocus focus;
4646
/** Indicates if the query focus is accessed or modified. */
4747
private Boolean fcs;
4848

basex-core/src/main/java/org/basex/query/value/seq/Empty.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public SeqType seqType() {
9999
}
100100

101101
@Override
102-
public Expr optimizePos(final OpV op, final CompileContext cc) throws QueryException {
102+
public Expr optimizePos(final OpV op, final CompileContext cc) {
103103
return Bln.FALSE;
104104
}
105105

basex-core/src/main/java/org/basex/query/value/seq/RangeSeq.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public boolean materialized(final Predicate<Data> test, final InputInfo ii) {
142142
}
143143

144144
@Override
145-
public Expr optimizePos(final OpV op, final CompileContext cc) throws QueryException {
145+
public Expr optimizePos(final OpV op, final CompileContext cc) {
146146
final long[] range = range(false);
147147
final long min = range[0], max = range[1];
148148
range[0] = Math.max(range[0], 1);

0 commit comments

Comments
 (0)