Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2018-11-15 02:45:15 -0500
committerAlexander Kurtakov2018-11-15 04:06:22 -0500
commitdc5952d249f244c87dcd42a197da1991a5aa1711 (patch)
treee478d0220c0bd5a93399684bbb796214c8e8b442
parent0c39858df327def23a12b23c1576e4578344c974 (diff)
downloadrt.equinox.bundles-dc5952d249f244c87dcd42a197da1991a5aa1711.tar.gz
rt.equinox.bundles-dc5952d249f244c87dcd42a197da1991a5aa1711.tar.xz
rt.equinox.bundles-dc5952d249f244c87dcd42a197da1991a5aa1711.zip
Fix EquinoxCommandProvider compile on Java 11.
Thread#stop(Throwable) is removed in Java 11 and in Java 8 it already throwed UnsupportedOpetionException and the private stop0 was called instead. Leave the reflection call only and don't try calling the removed method at all. Change-Id: Ib408c1b145fb1ba7eb0d96501fe9d1b1784b68e3 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rwxr-xr-xbundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
index 5b97644e..fc1ec0c7 100755
--- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
+++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java
@@ -1445,14 +1445,10 @@ public class EquinoxCommandProvider implements SynchronousBundleListener {
// Set the stack trace to that of the target thread.
toThrow.setStackTrace(t.getStackTrace());
// Stop the thread using the specified throwable.
- try {
- t.stop(toThrow);
- } catch (UnsupportedOperationException e) {
- // Thread#stop(Throwable) doesn't work any more in JDK 8. Try stop0:
- Method stop0 = Thread.class.getDeclaredMethod("stop0", Object.class);
- stop0.setAccessible(true);
- stop0.invoke(t, toThrow);
- }
+ // Thread#stop(Throwable) doesn't work any more in JDK 8 and is removed in Java 11. Try stop0:
+ Method stop0 = Thread.class.getDeclaredMethod("stop0", Object.class);
+ stop0.setAccessible(true);
+ stop0.invoke(t, toThrow);
return;
}
// An unrecognized action was specified.

Back to the top