Skip to content

Commit a586fed

Browse files
author
Vladimir Kotal
committed
clazz.newInstance() -> clazz.getDeclaredConstructor().newInstance()
1 parent 3395f1d commit a586fed

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

opengrok-indexer/src/test/java/org/opengrok/indexer/authorization/AuthorizationPluginClassLoaderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public void testTruePlugin() {
191191
private IAuthorizationPlugin getNewInstance(Class c) {
192192
IAuthorizationPlugin plugin = null;
193193
try {
194-
plugin = (IAuthorizationPlugin) c.newInstance();
194+
plugin = (IAuthorizationPlugin) c.getDeclaredConstructor().newInstance();
195195
} catch (InstantiationException ex) {
196196
Assert.fail("Should not produce InstantiationException");
197197
} catch (IllegalAccessException ex) {

opengrok-indexer/src/test/java/org/opengrok/indexer/condition/ConditionalRunRule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ private RunCondition createCondition() throws Exception {
155155
result = new CompositeCondition();
156156
}
157157
if (isConditionTypeStandalone(clazz)) {
158-
result.add(clazz.newInstance());
158+
result.add(clazz.getDeclaredConstructor().newInstance());
159159
} else {
160160
result.add(clazz.getDeclaredConstructor(mTestClass).newInstance(mTestClass));
161161
}

0 commit comments

Comments
 (0)