Skip to content

Commit 74f0821

Browse files
author
Achim Brandt
committed
Revert "fixed some sonarlint issues"
This reverts commit 8d16192.
1 parent 8d16192 commit 74f0821

31 files changed

+1008
-941
lines changed

src/main/java/com/arangodb/BaseArangoDriver.java

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -467,21 +467,4 @@ protected String createIndexEndpointUrl(String database, Object... paths) throws
467467
protected String createGharialEndpointUrl(String database, Object... paths) throws ArangoException {
468468
return createEndpointUrl(database, "/_api/gharial", paths);
469469
}
470-
471-
protected String createDocumentEndpointUrl(String database, Object... paths) throws ArangoException {
472-
return createEndpointUrl(database, "/_api/document", paths);
473-
}
474-
475-
protected String createDatabaseEndpointUrl(String database, Object... paths) throws ArangoException {
476-
return createEndpointUrl(database, "/_api/database", paths);
477-
}
478-
479-
protected String createCursorEndpointUrl(String database, Object... paths) throws ArangoException {
480-
return createEndpointUrl(database, "/_api/cursor", paths);
481-
}
482-
483-
protected String createCollectionEndpointUrl(String database, Object... paths) throws ArangoException {
484-
return createEndpointUrl(database, "/_api/collection", paths);
485-
}
486-
487470
}

src/main/java/com/arangodb/ErrorNums.java

Lines changed: 274 additions & 276 deletions
Large diffs are not rendered by default.

src/main/java/com/arangodb/entity/AqlFunctionsEntity.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public class AqlFunctionsEntity extends BaseEntity {
3131
*/
3232
Map<String, String> aqlFunctions;
3333

34+
public AqlFunctionsEntity() {
35+
}
36+
3437
AqlFunctionsEntity(Map<String, String> aqlfunctions) {
3538
this.aqlFunctions = aqlfunctions;
3639
}

src/main/java/com/arangodb/entity/BaseDocument.java

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,44 @@ public BaseDocument(String documentKey) {
6161
this.documentKey = documentKey;
6262
}
6363

64+
// /**
65+
// * @param keyValues a set of key/value pairs containing the attributes for
66+
// the document.
67+
// * The length has to be even and each even entry has to be of type String.
68+
// * If not an empty document will be created
69+
// */
70+
// public BaseDocument(Object ...keyValues) {
71+
// this(null, keyValues);
72+
// }
73+
//
74+
// /**
75+
// * create a BaseDocument with a given key and attributes defined in
76+
// keyValues
77+
// *
78+
// * @param documentKey the unique key of the document
79+
// * @param keyValues a set of key/value pairs containing the attributes for
80+
// the document.
81+
// * The length has to be even and each even entry has to be of type String.
82+
// * If not an empty document will be created
83+
// */
84+
// public BaseDocument(String documentKey, Object ...keyValues) {
85+
// this.init();
86+
// if (documentKey != null) {
87+
// this.documentKey = documentKey;
88+
// }
89+
// if (checkKeyValues(keyValues)) {
90+
// for (int i = 0; i < keyValues.length; i = i+2) {
91+
// if (keyValues[i] == REV) {
92+
// this.documentRevision = (Long) keyValues[i+1];
93+
// } else if (keyValues[i] == KEY && documentKey == null) {
94+
// this.documentKey = (String) keyValues[i+1];
95+
// } else {
96+
// this.addAttribute((String) keyValues[i], keyValues[i + 1]);
97+
// }
98+
// }
99+
// }
100+
// }
101+
64102
/**
65103
* create an BaseDocument with given attributes
66104
*
@@ -183,4 +221,23 @@ public String toString() {
183221
+ ", documentKey=" + documentKey + ", properties=" + properties + "]";
184222
}
185223

224+
// /**
225+
// * check the list if it is suitable
226+
// *
227+
// * @param keyValues
228+
// * @return true, if the list has an even number and is an alternating
229+
// sequence of instances of String and Object.
230+
// */
231+
// private boolean checkKeyValues(Object... keyValues) {
232+
// if (keyValues.length %2 != 0) {
233+
// return false;
234+
// }
235+
// for (int i = 0; i < keyValues.length; i = i+2) {
236+
// if (! (keyValues[i] instanceof String)) {
237+
// return false;
238+
// }
239+
// }
240+
// return true;
241+
// }
242+
186243
}

