Skip to content

Commit 5b83371

Browse files
authored
Merge pull request #248 from limpid-kzonix/feature/fix-build-warnings
code-style refactoring, fix Javadoc warnings
2 parents bdb4134 + 62d64f9 commit 5b83371

16 files changed

+325
-281
lines changed

pom.xml

Lines changed: 61 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1+
<project xmlns="http://maven.apache.org/POM/4.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45

@@ -26,7 +27,7 @@
2627
<arangodb.velocypack.version>1.4.1</arangodb.velocypack.version>
2728

2829
<!-- provided -->
29-
<httpclient.version>4.5.1</httpclient.version>
30+
<httpclient.version>4.5.7</httpclient.version>
3031

3132
<!-- test -->
3233
<logback-classic.version>1.1.3</logback-classic.version>
@@ -67,17 +68,41 @@
6768
<jdk>[1.8,)</jdk>
6869
</activation>
6970
<properties>
70-
<javadoc.opts>-Xdoclint:none</javadoc.opts>
71+
<doclint>none</doclint>
7172
</properties>
7273
</profile>
7374
</profiles>
7475

7576
<build>
7677
<plugins>
78+
79+
<plugin>
80+
<inherited>true</inherited>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-enforcer-plugin</artifactId>
83+
<version>3.0.0-M2</version>
84+
<executions>
85+
<execution>
86+
<id>enforce-maven-3</id>
87+
<goals>
88+
<goal>enforce</goal>
89+
</goals>
90+
<configuration>
91+
<rules>
92+
<requireMavenVersion>
93+
<version>3.0.5</version>
94+
</requireMavenVersion>
95+
</rules>
96+
<fail>true</fail>
97+
</configuration>
98+
</execution>
99+
</executions>
100+
</plugin>
101+
77102
<plugin>
78103
<groupId>org.sonatype.plugins</groupId>
79104
<artifactId>nexus-staging-maven-plugin</artifactId>
80-
<version>1.6.5</version>
105+
<version>1.6.8</version>
81106
<extensions>true</extensions>
82107
<configuration>
83108
<serverId>ossrh</serverId>
@@ -90,7 +115,6 @@
90115
<plugin>
91116
<groupId>org.apache.maven.plugins</groupId>
92117
<artifactId>maven-assembly-plugin</artifactId>
93-
<version>2.4.1</version>
94118
<executions>
95119
<execution>
96120
<id>assembly</id>
@@ -115,18 +139,16 @@
115139
<plugin>
116140
<groupId>org.apache.maven.plugins</groupId>
117141
<artifactId>maven-compiler-plugin</artifactId>
118-
<version>3.2</version>
119142
<configuration>
120-
<source>1.6</source>
121-
<target>1.6</target>
143+
<source>1.8</source>
144+
<target>1.8</target>
122145
<compilerArgument></compilerArgument>
123146
</configuration>
124147
</plugin>
125148

126149
<plugin>
127150
<groupId>org.apache.maven.plugins</groupId>
128151
<artifactId>maven-resources-plugin</artifactId>
129-
<version>2.7</version>
130152
<configuration>
131153
<encoding>UTF-8</encoding>
132154
</configuration>
@@ -135,7 +157,6 @@
135157
<plugin>
136158
<groupId>org.apache.maven.plugins</groupId>
137159
<artifactId>maven-source-plugin</artifactId>
138-
<version>2.4</version>
139160
<executions>
140161
<execution>
141162
<goals>
@@ -148,7 +169,6 @@
148169
<plugin>
149170
<groupId>org.apache.maven.plugins</groupId>
150171
<artifactId>maven-javadoc-plugin</artifactId>
151-
<version>2.9.1</version>
152172
<executions>
153173
<execution>
154174
<id>attach-javadocs</id>
@@ -165,7 +185,6 @@
165185

