Skip to content

Commit 44a2a61

Browse files
committed
[GR-68395] Fix -H:TrackDynamicAccess=all collecting unwanted class and module path entries
PullRequest: graal/21728
2 parents 0001744 + 03c0451 commit 44a2a61

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/DynamicAccessDetectionFeature.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public ConcurrentLinkedQueue<String> getMethodCallLocations(String methodName) {
108108
"java.lang.ClassLoader.loadClass",
109109
"java.lang.foreign.Linker.nativeLinker");
110110

111-
public static final String GRAAL_SUBPATH = File.separator + "graal" + File.separator;
112111
public static final String TRACK_ALL = "all";
113112

114113
private static final String OUTPUT_DIR_NAME = "dynamic-access";

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageClassLoaderSupport.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,14 +1180,8 @@ public void setPreserveAll(ValueWithOrigin<String> valueWithOrigin) {
11801180

11811181
public void setTrackAllDynamicAccess(ValueWithOrigin<String> valueWithOrigin) {
11821182
var origin = new IncludeOptionsSupport.ExtendedOptionWithOrigin(new IncludeOptionsSupport.ExtendedOption("", DynamicAccessDetectionFeature.TRACK_ALL), valueWithOrigin);
1183-
classpath().stream()
1184-
.map(Path::toString)
1185-
.filter(path -> !path.contains(DynamicAccessDetectionFeature.GRAAL_SUBPATH))
1186-
.forEach(entry -> dynamicAccessSelectors.addClassPathEntry(entry, origin));
1187-
modulepath().stream()
1188-
.map(Path::toString)
1189-
.filter(path -> !path.contains(DynamicAccessDetectionFeature.GRAAL_SUBPATH))
1190-
.forEach(entry -> dynamicAccessSelectors.addModule(entry, origin));
1183+
getModulePathsFinder().findAll().forEach(m -> dynamicAccessSelectors.addModule(m.descriptor().name(), origin));
1184+
dynamicAccessSelectors.addModule(ALL_UNNAMED, origin);
11911185
}
11921186

11931187
public Stream<Class<?>> getClassesToIncludeUnconditionally() {

0 commit comments

Comments
 (0)