Skip to content

Commit 0155d06

Browse files
committed
Just have module finder tell us the damn module name, if it fails then proceed to do our fallback of checking the manifest...
1 parent a4bfe9d commit 0155d06

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/main/java/org/mangorage/bootstrap/internal/JarHandler.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ interface UnsafeRunnable {
2424
enum ModuleNameOrigin {
2525
MODULE_INFO, // Takes Highest priority
2626
MANIFEST,
27+
MANIFEST_BUNDLE_SYMBOLIC_NAME,
2728
MULTI_RELEASE,
2829
GUESSED // Takes lowest
2930
}
@@ -136,6 +137,7 @@ private static Result resolveModuleName(Path jarPath) {
136137

137138
// 2. Check MANIFEST.MF for Automatic-Module-Name
138139
Manifest manifest = jarFile.getManifest();
140+
139141
if (manifest != null) {
140142
String autoName = manifest.getMainAttributes()
141143
.getValue("Automatic-Module-Name");
@@ -147,6 +149,18 @@ private static Result resolveModuleName(Path jarPath) {
147149
jarPath
148150
);
149151
}
152+
153+
String symbolicName = manifest.getMainAttributes()
154+
.getValue("Bundle-SymbolicName");
155+
156+
if (symbolicName != null) {
157+
return new Result(
158+
symbolicName,
159+
ModuleNameOrigin.MANIFEST_BUNDLE_SYMBOLIC_NAME,
160+
jarPath
161+
);
162+
}
163+
150164
}
151165

152166
// 3. Fallback: filename heuristic (aka desperation mode)

0 commit comments

Comments
 (0)