diff options
author | Alexander Kurtakov | 2018-11-15 07:45:15 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-11-15 09:06:22 +0000 |
commit | dc5952d249f244c87dcd42a197da1991a5aa1711 (patch) | |
tree | e478d0220c0bd5a93399684bbb796214c8e8b442 | |
parent | 0c39858df327def23a12b23c1576e4578344c974 (diff) | |
download | rt.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-x | bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java | 12 |
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 5b97644ea..fc1ec0c7d 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. |