diff --git a/pom.xml b/pom.xml index ed784a869..e49cc518f 100755 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,9 @@ + + 4.0.0 + net.openhft java-parent-pom @@ -8,9 +11,9 @@ - 4.0.0 chronicle-map - 3.19.41-SNAPSHOT + + 3.19.43-SNAPSHOT OpenHFT/Chronicle-Map Chronicle-Map bundle @@ -246,7 +249,6 @@ - src/main/resources @@ -436,6 +438,26 @@ + + chronicle-enterprise-snapshots + Snapshot Repository + + https://nexus.chronicle.software/content/repositories/snapshots + + + true + + + + chronicle-enterprise-release + + https://nexus.chronicle.software/content/repositories/releases + + + true + + + central Central Repository diff --git a/src/test/java/net/openhft/chronicle/map/ExitHookTest.java b/src/test/java/net/openhft/chronicle/map/ExitHookTest.java index eed6bea0e..72eec6530 100644 --- a/src/test/java/net/openhft/chronicle/map/ExitHookTest.java +++ b/src/test/java/net/openhft/chronicle/map/ExitHookTest.java @@ -17,6 +17,8 @@ package net.openhft.chronicle.map; import com.google.common.base.Preconditions; +import net.openhft.chronicle.core.Jvm; + import net.openhft.chronicle.core.OS; import org.junit.Rule; import org.junit.Test; @@ -24,7 +26,6 @@ import org.junit.rules.TemporaryFolder; import java.io.File; import java.io.IOException; -import java.lang.reflect.Field; import java.nio.file.Files; import java.util.Iterator; import java.util.concurrent.atomic.AtomicReference; @@ -36,6 +37,7 @@ public class ExitHookTest { private static final int KEY = 1; private static final int JVM_STARTUP_WAIT_TIME_MS = 5_000; + private static final String PRE_SHUTDOWN_ACTION_EXECUTED = "PRE_SHUTDOWN_ACTION_EXECUTED"; private static final String USER_SHUTDOWN_HOOK_EXECUTED = "USER_SHUTDOWN_HOOK_EXECUTED"; @@ -104,19 +106,8 @@ public class ExitHookTest { // http://stackoverflow.com/a/33171840/648955 public static long getPidOfProcess(Process p) { - long pid = -1; - - try { - if (p.getClass().getName().equals("java.lang.UNIXProcess")) { - Field f = p.getClass().getDeclaredField("pid"); - f.setAccessible(true); - pid = f.getLong(p); - f.setAccessible(false); - } - } catch (Exception e) { - pid = -1; - } - return pid; + Number pid = Jvm.getValue(p, "pid"); + return pid.longValue(); } @Test diff --git a/system.properties b/system.properties index 677f6b473..9f316b79c 100644 --- a/system.properties +++ b/system.properties @@ -1,4 +1,5 @@ # Tracing if resources are closed/released correctly. jvm.resource.tracing=true +check.thread.safety=true # for profiling jvm.safepoint.enabled=false \ No newline at end of file