diff --git a/infer/models/java/src/java/lang/Double.java b/infer/models/java/src/java/lang/Double.java index ae304cfb7..bd36873c9 100644 --- a/infer/models/java/src/java/lang/Double.java +++ b/infer/models/java/src/java/lang/Double.java @@ -7,6 +7,8 @@ package java.lang; +import javax.annotation.Nullable; + public final class Double { protected final double value; @@ -19,7 +21,7 @@ public final class Double { return new Double(i); } - public boolean equals(Object anObject) { + public boolean equals(@Nullable Object anObject) { return anObject != null && anObject instanceof Double && this.value == ((Double) anObject).value; diff --git a/infer/models/java/src/java/lang/Integer.java b/infer/models/java/src/java/lang/Integer.java index c75e8696c..71e219bd5 100644 --- a/infer/models/java/src/java/lang/Integer.java +++ b/infer/models/java/src/java/lang/Integer.java @@ -7,6 +7,8 @@ package java.lang; +import javax.annotation.Nullable; + public final class Integer { public static int MAX_VALUE = 2147483647; // 2**31-1 @@ -22,7 +24,7 @@ public final class Integer { return new Integer(i); } - public boolean equals(Object anObject) { + public boolean equals(@Nullable Object anObject) { return anObject != null && anObject instanceof Integer && this.value == ((Integer) anObject).value;