[RFC] Format all java files

Reviewed By: jeremydubreil

Differential Revision: D10067033

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

@ -10,9 +10,7 @@ package infer.inferandroidexample;
import android.app.Application;
import android.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 ApplicationTest() {
super(Application.class);

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

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

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

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

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

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

@ -7,9 +7,9 @@
package com.facebook.infer.annotation;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
public class Assertions {
@ -53,11 +53,9 @@ public class Assertions {
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) {
if (!condition) {

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

@ -12,9 +12,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
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)
@Target({ElementType.METHOD})
public @interface FalseOnNull {}

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

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

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

@ -13,11 +13,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target(value={
@Target(
value = {
ElementType.METHOD, // method returns something 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;
@Retention(RetentionPolicy.CLASS)
@Target({
ElementType.CONSTRUCTOR,
ElementType.METHOD,
ElementType.TYPE
})
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
// 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

@ -13,12 +13,10 @@ import java.lang.annotation.RetentionPolicy;
/**
* 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
* only if it was built with the purpose of being extended.
* <p>This annotation is meant to counter common misuses of subclassing. Annotate your class with
* 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)
public @interface OkToExtend {
}
public @interface OkToExtend {}

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

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

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

@ -13,11 +13,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target(value={
@Target(
value = {
ElementType.METHOD, // method returns something 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.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)
@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
* 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.
* This annotation is trusted for now, but may be checked eventually.
* synchronization. The annotated method should not retain any references to the value. This
* annotation is trusted for now, but may be checked eventually.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.CLASS)
public @interface ReturnsOwnership {
}
public @interface ReturnsOwnership {}

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

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

@ -13,12 +13,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Tell the analysis that a collection is thread-safe when this information is not already
* reflected in the collection's type. For example:
* private {@literal @SynchronizedCollection} Map mMap = Collections.synchronizedMap(...);
* Tell the analysis that a collection is thread-safe when this information is not already reflected
* in the collection's type. For example: private {@literal @SynchronizedCollection} Map mMap =
* Collections.synchronizedMap(...);
*/
@Target({ ElementType.FIELD })
@Target({ElementType.FIELD})
@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
* 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)
public @interface ThreadConfined {
String value(); /** the thread that the mutations should be confined to */
public static String UI = "UI"; /** confined to the UI thread */
public static String ANY = "ANY"; /** confined to any thread (but only that thread!) */
String value();
/** the thread that the mutations should be confined to */
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
* it by using {@literal @ThreadSafe(enableChecks = false)}.
*/
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE })
@Target({ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface ThreadSafe {
boolean enableChecks() default true;

@ -12,9 +12,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
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)
@Target({ElementType.METHOD})
public @interface TrueOnNull {}

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

@ -10,17 +10,17 @@ package com.facebook.infer.builtins;
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) {
__infer_assume(condition);
@ -32,6 +32,5 @@ public class InferBuiltins {
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 {
private InferCloseables() {
}
private InferCloseables() {}
public static void close(Closeable closeable) {
if (closeable != null) {
@ -24,5 +23,4 @@ public final class InferCloseables {
public static void closeQuietly(Closeable closeable) {
close(closeable);
}
}

@ -7,10 +7,10 @@
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.
*/
public class InferTaint {
// 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;
}
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
public static native Object inferSecretSourceUndefined();
public static native void inferSensitiveSinkUndefined(Object iMightBeTainted);
}

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

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

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

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

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

@ -7,15 +7,12 @@
package android.content;
import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
import android.database.Cursor;
import android.database.sqlite.SQLiteCursor;
import android.net.Uri;
import android.os.CancellationSignal;
import android.os.RemoteException;
import com.facebook.infer.builtins.InferUndefined;
public class ContentProviderClient {
@ -28,22 +25,26 @@ public class ContentProviderClient {
ContentResolver contentResolver, IContentProvider contentProvider, boolean stable) {
mContentResolver = contentResolver;
mContentProvider = contentProvider;
mPackageName = (String)InferUndefined.object_undefined();
mPackageName = (String) InferUndefined.object_undefined();
mStable = stable;
}
public Cursor query(Uri url, String[] projection, String selection,
String[] selectionArgs, String sortOrder) throws RemoteException {
public Cursor query(
Uri url, String[] projection, String selection, String[] selectionArgs, String sortOrder)
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(
Uri url,
String[] projection,
String selection,
String[] selectionArgs,
String sortOrder,
CancellationSignal cancellationSignal)
throws RemoteException {
return new SQLiteCursor(null, null, null);
}
private class NotRespondingRunnable {
}
private class NotRespondingRunnable {}
}

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

@ -13,7 +13,6 @@ import com.facebook.infer.builtins.InferUndefined;
public class Context {
public ContentResolver getContentResolver() {
return new ContentResolver(this);
}
@ -22,22 +21,20 @@ public class Context {
return new TypedArray(null, attrs, attrs, 1);
}
public TypedArray obtainStyledAttributes(int resid, int[] attrs)
throws NotFoundException {
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) {
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 NotFoundException() {
}
public NotFoundException() {}
public NotFoundException(String name) {
super(name);
@ -47,6 +44,4 @@ public class Context {
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return new TypedArray(null, attrs, attrs, 1);
}
}

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

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

@ -8,36 +8,30 @@
package android.content.res;
import android.util.AttributeSet;
import com.facebook.infer.builtins.InferUndefined;
public class Resources {
public final class Theme {
public TypedArray obtainStyledAttributes(int[] attrs) {
return new TypedArray(null, attrs, attrs, 1);
}
public TypedArray obtainStyledAttributes(int resid, int[] attrs)
throws NotFoundException {
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) {
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 NotFoundException() {
}
public NotFoundException() {}
public NotFoundException(String name) {
super(name);
@ -47,5 +41,4 @@ public class Resources {
public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
return new TypedArray(null, attrs, attrs, 1);
}
}

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

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

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

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

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

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

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

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

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

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

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

@ -8,7 +8,6 @@
package com.facebook.infer.annotation;
import com.facebook.infer.builtins.InferBuiltins;
import javax.annotation.Nullable;
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.UTF8StreamJsonParser;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@ -17,47 +16,35 @@ import java.io.InputStream;
import java.io.Reader;
import java.net.URL;
public class JsonFactory
implements Versioned, java.io.Serializable {
public class JsonFactory implements Versioned, java.io.Serializable {
@Override
public Version version() {
return PackageVersion.VERSION;
}
public JsonParser createParser(File f)
throws IOException, JsonParseException {
public JsonParser createParser(File f) throws IOException, JsonParseException {
return createOwningParser();
}
public JsonParser createParser(URL url)
throws IOException, JsonParseException {
public JsonParser createParser(URL url) throws IOException, JsonParseException {
return createOwningParser();
}
public JsonParser createParser(InputStream in)
throws IOException, JsonParseException {
public JsonParser createParser(InputStream in) throws IOException, JsonParseException {
return createNonOwningParser();
}
public JsonParser createParser(Reader r)
throws IOException, JsonParseException {
public JsonParser createParser(Reader r) throws IOException, JsonParseException {
return createNonOwningParser();
}
private JsonParser createOwningParser()
throws IOException, JsonParseException {
private JsonParser createOwningParser() throws IOException, JsonParseException {
InputStream in = new FileInputStream("");
return new UTF8StreamJsonParser(null, 0, in, null, null,
new byte[]{}, 0, 0,
false);
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,20 +9,17 @@ package com.fasterxml.jackson.core;
import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
import java.io.Closeable;
import java.io.IOException;
public abstract class JsonParser
implements Closeable, Versioned {
public abstract class JsonParser implements Closeable, Versioned {
public void close() throws IOException {
InferBuiltins.__set_mem_attribute(this);
InferUndefined.can_throw_ioexception_void();
}
private void throwExceptions()
throws JsonParseException, IOException {
private void throwExceptions() throws JsonParseException, IOException {
if (InferUndefined.boolean_undefined()) {
throw new JsonParseException(null, null, null);
}
@ -31,10 +28,8 @@ public abstract class JsonParser
}
}
public Object readValueAs(Class valueType)
throws IOException, JsonProcessingException {
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.io.IOContext;
import com.fasterxml.jackson.core.sym.BytesToNameCanonicalizer;
import java.io.IOException;
import java.io.InputStream;
@ -24,9 +23,7 @@ import java.io.InputStream;
* This class contains a minimum set of methods in order to compile it for the
* models
*/
public final class UTF8StreamJsonParser
extends ParserBase {
public final class UTF8StreamJsonParser extends ParserBase {
protected ObjectCodec _objectCodec;
@ -42,9 +39,15 @@ public final class UTF8StreamJsonParser
protected boolean _bufferRecyclable;
public UTF8StreamJsonParser(IOContext ctxt, int features, InputStream in,
ObjectCodec codec, BytesToNameCanonicalizer sym,
byte[] inputBuffer, int start, int end,
public UTF8StreamJsonParser(
IOContext ctxt,
int features,
InputStream in,
ObjectCodec codec,
BytesToNameCanonicalizer sym,
byte[] inputBuffer,
int start,
int end,
boolean bufferRecyclable) {
super(ctxt, features);
_inputStream = in;
@ -63,8 +66,7 @@ public final class UTF8StreamJsonParser
}
}
private void throwExceptions()
throws JsonParseException, IOException {
private void throwExceptions() throws JsonParseException, IOException {
if (InferUndefined.boolean_undefined()) {
throw new JsonParseException(null, null, null);
}
@ -78,14 +80,12 @@ public final class UTF8StreamJsonParser
*/
@Override
protected boolean loadMore()
throws IOException {
protected boolean loadMore() throws IOException {
return InferUndefined.can_throw_ioexception_boolean();
}
@Override
protected void _finishString()
throws IOException, JsonParseException {
protected void _finishString() throws IOException, JsonParseException {
throwExceptions();
}
@ -99,45 +99,38 @@ public final class UTF8StreamJsonParser
*/
@Override
public byte[] getBinaryValue(Base64Variant b64variant)
throws IOException, JsonParseException {
public byte[] getBinaryValue(Base64Variant b64variant) throws IOException, JsonParseException {
throwExceptions();
return new byte[]{InferUndefined.byte_undefined()};
return new byte[] {InferUndefined.byte_undefined()};
}
@Override
public int getTextOffset()
throws IOException, JsonParseException {
public int getTextOffset() throws IOException, JsonParseException {
throwExceptions();
return InferUndefined.int_undefined();
}
@Override
public int getTextLength()
throws IOException, JsonParseException {
public int getTextLength() throws IOException, JsonParseException {
throwExceptions();
return InferUndefined.int_undefined();
}
@Override
public char[] getTextCharacters()
throws IOException, JsonParseException {
public char[] getTextCharacters() throws IOException, JsonParseException {
throwExceptions();
return new char[]{InferUndefined.char_undefined()};
return new char[] {InferUndefined.char_undefined()};
}
@Override
public String getText()
throws IOException, JsonParseException {
public String getText() throws IOException, JsonParseException {
throwExceptions();
return (String)InferUndefined.object_undefined();
return (String) InferUndefined.object_undefined();
}
@Override
public JsonToken nextToken()
throws IOException, JsonParseException {
public JsonToken nextToken() throws IOException, JsonParseException {
throwExceptions();
throw new IOException();
}
}

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

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

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

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

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

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

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

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

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

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

@ -16,8 +16,7 @@ public class File {
if (InferUndefined.boolean_undefined()) {
return null;
} else {
return (File[])InferUndefined.object_undefined();
return (File[]) InferUndefined.object_undefined();
}
}
}

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

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

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

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

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

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

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

@ -7,10 +7,8 @@
package java.io;
import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
public class ObjectInputStream {
InputStream in;
@ -26,8 +24,7 @@ public class ObjectInputStream {
}
}
protected ObjectInputStream() throws IOException, SecurityException {
}
protected ObjectInputStream() throws IOException, SecurityException {}
public int available() throws IOException {
return InferUndefined.can_throw_ioexception_int();
@ -117,7 +114,5 @@ public class ObjectInputStream {
return InferUndefined.can_throw_ioexception_int();
}
public static abstract class GetField {
}
public abstract static class GetField {}
}

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

@ -11,19 +11,14 @@ import com.facebook.infer.builtins.InferBuiltins;
import com.facebook.infer.builtins.InferUndefined;
import com.facebook.infer.builtins.InferUtils;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
public class OutputStreamWriter extends Writer {
public OutputStreamWriter(OutputStream out, String charsetName)
throws UnsupportedEncodingException {
if (charsetName == null)
throw new NullPointerException("charsetName");
if (charsetName == null) throw new NullPointerException("charsetName");
else if (InferUtils.isValidCharset(charsetName)) {
InferBuiltins.__set_file_attribute(this);
} else
throw new UnsupportedEncodingException();
} else throw new UnsupportedEncodingException();
}
public void flush() throws IOException {
@ -49,5 +44,4 @@ public class OutputStreamWriter extends Writer {
public void write(String str, int off, int len) throws IOException {
InferUndefined.can_throw_ioexception_void();
}
}

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -13,7 +13,7 @@ public class Object {
public Class getClass() {
Class c = new Class();
c.name = (String)InferUndefined.object_undefined();
c.name = (String) InferUndefined.object_undefined();
return c;
}

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

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

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

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

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

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

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

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

Loading…
Cancel
Save