src/main/java/com/arangodb/entity/BaseEntity.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public abstract class BaseEntity implements Serializable {
7474
* @return boolean
7575
*/
7676
public boolean isNotModified() {
77-
return statusCode == 304;
77+
return statusCode == 304; // HttpStatus.SC_NOT_MODIFIED;
7878
}
7979

8080
/**
@@ -86,6 +86,15 @@ public boolean isUnauthorized() {
8686
return statusCode == 401;
8787
}
8888

89+
// /**
90+
// * If the requested resource has not been modified it returns true
91+
// *
92+
// * @return boolean
93+
// */
94+
// public boolean isNotFound() {
95+
// return statusCode == 404;
96+
// }
97+
8998
/**
9099
* If this is the response of a batch request it returns true
91100
*

src/main/java/com/arangodb/entity/BaseMapEntity.java

Lines changed: 49 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -30,66 +30,54 @@
3030
*/
3131
public abstract class BaseMapEntity<K, V> extends BaseEntity implements Map<K, V> {
3232

33-
private final TreeMap<K, V> innerMap = new TreeMap<K, V>();
34-
35-
@Override
36-
public int size() {
37-
return innerMap.size();
38-
}
39-
40-
@Override
41-
public boolean isEmpty() {
42-
return innerMap.isEmpty();
43-
}
44-
45-
@Override
46-
public boolean containsKey(Object key) {
47-
return innerMap.containsKey(key);
48-
}
49-
50-
@Override
51-
public boolean containsValue(Object value) {
52-
return innerMap.containsValue(value);
53-
}
54-
55-
@Override
56-
public V get(Object key) {
57-
return innerMap.get(key);
58-
}
59-
60-
@Override
61-
public V put(K key, V value) {
62-
return innerMap.put(key, value);
63-
}
64-
65-
@Override
66-
public V remove(Object key) {
67-
return innerMap.remove(key);
68-
}
69-
70-
@Override
71-
public void putAll(Map<? extends K, ? extends V> t) {
72-
innerMap.putAll(t);
73-
}
74-
75-
@Override
76-
public void clear() {
77-
innerMap.clear();
78-
}
79-
80-
@Override
81-
public Set<K> keySet() {
82-
return innerMap.keySet();
83-
}
84-
85-
@Override
86-
public Collection<V> values() {
87-
return innerMap.values();
88-
}
89-
90-
@Override
91-
public Set<java.util.Map.Entry<K, V>> entrySet() {
92-
return innerMap.entrySet();
93-
}
33+
private final TreeMap<K, V> innerMap = new TreeMap<K, V>();
9434

35+
public int size() {
36+
return innerMap.size();
37+
}
38+
39+
public boolean isEmpty() {
40+
return innerMap.isEmpty();
41+
}
42+
43+
public boolean containsKey(Object key) {
44+
return innerMap.containsKey(key);
45+
}
46+
47+
public boolean containsValue(Object value) {
48+
return innerMap.containsValue(value);
49+
}
50+
51+
public V get(Object key) {
52+
return innerMap.get(key);
53+
}
54+
55+
public V put(K key, V value) {
56+
return innerMap.put(key, value);
57+
}
58+
59+
public V remove(Object key) {
60+
return innerMap.remove(key);
61+
}
62+
63+
public void putAll(Map<? extends K, ? extends V> t) {
64+
innerMap.putAll(t);
65+
}
66+
67+
public void clear() {
68+
innerMap.clear();
69+
}
70+
71+
public Set<K> keySet() {
72+
return innerMap.keySet();
73+
}
74+
75+
public Collection<V> values() {
76+
return innerMap.values();
77+
}
78+
79+
public Set<java.util.Map.Entry<K, V>> entrySet() {
80+
return innerMap.entrySet();
81+
}
82+
9583
}

src/main/java/com/arangodb/entity/BatchResponseEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public class BatchResponseEntity extends BaseEntity {
3131
* The context of the function call, this is used to to process the server
3232
* response to an api entity.
3333
*/
34-
private InvocationObject invocationObject;
34+
InvocationObject invocationObject;
3535

3636
/**
3737
* The http response of the batch part.
3838
*/
39-
private HttpResponseEntity httpResponseEntity;
39+
public HttpResponseEntity httpResponseEntity;
4040

4141
public BatchResponseEntity(InvocationObject invocationObject) {
4242
this.invocationObject = invocationObject;

src/main/java/com/arangodb/entity/CollectionOptions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ public class CollectionOptions {
6767
*/
6868
private List<String> shardKeys;
6969

70+
public CollectionOptions() {
71+
}
72+
7073
public Boolean getWaitForSync() {
7174
return waitForSync;
7275
}

src/main/java/com/arangodb/entity/CollectionStatus.java

Lines changed: 42 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -27,54 +27,46 @@
2727
*/
2828
public enum CollectionStatus {
2929

30-
/**
31-
* initial state of a new collection
32-
*/
33-
NEW_BORN_COLLECTION(1),
34-
35-
/**
36-
* collection is not in memory
37-
*/
38-
UNLOADED(2),
39-
40-
/**
41-
* collection is in memory
42-
*/
43-
LOADED(3),
44-
45-
/**
46-
* temporary state of a collection in the process of being unloaded
47-
*/
48-
IN_THE_PROCESS_OF_BEING_UNLOADED(4),
49-
50-
/**
51-
* deleted state
52-
*/
53-
DELETED(5);
54-
55-
private static class Holder implements Serializable {
56-
57-
private static final long serialVersionUID = -7016368432042468015L;
58-
59-
private static TreeMap<Integer, CollectionStatus> lookupMap = new TreeMap<Integer, CollectionStatus>();
60-
61-
private Holder() {
62-
// this is a helper class
63-
}
64-
}
65-
66-
private final int status;
67-
68-
private CollectionStatus(int status) {
69-
this.status = status;
70-
Holder.lookupMap.put(status, this);
71-
}
72-
73-
public int status() {
74-
return status;
75-
}
76-
77-
public static CollectionStatus valueOf(int status) {
78-
return Holder.lookupMap.get(status);
79-
}
30+
/**
31+
* initial state of a new collection
32+
*/
33+
NEW_BORN_COLLECTION(1),
34+
35+
/**
36+
* collection is not in memory
37+
*/
38+
UNLOADED(2),
39+
40+
/**
41+
* collection is in memory
42+
*/
43+
LOADED(3),
44+
45+
/**
46+
* temporary state of a collection in the process of being unloaded
47+
*/
48+
IN_THE_PROCESS_OF_BEING_UNLOADED(4),
49+
50+
/**
51+
* deleted state
52+
*/
53+
DELETED(5)
54+
;
55+
56+
private static class Holder implements Serializable {
57+
private static final long serialVersionUID = -7016368432042468015L;
58+
private static TreeMap<Integer, CollectionStatus> lookupMap = new TreeMap<Integer, CollectionStatus>();
59+
}
60+
61+
private final int status;
62+
private CollectionStatus(int status) {
63+
this.status = status;
64+
Holder.lookupMap.put(status, this);
65+
}
66+
public int status() {
67+
return status;
68+
}
69+
public static CollectionStatus valueOf(int status) {
70+
return Holder.lookupMap.get(status);
71+
}
8072
}

0 commit comments

Comments
 (0)