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; } + * + *
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 + * 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 {} diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/Initializer.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Initializer.java index cd1d9001c..8909669e9 100644 --- a/infer/annotations/src/main/java/com/facebook/infer/annotation/Initializer.java +++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/Initializer.java @@ -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}) diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySink.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySink.java index 2baef6148..5d5b367cd 100644 --- a/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySink.java +++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySink.java @@ -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 {} diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySource.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySource.java index 9162c36dc..a745c9e23 100644 --- a/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySource.java +++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySource.java @@ -13,11 +13,10 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.CLASS) -@Target(value={ - ElementType.METHOD, // method returns something user-controlled - ElementType.PARAMETER, // parameter is user-controlled - ElementType.FIELD, // field is user-controlled - }) - -public @interface IntegritySource { -} +@Target( + value = { + ElementType.METHOD, // method returns something user-controlled + ElementType.PARAMETER, // parameter is user-controlled + ElementType.FIELD, // field is user-controlled + }) +public @interface IntegritySource {} diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/NonBlocking.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/NonBlocking.java index 507caa389..d1a09e8c5 100644 --- a/infer/annotations/src/main/java/com/facebook/infer/annotation/NonBlocking.java +++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/NonBlocking.java @@ -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 diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/OkToExtend.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/OkToExtend.java index 7b26b4a1d..352d9d1ed 100644 --- a/infer/annotations/src/main/java/com/facebook/infer/annotation/OkToExtend.java +++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/OkToExtend.java @@ -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. + *
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. + *
Avoid adding this to classes that have existed for a long time without needing it.
*/
@Retention(RetentionPolicy.SOURCE)
-public @interface OkToExtend {
-
-}
+public @interface OkToExtend {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/PerformanceCritical.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/PerformanceCritical.java
index 5f47614bf..030c186f7 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/PerformanceCritical.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/PerformanceCritical.java
@@ -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 {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/Present.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Present.java
index 3e4282c7e..ba6e531b0 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/Present.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/Present.java
@@ -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 {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySink.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySink.java
index dc211f3c3..50f76990e 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySink.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySink.java
@@ -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 {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySource.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySource.java
index b59b5f586..4abd800e5 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySource.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySource.java
@@ -13,11 +13,10 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
-@Target(value={
- ElementType.METHOD, // method returns something private
- ElementType.PARAMETER, // parameter is private
- ElementType.FIELD, // field is private
- })
-
-public @interface PrivacySource {
-}
+@Target(
+ value = {
+ ElementType.METHOD, // method returns something private
+ ElementType.PARAMETER, // parameter is private
+ ElementType.FIELD, // field is private
+ })
+public @interface PrivacySource {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/PropagatesNullable.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/PropagatesNullable.java
index d910e69b6..ef60d4892 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/PropagatesNullable.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/PropagatesNullable.java
@@ -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 {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/ReturnsOwnership.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/ReturnsOwnership.java
index 124e7cead..26d761562 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/ReturnsOwnership.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/ReturnsOwnership.java
@@ -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 {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressLint.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressLint.java
index 504b81c87..6fda01453 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressLint.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressLint.java
@@ -14,10 +14,9 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target({
- ElementType.CONSTRUCTOR,
- ElementType.METHOD,
+ ElementType.CONSTRUCTOR,
+ ElementType.METHOD,
})
-
public @interface SuppressLint {
String[] value();
}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressViewNullability.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressViewNullability.java
index a6f0a0021..176230822 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressViewNullability.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressViewNullability.java
@@ -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)
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/SynchronizedCollection.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SynchronizedCollection.java
index a28a898d4..e1bbe5a0c 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/SynchronizedCollection.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/SynchronizedCollection.java
@@ -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 {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadConfined.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadConfined.java
index 5bbfd9e61..58b6125f2 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadConfined.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadConfined.java
@@ -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!) */
}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadSafe.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadSafe.java
index 9f906a0a2..b04d62099 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadSafe.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadSafe.java
@@ -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;
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/TrueOnNull.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/TrueOnNull.java
index 11de52011..4b181a0a3 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/TrueOnNull.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/TrueOnNull.java
@@ -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 {}
diff --git a/infer/annotations/src/main/java/com/facebook/infer/annotation/Verify.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Verify.java
index ea62006f2..c75cd15b1 100644
--- a/infer/annotations/src/main/java/com/facebook/infer/annotation/Verify.java
+++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/Verify.java
@@ -14,11 +14,9 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target({
- ElementType.CONSTRUCTOR,
- ElementType.METHOD,
- ElementType.PACKAGE,
- ElementType.TYPE,
+ ElementType.CONSTRUCTOR,
+ ElementType.METHOD,
+ ElementType.PACKAGE,
+ ElementType.TYPE,
})
-
-public @interface Verify {
-}
+public @interface Verify {}
diff --git a/infer/models/java/builtins/com/facebook/infer/builtins/InferBuiltins.java b/infer/models/java/builtins/com/facebook/infer/builtins/InferBuiltins.java
index 98a67c1f4..d72f64c58 100644
--- a/infer/models/java/builtins/com/facebook/infer/builtins/InferBuiltins.java
+++ b/infer/models/java/builtins/com/facebook/infer/builtins/InferBuiltins.java
@@ -10,28 +10,27 @@ 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);
- }
+ public static void assume(boolean condition) {
+ __infer_assume(condition);
+ }
- // use this instead of "assume o != null". being non-null and allocated are different to Infer
- public static void assume_allocated(Object o) {
- assume(o != null);
- o.hashCode();
- }
-
- public native static String __split_get_nth(String s, String sep, int n);
+ // use this instead of "assume o != null". being non-null and allocated are different to Infer
+ public static void assume_allocated(Object o) {
+ assume(o != null);
+ o.hashCode();
+ }
+ public static native String __split_get_nth(String s, String sep, int n);
}
diff --git a/infer/models/java/builtins/com/facebook/infer/builtins/InferCloseables.java b/infer/models/java/builtins/com/facebook/infer/builtins/InferCloseables.java
index c6a952ea6..76ad015ca 100644
--- a/infer/models/java/builtins/com/facebook/infer/builtins/InferCloseables.java
+++ b/infer/models/java/builtins/com/facebook/infer/builtins/InferCloseables.java
@@ -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);
}
-
}
diff --git a/infer/models/java/builtins/com/facebook/infer/builtins/InferTaint.java b/infer/models/java/builtins/com/facebook/infer/builtins/InferTaint.java
index 60458d890..7318f0a09 100644
--- a/infer/models/java/builtins/com/facebook/infer/builtins/InferTaint.java
+++ b/infer/models/java/builtins/com/facebook/infer/builtins/InferTaint.java
@@ -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);
-
}
diff --git a/infer/models/java/builtins/com/facebook/infer/builtins/InferUndefined.java b/infer/models/java/builtins/com/facebook/infer/builtins/InferUndefined.java
index eb86a2f5d..3fbf06fe6 100644
--- a/infer/models/java/builtins/com/facebook/infer/builtins/InferUndefined.java
+++ b/infer/models/java/builtins/com/facebook/infer/builtins/InferUndefined.java
@@ -12,149 +12,133 @@ import java.io.IOException;
import java.net.SocketException;
import java.sql.SQLException;
-
public class InferUndefined {
- public static native boolean boolean_undefined();
-
- public static native int int_undefined();
-
- public static native long long_undefined();
-
- public static native byte byte_undefined();
-
- public static native void void_undefined();
-
- public static native char char_undefined();
-
- public static native short short_undefined();
-
- public static native double double_undefined();
-
- public static native float float_undefined();
-
- public static native Object object_undefined();
-
- public static void can_throw_ioexception_void() throws IOException {
- boolean undef = boolean_undefined();
- if (undef) {
- } 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();
- }
-
- public static int can_throw_ioexception_int() throws IOException {
- boolean undef = boolean_undefined();
- if (undef) {
- return int_undefined();
- } 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();
- }
-
- public static byte can_throw_ioexception_byte() throws IOException {
- boolean undef = boolean_undefined();
- if (undef) {
- return byte_undefined();
- } 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();
- }
-
- public static float can_throw_ioexception_float() throws IOException {
- boolean undef = boolean_undefined();
- if (undef) {
- return float_undefined();
- } 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();
- }
-
- public static char can_throw_ioexception_char() throws IOException {
- boolean undef = boolean_undefined();
- if (undef) {
- return char_undefined();
- } 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();
- }
-
- public static Object can_throw_ioexception_object() throws IOException {
- boolean undef = boolean_undefined();
- if (undef) {
- return object_undefined();
- } else
- throw new IOException();
- }
-
- public static void can_throw_sqlexception_void() throws SQLException {
- boolean undef = boolean_undefined();
- if (undef) {
- } else
- throw new SQLException();
- }
-
- public static int nonneg_int() {
- int res = int_undefined();
- InferBuiltins.assume(res >= 0);
- return res;
- }
-
- public static void can_throw_socketexception_void() throws SocketException {
- boolean undef = boolean_undefined();
- if (undef) {
- } 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();
- }
+ public static native boolean boolean_undefined();
+
+ public static native int int_undefined();
+
+ public static native long long_undefined();
+
+ public static native byte byte_undefined();
+
+ public static native void void_undefined();
+
+ public static native char char_undefined();
+
+ public static native short short_undefined();
+
+ public static native double double_undefined();
+
+ public static native float float_undefined();
+
+ public static native Object object_undefined();
+
+ public static void can_throw_ioexception_void() throws IOException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ } 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();
+ }
+
+ public static int can_throw_ioexception_int() throws IOException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ return int_undefined();
+ } 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();
+ }
+
+ public static byte can_throw_ioexception_byte() throws IOException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ return byte_undefined();
+ } 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();
+ }
+
+ public static float can_throw_ioexception_float() throws IOException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ return float_undefined();
+ } 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();
+ }
+
+ public static char can_throw_ioexception_char() throws IOException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ return char_undefined();
+ } 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();
+ }
+
+ public static Object can_throw_ioexception_object() throws IOException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ return object_undefined();
+ } else throw new IOException();
+ }
+
+ public static void can_throw_sqlexception_void() throws SQLException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ } else throw new SQLException();
+ }
+
+ public static int nonneg_int() {
+ int res = int_undefined();
+ InferBuiltins.assume(res >= 0);
+ return res;
+ }
+
+ public static void can_throw_socketexception_void() throws SocketException {
+ boolean undef = boolean_undefined();
+ if (undef) {
+ } 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();
+ }
}
diff --git a/infer/models/java/builtins/com/facebook/infer/builtins/InferUtils.java b/infer/models/java/builtins/com/facebook/infer/builtins/InferUtils.java
index 0fbcbbfe4..db1e2edc5 100644
--- a/infer/models/java/builtins/com/facebook/infer/builtins/InferUtils.java
+++ b/infer/models/java/builtins/com/facebook/infer/builtins/InferUtils.java
@@ -25,5 +25,4 @@ public class InferUtils {
|| charsetName == "UTF-16"
|| charsetName == "utf-16";
}
-
}
diff --git a/infer/models/java/src/android/app/Activity.java b/infer/models/java/src/android/app/Activity.java
index 3d04adc05..e4ef14bae 100644
--- a/infer/models/java/src/android/app/Activity.java
+++ b/infer/models/java/src/android/app/Activity.java
@@ -10,39 +10,35 @@ 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 {
- public TypedArray obtainStyledAttributes(int[] attrs) {
- 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)
- throws NotFoundException {
- if (InferUndefined.boolean_undefined()) {
- throw new NotFoundException();
- }
- 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 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(String name) {
- super(name);
- }
- }
+ public static class NotFoundException extends RuntimeException {
+ public NotFoundException() {}
- public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
- return new TypedArray(null, attrs, attrs, 1);
+ public NotFoundException(String name) {
+ super(name);
}
+ }
+ public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
+ return new TypedArray(null, attrs, attrs, 1);
+ }
}
diff --git a/infer/models/java/src/android/app/AlarmManager.java b/infer/models/java/src/android/app/AlarmManager.java
index d48827840..984bdb975 100644
--- a/infer/models/java/src/android/app/AlarmManager.java
+++ b/infer/models/java/src/android/app/AlarmManager.java
@@ -7,7 +7,6 @@
package android.app;
-import android.app.PendingIntent;
public abstract class AlarmManager {
diff --git a/infer/models/java/src/android/app/DownloadManager.java b/infer/models/java/src/android/app/DownloadManager.java
index 0d0c29441..0a54c4710 100644
--- a/infer/models/java/src/android/app/DownloadManager.java
+++ b/infer/models/java/src/android/app/DownloadManager.java
@@ -12,20 +12,17 @@ import android.database.Cursor;
public class DownloadManager {
- private ContentResolver mResolver;
- private String mPackageName;
+ private ContentResolver mResolver;
+ private String mPackageName;
- public DownloadManager(ContentResolver resolver, String packageName) {
- mResolver = resolver;
- mPackageName = packageName;
- }
-
- public static class Query {
- }
-
- public Cursor query(Query query) {
- return mResolver.query(null, null, null, null, null);
- }
+ public DownloadManager(ContentResolver resolver, String packageName) {
+ mResolver = resolver;
+ mPackageName = packageName;
+ }
+ public static class Query {}
+ public Cursor query(Query query) {
+ return mResolver.query(null, null, null, null, null);
+ }
}
diff --git a/infer/models/java/src/android/content/ContentProviderClient.java b/infer/models/java/src/android/content/ContentProviderClient.java
index 0308e7ad8..3a25068ba 100644
--- a/infer/models/java/src/android/content/ContentProviderClient.java
+++ b/infer/models/java/src/android/content/ContentProviderClient.java
@@ -7,43 +7,44 @@
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 {
- private ContentResolver mContentResolver;
- private IContentProvider mContentProvider;
- private String mPackageName;
- private boolean mStable;
-
- ContentProviderClient(
- ContentResolver contentResolver, IContentProvider contentProvider, boolean stable) {
- mContentResolver = contentResolver;
- mContentProvider = contentProvider;
- mPackageName = (String)InferUndefined.object_undefined();
- mStable = stable;
- }
-
- 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 {
- return new SQLiteCursor(null, null, null);
- }
-
- private class NotRespondingRunnable {
- }
-
-
+ private ContentResolver mContentResolver;
+ private IContentProvider mContentProvider;
+ private String mPackageName;
+ private boolean mStable;
+
+ ContentProviderClient(
+ ContentResolver contentResolver, IContentProvider contentProvider, boolean stable) {
+ mContentResolver = contentResolver;
+ mContentProvider = contentProvider;
+ mPackageName = (String) InferUndefined.object_undefined();
+ mStable = stable;
+ }
+
+ 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 {
+ return new SQLiteCursor(null, null, null);
+ }
+
+ private class NotRespondingRunnable {}
}
diff --git a/infer/models/java/src/android/content/ContentResolver.java b/infer/models/java/src/android/content/ContentResolver.java
index 6966ff186..799510695 100644
--- a/infer/models/java/src/android/content/ContentResolver.java
+++ b/infer/models/java/src/android/content/ContentResolver.java
@@ -11,42 +11,44 @@ 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;
+ private final Context mContext;
- public ContentResolver(Context context) {
- mContext = context;
- }
+ public ContentResolver(Context context) {
+ mContext = context;
+ }
- public final Cursor query(Uri uri, String[] projection,
- String selection, String[] selectionArgs, String sortOrder) {
- if (InferUndefined.boolean_undefined()) {
- return null;
- } else {
- return query(uri, projection, selection, selectionArgs, sortOrder, null);
- }
+ public final Cursor query(
+ Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
+ if (InferUndefined.boolean_undefined()) {
+ return null;
+ } else {
+ return query(uri, projection, selection, selectionArgs, sortOrder, null);
}
-
- public final Cursor query(final Uri uri, String[] projection,
- String selection, String[] selectionArgs, String sortOrder,
- CancellationSignal cancellationSignal) {
- if (InferUndefined.boolean_undefined()) {
- return null;
- } else {
- return new SQLiteCursor(null, null, null);
- }
+ }
+
+ public final Cursor query(
+ final Uri uri,
+ String[] projection,
+ String selection,
+ String[] selectionArgs,
+ String sortOrder,
+ CancellationSignal cancellationSignal) {
+ if (InferUndefined.boolean_undefined()) {
+ return null;
+ } else {
+ return new SQLiteCursor(null, null, null);
}
+ }
- public final ContentProviderClient acquireContentProviderClient(Uri uri) {
- return new ContentProviderClient(this, null, true);
- }
+ public final ContentProviderClient acquireContentProviderClient(Uri uri) {
+ return new ContentProviderClient(this, null, true);
+ }
- public final ContentProviderClient acquireContentProviderClient(String name) {
- return new ContentProviderClient(this, null, true);
- }
+ public final ContentProviderClient acquireContentProviderClient(String name) {
+ return new ContentProviderClient(this, null, true);
+ }
}
diff --git a/infer/models/java/src/android/content/Context.java b/infer/models/java/src/android/content/Context.java
index cb1d4758f..e1e2c6e5b 100644
--- a/infer/models/java/src/android/content/Context.java
+++ b/infer/models/java/src/android/content/Context.java
@@ -13,40 +13,35 @@ import com.facebook.infer.builtins.InferUndefined;
public class Context {
+ public ContentResolver getContentResolver() {
+ return new ContentResolver(this);
+ }
- public ContentResolver getContentResolver() {
- return new ContentResolver(this);
- }
-
- public TypedArray obtainStyledAttributes(int[] attrs) {
- 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)
- throws NotFoundException {
- if (InferUndefined.boolean_undefined()) {
- throw new NotFoundException();
- }
- 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 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 static class NotFoundException extends RuntimeException {
+ public NotFoundException() {}
- public NotFoundException(String name) {
- super(name);
- }
+ public NotFoundException(String name) {
+ super(name);
}
+ }
- public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
- return new TypedArray(null, attrs, attrs, 1);
- }
-
-
+ public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
+ return new TypedArray(null, attrs, attrs, 1);
+ }
}
diff --git a/infer/models/java/src/android/content/IContentProvider.java b/infer/models/java/src/android/content/IContentProvider.java
index 7c4f730e5..ab971129c 100644
--- a/infer/models/java/src/android/content/IContentProvider.java
+++ b/infer/models/java/src/android/content/IContentProvider.java
@@ -7,5 +7,4 @@
package android.content;
-public interface IContentProvider {
-}
+public interface IContentProvider {}
diff --git a/infer/models/java/src/android/content/IContentService.java b/infer/models/java/src/android/content/IContentService.java
index 7526c9386..7f5a6d7ef 100644
--- a/infer/models/java/src/android/content/IContentService.java
+++ b/infer/models/java/src/android/content/IContentService.java
@@ -7,5 +7,4 @@
package android.content;
-public interface IContentService {
-}
+public interface IContentService {}
diff --git a/infer/models/java/src/android/content/res/Resources.java b/infer/models/java/src/android/content/res/Resources.java
index de2af9756..aae9d1de8 100644
--- a/infer/models/java/src/android/content/res/Resources.java
+++ b/infer/models/java/src/android/content/res/Resources.java
@@ -8,44 +8,37 @@
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 {
- 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 final class Theme {
+ public TypedArray obtainStyledAttributes(int[] attrs) {
+ return new TypedArray(null, attrs, attrs, 1);
}
- public static class NotFoundException extends RuntimeException {
- public 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 NotFoundException(String name) {
- super(name);
- }
+ 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 TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
- return new TypedArray(null, attrs, attrs, 1);
+ public NotFoundException(String name) {
+ super(name);
}
+ }
+ public TypedArray obtainAttributes(AttributeSet set, int[] attrs) {
+ return new TypedArray(null, attrs, attrs, 1);
+ }
}
diff --git a/infer/models/java/src/android/content/res/TypedArray.java b/infer/models/java/src/android/content/res/TypedArray.java
index 73aeebd94..8b5abc3ad 100644
--- a/infer/models/java/src/android/content/res/TypedArray.java
+++ b/infer/models/java/src/android/content/res/TypedArray.java
@@ -11,28 +11,27 @@ import com.facebook.infer.builtins.InferBuiltins;
public class TypedArray {
- private Resources mResources;
- int[] mData;
- int[] mIndices;
- int mLength;
-
- public void recycle() {
- // Release resource
- if (mLength > 0) {
- InferBuiltins.__set_mem_attribute(this);
- }
+ private Resources mResources;
+ int[] mData;
+ int[] mIndices;
+ int mLength;
+
+ public void recycle() {
+ // Release resource
+ if (mLength > 0) {
+ InferBuiltins.__set_mem_attribute(this);
}
+ }
- public TypedArray(Resources resources, int[] data, int[] indices, int len) {
- mResources = resources;
- mData = data;
- mIndices = indices;
- mLength = len;
+ public TypedArray(Resources resources, int[] data, int[] indices, int len) {
+ mResources = resources;
+ mData = data;
+ mIndices = indices;
+ mLength = len;
- // Acquire resource
- if (mLength > 0) {
- InferBuiltins.__set_file_attribute(this);
- }
+ // Acquire resource
+ if (mLength > 0) {
+ InferBuiltins.__set_file_attribute(this);
}
-
+ }
}
diff --git a/infer/models/java/src/android/database/AbstractCursor.java b/infer/models/java/src/android/database/AbstractCursor.java
index 1d3c2cf86..2b674ba8b 100644
--- a/infer/models/java/src/android/database/AbstractCursor.java
+++ b/infer/models/java/src/android/database/AbstractCursor.java
@@ -7,5 +7,4 @@
package android.database;
-public abstract class AbstractCursor implements CrossProcessCursor {
-}
+public abstract class AbstractCursor implements CrossProcessCursor {}
diff --git a/infer/models/java/src/android/database/CrossProcessCursor.java b/infer/models/java/src/android/database/CrossProcessCursor.java
index d1b7f2f52..e4ca42946 100644
--- a/infer/models/java/src/android/database/CrossProcessCursor.java
+++ b/infer/models/java/src/android/database/CrossProcessCursor.java
@@ -7,5 +7,4 @@
package android.database;
-public interface CrossProcessCursor extends Cursor {
-}
+public interface CrossProcessCursor extends Cursor {}
diff --git a/infer/models/java/src/android/database/CrossProcessCursorWrapper.java b/infer/models/java/src/android/database/CrossProcessCursorWrapper.java
index 13fbd06f8..94345b042 100644
--- a/infer/models/java/src/android/database/CrossProcessCursorWrapper.java
+++ b/infer/models/java/src/android/database/CrossProcessCursorWrapper.java
@@ -7,5 +7,4 @@
package android.database;
-public abstract class CrossProcessCursorWrapper implements CrossProcessCursor {
-}
+public abstract class CrossProcessCursorWrapper implements CrossProcessCursor {}
diff --git a/infer/models/java/src/android/database/CursorWrapper.java b/infer/models/java/src/android/database/CursorWrapper.java
index 639ea18a0..8eec33a5e 100644
--- a/infer/models/java/src/android/database/CursorWrapper.java
+++ b/infer/models/java/src/android/database/CursorWrapper.java
@@ -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) {
+ }
}
-
}
diff --git a/infer/models/java/src/android/database/sqlite/SQLiteConnectionPool.java b/infer/models/java/src/android/database/sqlite/SQLiteConnectionPool.java
index dc45197f2..8f15be06b 100644
--- a/infer/models/java/src/android/database/sqlite/SQLiteConnectionPool.java
+++ b/infer/models/java/src/android/database/sqlite/SQLiteConnectionPool.java
@@ -7,6 +7,4 @@
package android.database.sqlite;
-public final class SQLiteConnectionPool {
-
-}
+public final class SQLiteConnectionPool {}
diff --git a/infer/models/java/src/android/database/sqlite/SQLiteCursor.java b/infer/models/java/src/android/database/sqlite/SQLiteCursor.java
index 6a9b9be25..7d98ce37e 100644
--- a/infer/models/java/src/android/database/sqlite/SQLiteCursor.java
+++ b/infer/models/java/src/android/database/sqlite/SQLiteCursor.java
@@ -9,24 +9,20 @@ 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) {
- this(driver, editTable, query);
- }
-
-
- public SQLiteCursor(SQLiteCursorDriver driver, String editTable, SQLiteQuery query) {
- InferBuiltins.__set_file_attribute(this);
- }
+ @Deprecated
+ public SQLiteCursor(
+ SQLiteDatabase db, SQLiteCursorDriver driver, String editTable, SQLiteQuery query) {
+ this(driver, editTable, query);
+ }
- public void close() {
- InferBuiltins.__set_mem_attribute(this);
- }
+ public SQLiteCursor(SQLiteCursorDriver driver, String editTable, SQLiteQuery query) {
+ InferBuiltins.__set_file_attribute(this);
+ }
+ public void close() {
+ InferBuiltins.__set_mem_attribute(this);
+ }
}
diff --git a/infer/models/java/src/android/database/sqlite/SQLiteDatabase.java b/infer/models/java/src/android/database/sqlite/SQLiteDatabase.java
index 6e9ebdbf5..a6bead267 100644
--- a/infer/models/java/src/android/database/sqlite/SQLiteDatabase.java
+++ b/infer/models/java/src/android/database/sqlite/SQLiteDatabase.java
@@ -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);
- }
-
-
- 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, 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);
- }
+ 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 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) {
+ 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);
+ }
}
diff --git a/infer/models/java/src/android/database/sqlite/SQLiteDatabaseConfiguration.java b/infer/models/java/src/android/database/sqlite/SQLiteDatabaseConfiguration.java
index 71ca85461..131c21dac 100644
--- a/infer/models/java/src/android/database/sqlite/SQLiteDatabaseConfiguration.java
+++ b/infer/models/java/src/android/database/sqlite/SQLiteDatabaseConfiguration.java
@@ -7,5 +7,4 @@
package android.database.sqlite;
-public final class SQLiteDatabaseConfiguration {
-}
+public final class SQLiteDatabaseConfiguration {}
diff --git a/infer/models/java/src/android/database/sqlite/SQLiteQueryBuilder.java b/infer/models/java/src/android/database/sqlite/SQLiteQueryBuilder.java
index 9a0f02a4c..08808febb 100644
--- a/infer/models/java/src/android/database/sqlite/SQLiteQueryBuilder.java
+++ b/infer/models/java/src/android/database/sqlite/SQLiteQueryBuilder.java
@@ -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, 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);
- }
-
-
+ 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,
+ CancellationSignal cancellationSignal) {
+ return new SQLiteCursor(null, null, null);
+ }
}
diff --git a/infer/models/java/src/android/provider/MediaStore.java b/infer/models/java/src/android/provider/MediaStore.java
index 1959b8e0d..67fb69f5d 100644
--- a/infer/models/java/src/android/provider/MediaStore.java
+++ b/infer/models/java/src/android/provider/MediaStore.java
@@ -13,23 +13,27 @@ import android.net.Uri;
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) {
- 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) {
- return cr.query(uri, projection, selection, selectionArgs, orderBy);
- }
- }
+ 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) {
+ 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) {
+ return cr.query(uri, projection, selection, selectionArgs, orderBy);
+ }
}
+ }
}
diff --git a/infer/models/java/src/android/text/TextUtils.java b/infer/models/java/src/android/text/TextUtils.java
index 00033653f..4a3fe82da 100644
--- a/infer/models/java/src/android/text/TextUtils.java
+++ b/infer/models/java/src/android/text/TextUtils.java
@@ -18,11 +18,11 @@
package android.text;
public class TextUtils {
- public static boolean isEmpty(CharSequence str) {
- if (str == null || str.length() == 0) {
- return true;
- } else {
- return false;
- }
+ public static boolean isEmpty(CharSequence str) {
+ if (str == null || str.length() == 0) {
+ return true;
+ } else {
+ return false;
}
+ }
}
diff --git a/infer/models/java/src/com/facebook/infer/annotation/Assertions.java b/infer/models/java/src/com/facebook/infer/annotation/Assertions.java
index 4aa7d7b19..382c506bc 100644
--- a/infer/models/java/src/com/facebook/infer/annotation/Assertions.java
+++ b/infer/models/java/src/com/facebook/infer/annotation/Assertions.java
@@ -8,7 +8,6 @@
package com.facebook.infer.annotation;
import com.facebook.infer.builtins.InferBuiltins;
-
import javax.annotation.Nullable;
public class Assertions {
diff --git a/infer/models/java/src/com/fasterxml/jackson/core/JsonFactory.java b/infer/models/java/src/com/fasterxml/jackson/core/JsonFactory.java
index f29d0a1be..e12a94185 100644
--- a/infer/models/java/src/com/fasterxml/jackson/core/JsonFactory.java
+++ b/infer/models/java/src/com/fasterxml/jackson/core/JsonFactory.java
@@ -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 {
-
- @Override
- public Version version() {
- return PackageVersion.VERSION;
- }
-
- public JsonParser createParser(File f)
- 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(Reader r)
- throws IOException, JsonParseException {
- return createNonOwningParser();
- }
-
- 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);
- }
+public class JsonFactory implements Versioned, java.io.Serializable {
+
+ @Override
+ public Version version() {
+ return PackageVersion.VERSION;
+ }
+
+ public JsonParser createParser(File f) 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(Reader r) throws IOException, JsonParseException {
+ return createNonOwningParser();
+ }
+
+ 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);
+ }
}
diff --git a/infer/models/java/src/com/fasterxml/jackson/core/JsonParser.java b/infer/models/java/src/com/fasterxml/jackson/core/JsonParser.java
index aee5c70df..f5c3412b2 100644
--- a/infer/models/java/src/com/fasterxml/jackson/core/JsonParser.java
+++ b/infer/models/java/src/com/fasterxml/jackson/core/JsonParser.java
@@ -9,32 +9,27 @@ 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();
- }
+ public void close() throws IOException {
+ InferBuiltins.__set_mem_attribute(this);
+ InferUndefined.can_throw_ioexception_void();
+ }
- private void throwExceptions()
- throws JsonParseException, IOException {
- if (InferUndefined.boolean_undefined()) {
- throw new JsonParseException(null, null, null);
- }
- if (InferUndefined.boolean_undefined()) {
- throw new IOException();
- }
+ private void throwExceptions() throws JsonParseException, IOException {
+ if (InferUndefined.boolean_undefined()) {
+ throw new JsonParseException(null, null, null);
}
-
- public Object readValueAs(Class valueType)
- throws IOException, JsonProcessingException {
- throwExceptions();
- return InferUndefined.object_undefined();
+ if (InferUndefined.boolean_undefined()) {
+ throw new IOException();
}
+ }
+ public Object readValueAs(Class valueType) throws IOException, JsonProcessingException {
+ throwExceptions();
+ return InferUndefined.object_undefined();
+ }
}
diff --git a/infer/models/java/src/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java b/infer/models/java/src/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
index ccf9d8d41..ee1088a29 100644
--- a/infer/models/java/src/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
+++ b/infer/models/java/src/com/fasterxml/jackson/core/json/UTF8StreamJsonParser.java
@@ -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,120 +23,114 @@ 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 {
-
-
- protected ObjectCodec _objectCodec;
-
- protected BytesToNameCanonicalizer _symbols;
-
- protected int[] _quadBuffer;
-
- protected boolean _tokenIncomplete;
-
- protected InputStream _inputStream;
-
- protected byte[] _inputBuffer;
-
- protected boolean _bufferRecyclable;
-
- 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;
- _objectCodec = codec;
- _symbols = sym;
- _inputBuffer = inputBuffer;
- _inputPtr = start;
- _inputEnd = end;
- _bufferRecyclable = bufferRecyclable;
- }
-
- @Override
- public void close() throws IOException {
- if (_inputStream != null) {
- _inputStream.close();
- }
- }
-
- private void throwExceptions()
- 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()};
+public final class UTF8StreamJsonParser extends ParserBase {
+
+ protected ObjectCodec _objectCodec;
+
+ protected BytesToNameCanonicalizer _symbols;
+
+ protected int[] _quadBuffer;
+
+ protected boolean _tokenIncomplete;
+
+ protected InputStream _inputStream;
+
+ protected byte[] _inputBuffer;
+
+ protected boolean _bufferRecyclable;
+
+ 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;
+ _objectCodec = codec;
+ _symbols = sym;
+ _inputBuffer = inputBuffer;
+ _inputPtr = start;
+ _inputEnd = end;
+ _bufferRecyclable = bufferRecyclable;
+ }
+
+ @Override
+ public void close() throws IOException {
+ if (_inputStream != null) {
+ _inputStream.close();
}
+ }
- @Override
- public int getTextOffset()
- throws IOException, JsonParseException {
- throwExceptions();
- return InferUndefined.int_undefined();
+ private void throwExceptions() throws JsonParseException, IOException {
+ if (InferUndefined.boolean_undefined()) {
+ throw new JsonParseException(null, null, null);
}
-
- @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();
+ 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
+ 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();
+ }
}
diff --git a/infer/models/java/src/com/google/common/base/Optional.java b/infer/models/java/src/com/google/common/base/Optional.java
index 7d6303c68..02ca3e897 100644
--- a/infer/models/java/src/com/google/common/base/Optional.java
+++ b/infer/models/java/src/com/google/common/base/Optional.java
@@ -9,9 +9,8 @@ package com.google.common.base;
import javax.annotation.Nullable;
-public abstract class Optional get(key) can return null when key is not in the hashmap, and containsKey(key) and put(key,
+ * value) are used to protect against such nulls. Slightly unsound for the other reason get() can
+ * return null, when a pair (key,null) is in the map. Then when containsKey(key) is true, we will
+ * not report an NPE on a subsequent get(key).
+ */
+public abstract class HashMap