Merge pull request #16620 from Christoph Dreis
* gh-16620: Optimize JarEntry construction Closes gh-16620
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user