[infer][java] Simplify some of the models of Java resources [2/n]

Summary: More simplifications of the models

Reviewed By: sblackshear

Differential Revision: D4541566

fbshipit-source-id: a0d0835
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent ecfb00e068
commit 266686457a

@ -12,17 +12,7 @@ package java.io;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public class BufferedWriter extends Writer { public abstract class BufferedWriter extends Writer {
private Writer out;
public BufferedWriter(Writer out) {
this.out = out;
}
public BufferedWriter(Writer out, int sz) {
this.out = out;
}
public void flush() throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
@ -52,11 +42,4 @@ public class BufferedWriter extends Writer {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void close() throws IOException {
if (out instanceof OutputStreamWriter) {
((OutputStreamWriter) out).close();
}
}
} }

@ -1,35 +0,0 @@
/*
* Copyright (c) 2013 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package java.io;
public class FileWriter extends OutputStreamWriter {
public FileWriter(String fileName) throws IOException {
super(new FileOutputStream(fileName));
}
public FileWriter(String fileName, boolean append) throws IOException {
super(new FileOutputStream(fileName, append));
}
public FileWriter(File file) throws IOException {
super(new FileOutputStream(file));
}
public FileWriter(File file, boolean append) throws IOException {
super(new FileOutputStream(file, append));
}
public FileWriter(FileDescriptor fd) {
super(new FileOutputStream(fd));
}
}

@ -9,17 +9,10 @@
package java.io; package java.io;
import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public abstract class OutputStream implements Closeable { public class OutputStream {
public void close() throws IOException {
if (this instanceof FileOutputStream) {
((FileOutputStream) this).close();
} else if (this instanceof FilterOutputStream) {
((FilterOutputStream) this).close();
}
}
public void write(int b) throws IOException { public void write(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
@ -36,4 +29,9 @@ public abstract class OutputStream implements Closeable {
public void flush() throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this);
}
} }

@ -9,6 +9,7 @@
package java.io; package java.io;
import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import com.facebook.infer.builtins.InferUtils; import com.facebook.infer.builtins.InferUtils;
@ -17,30 +18,16 @@ import java.nio.charset.CharsetEncoder;
public class OutputStreamWriter extends Writer { public class OutputStreamWriter extends Writer {
private OutputStream out;
public OutputStreamWriter(OutputStream out, String charsetName) public OutputStreamWriter(OutputStream out, String charsetName)
throws UnsupportedEncodingException { throws UnsupportedEncodingException {
if (charsetName == null) if (charsetName == null)
throw new NullPointerException("charsetName"); throw new NullPointerException("charsetName");
else if (InferUtils.isValidCharset(charsetName)) { else if (InferUtils.isValidCharset(charsetName)) {
this.out = out; InferBuiltins.__set_file_attribute(this);
} else } else
throw new UnsupportedEncodingException(); throw new UnsupportedEncodingException();
} }
public OutputStreamWriter(OutputStream out) {
this.out = out;
}
public OutputStreamWriter(OutputStream out, Charset cs) {
this.out = out;
}
public OutputStreamWriter(OutputStream out, CharsetEncoder enc) {
this.out = out;
}
public void flush() throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
@ -65,7 +52,4 @@ public class OutputStreamWriter extends Writer {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void close() throws IOException {
out.close();
}
} }

@ -9,44 +9,19 @@
package java.io; package java.io;
import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public class PrintWriter extends Writer { public abstract class PrintWriter {
protected Writer out; OutputStream mOutputStream;
public PrintWriter(OutputStream out) { public PrintWriter(OutputStream out) {
this(new OutputStreamWriter(out)); mOutputStream = out;
} }
public PrintWriter(OutputStream out, boolean autoFlush) { public PrintWriter(OutputStream out, boolean autoFlush) {
this(new OutputStreamWriter(out), autoFlush); mOutputStream = out;
}
public PrintWriter(Writer wr) {
out = wr;
}
public PrintWriter(Writer wr, boolean autoFlush) {
out = wr;
}
public PrintWriter(File file) throws FileNotFoundException {
this(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file))));
}
public PrintWriter(File file, String csn) throws FileNotFoundException,
UnsupportedEncodingException {
this(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file))));
}
public PrintWriter(String fileName) throws FileNotFoundException {
this(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(fileName))));
}
public PrintWriter(String fileName, String csn)
throws FileNotFoundException, UnsupportedEncodingException {
this(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(fileName))));
} }
public PrintWriter append(char c) throws IOException { public PrintWriter append(char c) throws IOException {
@ -65,19 +40,6 @@ public class PrintWriter extends Writer {
return this; return this;
} }
public void close() {
if (out != null) {
try {
if (out instanceof OutputStreamWriter) {
((OutputStreamWriter) out).close();
} else if (out instanceof BufferedWriter) {
((BufferedWriter) out).close();
}
} catch (IOException x) {
}
}
}
public void flush() throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
@ -102,5 +64,11 @@ public class PrintWriter extends Writer {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this);
if (mOutputStream != null) {
mOutputStream.close();
}
}
} }

@ -11,7 +11,7 @@ package java.io;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public abstract class Writer implements Closeable { public abstract class Writer {
public Writer append(char c) throws IOException { public Writer append(char c) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
@ -29,16 +29,6 @@ public abstract class Writer implements Closeable {
return this; return this;
} }
public void close() throws IOException {
if (this instanceof OutputStreamWriter) {
((OutputStreamWriter) this).close();
} else if (this instanceof BufferedWriter) {
((BufferedWriter) this).close();
} else if (this instanceof PrintWriter) {
((PrintWriter) this).close();
}
}
public void flush() throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
@ -63,5 +53,4 @@ public abstract class Writer implements Closeable {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -17,56 +17,48 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
class PlainSocketImpl extends SocketImpl { abstract class PlainSocketImpl extends SocketImpl {
PlainSocketImpl() { PlainSocketImpl() {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
protected void create(boolean stream) throws IOException { protected void create(boolean stream) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
protected void connect(String host, int port) throws IOException { protected void connect(String host, int port) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
protected void connect(InetAddress address, int port) throws IOException { protected void connect(InetAddress address, int port) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
protected void connect(SocketAddress address, int timeout) throws IOException { protected void connect(SocketAddress address, int timeout) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
protected void bind(InetAddress host, int port) throws IOException { protected void bind(InetAddress host, int port) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
protected void listen(int backlog) throws IOException { protected void listen(int backlog) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
protected void accept(SocketImpl s) throws IOException { protected void accept(SocketImpl s) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public synchronized InputStream getInputStream() throws IOException { public synchronized InputStream getInputStream() throws IOException {
return new PlainSocketInputStream(this); return new PlainSocketInputStream();
} }
public synchronized OutputStream getOutputStream() throws IOException { public synchronized OutputStream getOutputStream() throws IOException {
return new PlainSocketOutputStream(this); return new PlainSocketOutputStream();
} }
protected int available() throws IOException { protected int available() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
@ -138,20 +130,15 @@ class PlainSocketImpl extends SocketImpl {
} }
private static class PlainSocketInputStream extends InputStream { private static class PlainSocketInputStream extends InputStream {
private PlainSocketImpl socketImpl;
public PlainSocketInputStream(PlainSocketImpl socketImpl) { public PlainSocketInputStream() {
this.socketImpl = socketImpl; InferBuiltins.__set_file_attribute(this);
} }
public int available() throws IOException { public int available() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public void close() throws IOException {
socketImpl.close();
}
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
@ -159,17 +146,17 @@ class PlainSocketImpl extends SocketImpl {
public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException { public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
}
private static class PlainSocketOutputStream extends OutputStream { public void close() {
private PlainSocketImpl socketImpl; InferBuiltins.__set_mem_attribute(this);
}
public PlainSocketOutputStream(PlainSocketImpl socketImpl) {
this.socketImpl = socketImpl;
} }
public void close() throws IOException { private static class PlainSocketOutputStream extends OutputStream {
socketImpl.close();
public PlainSocketOutputStream() {
InferBuiltins.__set_file_attribute(this);
} }
public void write(int oneByte) throws IOException { public void write(int oneByte) throws IOException {
@ -179,6 +166,11 @@ class PlainSocketImpl extends SocketImpl {
public void write(byte[] buffer, int offset, int byteCount) throws IOException { public void write(byte[] buffer, int offset, int byteCount) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void close() {
InferBuiltins.__set_mem_attribute(this);
}
} }
} }

@ -15,32 +15,9 @@ import java.io.IOException;
public class ServerSocket { public class ServerSocket {
private SocketImpl impl;
public ServerSocket() throws IOException {
impl = new PlainSocketImpl();
}
public ServerSocket(int port) throws IOException {
this();
}
public ServerSocket(int port, int backlog) throws IOException {
this();
}
public ServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException {
this();
}
public void close() throws IOException {
((PlainSocketImpl) impl).close();
}
public Socket accept() throws IOException { public Socket accept() throws IOException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
Socket s = new Socket((SocketImpl) null); return new Socket();
return s;
} else throw new IOException(); } else throw new IOException();
} }

@ -17,67 +17,31 @@ import com.facebook.infer.builtins.InferBuiltins;
public class Socket { public class Socket {
SocketImpl impl; InputStream inputStream;
OutputStream outputStream;
public Socket() { public Socket() {
try { InferBuiltins.__set_file_attribute(this);
setImpl(); inputStream = new InputStream();
} catch (IOException e) { InferBuiltins.__set_file_attribute(inputStream);
} outputStream = new OutputStream();
} InferBuiltins.__set_file_attribute(outputStream);
void setImpl() throws IOException {
impl = new PlainSocketImpl();
}
public Socket(Proxy proxy) {
this();
}
protected Socket(SocketImpl impl) throws SocketException {
this();
}
public Socket(String host, int port) throws UnknownHostException,
IOException {
this();
}
public Socket(InetAddress address, int port) throws IOException {
this();
}
public Socket(String host, int port, InetAddress localAddr, int localPort)
throws IOException {
this();
}
public Socket(InetAddress address, int port, InetAddress localAddr,
int localPort) throws IOException {
this();
}
public Socket(String host, int port, boolean stream) throws IOException {
this();
}
public Socket(InetAddress host, int port, boolean stream)
throws IOException {
this();
} }
public InputStream getInputStream() throws IOException { public InputStream getInputStream() throws IOException {
InferBuiltins.__check_untainted(this); InferBuiltins.__check_untainted(this);
return ((PlainSocketImpl) impl).getInputStream(); return inputStream;
} }
public OutputStream getOutputStream() throws IOException { public OutputStream getOutputStream() throws IOException {
InferBuiltins.__check_untainted(this); InferBuiltins.__check_untainted(this);
return ((PlainSocketImpl) impl).getOutputStream(); return outputStream;
} }
public synchronized void close() throws IOException { public void close() {
((PlainSocketImpl) impl).close(); InferBuiltins.__set_mem_attribute(this);
InferBuiltins.__set_mem_attribute(inputStream);
InferBuiltins.__set_mem_attribute(outputStream);
} }
} }

@ -168,13 +168,11 @@ codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.socketNotClosed(
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK, [start of procedure themeObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(Object)] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK, [start of procedure themeObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(Object)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),Taking true branch,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),Taking true branch,exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK, [start of procedure twoResourcesRandomAccessFile(),Taking true branch,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK, [start of procedure twoResourcesRandomAccessFile(),Taking true branch,exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 10, RESOURCE_LEAK, [start of procedure twoResourcesServerSocket(),Taking true branch,exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketIgnoreExceptionNoVerify(SSLSocketFactory), 9, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketIgnoreExceptionNoVerify(...),start of procedure throwExceptionIfNoVerify(...),Taking true branch,exception javax.net.ssl.SSLException,return from a call to void TaintExample.throwExceptionIfNoVerify(SSLSocket,String),Switch condition is true. Entering switch case] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketIgnoreExceptionNoVerify(SSLSocketFactory), 9, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketIgnoreExceptionNoVerify(...),start of procedure throwExceptionIfNoVerify(...),Taking true branch,exception javax.net.ssl.SSLException,return from a call to void TaintExample.throwExceptionIfNoVerify(SSLSocket,String),Switch condition is true. Entering switch case]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketNotVerifiedSimple(...)] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketNotVerifiedSimple(...)]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 7, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketVerifiedForgotToCheckRetval(...)] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 7, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketVerifiedForgotToCheckRetval(...)]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference1(SSLSocketFactory), 4, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference1(...),start of procedure socketNotVerifiedSimple(...),return from a call to InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory)] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference1(SSLSocketFactory), 4, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference1(...),start of procedure socketNotVerifiedSimple(...),return from a call to InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory)]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference2(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference2(...),start of procedure callReadInputStreamCauseTaintError(...),start of procedure readInputStream(...),return from a call to InputStream TaintExample.readInputStream(Socket),return from a call to Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory)]
codetoanalyze/java/infer/TaintExample.java, Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure callReadInputStreamCauseTaintError(...)] codetoanalyze/java/infer/TaintExample.java, Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure callReadInputStreamCauseTaintError(...)]
codetoanalyze/java/infer/TaintExample.java, void TaintExample.contentValuesPutWithTaintedString(ContentValues,SharedPreferences,String,String), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure contentValuesPutWithTaintedString(...)] codetoanalyze/java/infer/TaintExample.java, void TaintExample.contentValuesPutWithTaintedString(ContentValues,SharedPreferences,String,String), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure contentValuesPutWithTaintedString(...)]
codetoanalyze/java/infer/TaintExample.java, void TaintExample.interprocTaintErrorWithModelMethods1(), 1, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure interprocTaintErrorWithModelMethods1(),start of procedure returnTaintedSourceModelMethods(),return from a call to Object TaintExample.returnTaintedSourceModelMethods()] codetoanalyze/java/infer/TaintExample.java, void TaintExample.interprocTaintErrorWithModelMethods1(), 1, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure interprocTaintErrorWithModelMethods1(),start of procedure returnTaintedSourceModelMethods(),return from a call to Object TaintExample.returnTaintedSourceModelMethods()]

@ -168,13 +168,11 @@ infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.sock
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK, [start of procedure themeObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(Object)] infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK, [start of procedure themeObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(Object)]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),Taking true branch,exception java.io.IOException] infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),Taking true branch,exception java.io.IOException]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK, [start of procedure twoResourcesRandomAccessFile(),Taking true branch,exception java.io.IOException] infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK, [start of procedure twoResourcesRandomAccessFile(),Taking true branch,exception java.io.IOException]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 10, RESOURCE_LEAK, [start of procedure twoResourcesServerSocket(),Taking true branch,exception java.io.IOException]
infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case] infer/tests/codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case]
infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketIgnoreExceptionNoVerify(SSLSocketFactory), 9, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketIgnoreExceptionNoVerify(...),start of procedure throwExceptionIfNoVerify(...),Taking true branch,exception javax.net.ssl.SSLException,return from a call to void TaintExample.throwExceptionIfNoVerify(SSLSocket,String),Switch condition is true. Entering switch case] infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketIgnoreExceptionNoVerify(SSLSocketFactory), 9, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketIgnoreExceptionNoVerify(...),start of procedure throwExceptionIfNoVerify(...),Taking true branch,exception javax.net.ssl.SSLException,return from a call to void TaintExample.throwExceptionIfNoVerify(SSLSocket,String),Switch condition is true. Entering switch case]
infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketNotVerifiedSimple(...)] infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketNotVerifiedSimple(...)]
infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 7, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketVerifiedForgotToCheckRetval(...)] infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 7, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketVerifiedForgotToCheckRetval(...)]
infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference1(SSLSocketFactory), 4, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference1(...),start of procedure socketNotVerifiedSimple(...),return from a call to InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory)] infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference1(SSLSocketFactory), 4, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference1(...),start of procedure socketNotVerifiedSimple(...),return from a call to InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory)]
infer/tests/codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference2(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference2(...),start of procedure callReadInputStreamCauseTaintError(...),start of procedure readInputStream(...),return from a call to InputStream TaintExample.readInputStream(Socket),return from a call to Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory)]
infer/tests/codetoanalyze/java/infer/TaintExample.java, Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure callReadInputStreamCauseTaintError(...)] infer/tests/codetoanalyze/java/infer/TaintExample.java, Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure callReadInputStreamCauseTaintError(...)]
infer/tests/codetoanalyze/java/infer/TaintExample.java, void TaintExample.contentValuesPutWithTaintedString(ContentValues,SharedPreferences,String,String), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure contentValuesPutWithTaintedString(...)] infer/tests/codetoanalyze/java/infer/TaintExample.java, void TaintExample.contentValuesPutWithTaintedString(ContentValues,SharedPreferences,String,String), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure contentValuesPutWithTaintedString(...)]
infer/tests/codetoanalyze/java/infer/TaintExample.java, void TaintExample.interprocTaintErrorWithModelMethods1(), 1, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure interprocTaintErrorWithModelMethods1(),start of procedure returnTaintedSourceModelMethods(),return from a call to Object TaintExample.returnTaintedSourceModelMethods()] infer/tests/codetoanalyze/java/infer/TaintExample.java, void TaintExample.interprocTaintErrorWithModelMethods1(), 1, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure interprocTaintErrorWithModelMethods1(),start of procedure returnTaintedSourceModelMethods(),return from a call to Object TaintExample.returnTaintedSourceModelMethods()]

@ -277,9 +277,6 @@ codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.socketNotClosed(
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK, [start of procedure themeObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(Object)] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.themeObtainTypedArrayAndLeak(Resources$Theme), 2, RESOURCE_LEAK, [start of procedure themeObtainTypedArrayAndLeak(...),start of procedure ignore(...),return from a call to void ResourceLeaks.ignore(Object)]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),Taking true branch,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResources(), 11, RESOURCE_LEAK, [start of procedure twoResources(),Taking true branch,exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK, [start of procedure twoResourcesRandomAccessFile(),Taking true branch,exception java.io.IOException] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesRandomAccessFile(), 10, RESOURCE_LEAK, [start of procedure twoResourcesRandomAccessFile(),Taking true branch,exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 7, NULL_TEST_AFTER_DEREFERENCE, [start of procedure twoResourcesServerSocket(),Taking false branch]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 8, NULL_TEST_AFTER_DEREFERENCE, [start of procedure twoResourcesServerSocket(),Taking true branch,Taking false branch]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.twoResourcesServerSocket(), 10, RESOURCE_LEAK, [start of procedure twoResourcesServerSocket(),Taking true branch,exception java.io.IOException]
codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case] codetoanalyze/java/infer/ResourceLeaks.java, void ResourceLeaks.zipFileLeakExceptionalBranch(), 5, RESOURCE_LEAK, [start of procedure zipFileLeakExceptionalBranch(),exception java.io.IOException,Switch condition is true. Entering switch case]
codetoanalyze/java/infer/ReturnValueIgnored.java, void ReturnValueIgnored.returnValueIgnored(), 1, RETURN_VALUE_IGNORED, [start of procedure returnValueIgnored()] codetoanalyze/java/infer/ReturnValueIgnored.java, void ReturnValueIgnored.returnValueIgnored(), 1, RETURN_VALUE_IGNORED, [start of procedure returnValueIgnored()]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketIgnoreExceptionNoVerify(SSLSocketFactory), 9, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketIgnoreExceptionNoVerify(...),start of procedure throwExceptionIfNoVerify(...),Taking true branch,exception javax.net.ssl.SSLException,return from a call to void TaintExample.throwExceptionIfNoVerify(SSLSocket,String),Switch condition is true. Entering switch case] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketIgnoreExceptionNoVerify(SSLSocketFactory), 9, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketIgnoreExceptionNoVerify(...),start of procedure throwExceptionIfNoVerify(...),Taking true branch,exception javax.net.ssl.SSLException,return from a call to void TaintExample.throwExceptionIfNoVerify(SSLSocket,String),Switch condition is true. Entering switch case]
@ -287,7 +284,6 @@ codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketNotVe
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 6, RETURN_VALUE_IGNORED, [start of procedure socketVerifiedForgotToCheckRetval(...)] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 6, RETURN_VALUE_IGNORED, [start of procedure socketVerifiedForgotToCheckRetval(...)]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 7, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketVerifiedForgotToCheckRetval(...)] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.socketVerifiedForgotToCheckRetval(SSLSocketFactory,HostnameVerifier,SSLSession), 7, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure socketVerifiedForgotToCheckRetval(...)]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference1(SSLSocketFactory), 4, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference1(...),start of procedure socketNotVerifiedSimple(...),return from a call to InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory)] codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference1(SSLSocketFactory), 4, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference1(...),start of procedure socketNotVerifiedSimple(...),return from a call to InputStream TaintExample.socketNotVerifiedSimple(SSLSocketFactory)]
codetoanalyze/java/infer/TaintExample.java, InputStream TaintExample.taintingShouldNotPreventInference2(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure taintingShouldNotPreventInference2(...),start of procedure callReadInputStreamCauseTaintError(...),start of procedure readInputStream(...),return from a call to InputStream TaintExample.readInputStream(Socket),return from a call to Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory)]
codetoanalyze/java/infer/TaintExample.java, Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure callReadInputStreamCauseTaintError(...)] codetoanalyze/java/infer/TaintExample.java, Socket TaintExample.callReadInputStreamCauseTaintError(SSLSocketFactory), 3, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure callReadInputStreamCauseTaintError(...)]
codetoanalyze/java/infer/TaintExample.java, void TaintExample.contentValuesPutWithTaintedString(ContentValues,SharedPreferences,String,String), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure contentValuesPutWithTaintedString(...)] codetoanalyze/java/infer/TaintExample.java, void TaintExample.contentValuesPutWithTaintedString(ContentValues,SharedPreferences,String,String), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure contentValuesPutWithTaintedString(...)]
codetoanalyze/java/infer/TaintExample.java, void TaintExample.interprocTaintErrorWithModelMethods1(), 1, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure interprocTaintErrorWithModelMethods1(),start of procedure returnTaintedSourceModelMethods(),return from a call to Object TaintExample.returnTaintedSourceModelMethods()] codetoanalyze/java/infer/TaintExample.java, void TaintExample.interprocTaintErrorWithModelMethods1(), 1, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure interprocTaintErrorWithModelMethods1(),start of procedure returnTaintedSourceModelMethods(),return from a call to Object TaintExample.returnTaintedSourceModelMethods()]
@ -308,15 +304,10 @@ codetoanalyze/java/infer/TaintExample.java, void TaintExample.testPrivacySourceA
codetoanalyze/java/infer/TaintExample.java, void TaintExample.testPrivacySourceFieldAnnotPropagation(), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure testPrivacySourceFieldAnnotPropagation()] codetoanalyze/java/infer/TaintExample.java, void TaintExample.testPrivacySourceFieldAnnotPropagation(), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure testPrivacySourceFieldAnnotPropagation()]
codetoanalyze/java/infer/TaintExample.java, void TaintExample.testPrivacySourceInstanceFieldAnnot(), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure testPrivacySourceInstanceFieldAnnot()] codetoanalyze/java/infer/TaintExample.java, void TaintExample.testPrivacySourceInstanceFieldAnnot(), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure testPrivacySourceInstanceFieldAnnot()]
codetoanalyze/java/infer/TaintExample.java, void TaintExample.testPrivacySourceStaticFieldAnnot(), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure testPrivacySourceStaticFieldAnnot()] codetoanalyze/java/infer/TaintExample.java, void TaintExample.testPrivacySourceStaticFieldAnnot(), 2, TAINTED_VALUE_REACHING_SENSITIVE_FUNCTION, [start of procedure testPrivacySourceStaticFieldAnnot()]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.bufferedWriterClosed(), 8, NULL_TEST_AFTER_DEREFERENCE, [start of procedure bufferedWriterClosed(),exception java.io.IOException,Switch condition is true. Entering switch case,Taking false branch]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.bufferedWriterNotClosedAfterWrite(), 7, RESOURCE_LEAK, [start of procedure bufferedWriterNotClosedAfterWrite(),exception java.io.IOException] codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.bufferedWriterNotClosedAfterWrite(), 7, RESOURCE_LEAK, [start of procedure bufferedWriterNotClosedAfterWrite(),exception java.io.IOException]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.fileWriterClosed(), 7, NULL_TEST_AFTER_DEREFERENCE, [start of procedure fileWriterClosed(),exception java.io.IOException,Switch condition is true. Entering switch case,Taking false branch]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.fileWriterNotClosedAfterWrite(), 6, RESOURCE_LEAK, [start of procedure fileWriterNotClosedAfterWrite(),exception java.io.IOException] codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.fileWriterNotClosedAfterWrite(), 6, RESOURCE_LEAK, [start of procedure fileWriterNotClosedAfterWrite(),exception java.io.IOException]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.outputStreamWriterClosed(), 7, NULL_TEST_AFTER_DEREFERENCE, [start of procedure outputStreamWriterClosed(),exception java.io.IOException,Switch condition is true. Entering switch case,Taking false branch]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.outputStreamWriterNotClosedAfterWrite(), 6, RESOURCE_LEAK, [start of procedure outputStreamWriterNotClosedAfterWrite(),exception java.io.IOException] codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.outputStreamWriterNotClosedAfterWrite(), 6, RESOURCE_LEAK, [start of procedure outputStreamWriterNotClosedAfterWrite(),exception java.io.IOException]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.pipedWriterNotClosedAfterConnect(PipedReader), 7, RESOURCE_LEAK, [start of procedure pipedWriterNotClosedAfterConnect(...),exception java.io.IOException] codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.pipedWriterNotClosedAfterConnect(PipedReader), 7, RESOURCE_LEAK, [start of procedure pipedWriterNotClosedAfterConnect(...),exception java.io.IOException]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.pipedWriterNotClosedAfterConstructedWithReader(), 8, RESOURCE_LEAK, [start of procedure pipedWriterNotClosedAfterConstructedWithReader(),exception java.io.IOException] codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.pipedWriterNotClosedAfterConstructedWithReader(), 8, RESOURCE_LEAK, [start of procedure pipedWriterNotClosedAfterConstructedWithReader(),exception java.io.IOException]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.printWriterClosed(), 7, NULL_TEST_AFTER_DEREFERENCE, [start of procedure printWriterClosed(),exception java.io.IOException,Switch condition is true. Entering switch case,Taking false branch]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.printWriterNotClosedAfterAppend(), 4, RESOURCE_LEAK, [start of procedure printWriterNotClosedAfterAppend()] codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.printWriterNotClosedAfterAppend(), 4, RESOURCE_LEAK, [start of procedure printWriterNotClosedAfterAppend()]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.writerClosed(), 7, NULL_TEST_AFTER_DEREFERENCE, [start of procedure writerClosed(),exception java.io.IOException,Switch condition is true. Entering switch case,Taking false branch]
codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.writerNotClosedAfterWrite(), 6, RESOURCE_LEAK, [start of procedure writerNotClosedAfterWrite(),exception java.io.IOException] codetoanalyze/java/infer/WriterLeaks.java, void WriterLeaks.writerNotClosedAfterWrite(), 6, RESOURCE_LEAK, [start of procedure writerNotClosedAfterWrite(),exception java.io.IOException]

Loading…
Cancel
Save