checking supertypes for annotations

Reviewed By: jeremydubreil

Differential Revision: D3221560

fb-gh-sync-id: 3ac68ef
fbshipit-source-id: 3ac68ef
master
Sam Blackshear 9 years ago committed by Facebook Github Bot 0
parent b228584855
commit ffc4e2d213

@ -120,9 +120,13 @@ let is_modeled_expensive =
let check_attributes check tenv pname = let check_attributes check tenv pname =
let check_class_attributes check tenv = function let check_class_attributes check tenv = function
| Procname.Java java_pname -> | Procname.Java java_pname ->
let check_class_annots { Sil.struct_annotations; } =
check struct_annotations in
begin begin
match Annotations.get_declaring_class_annotations java_pname tenv with match Tenv.proc_extract_declaring_class_typ tenv java_pname with
| Some annotations -> check annotations | Some current_class ->
check_class_annots current_class ||
PatternMatch.strict_supertype_exists tenv check_class_annots current_class
| None -> false | None -> false
end end
| _ -> false in | _ -> false in

@ -50,10 +50,9 @@ public class ExpensiveCallTest {
"performanceCriticalMethod1", "performanceCriticalMethod1",
"performanceCriticalMethod2", "performanceCriticalMethod2",
"performanceCriticalMethod3", "performanceCriticalMethod3",
// TODO: make subclassing work "subclassPerformanceCriticalMethod1",
//"subclassPerformanceCriticalMethod1", "subclassPerformanceCriticalMethod2",
//"subclassPerformanceCriticalMethod2", "subclassPerformanceCriticalMethod3",
//"subclassPerformanceCriticalMethod3",
"callMethodOnExpensiveClass", "callMethodOnExpensiveClass",
"onlyOneExpensiveCallUsingUnlikely", "onlyOneExpensiveCallUsingUnlikely",
"callsExpensiveInTheUnlikelyElseBranch", "callsExpensiveInTheUnlikelyElseBranch",

Loading…
Cancel
Save