Skip to content

Enable compilation failures on warnings for backend #1279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion testkit-backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs combine.self="override"/>
<compilerArgs combine.self="override">
<arg>-Xlint:all,-processing</arg>
<arg>-Werror</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
*/
package neo4j.org.testkit.backend;

import java.io.Serial;

public class CustomDriverError extends RuntimeException {
@Serial
private static final long serialVersionUID = 2979071989786663535L;

public CustomDriverError(Throwable cause) {
super(cause);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
*/
package neo4j.org.testkit.backend;

public class FrontendError extends RuntimeException {}
import java.io.Serial;

public class FrontendError extends RuntimeException {
@Serial
private static final long serialVersionUID = -8369933385092563391L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.neo4j.driver.Record;
import org.neo4j.driver.reactive.RxResult;

@SuppressWarnings("deprecation")
public class RxResultHolder extends AbstractResultHolder<RxSessionHolder, RxTransactionHolder, RxResult> {
@Setter
private RxBufferedSubscriber<Record> subscriber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.neo4j.driver.SessionConfig;
import org.neo4j.driver.reactive.RxSession;

@SuppressWarnings("deprecation")
public class RxSessionHolder extends AbstractSessionHolder<RxSession> {
public RxSessionHolder(DriverHolder driverHolder, RxSession session, SessionConfig config) {
super(driverHolder, session, config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.neo4j.driver.reactive.RxTransaction;

@SuppressWarnings("deprecation")
public class RxTransactionHolder extends AbstractTransactionHolder<RxSessionHolder, RxTransaction> {
public RxTransactionHolder(RxSessionHolder sessionHolder, RxTransaction transaction) {
super(sessionHolder, transaction);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package neo4j.org.testkit.backend.messages;

import com.fasterxml.jackson.databind.module.SimpleModule;
import java.io.Serial;
import java.time.LocalDate;
import java.util.List;
import neo4j.org.testkit.backend.messages.requests.deserializer.TestkitCypherDateDeserializer;
Expand Down Expand Up @@ -57,6 +58,9 @@
import org.neo4j.driver.types.IsoDuration;

public class TestkitModule extends SimpleModule {
@Serial
private static final long serialVersionUID = 7051732358423895087L;

public TestkitModule() {
this.addDeserializer(List.class, new TestkitListDeserializer());
this.addDeserializer(CypherDateTime.class, new TestkitCypherDateTimeDeserializer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private AsyncSessionHolder createAsyncSessionState(DriverHolder driverHolder, Se
driverHolder, driverHolder.getDriver().asyncSession(sessionConfig), sessionConfig);
}

@SuppressWarnings("deprecation")
private RxSessionHolder createRxSessionState(DriverHolder driverHolder, SessionConfig sessionConfig) {
return new RxSessionHolder(driverHolder, driverHolder.getDriver().rxSession(sessionConfig), sessionConfig);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState)
}

@Override
@SuppressWarnings("deprecation")
public Mono<TestkitResponse> processRx(TestkitState testkitState) {
return testkitState.getRxSessionHolder(data.getSessionId()).flatMap(sessionHolder -> {
RxSession session = sessionHolder.getSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState)
}

@Override
@SuppressWarnings("deprecation")
public Mono<TestkitResponse> processRx(TestkitState testkitState) {
return testkitState
.getRxSessionHolder(data.getSessionId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class SessionReadTransaction implements TestkitRequest {
private SessionReadTransactionBody data;

@Override
@SuppressWarnings("deprecation")
public TestkitResponse process(TestkitState testkitState) {
SessionHolder sessionHolder = testkitState.getSessionHolder(data.getSessionId());
Session session = sessionHolder.getSession();
Expand All @@ -56,6 +57,7 @@ public TestkitResponse process(TestkitState testkitState) {
}

@Override
@SuppressWarnings("deprecation")
public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState) {
return testkitState
.getAsyncSessionHolder(data.getSessionId())
Expand All @@ -77,6 +79,7 @@ public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState)
}

@Override
@SuppressWarnings("deprecation")
public Mono<TestkitResponse> processRx(TestkitState testkitState) {
return testkitState
.getRxSessionHolder(data.getSessionId())
Expand Down Expand Up @@ -113,6 +116,7 @@ public Mono<TestkitResponse> processReactive(TestkitState testkitState) {
.then(Mono.just(retryableDone()));
}

@SuppressWarnings("deprecation")
private TransactionWork<Void> handle(TestkitState testkitState, SessionHolder sessionHolder) {
return tx -> {
String txId = testkitState.addTransactionHolder(new TransactionHolder(sessionHolder, tx));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState)
}

@Override
@SuppressWarnings("deprecation")
public Mono<TestkitResponse> processRx(TestkitState testkitState) {
return testkitState.getRxSessionHolder(data.getSessionId()).flatMap(sessionHolder -> {
RxSession session = sessionHolder.getSession();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class SessionWriteTransaction implements TestkitRequest {
private SessionWriteTransactionBody data;

@Override
@SuppressWarnings("deprecation")
public TestkitResponse process(TestkitState testkitState) {
SessionHolder sessionHolder = testkitState.getSessionHolder(data.getSessionId());
Session session = sessionHolder.getSession();
Expand All @@ -57,6 +58,7 @@ public TestkitResponse process(TestkitState testkitState) {
}

@Override
@SuppressWarnings("deprecation")
public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState) {
return testkitState
.getAsyncSessionHolder(data.getSessionId())
Expand All @@ -78,6 +80,7 @@ public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState)
}

@Override
@SuppressWarnings("deprecation")
public Mono<TestkitResponse> processRx(TestkitState testkitState) {
return testkitState
.getRxSessionHolder(data.getSessionId())
Expand Down Expand Up @@ -114,6 +117,7 @@ public Mono<TestkitResponse> processReactive(TestkitState testkitState) {
.then(Mono.just(retryableDone()));
}

@SuppressWarnings("deprecation")
private TransactionWork<Void> handle(TestkitState testkitState, SessionHolder sessionHolder) {
return tx -> {
String txId = testkitState.addTransactionHolder(new TransactionHolder(sessionHolder, tx));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState)
}

@Override
@SuppressWarnings("deprecation")
public Mono<TestkitResponse> processRx(TestkitState testkitState) {
return testkitState
.getRxTransactionHolder(data.getTxId())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public CompletionStage<TestkitResponse> processAsync(TestkitState testkitState)
}

@Override
@SuppressWarnings("deprecation")
public Mono<TestkitResponse> processRx(TestkitState testkitState) {
return testkitState.getRxTransactionHolder(data.getTxId()).flatMap(transactionHolder -> {
RxResult result = transactionHolder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,15 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.io.Serial;
import java.time.LocalDate;
import java.util.Date;

public class TestkitCypherDateDeserializer extends StdDeserializer<LocalDate> {

@Serial
private static final long serialVersionUID = 3489940766207129614L;

private final TestkitCypherTypeMapper mapper;

public TestkitCypherDateDeserializer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.io.Serial;
import neo4j.org.testkit.backend.messages.requests.deserializer.types.CypherDateTime;

public class TestkitCypherDateTimeDeserializer extends StdDeserializer<CypherDateTime> {
@Serial
private static final long serialVersionUID = 8980981682742682436L;

private final TestkitCypherTypeMapper mapper;

public TestkitCypherDateTimeDeserializer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.io.Serial;
import org.neo4j.driver.internal.InternalIsoDuration;
import org.neo4j.driver.types.IsoDuration;

public class TestkitCypherDurationDeserializer extends StdDeserializer<IsoDuration> {
@Serial
private static final long serialVersionUID = 3128342779161014747L;

private final TestkitCypherTypeMapper mapper;

public TestkitCypherDurationDeserializer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,16 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.io.Serial;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import neo4j.org.testkit.backend.messages.requests.deserializer.types.CypherType;

public class TestkitCypherParamDeserializer extends StdDeserializer<Map<String, Object>> {
@Serial
private static final long serialVersionUID = -3239342714470961079L;

public TestkitCypherParamDeserializer() {
super(Map.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.io.Serial;
import neo4j.org.testkit.backend.messages.requests.deserializer.types.CypherTime;

public class TestkitCypherTimeDeserializer extends StdDeserializer<CypherTime> {
@Serial
private static final long serialVersionUID = 8354352358618500970L;

private final TestkitCypherTypeMapper mapper;

public TestkitCypherTimeDeserializer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
import java.io.IOException;
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
import neo4j.org.testkit.backend.messages.requests.deserializer.types.CypherType;

public class TestkitListDeserializer extends StdDeserializer<List<?>> {
@Serial
private static final long serialVersionUID = -1878499456593526741L;

private final TestkitCypherParamDeserializer mapDeserializer;

public TestkitListDeserializer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import org.neo4j.driver.internal.value.DateTimeValue;

public class TestkitDateTimeValueSerializer extends StdSerializer<DateTimeValue> {
@Serial
private static final long serialVersionUID = 819438767898259613L;

public TestkitDateTimeValueSerializer() {
super(DateTimeValue.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial;
import java.time.LocalDate;
import org.neo4j.driver.internal.value.DateValue;

public class TestkitDateValueSerializer extends StdSerializer<DateValue> {
@Serial
private static final long serialVersionUID = 6317556585191107633L;

public TestkitDateValueSerializer() {
super(DateValue.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial;
import org.neo4j.driver.internal.value.DurationValue;
import org.neo4j.driver.types.IsoDuration;

public class TestkitDurationValueSerializer extends StdSerializer<DurationValue> {
@Serial
private static final long serialVersionUID = -4371898769147355036L;

public TestkitDurationValueSerializer() {
super(DurationValue.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial;
import java.util.function.Function;
import org.neo4j.driver.internal.value.ListValue;

public class TestkitListValueSerializer extends StdSerializer<ListValue> {
@Serial
private static final long serialVersionUID = -5564826952797323279L;

public TestkitListValueSerializer() {
super(ListValue.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial;
import java.time.LocalDateTime;
import org.neo4j.driver.internal.value.LocalDateTimeValue;

public class TestkitLocalDateTimeValueSerializer extends StdSerializer<LocalDateTimeValue> {
@Serial
private static final long serialVersionUID = 8864167921883077348L;

public TestkitLocalDateTimeValueSerializer() {
super(LocalDateTimeValue.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial;
import java.time.LocalTime;
import org.neo4j.driver.internal.value.LocalTimeValue;

public class TestkitLocalTimeValueSerializer extends StdSerializer<LocalTimeValue> {
@Serial
private static final long serialVersionUID = -3712440793854179552L;

public TestkitLocalTimeValueSerializer() {
super(LocalTimeValue.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import java.io.IOException;
import java.io.Serial;
import java.util.Map;
import java.util.function.Function;
import org.neo4j.driver.Value;
import org.neo4j.driver.internal.value.MapValue;

public class TestkitMapValueSerializer extends StdSerializer<MapValue> {
@Serial
private static final long serialVersionUID = 3405706388191274032L;

public TestkitMapValueSerializer() {
super(MapValue.class);
}
Expand Down
Loading