Skip to content

Commit

Permalink
include trivial bits of h2database#3090
Browse files Browse the repository at this point in the history
  • Loading branch information
andreitokar committed Nov 25, 2021
1 parent 9ccde29 commit 3ada1aa
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion h2/src/main/org/h2/expression/analysis/WindowFrame.java
Expand Up @@ -27,7 +27,7 @@
*/
public final class WindowFrame {

private static abstract class Itr implements Iterator<Value[]> {
private abstract static class Itr implements Iterator<Value[]> {

final ArrayList<Value[]> orderedRows;

Expand Down
2 changes: 1 addition & 1 deletion h2/src/main/org/h2/store/fs/FileBaseDefault.java
Expand Up @@ -18,7 +18,7 @@ public abstract class FileBaseDefault extends FileBase {
private long position = 0;

@Override
public synchronized final long position() throws IOException {
public final synchronized long position() throws IOException {
return position;
}

Expand Down
2 changes: 1 addition & 1 deletion h2/src/main/org/h2/util/geometry/GeometryUtils.java
Expand Up @@ -13,7 +13,7 @@ public final class GeometryUtils {
/**
* Converter output target.
*/
public static abstract class Target {
public abstract static class Target {

public Target() {
}
Expand Down
2 changes: 1 addition & 1 deletion h2/src/tools/org/h2/build/doc/LinkChecker.java
Expand Up @@ -166,7 +166,7 @@ private void listBadLinks() throws Exception {
for (String error : errors) {
System.out.println(error);
}
if (errors.size() > 0) {
if (!errors.isEmpty()) {
throw new Exception("Problems where found by the Link Checker");
}
}
Expand Down
4 changes: 2 additions & 2 deletions h2/src/tools/org/h2/build/doc/XMLChecker.java
Expand Up @@ -94,7 +94,7 @@ private static void checkXML(String xml, boolean html) throws Exception {
if (event == XMLParser.END_DOCUMENT) {
break;
} else if (event == XMLParser.START_ELEMENT) {
if (stack.size() == 0) {
if (stack.isEmpty()) {
if (rootElement) {
throw new Exception("Second root element at " + parser.getRemaining());
}
Expand Down Expand Up @@ -146,7 +146,7 @@ private static void checkXML(String xml, boolean html) throws Exception {
+ parser.getRemaining());
}
}
if (stack.size() != 0) {
if (!stack.isEmpty()) {
throw new Exception("Unclosed root element");
}
}
Expand Down
6 changes: 3 additions & 3 deletions h2/src/tools/org/h2/dev/fs/ArchiveTool.java
Expand Up @@ -255,7 +255,7 @@ public int read() throws IOException {
fileIn.close();
fileIn = null;
}
if (files.size() == 0) {
if (files.isEmpty()) {
// EOF
return -1;
}
Expand Down Expand Up @@ -562,7 +562,7 @@ private static Iterator<Chunk> merge(final TreeSet<ChunkStream> segmentIn, final

@Override
public boolean hasNext() {
return segmentIn.size() > 0;
return !segmentIn.isEmpty();
}

@Override
Expand Down Expand Up @@ -948,7 +948,7 @@ public static Chunk read(DataInputStream in, boolean readKey) {
}
idList.add(x);
}
if (idList.size() == 0) {
if (idList.isEmpty()) {
// eof
in.close();
return null;
Expand Down
4 changes: 2 additions & 2 deletions h2/src/tools/org/h2/java/Expr.java
Expand Up @@ -80,7 +80,7 @@ public String asString() {
StringBuilder buff = new StringBuilder();
initMethod();
if (method.isIgnore) {
if (args.size() == 0) {
if (args.isEmpty()) {
// ignore
} else if (args.size() == 1) {
buff.append(args.get(0));
Expand Down Expand Up @@ -394,7 +394,7 @@ class NewExpr extends ExprBase {
public String asString() {
boolean refCount = type.refCount;
StringBuilder buff = new StringBuilder();
if (arrayInitExpr.size() > 0) {
if (!arrayInitExpr.isEmpty()) {
if (refCount) {
if (classObj.isPrimitive) {
buff.append("ptr< array< " + classObj + " > >");
Expand Down

0 comments on commit 3ada1aa

Please sign in to comment.