mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #9545 from igfoo/igfoo/type_cycles
Java: Fix RefType.getAStrictAncestor() in the presence of type hierarchy cycles
This commit is contained in:
@@ -413,8 +413,12 @@ class RefType extends Type, Annotatable, Modifiable, @reftype {
|
||||
/** Gets a direct or indirect supertype of this type, including itself. */
|
||||
RefType getAnAncestor() { hasDescendant(result, this) }
|
||||
|
||||
/** Gets a direct or indirect supertype of this type, not including itself. */
|
||||
RefType getAStrictAncestor() { result = this.getAnAncestor() and result != this }
|
||||
/**
|
||||
* Gets a direct or indirect supertype of this type.
|
||||
* This does not including itself, unless this type is part of a cycle
|
||||
* in the type hierarchy.
|
||||
*/
|
||||
RefType getAStrictAncestor() { result = this.getASupertype().getAnAncestor() }
|
||||
|
||||
/**
|
||||
* Gets the source declaration of a direct supertype of this type, excluding itself.
|
||||
|
||||
Reference in New Issue
Block a user