@@ -129,6 +129,7 @@ public static Resources[] layeredSingletons() {
129
129
* {see com.oracle.svm.hosted.ModuleLayerFeature}.
130
130
*/
131
131
private final EconomicMap <ModuleResourceKey , ConditionalRuntimeValue <ResourceStorageEntryBase >> resources = ImageHeapMap .createNonLayeredMap ();
132
+ /** Regexp patterns used to match names of resources to be included in the image. */
132
133
private final EconomicMap <RequestedPattern , RuntimeConditionSet > requestedPatterns = ImageHeapMap .createNonLayeredMap ();
133
134
134
135
/**
@@ -152,7 +153,7 @@ public static Resources[] layeredSingletons() {
152
153
@ Platforms (Platform .HOSTED_ONLY .class ) //
153
154
private final Set <String > previousLayerPatterns ;
154
155
155
- public record RequestedPattern (String module , String resource ) {
156
+ public record RequestedPattern (String module , String pattern ) {
156
157
}
157
158
158
159
public interface ModuleResourceKey {
@@ -437,6 +438,7 @@ public void registerIncludePattern(ConfigurationCondition condition, String modu
437
438
}
438
439
}
439
440
441
+ @ Platforms (Platform .HOSTED_ONLY .class )
440
442
private void addPattern (RequestedPattern pattern , RuntimeConditionSet condition ) {
441
443
if (!previousLayerPatterns .contains (pattern .toString ())) {
442
444
requestedPatterns .put (pattern , condition );
@@ -451,7 +453,7 @@ private void addPattern(RequestedPattern pattern, RuntimeConditionSet condition)
451
453
452
454
/*
453
455
* This handles generated include patterns which start and end with \Q and \E. The actual
454
- * resource name is located inbetween those tags.
456
+ * resource name is located in between those tags.
455
457
*/
456
458
@ Platforms (Platform .HOSTED_ONLY .class )
457
459
private static String handleEscapedCharacters (String pattern ) {
@@ -574,7 +576,7 @@ private static boolean missingResourceMatchesIncludePattern(String resourceName,
574
576
MapCursor <RequestedPattern , RuntimeConditionSet > cursor = r .requestedPatterns .getEntries ();
575
577
while (cursor .advance ()) {
576
578
RequestedPattern moduleResourcePair = cursor .getKey ();
577
- if (Objects .equals (moduleName , moduleResourcePair .module ) && matchResource (moduleResourcePair .resource , resourceName ) && cursor .getValue ().satisfied ()) {
579
+ if (Objects .equals (moduleName , moduleResourcePair .module ) && matchResource (moduleResourcePair .pattern , resourceName ) && cursor .getValue ().satisfied ()) {
578
580
return true ;
579
581
}
580
582
}
0 commit comments