Open smillst opened 8 years ago
Fixing this issue will fix the todo in framework/tests/value/rRepo.java
Turing off caching in dataflow with the body of a loop is tricky because data flow works on CGFs which do not contain information about whether an expression is in the body of a loop. So, instead of turning off caching only during loops, we will start by turning off caching during dataflow.
Implementation plan:
Because the qualified types of some expressions are cached, the code below does not issue a warning that it should.
When data flow analyzes the code in the loop for the first time, the type of
nullable
is@NonNull
, so the type ofid(nullable)
is also@NonNull
. This type is cached in the AnnotatedTypeFactory and then used on subsequent data flow passes and also when type checking.Caching should be turned off when data flow is analyzing code in a loop.