File tree 2 files changed +12
-0
lines changed
afterburner/src/main/java/com/fasterxml/jackson/module/afterburner
blackbird/src/main/java/com/fasterxml/jackson/module/blackbird 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 8
8
public class AfterburnerModule extends Module
9
9
implements java .io .Serializable // is this necessary?
10
10
{
11
+ // TODO: replace with jackson-databind/NativeImageUtil.RUNNING_IN_SVM
12
+ private static final boolean RUNNING_IN_SVM = System .getProperty ("org.graalvm.nativeimage.imagecode" ) != null ;
11
13
private static final long serialVersionUID = 1L ;
12
14
13
15
/*
@@ -49,6 +51,10 @@ public AfterburnerModule() { }
49
51
@ Override
50
52
public void setupModule (SetupContext context )
51
53
{
54
+ if (RUNNING_IN_SVM )
55
+ {
56
+ return ;
57
+ }
52
58
ClassLoader cl = _cfgUseValueClassLoader ? null : getClass ().getClassLoader ();
53
59
context .addBeanDeserializerModifier (new DeserializerModifier (cl ,
54
60
_cfgUseOptimizedBeanDeserializer ));
Original file line number Diff line number Diff line change 12
12
13
13
public class BlackbirdModule extends Module
14
14
{
15
+ // TODO: replace with jackson-databind/NativeImageUtil.RUNNING_IN_SVM
16
+ private static final boolean RUNNING_IN_SVM = System .getProperty ("org.graalvm.nativeimage.imagecode" ) != null ;
15
17
private Function <Class <?>, Lookup > _lookups ;
16
18
17
19
public BlackbirdModule () {
@@ -35,6 +37,10 @@ public BlackbirdModule(Supplier<MethodHandles.Lookup> lookup) {
35
37
@ Override
36
38
public void setupModule (SetupContext context )
37
39
{
40
+ if (RUNNING_IN_SVM )
41
+ {
42
+ return ;
43
+ }
38
44
CrossLoaderAccess openSesame = new CrossLoaderAccess ();
39
45
context .addBeanDeserializerModifier (new BBDeserializerModifier (_lookups , openSesame ));
40
46
context .addBeanSerializerModifier (new BBSerializerModifier (_lookups , openSesame ));
You can’t perform that action at this time.
0 commit comments