Adding Long.parseLong model to nullsafe/modelTables.ml

Reviewed By: jeremydubreil

Differential Revision: D14395623

fbshipit-source-id: f643abc63
master
Wenzhe Lu 6 years ago committed by Facebook Github Bot
parent f00950a3c8
commit ead4c44f9d

@ -362,6 +362,8 @@ let annotated_list_nullable =
; ((n, [o]), "java.lang.Class.getResource(java.lang.String):java.net.URL")
; (o1, "java.lang.Class.isAssignableFrom(java.lang.Class):boolean")
; (n1, "java.lang.Integer.equals(java.lang.Object):boolean")
; (o1, "java.lang.Integer.parseInt(java.lang.String):int")
; (o1, "java.lang.Long.parseLong(java.lang.String):long")
; (n2, "java.lang.RuntimeException.<init>(java.lang.String,java.lang.Throwable)")
; (n1, "java.lang.String.equals(java.lang.Object):boolean")
; (n1, "java.lang.StringBuilder.append(java.lang.String):java.lang.StringBuilder")

@ -180,6 +180,12 @@ public class ParameterNotNullable {
ImmutableMap.copyOf(nullIterable);
ImmutableMap.copyOf(nullMap);
}
void testParsingNullStringToNumber() {
String ns = null;
long l = Long.parseLong(ns);
int i = Integer.parseInt(ns);
}
}
interface SomeInterface {

@ -95,6 +95,8 @@ codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradi
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 7, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 151)]
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 2 but argument `null` can be null. (Origin: null constant at line 152)]
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testImmutableSetOfnotNullArguments():void, 8, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ImmutableSet.of(...)` needs a non-null value in parameter 4 but argument `null` can be null. (Origin: null constant at line 152)]
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testParsingNullStringToNumber():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`Long.parseLong(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)]
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testParsingNullStringToNumber():void, 3, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`Integer.parseInt(...)` needs a non-null value in parameter 1 but argument `ns` can be null. (Origin: null constant at line 185)]
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testSystemGetPropertyArgument():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`System.getProperty(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 71)]
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testSystemGetenvBad():java.lang.String, 1, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`System.getenv(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 77)]
codetoanalyze/java/eradicate/ParameterNotNullable.java, codetoanalyze.java.eradicate.ParameterNotNullable.testThreeParameters():void, 2, ERADICATE_PARAMETER_NOT_NULLABLE, no_bucket, WARNING, [origin,`ParameterNotNullable.threeParameters(...)` needs a non-null value in parameter 1 but argument `null` can be null. (Origin: null constant at line 88)]

Loading…
Cancel
Save