diff -r f5a1bd5db861 -r 53a6fb443c20 jdk/test/tools/jlink/plugins/StripDebugPluginTest.java --- a/jdk/test/tools/jlink/plugins/StripDebugPluginTest.java Thu Jul 28 13:29:34 2016 +0100 +++ b/jdk/test/tools/jlink/plugins/StripDebugPluginTest.java Thu Jul 28 19:34:58 2016 +0530 @@ -54,10 +54,10 @@ import com.sun.tools.classfile.Method; import java.util.HashMap; import java.util.Map; -import jdk.tools.jlink.internal.ModulePoolImpl; +import jdk.tools.jlink.internal.ResourcePoolManager; import jdk.tools.jlink.internal.plugins.StripDebugPlugin; -import jdk.tools.jlink.plugin.ModuleEntry; -import jdk.tools.jlink.plugin.ModulePool; +import jdk.tools.jlink.plugin.ResourcePoolEntry; +import jdk.tools.jlink.plugin.ResourcePool; import jdk.tools.jlink.plugin.Plugin; import tests.Helper; @@ -106,36 +106,38 @@ path = path.replace('\\', '/'); StripDebugPlugin debug = new StripDebugPlugin(); debug.configure(new HashMap<>()); - ModuleEntry result1 = stripDebug(debug, ModuleEntry.create(path,content), path, infoPath, moduleInfo); + ResourcePoolEntry result1 = stripDebug(debug, ResourcePoolEntry.create(path,content), path, infoPath, moduleInfo); if (!path.endsWith("module-info.class")) { - if (result1.getLength() >= content.length) { + if (result1.contentLength() >= content.length) { throw new AssertionError("Class size not reduced, debug info not " + "removed for " + path); } - checkDebugAttributes(result1.getBytes()); + checkDebugAttributes(result1.contentBytes()); } - ModuleEntry result2 = stripDebug(debug, result1, path, infoPath, moduleInfo); - if (result1.getLength() != result2.getLength()) { + ResourcePoolEntry result2 = stripDebug(debug, result1, path, infoPath, moduleInfo); + if (result1.contentLength() != result2.contentLength()) { throw new AssertionError("removing debug info twice reduces class size of " + path); } - checkDebugAttributes(result1.getBytes()); + checkDebugAttributes(result1.contentBytes()); } - private ModuleEntry stripDebug(Plugin debug, ModuleEntry classResource, + private ResourcePoolEntry stripDebug(Plugin debug, ResourcePoolEntry classResource, String path, String infoPath, byte[] moduleInfo) throws Exception { - ModulePool resources = new ModulePoolImpl(); + ResourcePoolManager resources = new ResourcePoolManager(); resources.add(classResource); if (!path.endsWith("module-info.class")) { - ModuleEntry res2 = ModuleEntry.create(infoPath, moduleInfo); + ResourcePoolEntry res2 = ResourcePoolEntry.create(infoPath, moduleInfo); resources.add(res2); } - ModulePool results = new ModulePoolImpl(); - debug.visit(resources, results); - System.out.println(classResource.getPath()); - return results.findEntry(classResource.getPath()).get(); + ResourcePoolManager results = new ResourcePoolManager(); + ResourcePool resPool = debug.transform(resources.resourcePool(), + results.resourcePoolBuilder()); + System.out.println(classResource.path()); + + return resPool.findEntry(classResource.path()).get(); } private void checkDebugAttributes(byte[] strippedClassFile) throws IOException, ConstantPoolException {