Java: Make implicit this receivers explicit

This commit is contained in:
Kasper Svendsen
2023-05-03 10:08:04 +02:00
parent 733a00039e
commit 081085e128
46 changed files with 309 additions and 292 deletions

View File

@@ -17,9 +17,9 @@ library class BoundKind extends string {
predicate isUpper() { this = "<=" }
predicate providesLowerBound() { isEqual() or isLower() }
predicate providesLowerBound() { this.isEqual() or this.isLower() }
predicate providesUpperBound() { isEqual() or isUpper() }
predicate providesUpperBound() { this.isEqual() or this.isUpper() }
}
/**

View File

@@ -19,19 +19,19 @@ import java
*/
class ArrayCast extends CastExpr {
ArrayCast() {
getExpr() instanceof ArrayCreationExpr and
getType() instanceof Array
this.getExpr() instanceof ArrayCreationExpr and
this.getType() instanceof Array
}
/** The type of the operand expression of this cast. */
Array getSourceType() { result = getExpr().getType() }
Array getSourceType() { result = this.getExpr().getType() }
/** The result type of this cast. */
Array getTargetType() { result = getType() }
Array getTargetType() { result = this.getType() }
Type getSourceComponentType() { result = getSourceType().getComponentType() }
Type getSourceComponentType() { result = this.getSourceType().getComponentType() }
Type getTargetComponentType() { result = getTargetType().getComponentType() }
Type getTargetComponentType() { result = this.getTargetType().getComponentType() }
}
predicate uncheckedCastType(RefType t) {