Fix Java 7 IDE migration warnings 15/78415/4
authorJakub Morvay <jmorvay@frinx.io>
Tue, 4 Dec 2018 12:15:32 +0000 (13:15 +0100)
committerJakub Morvay <jmorvay@frinx.io>
Tue, 4 Dec 2018 15:45:03 +0000 (16:45 +0100)
- explicit type argument can be replaces with <>
- identical 'catch' branches in 'try' statement

Change-Id: I731a00664a50fae9d4fa5f3fe9a908779948adfb
Signed-off-by: Jakub Morvay <jmorvay@frinx.io>
netconf/netconf-notifications-impl/src/main/java/org/opendaylight/netconf/notifications/impl/osgi/Activator.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClient.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/NormalizedNodeXmlBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/PatchXmlBodyWriter.java
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfDocumentedExceptionMapper.java
restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/jersey/providers/patch/PatchXmlBodyWriter.java

index cc4c57c07b2bc1a81d2f727dfc6a8877a46df001..967bd08914e17734628387badc80fe921e770be9 100644 (file)
@@ -47,7 +47,7 @@ public class Activator implements BundleActivator {
         final Dictionary<String, String> props = new Hashtable<>();
         props.put(NetconfConstants.SERVICE_NAME, NetconfConstants.NETCONF_NOTIFICATION);
         netconfNotificationCollectorServiceRegistration = context.registerService(NetconfNotificationCollector.class,
-                netconfNotificationManager, new Hashtable<String, Object>());
+                netconfNotificationManager, new Hashtable<>());
 
         final NetconfOperationServiceFactory netconfOperationServiceFactory = new NetconfOperationServiceFactory() {
 
index 9e2d9c419325d0f123f7885cecae8a54551b7886..6d02ba259a94585aa3c4fdedcfc763ce522f8967 100644 (file)
@@ -128,9 +128,9 @@ public final class StressClient {
         final List<List<NetconfMessage>> allPreparedMessages = new ArrayList<>(threadAmount);
         for (int i = 0; i < threadAmount; i++) {
             if (i != threadAmount - 1) {
-                allPreparedMessages.add(new ArrayList<NetconfMessage>(requestsPerThread));
+                allPreparedMessages.add(new ArrayList<>(requestsPerThread));
             } else {
-                allPreparedMessages.add(new ArrayList<NetconfMessage>(requestsPerThread + leftoverRequests));
+                allPreparedMessages.add(new ArrayList<>(requestsPerThread + leftoverRequests));
             }
         }
 
index 7db0081ca57c0e0b132b36559daf2e0408a5141a..df9b4f03b6bbea2de251268bd83293b72bb8018e 100644 (file)
@@ -92,9 +92,7 @@ public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter<Normalized
             if (context.getWriterParameters().isPrettyPrint()) {
                 xmlWriter = new IndentingXMLStreamWriter(xmlWriter);
             }
-        } catch (final XMLStreamException e) {
-            throw new IllegalStateException(e);
-        } catch (final FactoryConfigurationError e) {
+        } catch (final XMLStreamException | FactoryConfigurationError e) {
             throw new IllegalStateException(e);
         }
         final NormalizedNode<?, ?> data = context.getData();
index 13ceb2e63ca2e95f2a4813dc00a7c52dbb567cce..a8ce65f18d74ef9f83b8a2dd4305ce6fbd4144a1 100644 (file)
@@ -62,9 +62,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
             final XMLStreamWriter xmlWriter =
                     XML_FACTORY.createXMLStreamWriter(entityStream, StandardCharsets.UTF_8.name());
             writeDocument(xmlWriter, patchStatusContext);
-        } catch (final XMLStreamException e) {
-            throw new IllegalStateException(e);
-        } catch (final FactoryConfigurationError e) {
+        } catch (final XMLStreamException | FactoryConfigurationError e) {
             throw new IllegalStateException(e);
         }
     }
index 3828abd6a70a20bb1e4114553473bc8caee9f2ec..6f9616163431b22deb947d80bfad6a6fa925e5c4 100644 (file)
@@ -294,9 +294,7 @@ public class RestconfDocumentedExceptionMapper implements ExceptionMapper<Restco
         final XMLStreamWriter xmlWriter;
         try {
             xmlWriter = XML_FACTORY.createXMLStreamWriter(outStream, StandardCharsets.UTF_8.name());
-        } catch (final XMLStreamException e) {
-            throw new IllegalStateException(e);
-        } catch (final FactoryConfigurationError e) {
+        } catch (final XMLStreamException | FactoryConfigurationError e) {
             throw new IllegalStateException(e);
         }
         NormalizedNode<?, ?> data = errorsNode.getData();
index d7d264fdab92d6fd6cb789264f8f3bfb43b8d2e9..aa936e59193cea70020ef2b2a6905f1db67a346a 100644 (file)
@@ -62,9 +62,7 @@ public class PatchXmlBodyWriter implements MessageBodyWriter<PatchStatusContext>
             final XMLStreamWriter xmlWriter =
                     XML_FACTORY.createXMLStreamWriter(entityStream, StandardCharsets.UTF_8.name());
             writeDocument(xmlWriter, patchStatusContext);
-        } catch (final XMLStreamException e) {
-            throw new IllegalStateException(e);
-        } catch (final FactoryConfigurationError e) {
+        } catch (final XMLStreamException | FactoryConfigurationError e) {
             throw new IllegalStateException(e);
         }
     }