mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-02-25 18:55:28 -06:00
fix errors found by errorprone
This commit is contained in:
@@ -75,13 +75,12 @@ public class DateRangeFunc implements LongFunction<DateRange> {
|
||||
this.upper = upper;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DateRange apply(long value) {
|
||||
Date lowerDate = new Date(lower.applyAsLong(value));
|
||||
DateRange.DateRangeBound lower = DateRange.DateRangeBound.lowerBound(lowerDate,precision);
|
||||
Date upperDate = new Date(upper.applyAsLong(value));
|
||||
DateRange.DateRangeBound upper = DateRange.DateRangeBound.upperBound(lowerDate,precision);
|
||||
DateRange.DateRangeBound upper = DateRange.DateRangeBound.upperBound(upperDate,precision);
|
||||
DateRange dateRange = new DateRange(lower, upper);
|
||||
return dateRange;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ public class AvailableCQLStatements {
|
||||
}
|
||||
|
||||
public List<CQLStatementDefParser> getMatching(String tagSpec) {
|
||||
|
||||
List<CQLStatementDefParser> defs = new ArrayList<>();
|
||||
TagFilter ts = new TagFilter(tagSpec);
|
||||
List<CQLStatementDefParser> CQLStatementDefParsers =
|
||||
availableDefs.stream()
|
||||
|
||||
@@ -320,7 +320,7 @@ public class CQLSessionCache implements Shutdownable {
|
||||
Cluster cl = builder.build();
|
||||
|
||||
// Apply default idempotence, if set
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").map(
|
||||
activityDef.getParams().getOptionalBoolean("defaultidempotence").ifPresent(
|
||||
b -> cl.getConfiguration().getQueryOptions().setDefaultIdempotence(b)
|
||||
);
|
||||
|
||||
|
||||
@@ -12,30 +12,18 @@ public class CQLStatementDefParser {
|
||||
private final static Logger logger = LogManager.getLogger(CQLStatementDefParser.class);
|
||||
// private final static Pattern templateToken = Pattern.compile("<<(\\w+(:(.+?))?)>>");
|
||||
private final static Pattern stmtToken = Pattern.compile("\\?(\\w+[-_\\d\\w]*)|\\{(\\w+[-_\\d\\w.]*)}");
|
||||
private final static String UNSET_VALUE = "UNSET-VALUE";
|
||||
private final String stmt;
|
||||
private final String name;
|
||||
|
||||
private CQLStatementDef deprecatedDef; // deprecated, to be removed
|
||||
|
||||
public void setBindings(Map<String, String> bindings) {
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
private Map<String, String> bindings;
|
||||
|
||||
public CQLStatementDef getDeprecatedDef() {
|
||||
return deprecatedDef;
|
||||
}
|
||||
|
||||
public void setDeprecatedDef(CQLStatementDef deprecatedDef) {
|
||||
this.deprecatedDef = deprecatedDef;
|
||||
}
|
||||
|
||||
public CQLStatementDefParser(String name, String stmt) {
|
||||
this.stmt = stmt;
|
||||
this.name = name;
|
||||
this.bindings = bindings;
|
||||
}
|
||||
|
||||
public Map<String,String> getBindings() {
|
||||
@@ -122,6 +110,7 @@ public class CQLStatementDefParser {
|
||||
this.missingGenerators = missingGenerators;
|
||||
this.missingAnchors = missingAnchors;
|
||||
this.statement = stmt;
|
||||
this.bindings = bindings;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public enum DiffType {
|
||||
/// the actual data.
|
||||
all(0x1|0x1<<1|0x1<<2);
|
||||
|
||||
public int bitmask;
|
||||
public final int bitmask;
|
||||
|
||||
DiffType(int bit) {
|
||||
this.bitmask = bit;
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.nio.file.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
public class ParserForCqlTest {
|
||||
|
||||
@@ -37,15 +38,14 @@ public class ParserForCqlTest {
|
||||
URL url = resources.nextElement();
|
||||
System.out.println("url=" + url.toExternalForm());
|
||||
Path path = Paths.get(url.toURI());
|
||||
Files.walk(path, FileVisitOption.FOLLOW_LINKS)
|
||||
.filter(p -> !Files.isDirectory(p, LinkOption.NOFOLLOW_LINKS))
|
||||
.forEach(subpaths::add);
|
||||
try (Stream<Path> fileStream = Files.walk(path, FileVisitOption.FOLLOW_LINKS)) {
|
||||
fileStream.filter(p -> !Files.isDirectory(p, LinkOption.NOFOLLOW_LINKS))
|
||||
.forEach(subpaths::add);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return subpaths;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user