166186
<plugin>
167187
<artifactId>maven-surefire-plugin</artifactId>
168-
<version>2.19.1</version>
169188
<configuration>
170189
<includes>
171190
<include>**/*Test.java</include>
@@ -176,7 +195,6 @@
176195

177196
<plugin>
178197
<artifactId>maven-deploy-plugin</artifactId>
179-
<version>2.8.2</version>
180198
<configuration>
181199
<uniqueVersion>false</uniqueVersion>
182200
<retryFailedDeploymentCount>10</retryFailedDeploymentCount>
@@ -186,7 +204,6 @@
186204
<plugin>
187205
<groupId>org.apache.maven.plugins</groupId>
188206
<artifactId>maven-gpg-plugin</artifactId>
189-
<version>1.5</version>
190207
<executions>
191208
<execution>
192209
<id>sign-artifacts</id>
@@ -208,6 +225,19 @@
208225
<artifactId>httpclient</artifactId>
209226
<scope>provided</scope>
210227
</dependency>
228+
<dependency>
229+
<groupId>org.apache.httpcomponents</groupId>
230+
<artifactId>httpcore</artifactId>
231+
<scope>provided</scope>
232+
</dependency>
233+
<dependency>
234+
<groupId>commons-logging</groupId>
235+
<artifactId>commons-logging</artifactId>
236+
</dependency>
237+
<dependency>
238+
<groupId>commons-codec</groupId>
239+
<artifactId>commons-codec</artifactId>
240+
</dependency>
211241
<dependency>
212242
<groupId>com.arangodb</groupId>
213243
<artifactId>velocypack</artifactId>
@@ -221,7 +251,7 @@
221251
<artifactId>logback-classic</artifactId>
222252
<scope>test</scope>
223253
</dependency>
224-
<dependency>
254+
<dependency>
225255
<groupId>junit</groupId>
226256
<artifactId>junit</artifactId>
227257
<scope>test</scope>
@@ -240,6 +270,21 @@
240270
<artifactId>httpclient</artifactId>
241271
<version>${httpclient.version}</version>
242272
</dependency>
273+
<dependency>
274+
<groupId>org.apache.httpcomponents</groupId>
275+
<artifactId>httpcore</artifactId>
276+
<version>4.4.11</version>
277+
</dependency>
278+
<dependency>
279+
<groupId>commons-codec</groupId>
280+
<artifactId>commons-codec</artifactId>
281+
<version>1.11</version>
282+
</dependency>
283+
<dependency>
284+
<groupId>commons-logging</groupId>
285+
<artifactId>commons-logging</artifactId>
286+
<version>1.2</version>
287+
</dependency>
243288
<dependency>
244289
<groupId>com.arangodb</groupId>
245290
<artifactId>velocypack</artifactId>
@@ -255,7 +300,7 @@
255300
<artifactId>logback-classic</artifactId>
256301
<version>${logback-classic.version}</version>
257302
</dependency>
258-
<dependency>
303+
<dependency>
259304
<groupId>junit</groupId>
260305
<artifactId>junit</artifactId>
261306
<version>${junit.version}</version>

src/main/java/com/arangodb/ArangoCollection.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,6 @@ <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(
368368
* Documentation</a>
369369
* @param key
370370
* The key of the document
371-
* @param type
372-
* The type of the document (POJO class, VPackSlice or String for JSON). Only necessary if
373-
* options.returnOld is set to true, otherwise can be null.
374-
* @param options
375-
* Additional options, can be null
376371
* @return information about the document
377372
* @throws ArangoDBException
378373
*/
@@ -404,9 +399,6 @@ <T> DocumentDeleteEntity<T> deleteDocument(String key, Class<T> type, DocumentDe
404399
* Documentation</a>
405400
* @param values
406401
* The keys of the documents or the documents themselves
407-
* @param type
408-
* The type of the documents (POJO class, VPackSlice or String for JSON). Only necessary if
409-
* options.returnOld is set to true, otherwise can be null.
410402
* @return information about the documents
411403
* @throws ArangoDBException
412404
*/

src/main/java/com/arangodb/ArangoDB.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,9 +603,10 @@ public synchronized ArangoDB build() {
603603
final ArangoSerialization custom = customSerializer != null ? customSerializer : internal;
604604
final ArangoSerializationFactory util = new ArangoSerializationFactory(internal, custom);
605605

606-
final int max = maxConnections != null ? Math.max(1, maxConnections)
607-
: protocol == Protocol.VST ? ArangoDefaults.MAX_CONNECTIONS_VST_DEFAULT
608-
: ArangoDefaults.MAX_CONNECTIONS_HTTP_DEFAULT;
606+
int protocolMaxConnections = protocol == Protocol.VST ?
607+
ArangoDefaults.MAX_CONNECTIONS_VST_DEFAULT :
608+
ArangoDefaults.MAX_CONNECTIONS_HTTP_DEFAULT;
609+
final int max = maxConnections != null ? Math.max(1, maxConnections) : protocolMaxConnections;
609610

610611
final ConnectionFactory connectionFactory = (protocol == null || Protocol.VST == protocol)
611612
? new VstConnectionFactorySync(host, timeout, connectionTtl, useSsl, sslContext)
@@ -688,7 +689,7 @@ public synchronized ArangoDB build() {
688689
* Documentation</a>
689690
* @param user
690691
* The name of the user for which you want to query the databases
691-
* @return
692+
* @return list of database names which are available for the specified user
692693
* @throws ArangoDBException
693694
*/
694695
Collection<String> getAccessibleDatabasesFor(String user) throws ArangoDBException;

src/main/java/com/arangodb/ArangoDBException.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,26 +29,32 @@
2929
public class ArangoDBException extends RuntimeException {
3030

3131
private static final long serialVersionUID = 6165638002614173801L;
32-
private ErrorEntity entity = null;
33-
private Integer responseCode;
32+
private final ErrorEntity entity;
33+
private final Integer responseCode;
3434

3535
public ArangoDBException(final ErrorEntity errorEntity) {
3636
super(String.format("Response: %s, Error: %s - %s", errorEntity.getCode(), errorEntity.getErrorNum(),
3737
errorEntity.getErrorMessage()));
3838
this.entity = errorEntity;
39+
this.responseCode = null;
3940
}
4041

4142
public ArangoDBException(final String message) {
4243
super(message);
44+
this.entity = null;
45+
this.responseCode = null;
4346
}
4447

4548
public ArangoDBException(final String message, final Integer responseCode) {
4649
super(message);
50+
this.entity = null;
4751
this.responseCode = responseCode;
4852
}
4953

5054
public ArangoDBException(final Throwable cause) {
5155
super(cause);
56+
this.entity = null;
57+
this.responseCode = null;
5258
}
5359

5460
/**
@@ -69,7 +75,8 @@ public String getException() {
6975
* @return HTTP response code
7076
*/
7177
public Integer getResponseCode() {
72-
return responseCode != null ? responseCode : entity != null ? entity.getCode() : null;
78+
Integer entityResponseCode = entity != null ? entity.getCode() : null;
79+
return responseCode != null ? responseCode : entityResponseCode;
7380
}
7481

7582
/**

src/main/java/com/arangodb/ArangoEdgeCollection.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
109109
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
110110
* @param key
111111
* The key of the edge
112-
* @param type
112+
* @param <T>
113113
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
114114
* @return information about the edge
115115
* @throws ArangoDBException
@@ -123,7 +123,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
123123
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
124124
* @param key
125125
* The key of the edge
126-
* @param type
126+
* @param <T>
127127
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
128128
* @param options
129129
* Additional options, can be null
@@ -140,7 +140,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
140140
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
141141
* @param key
142142
* The key of the edge
143-
* @param type
143+
* @param <T>
144144
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
145145
* @return information about the edge
146146
* @throws ArangoDBException
@@ -155,7 +155,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
155155
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
156156
* @param key
157157
* The key of the edge
158-
* @param type
158+
* @param <T>
159159
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
160160
* @param options
161161
* Additional options, can be null

src/main/java/com/arangodb/ArangoGraph.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ public interface ArangoGraph extends ArangoSerializationAccessor {
3939
*
4040
* @return database handler
4141
*/
42-
public ArangoDatabase db();
42+
ArangoDatabase db();
4343

4444
/**
4545
* The name of the collection
4646
*
4747
* @return collection name
4848
*/
49-
public String name();
49+
String name();
5050

5151
/**
5252
* Checks whether the graph exists

src/main/java/com/arangodb/ArangoVertexCollection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public interface ArangoVertexCollection extends ArangoSerializationAccessor {
152152
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
153153
* @param key
154154
* The key of the vertex
155-
* @param type
155+
* @param <T>
156156
* The type of the vertex-document (POJO class, VPackSlice or String for JSON)
157157
* @return information about the vertex
158158
* @throws ArangoDBException
@@ -167,7 +167,7 @@ public interface ArangoVertexCollection extends ArangoSerializationAccessor {
167167
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
168168
* @param key
169169
* The key of the vertex
170-
* @param type
170+
* @param <T>
171171
* The type of the vertex-document (POJO class, VPackSlice or String for JSON)
172172
* @param options
173173
* Additional options, can be null

src/main/java/com/arangodb/ArangoView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ public interface ArangoView extends ArangoSerializationAccessor {
3636
*
3737
* @return database handler
3838
*/
39-
public ArangoDatabase db();
39+
ArangoDatabase db();
4040

4141
/**
4242
* The name of the view
4343
*
4444
* @return view name
4545
*/
46-
public String name();
46+
String name();
4747

4848
/**
4949
* Checks whether the view exists.

0 commit comments

Comments
 (0)