Index: lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java =================================================================== --- lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java (revision 1481635) +++ lucene/core/src/test/org/apache/lucene/index/TestIndexWriterOnJRECrash.java (working copy) @@ -22,13 +22,10 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; -import java.lang.reflect.Field; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import org.apache.lucene.store.BaseDirectoryWrapper; -import org.apache.lucene.util.Constants; import org.apache.lucene.util._TestUtil; import com.carrotsearch.randomizedtesting.SeedUtils; @@ -49,10 +46,6 @@ @Override @Nightly public void testNRTThreads() throws Exception { - String vendor = Constants.JAVA_VENDOR; - assumeTrue(vendor + " JRE not supported.", - vendor.startsWith("Oracle") || vendor.startsWith("Sun") || vendor.startsWith("Apple")); - // if we are not the fork if (System.getProperty("tests.crashmode") == null) { // try up to 10 times to create an index @@ -161,13 +154,7 @@ */ public void crashJRE() { try { - Class clazz = Class.forName("sun.misc.Unsafe"); - // we should use getUnsafe instead, harmony implements it, etc. - Field field = clazz.getDeclaredField("theUnsafe"); - field.setAccessible(true); - Object o = field.get(null); - Method m = clazz.getMethod("putAddress", long.class, long.class); - m.invoke(o, 0L, 0L); + Runtime.getRuntime().halt(0); } catch (Exception e) { e.printStackTrace(); } fail(); }