Skip to content

[GR-60238] Include JNI reachability metadata with reflection #11066

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@
"title": "Allow objects of this class to be serialized and deserialized",
"type": "boolean",
"default": false
},
"jniAccessible": {
"title": "Register the type for runtime JNI access, including all registered fields and methods",
"type": "boolean",
"default": false
}
},
"additionalProperties": false
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions substratevm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This changelog summarizes major changes to GraalVM Native Image.
1. `run-time-initialized-jdk` shifts away from build-time initialization of the JDK, instead initializing most of it at run time. This transition is gradual, with individual components of the JDK becoming run-time initialized in each release. This process should complete with JDK 29 when this option should not be needed anymore. Unless you store classes from the JDK in the image heap, this option should not affect you. In case this option breaks your build, follow the suggestions in the error messages.
* (GR-63494) Recurring callback support is no longer enabled by default. If this feature is needed, please specify `-H:+SupportRecurringCallback` at image build-time.
* (GR-60209) New syntax for configuration of the [Foreign Function & Memory API](https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/ForeignInterface.md)
* (GR-60238) JNI registration is now included as part of the `"reflection"` section of `reachability-metadata.json`. Registrations performed through the `"jni"` section of `reachability-metadata.json` and through `jni-config.json` will still be accepted and parsed correctly.

## GraalVM for JDK 24 (Internal Version 24.2.0)
* (GR-59717) Added `DuringSetupAccess.registerObjectReachabilityHandler` to allow registering a callback that is executed when an object of a specified type is marked as reachable during heap scanning.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
import java.util.function.Function;
import java.util.function.Predicate;

import org.graalvm.nativeimage.impl.UnresolvedConfigurationCondition;
import org.junit.Assert;
import org.junit.Test;

import com.oracle.svm.configure.ConfigurationTypeDescriptor;
import com.oracle.svm.configure.NamedConfigurationTypeDescriptor;
import com.oracle.svm.configure.UnresolvedConfigurationCondition;
import com.oracle.svm.configure.config.ConfigurationFileCollection;
import com.oracle.svm.configure.config.ConfigurationMemberInfo;
import com.oracle.svm.configure.config.ConfigurationMemberInfo.ConfigurationMemberAccessibility;
Expand Down Expand Up @@ -97,7 +97,6 @@ public void testSameConfig() {
ConfigurationSet config = loadTraceProcessorFromResourceDirectory(PREVIOUS_CONFIG_DIR_NAME, omittedConfig);
config = config.copyAndSubtract(omittedConfig);

assertTrue(config.getJniConfiguration().isEmpty());
assertTrue(config.getReflectionConfiguration().isEmpty());
assertTrue(config.getProxyConfiguration().isEmpty());
assertTrue(config.getResourceConfiguration().isEmpty());
Expand All @@ -112,7 +111,7 @@ public void testConfigDifference() {
config = config.copyAndSubtract(omittedConfig);

doTestGeneratedTypeConfig();
doTestTypeConfig(config.getJniConfiguration());
doTestTypeConfig(config.getReflectionConfiguration());

doTestProxyConfig(config.getProxyConfiguration());

Expand Down Expand Up @@ -242,8 +241,8 @@ class TypeMethodsWithFlagsTest {
final Map<ConfigurationMethod, ConfigurationMemberDeclaration> methodsThatMustExist = new HashMap<>();
final Map<ConfigurationMethod, ConfigurationMemberDeclaration> methodsThatMustNotExist = new HashMap<>();

final TypeConfiguration previousConfig = new TypeConfiguration("");
final TypeConfiguration currentConfig = new TypeConfiguration("");
final TypeConfiguration previousConfig = new TypeConfiguration();
final TypeConfiguration currentConfig = new TypeConfiguration();

TypeMethodsWithFlagsTest(ConfigurationMemberDeclaration methodKind) {
this.methodKind = methodKind;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
import java.util.Locale;

import org.graalvm.nativeimage.impl.ConfigurationCondition;
import org.graalvm.nativeimage.impl.UnresolvedConfigurationCondition;
import org.junit.Assert;
import org.junit.Test;

import com.oracle.svm.configure.ConfigurationParserOption;
import com.oracle.svm.configure.ResourceConfigurationParser;
import com.oracle.svm.configure.ResourcesRegistry;
import com.oracle.svm.configure.UnresolvedConfigurationCondition;
import com.oracle.svm.configure.config.ResourceConfiguration;
import com.oracle.svm.configure.config.conditional.ConfigurationConditionResolver;

Expand Down
Loading