Skip to content

Commit 7f65385

Browse files
authored
avoid deprecated Class.newInstance (sbt#192)
1 parent 9bc0bf7 commit 7f65385

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/library/src/main/java/com/github/sbt/junit/jupiter/internal/Configuration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ public Optional<TestExecutionListener> createRunListener(ClassLoader classLoader
104104
.map(
105105
className -> {
106106
try {
107-
final Object listener = classLoader.loadClass(className).newInstance();
107+
final Object listener =
108+
classLoader.loadClass(className).getDeclaredConstructor().newInstance();
108109
return (TestExecutionListener) listener;
109110
} catch (Exception e) {
110111
throw new RuntimeException(e);

0 commit comments

Comments
 (0)