@ Override public int compareTo ( final FastZipEntry o ) { final int diff0 = o . version - this . version ; if ( diff0 != 0 ) { return diff0 ; } final int diff1 = entryNameUnversioned . compareTo ( o . entryNameUnversioned ) ; if ( diff1 != 0 ) { return diff1 ; } final int diff2 = entryName . compareTo ( o . entryName ) ; if ( diff2 != 0 ) { return diff2 ; } // In case of multiple entries with the same entry name, return them in consecutive order of location, // so that the earliest entry overrides later entries (this is an arbitrary decision for consistency) final long diff3 = locHeaderPos - o . locHeaderPos ; return diff3 < 0L ? - 1 : diff3 > 0L ? 1 : 0 ; }
Sort in decreasing order of version number then lexicographically increasing order of unversioned entry path .