|
|
@ -11,76 +11,56 @@ package java.util.zip;
|
|
|
|
|
|
|
|
|
|
|
|
import com.facebook.infer.models.InferBuiltins;
|
|
|
|
import com.facebook.infer.models.InferBuiltins;
|
|
|
|
import com.facebook.infer.models.InferUndefined;
|
|
|
|
import com.facebook.infer.models.InferUndefined;
|
|
|
|
import dalvik.system.CloseGuard;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.Enumeration;
|
|
|
|
import java.util.Enumeration;
|
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
|
|
|
|
import java.util.NoSuchElementException;
|
|
|
|
import java.util.NoSuchElementException;
|
|
|
|
|
|
|
|
|
|
|
|
public class ZipFile {
|
|
|
|
public class ZipFile {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void init() throws IOException {
|
|
|
|
|
|
|
|
InferUndefined.can_throw_ioexception_void();
|
|
|
|
|
|
|
|
InferBuiltins.__set_file_attribute(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public ZipFile(String name) throws IOException {
|
|
|
|
public ZipFile(String name) throws IOException {
|
|
|
|
InferUndefined.can_throw_ioexception_void();
|
|
|
|
init();
|
|
|
|
//Had to throw before setting attribute else
|
|
|
|
}
|
|
|
|
// whenInferRunsOnJarFileClosedThenResourceLeakIsNotFound fails
|
|
|
|
|
|
|
|
InferBuiltins.__set_file_attribute(this);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ZipFile(File file, int mode) throws IOException {
|
|
|
|
public ZipFile(File file, int mode) throws IOException {
|
|
|
|
InferUndefined.can_throw_ioexception_void();
|
|
|
|
init();
|
|
|
|
InferBuiltins.__set_file_attribute(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ZipFile(File file) throws ZipException, IOException {
|
|
|
|
public ZipFile(File file) throws ZipException, IOException {
|
|
|
|
this(file, 0);
|
|
|
|
init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public InputStream getInputStream(ZipEntry entry) throws IOException {
|
|
|
|
public void close() throws IOException {
|
|
|
|
FileInputStream in = new FileInputStream("");
|
|
|
|
InferBuiltins.__set_mem_attribute(this);
|
|
|
|
return new InflaterInputStream(in, null, 0) {
|
|
|
|
InferUndefined.can_throw_ioexception_void();
|
|
|
|
private boolean isClosed = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void close() throws IOException {
|
|
|
|
protected void finalize() throws IOException {
|
|
|
|
super.close();
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void fill() throws IOException {
|
|
|
|
public Enumeration<? extends ZipEntry> entries() {
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private boolean eof;
|
|
|
|
return new Enumeration<ZipEntry>() {
|
|
|
|
|
|
|
|
private boolean hasEls;
|
|
|
|
|
|
|
|
|
|
|
|
public int available() throws IOException {
|
|
|
|
public boolean hasMoreElements() {
|
|
|
|
return InferUndefined.can_throw_ioexception_int();
|
|
|
|
return hasEls;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void close() throws IOException {
|
|
|
|
public ZipEntry nextElement() throws NoSuchElementException {
|
|
|
|
InferBuiltins.__set_mem_attribute(this);
|
|
|
|
if (hasEls)
|
|
|
|
InferUndefined.can_throw_ioexception_void();
|
|
|
|
return new ZipEntry("");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
|
|
|
|
throw new NoSuchElementException();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected void finalize() throws IOException {
|
|
|
|
|
|
|
|
close();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Enumeration<? extends ZipEntry> entries() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new Enumeration<ZipEntry>() {
|
|
|
|
|
|
|
|
private boolean hasEls;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean hasMoreElements() {
|
|
|
|
|
|
|
|
return hasEls;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ZipEntry nextElement() throws NoSuchElementException {
|
|
|
|
|
|
|
|
if (hasEls)
|
|
|
|
|
|
|
|
return new ZipEntry("");
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
throw new NoSuchElementException();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|