[RFC] Format all java files

Reviewed By: jeremydubreil

Differential Revision: D10067033

fbshipit-source-id: 73975664e
master
Mehdi Bouaziz 6 years ago committed by Facebook Github Bot
parent d4f943e953
commit 7c89d92851

@ -10,9 +10,7 @@ package infer.inferandroidexample;
import android.app.Application; import android.app.Application;
import android.test.ApplicationTestCase; import android.test.ApplicationTestCase;
/** /** <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> { public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() { public ApplicationTest() {
super(Application.class); super(Application.class);

@ -14,5 +14,4 @@ public class Generated {
static Object returnsNull() { static Object returnsNull() {
return null; return null;
} }
} }

@ -7,16 +7,14 @@
package infer.inferandroidexample; package infer.inferandroidexample;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.util.Calendar; import java.util.Calendar;
public class MainActivity extends ActionBarActivity { public class MainActivity extends ActionBarActivity {
@Override @Override
@ -81,5 +79,4 @@ public class MainActivity extends ActionBarActivity {
Object o = Generated.returnsNull(); Object o = Generated.returnsNull();
o.toString(); o.toString();
} }
} }

@ -8,8 +8,8 @@
package infer.other; package infer.other;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle; import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
public class MainActivity extends ActionBarActivity { public class MainActivity extends ActionBarActivity {
@ -26,5 +26,4 @@ public class MainActivity extends ActionBarActivity {
void shouldNotBeReported() { void shouldNotBeReported() {
source().toString(); source().toString();
} }
} }

@ -42,9 +42,8 @@ class Hello {
} }
/** /**
* This method should be rewritten with nested try { ... } finally { * This method should be rewritten with nested try { ... } finally { ... } statements, or the
* ... } statements, or the possible exception raised by fis.close() * possible exception raised by fis.close() should be swallowed.
* should be swallowed.
*/ */
void twoResources() throws IOException { void twoResources() throws IOException {
FileInputStream fis = null; FileInputStream fis = null;
@ -54,9 +53,12 @@ class Hello {
fos = new FileOutputStream(new File("everwhat.txt")); fos = new FileOutputStream(new File("everwhat.txt"));
fos.write(fis.read()); fos.write(fis.read());
} finally { } finally {
if (fis != null) { fis.close(); } if (fis != null) {
if (fos != null) { fos.close(); } fis.close();
}
if (fos != null) {
fos.close();
}
} }
} }
} }

@ -10,8 +10,7 @@ package hello;
public class Pointers { public class Pointers {
public static class A { public static class A {
public void method() { public void method() {}
}
} }
public static A mayReturnNull(int i) { public static A mayReturnNull(int i) {
@ -20,5 +19,4 @@ public class Pointers {
} }
return null; return null;
} }
} }

@ -21,5 +21,4 @@ public class Resources {
return null; return null;
} }
} }
} }

@ -7,9 +7,9 @@
package com.facebook.infer.annotation; package com.facebook.infer.annotation;
import javax.annotation.Nullable;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.annotation.Nullable;
public class Assertions { public class Assertions {
@ -53,11 +53,9 @@ public class Assertions {
return assertNotNull(map.get(key)); return assertNotNull(map.get(key));
} }
public static void assumeCondition(boolean condition) { public static void assumeCondition(boolean condition) {}
}
public static void assumeCondition(boolean condition, String explanation) { public static void assumeCondition(boolean condition, String explanation) {}
}
public static void assertCondition(boolean condition) { public static void assertCondition(boolean condition) {
if (!condition) { if (!condition) {

@ -12,9 +12,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /** Annotation for a boolean function returning false when the argument is null. */
* Annotation for a boolean function returning false when the argument is null.
*/
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ElementType.METHOD}) @Target({ElementType.METHOD})
public @interface FalseOnNull {} public @interface FalseOnNull {}

@ -12,29 +12,23 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** Annotation for methods that always return the same value. The annotation is inherited by /**
* Annotation for methods that always return the same value. The annotation is inherited by
* overrides of methods. * overrides of methods.
* *
* This annotation is used to suppress benign race warnings on fields assigned to methods annotated * <p>This annotation is used to suppress benign race warnings on fields assigned to methods
* with {@literal @Functional} in the thread-safety analysis. For example: * annotated with {@literal @Functional} in the thread-safety analysis. For example:
* *
* T mField; * <p>T mField; {@literal @Functional} T someMethod(); public void getField() { if (mField == null)
* {@literal @Functional} T someMethod(); * { mField = someMethod(); } return mField; }
* public void getField() {
* if (mField == null) {
* mField = someMethod();
* }
* return mField;
* }
* *
* Normally, we'd report that the access to mField is unsafe, but we won't report here because of * <p>Normally, we'd report that the access to mField is unsafe, but we won't report here because of
* the {@literal @Functional} annotation. * the {@literal @Functional} annotation.
* *
* If the return value of the annotated function is a double or long, the annotation will be * <p>If the return value of the annotated function is a double or long, the annotation will be
* ignored because writes to doubles/longs are not guaranteed to be atomic. That is, if type T was * ignored because writes to doubles/longs are not guaranteed to be atomic. That is, if type T was
* `long` in the example above, the write-write race on mField would no longer be benign. * `long` in the example above, the write-write race on mField would no longer be benign.
*/ */
@Target({ElementType.METHOD}) @Target({ElementType.METHOD})
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
public @interface Functional {} public @interface Functional {}

@ -13,11 +13,11 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* A method annotated with @Initializer should always be be called before the object is used. * A method annotated with @Initializer should always be be called before the object is used. Users
* Users of the class and static checkers must enforce, and can rely on, this invariant. * of the class and static checkers must enforce, and can rely on, this invariant. Examples include
* Examples include methods called indirectly by the constructor, protocols of init-then-use * methods called indirectly by the constructor, protocols of init-then-use where some values are
* where some values are initialized after construction but before the first use, * initialized after construction but before the first use, and builder classes where an object
* and builder classes where an object initialization must complete before build() is called. * initialization must complete before build() is called.
*/ */
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD}) @Target({ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD})

@ -13,9 +13,6 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target( @Target(ElementType.PARAMETER // a user-controlled should not flow to this parameter
ElementType.PARAMETER // a user-controlled should not flow to this parameter
) )
public @interface IntegritySink {}
public @interface IntegritySink {
}

@ -13,11 +13,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target(value={ @Target(
value = {
ElementType.METHOD, // method returns something user-controlled ElementType.METHOD, // method returns something user-controlled
ElementType.PARAMETER, // parameter is user-controlled ElementType.PARAMETER, // parameter is user-controlled
ElementType.FIELD, // field is user-controlled ElementType.FIELD, // field is user-controlled
}) })
public @interface IntegritySource {}
public @interface IntegritySource {
}

@ -13,11 +13,7 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
ElementType.CONSTRUCTOR,
ElementType.METHOD,
ElementType.TYPE
})
// Signal to the starvation checker that the method (or all the methods of the class, // Signal to the starvation checker that the method (or all the methods of the class,
// if at class level) does not perform any potentially blocking operations. Can be used to // if at class level) does not perform any potentially blocking operations. Can be used to

@ -13,12 +13,10 @@ import java.lang.annotation.RetentionPolicy;
/** /**
* Marks a class as one that is expected to be extended. * Marks a class as one that is expected to be extended.
* *
* This annotation is meant to counter common misuses of subclassing. Annotate your class with this * <p>This annotation is meant to counter common misuses of subclassing. Annotate your class with
* only if it was built with the purpose of being extended. * this only if it was built with the purpose of being extended.
* *
* Avoid adding this to classes that have existed for a long time without needing it. * <p>Avoid adding this to classes that have existed for a long time without needing it.
*/ */
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface OkToExtend { public @interface OkToExtend {}
}

