Skip to content

Commit f932146

Browse files
author
michele
committed
code analysis fixes
1 parent 03ac332 commit f932146

20 files changed

+51
-75
lines changed

β€ŽREADME.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ The following documentation links to the documentation of the synchronous varian
2121

2222
- [ArangoDB](https://www.arangodb.com/)
2323
- [ChangeLog](ChangeLog.md)
24-
- [Examples](src/test/java/com/arangodb/example)
24+
- [Examples](src/test/java/com/arangodb/async/example)
2525
- [JavaDoc](http://arangodb.github.io/arangodb-java-driver-async/javadoc-5_1)

β€Žsrc/main/java/com/arangodb/async/ArangoCollectionAsync.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,22 @@
3535
* @see <a href="https://docs.arangodb.com/current/HTTP/Collection/">Documents API Documentation</a>
3636
* @author Mark Vollmary
3737
*/
38+
@SuppressWarnings("unused")
3839
public interface ArangoCollectionAsync extends ArangoSerializationAccessor {
3940

4041
/**
4142
* The the handler of the database the collection is within
4243
*
4344
* @return database handler
4445
*/
45-
public ArangoDatabaseAsync db();
46+
ArangoDatabaseAsync db();
4647

4748
/**
4849
* The name of the collection
4950
*
5051
* @return collection name
5152
*/
52-
public String name();
53+
String name();
5354

5455
/**
5556
* Creates a new document from the given document, unless there is already a document with the _key given. If no
@@ -338,9 +339,6 @@ <T> CompletableFuture<MultiDocumentEntity<DocumentUpdateEntity<T>>> updateDocume
338339
* Documentation</a>
339340
* @param key
340341
* The key of the document
341-
* @param type
342-
* The type of the document (POJO class, VPackSlice or String for Json). Only necessary if
343-
* options.returnOld is set to true, otherwise can be null.
344342
* @return information about the document
345343
*/
346344
CompletableFuture<DocumentDeleteEntity<Void>> deleteDocument(final String key);
@@ -372,9 +370,6 @@ <T> CompletableFuture<DocumentDeleteEntity<T>> deleteDocument(
372370
* Documentation</a>
373371
* @param values
374372
* The keys of the documents or the documents themselves
375-
* @param type
376-
* The type of the documents (POJO class, VPackSlice or String for Json). Only necessary if
377-
* options.returnOld is set to true, otherwise can be null.
378373
* @return information about the documents
379374
*/
380375
CompletableFuture<MultiDocumentEntity<DocumentDeleteEntity<Void>>> deleteDocuments(final Collection<?> values);
@@ -586,8 +581,6 @@ CompletableFuture<IndexEntity> ensureFulltextIndex(
586581
*
587582
* @see <a href="https://docs.arangodb.com/current/HTTP/Collection/Creating.html#create-collection">API
588583
* Documentation</a>
589-
* @param options
590-
* Additional options, can be null
591584
* @return information about the collection
592585
*/
593586
CompletableFuture<CollectionEntity> create();

β€Žsrc/main/java/com/arangodb/async/ArangoDBAsync.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ public interface ArangoDBAsync extends ArangoSerializationAccessor {
7575
*
7676
* @author Mark Vollmary
7777
*/
78-
public static class Builder extends InternalArangoDBBuilder {
78+
@SuppressWarnings("unused")
79+
class Builder extends InternalArangoDBBuilder {
7980

8081
public Builder() {
8182
super();
@@ -483,8 +484,8 @@ public Builder registerJsonModule(final VPackParserModule module) {
483484
* modules to register
484485
* @return {@link ArangoDBAsync.Builder}
485486
*/
486-
public Builder registerJsonModules(final VPackParserModule... module) {
487-
vpackParserBuilder.registerModules(module);
487+
public Builder registerJsonModules(final VPackParserModule... modules) {
488+
vpackParserBuilder.registerModules(modules);
488489
return this;
489490
}
490491

β€Žsrc/main/java/com/arangodb/async/ArangoDatabaseAsync.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
* @see <a href="https://docs.arangodb.com/current/HTTP/Database/">Databases API Documentation</a>
4040
* @see <a href="https://docs.arangodb.com/current/HTTP/AqlQuery/">Query API Documentation</a>
4141
*/
42+
@SuppressWarnings("unused")
4243
public interface ArangoDatabaseAsync extends ArangoSerializationAccessor {
4344

4445
/**
@@ -102,7 +103,6 @@ public interface ArangoDatabaseAsync extends ArangoSerializationAccessor {
102103
* Creates a collection
103104
*
104105
* @param name The name of the collection
105-
* @param options Additional options, can be null
106106
* @return information about the collection
107107
* @see <a href="https://docs.arangodb.com/current/HTTP/Collection/Creating.html#create-collection">API
108108
* Documentation</a>

β€Žsrc/main/java/com/arangodb/async/ArangoEdgeCollectionAsync.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html">API Documentation</a>
3434
* @author Mark Vollmary
3535
*/
36+
@SuppressWarnings("unused")
3637
public interface ArangoEdgeCollectionAsync extends ArangoSerializationAccessor {
3738

3839
/**
@@ -104,8 +105,6 @@ public interface ArangoEdgeCollectionAsync extends ArangoSerializationAccessor {
104105
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
105106
* @param key
106107
* The key of the edge
107-
* @param type
108-
* The type of the edge-document (POJO class, VPackSlice or String for Json)
109108
* @return information about the edge
110109
*/
111110
<T> CompletableFuture<EdgeUpdateEntity> replaceEdge(final String key, final T value);
@@ -117,8 +116,6 @@ public interface ArangoEdgeCollectionAsync extends ArangoSerializationAccessor {
117116
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
118117
* @param key
119118
* The key of the edge
120-
* @param type
121-
* The type of the edge-document (POJO class, VPackSlice or String for Json)
122119
* @param options
123120
* Additional options, can be null
124121
* @return information about the edge
@@ -136,8 +133,6 @@ <T> CompletableFuture<EdgeUpdateEntity> replaceEdge(
136133
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
137134
* @param key
138135
* The key of the edge
139-
* @param type
140-
* The type of the edge-document (POJO class, VPackSlice or String for Json)
141136
* @return information about the edge
142137
*/
143138
<T> CompletableFuture<EdgeUpdateEntity> updateEdge(final String key, final T value);
@@ -150,8 +145,6 @@ <T> CompletableFuture<EdgeUpdateEntity> replaceEdge(
150145
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
151146
* @param key
152147
* The key of the edge
153-
* @param type
154-
* The type of the edge-document (POJO class, VPackSlice or String for Json)
155148
* @param options
156149
* Additional options, can be null
157150
* @return information about the edge

β€Žsrc/main/java/com/arangodb/async/ArangoGraphAsync.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,22 @@
3434
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/">API Documentation</a>
3535
* @author Mark Vollmary
3636
*/
37+
@SuppressWarnings("unused")
3738
public interface ArangoGraphAsync extends ArangoSerializationAccessor {
3839

3940
/**
4041
* The the handler of the database the named graph is within
4142
*
4243
* @return database handler
4344
*/
44-
public ArangoDatabaseAsync db();
45+
ArangoDatabaseAsync db();
4546

4647
/**
4748
* The name of the collection
4849
*
4950
* @return collection name
5051
*/
51-
public String name();
52+
String name();
5253

5354
/**
5455
* Checks whether the graph exists
@@ -102,7 +103,7 @@ CompletableFuture<GraphEntity> createGraph(
102103
* graphs.
103104
* @return void
104105
*/
105-
CompletableFuture<Void> drop(boolean dropCollection);
106+
CompletableFuture<Void> drop(boolean dropCollections);
106107

107108
/**
108109
* Get a graph from the graph module

β€Žsrc/main/java/com/arangodb/async/ArangoRouteAsync.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
*
3232
* @author Mark Vollmary
3333
*/
34+
@SuppressWarnings("unused")
3435
public interface ArangoRouteAsync extends ArangoSerializationAccessor {
3536

3637
/**

β€Žsrc/main/java/com/arangodb/async/ArangoVertexCollectionAsync.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html">API Documentation</a>
3434
* @author Mark Vollmary
3535
*/
36+
@SuppressWarnings("unused")
3637
public interface ArangoVertexCollectionAsync extends ArangoSerializationAccessor {
3738

3839
/**
@@ -115,8 +116,6 @@ public interface ArangoVertexCollectionAsync extends ArangoSerializationAccessor
115116
* Documentation</a>
116117
* @param key
117118
* The key of the vertex
118-
* @param type
119-
* The type of the vertex-document (POJO class, VPackSlice or String for Json)
120119
* @return information about the vertex
121120
*/
122121
<T> CompletableFuture<VertexUpdateEntity> replaceVertex(final String key, final T value);
@@ -129,8 +128,6 @@ public interface ArangoVertexCollectionAsync extends ArangoSerializationAccessor
129128
* Documentation</a>
130129
* @param key
131130
* The key of the vertex
132-
* @param type
133-
* The type of the vertex-document (POJO class, VPackSlice or String for Json)
134131
* @param options
135132
* Additional options, can be null
136133
* @return information about the vertex
@@ -148,8 +145,6 @@ <T> CompletableFuture<VertexUpdateEntity> replaceVertex(
148145
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
149146
* @param key
150147
* The key of the vertex
151-
* @param type
152-
* The type of the vertex-document (POJO class, VPackSlice or String for Json)
153148
* @return information about the vertex
154149
*/
155150
<T> CompletableFuture<VertexUpdateEntity> updateVertex(final String key, final T value);
@@ -162,8 +157,6 @@ <T> CompletableFuture<VertexUpdateEntity> replaceVertex(
162157
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
163158
* @param key
164159
* The key of the vertex
165-
* @param type
166-
* The type of the vertex-document (POJO class, VPackSlice or String for Json)
167160
* @param options
168161
* Additional options, can be null
169162
* @return information about the vertex

β€Žsrc/main/java/com/arangodb/async/ArangoViewAsync.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@
3232
* @author Mark Vollmary
3333
* @since ArangoDB 3.4.0
3434
*/
35+
@SuppressWarnings("unused")
3536
public interface ArangoViewAsync extends ArangoSerializationAccessor {
3637

3738
/**
3839
* The the handler of the database the collection is within
3940
*
4041
* @return database handler
4142
*/
42-
public ArangoDatabaseAsync db();
43+
ArangoDatabaseAsync db();
4344

4445
/**
4546
* The name of the view
4647
*
4748
* @return view name
4849
*/
49-
public String name();
50+
String name();
5051

5152
/**
5253
* Checks whether the view exists.

β€Žsrc/main/java/com/arangodb/async/internal/ArangoCollectionAsyncImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ArangoCollectionAsyncImpl
4141
extends InternalArangoCollection<ArangoDBAsyncImpl, ArangoDatabaseAsyncImpl, ArangoExecutorAsync>
4242
implements ArangoCollectionAsync {
4343

44-
protected ArangoCollectionAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
44+
ArangoCollectionAsyncImpl(final ArangoDatabaseAsyncImpl db, final String name) {
4545
super(db, name);
4646
}
4747

@@ -319,7 +319,7 @@ public CompletableFuture<Collection<IndexEntity>> getIndexes() {
319319

320320
@Override
321321
public CompletableFuture<Boolean> exists() {
322-
return getInfo().thenApply(info -> info != null).exceptionally(e -> e == null);
322+
return getInfo().thenApply(Objects::nonNull).exceptionally(Objects::isNull);
323323
}
324324

325325
@Override

0 commit comments

Comments
 (0)