Skip to content

Commit

Permalink
GEODE-10447: improve code for supporting JDK11 (#7882)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener authored Jun 19, 2023
1 parent 55d92bb commit b81e9d4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.apache.geode.test.concurrency;

import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.List;

Expand Down Expand Up @@ -81,8 +82,9 @@ public ConcurrentTestRunner(Class testClass) throws InitializationError {
}

try {
runner = configuration.runner().newInstance();
} catch (InstantiationException | IllegalAccessException e) {
runner = configuration.runner().getDeclaredConstructor().newInstance();
} catch (InstantiationException | IllegalAccessException | InvocationTargetException
| NoSuchMethodException e) {
throw new InitializationError(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public List<Throwable> runTestMethod(Method child) {
ParallelExecutor executor = new DelegatingExecutor(executorService);
for (int i = 0; i < count; i++) {
try {
Object test = child.getDeclaringClass().newInstance();
Object test = child.getDeclaringClass().getDeclaredConstructor().newInstance();
child.invoke(test, executor);
} catch (InvocationTargetException ex) {
Throwable exceptionToReturn = ex.getCause();
Expand Down

0 comments on commit b81e9d4

Please sign in to comment.