< prev index next >
test/hotspot/jtreg/runtime/cds/appcds/JarBuilder.java
Print this page
*** 124,163 ****
args.add(".");
executeProcess(args.toArray(new String[1]));
}
- // Add commonly used inner classes that are often omitted by mistake. Currently
- // we support only sun/hotspot/WhiteBox$WhiteBoxPermission. See JDK-8199290
- private static String[] addInnerClasses(String[] classes, int startIdx) {
- boolean seenWB = false;
- boolean seenWBInner = false;
- // This method is different than ClassFileInstaller.addInnerClasses which
- // uses "." as the package delimiter :-(
- final String wb = "sun/hotspot/WhiteBox";
- final String wbInner = "sun/hotspot/WhiteBox$WhiteBoxPermission";
-
- ArrayList<String> list = new ArrayList<>();
-
- for (int i = startIdx; i < classes.length; i++) {
- String cls = classes[i];
- list.add(cls);
- switch (cls) {
- case wb: seenWB = true; break;
- case wbInner: seenWBInner = true; break;
- }
- }
- if (seenWB && !seenWBInner) {
- list.add(wbInner);
- }
-
- String[] array = new String[list.size()];
- list.toArray(array);
- return array;
- }
-
-
private static String createSimpleJar(String jarclassDir, String jarName,
String[] classNames) throws Exception {
ArrayList<String> args = new ArrayList<String>();
args.add("cf");
--- 124,133 ----
*** 169,180 ****
}
private static void addClassArgs(ArrayList<String> args, String jarclassDir,
String[] classNames) {
- classNames = addInnerClasses(classNames, 0);
-
for (String name : classNames) {
args.add("-C");
args.add(jarclassDir);
args.add(name + ".class");
}
--- 139,148 ----
< prev index next >