Skip to content

Commit ed7bf5d

Browse files
committed
Refactoring
1 parent f3984a2 commit ed7bf5d

File tree

65 files changed

+167
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+167
-40
lines changed

driver/src/main/java/org/neo4j/driver/TransactionWork.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
* @deprecated superseded by {@link TransactionCallback}.
2727
*/
2828
@Deprecated
29+
@SuppressWarnings("DeprecatedIsStillUsed")
2930
public interface TransactionWork<T> {
3031
/**
3132
* Executes all given operations against the same transaction.

driver/src/main/java/org/neo4j/driver/async/AsyncTransactionWork.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* @deprecated superseded by {@link AsyncTransactionCallback}.
2828
*/
2929
@Deprecated
30+
@SuppressWarnings("DeprecatedIsStillUsed")
3031
public interface AsyncTransactionWork<T> {
3132
/**
3233
* Executes all given operations against the same transaction.

driver/src/main/java/org/neo4j/driver/internal/cluster/RediscoveryImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ private CompletionStage<ClusterComposition> lookupOnRouter(
310310
});
311311
}
312312

313+
@SuppressWarnings("ThrowableNotThrown")
313314
private ClusterComposition handleRoutingProcedureError(
314315
Throwable error, RoutingTable routingTable, BoltServerAddress routerAddress, Throwable baseError) {
315316
if (mustAbortDiscovery(error)) {

driver/src/main/java/org/neo4j/driver/internal/handlers/RunResponseHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public void onSuccess(Map<String, Value> metadata) {
6161
}
6262

6363
@Override
64+
@SuppressWarnings("ThrowableNotThrown")
6465
public void onFailure(Throwable error) {
6566
if (tx != null) {
6667
tx.markTerminated(error);

driver/src/main/java/org/neo4j/driver/internal/handlers/TransactionPullResponseCompletionListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public TransactionPullResponseCompletionListener(UnmanagedTransaction tx) {
3535
public void afterSuccess(Map<String, Value> metadata) {}
3636

3737
@Override
38+
@SuppressWarnings("ThrowableNotThrown")
3839
public void afterFailure(Throwable error) {
3940
// always mark transaction as terminated because every error is "acknowledged" with a RESET message
4041
// so database forgets about the transaction after the first error

driver/src/main/java/org/neo4j/driver/internal/messaging/common/CommonValuePacker.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private void packLocalDateTime(LocalDateTime localDateTime) throws IOException {
173173
packer.pack(nano);
174174
}
175175

176+
@SuppressWarnings("DuplicatedCode")
176177
private void packZonedDateTimeUsingUtcBaseline(ZonedDateTime zonedDateTime) throws IOException {
177178
var instant = zonedDateTime.toInstant();
178179
var epochSecondLocal = instant.getEpochSecond();
@@ -196,6 +197,7 @@ private void packZonedDateTimeUsingUtcBaseline(ZonedDateTime zonedDateTime) thro
196197
}
197198
}
198199

200+
@SuppressWarnings("DuplicatedCode")
199201
private void packZonedDateTime(ZonedDateTime zonedDateTime) throws IOException {
200202
var epochSecondLocal = zonedDateTime.toLocalDateTime().toEpochSecond(UTC);
201203
var nano = zonedDateTime.getNano();

driver/src/main/java/org/neo4j/driver/internal/messaging/common/CommonValueUnpacker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ protected Value unpackRelationship() throws IOException {
277277
return new RelationshipValue(adapted);
278278
}
279279

280+
@SuppressWarnings("DuplicatedCode")
280281
protected InternalNode unpackNode() throws IOException {
281282
var urn = unpacker.unpackLong();
282283

@@ -295,7 +296,7 @@ protected InternalNode unpackNode() throws IOException {
295296
return new InternalNode(urn, String.valueOf(urn), labels, props);
296297
}
297298

298-
@SuppressWarnings("deprecation")
299+
@SuppressWarnings({"deprecation", "DuplicatedCode"})
299300
protected Value unpackPath() throws IOException {
300301
// List of unique nodes
301302
var uniqNodes = new Node[(int) unpacker.unpackListHeader()];

driver/src/main/java/org/neo4j/driver/internal/messaging/v4/MessageWriterV4.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public MessageWriterV4(PackOutput output) {
4848
super(new CommonValuePacker(output, false), buildEncoders());
4949
}
5050

51+
@SuppressWarnings("DuplicatedCode")
5152
private static Map<Byte, MessageEncoder> buildEncoders() {
5253
Map<Byte, MessageEncoder> result = Iterables.newHashMapWithSize(9);
5354
result.put(HelloMessage.SIGNATURE, new HelloMessageEncoder());

driver/src/main/java/org/neo4j/driver/internal/messaging/v43/MessageWriterV43.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public MessageWriterV43(PackOutput output, boolean dateTimeUtcEnabled) {
5656
super(new CommonValuePacker(output, dateTimeUtcEnabled), buildEncoders());
5757
}
5858

59+
@SuppressWarnings("DuplicatedCode")
5960
private static Map<Byte, MessageEncoder> buildEncoders() {
6061
Map<Byte, MessageEncoder> result = Iterables.newHashMapWithSize(9);
6162
result.put(HelloMessage.SIGNATURE, new HelloMessageEncoder());

driver/src/main/java/org/neo4j/driver/internal/messaging/v44/MessageWriterV44.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public MessageWriterV44(PackOutput output, boolean dateTimeUtcEnabled) {
5353
super(new CommonValuePacker(output, dateTimeUtcEnabled), buildEncoders());
5454
}
5555

56+
@SuppressWarnings("DuplicatedCode")
5657
private static Map<Byte, MessageEncoder> buildEncoders() {
5758
Map<Byte, MessageEncoder> result = Iterables.newHashMapWithSize(9);
5859
result.put(HelloMessage.SIGNATURE, new HelloMessageEncoder());

0 commit comments

Comments
 (0)