diff options
author | William Reehil <william.reehil@att.com> | 2022-11-11 13:37:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2022-11-11 13:37:39 +0000 |
commit | 72b44a38290334c46a9dedc0be1dadcd08520515 (patch) | |
tree | 4ea0ae01f4dabf1b9781779b5fea790f9c2c03ba /aai-core/src/main/java | |
parent | 131345b4ef18b8dc2c346c6af59f90f0d3fde431 (diff) | |
parent | 2c9ee21f2cf8fc230decfc48e3f652fe11862216 (diff) |
Merge "Reduce the number of raw-type related warnings in aai-common"
Diffstat (limited to 'aai-core/src/main/java')
14 files changed, 40 insertions, 28 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 2676d19d..496c1e82 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 @@ -151,7 +151,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 187db197..3c5c4489 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 @@ -909,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 9f599eb9..2192ff5e 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 3706da0d..71f7bc78 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 @@ -202,7 +202,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 e03620ba..c0ba860f 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 @@ -104,7 +104,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 4443ade8..02c4041f 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 @@ -92,10 +92,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 657dd89b..1caa7b50 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 @@ -78,7 +78,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 4b8229fa..0da0ec55 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 @@ -183,9 +183,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 379b31f3..1b050829 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 @@ -257,7 +257,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); |