diff --git a/infer/models/java/src/com/squareup/okhttp/internal/StrictLineReader.java b/infer/models/java/src/com/squareup/okhttp/internal/StrictLineReader.java deleted file mode 100644 index b913fd2d4..000000000 --- a/infer/models/java/src/com/squareup/okhttp/internal/StrictLineReader.java +++ /dev/null @@ -1,26 +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 com.squareup.okhttp.internal; - -import com.facebook.infer.builtins.InferUndefined; - -import java.io.IOException; - -public class StrictLineReader { - - public String readLine() throws IOException { - return InferUndefined.can_throw_ioexception_string(); - } - - public int readInt() throws IOException { - return InferUndefined.can_throw_ioexception_int(); - } - -} diff --git a/infer/models/java/src/com/squareup/okhttp/internal/Util.java b/infer/models/java/src/com/squareup/okhttp/internal/Util.java deleted file mode 100644 index fa25d4941..000000000 --- a/infer/models/java/src/com/squareup/okhttp/internal/Util.java +++ /dev/null @@ -1,24 +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 com.squareup.okhttp.internal; - -import com.facebook.infer.builtins.InferCloseables; - -import java.io.Closeable; -import java.io.IOException; - - -public class Util { - - public static void closeQuietly(Closeable closeable) throws IOException { - InferCloseables.closeQuietly(closeable); - } - -} diff --git a/infer/tests/codetoanalyze/java/infer/ReaderLeaks.java b/infer/tests/codetoanalyze/java/infer/ReaderLeaks.java index 409272452..41df66327 100644 --- a/infer/tests/codetoanalyze/java/infer/ReaderLeaks.java +++ b/infer/tests/codetoanalyze/java/infer/ReaderLeaks.java @@ -9,10 +9,6 @@ package codetoanalyze.java.infer; - -import com.squareup.okhttp.internal.StrictLineReader; -import com.squareup.okhttp.internal.Util; - import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileReader; @@ -203,34 +199,4 @@ public class ReaderLeaks { } } - private String strictLineReaderClosed(String journalFile) throws IOException { - FileInputStream fs = new FileInputStream(journalFile); - StrictLineReader reader = null; - try { - reader = new StrictLineReader(fs, Util.US_ASCII); - String magic = reader.readLine(); - return magic; - - } finally { - if (reader != null) - Util.closeQuietly(reader); - else fs.close(); - return null; - } - } - - private String strictLineReaderNoLeak(String journalFile) throws IOException { - - StrictLineReader reader = new StrictLineReader( - new FileInputStream(journalFile), Util.US_ASCII); - try { - String magic = reader.readLine(); - return magic; - - } finally { - Util.closeQuietly(reader); - return null; - } - } - }