Skip to content

Commit 3206bde

Browse files
authored
Refactoring (#1468)
1 parent aee893b commit 3206bde

Some content is hidden

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

42 files changed

+61
-102
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ As a policy, patch versions will not be released except on rare occasions. Bug f
1515

1616
## Supported Driver Series
1717

18-
| Driver Series | Supported Java Runtime versions | Status | Changelog |
19-
| --- | --- | --- | --- |
20-
| 5.x | 17 | Primary development branch. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/5.x-changelog) |
21-
| 4.4 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.4-changelog) |
18+
| Driver Series | Supported Java Runtime versions | Status | Changelog |
19+
|---------------|---------------------------------|-----------------------------|-----------------------------------------------------------------------|
20+
| 5.x | 17 | Primary development branch. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/5.x-changelog) |
21+
| 4.4 | 8, 11 | Maintenance. | [link](https://github.com/neo4j/neo4j-java-driver/wiki/4.4-changelog) |
2222

2323
## Server Compatibility
2424

build/javadoc/overview.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2-
<HTML>
2+
<HTML lang="en">
33
<HEAD>
44
<TITLE>API Overview</TITLE>
55
</HEAD>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,8 @@ public ConfigBuilder withRoutingTablePurgeDelay(long delay, TimeUnit unit) {
574574
* By default, the value is set to {@code 1000}.
575575
* Use {@code -1} to disables back pressure and config client to pull all records at once after each run.
576576
* <p>
577-
* This config only applies to run result obtained via {@link Session} and {@link org.neo4j.driver.async.AsyncSession}.
578-
* As with {@link org.neo4j.driver.reactive.RxSession}, the batch size is provided via
579-
* {@link org.reactivestreams.Subscription#request(long)} instead.
577+
* This config only applies to run results obtained via {@link Session} and {@link org.neo4j.driver.async.AsyncSession}.
578+
* As with the reactive sessions the batch size is managed by the subscription requests instead.
580579
*
581580
* @param size the default record fetch size when pulling records in batches using Bolt V4.
582581
* @return this builder

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ default Session session(SessionConfig sessionConfig) {
139139
* @throws IllegalArgumentException for unsupported session types
140140
* @since 5.2
141141
*/
142+
@SuppressWarnings("deprecation")
142143
default <T extends BaseSession> T session(Class<T> sessionClass) {
143144
return session(sessionClass, SessionConfig.defaultConfig());
144145
}
@@ -176,6 +177,7 @@ default <T extends BaseSession> T session(Class<T> sessionClass) {
176177
* @since 5.8
177178
*/
178179
@Preview(name = "AuthToken rotation and session auth support")
180+
@SuppressWarnings("deprecation")
179181
default <T extends BaseSession> T session(Class<T> sessionClass, AuthToken sessionAuthToken) {
180182
return session(sessionClass, SessionConfig.defaultConfig(), sessionAuthToken);
181183
}
@@ -208,6 +210,7 @@ default <T extends BaseSession> T session(Class<T> sessionClass, AuthToken sessi
208210
* @throws IllegalArgumentException for unsupported session types
209211
* @since 5.2
210212
*/
213+
@SuppressWarnings("deprecation")
211214
default <T extends BaseSession> T session(Class<T> sessionClass, SessionConfig sessionConfig) {
212215
return session(sessionClass, sessionConfig, null);
213216
}
@@ -247,6 +250,7 @@ default <T extends BaseSession> T session(Class<T> sessionClass, SessionConfig s
247250
* @since 5.8
248251
*/
249252
@Preview(name = "AuthToken rotation and session auth support")
253+
@SuppressWarnings("deprecation")
250254
<T extends BaseSession> T session(Class<T> sessionClass, SessionConfig sessionConfig, AuthToken sessionAuthToken);
251255

252256
/**

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
import org.neo4j.driver.async.AsyncSession;
3131
import org.neo4j.driver.exceptions.UnsupportedFeatureException;
3232
import org.neo4j.driver.reactive.ReactiveSession;
33-
import org.neo4j.driver.reactive.RxSession;
34-
import org.reactivestreams.Subscription;
3533

3634
/**
3735
* The session configurations used to configure a session.
@@ -339,7 +337,8 @@ public Builder withDatabase(String database) {
339337
* Use {@code -1} to disables back pressure and config client to pull all records at once after each run.
340338
* <p>
341339
* This config only applies to run result obtained via {@link Session} and {@link AsyncSession}.
342-
* As with {@link RxSession}, the batch size is provided via {@link Subscription#request(long)} instead.
340+
* As with the reactive sessions the batch size is managed by the subscription requests instead.
341+
*
343342
* @param size the default record fetch size when pulling records in batches using Bolt V4.
344343
* @return this builder
345344
*/

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.util.Map;
3131
import java.util.Objects;
3232
import org.neo4j.driver.async.AsyncSession;
33-
import org.neo4j.driver.async.AsyncTransactionWork;
3433
import org.neo4j.driver.internal.util.Extract;
3534

3635
/**
@@ -41,9 +40,8 @@
4140
* <ul>
4241
* <li>queries executed in auto-commit transactions - using various overloads of {@link Session#run(String, TransactionConfig)} and
4342
* {@link AsyncSession#runAsync(String, TransactionConfig)}</li>
44-
* <li>transactions started by transaction functions - using {@link Session#readTransaction(TransactionWork, TransactionConfig)},
45-
* {@link Session#writeTransaction(TransactionWork, TransactionConfig)}, {@link AsyncSession#readTransactionAsync(AsyncTransactionWork, TransactionConfig)} and
46-
* {@link AsyncSession#writeTransactionAsync(AsyncTransactionWork, TransactionConfig)}</li>
43+
* <li>transactions started by transaction functions - using {@link Session#executeWrite(TransactionCallback, TransactionConfig)},
44+
* {@link Session#executeRead(TransactionCallback, TransactionConfig)} and the other similar variants</li>
4745
* <li>unmanaged transactions - using {@link Session#beginTransaction(TransactionConfig)} and {@link AsyncSession#beginTransactionAsync(TransactionConfig)}</li>
4846
* </ul>
4947
* <p>

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,7 @@ public static Value value(Object value) {
224224
* @return the array of values
225225
*/
226226
public static Value[] values(final Object... input) {
227-
var values = Arrays.stream(input).map(Values::value).toArray(Value[]::new);
228-
return values;
227+
return Arrays.stream(input).map(Values::value).toArray(Value[]::new);
229228
}
230229

231230
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,9 @@ private CompletionStage<ConnectionContextAndHandler> ensureDatabaseNameIsComplet
165165
public Set<BoltServerAddress> allServers() {
166166
// obviously we just had a snapshot of all servers in all routing tables
167167
// after we read it, the set could already be changed.
168-
var servers = routingTableHandlers.values().stream()
168+
return routingTableHandlers.values().stream()
169169
.flatMap(tableHandler -> tableHandler.servers().stream())
170170
.collect(Collectors.toSet());
171-
return servers;
172171
}
173172

174173
@Override

driver/src/test/java/org/neo4j/driver/integration/QueryIT.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ void shouldRunParameterizedWithResult() {
141141
assertThat(result.size(), equalTo(3));
142142
}
143143

144-
@SuppressWarnings({"QueryWithEmptyBody", "ConstantConditions"})
144+
@SuppressWarnings({"QueryWithEmptyBody"})
145145
@Test
146146
void shouldRunSimpleQuery() {
147147
// When I run a simple write query
@@ -166,7 +166,6 @@ void shouldFailForIllegalQueries() {
166166
}
167167

168168
@Test
169-
@SuppressWarnings("deprecation")
170169
void shouldBeAbleToLogSemanticWrongExceptions() {
171170
try {
172171
// When I run a query with the old syntax

driver/src/test/java/org/neo4j/driver/integration/SessionBoltV3IT.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ void beforeAll() {
7373
}
7474

7575
@Test
76-
@SuppressWarnings("resource")
7776
void shouldSetTransactionMetadata() {
7877
Map<String, Object> metadata = new HashMap<>();
7978
metadata.put("a", "hello world");

0 commit comments

Comments
 (0)