Permalink
Browse files

Fix copying of archives that use a different deflation alg than the copy

  • Loading branch information...
1 parent ecb3994 commit 029726860cecf80089acf6aebb6f4ed660af06c3 @n1hility n1hility committed Oct 13, 2011
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/main/java/org/jboss/jandex/JarIndexer.java
@@ -52,7 +52,10 @@ public static Result createJarIndex(File jarFile, Indexer indexer, boolean modif
while (entries.hasMoreElements()) {
JarEntry entry = entries.nextElement();
if (modify) {
- zo.putNextEntry(entry);
+ JarEntry clone = (JarEntry) entry.clone();
+ // Compression level and format can vary across implementations
+ clone.setCompressedSize(-1);
+ zo.putNextEntry(clone);
copy(jar.getInputStream(entry), zo);
}

0 comments on commit 0297268

Please sign in to comment.