diff --git a/dependencies/java/android/support/v4/BUCK b/dependencies/java/android/support/v4/BUCK new file mode 100644 index 000000000..9e49c8e38 --- /dev/null +++ b/dependencies/java/android/support/v4/BUCK @@ -0,0 +1,7 @@ +prebuilt_jar( + name = 'android-support-v4', + binary_jar = 'android-support-v4.jar', + visibility = [ + 'PUBLIC', + ], +) diff --git a/dependencies/java/android/support/v4/android-support-v4.jar b/dependencies/java/android/support/v4/android-support-v4.jar new file mode 100644 index 000000000..7b78bb8ee Binary files /dev/null and b/dependencies/java/android/support/v4/android-support-v4.jar differ diff --git a/infer/src/checkers/annotations.ml b/infer/src/checkers/annotations.ml index 48aec40db..eef5ddb0e 100644 --- a/infer/src/checkers/annotations.ml +++ b/infer/src/checkers/annotations.ml @@ -100,6 +100,7 @@ let inject = "Inject" let mutable_ = "Mutable" let nullable = "Nullable" let nonnull = "Nonnull" +let camel_nonnull = "NonNull" let notnull = "NotNull" let present = "Present" let strict = "com.facebook.infer.annotation.Strict" @@ -112,7 +113,9 @@ let ia_is_present ia = ia_ends_with ia present let ia_is_nonnull ia = - ia_ends_with ia nonnull || ia_ends_with ia notnull + ia_ends_with ia nonnull + || ia_ends_with ia notnull + || ia_ends_with ia camel_nonnull let ia_is_initializer ia = ia_contains ia initializer_ diff --git a/infer/tests/codetoanalyze/java/eradicate/BUCK b/infer/tests/codetoanalyze/java/eradicate/BUCK index f68d37184..966e21f98 100644 --- a/infer/tests/codetoanalyze/java/eradicate/BUCK +++ b/infer/tests/codetoanalyze/java/eradicate/BUCK @@ -5,6 +5,7 @@ dependencies = [ '//infer/lib/java/android:android', '//dependencies/java/jsr-305:jsr-305', '//dependencies/java/jsr-330:jsr-330', + '//dependencies/java/android/support/v4:android-support-v4', ] java_library( diff --git a/infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java b/infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java index 1c0712157..d363fa04c 100644 --- a/infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java +++ b/infer/tests/codetoanalyze/java/eradicate/FieldNotInitialized.java @@ -9,6 +9,8 @@ package codetoanalyze.java.eradicate; +import android.support.annotation.NonNull; + import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; @@ -23,6 +25,8 @@ public class FieldNotInitialized { @Inject String d; // Means: assume it will be initialized via dependency injection + @NonNull String e; + // Eradicate should only report one initialization error FieldNotInitialized() {}