Fix JDK11 deprecations
[neutron.git] / neutron-spi / src / main / java / org / opendaylight / neutron / spi / NeutronObject.java
index d2fc06cc2038fb7513e88b18abe89ae1250cbe25..255ff47b1af470c7ab3a1ed3ce69bc59a8e4109f 100644 (file)
@@ -116,8 +116,8 @@ public abstract class NeutronObject<T extends NeutronObject<T>> extends NeutronI
         Class<T> cls = (Class<T>) types[NEUTRON_OBJECT_CLASS_TYPE_INDEX];
         T ans;
         try {
-            ans = cls.newInstance();
-        } catch (IllegalAccessException | InstantiationException e) {
+            ans = cls.getDeclaredConstructor().newInstance();
+        } catch (ReflectiveOperationException e) {
             // should not happen.
             throw new IllegalStateException(e);
         }