Commit f40b086e authored by dreis2211's avatar dreis2211 Committed by Andy Wilkinson

Optimize JarEntry construction

This commit avoids calling the underlying ZipEntry.setExtra() method
that is not very inline friendly in cases where there is no extra
information to be set.

See gh-16620
parent fd14cd0b
......@@ -153,6 +153,10 @@ final class CentralDirectoryFileHeader implements FileHeader {
return this.extra;
}
public boolean hasExtra() {
return this.extra.length > 0;
}
public AsciiBytes getComment() {
return this.comment;
}
......
......@@ -56,7 +56,9 @@ class JarEntry extends java.util.jar.JarEntry implements FileHeader {
setComment(header.getComment().toString());
setSize(header.getSize());
setTime(header.getTime());
setExtra(header.getExtra());
if (header.hasExtra()) {
setExtra(header.getExtra());
}
}
AsciiBytes getAsciiBytesName() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment