--- old/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java 2016-03-29 20:56:00.589738300 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jimage/JImageTask.java 2016-03-29 20:55:59.801693200 +0530 @@ -202,7 +202,7 @@ if (jimage.toFile().createNewFile()) { ImagePluginStack pc = ImagePluginConfiguration.parseConfiguration(taskHelper. - getPluginsConfig(null, false)); + getPluginsConfig(null)); ExtractedImage img = new ExtractedImage(dirPath, pc, log, options.verbose); img.recreateJImage(jimage); } else { --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java 2016-03-29 20:56:06.109054000 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/DefaultImageBuilder.java 2016-03-29 20:56:05.381012300 +0530 @@ -95,27 +95,23 @@ private final Path root; private final Path mdir; - private final boolean genBom; private final Set modules = new HashSet<>(); /** * Default image builder constructor. * - * @param genBom true, generates a bom file. * @param root The image root directory. * @throws IOException */ - public DefaultImageBuilder(boolean genBom, Path root) throws IOException { + public DefaultImageBuilder(Path root) throws IOException { Objects.requireNonNull(root); - this.genBom = genBom; - this.root = root; this.mdir = root.resolve("lib"); Files.createDirectories(mdir); } - private void storeFiles(Set modules, String bom, Properties release) throws IOException { + private void storeFiles(Set modules, Properties release) throws IOException { if (release != null) { addModules(release, modules); File r = new File(root.toFile(), "release"); @@ -123,11 +119,6 @@ release.store(fo, null); } } - // Generate bom - if (genBom) { - File bomFile = new File(root.toFile(), "bom"); - createUtf8File(bomFile, bom); - } } private void addModules(Properties release, Set modules) throws IOException { @@ -144,7 +135,7 @@ } @Override - public void storeFiles(Pool files, String bom, Properties release) { + public void storeFiles(Pool files, Properties release) { try { for (ModuleData f : files.getContent()) { if (!f.getType().equals(Pool.ModuleDataType.CLASS_OR_RESOURCE)) { @@ -161,7 +152,7 @@ modules.add(m.getName()); } } - storeFiles(modules, bom, release); + storeFiles(modules, release); if (Files.getFileStore(root).supportsFileAttributeView(PosixFileAttributeView.class)) { // launchers in the bin directory need execute permission @@ -190,8 +181,8 @@ } @Override - public void storeFiles(Pool files, String bom) { - storeFiles(files, bom, new Properties()); + public void storeFiles(Pool files) { + storeFiles(files, new Properties()); } /** --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java 2016-03-29 20:56:09.896270600 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/builder/ImageBuilder.java 2016-03-29 20:56:09.112225800 +0530 @@ -42,22 +42,20 @@ * Store the external files. * * @param content Pool of module content. - * @param bom The options used to build the image file. * @param release the release properties * @throws PluginException */ - public default void storeFiles(Pool content, String bom, Properties release) { - storeFiles(content, bom); + public default void storeFiles(Pool content, Properties release) { + storeFiles(content); } /** * Store the external files. * * @param content Pool of module content. - * @param bom The options used to build the image file. * @throws PluginException */ - public default void storeFiles(Pool content, String bom) { + public default void storeFiles(Pool content) { throw new UnsupportedOperationException("storeFiles"); } --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java 2016-03-29 20:56:14.141513400 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java 2016-03-29 20:56:13.281464200 +0530 @@ -87,7 +87,7 @@ ByteOrder byteOrder) throws IOException { return ImageFileCreator.create(archives, byteOrder, - new ImagePluginStack(null)); + new ImagePluginStack()); } public static ExecutableImage create(Set archives, --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java 2016-03-29 20:56:18.434759000 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java 2016-03-29 20:56:17.522706800 +0530 @@ -68,20 +68,13 @@ private ImagePluginConfiguration() { } - public static ImagePluginStack parseConfiguration(Jlink.PluginsConfiguration plugins) - throws Exception { - return parseConfiguration(plugins, null); - } - /* * Create a stack of plugins from a a configuration. - * */ - public static ImagePluginStack parseConfiguration(Jlink.PluginsConfiguration pluginsConfiguration, - String bom) + public static ImagePluginStack parseConfiguration(Jlink.PluginsConfiguration pluginsConfiguration) throws Exception { if (pluginsConfiguration == null) { - return new ImagePluginStack(bom); + return new ImagePluginStack(); } Map> plugins = new LinkedHashMap<>(); for (Plugin.CATEGORY cat : CATEGORIES_ORDER) { @@ -150,7 +143,7 @@ } @Override - public void storeFiles(Pool files, String bom) { + public void storeFiles(Pool files) { throw new PluginException("No directory setup to store files"); } }; @@ -158,6 +151,6 @@ PluginContext ctxt = pluginsConfiguration.getPluginContext(); return new ImagePluginStack(builder, transformerPlugins, - lastSorter, postProcessingPlugins, ctxt, bom); + lastSorter, postProcessingPlugins, ctxt); } } --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java 2016-03-29 20:56:22.945016900 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java 2016-03-29 20:56:21.998962800 +0530 @@ -167,28 +167,25 @@ private final ImageBuilder imageBuilder; private final Properties release; - private final String bom; - public ImagePluginStack(String bom) { + public ImagePluginStack() { this(null, Collections.emptyList(), null, - Collections.emptyList(), null, bom); + Collections.emptyList(), null); } public ImagePluginStack(ImageBuilder imageBuilder, List contentPlugins, Plugin lastSorter, - List postprocessingPlugins, - String bom) { + List postprocessingPlugins) { this(imageBuilder, contentPlugins, lastSorter, - postprocessingPlugins, null, bom); + postprocessingPlugins, null); } public ImagePluginStack(ImageBuilder imageBuilder, List contentPlugins, Plugin lastSorter, List postprocessingPlugins, - PluginContext ctxt, - String bom) { + PluginContext ctxt) { Objects.requireNonNull(contentPlugins); this.lastSorter = lastSorter; for (TransformerPlugin p : contentPlugins) { @@ -204,7 +201,6 @@ } this.imageBuilder = imageBuilder; this.release = ctxt != null? ctxt.getReleaseProperties() : new Properties(); - this.bom = bom; } public void operate(ImageProvider provider) throws Exception { @@ -479,7 +475,7 @@ } catch (Exception ignored) { } - imageBuilder.storeFiles(new LastPool(transformed), bom, release); + imageBuilder.storeFiles(new LastPool(transformed), release); } public ExecutableImage getExecutableImage() throws IOException { --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java 2016-03-29 20:56:27.198260200 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java 2016-03-29 20:56:26.306209200 +0530 @@ -142,9 +142,6 @@ } task.options.packagedModulesPath = path; }, true, "--keep-packaged-modules"), - new Option(false, (task, opt, arg) -> { - task.options.genbom = true; - }, true, "--genbom"), new Option(true, (task, opt, arg) -> { task.options.saveoptsfile = arg; }, "--saveopts"), @@ -175,7 +172,6 @@ static class OptionsValues { boolean help; - boolean genbom; String saveoptsfile; boolean version; boolean fullVersion; @@ -275,8 +271,7 @@ null); // Then create the Plugin Stack - ImagePluginStack stack = ImagePluginConfiguration.parseConfiguration(plugins, - genBOMContent(config, plugins)); + ImagePluginStack stack = ImagePluginConfiguration.parseConfiguration(plugins); //Ask the stack to proceed; stack.operate(imageProvider); @@ -297,7 +292,7 @@ } private void postProcessOnly(Path existingImage) throws Exception { - PluginsConfiguration config = taskHelper.getPluginsConfig(null, false); + PluginsConfiguration config = taskHelper.getPluginsConfig(null); ExecutableImage img = DefaultImageBuilder.getExecutableImage(existingImage); if (img == null) { throw taskHelper.newBadArgs("err.existing.image.invalid"); @@ -327,8 +322,7 @@ // Then create the Plugin Stack ImagePluginStack stack = ImagePluginConfiguration. - parseConfiguration(taskHelper.getPluginsConfig(options.output, options.genbom), - genBOMContent()); + parseConfiguration(taskHelper.getPluginsConfig(options.output)); //Ask the stack to proceed stack.operate(imageProvider); --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java 2016-03-29 20:56:31.137485500 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java 2016-03-29 20:56:30.353440700 +0530 @@ -337,8 +337,8 @@ return null; } - private PluginsConfiguration getPluginsConfig(Path output, - boolean genbom) throws IOException, BadArgs { + private PluginsConfiguration getPluginsConfig(Path output + ) throws IOException, BadArgs { if (output != null) { if (Files.exists(output)) { throw new PluginException(PluginsResourceBundle. @@ -367,7 +367,7 @@ // recreate or postprocessing don't require an output directory. ImageBuilder builder = null; if (output != null) { - builder = new DefaultImageBuilder(genbom, output); + builder = new DefaultImageBuilder(output); } return new Jlink.PluginsConfiguration(pluginsList, @@ -676,9 +676,9 @@ + bundleHelper.getMessage(key, args)); } - public PluginsConfiguration getPluginsConfig(Path output, boolean genbom) + public PluginsConfiguration getPluginsConfig(Path output) throws IOException, BadArgs { - return pluginOptions.getPluginsConfig(output, genbom); + return pluginOptions.getPluginsConfig(output); } public Path getExistingImage() { --- old/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties 2016-03-29 20:56:34.957704000 +0530 +++ new/src/jdk.jlink/share/classes/jdk/tools/jlink/resources/jlink.properties 2016-03-29 20:56:34.181659600 +0530 @@ -33,9 +33,6 @@ main.opt.endian=\ \ --endian Byte order of generated jimage (default:native) -main.opt.genbom=\ -\ --genbom Generate a bom file containing jlink info - main.opt.saveopts=\ \ --saveopts Save jlink options in the given file --- old/test/tools/jlink/ImageFileCreatorTest.java 2016-03-29 20:56:38.457904200 +0530 +++ new/test/tools/jlink/ImageFileCreatorTest.java 2016-03-29 20:56:37.728862500 +0530 @@ -214,14 +214,12 @@ } @Override - public void storeFiles(Pool content, String bom) { - + public void storeFiles(Pool content) { } - }; ImagePluginStack stack = new ImagePluginStack(noopBuilder, Collections.emptyList(), - null, Collections.emptyList(), ""); + null, Collections.emptyList()); ImageFileCreator.create(archives, ByteOrder.nativeOrder(), stack); } --- old/test/tools/jlink/IntegrationTest.java 2016-03-29 20:56:42.041109200 +0530 +++ new/test/tools/jlink/IntegrationTest.java 2016-03-29 20:56:41.259064400 +0530 @@ -241,7 +241,7 @@ lst.add(new MyPostProcessor()); } // Image builder - DefaultImageBuilder builder = new DefaultImageBuilder(true, output); + DefaultImageBuilder builder = new DefaultImageBuilder(output); PluginsConfiguration plugins = new Jlink.PluginsConfiguration(lst, builder, null); @@ -254,10 +254,6 @@ if (!jimage.exists()) { throw new AssertionError("jimage not generated"); } - File bom = new File(output.toString(), "bom"); - if (!bom.exists()) { - throw new AssertionError("bom not generated"); - } File release = new File(output.toString(), "release"); if (!release.exists()) { throw new AssertionError("release not generated"); @@ -311,7 +307,7 @@ } // Image builder - DefaultImageBuilder builder = new DefaultImageBuilder(false, output); + DefaultImageBuilder builder = new DefaultImageBuilder(output); PluginsConfiguration plugins = new Jlink.PluginsConfiguration(lst, builder, null); @@ -359,7 +355,7 @@ } // Image builder - DefaultImageBuilder builder = new DefaultImageBuilder(false, output); + DefaultImageBuilder builder = new DefaultImageBuilder(output); PluginsConfiguration plugins = new Jlink.PluginsConfiguration(lst, builder, null); boolean failed = false; --- old/test/tools/jlink/JLink2Test.java 2016-03-29 20:56:45.668316600 +0530 +++ new/test/tools/jlink/JLink2Test.java 2016-03-29 20:56:44.955275900 +0530 @@ -66,8 +66,6 @@ // This test case must be first one, the JlinkTask is clean // and reveals possible bug related to plugin options in defaults - // e. g.: --genbom - testBomFile(helper); testSameNames(helper); testModulePath(helper); testOptions(); @@ -136,35 +134,6 @@ validator.validate(); } - private static void testBomFile(Helper helper) throws Exception { - String[] userOptions = { - "--compress", - "2", - "--addmods", - "bomzip", - "--strip-debug", - "--genbom", - "--exclude-resources", - "*.jcov,*/META-INF/*"}; - String moduleName = "bomzip"; - helper.generateDefaultJModule(moduleName, "composite2"); - Path imgDir = helper.generateDefaultImage(userOptions, moduleName).assertSuccess(); - helper.checkImage(imgDir, moduleName, userOptions, null, null); - File bom = new File(imgDir.toFile(), "bom"); - if (!bom.exists()) { - throw new RuntimeException(bom.getAbsolutePath() + " not generated"); - } - String bomcontent = new String(Files.readAllBytes(bom.toPath())); - if (!bomcontent.contains("--strip-debug") - || !bomcontent.contains("--compress") - || !bomcontent.contains("--genbom") - || !bomcontent.contains("--exclude-resources *.jcov," - + "*/META-INF/*") - || !bomcontent.contains("--addmods bomzip")) { - throw new Exception("Not expected content in " + bom); - } - } - private static void testOptions() throws Exception { List builtInPlugins = new ArrayList<>(); builtInPlugins.addAll(PluginRepository.getPlugins(Layer.boot())); --- old/test/tools/jlink/plugins/FileCopierPluginTest.java 2016-03-29 20:56:49.238520800 +0530 +++ new/test/tools/jlink/plugins/FileCopierPluginTest.java 2016-03-29 20:56:48.516479500 +0530 @@ -101,9 +101,8 @@ } Path root = new File(".").toPath(); - DefaultImageBuilder imgbuilder = new DefaultImageBuilder(false, - root); - imgbuilder.storeFiles(pool, ""); + DefaultImageBuilder imgbuilder = new DefaultImageBuilder(root); + imgbuilder.storeFiles(pool); if (lic.exists()) { File license = new File(root.toFile(), "LICENSE");