summaryrefslogtreecommitdiffstats
path: root/aai-core/src/main
diff options
context:
space:
mode:
authorFiete Ostkamp <Fiete.Ostkamp@telekom.de>2022-11-09 12:41:32 +0000
committerFiete Ostkamp <Fiete.Ostkamp@telekom.de>2022-11-09 15:58:51 +0000
commit2c9ee21f2cf8fc230decfc48e3f652fe11862216 (patch)
treeadbae7caa43364c0003cafdf668e1446266333b5 /aai-core/src/main
parentfbb02159b84435cf37221ae8ae5e0045167be15a (diff)
Reduce the number of raw-type related warnings in aai-common
Issue-ID: AAI-3586 Signed-off-by: Fiete Ostkamp <Fiete.Ostkamp@telekom.de> Change-Id: If4affb02cfe40b4b82ecbdbb1a25d919d88be25c
Diffstat (limited to 'aai-core/src/main')
-rw-r--r--aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java19
-rw-r--r--aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java8
-rw-r--r--aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java4
-rw-r--r--aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java9
-rw-r--r--aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java10
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java16
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java10
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java2
-rw-r--r--aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java11
-rw-r--r--aai-core/src/main/java/org/onap/aai/util/RestController.java2
14 files changed, 66 insertions, 33 deletions
diff --git a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java
index 2858ece3..d3addebb 100644
--- a/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java
+++ b/aai-core/src/main/java/org/onap/aai/dmaap/AAIDmaapEventJMSConsumer.java
@@ -119,7 +119,7 @@ public class AAIDmaapEventJMSConsumer implements MessageListener {
}
metricLog.pre(eventName, aaiEvent, transactionId, serviceName);
- HttpEntity httpEntity = new HttpEntity(aaiEvent, httpHeaders);
+ HttpEntity<String> httpEntity = new HttpEntity<String>(aaiEvent, httpHeaders);
String transportType = environment.getProperty("dmaap.ribbon.transportType", "http");
String baseUrl = transportType + "://" + environment.getProperty("dmaap.ribbon.listOfServers");
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
index 40352360..02288c35 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/JSONStrategy.java
@@ -150,7 +150,7 @@ public class JSONStrategy extends Introspector {
Class<?> resultClass = null;
Object resultObject = this.getValue(name);
if (resultObject instanceof JSONArray) {
- resultClass = ((List) resultObject).get(0).getClass();
+ resultClass = ((List<?>) resultObject).get(0).getClass();
}
return resultClass;
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java b/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
index df8e9238..55980c3b 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/MoxyStrategy.java
@@ -25,8 +25,15 @@ import com.google.common.base.Joiner;
import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Set;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
@@ -170,12 +177,12 @@ public class MoxyStrategy extends Introspector {
DatabaseMapping mapping = cd.getMappingForAttributeName(propName);
Map<PropertyMetadata, String> result = new HashMap<>();
if (mapping != null) {
- Set<Entry> entrySet = mapping.getProperties().entrySet();
- for (Entry<?, ?> entry : entrySet) {
+ Set<Map.Entry<String, String>> entrySet = mapping.getProperties().entrySet();
+ for (Entry<String, String> entry : entrySet) {
result.put(
- PropertyMetadata.valueOf(
- CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, (String) entry.getKey())),
- (String) entry.getValue());
+ PropertyMetadata
+ .valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, entry.getKey())),
+ entry.getValue());
}
}
diff --git a/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java b/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java
index 9e32ef40..e58ff9bc 100644
--- a/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java
+++ b/aai-core/src/main/java/org/onap/aai/introspection/sideeffect/PrivateEdge.java
@@ -25,8 +25,12 @@ import com.google.common.collect.Multimap;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Optional;
import javax.ws.rs.core.MultivaluedMap;
@@ -92,7 +96,7 @@ public class PrivateEdge extends SideEffect {
List<Vertex> results = uriQuery.getQueryBuilder().toList();
if (results.size() == 1) {
Vertex otherVertex = results.get(0);
- VertexProperty otherVProperty = otherVertex.property("aai-node-type");
+ VertexProperty<Object> otherVProperty = otherVertex.property("aai-node-type");
if (otherVProperty.isPresent()) {
diff --git a/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java b/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java
index c66511f0..70e16e27 100644
--- a/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java
+++ b/aai-core/src/main/java/org/onap/aai/prevalidation/ValidationService.java
@@ -222,7 +222,7 @@ public class ValidationService {
httpHeaders.put("Content-Type", "application/json");
List<String> violations = new ArrayList<>();
- ResponseEntity responseEntity;
+ ResponseEntity<String> responseEntity;
try {
responseEntity = validationRestClient.execute(VALIDATION_ENDPOINT, HttpMethod.POST, httpHeaders, body);
@@ -267,7 +267,7 @@ public class ValidationService {
return violations;
}
- boolean isSuccess(ResponseEntity responseEntity) {
+ boolean isSuccess(ResponseEntity<String> responseEntity) {
return responseEntity != null && responseEntity.getStatusCode().is2xxSuccessful();
}
diff --git a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java
index 2517e2c0..312be4f9 100644
--- a/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java
+++ b/aai-core/src/main/java/org/onap/aai/query/builder/GraphTraversalBuilder.java
@@ -23,7 +23,12 @@ package org.onap.aai.query.builder;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
import org.apache.tinkerpop.gremlin.process.traversal.P;
import org.apache.tinkerpop.gremlin.process.traversal.Path;
@@ -904,7 +909,7 @@ public abstract class GraphTraversalBuilder<E> extends QueryBuilder<E> {
protected void executeQuery() {
- Admin admin;
+ Admin<Vertex, Vertex> admin;
if (start != null) {
this.completeTraversal = traversal.asAdmin();
} else {
diff --git a/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java b/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java
index 3666eb67..31805fd4 100644
--- a/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java
+++ b/aai-core/src/main/java/org/onap/aai/restcore/RESTAPI.java
@@ -341,7 +341,7 @@ public class RESTAPI {
* @return the response
*/
public Response runner(String toe, String tba, String tdl, HttpHeaders headers, UriInfo info, HttpMethod httpMethod,
- Callable c) {
+ Callable<Response> c) {
Response response = null;
Future<Response> handler = null;
ExecutorService executor = null;
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
index dc478337..3be88df6 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/db/DBSerializer.java
@@ -723,7 +723,7 @@ public class DBSerializer {
throws IllegalArgumentException, SecurityException, UnsupportedEncodingException, AAIException {
HashMap<String, Introspector> relatedVertices = new HashMap<>();
- VertexProperty aaiUriProperty = v.property(AAIProperties.AAI_URI);
+ VertexProperty<Object> aaiUriProperty = v.property(AAIProperties.AAI_URI);
if (!aaiUriProperty.isPresent()) {
if (LOGGER.isDebugEnabled()) {
@@ -1232,7 +1232,7 @@ public class DBSerializer {
throw new AAIException("AAI_6136",
"query object mismatch: this object cannot hold multiple items." + obj.getDbName());
} else if (obj.isContainer()) {
- final List getList;
+ final List<Object> getList;
String listProperty = null;
for (String property : obj.getProperties()) {
if (obj.isListType(property) && obj.isComplexGenericType(property)) {
@@ -1565,7 +1565,7 @@ public class DBSerializer {
throws UnsupportedEncodingException, AAIException {
List<Object> relationshipObjList = obj.getValue(RELATIONSHIP);
- VertexProperty nodeTypeProperty = v.property(AAIProperties.NODE_TYPE);
+ VertexProperty<Object> nodeTypeProperty = v.property(AAIProperties.NODE_TYPE);
if (!nodeTypeProperty.isPresent()) {
LOGGER.warn("Not processing the vertex {} because its missing required property aai-node-type", v.id());
@@ -1651,7 +1651,7 @@ public class DBSerializer {
private Object processEdgeRelationship(Introspector relationshipObj, Vertex cousin, String cleanUp,
String edgeLabel, boolean isSkipRelatedTo) throws UnsupportedEncodingException, AAIUnknownObjectException {
- VertexProperty aaiUriProperty = cousin.property("aai-uri");
+ VertexProperty<Object> aaiUriProperty = cousin.property("aai-uri");
if (!aaiUriProperty.isPresent()) {
return null;
@@ -1670,7 +1670,7 @@ public class DBSerializer {
return null;
}
- VertexProperty cousinVertexNodeType = cousin.property(AAIProperties.NODE_TYPE);
+ VertexProperty<Object> cousinVertexNodeType = cousin.property(AAIProperties.NODE_TYPE);
if (cousinVertexNodeType.isPresent()) {
String cousinType = cousinVertexNodeType.value().toString();
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java
index 28362826..457c0b8b 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/Aggregate.java
@@ -20,10 +20,19 @@
package org.onap.aai.serialization.queryformats;
-import com.google.gson.*;
+import com.google.gson.Gson;
+import com.google.gson.JsonArray;
+import com.google.gson.JsonObject;
+import com.google.gson.JsonParser;
import java.io.UnsupportedEncodingException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -194,7 +203,8 @@ public class Aggregate extends MultiFormatMapper {
return Optional.of(json);
}
- private Optional<JsonArray> processInput(Object input, Map properties) throws AAIFormatVertexException {
+ private Optional<JsonArray> processInput(Object input, Map<String, List<String>> properties)
+ throws AAIFormatVertexException {
JsonArray json = new JsonArray();
for (Object l : (ArrayList) input) {
if (l instanceof ArrayList) {
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java
index fc3316d4..e73b9902 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/GraphSON.java
@@ -105,7 +105,7 @@ public class GraphSON implements FormatMapper {
*/
private void removePrivateEdges(JsonObject jsonObject, JsonObject edges, String edgeDirection) {
- Iterator it = edges.entrySet().iterator();
+ Iterator<Map.Entry<String, JsonElement>> it = edges.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, JsonElement> outEntry = (Map.Entry<String, JsonElement>) it.next();
JsonArray edgePropertiesArray = outEntry.getValue().getAsJsonArray();
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java
index fccc17c6..5d583c56 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/HistoryFormat.java
@@ -31,7 +31,11 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import org.apache.tinkerpop.gremlin.structure.*;
+import org.apache.tinkerpop.gremlin.structure.Direction;
+import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Property;
+import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.onap.aai.db.props.AAIProperties;
import org.onap.aai.introspection.Loader;
import org.onap.aai.serialization.db.DBSerializer;
@@ -90,10 +94,10 @@ public abstract class HistoryFormat extends MultiFormatMapper {
protected JsonObject createMetaPropertiesObject(VertexProperty<Object> prop) {
JsonObject json = new JsonObject();
- Iterator iter = prop.properties();
+ Iterator<Property<Object>> iter = prop.properties();
while (iter.hasNext()) {
- Property<Object> metaProp = (Property) iter.next();
+ Property<Object> metaProp = iter.next();
mapPropertyValues(json, metaProp.key(), metaProp.value());
}
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java
index f1d1c26e..ea4cd1c4 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/SimpleFormat.java
@@ -77,7 +77,7 @@ public class SimpleFormat extends RawFormat {
@Override
protected void addEdge(Edge e, Vertex v, JsonArray array) throws AAIFormatVertexException {
- Property property = e.property("private");
+ Property<Object> property = e.property("private");
if (property.isPresent()) {
if ("true".equals(e.property("private").value().toString())) {
diff --git a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java
index 2e1cbf6e..d8167308 100644
--- a/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java
+++ b/aai-core/src/main/java/org/onap/aai/serialization/queryformats/TreeFormat.java
@@ -28,8 +28,11 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.UnsupportedEncodingException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
import java.util.Map.Entry;
+import java.util.Optional;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
@@ -181,9 +184,9 @@ public class TreeFormat extends MultiFormatMapper {
// DSL Query
if (o instanceof BulkSet) {
- BulkSet bs = (BulkSet) o;
- for (Object o1 : bs) {
- Optional<JsonObject> obj = this.getJsonFromVertex((Vertex) o1);
+ BulkSet<Vertex> bs = (BulkSet<Vertex>) o;
+ for (Vertex o1 : bs) {
+ Optional<JsonObject> obj = this.getJsonFromVertex(o1);
if (obj.isPresent()) {
jsonObject = obj.get();
for (Map.Entry<String, JsonElement> mapEntry : jsonObject.entrySet()) {
diff --git a/aai-core/src/main/java/org/onap/aai/util/RestController.java b/aai-core/src/main/java/org/onap/aai/util/RestController.java
index 6c57040d..18a85e4d 100644
--- a/aai-core/src/main/java/org/onap/aai/util/RestController.java
+++ b/aai-core/src/main/java/org/onap/aai/util/RestController.java
@@ -256,7 +256,7 @@ public class RestController implements RestControllerInterface {
* @return the list
* @throws Exception the exception
*/
- private <T> List<T> mapJsonToObjectList(T typeDef, String json, Class clazz) throws Exception {
+ private <T> List<T> mapJsonToObjectList(T typeDef, String json, Class<?> clazz) throws Exception {
List<T> list;
ObjectMapper mapper = new ObjectMapper();
System.out.println(json);