diff --git a/driver/src/main/java/org/neo4j/driver/AccessMode.java b/driver/src/main/java/org/neo4j/driver/AccessMode.java index 3a3900d7e7..ee6ae1c6ee 100644 --- a/driver/src/main/java/org/neo4j/driver/AccessMode.java +++ b/driver/src/main/java/org/neo4j/driver/AccessMode.java @@ -23,7 +23,7 @@ * When running a transaction, a write transaction requires a server that supports writes. * A read transaction, on the other hand, requires a server that supports read operations. * This classification is key for routing driver to route transactions to a cluster correctly. - * + *
* While any {@link AccessMode} will be ignored while running transactions via a driver towards a single server. * As the single server serves both read and write operations at the same time. */ diff --git a/driver/src/main/java/org/neo4j/driver/Bookmark.java b/driver/src/main/java/org/neo4j/driver/Bookmark.java index b80a4b73ed..1cffb1f14a 100644 --- a/driver/src/main/java/org/neo4j/driver/Bookmark.java +++ b/driver/src/main/java/org/neo4j/driver/Bookmark.java @@ -24,13 +24,13 @@ /** * Causal chaining is carried out by passing bookmarks between transactions. - * + *
* When starting a session with initial bookmarks, the first transaction will be ensured to run at least after * the database is as up-to-date as the latest transaction referenced by the supplied bookmarks. - * + *
* Within a session, bookmark propagation is carried out automatically. * Thus all transactions in a session (both managed and unmanaged) are guaranteed to be carried out one after another. - * + *
* To opt out of this mechanism for unrelated units of work, applications can use multiple sessions.
*/
public interface Bookmark {
diff --git a/driver/src/main/java/org/neo4j/driver/BookmarkManagerConfig.java b/driver/src/main/java/org/neo4j/driver/BookmarkManagerConfig.java
index 170692c180..d00a5f9d52 100644
--- a/driver/src/main/java/org/neo4j/driver/BookmarkManagerConfig.java
+++ b/driver/src/main/java/org/neo4j/driver/BookmarkManagerConfig.java
@@ -51,7 +51,7 @@ public static BookmarkManagerConfigBuilder builder() {
/**
* Returns the map of bookmarks used to initialise the bookmark manager.
*
- * @return the map of bookmarks
+ * @return the set of bookmarks
*/
public Set
* Every update key that points to a null value will be removed from
* the new query's parameters. All other entries will just replace
* any existing parameter in the new query.
diff --git a/driver/src/main/java/org/neo4j/driver/Result.java b/driver/src/main/java/org/neo4j/driver/Result.java
index 8e014f11e4..78e3fe584f 100644
--- a/driver/src/main/java/org/neo4j/driver/Result.java
+++ b/driver/src/main/java/org/neo4j/driver/Result.java
@@ -29,10 +29,10 @@
/**
* The result of running a Cypher query, conceptually a stream of {@link Record records}.
- *
+ *
* The standard way of navigating through the result returned by the database is to
* {@link #next() iterate} over it.
- *
+ *
* Results are valid until the next query is run or until the end of the current transaction,
* whichever comes first. To keep a result around while further queries are run, or to use a result outside the scope
* of the current transaction, see {@link #list()}.
@@ -42,11 +42,11 @@
* In order to handle very large results, and to minimize memory overhead and maximize
* performance, results are retrieved lazily. Please see {@link QueryRunner} for
* important details on the effects of this.
- *
+ *
* The short version is that, if you want a hard guarantee that the underlying query
* has completed, you need to either call {@link Resource#close()} on the {@link Transaction}
* or {@link Session} that created this result, or you need to use the result.
- *
+ *
* Calling any method on this interface will guarantee that any write operation has completed on
* the remote database.
*
@@ -79,7 +79,7 @@ public interface Result extends Iterator
* Calling this method always exhausts the result, even when {@link NoSuchRecordException} is thrown.
*
* @return the first and only record in the stream
@@ -108,12 +108,12 @@ public interface Result extends Iterator
* Note that this method can only be used if you know that the query that
* yielded this result returns a finite stream. Some queries can yield
* infinite results, in which case calling this method will lead to running
* out of memory.
- *
+ *
* Calling this method exhausts the result.
*
* @return list of all remaining immutable records
@@ -124,12 +124,12 @@ public interface Result extends Iterator
* Note that this method can only be used if you know that the query that
* yielded this result returns a finite stream. Some queries can yield
* infinite results, in which case calling this method will lead to running
* out of memory.
- *
+ *
* Calling this method exhausts the result.
*
* @param mapFunction a function to map from Record to T. See {@link Records} for some predefined functions.
diff --git a/driver/src/main/java/org/neo4j/driver/SessionConfig.java b/driver/src/main/java/org/neo4j/driver/SessionConfig.java
index e1c63a74d8..e9b2c63fc7 100644
--- a/driver/src/main/java/org/neo4j/driver/SessionConfig.java
+++ b/driver/src/main/java/org/neo4j/driver/SessionConfig.java
@@ -332,12 +332,12 @@ public Builder withDatabase(String database) {
* Specify how many records to fetch in each batch for this session.
* This config will overrides the default value set on {@link Config#fetchSize()}.
* This config is only valid when the driver is used with servers that support Bolt V4 (Server version 4.0 and later).
- *
+ *
* Bolt V4 enables pulling records in batches to allow client to take control of data population and apply back pressure to server.
* This config specifies the default fetch size for all query runs using {@link Session} and {@link AsyncSession}.
* By default, the value is set to {@code 1000}.
* Use {@code -1} to disables back pressure and config client to pull all records at once after each run.
- *
+ *
* This config only applies to run result obtained via {@link Session} and {@link AsyncSession}.
* As with {@link RxSession}, the batch size is provided via {@link Subscription#request(long)} instead.
* @param size the default record fetch size when pulling records in batches using Bolt V4.
diff --git a/driver/src/main/java/org/neo4j/driver/SimpleQueryRunner.java b/driver/src/main/java/org/neo4j/driver/SimpleQueryRunner.java
index 3e8c6cff5c..880c5eedfb 100644
--- a/driver/src/main/java/org/neo4j/driver/SimpleQueryRunner.java
+++ b/driver/src/main/java/org/neo4j/driver/SimpleQueryRunner.java
@@ -95,7 +95,7 @@ public interface SimpleQueryRunner {
*
* Map
* Result result = session.run( "MATCH (n) WHERE n.name = $myNameParam RETURN (n)",
* parameters );
* }
diff --git a/driver/src/main/java/org/neo4j/driver/Value.java b/driver/src/main/java/org/neo4j/driver/Value.java
index 8a646f8fa8..318dfa9eb6 100644
--- a/driver/src/main/java/org/neo4j/driver/Value.java
+++ b/driver/src/main/java/org/neo4j/driver/Value.java
@@ -46,7 +46,7 @@
/**
* A unit of data that adheres to the Neo4j type system.
- *
+ *
* This interface describes a number of
* Given a tree structure like:
*
*
* This is equivalent to calling {@link #asMap(Function, Map)} with {@link Values#ofObject()}.
*
* @param defaultValue default to this value if the value is a {@link NullValue}
diff --git a/driver/src/main/java/org/neo4j/driver/exceptions/NoSuchRecordException.java b/driver/src/main/java/org/neo4j/driver/exceptions/NoSuchRecordException.java
index 0a9dd4465c..c7ba5b2997 100644
--- a/driver/src/main/java/org/neo4j/driver/exceptions/NoSuchRecordException.java
+++ b/driver/src/main/java/org/neo4j/driver/exceptions/NoSuchRecordException.java
@@ -23,7 +23,7 @@
/**
* Thrown whenever a client expected to read a record that was not available (i.e. because it wasn't returned by the server).
- *
+ *
* This usually indicates an expectation mismatch between client code and database application logic.
*
* @since 1.0
diff --git a/driver/src/main/java/org/neo4j/driver/internal/async/pool/NettyChannelPool.java b/driver/src/main/java/org/neo4j/driver/internal/async/pool/NettyChannelPool.java
index 23a1b888c7..0ad087617a 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/async/pool/NettyChannelPool.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/async/pool/NettyChannelPool.java
@@ -190,11 +190,9 @@ private CompletionStage
* The version 4.3 use most of the 4.2 behaviours, but it extends it with new messages such as ROUTE
*/
public class BoltProtocolV43 extends BoltProtocolV42 {
diff --git a/driver/src/main/java/org/neo4j/driver/internal/messaging/v43/MessageWriterV43.java b/driver/src/main/java/org/neo4j/driver/internal/messaging/v43/MessageWriterV43.java
index c59cdfb3b7..49a0b9b3ab 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/messaging/v43/MessageWriterV43.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/messaging/v43/MessageWriterV43.java
@@ -47,7 +47,7 @@
/**
* Bolt message writer v4.3
- *
+ *
* This version is able to encode all the versions existing on v4.2, but it encodes
* new messages such as ROUTE
*/
diff --git a/driver/src/main/java/org/neo4j/driver/internal/metrics/ConnectionPoolMetricsListener.java b/driver/src/main/java/org/neo4j/driver/internal/metrics/ConnectionPoolMetricsListener.java
index b21ac24d8b..d974fde1cc 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/metrics/ConnectionPoolMetricsListener.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/metrics/ConnectionPoolMetricsListener.java
@@ -42,7 +42,7 @@ interface ConnectionPoolMetricsListener {
/**
* Invoked before acquiring or creating a connection.
*
- * @param acquireEvent
+ * @param acquireEvent the event
*/
void beforeAcquiringOrCreating(ListenerEvent> acquireEvent);
@@ -54,7 +54,7 @@ interface ConnectionPoolMetricsListener {
/**
* Invoked after a connection is acquired or created successfully.
*
- * @param acquireEvent
+ * @param acquireEvent the event
*/
void afterAcquiredOrCreated(ListenerEvent> acquireEvent);
@@ -66,14 +66,14 @@ interface ConnectionPoolMetricsListener {
/**
* After a connection is acquired from the pool.
*
- * @param inUseEvent
+ * @param inUseEvent the event
*/
void acquired(ListenerEvent> inUseEvent);
/**
* After a connection is released back to pool.
*
- * @param inUseEvent
+ * @param inUseEvent the event
*/
void released(ListenerEvent> inUseEvent);
}
diff --git a/driver/src/main/java/org/neo4j/driver/internal/packstream/PackOutput.java b/driver/src/main/java/org/neo4j/driver/internal/packstream/PackOutput.java
index 22f355f513..ee7e8c1719 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/packstream/PackOutput.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/packstream/PackOutput.java
@@ -28,17 +28,21 @@ public interface PackOutput {
PackOutput writeByte(byte value) throws IOException;
/** Produce binary data */
+ @SuppressWarnings("UnusedReturnValue")
PackOutput writeBytes(byte[] data) throws IOException;
/** Produce a 4-byte signed integer */
PackOutput writeShort(short value) throws IOException;
/** Produce a 4-byte signed integer */
+ @SuppressWarnings("UnusedReturnValue")
PackOutput writeInt(int value) throws IOException;
/** Produce an 8-byte signed integer */
+ @SuppressWarnings("UnusedReturnValue")
PackOutput writeLong(long value) throws IOException;
/** Produce an 8-byte IEEE 754 "double format" floating-point number */
+ @SuppressWarnings("UnusedReturnValue")
PackOutput writeDouble(double value) throws IOException;
}
diff --git a/driver/src/main/java/org/neo4j/driver/internal/packstream/PackStream.java b/driver/src/main/java/org/neo4j/driver/internal/packstream/PackStream.java
index 647c9bf378..fc28e3beed 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/packstream/PackStream.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/packstream/PackStream.java
@@ -33,10 +33,10 @@
* PackStream is a messaging serialisation format heavily inspired by MessagePack.
* The key differences are in the type system itself which (among other things) replaces extensions with structures.
* The Packer and Unpacker implementations are also faster than their MessagePack counterparts.
- *
+ *
* Note that several marker byte values are RESERVED for future use.
* Extra markers should not be added casually and such additions must be follow a strict process involving both client and server software.
- *
+ *
* The table below shows all allocated marker byte values.
*
* This method takes a set of parameters that will be injected into the
* query by Neo4j. Using parameters is highly encouraged, it helps avoid
* dangerous cypher injection attacks and improves database performance as
* Neo4j can re-use query plans more often.
- *
+ *
* This particular method takes a {@link Value} as its input. This is useful
* if you want to take a map-like value that you've gotten from a prior result
* and send it back as parameters.
- *
+ *
* If you are creating parameters programmatically, {@link #run(String, Map)}
* might be more helpful, it converts your map to a {@link Value} for you.
*
@@ -64,12 +64,12 @@ default RxResult run(String query, Value parameters) {
* Register running of a query and return a reactive result stream.
* The query is not executed when the reactive result is returned.
* Instead, the publishers in the result will actually start the execution of the query.
- *
+ *
* This method takes a set of parameters that will be injected into the
* query by Neo4j. Using parameters is highly encouraged, it helps avoid
* dangerous cypher injection attacks and improves database performance as
* Neo4j can re-use query plans more often.
- *
+ *
* This version of run takes a {@link Map} of parameters. The values in the map
* must be values that can be converted to Neo4j types. See {@link Values#parameters(Object...)} for
* a list of allowed types.
@@ -86,12 +86,12 @@ default RxResult run(String query, Map
* This method takes a set of parameters that will be injected into the
* query by Neo4j. Using parameters is highly encouraged, it helps avoid
* dangerous cypher injection attacks and improves database performance as
* Neo4j can re-use query plans more often.
- *
+ *
* This version of run takes a {@link Record} of parameters, which can be useful
* if you want to use the output of one query as input for another.
*
diff --git a/driver/src/main/java/org/neo4j/driver/summary/Plan.java b/driver/src/main/java/org/neo4j/driver/summary/Plan.java
index 561fd2d328..fb42948df0 100644
--- a/driver/src/main/java/org/neo4j/driver/summary/Plan.java
+++ b/driver/src/main/java/org/neo4j/driver/summary/Plan.java
@@ -27,12 +27,12 @@
* This describes the plan that the database planner produced and used (or will use) to execute your query.
* This can be extremely helpful in understanding what a query is doing, and how to optimize it. For more
* details, see the Neo4j Manual.
- *
+ *
* The plan for the query is a tree of plans - each sub-tree containing zero or more child plans. The query
* starts with the root plan. Each sub-plan is of a specific {@link #operatorType() operator type}, which describes
* what that part of the plan does - for instance, perform an index lookup or filter results. The Neo4j Manual contains
* a reference of the available operator types, and these may differ across Neo4j versions.
- *
+ *
* For a simple view of a plan, the {@code toString} method will give a human-readable rendering of the tree.
* @since 1.0
*/
diff --git a/driver/src/main/java/org/neo4j/driver/summary/ResultSummary.java b/driver/src/main/java/org/neo4j/driver/summary/ResultSummary.java
index 025718bda5..ab133b76ad 100644
--- a/driver/src/main/java/org/neo4j/driver/summary/ResultSummary.java
+++ b/driver/src/main/java/org/neo4j/driver/summary/ResultSummary.java
@@ -27,9 +27,9 @@
* The result summary of running a query. The result summary interface can be used to investigate
* details about the result, like the type of query run, how many and which kinds of updates have been executed,
* and query plan and profiling information if available.
- *
+ *
* The result summary is only available after all result records have been consumed.
- *
+ *
* Keeping the result summary around does not influence the lifecycle of any associated session and/or transaction.
* @since 1.0
*/
@@ -69,7 +69,7 @@ public interface ResultSummary {
/**
* This describes how the database did execute your query.
- *
+ *
* If the query you executed {@link #hasProfile() was profiled}, the query plan will contain detailed
* information about what each step of the plan did. That more in-depth version of the query plan becomes
* available here.
@@ -82,7 +82,7 @@ public interface ResultSummary {
* A list of notifications that might arise when executing the query.
* Notifications can be warnings about problematic queries or other valuable information that can be presented
* in a client.
- *
+ *
* Unlike failures or errors, notifications do not affect the execution of a query.
*
* @return a list of notifications produced while executing the query. The list will be empty if no
diff --git a/driver/src/main/java/org/neo4j/driver/types/MapAccessor.java b/driver/src/main/java/org/neo4j/driver/types/MapAccessor.java
index a7df3b39a2..ba4fa54e7a 100644
--- a/driver/src/main/java/org/neo4j/driver/types/MapAccessor.java
+++ b/driver/src/main/java/org/neo4j/driver/types/MapAccessor.java
@@ -27,7 +27,7 @@
/**
* Access the keys, properties and values of an underlying unordered map by key
- *
+ *
* This provides only read methods. Subclasses may chose to provide additional methods
* for changing the underlying map.
* @since 1.0
@@ -84,7 +84,7 @@ public interface MapAccessor {
/**
* Return the underlying map as a map of string keys and values converted using
* {@link Value#asObject()}.
- *
+ *
* This is equivalent to calling {@link #asMap(Function)} with {@link Values#ofObject()}.
*
* @return the value as a Java map
diff --git a/driver/src/main/java/org/neo4j/driver/types/Path.java b/driver/src/main/java/org/neo4j/driver/types/Path.java
index 425f486023..e7b6094707 100644
--- a/driver/src/main/java/org/neo4j/driver/types/Path.java
+++ b/driver/src/main/java/org/neo4j/driver/types/Path.java
@@ -24,7 +24,7 @@
* A Path is a directed sequence of relationships between two nodes. This generally
* represents a traversal or walk through a graph and maintains a direction separate
* from that of any relationships traversed.
- *
+ *
* It is allowed to be of size 0, meaning there are no relationships in it. In this case,
* it contains only a single node which is both the start and the end of the path.
*
diff --git a/driver/src/test/java/org/neo4j/driver/integration/ConnectionPoolIT.java b/driver/src/test/java/org/neo4j/driver/integration/ConnectionPoolIT.java
index 0ee8a05efb..2e69060b64 100644
--- a/driver/src/test/java/org/neo4j/driver/integration/ConnectionPoolIT.java
+++ b/driver/src/test/java/org/neo4j/driver/integration/ConnectionPoolIT.java
@@ -170,6 +170,7 @@ private static void startAndCloseTransactions(Driver driver, int txCount) {
}
}
+ @SuppressWarnings("BusyWait")
private void awaitNoActiveChannels(ChannelTrackingDriverFactory driverFactory) throws InterruptedException {
var deadline = System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(20);
var activeChannels = -1;
@@ -187,7 +188,7 @@ private void awaitNoActiveChannels(ChannelTrackingDriverFactory driverFactory) t
/**
* This is a background runner that will grab lots of sessions in one go, and then close them all, while tracking
* it's current state - is it currently able to acquire complete groups of sessions, or are there errors occurring?
- *
+ *
* This can thus be used to judge the state of the driver - is it currently healthy or not?
*/
private static class SessionGrabber implements Runnable {
@@ -207,6 +208,7 @@ public void start() {
}
@Override
+ @SuppressWarnings("BusyWait")
public void run() {
try {
while (run) {
@@ -231,6 +233,7 @@ public void run() {
}
}
+ @SuppressWarnings("BusyWait")
void assertSessionsAvailableWithin() throws InterruptedException {
var deadline = System.currentTimeMillis() + 1000 * 120;
while (System.currentTimeMillis() < deadline) {
diff --git a/driver/src/test/java/org/neo4j/driver/integration/SessionResetIT.java b/driver/src/test/java/org/neo4j/driver/integration/SessionResetIT.java
index 409b2ba2c0..1b3d336e92 100644
--- a/driver/src/test/java/org/neo4j/driver/integration/SessionResetIT.java
+++ b/driver/src/test/java/org/neo4j/driver/integration/SessionResetIT.java
@@ -449,7 +449,8 @@ private void testQueryTermination(boolean autoCommit) {
}
@SuppressWarnings("resource")
- private FutureisType
methods along with
* typeValue
methods. The first set of these correlate with types from
* the Neo4j Type System and are used to determine which Neo4j type is represented.
@@ -59,7 +59,7 @@
* Because Neo4j often handles dynamic structures, this interface is designed to help
* you handle such structures in Java. Specifically, {@link Value} lets you navigate arbitrary tree
* structures without having to resort to type casting.
- *
+ *
@@ -74,7 +74,6 @@
*
*
* You can retrieve the name of the second user, John, like so:
- *
*
* {@code
* String username = value.get("users").get(1).get("name").asString();
@@ -82,7 +81,6 @@
*
*
* You can also easily iterate over the users:
- *
*
* {@code
* List
*
diff --git a/driver/src/main/java/org/neo4j/driver/internal/retry/ExponentialBackoffRetryLogic.java b/driver/src/main/java/org/neo4j/driver/internal/retry/ExponentialBackoffRetryLogic.java
index 4bbae7ee89..ddd39c8be8 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/retry/ExponentialBackoffRetryLogic.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/retry/ExponentialBackoffRetryLogic.java
@@ -158,11 +158,10 @@ protected boolean canRetryOn(Throwable error) {
/**
* Extracts the possible cause of a transaction that has been marked terminated.
*
- * @param error
- * @return
+ * @param error the error
+ * @return the possible cause or the original error
*/
private static Throwable extractPossibleTerminationCause(Throwable error) {
-
// Having a dedicated "TerminatedException" inheriting from ClientException might be a good idea.
if (error instanceof ClientException && error.getCause() != null) {
return error.getCause();
diff --git a/driver/src/main/java/org/neo4j/driver/internal/util/CertificateTool.java b/driver/src/main/java/org/neo4j/driver/internal/util/CertificateTool.java
index fd829d4438..cfc95f24c4 100644
--- a/driver/src/main/java/org/neo4j/driver/internal/util/CertificateTool.java
+++ b/driver/src/main/java/org/neo4j/driver/internal/util/CertificateTool.java
@@ -44,10 +44,8 @@ public final class CertificateTool {
/**
* Save a certificate to a file. Remove all the content in the file if there is any before.
*
- * @param cert
- * @param certFile
- * @throws GeneralSecurityException
- * @throws IOException
+ * @param cert the certificate
+ * @param certFile the certificate file
*/
public static void saveX509Cert(Certificate cert, File certFile) throws GeneralSecurityException, IOException {
saveX509Cert(new Certificate[] {cert}, certFile);
@@ -56,10 +54,8 @@ public static void saveX509Cert(Certificate cert, File certFile) throws GeneralS
/**
* Save a list of certificates into a file
*
- * @param certs
- * @param certFile
- * @throws GeneralSecurityException
- * @throws IOException
+ * @param certs the certificates
+ * @param certFile the certificate file
*/
public static void saveX509Cert(Certificate[] certs, File certFile) throws GeneralSecurityException, IOException {
try (var writer = new BufferedWriter(new FileWriter(certFile))) {
@@ -82,10 +78,8 @@ public static void saveX509Cert(Certificate[] certs, File certFile) throws Gener
/**
* Load the certificates written in X.509 format in a file to a key store.
*
- * @param certFiles
- * @param keyStore
- * @throws GeneralSecurityException
- * @throws IOException
+ * @param certFiles the certificate files
+ * @param keyStore the key store
*/
public static void loadX509Cert(List