Skip to content

Commit 567dc19

Browse files
committed
Release 8.1.2, Remove Checker Framework
1 parent d522a62 commit 567dc19

22 files changed

Lines changed: 21 additions & 160 deletions

PgBulkInsert/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>de.bytefish</groupId>
88
<artifactId>pgbulkinsert</artifactId>
9-
<version>8.1.1</version>
9+
<version>8.1.2</version>
1010
<name>pgbulkinsert</name>
1111
<description>PgBulkInsert is a Java library for Bulk Inserts with PostgreSQL.</description>
1212
<url>http://www.github.com/bytefish/PgBulkInsert</url>

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/bulkprocessor/BulkProcessor.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package de.bytefish.pgbulkinsert.bulkprocessor;
44

55
import de.bytefish.pgbulkinsert.bulkprocessor.handler.IBulkWriteHandler;
6-
import org.checkerframework.checker.nullness.qual.Nullable;
76

87
import java.time.Duration;
98
import java.util.ArrayList;
@@ -16,10 +15,8 @@
1615

1716
public class BulkProcessor<TEntity> implements AutoCloseable {
1817

19-
@Nullable
20-
private final ScheduledThreadPoolExecutor scheduler;
18+
private final ScheduledThreadPoolExecutor scheduler;
2119

22-
@Nullable
2320
private final ScheduledFuture<?> scheduledFuture;
2421

2522
private volatile boolean closed = false;
@@ -34,7 +31,7 @@ public BulkProcessor(IBulkWriteHandler<TEntity> handler, int bulkSize) {
3431
this(handler, bulkSize, null);
3532
}
3633

37-
public BulkProcessor(IBulkWriteHandler<TEntity> handler, int bulkSize, @Nullable Duration flushInterval) {
34+
public BulkProcessor(IBulkWriteHandler<TEntity> handler, int bulkSize, Duration flushInterval) {
3835

3936
this.handler = handler;
4037
this.bulkSize = bulkSize;

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import de.bytefish.pgbulkinsert.exceptions.BinaryWriteFailedException;
66
import de.bytefish.pgbulkinsert.pgsql.handlers.IValueHandler;
7-
import org.checkerframework.checker.nullness.qual.Nullable;
87

98
import java.io.BufferedOutputStream;
109
import java.io.DataOutputStream;
@@ -37,7 +36,7 @@ public void startRow(int numColumns) {
3736
}
3837
}
3938

40-
public <TTargetType> void write(final IValueHandler<TTargetType> handler, @Nullable final TTargetType value) {
39+
public <TTargetType> void write(final IValueHandler<TTargetType> handler, final TTargetType value) {
4140
handler.handle(buffer, value);
4241
}
4342

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/handlers/BaseValueHandler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33
package de.bytefish.pgbulkinsert.pgsql.handlers;
44

55
import de.bytefish.pgbulkinsert.exceptions.BinaryWriteFailedException;
6-
import org.checkerframework.checker.nullness.qual.Nullable;
76

87
import java.io.DataOutputStream;
98

109
public abstract class BaseValueHandler<T> implements IValueHandler<T> {
1110

1211
@Override
13-
public void handle(DataOutputStream buffer, @Nullable final T value) {
12+
public void handle(DataOutputStream buffer, final T value) {
1413
try {
1514
if (value == null) {
1615
buffer.writeInt(-1);

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/handlers/IValueHandler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
package de.bytefish.pgbulkinsert.pgsql.handlers;
44

5-
import org.checkerframework.checker.nullness.qual.Nullable;
6-
75
import java.io.DataOutputStream;
86

97
public interface IValueHandler<TTargetType> extends ValueHandler {
108

11-
void handle(DataOutputStream buffer, @Nullable final TTargetType value);
9+
void handle(DataOutputStream buffer, final TTargetType value);
1210

1311
int getLength(final TTargetType value);
1412
}

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/model/range/Range.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,32 @@
22

33
package de.bytefish.pgbulkinsert.pgsql.model.range;
44

5-
import org.checkerframework.checker.nullness.qual.Nullable;
6-
75
import java.util.Objects;
86

97
// https://github.com/npgsql/npgsql/blob/d4132d0d546594629bcef658bcb1418b4a8624cc/src/Npgsql/NpgsqlTypes/NpgsqlRange.cs
108
public class Range<TElementType> {
119

1210
private int flags;
1311

14-
@Nullable
1512
private TElementType lowerBound;
1613

17-
@Nullable
1814
private TElementType upperBound;
1915

20-
public Range(@Nullable TElementType lowerBound, @Nullable TElementType upperBound) {
16+
public Range(TElementType lowerBound, TElementType upperBound) {
2117
this(lowerBound, true, false, upperBound, true, false);
2218
}
2319

24-
public Range(@Nullable TElementType lowerBound, boolean lowerBoundIsInclusive, @Nullable TElementType upperBound, boolean upperBoundIsInclusive) {
20+
public Range(TElementType lowerBound, boolean lowerBoundIsInclusive, TElementType upperBound, boolean upperBoundIsInclusive) {
2521
this(lowerBound, lowerBoundIsInclusive, false, upperBound, upperBoundIsInclusive, false);
2622
}
2723

28-
public Range(@Nullable TElementType lowerBound, boolean lowerBoundIsInclusive, boolean lowerBoundInfinite,
29-
@Nullable TElementType upperBound, boolean upperBoundIsInclusive, boolean upperBoundInfinite) {
24+
public Range(TElementType lowerBound, boolean lowerBoundIsInclusive, boolean lowerBoundInfinite,
25+
TElementType upperBound, boolean upperBoundIsInclusive, boolean upperBoundInfinite) {
3026
this(lowerBound, upperBound, evaluateBoundaryFlags(lowerBoundIsInclusive, upperBoundIsInclusive, lowerBoundInfinite, upperBoundInfinite));
3127
}
3228

3329

34-
private Range(@Nullable TElementType lowerBound, @Nullable TElementType upperBound, int flags) {
30+
private Range(TElementType lowerBound, TElementType upperBound, int flags) {
3531
this.lowerBound = (flags & RangeFlags.LowerBoundInfinite) != 0 ? null : lowerBound;
3632
this.upperBound = (flags & RangeFlags.UpperBoundInfinite) != 0 ? null : upperBound;
3733
this.flags = flags;
@@ -52,7 +48,7 @@ private Range(@Nullable TElementType lowerBound, @Nullable TElementType upperBou
5248
}
5349
}
5450

55-
private boolean isEmptyRange(@Nullable TElementType lowerBound, @Nullable TElementType upperBound, int flags) {
51+
private boolean isEmptyRange(TElementType lowerBound, TElementType upperBound, int flags) {
5652
// ---------------------------------------------------------------------------------
5753
// We only want to check for those conditions that are unambiguously erroneous:
5854
// 1. The bounds must not be default values (including null).
@@ -121,7 +117,6 @@ public boolean isUpperBoundInfinite() {
121117
return (flags & RangeFlags.UpperBoundInfinite) != 0;
122118
}
123119

124-
@Nullable
125120
public TElementType getLowerBound() {
126121
return lowerBound;
127122
}
@@ -130,7 +125,6 @@ public void setLowerBound(TElementType lowerBound) {
130125
this.lowerBound = lowerBound;
131126
}
132127

133-
@Nullable
134128
public TElementType getUpperBound() {
135129
return upperBound;
136130
}

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/row/SimpleRowWriter.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import de.bytefish.pgbulkinsert.pgsql.handlers.ValueHandlerProvider;
66
import de.bytefish.pgbulkinsert.util.PostgreSqlUtils;
77
import de.bytefish.pgbulkinsert.util.StringUtils;
8-
import org.checkerframework.checker.nullness.qual.Nullable;
98
import org.postgresql.PGConnection;
109
import org.postgresql.copy.PGCopyOutputStream;
1110

@@ -21,7 +20,6 @@ public class SimpleRowWriter implements AutoCloseable {
2120

2221
public static class Table {
2322

24-
@Nullable
2523
private final String schema;
2624
private final String table;
2725
private final String[] columns;
@@ -30,13 +28,12 @@ public Table(String table, String... columns) {
3028
this(null, table, columns);
3129
}
3230

33-
public Table(@Nullable String schema, String table, String... columns) {
31+
public Table(String schema, String table, String... columns) {
3432
this.schema = schema;
3533
this.table = table;
3634
this.columns = columns;
3735
}
3836

39-
@Nullable
4037
public String getSchema() {
4138
return schema;
4239
}

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/util/ExceptionUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
package de.bytefish.pgbulkinsert.util;
44

5-
import org.checkerframework.checker.nullness.qual.Nullable;
65

76
public class ExceptionUtils {
87

98
private ExceptionUtils() {}
109

11-
@Nullable
12-
public static Throwable getRootCause(@Nullable Throwable t) {
10+
public static Throwable getRootCause(Throwable t) {
1311
if (t == null) {
1412
return null;
1513
}

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/util/PostgreSqlUtils.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
package de.bytefish.pgbulkinsert.util;
44

55
import de.bytefish.pgbulkinsert.exceptions.PgConnectionException;
6-
import org.checkerframework.checker.nullness.qual.Nullable;
76
import org.postgresql.PGConnection;
87
import org.postgresql.core.Utils;
98

@@ -54,8 +53,7 @@ public static String quoteIdentifier(String identifier) {
5453
}
5554
}
5655

57-
@SuppressWarnings("NullAway")
58-
public static String getFullyQualifiedTableName(@Nullable String schemaName, String tableName, boolean usePostgresQuoting) {
56+
public static String getFullyQualifiedTableName(String schemaName, String tableName, boolean usePostgresQuoting) {
5957
if (usePostgresQuoting) {
6058
return StringUtils.isNullOrWhiteSpace(schemaName) ? quoteIdentifier(tableName)
6159
: String.format("%s.%s", quoteIdentifier(schemaName), quoteIdentifier(tableName));

PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/util/StringUtils.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
package de.bytefish.pgbulkinsert.util;
44

5-
import org.checkerframework.checker.nullness.qual.Nullable;
6-
75
import java.nio.charset.Charset;
86
import java.nio.charset.StandardCharsets;
97

@@ -13,18 +11,17 @@ public class StringUtils {
1311

1412
private StringUtils() {}
1513

16-
public static boolean isNullOrWhiteSpace(@Nullable String input) {
14+
public static boolean isNullOrWhiteSpace(String input) {
1715
return input == null || input.trim().length() == 0;
1816
}
1917

2018
public static byte[] getUtf8Bytes(String value) {
2119
return value.getBytes(utf8Charset);
2220
}
2321

24-
@Nullable
25-
public static String removeNullCharacter(@Nullable String data) {
22+
public static String removeNullCharacter(String data) {
2623
if (data == null) {
27-
return data;
24+
return null;
2825
}
2926

3027
return data.replaceAll("\u0000", "");

0 commit comments

Comments
 (0)