-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
questionFurther information is requestedFurther information is requested
Description
WildcardTypeAccess.hasNoBound() returns for wildcards bounded by an array type, that they have no bound.
Example query:
import java
from WildcardTypeAccess w
where
exists (w.getUpperBound())
and w.hasNoBound()
select wThe issue appears to be that this predicate only checks for TypeAccess children, however ArrayTypeAccess is not a subclass of TypeAccess:
codeql/java/ql/src/semmle/code/java/Expr.qll
Lines 1589 to 1590 in 595ab44
| /** Holds if this wildcard is not bounded by any type bounds. */ | |
| predicate hasNoBound() { not exists(TypeAccess t | t.getParent() = this) } |
Maybe it would suffice checking that any child expression at index 0 or 1 exists (or would that also match annotations somehow)?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested