Skip to content

code-style refactoring, fix Javadoc warnings #248

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 6 commits into from
May 10, 2019
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
77 changes: 61 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -26,7 +27,7 @@
<arangodb.velocypack.version>1.4.1</arangodb.velocypack.version>

<!-- provided -->
<httpclient.version>4.5.1</httpclient.version>
<httpclient.version>4.5.7</httpclient.version>

<!-- test -->
<logback-classic.version>1.1.3</logback-classic.version>
Expand Down Expand Up @@ -67,17 +68,41 @@
<jdk>[1.8,)</jdk>
</activation>
<properties>
<javadoc.opts>-Xdoclint:none</javadoc.opts>
<doclint>none</doclint>
</properties>
</profile>
</profiles>

<build>
<plugins>

<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.0.0-M2</version>
<executions>
<execution>
<id>enforce-maven-3</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.0.5</version>
</requireMavenVersion>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.5</version>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
Expand All @@ -90,7 +115,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>assembly</id>
Expand All @@ -115,18 +139,16 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.8</source>
<target>1.8</target>
<compilerArgument></compilerArgument>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
Expand All @@ -135,7 +157,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<goals>
Expand All @@ -148,7 +169,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
Expand All @@ -165,7 +185,6 @@

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<includes>
<include>**/*Test.java</include>
Expand All @@ -176,7 +195,6 @@

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<uniqueVersion>false</uniqueVersion>
<retryFailedDeploymentCount>10</retryFailedDeploymentCount>
Expand All @@ -186,7 +204,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
Expand All @@ -208,6 +225,19 @@
<artifactId>httpclient</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>velocypack</artifactId>
Expand All @@ -221,7 +251,7 @@
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
Expand All @@ -240,6 +270,21 @@
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.11</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>velocypack</artifactId>
Expand All @@ -255,7 +300,7 @@
<artifactId>logback-classic</artifactId>
<version>${logback-classic.version}</version>
</dependency>
<dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/com/arangodb/ArangoCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,6 @@ <T> MultiDocumentEntity<DocumentUpdateEntity<T>> updateDocuments(
* Documentation</a>
* @param key
* The key of the document
* @param type
* The type of the document (POJO class, VPackSlice or String for JSON). Only necessary if
* options.returnOld is set to true, otherwise can be null.
* @param options
* Additional options, can be null
* @return information about the document
* @throws ArangoDBException
*/
Expand Down Expand Up @@ -404,9 +399,6 @@ <T> DocumentDeleteEntity<T> deleteDocument(String key, Class<T> type, DocumentDe
* Documentation</a>
* @param values
* The keys of the documents or the documents themselves
* @param type
* The type of the documents (POJO class, VPackSlice or String for JSON). Only necessary if
* options.returnOld is set to true, otherwise can be null.
* @return information about the documents
* @throws ArangoDBException
*/
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/arangodb/ArangoDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,10 @@ public synchronized ArangoDB build() {
final ArangoSerialization custom = customSerializer != null ? customSerializer : internal;
final ArangoSerializationFactory util = new ArangoSerializationFactory(internal, custom);

final int max = maxConnections != null ? Math.max(1, maxConnections)
: protocol == Protocol.VST ? ArangoDefaults.MAX_CONNECTIONS_VST_DEFAULT
: ArangoDefaults.MAX_CONNECTIONS_HTTP_DEFAULT;
int protocolMaxConnections = protocol == Protocol.VST ?
ArangoDefaults.MAX_CONNECTIONS_VST_DEFAULT :
ArangoDefaults.MAX_CONNECTIONS_HTTP_DEFAULT;
final int max = maxConnections != null ? Math.max(1, maxConnections) : protocolMaxConnections;

final ConnectionFactory connectionFactory = (protocol == null || Protocol.VST == protocol)
? new VstConnectionFactorySync(host, timeout, connectionTtl, useSsl, sslContext)
Expand Down Expand Up @@ -688,7 +689,7 @@ public synchronized ArangoDB build() {
* Documentation</a>
* @param user
* The name of the user for which you want to query the databases
* @return
* @return list of database names which are available for the specified user
* @throws ArangoDBException
*/
Collection<String> getAccessibleDatabasesFor(String user) throws ArangoDBException;
Expand Down
13 changes: 10 additions & 3 deletions src/main/java/com/arangodb/ArangoDBException.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,32 @@
public class ArangoDBException extends RuntimeException {

private static final long serialVersionUID = 6165638002614173801L;
private ErrorEntity entity = null;
private Integer responseCode;
private final ErrorEntity entity;
private final Integer responseCode;

public ArangoDBException(final ErrorEntity errorEntity) {
super(String.format("Response: %s, Error: %s - %s", errorEntity.getCode(), errorEntity.getErrorNum(),
errorEntity.getErrorMessage()));
this.entity = errorEntity;
this.responseCode = null;
}

public ArangoDBException(final String message) {
super(message);
this.entity = null;
this.responseCode = null;
}

public ArangoDBException(final String message, final Integer responseCode) {
super(message);
this.entity = null;
this.responseCode = responseCode;
}

public ArangoDBException(final Throwable cause) {
super(cause);
this.entity = null;
this.responseCode = null;
}

/**
Expand All @@ -69,7 +75,8 @@ public String getException() {
* @return HTTP response code
*/
public Integer getResponseCode() {
return responseCode != null ? responseCode : entity != null ? entity.getCode() : null;
Integer entityResponseCode = entity != null ? entity.getCode() : null;
return responseCode != null ? responseCode : entityResponseCode;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/arangodb/ArangoEdgeCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
* @param key
* The key of the edge
* @param type
* @param <T>
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
* @return information about the edge
* @throws ArangoDBException
Expand All @@ -123,7 +123,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#replace-an-edge">API Documentation</a>
* @param key
* The key of the edge
* @param type
* @param <T>
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
* @param options
* Additional options, can be null
Expand All @@ -140,7 +140,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
* @param key
* The key of the edge
* @param type
* @param <T>
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
* @return information about the edge
* @throws ArangoDBException
Expand All @@ -155,7 +155,7 @@ public interface ArangoEdgeCollection extends ArangoSerializationAccessor {
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Edges.html#modify-an-edge">API Documentation</a>
* @param key
* The key of the edge
* @param type
* @param <T>
* The type of the edge-document (POJO class, VPackSlice or String for JSON)
* @param options
* Additional options, can be null
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/arangodb/ArangoGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@ public interface ArangoGraph extends ArangoSerializationAccessor {
*
* @return database handler
*/
public ArangoDatabase db();
ArangoDatabase db();

/**
* The name of the collection
*
* @return collection name
*/
public String name();
String name();

/**
* Checks whether the graph exists
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/arangodb/ArangoVertexCollection.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public interface ArangoVertexCollection extends ArangoSerializationAccessor {
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
* @param key
* The key of the vertex
* @param type
* @param <T>
* The type of the vertex-document (POJO class, VPackSlice or String for JSON)
* @return information about the vertex
* @throws ArangoDBException
Expand All @@ -167,7 +167,7 @@ public interface ArangoVertexCollection extends ArangoSerializationAccessor {
* @see <a href="https://docs.arangodb.com/current/HTTP/Gharial/Vertices.html#modify-a-vertex">API Documentation</a>
* @param key
* The key of the vertex
* @param type
* @param <T>
* The type of the vertex-document (POJO class, VPackSlice or String for JSON)
* @param options
* Additional options, can be null
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/arangodb/ArangoView.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public interface ArangoView extends ArangoSerializationAccessor {
*
* @return database handler
*/
public ArangoDatabase db();
ArangoDatabase db();

/**
* The name of the view
*
* @return view name
*/
public String name();
String name();

/**
* Checks whether the view exists.
Expand Down
Loading