Skip to content

Commit 3ed3cc5

Browse files
committed
Incorporate PR review feedback
1 parent 4fd3967 commit 3ed3cc5

File tree

6 files changed

+31
-21
lines changed

6 files changed

+31
-21
lines changed

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/hosted/RuntimeJNIAccess.java

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,22 @@
5959
public final class RuntimeJNIAccess {
6060

6161
/**
62-
* Makes the provided classes available for JNI access at run time. Needed when C/C++ code looks
63-
* up Java classes via JNINativeInterface.FindClass, GetObjectClass or DefineClass.
64-
*
62+
* Makes the provided classes available for JNI access at run time. Needed when native code
63+
* looks up Java classes via <a href=
64+
* "https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#findclass">FindClass</a>.
65+
*
6566
* @since 22.3
6667
*/
6768
public static void register(Class<?>... classes) {
6869
ImageSingletons.lookup(RuntimeJNIAccessSupport.class).register(ConfigurationCondition.alwaysTrue(), classes);
6970
}
7071

7172
/**
72-
* Makes the provided methods available for JNI access at run time. Needed when C/C++ code looks
73-
* up Java methods via JNINativeInterface.GetMethodID or GetStaticMethodID.
73+
* Makes the provided methods available for JNI access at run time. Needed when native code
74+
* looks up Java methods via <a href=
75+
* "https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getmethodid">GetMethodID</a>
76+
* or <a href=
77+
* "https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getstaticmethodid">GetStaticMethodID</a>.
7478
*
7579
* @since 22.3
7680
*/
@@ -79,8 +83,11 @@ public static void register(Executable... methods) {
7983
}
8084

8185
/**
82-
* Makes the provided fields available for JNI access at run time. Needed when C/C++ code looks
83-
* up Java fields via JNINativeInterface.GetFieldID or GetStaticFieldID.
86+
* Makes the provided fields available for JNI access at run time. Needed when native code looks
87+
* up Java fields via <a href=
88+
* "https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getfieldid">GetFieldID</a>
89+
* or <a href=
90+
* "https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#getstaticfieldid">GetStaticFieldID</a>.
8491
*
8592
* @since 22.3
8693
*/

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/hosted/RuntimeProxyCreation.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@
5454
public final class RuntimeProxyCreation {
5555

5656
/**
57-
* Register dynamic proxy class that should be available to get created at run time. The proxy
58-
* class is fully specified by the interfaces it implements.
57+
* Enables registering specifications of {@link java.lang.reflect.Proxy} classes during the
58+
* image build so that matching proxy objects can be created at runtime. The proxy class is
59+
* fully specified by the interfaces it implements.
5960
*
6061
* @since 22.3
6162
*/

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/hosted/RuntimeResourceAccess.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ public final class RuntimeResourceAccess {
6060

6161
/**
6262
* Make Java resources that are matched by a {@code pattern} available at run time. If the given
63-
* {@code pattern} starts with {@code <module-name>:} then pattern that follows will only match
64-
* resources coming from Java module named {@code <module-name>}.
63+
* {@code pattern} starts with {@code <module-name>:} then the pattern that follows will only
64+
* match resources from Java module named {@code <module-name>}.
6565
*
6666
* @since 22.3
6767
*/
@@ -71,8 +71,8 @@ public static void includeResources(String pattern) {
7171

7272
/**
7373
* Ensure Java resources that are matched by a {@code pattern} will never be available at run
74-
* time. If the given {@code pattern} starts with {@code <module-name>:} then pattern that
75-
* follows will only match resources coming from Java module named {@code <module-name>}.
74+
* time. If the given {@code pattern} starts with {@code <module-name>:} then the pattern that
75+
* follows will only match resources from Java module named {@code <module-name>}.
7676
*
7777
* @since 22.3
7878
*/

sdk/src/org.graalvm.nativeimage/src/org/graalvm/nativeimage/hosted/RuntimeSerialization.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ public static void registerWithTargetConstructorClass(Class<?> clazz, Class<?> c
101101
}
102102

103103
/**
104-
* Makes class available for serialization at runtime that is created for the lambda expressions
105-
* (a class that has a $deserializeLambda$ method) specified by the lambdaCapturingClassName.
104+
* Makes a class available for serialization at runtime that is created for the lambda
105+
* expressions (a class that has a $deserializeLambda$ method) specified by the
106+
* lambdaCapturingClass.
106107
*
107108
* @since 22.3
108109
*/

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/configure/ResourcesRegistry.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ default void addResourceBundles(String name) {
6161

6262
/**
6363
* Although the interface-methods below are already defined in the super-interface
64-
* {@link RuntimeResourceSupport} they are also needed here for backwards compatibility.
64+
* {@link RuntimeResourceSupport} they are also needed here for legacy code that accesses them
65+
* reflectively.
6566
*/
6667
@Override
6768
void addResources(ConfigurationCondition condition, String pattern);

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/jni/JNIAccessFeature.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ static final class JNICallableJavaMethod {
148148
}
149149
}
150150

151-
private JNIRuntimeAccessibilitySupportImpl runtimeAccessibilitySupport;
151+
private JNIRuntimeAccessibilitySupportImpl runtimeSupport;
152152

153153
private boolean sealed = false;
154154
private final Map<String, JNICallTrampolineMethod> trampolineMethods = new ConcurrentHashMap<>();
@@ -187,10 +187,10 @@ public void afterRegistration(AfterRegistrationAccess arg) {
187187

188188
JNIReflectionDictionary.create();
189189

190-
runtimeAccessibilitySupport = new JNIRuntimeAccessibilitySupportImpl();
191-
ImageSingletons.add(RuntimeJNIAccessSupport.class, runtimeAccessibilitySupport);
190+
runtimeSupport = new JNIRuntimeAccessibilitySupportImpl();
191+
ImageSingletons.add(RuntimeJNIAccessSupport.class, runtimeSupport);
192192

193-
ReflectionConfigurationParser<ConditionalElement<Class<?>>> parser = ConfigurationParserUtils.create(runtimeAccessibilitySupport, access.getImageClassLoader());
193+
ReflectionConfigurationParser<ConditionalElement<Class<?>>> parser = ConfigurationParserUtils.create(runtimeSupport, access.getImageClassLoader());
194194
loadedConfigurations = ConfigurationParserUtils.parseAndRegisterConfigurations(parser, access.getImageClassLoader(), "JNI",
195195
ConfigurationFiles.Options.JNIConfigurationFiles, ConfigurationFiles.Options.JNIConfigurationResources, ConfigurationFile.JNI.getFileName());
196196
}
@@ -247,7 +247,7 @@ public void beforeAnalysis(BeforeAnalysisAccess arg) {
247247
}
248248

249249
private static ConditionalConfigurationRegistry getConditionalConfigurationRegistry() {
250-
return singleton().runtimeAccessibilitySupport;
250+
return singleton().runtimeSupport;
251251
}
252252

253253
private static void registerJavaCallTrampoline(BeforeAnalysisAccessImpl access, CallVariant variant, boolean nonVirtual) {

0 commit comments

Comments
 (0)