Skip to content

Commit 471036b

Browse files
committed
Use RuntimeProxyCreation API were appropriate
1 parent ff91964 commit 471036b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/reflect/ReflectionDataBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252

5353
import org.graalvm.nativeimage.ImageSingletons;
5454
import org.graalvm.nativeimage.hosted.Feature.DuringAnalysisAccess;
55+
import org.graalvm.nativeimage.hosted.RuntimeProxyCreation;
5556
import org.graalvm.nativeimage.hosted.RuntimeReflection;
5657
import org.graalvm.nativeimage.impl.ConfigurationCondition;
5758
import org.graalvm.nativeimage.impl.RuntimeReflectionSupport;
@@ -66,7 +67,6 @@
6667
import com.oracle.svm.core.hub.ClassLoadingExceptionSupport;
6768
import com.oracle.svm.core.hub.DynamicHub;
6869
import com.oracle.svm.core.jdk.RecordSupport;
69-
import com.oracle.svm.core.jdk.proxy.DynamicProxyRegistry;
7070
import com.oracle.svm.core.reflect.SubstrateAccessor;
7171
import com.oracle.svm.core.util.UserError;
7272
import com.oracle.svm.core.util.VMError;
@@ -641,7 +641,7 @@ private static void registerTypes(DuringAnalysisAccessImpl access, Collection<Cl
641641
AnalysisType analysisType = access.getMetaAccess().lookupJavaType(type);
642642
makeAnalysisTypeReachable(access, analysisType);
643643
if (type.isAnnotation()) {
644-
ImageSingletons.lookup(DynamicProxyRegistry.class).addProxyClass(type);
644+
RuntimeProxyCreation.register(type);
645645
}
646646
/*
647647
* Exception proxies are stored as-is in the image heap

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/snippets/SubstrateGraphBuilderPlugins.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
package com.oracle.svm.hosted.snippets;
2626

27-
import java.awt.GraphicsEnvironment;
27+
import java.awt.*;
2828
import java.lang.ref.Reference;
2929
import java.lang.reflect.Array;
3030
import java.lang.reflect.Field;
@@ -91,6 +91,7 @@
9191
import org.graalvm.nativeimage.StackValue;
9292
import org.graalvm.nativeimage.c.function.CodePointer;
9393
import org.graalvm.nativeimage.c.struct.SizeOf;
94+
import org.graalvm.nativeimage.hosted.RuntimeProxyCreation;
9495
import org.graalvm.nativeimage.hosted.RuntimeReflection;
9596
import org.graalvm.word.LocationIdentity;
9697
import org.graalvm.word.Pointer;
@@ -278,7 +279,7 @@ private static void interceptProxyInterfaces(GraphBuilderContext b, ResolvedJava
278279
Class<?>[] interfaces = extractClassArray(snippetReflection, annotationSubstitutions, interfacesNode);
279280
if (interfaces != null) {
280281
/* The interfaces array can be empty. The java.lang.reflect.Proxy API allows it. */
281-
ImageSingletons.lookup(DynamicProxyRegistry.class).addProxyClass(interfaces);
282+
RuntimeProxyCreation.register(interfaces);
282283
if (ImageSingletons.contains(FallbackFeature.class)) {
283284
ImageSingletons.lookup(FallbackFeature.class).addAutoProxyInvoke(b.getMethod(), b.bci());
284285
}

0 commit comments

Comments
 (0)