Skip to content

Commit 45eb97e

Browse files
committed
Put back SystemPropertiesSupport.class ImageSingleton for now
1 parent 361043f commit 45eb97e

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/darwin/DarwinSystemPropertiesSupport.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import com.oracle.svm.core.feature.InternalFeature;
3939
import com.oracle.svm.core.graal.stackvalue.UnsafeStackValue;
4040
import com.oracle.svm.core.headers.LibC;
41+
import com.oracle.svm.core.jdk.SystemPropertiesSupport;
4142
import com.oracle.svm.core.posix.PosixSystemPropertiesSupport;
4243
import com.oracle.svm.core.posix.headers.Limits;
4344
import com.oracle.svm.core.posix.headers.Stdlib;
@@ -130,7 +131,8 @@ protected String osVersionValue() {
130131
class DarwinSystemPropertiesFeature implements InternalFeature {
131132
@Override
132133
public void duringSetup(DuringSetupAccess access) {
133-
DarwinSystemPropertiesSupport systemPropertiesSupport = new DarwinSystemPropertiesSupport();
134-
ImageSingletons.add(RuntimeSystemPropertiesSupport.class, systemPropertiesSupport);
134+
ImageSingletons.add(RuntimeSystemPropertiesSupport.class, new DarwinSystemPropertiesSupport());
135+
/* GR-42971 - Remove once SystemPropertiesSupport.class ImageSingletons use is gone. */
136+
ImageSingletons.add(SystemPropertiesSupport.class, SystemPropertiesSupport.singleton());
135137
}
136138
}

substratevm/src/com.oracle.svm.core.posix/src/com/oracle/svm/core/posix/linux/LinuxSystemPropertiesSupport.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature;
3434
import com.oracle.svm.core.feature.InternalFeature;
3535
import com.oracle.svm.core.graal.stackvalue.UnsafeStackValue;
36+
import com.oracle.svm.core.jdk.SystemPropertiesSupport;
3637
import com.oracle.svm.core.posix.PosixSystemPropertiesSupport;
3738
import com.oracle.svm.core.posix.headers.Stdlib;
3839
import com.oracle.svm.core.posix.headers.Utsname;
@@ -92,7 +93,8 @@ class LinuxSystemPropertiesFeature implements InternalFeature {
9293

9394
@Override
9495
public void duringSetup(DuringSetupAccess access) {
95-
LinuxSystemPropertiesSupport systemPropertiesSupport = new LinuxSystemPropertiesSupport();
96-
ImageSingletons.add(RuntimeSystemPropertiesSupport.class, systemPropertiesSupport);
96+
ImageSingletons.add(RuntimeSystemPropertiesSupport.class, new LinuxSystemPropertiesSupport());
97+
/* GR-42971 - Remove once SystemPropertiesSupport.class ImageSingletons use is gone. */
98+
ImageSingletons.add(SystemPropertiesSupport.class, SystemPropertiesSupport.singleton());
9799
}
98100
}

substratevm/src/com.oracle.svm.core.windows/src/com/oracle/svm/core/windows/WindowsSystemPropertiesSupport.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ public Pair<String, String> getOsNameAndVersion() {
391391
class WindowsSystemPropertiesFeature implements InternalFeature {
392392
@Override
393393
public void duringSetup(DuringSetupAccess access) {
394-
WindowsSystemPropertiesSupport systemPropertiesSupport = new WindowsSystemPropertiesSupport();
395-
ImageSingletons.add(RuntimeSystemPropertiesSupport.class, systemPropertiesSupport);
394+
ImageSingletons.add(RuntimeSystemPropertiesSupport.class, new WindowsSystemPropertiesSupport());
395+
/* GR-42971 - Remove once SystemPropertiesSupport.class ImageSingletons use is gone. */
396+
ImageSingletons.add(SystemPropertiesSupport.class, SystemPropertiesSupport.singleton());
396397
}
397398
}

0 commit comments

Comments
 (0)