@ -13,11 +13,16 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* A class field, or method return/parameter type, of Optional type is annotated @Present * A class field, or method return/parameter type, of Optional type is annotated @Present to
* to indicate that its value cannot be absent. * indicate that its value cannot be absent. Users of the method/field and static checkers must
* Users of the method/field and static checkers must enforce, and can rely on, this invariant. * enforce, and can rely on, this invariant.
*/ */
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, @Target({
ElementType.METHOD, ElementType.PARAMETER}) ElementType.TYPE,
ElementType.FIELD,
ElementType.CONSTRUCTOR,
ElementType.METHOD,
ElementType.PARAMETER
})
public @interface Present {} public @interface Present {}

@ -13,9 +13,6 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target( @Target(ElementType.PARAMETER // a privacy source should not flow to this parameter
ElementType.PARAMETER // a privacy source should not flow to this parameter
) )
public @interface PrivacySink {}
public @interface PrivacySink {
}

@ -13,11 +13,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target(value={ @Target(
value = {
ElementType.METHOD, // method returns something private ElementType.METHOD, // method returns something private
ElementType.PARAMETER, // parameter is private ElementType.PARAMETER, // parameter is private
ElementType.FIELD, // field is private ElementType.FIELD, // field is private
}) })
public @interface PrivacySource {}
public @interface PrivacySource {
}

@ -12,10 +12,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /** Annotation to indicate that when the parameter is null, the result is also null. */
* Annotation to indicate that when the parameter is null, the result is also null.
*/
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ElementType.PARAMETER}) @Target({ElementType.PARAMETER})
public @interface PropagatesNullable { public @interface PropagatesNullable {}
}

@ -15,10 +15,9 @@ import java.lang.annotation.Target;
/** /**
* Tell the thread-safety analysis that this method transfers ownership of its return value to its * Tell the thread-safety analysis that this method transfers ownership of its return value to its
* caller. Ownership means that the caller is allowed to both read and write the value outside of * caller. Ownership means that the caller is allowed to both read and write the value outside of
* synchronization. The annotated method should not retain any references to the value. * synchronization. The annotated method should not retain any references to the value. This
* This annotation is trusted for now, but may be checked eventually. * annotation is trusted for now, but may be checked eventually.
*/ */
@Target(ElementType.METHOD) @Target(ElementType.METHOD)
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
public @interface ReturnsOwnership { public @interface ReturnsOwnership {}
}

@ -17,7 +17,6 @@ import java.lang.annotation.Target;
ElementType.CONSTRUCTOR, ElementType.CONSTRUCTOR,
ElementType.METHOD, ElementType.METHOD,
}) })
public @interface SuppressLint { public @interface SuppressLint {
String[] value(); String[] value();
} }

@ -13,8 +13,8 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* View can be annotated with @SuppressViewNullability to silence warnings when * View can be annotated with @SuppressViewNullability to silence warnings when a view is set to
* a view is set to null in a destructor, and created in an initializer. * null in a destructor, and created in an initializer.
*/ */
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target(ElementType.FIELD) @Target(ElementType.FIELD)

@ -13,12 +13,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /**
* Tell the analysis that a collection is thread-safe when this information is not already * Tell the analysis that a collection is thread-safe when this information is not already reflected
* reflected in the collection's type. For example: * in the collection's type. For example: private {@literal @SynchronizedCollection} Map mMap =
* private {@literal @SynchronizedCollection} Map mMap = Collections.synchronizedMap(...); * Collections.synchronizedMap(...);
*/ */
@Target({ElementType.FIELD}) @Target({ElementType.FIELD})
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
public @interface SynchronizedCollection { public @interface SynchronizedCollection {}
}

@ -17,12 +17,13 @@ import java.lang.annotation.Target;
* class/field/method are confined to the given thread name. For the thread name, you can either use * class/field/method are confined to the given thread name. For the thread name, you can either use
* the default constants UI/ANY or add your own. * the default constants UI/ANY or add your own.
*/ */
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) @Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
public @interface ThreadConfined { public @interface ThreadConfined {
String value(); /** the thread that the mutations should be confined to */ String value();
public static String UI = "UI"; /** confined to the UI thread */ /** the thread that the mutations should be confined to */
public static String ANY = "ANY"; /** confined to any thread (but only that thread!) */ public static String UI = "UI";
/** confined to the UI thread */
public static String ANY = "ANY";
/** confined to any thread (but only that thread!) */
} }

@ -17,7 +17,6 @@ import java.lang.annotation.Target;
* applied to methods. In addition, you can ask Infer to assume thread-safety rather than checking * applied to methods. In addition, you can ask Infer to assume thread-safety rather than checking
* it by using {@literal @ThreadSafe(enableChecks = false)}. * it by using {@literal @ThreadSafe(enableChecks = false)}.
*/ */
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE}) @Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
public @interface ThreadSafe { public @interface ThreadSafe {

@ -12,9 +12,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
/** /** Annotation for a boolean function returning true when the argument is null. */
* Annotation for a boolean function returning true when the argument is null.
*/
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ElementType.METHOD}) @Target({ElementType.METHOD})
public @interface TrueOnNull {} public @interface TrueOnNull {}

@ -19,6 +19,4 @@ import java.lang.annotation.Target;
ElementType.PACKAGE, ElementType.PACKAGE,
ElementType.TYPE, ElementType.TYPE,
}) })
public @interface Verify {}
public @interface Verify {
}

@ -10,17 +10,17 @@ package com.facebook.infer.builtins;
public class InferBuiltins { public class InferBuiltins {
public native static void __set_file_attribute(Object o); public static native void __set_file_attribute(Object o);
public native static void __set_mem_attribute(Object o); public static native void __set_mem_attribute(Object o);
public native static void __set_locked_attribute(Object o); public static native void __set_locked_attribute(Object o);
public native static void __delete_locked_attribute(Object o); public static native void __delete_locked_attribute(Object o);
public native static void _exit(); public static native void _exit();
private native static void __infer_assume(boolean condition); private static native void __infer_assume(boolean condition);
public static void assume(boolean condition) { public static void assume(boolean condition) {
__infer_assume(condition); __infer_assume(condition);
@ -32,6 +32,5 @@ public class InferBuiltins {
o.hashCode(); o.hashCode();
} }
public native static String __split_get_nth(String s, String sep, int n); public static native String __split_get_nth(String s, String sep, int n);
} }

@ -12,8 +12,7 @@ import java.io.Closeable;
public final class InferCloseables { public final class InferCloseables {
private InferCloseables() { private InferCloseables() {}
}
public static void close(Closeable closeable) { public static void close(Closeable closeable) {
if (closeable != null) { if (closeable != null) {
@ -24,5 +23,4 @@ public final class InferCloseables {
public static void closeQuietly(Closeable closeable) { public static void closeQuietly(Closeable closeable) {
close(closeable); close(closeable);
} }
} }

@ -7,10 +7,10 @@
package com.facebook.infer.builtins; package com.facebook.infer.builtins;
/** WARNING! These methods are for testing the taint analysis only! Don't use them in models or in /**
* WARNING! These methods are for testing the taint analysis only! Don't use them in models or in
* real code. * real code.
*/ */
public class InferTaint { public class InferTaint {
// these are to test whether we can add a taint spec to methods that have an implementation // these are to test whether we can add a taint spec to methods that have an implementation
@ -20,13 +20,10 @@ public class InferTaint {
return o; return o;
} }
public static void inferSensitiveSink(Object iMightBeTainted) { public static void inferSensitiveSink(Object iMightBeTainted) {}
}
// these are to test whether we can add a taint spec to undefined methods // these are to test whether we can add a taint spec to undefined methods
public static native Object inferSecretSourceUndefined(); public static native Object inferSecretSourceUndefined();
public static native void inferSensitiveSinkUndefined(Object iMightBeTainted); public static native void inferSensitiveSinkUndefined(Object iMightBeTainted);
} }

@ -12,7 +12,6 @@ import java.io.IOException;
import java.net.SocketException; import java.net.SocketException;
import java.sql.SQLException; import java.sql.SQLException;
public class InferUndefined { public class InferUndefined {
public static native boolean boolean_undefined(); public static native boolean boolean_undefined();
@ -38,95 +37,83 @@ public class InferUndefined {
public static void can_throw_ioexception_void() throws IOException { public static void can_throw_ioexception_void() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
} else } else throw new IOException();
throw new IOException();
} }
public static boolean can_throw_ioexception_boolean() throws IOException { public static boolean can_throw_ioexception_boolean() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return undef; return undef;
} else } else throw new IOException();
throw new IOException();
} }
public static int can_throw_ioexception_int() throws IOException { public static int can_throw_ioexception_int() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return int_undefined(); return int_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static long can_throw_ioexception_long() throws IOException { public static long can_throw_ioexception_long() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return long_undefined(); return long_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static byte can_throw_ioexception_byte() throws IOException { public static byte can_throw_ioexception_byte() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return byte_undefined(); return byte_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static short can_throw_ioexception_short() throws IOException { public static short can_throw_ioexception_short() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return short_undefined(); return short_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static float can_throw_ioexception_float() throws IOException { public static float can_throw_ioexception_float() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return float_undefined(); return float_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static double can_throw_ioexception_double() throws IOException { public static double can_throw_ioexception_double() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return double_undefined(); return double_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static char can_throw_ioexception_char() throws IOException { public static char can_throw_ioexception_char() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return char_undefined(); return char_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static String can_throw_ioexception_string() throws IOException { public static String can_throw_ioexception_string() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return (String) object_undefined(); return (String) object_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static Object can_throw_ioexception_object() throws IOException { public static Object can_throw_ioexception_object() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return object_undefined(); return object_undefined();
} else } else throw new IOException();
throw new IOException();
} }
public static void can_throw_sqlexception_void() throws SQLException { public static void can_throw_sqlexception_void() throws SQLException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
} else } else throw new SQLException();
throw new SQLException();
} }
public static int nonneg_int() { public static int nonneg_int() {
@ -138,23 +125,20 @@ public class InferUndefined {
public static void can_throw_socketexception_void() throws SocketException { public static void can_throw_socketexception_void() throws SocketException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
} else } else throw new SocketException();
throw new SocketException();
} }
public static int can_throw_socketexception_int() throws SocketException { public static int can_throw_socketexception_int() throws SocketException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return int_undefined(); return int_undefined();
} else } else throw new SocketException();
throw new SocketException();
} }
public static Object can_throw_socketexception_object() throws SocketException { public static Object can_throw_socketexception_object() throws SocketException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return object_undefined(); return object_undefined();
} else } else throw new SocketException();
throw new SocketException();
} }
} }

