Skip to content

Commit

Permalink
replace deprecated isAccessible()
Browse files Browse the repository at this point in the history
The method isAccessible() from the type AccessibleObject is deprecated
since version 9
  • Loading branch information
EcljpseB0T authored and jukzi committed Feb 13, 2024
1 parent 8315300 commit 2b989e7
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,7 @@ private void registerRestartHandler(Class<?> starterClazz)
try {
registerFrameworkShutdownHandler = starterClazz.getDeclaredMethod("internalAddFrameworkShutdownHandler", //$NON-NLS-1$
Runnable.class);
if (!registerFrameworkShutdownHandler.isAccessible()) {
registerFrameworkShutdownHandler.setAccessible(true);
}
registerFrameworkShutdownHandler.trySetAccessible();
Runnable restartHandler = createRestartHandler(starterClazz);
registerFrameworkShutdownHandler.invoke(null, restartHandler);
} catch (NoSuchMethodException e) {
Expand All @@ -528,9 +526,7 @@ private void registerRestartHandler(Class<?> starterClazz)

private Runnable createRestartHandler(Class<?> starterClazz) throws NoSuchMethodException {
final Method getProperty = starterClazz.getDeclaredMethod("getProperty", String.class); //$NON-NLS-1$
if (!getProperty.isAccessible()) {
getProperty.setAccessible(true);
}
getProperty.trySetAccessible();
Runnable restartHandler = new Runnable() {
@Override
public void run() {
Expand Down

0 comments on commit 2b989e7

Please sign in to comment.