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

Update NativeImageUtil method name and expose new getter #4063

Conversation

JooHyukKim
Copy link
Member

@JooHyukKim JooHyukKim commented Aug 1, 2023

(As discussed in FasterXML/jackson-modules-base#217 (comment))

Motivation

Checks around native image needs update

Modifications

  1. RenamedisRunningInNativeImage() to isInNativeImageAndIsAtRuntime()
  2. Updated JavaDoc for method above (1)
  3. Reverted modifier back to private for method above (1)
  4. Introduced new method isInNativeImage() for only checking if we are in Native Image --will be used in Follow up wrt #191 by using NativeImageUtil.isRunningInNativeImage() in databind jackson-modules-base#217

@JooHyukKim
Copy link
Member Author

@yawkat Could you please take a look when you have time?

* @since 2.16
*/
public static boolean isInNativeImage() {
return System.getProperty("org.graalvm.nativeimage.imagecode") != null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this check can be inlined into RUNNING_IN_SVM, because it doesnt care whether the value is buildtime or runtime.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And still keep this method, right? Using in FasterXML/jackson-modules-base#217

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so this should just return RUNNING_IN_SVM, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep

@JooHyukKim JooHyukKim changed the title Update NativeImageUtil method name and expose new getter isInSVM() Update NativeImageUtil method name and expose new getter Aug 1, 2023
@yawkat
Copy link
Member

yawkat commented Aug 2, 2023

these names are much better, thanks :)

@cowtowncoder cowtowncoder merged commit ef23d8c into FasterXML:2.16 Aug 3, 2023
cowtowncoder added a commit that referenced this pull request Aug 3, 2023
@JooHyukKim JooHyukKim deleted the Update-NativeImageUtil-and-expose-getter-for-SVM branch September 5, 2023 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants