From 82f734885a1c290c9ecf4beff2ca05e157620422 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Sat, 10 Jun 2017 09:15:12 +0200 Subject: Revert "Set the default constructor on config classes private." --- config-lib/src/main/java/com/yahoo/config/InnerNodeVector.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'config-lib/src') diff --git a/config-lib/src/main/java/com/yahoo/config/InnerNodeVector.java b/config-lib/src/main/java/com/yahoo/config/InnerNodeVector.java index eec2d3cd500..72ca0138a53 100644 --- a/config-lib/src/main/java/com/yahoo/config/InnerNodeVector.java +++ b/config-lib/src/main/java/com/yahoo/config/InnerNodeVector.java @@ -1,8 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.config; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; import java.util.List; /** @@ -40,11 +38,9 @@ public class InnerNodeVector extends NodeVector { @SuppressWarnings("unchecked") protected NODE createNew() { try { - Constructor ctor = defaultNode.getClass().getDeclaredConstructor(); - ctor.setAccessible(true); - return (NODE) ctor.newInstance(); - } catch (InvocationTargetException | IllegalAccessException | InstantiationException | NoSuchMethodException e) { - throw new ConfigurationRuntimeException(e); + return (NODE) defaultNode.getClass().newInstance(); + } catch (IllegalAccessException | InstantiationException ex) { + throw new ConfigurationRuntimeException(ex); } } -- cgit v1.2.3