Skip to content

Commit a53d8a7

Browse files
committed
PMD suppressions
1 parent a0f811d commit a53d8a7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/main/java/org/lmdbjava/bench/LevelDb.java

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public void teardown() throws IOException {
159159
super.teardown();
160160
}
161161

162+
@SuppressWarnings("PMD.CloseResource")
162163
void write(final int batchSize) throws IOException {
163164
final int rndByteMax = RND_MB.length - valSize;
164165
int rndByteOffset = 0;

src/main/java/org/lmdbjava/bench/LmdbLwjgl.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181
@Warmup(iterations = 3)
8282
@Measurement(iterations = 3)
8383
@BenchmarkMode(SampleTime)
84-
@SuppressWarnings({"checkstyle:javadoctype", "checkstyle:designforextension"})
84+
@SuppressWarnings({"checkstyle:javadoctype", "checkstyle:designforextension",
85+
"PMD.CloseResource"})
8586
public class LmdbLwjgl {
8687

8788
@Benchmark

src/main/java/org/lmdbjava/bench/RocksDb.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
public class RocksDb {
6262

6363
@Benchmark
64+
@SuppressWarnings("PMD.CloseResource")
6465
public void readCrc(final Reader r, final Blackhole bh) {
6566
r.crc.reset();
6667
final RocksIterator iterator = r.db.newIterator();
@@ -87,6 +88,7 @@ public void readKey(final Reader r, final Blackhole bh) throws
8788
}
8889

8990
@Benchmark
91+
@SuppressWarnings("PMD.CloseResource")
9092
public void readRev(final Reader r, final Blackhole bh) {
9193
final RocksIterator iterator = r.db.newIterator();
9294
iterator.seekToLast();
@@ -97,6 +99,7 @@ public void readRev(final Reader r, final Blackhole bh) {
9799
}
98100

99101
@Benchmark
102+
@SuppressWarnings("PMD.CloseResource")
100103
public void readSeq(final Reader r, final Blackhole bh) {
101104
final RocksIterator iterator = r.db.newIterator();
102105
iterator.seekToFirst();
@@ -107,6 +110,7 @@ public void readSeq(final Reader r, final Blackhole bh) {
107110
}
108111

109112
@Benchmark
113+
@SuppressWarnings("PMD.CloseResource")
110114
public void readXxh64(final Reader r, final Blackhole bh) {
111115
long result = 0;
112116
final RocksIterator iterator = r.db.newIterator();
@@ -141,6 +145,7 @@ public static class CommonRocksDb extends Common {
141145
MutableDirectBuffer wvb;
142146

143147
@Override
148+
@SuppressWarnings("PMD.CloseResource")
144149
public void setup(final BenchmarkParams b) throws IOException {
145150
super.setup(b);
146151
wkb = new UnsafeBuffer(new byte[keySize]);
@@ -165,7 +170,7 @@ public void teardown() throws IOException {
165170
super.teardown();
166171
}
167172

168-
@SuppressWarnings("PMD.CyclomaticComplexity")
173+
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.CloseResource"})
169174
void write(final int batchSize) throws IOException {
170175
final int rndByteMax = RND_MB.length - valSize;
171176
int rndByteOffset = 0;

0 commit comments

Comments
 (0)