8132994: /modules and /packages should not be parsed by the jimage parser

Reviewed-by: sundar
This commit is contained in:
Jim Laskey 2016-04-26 11:55:52 -03:00
parent 5125f71376
commit fb8f4acea8

View File

@ -61,6 +61,13 @@ public final class ImageLocationWriter extends ImageLocation {
String baseName;
String extensionName = "";
if (fullName.startsWith("/modules/")) {
moduleName = "modules";
baseName = fullName.substring("/modules/".length());
} else if ( fullName.startsWith("/packages/")) {
moduleName = "packages";
baseName = fullName.substring("/packages/".length());
} else {
int offset = fullName.indexOf('/', 1);
if (fullName.length() >= 2 && fullName.charAt(0) == '/' && offset != -1) {
moduleName = fullName.substring(1, offset);
@ -80,6 +87,7 @@ public final class ImageLocationWriter extends ImageLocation {
} else {
baseName = fullName;
}
}
return new ImageLocationWriter(strings)
.addAttribute(ATTRIBUTE_MODULE, moduleName)