From d9992035ab8598263434be43ce44a555fc7287b3 Mon Sep 17 00:00:00 2001 From: Esteban Ginez Date: Mon, 6 Apr 2020 14:33:23 -0700 Subject: [PATCH] [GR-21741] Avoids data on posix oses --- .../src/org/graalvm/nativeimage/c/function/CLibrary.java | 2 +- .../src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/c/function/CLibrary.java b/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/c/function/CLibrary.java index ecdb513abfce..de00d235a5cf 100644 --- a/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/c/function/CLibrary.java +++ b/sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/c/function/CLibrary.java @@ -72,7 +72,7 @@ /** * Specifies the name of the libraries this library depends on. * - * @since 20.0.1 + * @since 20.1.0 */ String[] dependsOn() default {}; } diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java index 591cb4741f4d..1fadd645f47a 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/TimeZoneSubstitutions.java @@ -86,9 +86,8 @@ private static String getSystemTimeZoneID(String javaHome) { int contentLen = 0; PinnedObject pinnedContent = null; try { - TimeZoneSupport timeZoneSupport = ImageSingletons.lookup(TimeZoneSupport.class); - byte[] content = timeZoneSupport.getTzMappingsContent(); - if (content != null) { + if (ImageSingletons.contains(TimeZoneSupport.class)) { + byte[] content = ImageSingletons.lookup(TimeZoneSupport.class).getTzMappingsContent(); contentLen = content.length; pinnedContent = PinnedObject.create(content); tzMappingsPtr = pinnedContent.addressOfArrayElement(0); @@ -168,7 +167,6 @@ private static byte[] cleanCR(byte[] buffer) { public void afterRegistration(AfterRegistrationAccess access) { if (OS.getCurrent() != OS.WINDOWS) { - ImageSingletons.add(TimeZoneSupport.class, new TimeZoneSupport(null)); return; }