From e7ee33487219d10f3ec15bd1861467c3c2ca4373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20W=C3=B6gerer?= Date: Tue, 5 Dec 2023 09:29:45 +0100 Subject: [PATCH] Add comments --- .../src/com/oracle/svm/driver/NativeImage.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java index b8ae9598628f..2fb1e4bd5298 100644 --- a/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java +++ b/substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java @@ -2110,12 +2110,17 @@ private void addImageClasspathEntry(LinkedHashSet destination, Path classp Path classpathEntryFinal = useBundle() ? bundleSupport.substituteClassPath(classpathEntry) : classpathEntry; if (!imageClasspath.contains(classpathEntryFinal) && !customImageClasspath.contains(classpathEntryFinal)) { + /* + * Maintain correct order by adding entry before processing its potential "Class-Path" + * attributes from META-INF/MANIFEST.MF (in case the entry is a jar-file). + */ boolean added = destination.add(classpathEntryFinal); if (ClasspathUtils.isJar(classpathEntryFinal)) { processJarManifestMainAttributes(classpathEntryFinal, (jarFilePath, attributes) -> handleClassPathAttribute(destination, jarFilePath, attributes)); } - boolean ignore = processClasspathNativeImageMetaInf(classpathEntryFinal); - if (added && ignore) { + boolean forcedOnModulePath = processClasspathNativeImageMetaInf(classpathEntryFinal); + if (added && forcedOnModulePath) { + /* Entry makes use of ForceOnModulePath. Undo adding to classpath. */ destination.remove(classpathEntryFinal); } }