remove redundant inline casts in arguments where the type is inferred by the call target

This commit is contained in:
Erik Krogh Kristensen
2021-10-29 14:37:56 +02:00
parent 15c90adec5
commit d36c66cfca
29 changed files with 51 additions and 60 deletions

View File

@@ -18,12 +18,12 @@ predicate isLive(Callable c) {
* would imply the liveness of `c`.
*/
Callable possibleLivenessCause(Callable c, string reason) {
c.(Method).overridesOrInstantiates(result.(Method)) and
c.(Method).overridesOrInstantiates(result) and
reason = "is overridden or instantiated by"
or
result.calls(c) and reason = "calls"
or
result.callsConstructor(c.(Constructor)) and reason = "calls constructor"
result.callsConstructor(c) and reason = "calls constructor"
or
exists(ClassInstanceExpr e | e.getEnclosingCallable() = result |
e.getConstructor() = c and reason = "constructs"
@@ -243,7 +243,7 @@ class DeadMethod extends Callable {
) and
not (
this.(Method).isAbstract() and
exists(Method m | m.overridesOrInstantiates+(this.(Method)) | isLive(m))
exists(Method m | m.overridesOrInstantiates+(this) | isLive(m))
) and
// A getter or setter associated with a live JPA field.
//