@@ -15,7 +15,7 @@ import java
1515predicate usefulUpcast ( CastExpr e ) {
1616 // Upcasts that may be performed to affect resolution of methods or constructors.
1717 exists ( Call c , int i , Callable target |
18- c .getArgument ( i ) . getProperExpr ( ) = e and
18+ c .getArgument ( i ) = e and
1919 target = c .getCallee ( ) and
2020 // An upcast to the type of the corresponding parameter.
2121 e .getType ( ) = target .getParameterType ( i )
@@ -31,27 +31,25 @@ predicate usefulUpcast(CastExpr e) {
3131 )
3232 or
3333 // Upcasts of a varargs argument.
34- exists ( Call c , int iArg , int iParam | c .getArgument ( iArg ) . getProperExpr ( ) = e |
34+ exists ( Call c , int iArg , int iParam | c .getArgument ( iArg ) = e |
3535 c .getCallee ( ) .getParameter ( iParam ) .isVarargs ( ) and iArg >= iParam
3636 )
3737 or
3838 // Upcasts that are performed on an operand of a ternary expression.
39- exists ( ConditionalExpr ce |
40- e = ce .getTrueExpr ( ) .getProperExpr ( ) or e = ce .getFalseExpr ( ) .getProperExpr ( )
41- )
39+ exists ( ConditionalExpr ce | e = ce .getTrueExpr ( ) or e = ce .getFalseExpr ( ) )
4240 or
4341 // Upcasts to raw types.
4442 e .getType ( ) instanceof RawType
4543 or
4644 e .getType ( ) .( Array ) .getElementType ( ) instanceof RawType
4745 or
4846 // Upcasts that are performed to affect field, private method, or static method resolution.
49- exists ( FieldAccess fa | e = fa .getQualifier ( ) . getProperExpr ( ) |
47+ exists ( FieldAccess fa | e = fa .getQualifier ( ) |
5048 not e .getExpr ( ) .getType ( ) .( RefType ) .inherits ( fa .getField ( ) )
5149 )
5250 or
5351 exists ( MethodAccess ma , Method m |
54- e = ma .getQualifier ( ) . getProperExpr ( ) and
52+ e = ma .getQualifier ( ) and
5553 m = ma .getMethod ( ) and
5654 ( m .isStatic ( ) or m .isPrivate ( ) )
5755 |
0 commit comments