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

Backport: [GR-49816] Throw exception for null pointers passed to RuntimeJNIAccess / RuntimeReflection register methods #15

Merged

Commits on Aug 26, 2024

  1. Throw exception for null in RuntimeJNIAccess/RuntimeReflection reg.

    Don't allow null values to be passed to the `register` method of
    `RuntimeJNIAccess` and `RuntimeReflection`. Since these are public APIs
    GraalVM should either handle null values (by ignoring them in this case)
    or throw a `NullPointerException` before creating an asynchronous task
    to perform the registration in the analysis, which then results in
    `NullPointerException`s being thrown later when it's no longer possible
    to understand where the null value originate from.
    
    (cherry picked from commit e6c12dd)
    zakkak authored and jerboaa committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    64184d3 View commit details
    Browse the repository at this point in the history
  2. Fix style.

    (cherry picked from commit d621dbd)
    fniephaus authored and jerboaa committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    1d0bab4 View commit details
    Browse the repository at this point in the history
  3. Move null checks to the beginning of register methods.

    Not before the register methods, which can miss cases, nor later on in a runnable.
    
    (cherry picked from commit f94551a)
    fniephaus authored and jerboaa committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    373204c View commit details
    Browse the repository at this point in the history
  4. Apply non-null strategy to JNIAccessFeature.

    (cherry picked from commit d996f32)
    fniephaus authored and jerboaa committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    6af144f View commit details
    Browse the repository at this point in the history
  5. Use Objects.requireNonNull() in ConditionalConfigurationRegistry.

    (cherry picked from commit 0ba6cc2)
    fniephaus authored and jerboaa committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    9980fdf View commit details
    Browse the repository at this point in the history