File tree 1 file changed +14
-0
lines changed
substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 25
25
package com .oracle .svm .core .jdk ;
26
26
27
27
import com .oracle .svm .core .annotate .Alias ;
28
+ import com .oracle .svm .core .annotate .RecomputeFieldValue ;
28
29
import com .oracle .svm .core .annotate .Substitute ;
29
30
import com .oracle .svm .core .annotate .TargetClass ;
30
31
import com .oracle .svm .core .annotate .TargetElement ;
40
41
@ SuppressWarnings ("unused" )
41
42
@ TargetClass (value = java .lang .Module .class )
42
43
public final class Target_java_lang_Module {
44
+
45
+ /**
46
+ * {@link Alias} to make {@code Module.layer} non-final. The actual run-time value is set via
47
+ * reflection in {@code ModuleLayerFeatureUtils#patchModuleLayerField}, which is called after
48
+ * analysis. Thus, we cannot leave it {@code final}, because the analysis might otherwise
49
+ * constant-fold the initial {@code null} value. Ideally, we would make it {@code @Stable}, but
50
+ * our substitution system currently does not allow this (GR-60154).
51
+ */
52
+ @ Alias //
53
+ @ RecomputeFieldValue (isFinal = false , kind = RecomputeFieldValue .Kind .None )
54
+ // @Stable (no effect currently GR-60154)
55
+ private ModuleLayer layer ;
56
+
43
57
@ Substitute
44
58
@ TargetElement (onlyWith = ForeignDisabled .class )
45
59
@ SuppressWarnings ("static-method" )
You can’t perform that action at this time.
0 commit comments