@@ -159,6 +159,7 @@ protected final void write(JarFile sourceJar, Libraries libraries, AbstractJarWr
159159 writeLoaderClasses (writer );
160160 writer .writeEntries (sourceJar , getEntityTransformer (), writeableLibraries );
161161 writeableLibraries .write (writer );
162+
162163 writeLayerIndex (writer );
163164 }
164165
@@ -425,14 +426,14 @@ private boolean isTransformable(JarArchiveEntry entry) {
425426 */
426427 private final class WritableLibraries implements UnpackHandler {
427428
428- private final Map <String , Library > libraryEntryNames = new LinkedHashMap <>();
429+ private final Map <String , Library > libraries = new LinkedHashMap <>();
429430
430431 WritableLibraries (Libraries libraries ) throws IOException {
431432 libraries .doWithLibraries ((library ) -> {
432433 if (isZip (library .getFile ())) {
433434 String location = getLocation (library );
434435 if (location != null ) {
435- Library existing = this .libraryEntryNames .putIfAbsent (location + library .getName (), library );
436+ Library existing = this .libraries .putIfAbsent (location + library .getName (), library );
436437 Assert .state (existing == null , "Duplicate library " + library .getName ());
437438 }
438439 }
@@ -452,25 +453,25 @@ private String getLocation(Library library) {
452453
453454 @ Override
454455 public boolean requiresUnpack (String name ) {
455- Library library = this .libraryEntryNames .get (name );
456+ Library library = this .libraries .get (name );
456457 return library != null && library .isUnpackRequired ();
457458 }
458459
459460 @ Override
460461 public String sha1Hash (String name ) throws IOException {
461- Library library = this .libraryEntryNames .get (name );
462+ Library library = this .libraries .get (name );
462463 Assert .notNull (library , "No library found for entry name '" + name + "'" );
463464 return FileUtils .sha1Hash (library .getFile ());
464465 }
465466
466467 private void write (AbstractJarWriter writer ) throws IOException {
467- for (Entry <String , Library > entry : this .libraryEntryNames .entrySet ()) {
468+ for (Entry <String , Library > entry : this .libraries .entrySet ()) {
468469 writer .writeNestedLibrary (entry .getKey ().substring (0 , entry .getKey ().lastIndexOf ('/' ) + 1 ),
469470 entry .getValue ());
470471 }
471472 if (getLayout () instanceof RepackagingLayout ) {
472473 String location = ((RepackagingLayout ) getLayout ()).getClasspathIndexFileLocation ();
473- writer .writeIndexFile (location , new ArrayList <>(this .libraryEntryNames .keySet ()));
474+ writer .writeIndexFile (location , new ArrayList <>(this .libraries .keySet ()));
474475 }
475476 }
476477
0 commit comments