Here is the getZipEntry method (starting from 1.7.0_10):
private ZipEntry getZipEntry(String name, long jzentry) { ZipEntry e = new ZipEntry(); e.flag = getEntryFlag(jzentry);
The only reason a NullPointerException will be thrown on this line would be if e , zc or bname were null .
e cannot be null because it is explicitly created in this method.
zc cannot be null :
public ZipFile(File file, int mode, Charset charset) throws IOException { this.zc = ZipCoder.get(charset); } static ZipCoder get(Charset charset) { return new ZipCoder(charset); }
This means that bname must be null , which is pretty hard to debug. getEntryBytes is a native method:
private static native byte[] getEntryBytes(long jzentry, int type);
Here's how I will continue:
- Find out if this is a particular zip file or all zip files. If this is a specific zip file, try redoing it.
- Update your version of Java, there may be an error with
getEntryBytes that has been fixed. - Submit Error Report to Oracle
source share