From 7e831603af601a46305ce6b48b26a27a17f4e0ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Sat, 18 Jan 2025 12:02:07 +0200 Subject: [PATCH] Stop using deprecated Class.newInstance() Recommended way is Class.getDeclaredConstructor().newInstance() --- .../eclipse/jdt/internal/junit/runner/RemoteTestRunner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java b/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java index d0429e9ce2e..2cb7af4ce32 100644 --- a/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java +++ b/org.eclipse.jdt.junit.runtime/src/org/eclipse/jdt/internal/junit/runner/RemoteTestRunner.java @@ -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 @@ -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));