[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,11 +10,9 @@ 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,73 +7,71 @@
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
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
String s = getDay(); String s = getDay();
int length = s.length(); int length = s.length();
writeToFile(); writeToFile();
} }
private String getDay() {
if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY) {
return "Wednesday";
} else {
return otherOutput();
}
}
private String otherOutput() { private String getDay() {
return null; if (Calendar.getInstance().get(Calendar.DAY_OF_WEEK) == Calendar.WEDNESDAY) {
return "Wednesday";
} else {
return otherOutput();
} }
}
private void writeToFile() { private String otherOutput() {
byte[] arr = {1, 2, 3}; return null;
FileOutputStream fis; }
try {
fis = new FileOutputStream("file.txt");
fis.write(arr);
fis.close();
} catch (IOException e) {
//Deal with exception
}
}
@Override private void writeToFile() {
public boolean onCreateOptionsMenu(Menu menu) { byte[] arr = {1, 2, 3};
// Inflate the menu; this adds items to the action bar if it is present. FileOutputStream fis;
getMenuInflater().inflate(R.menu.menu_main, menu); try {
return true; fis = new FileOutputStream("file.txt");
fis.write(arr);
fis.close();
} catch (IOException e) {
// Deal with exception
} }
}
@Override @Override
public boolean onOptionsItemSelected(MenuItem item) { public boolean onCreateOptionsMenu(Menu menu) {
// Handle action bar item clicks here. The action bar will // Inflate the menu; this adds items to the action bar if it is present.
// automatically handle clicks on the Home/Up button, so long getMenuInflater().inflate(R.menu.menu_main, menu);
// as you specify a parent activity in AndroidManifest.xml. return true;
int id = item.getItemId(); }
//noinspection SimplifiableIfStatement @Override
if (id == R.id.action_settings) { public boolean onOptionsItemSelected(MenuItem item) {
return true; // Handle action bar item clicks here. The action bar will
} // automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
return super.onOptionsItemSelected(item); //noinspection SimplifiableIfStatement
if (id == R.id.action_settings) {
return true;
} }
return super.onOptionsItemSelected(item);
}
private void inferShouldNotReport() { private void inferShouldNotReport() {
// Generated.java is supposed to be skipped by infer, thus even though // Generated.java is supposed to be skipped by infer, thus even though
// Generated.returnsNull() returns null, infer is not supposed to know // Generated.returnsNull() returns null, infer is not supposed to know
@ -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) {

@ -13,5 +13,5 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ ElementType.METHOD, ElementType.TYPE }) @Target({ElementType.METHOD, ElementType.TYPE})
public @interface Expensive {} public @interface Expensive {}