@ -25,5 +25,4 @@ public class InferUtils {
|| charsetName == "UTF-16" || charsetName == "UTF-16"
|| charsetName == "utf-16"; || charsetName == "utf-16";
} }
} }

@ -10,7 +10,6 @@ package android.app;
import android.content.res.TypedArray; import android.content.res.TypedArray;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.ContextThemeWrapper; import android.view.ContextThemeWrapper;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public abstract class Activity extends ContextThemeWrapper { public abstract class Activity extends ContextThemeWrapper {
@ -19,22 +18,20 @@ public abstract class Activity extends ContextThemeWrapper {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public TypedArray obtainStyledAttributes(int resid, int[] attrs) public TypedArray obtainStyledAttributes(int resid, int[] attrs) throws NotFoundException {
throws NotFoundException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
throw new NotFoundException(); throw new NotFoundException();
} }
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public TypedArray obtainStyledAttributes(AttributeSet set, public TypedArray obtainStyledAttributes(
int[] attrs, int defStyleAttr, int defStyleRes) { AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public static class NotFoundException extends RuntimeException { public static class NotFoundException extends RuntimeException {
public NotFoundException() { public NotFoundException() {}
}
public NotFoundException(String name) { public NotFoundException(String name) {
super(name); super(name);
@ -44,5 +41,4 @@ public abstract class Activity extends ContextThemeWrapper {
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) { public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
} }

@ -7,7 +7,6 @@
package android.app; package android.app;
import android.app.PendingIntent;
public abstract class AlarmManager { public abstract class AlarmManager {

@ -20,12 +20,9 @@ public class DownloadManager {
mPackageName = packageName; mPackageName = packageName;
} }
public static class Query { public static class Query {}
}
public Cursor query(Query query) { public Cursor query(Query query) {
return mResolver.query(null, null, null, null, null); return mResolver.query(null, null, null, null, null);
} }
} }

@ -7,15 +7,12 @@
package android.content; package android.content;
import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
import android.database.Cursor; import android.database.Cursor;
import android.database.sqlite.SQLiteCursor; import android.database.sqlite.SQLiteCursor;
import android.net.Uri; import android.net.Uri;
import android.os.CancellationSignal; import android.os.CancellationSignal;
import android.os.RemoteException; import android.os.RemoteException;
import com.facebook.infer.builtins.InferUndefined;
public class ContentProviderClient { public class ContentProviderClient {
@ -32,18 +29,22 @@ public class ContentProviderClient {
mStable = stable; mStable = stable;
} }
public Cursor query(Uri url, String[] projection, String selection, public Cursor query(
String[] selectionArgs, String sortOrder) throws RemoteException { Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder)
throws RemoteException {
return query(url, projection, selection, selectionArgs, sortOrder, null); return query(url, projection, selection, selectionArgs, sortOrder, null);
} }
public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs, public Cursor query(
String sortOrder, CancellationSignal cancellationSignal) throws RemoteException { Uri url,
String[] projection,
String selection,
String[] selectionArgs,
String sortOrder,
CancellationSignal cancellationSignal)
throws RemoteException {
return new SQLiteCursor(null, null, null); return new SQLiteCursor(null, null, null);
} }
private class NotRespondingRunnable { private class NotRespondingRunnable {}
}
} }

@ -11,10 +11,8 @@ import android.database.Cursor;
import android.database.sqlite.SQLiteCursor; import android.database.sqlite.SQLiteCursor;
import android.net.Uri; import android.net.Uri;
import android.os.CancellationSignal; import android.os.CancellationSignal;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public class ContentResolver { public class ContentResolver {
private final Context mContext; private final Context mContext;
@ -23,8 +21,8 @@ public class ContentResolver {
mContext = context; mContext = context;
} }
public final Cursor query(Uri uri, String[] projection, public final Cursor query(
String selection, String[] selectionArgs, String sortOrder) { Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
return null; return null;
} else { } else {
@ -32,8 +30,12 @@ public class ContentResolver {
} }
} }
public final Cursor query(final Uri uri, String[] projection, public final Cursor query(
String selection, String[] selectionArgs, String sortOrder, final Uri uri,
String[] projection,
String selection,
String[] selectionArgs,
String sortOrder,
CancellationSignal cancellationSignal) { CancellationSignal cancellationSignal) {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
return null; return null;

@ -13,7 +13,6 @@ import com.facebook.infer.builtins.InferUndefined;
public class Context { public class Context {
public ContentResolver getContentResolver() { public ContentResolver getContentResolver() {
return new ContentResolver(this); return new ContentResolver(this);
} }
@ -22,22 +21,20 @@ public class Context {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public TypedArray obtainStyledAttributes(int resid, int[] attrs) public TypedArray obtainStyledAttributes(int resid, int[] attrs) throws NotFoundException {
throws NotFoundException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
throw new NotFoundException(); throw new NotFoundException();
} }
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public TypedArray obtainStyledAttributes(AttributeSet set, public TypedArray obtainStyledAttributes(
int[] attrs, int defStyleAttr, int defStyleRes) { AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public static class NotFoundException extends RuntimeException { public static class NotFoundException extends RuntimeException {
public NotFoundException() { public NotFoundException() {}
}
public NotFoundException(String name) { public NotFoundException(String name) {
super(name); super(name);
@ -47,6 +44,4 @@ public class Context {
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) { public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
} }

@ -7,5 +7,4 @@
package android.content; package android.content;
public interface IContentProvider { public interface IContentProvider {}
}

@ -7,5 +7,4 @@
package android.content; package android.content;
public interface IContentService { public interface IContentService {}
}

@ -8,36 +8,30 @@
package android.content.res; package android.content.res;
import android.util.AttributeSet; import android.util.AttributeSet;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public class Resources { public class Resources {
public final class Theme { public final class Theme {
public TypedArray obtainStyledAttributes(int[] attrs) { public TypedArray obtainStyledAttributes(int[] attrs) {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public TypedArray obtainStyledAttributes(int resid, int[] attrs) public TypedArray obtainStyledAttributes(int resid, int[] attrs) throws NotFoundException {
throws NotFoundException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
throw new NotFoundException(); throw new NotFoundException();
} }
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
public TypedArray obtainStyledAttributes(AttributeSet set, public TypedArray obtainStyledAttributes(
int[] attrs, int defStyleAttr, int defStyleRes) { AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
} }
public static class NotFoundException extends RuntimeException { public static class NotFoundException extends RuntimeException {
public NotFoundException() { public NotFoundException() {}
}
public NotFoundException(String name) { public NotFoundException(String name) {
super(name); super(name);
@ -47,5 +41,4 @@ public class Resources {
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) { public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return new TypedArray(null, attrs, attrs, 1); return new TypedArray(null, attrs, attrs, 1);
} }
} }

@ -34,5 +34,4 @@ public class TypedArray {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
} }
} }

@ -7,5 +7,4 @@
package android.database; package android.database;
public abstract class AbstractCursor implements CrossProcessCursor { public abstract class AbstractCursor implements CrossProcessCursor {}
}

@ -7,5 +7,4 @@
package android.database; package android.database;
public interface CrossProcessCursor extends Cursor { public interface CrossProcessCursor extends Cursor {}
}

@ -7,5 +7,4 @@
package android.database; package android.database;
public abstract class CrossProcessCursorWrapper implements CrossProcessCursor { public abstract class CrossProcessCursorWrapper implements CrossProcessCursor {}
}

@ -7,8 +7,6 @@
package android.database; package android.database;
import com.facebook.infer.builtins.InferUndefined;
import com.facebook.infer.builtins.InferBuiltins;
import java.io.IOException; import java.io.IOException;
@ -22,7 +20,7 @@ public class CursorWrapper implements Cursor {
public void close() { public void close() {
try { try {
mCursor.close(); mCursor.close();
} catch (IOException e) {} } catch (IOException e) {
}
} }
} }

@ -7,6 +7,4 @@
package android.database.sqlite; package android.database.sqlite;
public final class SQLiteConnectionPool { public final class SQLiteConnectionPool {}
}

@ -9,18 +9,15 @@ package android.database.sqlite;
import android.database.Cursor; import android.database.Cursor;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
public class SQLiteCursor implements Cursor { public class SQLiteCursor implements Cursor {
@Deprecated @Deprecated
public SQLiteCursor(SQLiteDatabase db, SQLiteCursorDriver driver, public SQLiteCursor(
String editTable, SQLiteQuery query) { SQLiteDatabase db, SQLiteCursorDriver driver, String editTable, SQLiteQuery query) {
this(driver, editTable, query); this(driver, editTable, query);
} }
public SQLiteCursor(SQLiteCursorDriver driver, String editTable, SQLiteQuery query) { public SQLiteCursor(SQLiteCursorDriver driver, String editTable, SQLiteQuery query) {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
@ -28,5 +25,4 @@ public class SQLiteCursor implements Cursor {
public void close() { public void close() {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
} }
} }

@ -11,86 +11,159 @@ import android.database.Cursor;
import android.database.DatabaseErrorHandler; import android.database.DatabaseErrorHandler;
import android.os.CancellationSignal; import android.os.CancellationSignal;
public final class SQLiteDatabase { public final class SQLiteDatabase {
private SQLiteDatabase(String path, int openFlags, CursorFactory cursorFactory, private SQLiteDatabase(
DatabaseErrorHandler errorHandler) { String path, int openFlags, CursorFactory cursorFactory, DatabaseErrorHandler errorHandler) {}
}
public Cursor query(
boolean distinct,
public Cursor query(boolean distinct, String table, String[] columns, String table,
String selection, String[] selectionArgs, String groupBy, String[] columns,
String having, String orderBy, String limit) { String selection,
return queryWithFactory(null, distinct, table, columns, selection, selectionArgs, String[] selectionArgs,
groupBy, having, orderBy, limit, null); String groupBy,
String having,
String orderBy,
String limit) {
return queryWithFactory(
null,
distinct,
table,
columns,
selection,
selectionArgs,
groupBy,
having,
orderBy,
limit,
null);
} }
public Cursor query(
public Cursor query(boolean distinct, String table, String[] columns, boolean distinct,
String selection, String[] selectionArgs, String groupBy, String table,
String having, String orderBy, String limit, CancellationSignal cancellationSignal) { String[] columns,
return queryWithFactory(null, distinct, table, columns, selection, selectionArgs, String selection,
groupBy, having, orderBy, limit, cancellationSignal); String[] selectionArgs,
String groupBy,
String having,
String orderBy,
String limit,
CancellationSignal cancellationSignal) {
return queryWithFactory(
null,
distinct,
table,
columns,
selection,
selectionArgs,
groupBy,
having,
orderBy,
limit,
cancellationSignal);
} }
public Cursor queryWithFactory(
public Cursor queryWithFactory(CursorFactory cursorFactory, CursorFactory cursorFactory,
boolean distinct, String table, String[] columns, boolean distinct,
String selection, String[] selectionArgs, String groupBy, String table,
String having, String orderBy, String limit) { String[] columns,
return queryWithFactory(cursorFactory, distinct, table, columns, selection, String selection,
selectionArgs, groupBy, having, orderBy, limit, null); String[] selectionArgs,
String groupBy,
String having,
String orderBy,
String limit) {
return queryWithFactory(
cursorFactory,
distinct,
table,
columns,
selection,
selectionArgs,
groupBy,
having,
orderBy,
limit,
null);
} }
public Cursor queryWithFactory(
public Cursor queryWithFactory(CursorFactory cursorFactory, CursorFactory cursorFactory,
boolean distinct, String table, String[] columns, boolean distinct,
String selection, String[] selectionArgs, String groupBy, String table,
String having, String orderBy, String limit, CancellationSignal cancellationSignal) { String[] columns,
String selection,
String[] selectionArgs,
String groupBy,
String having,
String orderBy,
String limit,
CancellationSignal cancellationSignal) {
return rawQueryWithFactory(cursorFactory, null, selectionArgs, table, cancellationSignal); return rawQueryWithFactory(cursorFactory, null, selectionArgs, table, cancellationSignal);
} }
public Cursor query(String table, String[] columns, String selection, public Cursor query(
String[] selectionArgs, String groupBy, String having, String table,
String[] columns,
String selection,
String[] selectionArgs,
String groupBy,
String having,
String orderBy) { String orderBy) {
return query(false, table, columns, selection, selectionArgs, groupBy, return query(
having, orderBy, null /* limit */); false,
table,
columns,
selection,
selectionArgs,
groupBy,
having,
orderBy,
null /* limit */);
} }
public Cursor query(String table, String[] columns, String selection, public Cursor query(
String[] selectionArgs, String groupBy, String having, String table,
String orderBy, String limit) { String[] columns,
String selection,
return query(false, table, columns, selection, selectionArgs, groupBy, String[] selectionArgs,
having, orderBy, limit); String groupBy,
String having,
String orderBy,
String limit) {
return query(false, table, columns, selection, selectionArgs, groupBy, having, orderBy, limit);
} }
public Cursor rawQuery(String sql, String[] selectionArgs) { public Cursor rawQuery(String sql, String[] selectionArgs) {
return rawQueryWithFactory(null, sql, selectionArgs, null, null); return rawQueryWithFactory(null, sql, selectionArgs, null, null);
} }
public Cursor rawQuery(String sql, String[] selectionArgs, public Cursor rawQuery(
CancellationSignal cancellationSignal) { String sql, String[] selectionArgs, CancellationSignal cancellationSignal) {
return rawQueryWithFactory(null, sql, selectionArgs, null, cancellationSignal); return rawQueryWithFactory(null, sql, selectionArgs, null, cancellationSignal);
} }
public Cursor rawQueryWithFactory( public Cursor rawQueryWithFactory(
CursorFactory cursorFactory, String sql, String[] selectionArgs, CursorFactory cursorFactory, String sql, String[] selectionArgs, String editTable) {
String editTable) {
return rawQueryWithFactory(cursorFactory, sql, selectionArgs, editTable, null); return rawQueryWithFactory(cursorFactory, sql, selectionArgs, editTable, null);
} }
public Cursor rawQueryWithFactory( public Cursor rawQueryWithFactory(
CursorFactory cursorFactory, String sql, String[] selectionArgs, CursorFactory cursorFactory,
String editTable, CancellationSignal cancellationSignal) { String sql,
String[] selectionArgs,
String editTable,
CancellationSignal cancellationSignal) {
return new SQLiteCursor(null, editTable, null); return new SQLiteCursor(null, editTable, null);
} }
public interface CursorFactory { public interface CursorFactory {
public Cursor newCursor(SQLiteDatabase db, public Cursor newCursor(
SQLiteCursorDriver masterQuery, String editTable, SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, SQLiteQuery query);
SQLiteQuery query);
} }
} }

@ -7,5 +7,4 @@
package android.database.sqlite; package android.database.sqlite;
public final class SQLiteDatabaseConfiguration { public final class SQLiteDatabaseConfiguration {}
}

@ -12,26 +12,49 @@ import android.os.CancellationSignal;
public class SQLiteQueryBuilder { public class SQLiteQueryBuilder {
public Cursor query(SQLiteDatabase db, String[] projectionIn, public Cursor query(
String selection, String[] selectionArgs, String groupBy, SQLiteDatabase db,
String having, String sortOrder) { String[] projectionIn,
return query(db, projectionIn, selection, selectionArgs, groupBy, having, sortOrder, String selection,
null /* limit */, null /* cancellationSignal */); String[] selectionArgs,
String groupBy,
String having,
String sortOrder) {
return query(
db,
projectionIn,
selection,
selectionArgs,
groupBy,
having,
sortOrder,
null /* limit */,
null /* cancellationSignal */);
} }
public Cursor query(SQLiteDatabase db, String[] projectionIn, public Cursor query(
String selection, String[] selectionArgs, String groupBy, SQLiteDatabase db,
String having, String sortOrder, String limit) { String[] projectionIn,
return query(db, projectionIn, selection, selectionArgs, String selection,
groupBy, having, sortOrder, limit, null); String[] selectionArgs,
String groupBy,
String having,
String sortOrder,
String limit) {
return query(
db, projectionIn, selection, selectionArgs, groupBy, having, sortOrder, limit, null);
} }
public Cursor query(SQLiteDatabase db, String[] projectionIn, public Cursor query(
String selection, String[] selectionArgs, String groupBy, SQLiteDatabase db,
String having, String sortOrder, String limit, String[] projectionIn,
String selection,
String[] selectionArgs,
String groupBy,
String having,
String sortOrder,
String limit,
CancellationSignal cancellationSignal) { CancellationSignal cancellationSignal) {
return new SQLiteCursor(null, null, null); return new SQLiteCursor(null, null, null);
} }
} }

@ -15,19 +15,23 @@ public final class MediaStore {
public static final class Images { public static final class Images {
public static final class Media { public static final class Media {
public static final Cursor query(ContentResolver cr, Uri uri, String[] projection) { public static final Cursor query(ContentResolver cr, Uri uri, String[] projection) {
return cr.query(uri, projection, null, null, null); return cr.query(uri, projection, null, null, null);
} }
public static final Cursor query(ContentResolver cr, Uri uri, String[] projection, public static final Cursor query(
String where, String orderBy) { ContentResolver cr, Uri uri, String[] projection, String where, String orderBy) {
return cr.query(uri, projection, where, null, orderBy); return cr.query(uri, projection, where, null, orderBy);
} }
public static final Cursor query(ContentResolver cr, Uri uri, String[] projection, public static final Cursor query(
String selection, String[] selectionArgs, String orderBy) { ContentResolver cr,
Uri uri,
String[] projection,
String selection,
String[] selectionArgs,
String orderBy) {
return cr.query(uri, projection, selection, selectionArgs, orderBy); return cr.query(uri, projection, selection, selectionArgs, orderBy);
} }
} }

@ -8,7 +8,6 @@
package com.facebook.infer.annotation; package com.facebook.infer.annotation;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public class Assertions { public class Assertions {

@ -9,7 +9,6 @@ package com.fasterxml.jackson.core;
import com.fasterxml.jackson.core.json.PackageVersion; import com.fasterxml.jackson.core.json.PackageVersion;
import com.fasterxml.jackson.core.json.UTF8StreamJsonParser; import com.fasterxml.jackson.core.json.UTF8StreamJsonParser;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
@ -17,47 +16,35 @@ import java.io.InputStream;
import java.io.Reader; import java.io.Reader;
import java.net.URL; import java.net.URL;
public class JsonFactory public class JsonFactory implements Versioned, java.io.Serializable {
implements Versioned, java.io.Serializable {
@Override @Override
public Version version() { public Version version() {
return PackageVersion.VERSION; return PackageVersion.VERSION;
} }
public JsonParser createParser(File f) public JsonParser createParser(File f) throws IOException, JsonParseException {
throws IOException, JsonParseException {
return createOwningParser(); return createOwningParser();
} }
public JsonParser createParser(URL url) public JsonParser createParser(URL url) throws IOException, JsonParseException {
throws IOException, JsonParseException {
return createOwningParser(); return createOwningParser();
} }
public JsonParser createParser(InputStream in) public JsonParser createParser(InputStream in) throws IOException, JsonParseException {
throws IOException, JsonParseException {
return createNonOwningParser(); return createNonOwningParser();
} }
public JsonParser createParser(Reader r) public JsonParser createParser(Reader r) throws IOException, JsonParseException {
throws IOException, JsonParseException {
return createNonOwningParser(); return createNonOwningParser();
} }
private JsonParser createOwningParser() private JsonParser createOwningParser() throws IOException, JsonParseException {
throws IOException, JsonParseException {
InputStream in = new FileInputStream(""); InputStream in = new FileInputStream("");
return new UTF8StreamJsonParser(null, 0, in, null, null, return new UTF8StreamJsonParser(null, 0, in, null, null, new byte[] {}, 0, 0, false);
new byte[]{}, 0, 0,
false);
} }
private JsonParser createNonOwningParser() private JsonParser createNonOwningParser() throws IOException, JsonParseException {
throws IOException, JsonParseException { return new UTF8StreamJsonParser(null, 0, null, null, null, new byte[] {}, 0, 0, false);
return new UTF8StreamJsonParser(null, 0, null, null, null,
new byte[]{}, 0, 0,
false);
} }
} }

@ -9,20 +9,17 @@ package com.fasterxml.jackson.core;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.io.Closeable; import java.io.Closeable;
import java.io.IOException; import java.io.IOException;
public abstract class JsonParser public abstract class JsonParser implements Closeable, Versioned {
implements Closeable, Versioned {
public void close() throws IOException { public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
private void throwExceptions() private void throwExceptions() throws JsonParseException, IOException {
throws JsonParseException, IOException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
throw new JsonParseException(null, null, null); throw new JsonParseException(null, null, null);
} }
@ -31,10 +28,8 @@ public abstract class JsonParser
} }
} }
public Object readValueAs(Class valueType) public Object readValueAs(Class valueType) throws IOException, JsonProcessingException {
throws IOException, JsonProcessingException {
throwExceptions(); throwExceptions();
return InferUndefined.object_undefined(); return InferUndefined.object_undefined();
} }
} }

@ -15,7 +15,6 @@ import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.base.ParserBase; import com.fasterxml.jackson.core.base.ParserBase;
import com.fasterxml.jackson.core.io.IOContext; import com.fasterxml.jackson.core.io.IOContext;
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer; import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
@ -24,9 +23,7 @@ import java.io.InputStream;
* This class contains a minimum set of methods in order to compile it for the * This class contains a minimum set of methods in order to compile it for the
* models * models
*/ */
public final class UTF8StreamJsonParser public final class UTF8StreamJsonParser extends ParserBase {
extends ParserBase {
protected ObjectCodec _objectCodec; protected ObjectCodec _objectCodec;
@ -42,9 +39,15 @@ public final class UTF8StreamJsonParser
protected boolean _bufferRecyclable; protected boolean _bufferRecyclable;
public UTF8StreamJsonParser(IOContext ctxt, int features, InputStream in, public UTF8StreamJsonParser(
ObjectCodec codec, BytesToNameCanonicalizer sym, IOContext ctxt,
byte[] inputBuffer, int start, int end, int features,
InputStream in,
ObjectCodec codec,
BytesToNameCanonicalizer sym,
byte[] inputBuffer,
int start,
int end,
boolean bufferRecyclable) { boolean bufferRecyclable) {
super(ctxt, features); super(ctxt, features);
_inputStream = in; _inputStream = in;
@ -63,8 +66,7 @@ public final class UTF8StreamJsonParser
} }
} }
private void throwExceptions() private void throwExceptions() throws JsonParseException, IOException {
throws JsonParseException, IOException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
throw new JsonParseException(null, null, null); throw new JsonParseException(null, null, null);
} }
@ -78,14 +80,12 @@ public final class UTF8StreamJsonParser
*/ */
@Override @Override
protected boolean loadMore() protected boolean loadMore() throws IOException {
throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_boolean();
} }
@Override @Override
protected void _finishString() protected void _finishString() throws IOException, JsonParseException {
throws IOException, JsonParseException {
throwExceptions(); throwExceptions();
} }
@ -99,45 +99,38 @@ public final class UTF8StreamJsonParser
*/ */
@Override @Override
public byte[] getBinaryValue(Base64Variant b64variant) public byte[] getBinaryValue(Base64Variant b64variant) throws IOException, JsonParseException {
throws IOException, JsonParseException {
throwExceptions(); throwExceptions();
return new byte[] {InferUndefined.byte_undefined()}; return new byte[] {InferUndefined.byte_undefined()};
} }
@Override @Override
public int getTextOffset() public int getTextOffset() throws IOException, JsonParseException {
throws IOException, JsonParseException {
throwExceptions(); throwExceptions();
return InferUndefined.int_undefined(); return InferUndefined.int_undefined();
} }
@Override @Override
public int getTextLength() public int getTextLength() throws IOException, JsonParseException {
throws IOException, JsonParseException {
throwExceptions(); throwExceptions();
return InferUndefined.int_undefined(); return InferUndefined.int_undefined();
} }
@Override @Override
public char[] getTextCharacters() public char[] getTextCharacters() throws IOException, JsonParseException {
throws IOException, JsonParseException {
throwExceptions(); throwExceptions();
return new char[] {InferUndefined.char_undefined()}; return new char[] {InferUndefined.char_undefined()};
} }
@Override @Override
public String getText() public String getText() throws IOException, JsonParseException {
throws IOException, JsonParseException {
throwExceptions(); throwExceptions();
return (String) InferUndefined.object_undefined(); return (String) InferUndefined.object_undefined();
} }
@Override @Override
public JsonToken nextToken() public JsonToken nextToken() throws IOException, JsonParseException {
throws IOException, JsonParseException {
throwExceptions(); throwExceptions();
throw new IOException(); throw new IOException();
} }
} }

@ -13,5 +13,4 @@ public abstract class Optional<T> {
@Nullable @Nullable
public abstract T orNull(); public abstract T orNull();
} }

@ -7,9 +7,9 @@
package com.google.common.base; package com.google.common.base;
import javax.annotation.Nullable;
import static com.facebook.infer.builtins.InferBuiltins.assume; import static com.facebook.infer.builtins.InferBuiltins.assume;
import javax.annotation.Nullable;
public final class Preconditions { public final class Preconditions {
@ -22,9 +22,8 @@ public final class Preconditions {
return checkNotNull(reference); return checkNotNull(reference);
} }
public static <T> T checkNotNull(T reference, public static <T> T checkNotNull(
@Nullable String errorMessageTemplate, T reference, @Nullable String errorMessageTemplate, @Nullable Object... errorMessageArgs) {
@Nullable Object... errorMessageArgs) {
return checkNotNull(reference); return checkNotNull(reference);
} }
@ -32,12 +31,12 @@ public final class Preconditions {
assume(expression); assume(expression);
} }
public static void checkState(boolean expression, public static void checkState(boolean expression, @Nullable Object errorMessage) {
@Nullable Object errorMessage) {
assume(expression); assume(expression);
} }
public static void checkState(boolean expression, public static void checkState(
boolean expression,
@Nullable String errorMessageTemplate, @Nullable String errorMessageTemplate,
@Nullable Object... errorMessageArgs) { @Nullable Object... errorMessageArgs) {
assume(expression); assume(expression);
@ -57,5 +56,4 @@ public final class Preconditions {
@Nullable Object... errorMessageArgs) { @Nullable Object... errorMessageArgs) {
assume(expression); assume(expression);
} }
} }

@ -7,10 +7,8 @@
package com.google.common.collect; package com.google.common.collect;
import java.util.NoSuchElementException;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import java.util.NoSuchElementException;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public class Iterators { public class Iterators {
@ -35,5 +33,4 @@ public class Iterators {
} }
}; };
} }
} }

@ -9,7 +9,6 @@ package com.google.common.io;
import com.facebook.infer.builtins.InferCloseables; import com.facebook.infer.builtins.InferCloseables;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.io.Closeable; import java.io.Closeable;
import java.io.IOException; import java.io.IOException;
@ -17,12 +16,10 @@ public final class Closeables {
public static void close(Closeable closeable, boolean swallowIOException) throws IOException { public static void close(Closeable closeable, boolean swallowIOException) throws IOException {
InferCloseables.close(closeable); InferCloseables.close(closeable);
if (!swallowIOException) if (!swallowIOException) InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void();
} }
public static void closeQuietly(Closeable closeable) { public static void closeQuietly(Closeable closeable) {
InferCloseables.closeQuietly(closeable); InferCloseables.closeQuietly(closeable);
} }
} }

@ -7,7 +7,6 @@
package dalvik.system; package dalvik.system;
public class CloseGuard { public class CloseGuard {
public static interface Reporter { public static interface Reporter {

@ -34,5 +34,4 @@ public class BufferedInputStream {
public long skip(long n) throws IOException { public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_long();
} }
} }

@ -40,5 +40,4 @@ public class BufferedOutputStream extends FilterOutputStream {
public void write(byte b[]) throws IOException { public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -9,7 +9,6 @@ package java.io;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public abstract class BufferedWriter extends Writer { public abstract class BufferedWriter extends Writer {
public void flush() throws IOException { public void flush() throws IOException {
@ -39,5 +38,4 @@ public abstract class BufferedWriter extends Writer {
public void write(String str, int off, int len) throws IOException { public void write(String str, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -9,7 +9,6 @@ package java.io;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public class DataInputStream { public class DataInputStream {
public int read(byte b[]) throws IOException { public int read(byte b[]) throws IOException {
@ -79,5 +78,4 @@ public class DataInputStream {
public final int skipBytes(int n) throws IOException { public final int skipBytes(int n) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
} }

@ -9,7 +9,6 @@ package java.io;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public class DataOutputStream extends FilterOutputStream { public class DataOutputStream extends FilterOutputStream {
public DataOutputStream(OutputStream out) { public DataOutputStream(OutputStream out) {
@ -75,5 +74,4 @@ public class DataOutputStream extends FilterOutputStream {
public final void writeUTF(String str) throws IOException { public final void writeUTF(String str) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -19,5 +19,4 @@ public class File {
return (File[]) InferUndefined.object_undefined(); return (File[]) InferUndefined.object_undefined();
} }
} }
} }

@ -9,8 +9,6 @@ package java.io;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.nio.FileChannelImpl; import java.nio.FileChannelImpl;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
@ -74,5 +72,4 @@ public class FileInputStream extends InputStream {
public long skip(int n) throws IOException { public long skip(int n) throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_long();
} }
} }

@ -9,11 +9,9 @@ package java.io;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.nio.FileChannelImpl; import java.nio.FileChannelImpl;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
public class FileOutputStream extends OutputStream { public class FileOutputStream extends OutputStream {
private FileDescriptor fd; private FileDescriptor fd;
@ -47,8 +45,7 @@ public class FileOutputStream extends OutputStream {
} }
} }
public FileOutputStream(File file, boolean append) public FileOutputStream(File file, boolean append) throws FileNotFoundException {
throws FileNotFoundException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
init(); init();
} else { } else {
@ -81,5 +78,4 @@ public class FileOutputStream extends OutputStream {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -34,6 +34,4 @@ public class FilterInputStream {
public long skip(long n) throws IOException { public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_long();
} }
} }

@ -13,8 +13,7 @@ public class FilterOutputStream {
protected OutputStream out; protected OutputStream out;
public FilterOutputStream() { public FilterOutputStream() {}
}
public FilterOutputStream(OutputStream out) { public FilterOutputStream(OutputStream out) {
this.out = out; this.out = out;
@ -41,6 +40,4 @@ public class FilterOutputStream {
public void write(byte b[], int off, int len) throws IOException { public void write(byte b[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -34,5 +34,4 @@ public abstract class FilterReader {
public long skip(long n) throws IOException { public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_long();
} }
} }

@ -28,5 +28,4 @@ public class InputStream {
public int read(byte b[], int off, int len) throws IOException { public int read(byte b[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
} }

@ -11,20 +11,14 @@ 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;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
public abstract class InputStreamReader { public abstract class InputStreamReader {
public InputStreamReader(InputStream in, String charsetName) public InputStreamReader(InputStream in, String charsetName) throws UnsupportedEncodingException {
throws UnsupportedEncodingException { if (charsetName == null) throw new NullPointerException("charsetName");
if (charsetName == null)
throw new NullPointerException("charsetName");
else if (InferUtils.isValidCharset(charsetName)) { else if (InferUtils.isValidCharset(charsetName)) {
InferBuiltins.__set_mem_attribute(in); InferBuiltins.__set_mem_attribute(in);
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} else } else throw new UnsupportedEncodingException();
throw new UnsupportedEncodingException();
} }
public int read() throws IOException { public int read() throws IOException {
@ -42,6 +36,4 @@ public abstract class InputStreamReader {
public boolean ready() throws IOException { public boolean ready() throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_boolean();
} }
} }

@ -7,10 +7,8 @@
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 ObjectInputStream { public class ObjectInputStream {
InputStream in; InputStream in;
@ -26,8 +24,7 @@ public class ObjectInputStream {
} }
} }
protected ObjectInputStream() throws IOException, SecurityException { protected ObjectInputStream() throws IOException, SecurityException {}
}
public int available() throws IOException { public int available() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
@ -117,7 +114,5 @@ public class ObjectInputStream {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public static abstract class GetField { public abstract static class GetField {}
}
} }

@ -31,5 +31,4 @@ public class OutputStream {
public void close() throws IOException { public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
} }
} }

@ -11,19 +11,14 @@ 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;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
public class OutputStreamWriter extends Writer { public class OutputStreamWriter extends Writer {
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)) {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} else } else throw new UnsupportedEncodingException();
throw new UnsupportedEncodingException();
} }
public void flush() throws IOException { public void flush() throws IOException {
@ -49,5 +44,4 @@ public class OutputStreamWriter extends Writer {
public void write(String str, int off, int len) throws IOException { public void write(String str, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -16,8 +16,7 @@ public class PipedInputStream extends InputStream {
this(); this();
} }
public PipedInputStream(PipedOutputStream src, int pipeSize) public PipedInputStream(PipedOutputStream src, int pipeSize) throws IOException {
throws IOException {
this(); this();
} }
@ -53,5 +52,4 @@ public class PipedInputStream extends InputStream {
public int read(byte b[], int off, int len) throws IOException { public int read(byte b[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
} }

@ -12,7 +12,6 @@ import com.facebook.infer.builtins.InferUndefined;
public class PipedOutputStream extends OutputStream { public class PipedOutputStream extends OutputStream {
public PipedOutputStream(PipedInputStream snk) throws IOException { public PipedOutputStream(PipedInputStream snk) throws IOException {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }

@ -17,11 +17,9 @@ public class PipedReader extends Reader {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
public PipedReader() { public PipedReader() {}
}
public PipedReader(int pipeSize) { public PipedReader(int pipeSize) {}
}
public PipedReader(PipedWriter src) throws IOException { public PipedReader(PipedWriter src) throws IOException {
init(); init();
@ -63,5 +61,4 @@ public class PipedReader extends Reader {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -17,8 +17,7 @@ public abstract class PipedWriter extends Writer {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
public PipedWriter() { public PipedWriter() {}
}
public PipedWriter(PipedReader snk) throws IOException { public PipedWriter(PipedReader snk) throws IOException {
init(); init();
@ -38,8 +37,7 @@ public abstract class PipedWriter extends Writer {
return this; return this;
} }
public Writer append(CharSequence csq, int start, int end) public Writer append(CharSequence csq, int start, int end) throws IOException {
throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
return this; return this;
} }
@ -72,5 +70,4 @@ public abstract class PipedWriter extends Writer {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -32,8 +32,7 @@ public abstract class PrintWriter {
return this; return this;
} }
public PrintWriter append(CharSequence csq, int start, int end) public PrintWriter append(CharSequence csq, int start, int end) throws IOException {
throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
return this; return this;
} }
@ -68,5 +67,4 @@ public abstract class PrintWriter {
mOutputStream.close(); mOutputStream.close();
} }
} }
} }

@ -9,7 +9,6 @@ package java.io;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
public class PushbackInputStream { public class PushbackInputStream {
public int available() throws IOException { public int available() throws IOException {
@ -47,5 +46,4 @@ public class PushbackInputStream {
public void unread(int b) throws IOException { public void unread(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -46,5 +46,4 @@ public abstract class PushbackReader {
public void unread(int c) throws IOException { public void unread(int c) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -9,7 +9,6 @@ package java.io;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.nio.FileChannelImpl; import java.nio.FileChannelImpl;
import java.nio.channels.FileChannel; import java.nio.channels.FileChannel;
@ -18,14 +17,11 @@ public class RandomAccessFile implements Closeable {
private FileDescriptor fd; private FileDescriptor fd;
private FileChannel channel; private FileChannel channel;
public RandomAccessFile(String name, String mode) throws FileNotFoundException {
public RandomAccessFile(String name, String mode)
throws FileNotFoundException {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
public RandomAccessFile(File file, String mode) public RandomAccessFile(File file, String mode) throws FileNotFoundException {
throws FileNotFoundException {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }

@ -44,5 +44,4 @@ public abstract class Reader {
public long skip(long n) throws IOException { public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_long();
} }
} }

@ -21,8 +21,7 @@ public abstract class Writer {
return this; return this;
} }
public Writer append(CharSequence csq, int start, int end) public Writer append(CharSequence csq, int start, int end) throws IOException {
throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
return this; return this;
} }
@ -50,5 +49,4 @@ public abstract class Writer {
public void write(String str, int off, int len) throws IOException { public void write(String str, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -15,8 +15,7 @@ public final class Class<T> {
return this.name; return this.name;
} }
public static Class<?> forName(String className) public static Class<?> forName(String className) throws ClassNotFoundException {
throws ClassNotFoundException {
return new Class(); return new Class();
} }
@ -29,5 +28,4 @@ public final class Class<T> {
c.name = name; c.name = name;
return c; return c;
} }
} }

@ -31,5 +31,4 @@ public final class Integer {
public int intValue() { public int intValue() {
return this.value; return this.value;
} }
} }

@ -9,10 +9,7 @@ package java.lang;
public class NullPointerException extends RuntimeException { public class NullPointerException extends RuntimeException {
public NullPointerException() { public NullPointerException() {}
}
public NullPointerException(String s) {
}
public NullPointerException(String s) {}
} }

@ -8,8 +8,6 @@
package java.lang; package java.lang;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
import java.io.FileDescriptor; import java.io.FileDescriptor;
public class Process { public class Process {
@ -26,5 +24,4 @@ public class Process {
destroy(); destroy();
return this; return this;
} }
} }

@ -8,19 +8,18 @@
package java.lang; package java.lang;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.io.File; import java.io.File;
import java.io.FileDescriptor; import java.io.FileDescriptor;
import java.io.IOException; import java.io.IOException;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
abstract class ProcessManager { abstract class ProcessManager {
public Process exec(String[] taintedCommand, String[] taintedEnvironment, File workingDirectory, public Process exec(
boolean redirectErrorStream) throws IOException { String[] taintedCommand,
String[] taintedEnvironment,
File workingDirectory,
boolean redirectErrorStream)
throws IOException {
FileDescriptor in = new FileDescriptor(); FileDescriptor in = new FileDescriptor();
FileDescriptor out = new FileDescriptor(); FileDescriptor out = new FileDescriptor();
@ -30,5 +29,4 @@ abstract class ProcessManager {
} }
public static native ProcessManager getInstance(); public static native ProcessManager getInstance();
} }

@ -10,11 +10,9 @@ package java.lang;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
public class Runtime { public class Runtime {
private Runtime() { private Runtime() {}
}
public Process exec(String command) throws IOException { public Process exec(String command) throws IOException {
return exec(command, null, null); return exec(command, null, null);
@ -24,8 +22,7 @@ public class Runtime {
return exec(command, envp, null); return exec(command, envp, null);
} }
public Process exec(String command, String[] envp, File dir) public Process exec(String command, String[] envp, File dir) throws IOException {
throws IOException {
return ProcessManager.getInstance().exec(null, envp, null, false); return ProcessManager.getInstance().exec(null, envp, null, false);
} }
@ -37,9 +34,7 @@ public class Runtime {
return exec(cmdarray, envp, null); return exec(cmdarray, envp, null);
} }
public Process exec(String[] cmdarray, String[] envp, File dir) public Process exec(String[] cmdarray, String[] envp, File dir) throws IOException {
throws IOException {
return ProcessManager.getInstance().exec(cmdarray, envp, dir, false); return ProcessManager.getInstance().exec(cmdarray, envp, dir, false);
} }
} }

@ -8,7 +8,6 @@
package java.lang; package java.lang;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import com.facebook.infer.builtins.InferBuiltins;
public final class String { public final class String {
@ -17,8 +16,7 @@ public final class String {
private final int count; private final int count;
public int length() { public int length() {
if (this == "") if (this == "") return 0;
return 0;
else { else {
return InferUndefined.nonneg_int(); return InferUndefined.nonneg_int();
} }
@ -34,22 +32,19 @@ public final class String {
this(bytes, 0, bytes.length); this(bytes, 0, bytes.length);
} }
public String(byte bytes[], int offset, int length) { public String(byte bytes[], int offset, int length) {
checkBounds(bytes, offset, length); checkBounds(bytes, offset, length);
char[] v = new char[bytes[0]]; /** yes, this could be improved **/ char[] v = new char[bytes[0]];
/** yes, this could be improved * */
this.offset = 0; this.offset = 0;
this.count = v.length; this.count = v.length;
this.value = v; this.value = v;
} }
private static void checkBounds(byte[] bytes, int offset, int length) { private static void checkBounds(byte[] bytes, int offset, int length) {
if (length < 0) if (length < 0) throw new StringIndexOutOfBoundsException(length);
throw new StringIndexOutOfBoundsException(length); if (offset < 0) throw new StringIndexOutOfBoundsException(offset);
if (offset < 0) if (offset > bytes.length - length) throw new StringIndexOutOfBoundsException(offset + length);
throw new StringIndexOutOfBoundsException(offset);
if (offset > bytes.length - length)
throw new StringIndexOutOfBoundsException(offset + length);
} }
public boolean equals(Object anObject) { public boolean equals(Object anObject) {
@ -59,5 +54,4 @@ public final class String {
return InferUndefined.boolean_undefined(); return InferUndefined.boolean_undefined();
} }
} }
} }

@ -9,30 +9,25 @@ package java.lang;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.io.ByteArrayInputStream; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.InputStream; import java.io.InputStream;
import java.io.PrintStream; import java.io.PrintStream;
public final class System { public final class System {
private System() { private System() {}
}
public final static InputStream in; public static final InputStream in;
static { static {
byte[] arr = {0}; byte[] arr = {0};
in = new ByteArrayInputStream(arr); in = new ByteArrayInputStream(arr);
} }
public final static PrintStream out = new PrintStream( public static final PrintStream out = new PrintStream(new ByteArrayOutputStream());
new ByteArrayOutputStream());
public final static PrintStream err = new PrintStream( public static final PrintStream err = new PrintStream(new ByteArrayOutputStream());
new ByteArrayOutputStream());
public static void exit(int status) { public static void exit(int status) {
InferBuiltins._exit(); InferBuiltins._exit();
@ -45,5 +40,4 @@ public final class System {
} }
return (String) InferUndefined.object_undefined(); return (String) InferUndefined.object_undefined();
} }
} }

@ -7,8 +7,8 @@
package java.lang; package java.lang;
import com.facebook.infer.builtins.InferUndefined;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
class Thread implements Runnable { class Thread implements Runnable {
@ -30,7 +30,5 @@ class Thread implements Runnable {
} else { } else {
return false; return false;
} }
} }
} }

@ -33,8 +33,6 @@ public final class Array {
return new double[length]; return new double[length];
} else if (name == "char") { } else if (name == "char") {
return new char[length]; return new char[length];
} else } else return InferUndefined.object_undefined();
return InferUndefined.object_undefined();
} }
} }

@ -9,12 +9,10 @@ package java.net;
import com.facebook.infer.builtins.InferBuiltins; import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
abstract class PlainSocketImpl extends SocketImpl { abstract class PlainSocketImpl extends SocketImpl {
PlainSocketImpl() { PlainSocketImpl() {
@ -86,7 +84,6 @@ abstract class PlainSocketImpl extends SocketImpl {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
void socketAccept(SocketImpl s) throws IOException { void socketAccept(SocketImpl s) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
@ -148,7 +145,6 @@ abstract class PlainSocketImpl extends SocketImpl {
public void close() { public void close() {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
} }
} }
private static class PlainSocketOutputStream extends OutputStream { private static class PlainSocketOutputStream extends OutputStream {
@ -168,7 +164,5 @@ abstract class PlainSocketImpl extends SocketImpl {
public void close() { public void close() {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
} }
} }
} }

@ -8,7 +8,6 @@
package java.net; package java.net;
import com.facebook.infer.builtins.InferUndefined; import com.facebook.infer.builtins.InferUndefined;
import java.io.IOException; import java.io.IOException;
public class ServerSocket { public class ServerSocket {
@ -18,5 +17,4 @@ public class ServerSocket {
return new Socket(); return new Socket();
} else throw new IOException(); } else throw new IOException();
} }
} }

@ -7,12 +7,11 @@
package java.net; package java.net;
import com.facebook.infer.builtins.InferBuiltins;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import com.facebook.infer.builtins.InferBuiltins;
public class Socket { public class Socket {
InputStream inputStream; InputStream inputStream;
@ -38,5 +37,4 @@ public class Socket {
InferBuiltins.__set_mem_attribute(inputStream); InferBuiltins.__set_mem_attribute(inputStream);
InferBuiltins.__set_mem_attribute(outputStream); InferBuiltins.__set_mem_attribute(outputStream);
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save