Skip to content

Commit

Permalink
Stop using deprecated Class.newInstance()
Browse files Browse the repository at this point in the history
Recommended way is Class.getDeclaredConstructor().newInstance()
  • Loading branch information
akurtakov committed Jan 18, 2025
1 parent 3cff735 commit 7e83160
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2021 IBM Corporation and others.
* Copyright (c) 2000, 2025 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -369,7 +369,7 @@ public void createLoader(String className) {

protected ITestLoader createRawTestLoader(String className) {
try {
return (ITestLoader) loadTestLoaderClass(className).newInstance();
return (ITestLoader) loadTestLoaderClass(className).getDeclaredConstructor().newInstance();
} catch (Exception e) {
StringWriter trace= new StringWriter();
e.printStackTrace(new PrintWriter(trace));
Expand Down

0 comments on commit 7e83160

Please sign in to comment.