[infer][java] Removing the models for com.squareup.okhttp.internal.StrictLineReader

Reviewed By: dulmarod

Differential Revision: D3929501

fbshipit-source-id: 450f5bd
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot 6
parent 168c613ac9
commit 2e2e9c89d6

@ -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();
}
}

@ -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);
}
}

@ -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;
}
}
}

Loading…
Cancel
Save