[infer][java] remove the concept of @Strict for Eradicate

Reviewed By: dkgi

Differential Revision: D4509354

fbshipit-source-id: 9849060
master
Jeremy Dubreil 8 years ago committed by Facebook Github Bot
parent 13cdff1532
commit 578baf319b

@ -1,28 +0,0 @@
/*
* Copyright (c) 2004 - present Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
package com.facebook.infer.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.CLASS)
@Target({
ElementType.CONSTRUCTOR,
ElementType.FIELD,
ElementType.METHOD,
ElementType.PACKAGE,
ElementType.TYPE,
})
public @interface Strict {
String value() default "";
}

@ -138,8 +138,3 @@ let mark_return ann asig =
let ia, t = asig.ret in
let ret' = mark_ia ann ia true, t in
{ asig with ret = ret'}
let mark_return_strict asig =
let ia, t = asig.ret in
let ret' = mark_ia_strict ia true, t in
{ asig with ret = ret'}

@ -37,9 +37,6 @@ val mark : Procname.t -> annotation -> t -> bool * bool list -> t
(** Mark the return of the annotated signature with the given annotation. *)
val mark_return : annotation -> t -> t
(** Mark the return of the annotated signature @Strict. *)
val mark_return_strict : t -> t
(** Get a method signature with annotations from a proc_attributes. *)
val get : ProcAttributes.t -> t

@ -111,18 +111,9 @@ let mapPut_list =
cp, "java.util.Map.put(java.lang.Object,java.lang.Object):java.lang.Object";
]
(** Models for @Strict annotations *)
let annotated_list_strict =
[
(* TODO: Investigate further if this method needs to
be considered as Nullable *)
(* (n, [o]), "android.content.Context.getSystemService(java.lang.String):java.lang.Object"; *)
]
(** Models for @Nullable annotations *)
let annotated_list_nullable =
check_not_null_list @ check_state_list @ check_argument_list @
annotated_list_strict @
[
n1, "android.os.Parcel.writeList(java.util.List):void";
n2, "android.os.Parcel.writeParcelable(android.os.Parcelable,int):void";
@ -248,7 +239,6 @@ let this_file = __FILE__
let annotated_table_nullable = mk_table annotated_list_nullable
let annotated_table_present = mk_table annotated_list_present
let annotated_table_strict = mk_table annotated_list_strict
let check_not_null_table, check_not_null_parameter_table =
mk_table check_not_null_list, mk_table check_not_null_parameter_list
let check_state_table = mk_table check_state_list

@ -16,7 +16,6 @@ val this_file : string
val annotated_table_nullable : model_table_t
val annotated_table_present : model_table_t
val annotated_table_strict : model_table_t
val check_not_null_table : model_table_t
val check_not_null_parameter_table : (string, int) Caml.Hashtbl.t
val check_state_table : model_table_t

@ -137,18 +137,10 @@ let get_modelled_annotated_signature proc_attributes =
with Not_found ->
ann_sig
else ann_sig in
let lookup_models_strict ann_sig =
if use_models
&& Hashtbl.mem annotated_table_strict proc_id
then
AnnotatedSignature.mark_return_strict ann_sig
else
ann_sig in
annotated_signature
|> lookup_models_nullable
|> lookup_models_present
|> lookup_models_strict
|> infer_return
|> infer_parameters

Loading…
Cancel
Save