summaryrefslogtreecommitdiffstats
path: root/config-lib
diff options
context:
space:
mode:
authorHarald Musum <musum@yahoo-inc.com>2017-06-10 09:15:12 +0200
committerGitHub <noreply@github.com>2017-06-10 09:15:12 +0200
commit82f734885a1c290c9ecf4beff2ca05e157620422 (patch)
tree65561ef5a03842948f389cf10ba10a2139f6274b /config-lib
parent2af698629318873b3167cbad30081d2994e9df91 (diff)
Revert "Set the default constructor on config classes private."
Diffstat (limited to 'config-lib')
-rw-r--r--config-lib/src/main/java/com/yahoo/config/InnerNodeVector.java10
1 files changed, 3 insertions, 7 deletions
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<NODE extends InnerNode> extends NodeVector<NODE> {
@SuppressWarnings("unchecked")
protected NODE createNew() {
try {
- Constructor<? extends InnerNode> 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);
}
}