Fix/Ignore raw type warnings after Phosphorus bump 08/97308/9
authorguillaume.lambert <guillaume.lambert@orange.com>
Tue, 24 Aug 2021 10:04:49 +0000 (12:04 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Mon, 13 Sep 2021 15:33:23 +0000 (15:33 +0000)
JIRA: TRNSPRTPCE-435
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I45ca9d8f3abceee8e53d5e90fd97f07299b6687d

common/src/main/java/org/opendaylight/transportpce/common/mapping/PortMappingVersion710.java
common/src/test/java/org/opendaylight/transportpce/common/NodeIdPairTest.java
common/src/test/java/org/opendaylight/transportpce/common/crossconnect/CrossConnectImpl221Test.java
olm/src/test/java/org/opendaylight/transportpce/olm/util/OlmTransactionUtils.java
olm/src/test/java/org/opendaylight/transportpce/olm/util/TransactionUtils.java
pce/src/test/java/org/opendaylight/transportpce/pce/utils/TransactionUtils.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRendererServiceImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/OtnDeviceRendererServiceImpl.java
renderer/src/test/java/org/opendaylight/transportpce/renderer/utils/TransactionUtils.java
test-common/src/main/java/org/opendaylight/transportpce/test/utils/TopologyDataUtils.java

index f7991a00deab0c718fd061b76d79537ec45be9c8..3c9f4ca9ee57cd8e497f5560231a13c70f9a143f 100644 (file)
@@ -244,7 +244,8 @@ public class PortMappingVersion710 {
         OduSwitchingPools osp = deviceTransactionManager.getDataFromDevice(nodeId, LogicalDatastoreType.OPERATIONAL,
             ospIID, Timeouts.DEVICE_READ_TIMEOUT, Timeouts.DEVICE_READ_TIMEOUT_UNIT).get();
         Uint16 ospNumber = osp.getSwitchingPoolNumber();
-        Map<SwitchingPoolLcpKey, SwitchingPoolLcp> splMap = new HashMap(portmappingNode.nonnullSwitchingPoolLcp());
+        Map<SwitchingPoolLcpKey, SwitchingPoolLcp> splMap =
+            new HashMap<SwitchingPoolLcpKey, SwitchingPoolLcp>(portmappingNode.nonnullSwitchingPoolLcp());
         SwitchingPoolLcpBuilder splBldr = splMap.containsKey(new SwitchingPoolLcpKey(ospNumber))
             ? new SwitchingPoolLcpBuilder(splMap.get(new SwitchingPoolLcpKey(ospNumber)))
             : new SwitchingPoolLcpBuilder().setSwitchingPoolNumber(ospNumber)
index 97c2180999c151ac21fccbdcabb2dcaeb5a29bea..bc02b76c9928de7501c0d44ea75d0a86f14c06a5 100644 (file)
@@ -29,7 +29,7 @@ public class NodeIdPairTest {
     }
 
     @Parameterized.Parameters
-    public static Collection nodes() {
+    public static Collection<?> nodes() {
         NodeIdPair same = new NodeIdPair("nodeS", "CLIENT");
         return Arrays.asList(new Object[][] {
                 { new NodeIdPair("",""), null, false },
index 312802f2ece17300d50e25511f6f08e58bbbbb7e..dc745332179f820afcb93979eeead66acb977906 100644 (file)
@@ -87,7 +87,7 @@ public class CrossConnectImpl221Test {
         spectrumInformation.setWaveLength(Uint32.valueOf(1));
         spectrumInformation.setLowerSpectralSlotNumber(761);
         spectrumInformation.setHigherSpectralSlotNumber(768);
-        Optional res = crossConnectImpl221.postCrossConnect("deviceId", "srcTp", "destTp", spectrumInformation);
+        Optional<String> res = crossConnectImpl221.postCrossConnect("deviceId", "srcTp", "destTp", spectrumInformation);
         Assert.assertEquals(res.get(), "srcTp-destTp-761:768");
     }
 
@@ -116,7 +116,7 @@ public class CrossConnectImpl221Test {
         Mockito.when(nodes.getNodeId()).thenReturn("nodeId");
         Mockito.when(deviceTransactionManager.getDeviceTransaction(any()))
             .thenReturn(CompletableFuture.completedFuture(Optional.of(mock(DeviceTransaction.class))));
-        Optional res = crossConnectImpl221.postOtnCrossConnect(List.of("src1", "src2"), nodes);
+        Optional<String> res = crossConnectImpl221.postOtnCrossConnect(List.of("src1", "src2"), nodes);
         Assert.assertTrue("Optional value should have a value", res.isPresent());
     }
 
index 90c35afa5e43eaadf65b33cc18eb4faafd8184d2..3891ce8d26b0c1d78cc79e54ea25569a62d5dd89 100644 (file)
@@ -81,7 +81,10 @@ public final class OlmTransactionUtils {
     private OlmTransactionUtils() {
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked","rawtypes"})
+    // FIXME check if the InstanceIdentifier raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     public static void writeTransaction(DataBroker dataBroker, InstanceIdentifier instanceIdentifier,
                                         DataObject object) {
         @NonNull
index d924cac0d6d8302b23d9c7a5a9ba8a70de6fd0ea..36ffb7d321cb28d9c545a0b53391eb2f5e024096 100644 (file)
@@ -75,7 +75,10 @@ public final class TransactionUtils {
 
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked","rawtypes"})
+    // FIXME check if the InstanceIdentifier raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     public static boolean writeTransaction(DataBroker dataBroker, InstanceIdentifier instanceIdentifier,
         DataObject object) {
         ReadWriteTransaction transaction = dataBroker.newReadWriteTransaction();
index e88bb9826cfdba789a6414cd5a9c04c49a6a5e7d..ba9bf0892c05b47236a4e178336f7439bf88ccb8 100644 (file)
@@ -84,7 +84,10 @@ public final class TransactionUtils {
     private TransactionUtils() {
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked","rawtypes"})
+    // FIXME check if the InstanceIdentifier raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     public static void writeTransaction(DataBroker dataBroker, InstanceIdentifier instanceIdentifier,
                                         DataObject object) {
         @NonNull
index 4bd53f81c22eeb470f3c8fc3b0b37325bc4b1bc6..8c5ca1275c966b77958243475d1d4e71c5d9ddee 100644 (file)
@@ -102,6 +102,10 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
         this.networkModelService = networkModelService;
     }
 
+    @SuppressWarnings("rawtypes")
+    // FIXME check if the ForkJoinTask raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     @Override
     public ServicePathOutput setupServicePath(ServicePathInput input, ServicePathDirection direction) {
         LOG.info("setup service path for input {} and direction {}", input, direction);
@@ -281,6 +285,10 @@ public class DeviceRendererServiceImpl implements DeviceRendererService {
         return messages;
     }
 
+    @SuppressWarnings("rawtypes")
+    // FIXME check if the ForkJoinTask raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     @Override
     public ServicePathOutput deleteServicePath(ServicePathInput input) {
         if (!alarmSuppressionNodeRegistration(input)) {
index 241ea4cb72708e9074343dbc7d1a854e5697b049..69266d599ce43a40a40c2f6aa22ce685a410920a 100644 (file)
@@ -136,6 +136,10 @@ public class OtnDeviceRendererServiceImpl implements OtnDeviceRendererService {
                 .build();
     }
 
+    @SuppressWarnings("rawtypes")
+    // FIXME check if the ForkJoinTask raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     public OtnServicePathOutput deleteOtnServicePath(OtnServicePathInput input) {
         if (input.getNodes() == null) {
             LOG.error("Unable to delete otn service path. input nodes = null");
index 62e6a650785e9fda145e1e5f7e6a50070845198d..9ba7c51f9cfabca3745e99ff2f028815c7826c4d 100644 (file)
@@ -24,8 +24,11 @@ public final class TransactionUtils {
 
     }
 
-    @SuppressWarnings({ "unchecked", "deprecation" })
+    @SuppressWarnings({ "unchecked", "deprecation", "rawtypes" })
     // deviceTx.put needs the "true" boolean parameter at the end in order to not compromise the Junit test suite
+    // FIXME check if the InstanceIdentifier raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     public static boolean writeTransaction(DeviceTransactionManager deviceTransactionManager,
                                     String nodeId,
                                     LogicalDatastoreType logicalDatastoreType,
index c3576ee5781a0fa333b367e773b920429e1c37cc..0e291af4084d3de0780fc49251d32beb24ec73ad 100644 (file)
@@ -32,6 +32,10 @@ public final class TopologyDataUtils {
 
     private static final Logger LOG = LoggerFactory.getLogger(TopologyDataUtils.class);
 
+    @SuppressWarnings({"unchecked","rawtypes"})
+    // FIXME check if the InstanceIdentifier raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     public static <T> void writeTopologyFromFileToDatastore(DataStoreContext dataStoreContextUtil, String file,
         InstanceIdentifier ii) throws InterruptedException, ExecutionException {
         Networks networks = null;
@@ -67,7 +71,10 @@ public final class TopologyDataUtils {
         LOG.info("extraction from {} stored with success in datastore", topoFile.getName());
     }
 
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings({"unchecked","rawtypes"})
+    // FIXME check if the InstanceIdentifier raw type can be avoided
+    // Raw types use are discouraged since they lack type safety.
+    // Resulting Problems are observed at run time and not at compile time
     private static FluentFuture<? extends CommitInfo> writeTransaction(DataBroker dataBroker,
         InstanceIdentifier instanceIdentifier, DataObject object) {
         WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();