Index: vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java =================================================================== --- vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java (revision 452710) +++ vm/vmcore/src/kernel_classes/javasrc/java/lang/Thread.java (working copy) @@ -757,18 +757,18 @@ * @com.intel.drl.spec_ref */ public final void stop(Throwable throwable) { + SecurityManager securityManager = System.getSecurityManager(); + if (securityManager != null) { + securityManager.checkAccess(this); + if (currentThread() != this || !(throwable instanceof ThreadDeath)) { + securityManager.checkPermission( + RuntimePermissionCollection.STOP_THREAD_PERMISSION); + } + } + if (throwable == null) { + throw new NullPointerException("The argument is null!"); + } synchronized (lock) { - if (throwable == null) { - throw new NullPointerException("The argument is null!"); - } - SecurityManager securityManager = System.getSecurityManager(); - if (securityManager != null) { - securityManager.checkAccess(this); - if (currentThread() != this) { - securityManager - .checkPermission(RuntimePermissionCollection.STOP_THREAD_PERMISSION); - } - } int status = VMThreadManager.stop(this, throwable); if (status != VMThreadManager.TM_ERROR_NONE) { throw new InternalError(