@ -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 /**
* overrides of methods. * Annotation for methods that always return the same value. The annotation is inherited by
* * overrides of methods.
* This annotation is used to suppress benign race warnings on fields assigned to methods annotated *
* with {@literal @Functional} in the thread-safety analysis. For example: * <p>This annotation is used to suppress benign race warnings on fields assigned to methods
* * annotated with {@literal @Functional} in the thread-safety analysis. For example:
* T mField; *
* {@literal @Functional} T someMethod(); * <p>T mField; {@literal @Functional} T someMethod(); public void getField() { if (mField == null)
* public void getField() { * { mField = someMethod(); } return mField; }
* if (mField == null) { *
* mField = someMethod(); * <p>Normally, we'd report that the access to mField is unsafe, but we won't report here because of
* } * the {@literal @Functional} annotation.
* return mField; *
* } * <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
* Normally, we'd report that the access to mField is unsafe, but we won't report here because of * `long` in the example above, the write-write race on mField would no longer be benign.
* the {@literal @Functional} annotation. */
*
* 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
* `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(
ElementType.METHOD, // method returns something user-controlled value = {
ElementType.PARAMETER, // parameter is user-controlled ElementType.METHOD, // method returns something user-controlled
ElementType.FIELD, // field is user-controlled ElementType.PARAMETER, // parameter 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,5 +13,5 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target; import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target(value={ElementType.METHOD, ElementType.TYPE}) @Target(value = {ElementType.METHOD, ElementType.TYPE})
public @interface PerformanceCritical {} public @interface PerformanceCritical {}

@ -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(
ElementType.METHOD, // method returns something private value = {
ElementType.PARAMETER, // parameter is private ElementType.METHOD, // method returns something private
ElementType.FIELD, // field is private ElementType.PARAMETER, // parameter 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 {}
}

@ -14,10 +14,9 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ @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,8 +17,7 @@ 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 {
boolean enableChecks() default true; boolean enableChecks() default true;

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

@ -14,11 +14,9 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS) @Retention(RetentionPolicy.CLASS)
@Target({ @Target({
ElementType.CONSTRUCTOR, ElementType.CONSTRUCTOR,
ElementType.METHOD, ElementType.METHOD,
ElementType.PACKAGE, ElementType.PACKAGE,
ElementType.TYPE, ElementType.TYPE,
}) })
public @interface Verify {}
public @interface Verify {
}

@ -10,28 +10,27 @@ 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);
} }
// use this instead of "assume o != null". being non-null and allocated are different to Infer // use this instead of "assume o != null". being non-null and allocated are different to Infer
public static void assume_allocated(Object o) { public static void assume_allocated(Object o) {
assume(o != null); assume(o != null);
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,149 +12,133 @@ 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();
public static native int int_undefined(); public static native int int_undefined();
public static native long long_undefined(); public static native long long_undefined();
public static native byte byte_undefined(); public static native byte byte_undefined();
public static native void void_undefined(); public static native void void_undefined();
public static native char char_undefined(); public static native char char_undefined();
public static native short short_undefined(); public static native short short_undefined();
public static native double double_undefined(); public static native double double_undefined();
public static native float float_undefined(); public static native float float_undefined();
public static native Object object_undefined(); public static native Object object_undefined();
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 throw new IOException();
} else }
throw new IOException();
} public static int can_throw_ioexception_int() throws IOException {
boolean undef = boolean_undefined();
public static int can_throw_ioexception_int() throws IOException { if (undef) {
boolean undef = boolean_undefined(); return int_undefined();
if (undef) { } else throw new IOException();
return int_undefined(); }
} else
throw new IOException(); public static long can_throw_ioexception_long() throws IOException {
} boolean undef = boolean_undefined();
if (undef) {
public static long can_throw_ioexception_long() throws IOException { return long_undefined();
boolean undef = boolean_undefined(); } else throw new IOException();
if (undef) { }
return long_undefined();
} else public static byte can_throw_ioexception_byte() throws IOException {
throw new IOException(); boolean undef = boolean_undefined();
} if (undef) {
return byte_undefined();
public static byte can_throw_ioexception_byte() throws IOException { } else throw new IOException();
boolean undef = boolean_undefined(); }
if (undef) {
return byte_undefined(); public static short can_throw_ioexception_short() throws IOException {
} else boolean undef = boolean_undefined();
throw new IOException(); if (undef) {
} return short_undefined();
} else throw new IOException();
public static short can_throw_ioexception_short() throws IOException { }
boolean undef = boolean_undefined();
if (undef) { public static float can_throw_ioexception_float() throws IOException {
return short_undefined(); boolean undef = boolean_undefined();
} else if (undef) {
throw new IOException(); return float_undefined();
} } else throw new IOException();
}
public static float can_throw_ioexception_float() throws IOException {
boolean undef = boolean_undefined(); public static double can_throw_ioexception_double() throws IOException {
if (undef) { boolean undef = boolean_undefined();
return float_undefined(); if (undef) {
} else return double_undefined();
throw new IOException(); } else throw new IOException();
} }
public static double can_throw_ioexception_double() throws IOException { public static char can_throw_ioexception_char() throws IOException {
boolean undef = boolean_undefined(); boolean undef = boolean_undefined();
if (undef) { if (undef) {
return double_undefined(); return char_undefined();
} else } else throw new IOException();
throw new IOException(); }
}
public static String can_throw_ioexception_string() throws IOException {
public static char can_throw_ioexception_char() throws IOException { boolean undef = boolean_undefined();
boolean undef = boolean_undefined(); if (undef) {
if (undef) { return (String) object_undefined();
return char_undefined(); } else throw new IOException();
} else }
throw new IOException();
} public static Object can_throw_ioexception_object() throws IOException {
boolean undef = boolean_undefined();
public static String can_throw_ioexception_string() throws IOException { if (undef) {
boolean undef = boolean_undefined(); return object_undefined();
if (undef) { } else throw new IOException();
return (String)object_undefined(); }
} else
throw new IOException(); public static void can_throw_sqlexception_void() throws SQLException {
} boolean undef = boolean_undefined();
if (undef) {
public static Object can_throw_ioexception_object() throws IOException { } else throw new SQLException();
boolean undef = boolean_undefined(); }
if (undef) {
return object_undefined(); public static int nonneg_int() {
} else int res = int_undefined();
throw new IOException(); InferBuiltins.assume(res >= 0);
} return res;
}
public static void can_throw_sqlexception_void() throws SQLException {
boolean undef = boolean_undefined(); public static void can_throw_socketexception_void() throws SocketException {
if (undef) { boolean undef = boolean_undefined();
} else if (undef) {
throw new SQLException(); } else throw new SocketException();
} }
public static int nonneg_int() { public static int can_throw_socketexception_int() throws SocketException {
int res = int_undefined(); boolean undef = boolean_undefined();
InferBuiltins.assume(res >= 0); if (undef) {
return res; return int_undefined();
} } else throw new SocketException();
}
public static void can_throw_socketexception_void() throws SocketException {
boolean undef = boolean_undefined(); public static Object can_throw_socketexception_object() throws SocketException {
if (undef) { boolean undef = boolean_undefined();
} else if (undef) {
throw new SocketException(); return object_undefined();
} } else throw new SocketException();
}
public static int can_throw_socketexception_int() throws SocketException {
boolean undef = boolean_undefined();
if (undef) {
return int_undefined();
} else
throw new SocketException();
}
public static Object can_throw_socketexception_object() throws SocketException {
boolean undef = boolean_undefined();
if (undef) {
return object_undefined();
} else
throw new SocketException();
}
} }

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

@ -10,39 +10,35 @@ 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 {
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) {
super(name);
}
}
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) { public NotFoundException(String name) {
return new TypedArray(null, attrs, attrs, 1); super(name);
} }
}
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
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 {

@ -12,20 +12,17 @@ import android.database.Cursor;
public class DownloadManager { public class DownloadManager {
private ContentResolver mResolver; private ContentResolver mResolver;
private String mPackageName; private String mPackageName;
public DownloadManager(ContentResolver resolver, String packageName) { public DownloadManager(ContentResolver resolver, String packageName) {
mResolver = resolver; mResolver = resolver;
mPackageName = packageName; mPackageName = packageName;
} }
public static class Query {
}
public Cursor query(Query query) {
return mResolver.query(null, null, null, null, null);
}
public static class Query {}
public Cursor query(Query query) {
return mResolver.query(null, null, null, null, null);
}
} }

@ -7,43 +7,44 @@
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 {
private ContentResolver mContentResolver; private ContentResolver mContentResolver;
private IContentProvider mContentProvider; private IContentProvider mContentProvider;
private String mPackageName; private String mPackageName;
private boolean mStable; private boolean mStable;
ContentProviderClient( ContentProviderClient(
ContentResolver contentResolver, IContentProvider contentProvider, boolean stable) { ContentResolver contentResolver, IContentProvider contentProvider, boolean stable) {
mContentResolver = contentResolver; mContentResolver = contentResolver;
mContentProvider = contentProvider; mContentProvider = contentProvider;
mPackageName = (String)InferUndefined.object_undefined(); mPackageName = (String) InferUndefined.object_undefined();
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)
return query(url, projection, selection, selectionArgs, sortOrder, null); throws RemoteException {
} return query(url, projection, selection, selectionArgs, sortOrder, null);
}
public Cursor query(Uri url, String[] projection, String selection, String[] selectionArgs,
String sortOrder, CancellationSignal cancellationSignal) throws RemoteException { public Cursor query(
return new SQLiteCursor(null, null, null); Uri url,
} String[] projection,
String selection,
private class NotRespondingRunnable { String[] selectionArgs,
} String sortOrder,
CancellationSignal cancellationSignal)
throws RemoteException {
return new SQLiteCursor(null, null, null);
}
private class NotRespondingRunnable {}
} }

@ -11,42 +11,44 @@ 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;
public ContentResolver(Context context) { public ContentResolver(Context context) {
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 {
return query(uri, projection, selection, selectionArgs, sortOrder, null); return query(uri, projection, selection, selectionArgs, sortOrder, null);
}
} }
}
public final Cursor query(final Uri uri, String[] projection,
String selection, String[] selectionArgs, String sortOrder, public final Cursor query(
CancellationSignal cancellationSignal) { final Uri uri,
if (InferUndefined.boolean_undefined()) { String[] projection,
return null; String selection,
} else { String[] selectionArgs,
return new SQLiteCursor(null, null, null); String sortOrder,
} CancellationSignal cancellationSignal) {
if (InferUndefined.boolean_undefined()) {
return null;
} else {
return new SQLiteCursor(null, null, null);
} }
}
public final ContentProviderClient acquireContentProviderClient(Uri uri) { public final ContentProviderClient acquireContentProviderClient(Uri uri) {
return new ContentProviderClient(this, null, true); return new ContentProviderClient(this, null, true);
} }
public final ContentProviderClient acquireContentProviderClient(String name) { public final ContentProviderClient acquireContentProviderClient(String name) {
return new ContentProviderClient(this, null, true); return new ContentProviderClient(this, null, true);
} }
} }

@ -13,40 +13,35 @@ import com.facebook.infer.builtins.InferUndefined;
public class Context { public class Context {
public ContentResolver getContentResolver() {
return new ContentResolver(this);
}
public ContentResolver getContentResolver() { public TypedArray obtainStyledAttributes(int[] attrs) {
return new ContentResolver(this); return new TypedArray(null, attrs, attrs, 1);
} }
public TypedArray obtainStyledAttributes(int[] attrs) {
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);
}
} }
}
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,44 +8,37 @@
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)
throws NotFoundException {
if (InferUndefined.boolean_undefined()) {
throw new NotFoundException();
}
return new TypedArray(null, attrs, attrs, 1);
}
public TypedArray obtainStyledAttributes(AttributeSet set,
int[] attrs, int defStyleAttr, int defStyleRes) {
return new TypedArray(null, attrs, attrs, 1);
}
} }
public static class NotFoundException extends RuntimeException { public TypedArray obtainStyledAttributes(int resid, int[] attrs) throws NotFoundException {
public NotFoundException() { if (InferUndefined.boolean_undefined()) {
} throw new NotFoundException();
}
return new TypedArray(null, attrs, attrs, 1);
}
public NotFoundException(String name) { public TypedArray obtainStyledAttributes(
super(name); AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
} return new TypedArray(null, attrs, attrs, 1);
} }
}
public static class NotFoundException extends RuntimeException {
public NotFoundException() {}
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) { public NotFoundException(String name) {
return new TypedArray(null, attrs, attrs, 1); super(name);
} }
}
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return new TypedArray(null, attrs, attrs, 1);
}
} }

@ -11,28 +11,27 @@ import com.facebook.infer.builtins.InferBuiltins;
public class TypedArray { public class TypedArray {
private Resources mResources; private Resources mResources;
int[] mData; int[] mData;
int[] mIndices; int[] mIndices;
int mLength; int mLength;
public void recycle() { public void recycle() {
// Release resource // Release resource
if (mLength > 0) { if (mLength > 0) {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_mem_attribute(this);
}
} }
}
public TypedArray(Resources resources, int[] data, int[] indices, int len) { public TypedArray(Resources resources, int[] data, int[] indices, int len) {
mResources = resources; mResources = resources;
mData = data; mData = data;
mIndices = indices; mIndices = indices;
mLength = len; mLength = len;
// Acquire resource // Acquire resource
if (mLength > 0) { if (mLength > 0) {
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,24 +9,20 @@ 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) {
InferBuiltins.__set_file_attribute(this);
}
public void close() { public SQLiteCursor(SQLiteCursorDriver driver, String editTable, SQLiteQuery query) {
InferBuiltins.__set_mem_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
public void close() {
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) {
public Cursor query(boolean distinct, String table, String[] columns, return queryWithFactory(
String selection, String[] selectionArgs, String groupBy, null,
String having, String orderBy, String limit, CancellationSignal cancellationSignal) { distinct,
return queryWithFactory(null, distinct, table, columns, selection, selectionArgs, table,
groupBy, having, orderBy, limit, cancellationSignal); columns,
} selection,
selectionArgs,
groupBy,
public Cursor queryWithFactory(CursorFactory cursorFactory, having,
boolean distinct, String table, String[] columns, orderBy,
String selection, String[] selectionArgs, String groupBy, limit,
String having, String orderBy, String limit) { null);
return queryWithFactory(cursorFactory, distinct, table, columns, selection, }
selectionArgs, groupBy, having, orderBy, limit, null);
} public Cursor query(
boolean distinct,
String table,
public Cursor queryWithFactory(CursorFactory cursorFactory, String[] columns,
boolean distinct, String table, String[] columns, String selection,
String selection, String[] selectionArgs, String groupBy, String[] selectionArgs,
String having, String orderBy, String limit, CancellationSignal cancellationSignal) { String groupBy,
return rawQueryWithFactory(cursorFactory, null, selectionArgs, table, cancellationSignal); String having,
} String orderBy,
String limit,
public Cursor query(String table, String[] columns, String selection, CancellationSignal cancellationSignal) {
String[] selectionArgs, String groupBy, String having, return queryWithFactory(
String orderBy) { null,
distinct,
return query(false, table, columns, selection, selectionArgs, groupBy, table,
having, orderBy, null /* limit */); columns,
} selection,
selectionArgs,
public Cursor query(String table, String[] columns, String selection, groupBy,
String[] selectionArgs, String groupBy, String having, having,
String orderBy, String limit) { orderBy,
limit,
return query(false, table, columns, selection, selectionArgs, groupBy, cancellationSignal);
having, orderBy, limit); }
}
public Cursor queryWithFactory(
public Cursor rawQuery(String sql, String[] selectionArgs) { CursorFactory cursorFactory,
return rawQueryWithFactory(null, sql, selectionArgs, null, null); boolean distinct,
} String table,
String[] columns,
public Cursor rawQuery(String sql, String[] selectionArgs, String selection,
CancellationSignal cancellationSignal) { String[] selectionArgs,
return rawQueryWithFactory(null, sql, selectionArgs, null, cancellationSignal); String groupBy,
} String having,
String orderBy,
public Cursor rawQueryWithFactory( String limit) {
CursorFactory cursorFactory, String sql, String[] selectionArgs, return queryWithFactory(
String editTable) { cursorFactory,
return rawQueryWithFactory(cursorFactory, sql, selectionArgs, editTable, null); distinct,
} table,
columns,
public Cursor rawQueryWithFactory( selection,
CursorFactory cursorFactory, String sql, String[] selectionArgs, selectionArgs,
String editTable, CancellationSignal cancellationSignal) { groupBy,
return new SQLiteCursor(null, editTable, null); having,
} orderBy,
limit,
public interface CursorFactory { null);
public Cursor newCursor(SQLiteDatabase db, }
SQLiteCursorDriver masterQuery, String editTable,
SQLiteQuery query); public Cursor queryWithFactory(
} CursorFactory cursorFactory,
boolean distinct,
String table,
String[] columns,
String selection,
String[] selectionArgs,
String groupBy,
String having,
String orderBy,
String limit,
CancellationSignal cancellationSignal) {
return rawQueryWithFactory(cursorFactory, null, selectionArgs, table, cancellationSignal);
}
public Cursor query(
String table,
String[] columns,
String selection,
String[] selectionArgs,
String groupBy,
String having,
String orderBy) {
return query(
false,
table,
columns,
selection,
selectionArgs,
groupBy,
having,
orderBy,
null /* limit */);
}
public Cursor query(
String table,
String[] columns,
String selection,
String[] selectionArgs,
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) {
return rawQueryWithFactory(null, sql, selectionArgs, null, null);
}
public Cursor rawQuery(
String sql, String[] selectionArgs, CancellationSignal cancellationSignal) {
return rawQueryWithFactory(null, sql, selectionArgs, null, cancellationSignal);
}
public Cursor rawQueryWithFactory(
CursorFactory cursorFactory, String sql, String[] selectionArgs, String editTable) {
return rawQueryWithFactory(cursorFactory, sql, selectionArgs, editTable, null);
}
public Cursor rawQueryWithFactory(
CursorFactory cursorFactory,
String sql,
String[] selectionArgs,
String editTable,
CancellationSignal cancellationSignal) {
return new SQLiteCursor(null, editTable, null);
}
public interface CursorFactory {
public Cursor newCursor(
SQLiteDatabase db, SQLiteCursorDriver masterQuery, String editTable, 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,
public Cursor query(SQLiteDatabase db, String[] projectionIn, String sortOrder) {
String selection, String[] selectionArgs, String groupBy, return query(
String having, String sortOrder, String limit) { db,
return query(db, projectionIn, selection, selectionArgs, projectionIn,
groupBy, having, sortOrder, limit, null); selection,
} selectionArgs,
groupBy,
public Cursor query(SQLiteDatabase db, String[] projectionIn, having,
String selection, String[] selectionArgs, String groupBy, sortOrder,
String having, String sortOrder, String limit, null /* limit */,
CancellationSignal cancellationSignal) { null /* cancellationSignal */);
return new SQLiteCursor(null, null, null); }
}
public Cursor query(
SQLiteDatabase db,
String[] projectionIn,
String selection,
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,
String selection,
String[] selectionArgs,
String groupBy,
String having,
String sortOrder,
String limit,
CancellationSignal cancellationSignal) {
return new SQLiteCursor(null, null, null);
}
} }

@ -13,23 +13,27 @@ import android.net.Uri;
public final class MediaStore { 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(
public static final Cursor query(ContentResolver cr, Uri uri, String[] projection, ContentResolver cr, Uri uri, String[] projection, String where, String orderBy) {
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(
public static final Cursor query(ContentResolver cr, Uri uri, String[] projection, ContentResolver cr,
String selection, String[] selectionArgs, String orderBy) { Uri uri,
return cr.query(uri, projection, selection, selectionArgs, orderBy); String[] projection,
} String selection,
} String[] selectionArgs,
String orderBy) {
return cr.query(uri, projection, selection, selectionArgs, orderBy);
}
} }
}
} }

@ -18,11 +18,11 @@
package android.text; package android.text;
public class TextUtils { public class TextUtils {
public static boolean isEmpty(CharSequence str) { public static boolean isEmpty(CharSequence str) {
if (str == null || str.length() == 0) { if (str == null || str.length() == 0) {
return true; return true;
} else { } else {
return false; return false;
}
} }
}
} }

@ -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) throws IOException, JsonParseException {
public JsonParser createParser(File f) return createOwningParser();
throws IOException, JsonParseException { }
return createOwningParser();
} public JsonParser createParser(URL url) throws IOException, JsonParseException {
return createOwningParser();
public JsonParser createParser(URL url) }
throws IOException, JsonParseException {
return createOwningParser(); public JsonParser createParser(InputStream in) throws IOException, JsonParseException {
} return createNonOwningParser();
}
public JsonParser createParser(InputStream in)
throws IOException, JsonParseException { public JsonParser createParser(Reader r) throws IOException, JsonParseException {
return createNonOwningParser(); return createNonOwningParser();
} }
public JsonParser createParser(Reader r) private JsonParser createOwningParser() throws IOException, JsonParseException {
throws IOException, JsonParseException { InputStream in = new FileInputStream("");
return createNonOwningParser(); return new UTF8StreamJsonParser(null, 0, in, null, null, new byte[] {}, 0, 0, false);
} }
private JsonParser createOwningParser()
throws IOException, JsonParseException {
InputStream in = new FileInputStream("");
return new UTF8StreamJsonParser(null, 0, in, null, null,
new byte[]{}, 0, 0,
false);
}
private JsonParser createNonOwningParser()
throws IOException, JsonParseException {
return new UTF8StreamJsonParser(null, 0, null, null, null,
new byte[]{}, 0, 0,
false);
}
private JsonParser createNonOwningParser() throws IOException, JsonParseException {
return new UTF8StreamJsonParser(null, 0, null, null, null, new byte[] {}, 0, 0, false);
}
} }

@ -9,32 +9,27 @@ 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);
}
if (InferUndefined.boolean_undefined()) {
throw new IOException();
}
} }
if (InferUndefined.boolean_undefined()) {
public Object readValueAs(Class valueType) throw new IOException();
throws IOException, JsonProcessingException {
throwExceptions();
return InferUndefined.object_undefined();
} }
}
public Object readValueAs(Class valueType) throws IOException, JsonProcessingException {
throwExceptions();
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,120 +23,114 @@ 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; protected BytesToNameCanonicalizer _symbols;
protected BytesToNameCanonicalizer _symbols; protected int[] _quadBuffer;
protected int[] _quadBuffer; protected boolean _tokenIncomplete;
protected boolean _tokenIncomplete; protected InputStream _inputStream;
protected InputStream _inputStream; protected byte[] _inputBuffer;
protected byte[] _inputBuffer; protected boolean _bufferRecyclable;
protected boolean _bufferRecyclable; public UTF8StreamJsonParser(
IOContext ctxt,
public UTF8StreamJsonParser(IOContext ctxt, int features, InputStream in, int features,
ObjectCodec codec, BytesToNameCanonicalizer sym, InputStream in,
byte[] inputBuffer, int start, int end, ObjectCodec codec,
boolean bufferRecyclable) { BytesToNameCanonicalizer sym,
super(ctxt, features); byte[] inputBuffer,
_inputStream = in; int start,
_objectCodec = codec; int end,
_symbols = sym; boolean bufferRecyclable) {
_inputBuffer = inputBuffer; super(ctxt, features);
_inputPtr = start; _inputStream = in;
_inputEnd = end; _objectCodec = codec;
_bufferRecyclable = bufferRecyclable; _symbols = sym;
} _inputBuffer = inputBuffer;
_inputPtr = start;
@Override _inputEnd = end;
public void close() throws IOException { _bufferRecyclable = bufferRecyclable;
if (_inputStream != null) { }
_inputStream.close();
} @Override
} public void close() throws IOException {
if (_inputStream != null) {
private void throwExceptions() _inputStream.close();
throws JsonParseException, IOException {
if (InferUndefined.boolean_undefined()) {
throw new JsonParseException(null, null, null);
}
if (InferUndefined.boolean_undefined()) {
throw new IOException();
}
}
/*
* Methods from ParserBase
*/
@Override
protected boolean loadMore()
throws IOException {
return InferUndefined.can_throw_ioexception_boolean();
}
@Override
protected void _finishString()
throws IOException, JsonParseException {
throwExceptions();
}
@Override
protected void _closeInput() throws IOException {
close();
}
/*
* Methods from ParserMinimalBase
*/
@Override
public byte[] getBinaryValue(Base64Variant b64variant)
throws IOException, JsonParseException {
throwExceptions();
return new byte[]{InferUndefined.byte_undefined()};
} }
}
@Override private void throwExceptions() throws JsonParseException, IOException {
public int getTextOffset() if (InferUndefined.boolean_undefined()) {
throws IOException, JsonParseException { throw new JsonParseException(null, null, null);
throwExceptions();
return InferUndefined.int_undefined();
} }
if (InferUndefined.boolean_undefined()) {
@Override throw new IOException();
public int getTextLength()
throws IOException, JsonParseException {
throwExceptions();
return InferUndefined.int_undefined();
}
@Override
public char[] getTextCharacters()
throws IOException, JsonParseException {
throwExceptions();
return new char[]{InferUndefined.char_undefined()};
}
@Override
public String getText()
throws IOException, JsonParseException {
throwExceptions();
return (String)InferUndefined.object_undefined();
}
@Override
public JsonToken nextToken()
throws IOException, JsonParseException {
throwExceptions();
throw new IOException();
} }
}
/*
* Methods from ParserBase
*/
@Override
protected boolean loadMore() throws IOException {
return InferUndefined.can_throw_ioexception_boolean();
}
@Override
protected void _finishString() throws IOException, JsonParseException {
throwExceptions();
}
@Override
protected void _closeInput() throws IOException {
close();
}
/*
* Methods from ParserMinimalBase
*/
@Override
public byte[] getBinaryValue(Base64Variant b64variant) throws IOException, JsonParseException {
throwExceptions();
return new byte[] {InferUndefined.byte_undefined()};
}
@Override
public int getTextOffset() throws IOException, JsonParseException {
throwExceptions();
return InferUndefined.int_undefined();
}
@Override
public int getTextLength() throws IOException, JsonParseException {
throwExceptions();
return InferUndefined.int_undefined();
}
@Override
public char[] getTextCharacters() throws IOException, JsonParseException {
throwExceptions();
return new char[] {InferUndefined.char_undefined()};
}
@Override
public String getText() throws IOException, JsonParseException {
throwExceptions();
return (String) InferUndefined.object_undefined();
}
@Override
public JsonToken nextToken() throws IOException, JsonParseException {
throwExceptions();
throw new IOException();
}
} }

@ -9,9 +9,8 @@ package com.google.common.base;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public abstract class Optional<T> { 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,14 +31,14 @@ 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(
@Nullable String errorMessageTemplate, boolean expression,
@Nullable Object... errorMessageArgs) { @Nullable String errorMessageTemplate,
@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,20 +9,17 @@ 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;
public final class Closeables { 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) {
InferCloseables.closeQuietly(closeable);
}
public static void closeQuietly(Closeable closeable) {
InferCloseables.closeQuietly(closeable);
}
} }

@ -7,10 +7,9 @@
package dalvik.system; package dalvik.system;
public class CloseGuard { public class CloseGuard {
public static interface Reporter { public static interface Reporter {
public void report(String message, Throwable allocationSite); public void report(String message, Throwable allocationSite);
} }
} }

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

@ -11,34 +11,33 @@ import com.facebook.infer.builtins.InferUndefined;
public class BufferedOutputStream extends FilterOutputStream { public class BufferedOutputStream extends FilterOutputStream {
public BufferedOutputStream(OutputStream out) { public BufferedOutputStream(OutputStream out) {
super(out); super(out);
} }
public BufferedOutputStream(OutputStream out, int size) { public BufferedOutputStream(OutputStream out, int size) {
super(out); super(out);
} }
public void close() throws IOException { public void close() throws IOException {
if (out != null) { if (out != null) {
out.close(); out.close();
}
} }
}
public void flush() throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(int b) throws IOException { public void write(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
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();
} }
public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
} }

@ -9,35 +9,33 @@ 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 {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void newLine() throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public void write(char cbuf[]) throws IOException { public void newLine() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(char cbuf[], int off, int len) throws IOException { public void write(char cbuf[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(int c) throws IOException { public void write(char cbuf[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(String str) throws IOException { public void write(int c) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(String str, int off, int len) throws IOException { public void write(String str) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(String str, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
} }

@ -9,75 +9,73 @@ 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 {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(byte b[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public final boolean readBoolean() throws IOException { public int read(byte b[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_int();
} }
public final byte readByte() throws IOException { public final boolean readBoolean() throws IOException {
return InferUndefined.can_throw_ioexception_byte(); return InferUndefined.can_throw_ioexception_boolean();
} }
public final char readChar() throws IOException { public final byte readByte() throws IOException {
return InferUndefined.can_throw_ioexception_char(); return InferUndefined.can_throw_ioexception_byte();
} }
public final double readDouble() throws IOException { public final char readChar() throws IOException {
return InferUndefined.can_throw_ioexception_double(); return InferUndefined.can_throw_ioexception_char();
} }
public final float readFloat() throws IOException { public final double readDouble() throws IOException {
return InferUndefined.can_throw_ioexception_float(); return InferUndefined.can_throw_ioexception_double();
} }
public final void readFully(byte b[]) throws IOException { public final float readFloat() throws IOException {
InferUndefined.can_throw_ioexception_void(); return InferUndefined.can_throw_ioexception_float();
} }
public final void readFully(byte b[], int off, int len) throws IOException { public final void readFully(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final int readInt() throws IOException { public final void readFully(byte b[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); InferUndefined.can_throw_ioexception_void();
} }
public final long readLong() throws IOException { public final int readInt() throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_int();
} }
public final short readShort() throws IOException { public final long readLong() throws IOException {
return InferUndefined.can_throw_ioexception_short(); return InferUndefined.can_throw_ioexception_long();
} }
public final int readUnsignedByte() throws IOException { public final short readShort() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_short();
} }
public final int readUnsignedShort() throws IOException { public final int readUnsignedByte() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public final String readUTF() throws IOException { public final int readUnsignedShort() throws IOException {
return InferUndefined.can_throw_ioexception_string(); return InferUndefined.can_throw_ioexception_int();
} }
public static final String readUTF(DataInput in) throws IOException { public final String readUTF() throws IOException {
return InferUndefined.can_throw_ioexception_string(); return InferUndefined.can_throw_ioexception_string();
} }
public final int skipBytes(int n) throws IOException { public static final String readUTF(DataInput in) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_string();
} }
public final int skipBytes(int n) throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
} }

@ -9,71 +9,69 @@ 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) {
super(out); super(out);
} }
public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public void write(byte b[], int off, int len) throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(byte b[]) throws IOException { public void write(byte b[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(int b) throws IOException { public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeBoolean(boolean v) throws IOException { public void write(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeByte(int v) throws IOException { public final void writeBoolean(boolean v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeBytes(String s) throws IOException { public final void writeByte(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeChar(int v) throws IOException { public final void writeBytes(String s) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeChars(String s) throws IOException { public final void writeChar(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeDouble(double v) throws IOException { public final void writeChars(String s) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeFloat(float v) throws IOException { public final void writeDouble(double v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeInt(int v) throws IOException { public final void writeFloat(float v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeLong(long v) throws IOException { public final void writeInt(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeShort(int v) throws IOException { public final void writeLong(long v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeUTF(String str) throws IOException { public final void writeShort(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeUTF(String str) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
} }

@ -12,12 +12,11 @@ import javax.annotation.Nullable;
public class File { public class File {
public @Nullable File[] listFiles() { public @Nullable File[] listFiles() {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
return null; return null;
} else { } else {
return (File[])InferUndefined.object_undefined(); return (File[]) InferUndefined.object_undefined();
}
} }
}
} }

@ -9,70 +9,67 @@ 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 FileInputStream extends InputStream { public class FileInputStream extends InputStream {
private FileDescriptor fd; private FileDescriptor fd;
private FileChannel channel; private FileChannel channel;
private void init() {
InferBuiltins.__set_file_attribute(this);
}
public FileInputStream(String name) throws FileNotFoundException {
if (InferUndefined.boolean_undefined()) {
init();
} else {
throw new FileNotFoundException();
}
}
public FileInputStream(File file) throws FileNotFoundException {
if (InferUndefined.boolean_undefined()) {
init();
} else {
throw new FileNotFoundException();
}
}
public FileInputStream(FileDescriptor fdObj) {
init();
}
public void close() throws IOException {
super.close();
}
public FileChannel getChannel() {
channel = new FileChannelImpl(this, fd, InferUndefined.int_undefined());
return channel;
}
public int available() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
@Override private void init() {
public int read() throws IOException { InferBuiltins.__set_file_attribute(this);
return InferUndefined.can_throw_ioexception_int(); }
}
@Override public FileInputStream(String name) throws FileNotFoundException {
public int read(byte b[]) throws IOException { if (InferUndefined.boolean_undefined()) {
return InferUndefined.can_throw_ioexception_int(); init();
} else {
throw new FileNotFoundException();
} }
}
@Override public FileInputStream(File file) throws FileNotFoundException {
public int read(byte b[], int off, int len) throws IOException { if (InferUndefined.boolean_undefined()) {
return InferUndefined.can_throw_ioexception_int(); init();
} else {
throw new FileNotFoundException();
} }
}
public long skip(int n) throws IOException {
return InferUndefined.can_throw_ioexception_long(); public FileInputStream(FileDescriptor fdObj) {
} init();
}
public void close() throws IOException {
super.close();
}
public FileChannel getChannel() {
channel = new FileChannelImpl(this, fd, InferUndefined.int_undefined());
return channel;
}
public int available() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
@Override
public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
@Override
public int read(byte b[]) throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
@Override
public int read(byte b[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int();
}
public long skip(int n) throws IOException {
return InferUndefined.can_throw_ioexception_long();
}
} }

@ -9,77 +9,73 @@ 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;
private FileChannel channel; private FileChannel channel;
private void init() { private void init() {
InferBuiltins.__set_file_attribute(this); InferBuiltins.__set_file_attribute(this);
} }
public FileOutputStream(String name) throws FileNotFoundException {
if (InferUndefined.boolean_undefined()) {
init();
} else {
throw new FileNotFoundException();
}
}
public FileOutputStream(String name, boolean append) throws FileNotFoundException { public FileOutputStream(String name) throws FileNotFoundException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
init(); init();
} else { } else {
throw new FileNotFoundException(); throw new FileNotFoundException();
}
} }
}
public FileOutputStream(File file) throws FileNotFoundException { public FileOutputStream(String name, boolean append) throws FileNotFoundException {
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
init(); init();
} else { } else {
throw new FileNotFoundException(); throw new FileNotFoundException();
}
} }
}
public FileOutputStream(File file, boolean append) public FileOutputStream(File file) throws FileNotFoundException {
throws FileNotFoundException { if (InferUndefined.boolean_undefined()) {
if (InferUndefined.boolean_undefined()) { init();
init(); } else {
} else { throw new FileNotFoundException();
throw new FileNotFoundException();
}
} }
}
public FileOutputStream(FileDescriptor fdObj) { public FileOutputStream(File file, boolean append) throws FileNotFoundException {
init(); if (InferUndefined.boolean_undefined()) {
init();
} else {
throw new FileNotFoundException();
} }
}
public FileChannel getChannel() { public FileOutputStream(FileDescriptor fdObj) {
channel = new FileChannelImpl(this, fd, InferUndefined.int_undefined()); init();
return channel; }
}
public void write(int b) throws IOException { public FileChannel getChannel() {
InferUndefined.can_throw_ioexception_void(); channel = new FileChannelImpl(this, fd, InferUndefined.int_undefined());
} return channel;
}
public void write(byte b[]) throws IOException { public void write(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(byte b[], int off, int len) throws IOException { public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void close() throws IOException { public void write(byte b[], int off, int len) throws IOException {
InferBuiltins.__set_mem_attribute(this); InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void();
}
} }

@ -11,29 +11,27 @@ import com.facebook.infer.builtins.InferUndefined;
public class FilterInputStream { public class FilterInputStream {
public int available() throws IOException { public int available() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(byte b[]) throws IOException { public int read(byte b[]) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
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();
} }
public void reset() throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long();
}
public void reset() throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long();
}
} }

@ -11,36 +11,33 @@ import com.facebook.infer.builtins.InferUndefined;
public class FilterOutputStream { public class FilterOutputStream {
protected OutputStream out; protected OutputStream out;
public FilterOutputStream() { public FilterOutputStream() {}
}
public FilterOutputStream(OutputStream out) {
this.out = out;
}
public void close() throws IOException {
if (out != null) {
out.close();
}
}
public void flush() throws IOException { public FilterOutputStream(OutputStream out) {
InferUndefined.can_throw_ioexception_void(); this.out = out;
} }
public void write(int b) throws IOException { public void close() throws IOException {
InferUndefined.can_throw_ioexception_void(); if (out != null) {
out.close();
} }
}
public void write(byte b[]) throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(byte b[], int off, int len) throws IOException { public void write(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public void write(byte b[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
} }

@ -11,28 +11,27 @@ import com.facebook.infer.builtins.InferUndefined;
public abstract class FilterReader { public abstract class FilterReader {
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(char cbuf[]) throws IOException { public int read(char cbuf[]) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(char cbuf[], int off, int len) throws IOException { public int read(char cbuf[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public boolean ready() throws IOException { public boolean ready() throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_boolean();
} }
public void reset() throws IOException { public void reset() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long();
}
public long skip(long n) throws IOException {
return InferUndefined.can_throw_ioexception_long();
}
} }

@ -12,21 +12,20 @@ import com.facebook.infer.builtins.InferUndefined;
public class InputStream { public class InputStream {
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();
} }
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(byte b[]) throws IOException { public int read(byte b[]) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
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,37 +11,29 @@ 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) else if (InferUtils.isValidCharset(charsetName)) {
throw new NullPointerException("charsetName"); InferBuiltins.__set_mem_attribute(in);
else if (InferUtils.isValidCharset(charsetName)) { InferBuiltins.__set_file_attribute(this);
InferBuiltins.__set_mem_attribute(in); } else throw new UnsupportedEncodingException();
InferBuiltins.__set_file_attribute(this); }
} else
throw new UnsupportedEncodingException(); public int read() throws IOException {
} return InferUndefined.can_throw_ioexception_int();
}
public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); public int read(char cbuf[]) throws IOException {
} return InferUndefined.can_throw_ioexception_int();
}
public int read(char cbuf[]) throws IOException {
return InferUndefined.can_throw_ioexception_int(); public int read(char[] cbuf, int off, int len) throws IOException {
} return InferUndefined.can_throw_ioexception_int();
}
public int read(char[] cbuf, int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); public boolean ready() throws IOException {
} return InferUndefined.can_throw_ioexception_boolean();
}
public boolean ready() throws IOException {
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 {}
}
} }

@ -11,94 +11,94 @@ import com.facebook.infer.builtins.InferUndefined;
public class ObjectOutputStream extends OutputStream { public class ObjectOutputStream extends OutputStream {
private DataOutputStream output; private DataOutputStream output;
public ObjectOutputStream(OutputStream out) throws IOException { public ObjectOutputStream(OutputStream out) throws IOException {
this.output = new DataOutputStream(out); this.output = new DataOutputStream(out);
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void close() throws IOException { public void close() throws IOException {
output.close(); output.close();
} }
public void defaultWriteObject() throws IOException { public void defaultWriteObject() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void flush() throws IOException { public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void reset() throws IOException { public void reset() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(byte b[]) throws IOException { public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
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();
} }
public void write(int b) throws IOException { public void write(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeBoolean(boolean val) throws IOException { public void writeBoolean(boolean val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeByte(int val) throws IOException { public void writeByte(int val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeBytes(String str) throws IOException { public void writeBytes(String str) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeChar(int val) throws IOException { public void writeChar(int val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeChars(String str) throws IOException { public void writeChars(String str) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeDouble(double val) throws IOException { public void writeDouble(double val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeFields() throws IOException { public void writeFields() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeFloat(float val) throws IOException { public void writeFloat(float val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeInt(int val) throws IOException { public void writeInt(int val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeLong(long val) throws IOException { public void writeLong(long val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeObject(Object obj) throws IOException { public final void writeObject(Object obj) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeShort(int val) throws IOException { public void writeShort(int val) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeUnshared(Object obj) throws IOException { public void writeUnshared(Object obj) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void writeUTF(String str) throws IOException { public void writeUTF(String str) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
} }

@ -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,43 +11,37 @@ 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 throw new UnsupportedEncodingException();
} else }
throw new UnsupportedEncodingException();
} public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void();
public void flush() throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(char cbuf[]) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(char cbuf[]) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(char cbuf[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(char cbuf[], int off, int len) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(int c) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(int c) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(String str) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(String str) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(String str, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(String str, int off, int len) throws IOException { }
InferUndefined.can_throw_ioexception_void();
}
} }

@ -12,46 +12,44 @@ import com.facebook.infer.builtins.InferUndefined;
public class PipedInputStream extends InputStream { public class PipedInputStream extends InputStream {
public PipedInputStream(PipedOutputStream src) throws IOException { public PipedInputStream(PipedOutputStream src) throws IOException {
this(); this();
} }
public PipedInputStream(PipedOutputStream src, int pipeSize) public PipedInputStream(PipedOutputStream src, int pipeSize) throws IOException {
throws IOException { this();
this(); }
}
public PipedInputStream() {
public PipedInputStream() { InferBuiltins.__set_file_attribute(this);
InferBuiltins.__set_file_attribute(this); }
}
public PipedInputStream(int pipeSize) {
public PipedInputStream(int pipeSize) { this();
this(); }
}
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(); }
}
public void connect(PipedOutputStream src) throws IOException {
public void connect(PipedOutputStream src) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public int available() throws IOException {
public int available() throws IOException { return InferUndefined.can_throw_ioexception_int();
return InferUndefined.can_throw_ioexception_int(); }
}
public int read() throws IOException {
public int read() throws IOException { return InferUndefined.can_throw_ioexception_int();
return InferUndefined.can_throw_ioexception_int(); }
}
public int read(byte b[]) throws IOException {
public int read(byte b[]) throws IOException { return InferUndefined.can_throw_ioexception_int();
return InferUndefined.can_throw_ioexception_int(); }
}
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,37 +12,36 @@ 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); }
}
public PipedOutputStream() {
public PipedOutputStream() { InferBuiltins.__set_file_attribute(this);
InferBuiltins.__set_file_attribute(this); }
}
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(); }
}
public void connect(PipedInputStream snk) throws IOException {
public void connect(PipedInputStream snk) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public void flush() throws IOException {
public void flush() throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public void write(byte b[]) throws IOException {
public void write(byte b[]) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
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(); }
}
public void write(int b) throws IOException {
public void write(int b) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
} }

@ -12,56 +12,53 @@ import com.facebook.infer.builtins.InferUndefined;
public class PipedReader extends Reader { public class PipedReader extends Reader {
private void init() throws IOException { private void init() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
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();
} }
public PipedReader(PipedWriter src, int pipeSize) throws IOException { public PipedReader(PipedWriter src, int pipeSize) throws IOException {
init(); init();
} }
public void connect(PipedWriter src) throws IOException { public void connect(PipedWriter src) throws IOException {
init(); init();
} }
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(char[] cbuf, int off, int len) throws IOException { public int read(char[] cbuf, int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public boolean ready() throws IOException { public boolean ready() throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_boolean();
} }
public void mark(int readAheadLimit) throws IOException { public void mark(int readAheadLimit) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void reset() throws IOException { public void reset() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
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();
} }
public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void();
}
public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void();
}
} }

@ -12,65 +12,62 @@ import com.facebook.infer.builtins.InferUndefined;
public abstract class PipedWriter extends Writer { public abstract class PipedWriter extends Writer {
private void init() throws IOException { private void init() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
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(); }
}
public void connect(PipedReader snk) throws IOException {
public void connect(PipedReader snk) throws IOException { init();
init(); }
}
public Writer append(char c) throws IOException {
public Writer append(char c) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); return this;
return this; }
}
public Writer append(CharSequence csq) throws IOException {
public Writer append(CharSequence csq) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); return this;
return this; }
}
public Writer append(CharSequence csq, int start, int end) throws IOException {
public Writer append(CharSequence csq, int start, int end) InferUndefined.can_throw_ioexception_void();
throws IOException { return this;
InferUndefined.can_throw_ioexception_void(); }
return this;
} public void flush() throws IOException {
InferUndefined.can_throw_ioexception_void();
public void flush() throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(char cbuf[]) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(char cbuf[]) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(char cbuf[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(char cbuf[], int off, int len) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(int c) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(int c) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(String str) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(String str) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void write(String str, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
public void write(String str, int off, int len) throws IOException { }
InferUndefined.can_throw_ioexception_void();
} public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this);
public void close() throws IOException { InferUndefined.can_throw_ioexception_void();
InferBuiltins.__set_mem_attribute(this); }
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();
} }
} }

@ -11,40 +11,39 @@ import com.facebook.infer.builtins.InferUndefined;
public abstract class PushbackReader { public abstract class PushbackReader {
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(char cbuf[]) throws IOException { public int read(char cbuf[]) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(char cbuf[], int off, int len) throws IOException { public int read(char cbuf[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public boolean ready() throws IOException { public boolean ready() throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_boolean();
} }
public void reset() throws IOException { public void reset() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
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();
} }
public void unread(char cbuf[]) throws IOException { public void unread(char cbuf[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void unread(char cbuf[], int off, int len) throws IOException { public void unread(char cbuf[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void unread(int c) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
public void unread(int c) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
} }

@ -9,165 +9,161 @@ 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 RandomAccessFile implements Closeable { public class RandomAccessFile implements Closeable {
private FileDescriptor fd; private FileDescriptor fd;
private FileChannel channel; private FileChannel channel;
public RandomAccessFile(String name, String mode) public RandomAccessFile(String name, String mode) throws FileNotFoundException {
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); }
}
public FileChannel getChannel() { public FileChannel getChannel() {
channel = new FileChannelImpl(this, fd, InferUndefined.int_undefined()); channel = new FileChannelImpl(this, fd, InferUndefined.int_undefined());
return channel; return channel;
} }
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();
} }
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
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();
} }
public int read(byte b[]) throws IOException { public int read(byte b[]) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public final void readFully(byte b[]) throws IOException { public final void readFully(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void readFully(byte b[], int off, int len) throws IOException { public final void readFully(byte b[], int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(int b) throws IOException { public void write(int b) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public void write(byte b[]) throws IOException { public void write(byte b[]) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
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();
} }
public void seek(long pos) throws IOException { public void seek(long pos) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public long length() throws IOException { public long length() throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_long();
} }
public final boolean readBoolean() throws IOException { public final boolean readBoolean() throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_boolean();
} }
public final byte readByte() throws IOException { public final byte readByte() throws IOException {
return InferUndefined.can_throw_ioexception_byte(); return InferUndefined.can_throw_ioexception_byte();
} }
public final int readUnsignedByte() throws IOException { public final int readUnsignedByte() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public final short readShort() throws IOException { public final short readShort() throws IOException {
return InferUndefined.can_throw_ioexception_short(); return InferUndefined.can_throw_ioexception_short();
} }
public final int readUnsignedShort() throws IOException { public final int readUnsignedShort() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public final char readChar() throws IOException { public final char readChar() throws IOException {
return InferUndefined.can_throw_ioexception_char(); return InferUndefined.can_throw_ioexception_char();
} }
public final int readInt() throws IOException { public final int readInt() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public final long readLong() throws IOException { public final long readLong() throws IOException {
return InferUndefined.can_throw_ioexception_long(); return InferUndefined.can_throw_ioexception_long();
} }
public final float readFloat() throws IOException { public final float readFloat() throws IOException {
return InferUndefined.can_throw_ioexception_float(); return InferUndefined.can_throw_ioexception_float();
} }
public final double readDouble() throws IOException { public final double readDouble() throws IOException {
return InferUndefined.can_throw_ioexception_double(); return InferUndefined.can_throw_ioexception_double();
} }
public final String readLine() throws IOException { public final String readLine() throws IOException {
return InferUndefined.can_throw_ioexception_string(); return InferUndefined.can_throw_ioexception_string();
} }
public final String readUTF() throws IOException { public final String readUTF() throws IOException {
return InferUndefined.can_throw_ioexception_string(); return InferUndefined.can_throw_ioexception_string();
} }
public final void writeBoolean(boolean v) throws IOException { public final void writeBoolean(boolean v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeByte(int v) throws IOException { public final void writeByte(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeShort(int v) throws IOException { public final void writeShort(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeChar(int v) throws IOException { public final void writeChar(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeInt(int v) throws IOException { public final void writeInt(int v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeLong(long v) throws IOException { public final void writeLong(long v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeFloat(float v) throws IOException { public final void writeFloat(float v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeDouble(double v) throws IOException { public final void writeDouble(double v) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeBytes(String s) throws IOException { public final void writeBytes(String s) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
public final void writeChars(String s) throws IOException { public final void writeChars(String s) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
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();
} }
} }

@ -12,37 +12,36 @@ import com.facebook.infer.builtins.InferUndefined;
public abstract class Reader { public abstract class Reader {
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();
} }
public int read() throws IOException { public int read() throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(char cbuf[]) throws IOException { public int read(char cbuf[]) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(char cbuf[], int off, int len) throws IOException { public int read(char cbuf[], int off, int len) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public int read(java.nio.CharBuffer target) throws IOException { public int read(java.nio.CharBuffer target) throws IOException {
return InferUndefined.can_throw_ioexception_int(); return InferUndefined.can_throw_ioexception_int();
} }
public boolean ready() throws IOException { public boolean ready() throws IOException {
return InferUndefined.can_throw_ioexception_boolean(); return InferUndefined.can_throw_ioexception_boolean();
} }
public void reset() throws IOException { public void reset() throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
} }
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();
} }
} }

@ -11,44 +11,42 @@ import com.facebook.infer.builtins.InferUndefined;
public abstract class Writer { public abstract class Writer {
public Writer append(char c) throws IOException { public Writer append(char c) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
return this; return this;
} }
public Writer append(CharSequence csq) throws IOException { public Writer append(CharSequence csq) throws IOException {
InferUndefined.can_throw_ioexception_void(); InferUndefined.can_throw_ioexception_void();
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; }
}
public void flush() throws IOException {
public void flush() throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public void write(char cbuf[]) throws IOException {
public void write(char cbuf[]) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public void write(char cbuf[], int off, int len) throws IOException {
public void write(char cbuf[], int off, int len) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public void write(int c) throws IOException {
public void write(int c) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
public void write(String str) throws IOException {
public void write(String str) throws IOException { InferUndefined.can_throw_ioexception_void();
InferUndefined.can_throw_ioexception_void(); }
}
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,25 +9,23 @@ package java.lang;
public final class Class<T> { public final class Class<T> {
transient String name; transient String name;
public String getName() { public String getName() {
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(); }
}
public boolean isAssignableFrom(Class<?> cls) { public boolean isAssignableFrom(Class<?> cls) {
return false; return false;
} }
public static Class getPrimitiveClass(String name) {
Class c = new Class();
c.name = name;
return c;
}
public static Class getPrimitiveClass(String name) {
Class c = new Class();
c.name = name;
return c;
}
} }

@ -24,12 +24,11 @@ public final class Integer {
public boolean equals(Object anObject) { public boolean equals(Object anObject) {
return anObject != null return anObject != null
&& anObject instanceof Integer && anObject instanceof Integer
&& this.value == ((Integer) anObject).value; && this.value == ((Integer) anObject).value;
} }
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) {}
} }

@ -11,13 +11,13 @@ import com.facebook.infer.builtins.InferUndefined;
public class Object { public class Object {
public Class getClass() { public Class getClass() {
Class c = new Class(); Class c = new Class();
c.name = (String)InferUndefined.object_undefined(); c.name = (String) InferUndefined.object_undefined();
return c; return c;
} }
public int hashCode() { public int hashCode() {
return InferUndefined.int_undefined(); return InferUndefined.int_undefined();
} }
} }

@ -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,56 +8,50 @@
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 {
private final char[] value; private final char[] value;
private final int offset; private final int offset;
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();
}
} }
}
public String() {
this.offset = 0; public String() {
this.count = 0; this.offset = 0;
this.value = new char[0]; this.count = 0;
} this.value = new char[0];
}
public String(byte bytes[]) {
this(bytes, 0, bytes.length); public String(byte bytes[]) {
} 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]];
this.offset = 0; /** yes, this could be improved * */
this.count = v.length; this.offset = 0;
this.value = v; this.count = v.length;
this.value = v;
}
private static void checkBounds(byte[] bytes, int offset, int length) {
if (length < 0) throw new StringIndexOutOfBoundsException(length);
if (offset < 0) throw new StringIndexOutOfBoundsException(offset);
if (offset > bytes.length - length) throw new StringIndexOutOfBoundsException(offset + length);
}
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
} else {
return InferUndefined.boolean_undefined();
} }
}
private static void checkBounds(byte[] bytes, int offset, int length) {
if (length < 0)
throw new StringIndexOutOfBoundsException(length);
if (offset < 0)
throw new StringIndexOutOfBoundsException(offset);
if (offset > bytes.length - length)
throw new StringIndexOutOfBoundsException(offset + length);
}
public boolean equals(Object anObject) {
if (this == anObject) {
return true;
} else {
return InferUndefined.boolean_undefined();
}
}
} }

@ -9,41 +9,35 @@ 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();
} }
public static String getProperty(String key) { public static String getProperty(String key) {
int n = key.length(); // key must not be null int n = key.length(); // key must not be null
if (InferUndefined.boolean_undefined()) { if (InferUndefined.boolean_undefined()) {
return null; return null;
}
return (String)InferUndefined.object_undefined();
} }
return (String) InferUndefined.object_undefined();
}
} }

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

Loading…
Cancel
Save