Buggy code:
public class ZipArchiveEntry extends ZipEntry implements ArchiveEntry { public static final int PLATFORM_UNIX = 3 ; public static final int PLATFORM_FAT = 0 ; private static final int SHORT_MASK = 65535 ; private static final int SHORT_SHIFT = 16 ; private static final byte [ ] EMPTY = new byte [ 0 ] ; private int method = - 1 ; private long size = SIZE_UNKNOWN ; private int internalAttributes = 0 ; private int platform = ZipArchiveEntry . PLATFORM_FAT ; private long externalAttributes = 0 ; private LinkedHashMap < ZipShort , ZipExtraField > extraFields = null ; private UnparseableExtraFieldData unparseableExtra = null ; private String name = null ; private byte [ ] rawName = null ; private GeneralPurposeBit gpb = new GeneralPurposeBit ( ) ; public ZipArchiveEntry ( String name ) { } public ZipArchiveEntry ( ZipEntry entry ) throws ZipException { } public ZipArchiveEntry ( ZipArchiveEntry entry ) throws ZipException { } protected ZipArchiveEntry ( ) { } public ZipArchiveEntry ( File inputFile , String entryName ) { } @ Override public Object clone ( ) { } @ Override public int getMethod ( ) { } @ Override public void setMethod ( int method ) { } public int getInternalAttributes ( ) { } public void setInternalAttributes ( int value ) { } public long getExternalAttributes ( ) { } public void setExternalAttributes ( long value ) { } public void setUnixMode ( int mode ) { } public int getUnixMode ( ) { } public boolean isUnixSymlink ( ) { } public int getPlatform ( ) { } protected void setPlatform ( int platform ) { } public void setExtraFields ( ZipExtraField [ ] fields ) { } public ZipExtraField [ ] getExtraFields ( ) { } public ZipExtraField [ ] getExtraFields ( boolean includeUnparseable ) { if ( ( extraFields ) == null ) { return ( ! includeUnparseable ) || ( ( unparseableExtra ) == null ) ? new ZipExtraField [ 0 ] : new ZipExtraField [ ] { unparseableExtra } ; } List < ZipExtraField > result = new ArrayList < ZipExtraField > ( extraFields . values ( ) ) ; if ( includeUnparseable && ( ( unparseableExtra ) != null ) ) { result . add ( unparseableExtra ) ; } <START_BUG> return result . toArray ( new ZipExtraField [ 0 ] ) ; <END_BUG> } public void addExtraField ( ZipExtraField ze ) { } public void addAsFirstExtraField ( ZipExtraField ze ) { } public void removeExtraField ( ZipShort type ) { } public void removeUnparseableExtraFieldData ( ) { } public ZipExtraField getExtraField ( ZipShort type ) { } public UnparseableExtraFieldData getUnparseableExtraFieldData ( ) { } @ Override public void setExtra ( byte [ ] extra ) throws RuntimeException { } protected void setExtra ( ) { } public void setCentralDirectoryExtra ( byte [ ] b ) { } public byte [ ] getLocalFileDataExtra ( ) { } public byte [ ] getCentralDirectoryExtra ( ) { } @ Override public String getName ( ) { } @ Override public boolean isDirectory ( ) { } protected void setName ( String name ) { } @ Override public long getSize ( ) { } @ Override public void setSize ( long size ) { } protected void setName ( String name , byte [ ] rawName ) { } public byte [ ] getRawName ( ) { } @ Override public int hashCode ( ) { } public GeneralPurposeBit getGeneralPurposeBit ( ) { } public void setGeneralPurposeBit ( GeneralPurposeBit b ) { } private void mergeExtraFields ( ZipExtraField [ ] f , boolean local ) throws ZipException { } public Date getLastModifiedDate ( ) { } @ Override public boolean equals ( Object obj ) { } }

Fix:
return result . toArray ( new ZipExtraField [ result . size ( ) ] ) ;