Buggy code:
public class ZipFile implements Closeable { private static final int HASH_SIZE = 509 ; static final int NIBLET_MASK = 15 ; static final int BYTE_SHIFT = 8 ; private static final int POS_0 = 0 ; private static final int POS_1 = 1 ; private static final int POS_2 = 2 ; private static final int POS_3 = 3 ; private final List < ZipArchiveEntry > entries = new LinkedList < ZipArchiveEntry > ( ) ; private final Map < String , LinkedList < ZipArchiveEntry > > nameMap = new HashMap < String , LinkedList < ZipArchiveEntry > > ( ZipFile . HASH_SIZE ) ; private static final class OffsetEntry { private long headerOffset = - 1 ; private long dataOffset = - 1 ; } private final String encoding ; private final ZipEncoding zipEncoding ; private final String archiveName ; private final RandomAccessFile archive ; private final boolean useUnicodeExtraFields ; private boolean closed = true ; private final byte [ ] DWORD_BUF = new byte [ ZipConstants . DWORD ] ; private final byte [ ] WORD_BUF = new byte [ ZipConstants . WORD ] ; private final byte [ ] CFH_BUF = new byte [ ZipFile . CFH_LEN ] ; private final byte [ ] SHORT_BUF = new byte [ ZipConstants . SHORT ] ; public ZipFile ( File f ) throws IOException { } public ZipFile ( String name ) throws IOException { } public ZipFile ( String name , String encoding ) throws IOException { } public ZipFile ( File f , String encoding ) throws IOException { } public ZipFile ( File f , String encoding , boolean useUnicodeExtraFields ) throws IOException { } public String getEncoding ( ) { } public void close ( ) throws IOException { } public static void closeQuietly ( ZipFile zipfile ) { } public Enumeration < ZipArchiveEntry > getEntries ( ) { } public Enumeration < ZipArchiveEntry > getEntriesInPhysicalOrder ( ) { <START_BUG> ZipArchiveEntry [ ] allEntries = entries . toArray ( new ZipArchiveEntry [ 0 ] ) ; <END_BUG> Arrays . sort ( allEntries , OFFSET_COMPARATOR ) ; return Collections . enumeration ( Arrays . asList ( allEntries ) ) ; } public ZipArchiveEntry getEntry ( String name ) { } public Iterable < ZipArchiveEntry > getEntries ( String name ) { } public Iterable < ZipArchiveEntry > getEntriesInPhysicalOrder ( String name ) { } public boolean canReadEntryData ( ZipArchiveEntry ze ) { } private InputStream getRawInputStream ( ZipArchiveEntry ze ) { } public void copyRawEntries ( ZipArchiveOutputStream target , ZipArchiveEntryPredicate predicate ) throws IOException { } public InputStream getInputStream ( ZipArchiveEntry ze ) throws IOException , ZipException { } public String getUnixSymlink ( ZipArchiveEntry entry ) throws IOException { } @ Override protected void finalize ( ) throws Throwable { } private static final int CFH_LEN = ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ZipConstants . SHORT ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . WORD ) ; private static final long CFH_SIG = ZipLong . getValue ( ZipArchiveOutputStream . CFH_SIG ) ; private Map < ZipArchiveEntry , ZipFile . NameAndComment > populateFromCentralDirectory ( ) throws IOException { } private void readCentralDirectoryEntry ( Map < ZipArchiveEntry , ZipFile . NameAndComment > noUTF8Flag ) throws IOException { } private void setSizesAndOffsetFromZip64Extra ( ZipArchiveEntry ze , ZipFile . OffsetEntry offset , int diskStart ) throws IOException { } static final int MIN_EOCD_SIZE = ( ( ( ( ( ( ( ZipConstants . WORD ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . SHORT ) ; private static final int MAX_EOCD_SIZE = ( ZipFile . MIN_EOCD_SIZE ) + ( ZipConstants . ZIP64_MAGIC_SHORT ) ; private static final int CFD_LOCATOR_OFFSET = ( ( ( ( ( ZipConstants . WORD ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . WORD ) ; private static final int ZIP64_EOCDL_LENGTH = ( ( ( ZipConstants . WORD ) + ( ZipConstants . WORD ) ) + ( ZipConstants . DWORD ) ) + ( ZipConstants . WORD ) ; private static final int ZIP64_EOCDL_LOCATOR_OFFSET = ( ZipConstants . WORD ) + ( ZipConstants . WORD ) ; private static final int ZIP64_EOCD_CFD_LOCATOR_OFFSET = ( ( ( ( ( ( ( ( ZipConstants . WORD ) + ( ZipConstants . DWORD ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . SHORT ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . WORD ) ) + ( ZipConstants . DWORD ) ) + ( ZipConstants . DWORD ) ) + ( ZipConstants . DWORD ) ; private void positionAtCentralDirectory ( ) throws IOException { } private void positionAtCentralDirectory64 ( ) throws IOException { } private void positionAtCentralDirectory32 ( ) throws IOException { } private void positionAtEndOfCentralDirectoryRecord ( ) throws IOException { } private boolean tryToLocateSignature ( long minDistanceFromEnd , long maxDistanceFromEnd , byte [ ] sig ) throws IOException { } private void skipBytes ( final int count ) throws IOException { }

Fix:
ZipArchiveEntry [ ] allEntries = entries . toArray ( new ZipArchiveEntry [ entries . size ( ) ] ) ;