Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose NativeImageUtil.isRunningInNativeImage() method #4060

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Project: jackson-databind
(contributed by Joo-Hyuk K)
#4056: Provide the "ObjectMapper.treeToValue(TreeNode, TypeReference)" method
(contributed by @fantasy0v0)
#4060: Expose `NativeImageUtil.isRunningInNativeImage()` method

2.15.3 (not yet released)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ private NativeImageUtil() {
/**
* Check whether we're running in substratevm native image runtime mode. This check cannot be a constant, because
* the static initializer may run early during build time
*<p>
* NOTE: {@code public} since 2.16 (before that, {@code private}).
*/
private static boolean isRunningInNativeImage() {
public static boolean isRunningInNativeImage() {
return RUNNING_IN_SVM && "runtime".equals(System.getProperty("org.graalvm.nativeimage.imagecode"));
}

Expand Down