Commit 25ea064d authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Remove deprecation warning.

Class#newInstance is deprecated in Java 9 and higher, which doesn't
affect us yet in Java 8. But the suggested replacement already works
in Java 8, so that we can safely switch to that.
parent 87d998c5
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -146,10 +146,9 @@ public final class DescriptorSourceFactory {
              + ".");
      }
      object = ClassLoader.getSystemClassLoader().loadClass(clazzName)
          .newInstance();
          .getDeclaredConstructor().newInstance();
      log.info("Serving implementation {} for {}.", clazzName, type);
    } catch (ClassNotFoundException | InstantiationException
             | IllegalAccessException ex) {
    } catch (ReflectiveOperationException ex) {
      throw new RuntimeException("Cannot load class "
          + clazzName + "for type " + type, ex);
    }