Skip to content

Commit ed080db

Browse files
committed
getAStrictAncestor
1 parent fffaa56 commit ed080db

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

java/ql/src/Language Abuse/UselessTypeTest.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ from InstanceOfExpr ioe, RefType t, RefType ct
1818
where
1919
t = ioe.getExpr().getType() and
2020
ct = ioe.getCheckedType() and
21-
ct = t.getAStrictAncestor()
21+
ct = t.getAStrictAncestorI()
2222
select ioe,
2323
"There is no need to test whether an instance of $@ is also an instance of $@ - it always is.", t,
2424
t.getName(), ct, ct.getName()

java/ql/src/Language Abuse/UselessUpcast.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ where
6565
src = cse.getExpr().getType() and
6666
dest = cse.getType()
6767
) and
68-
dest = src.getAStrictAncestor() and
68+
dest = src.getAStrictAncestorI() and
6969
not usefulUpcast(e)
7070
select e, "There is no need to upcast from $@ to $@ - the conversion can be done implicitly.", src,
7171
src.getName(), dest, dest.getName()

java/ql/src/Likely Bugs/Finalization/NullifiedSuperFinalize.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ from FinalizeMethod m, Class c, FinalizeMethod mSuper, Class cSuper
1717
where
1818
m.getDeclaringType() = c and
1919
mSuper.getDeclaringType() = cSuper and
20-
c.getAStrictAncestor() = cSuper and
20+
c.getAStrictAncestorI() = cSuper and
2121
not cSuper instanceof TypeObject and
2222
not exists(m.getBody().getAChild())
2323
select m, "Finalize in " + c.getName() + " nullifies finalize in " + cSuper.getName() + "."

java/ql/src/Likely Bugs/Serialization/IncorrectSerialVersionUID.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ where
2121
not f.isStatic() or
2222
not f.getType().hasName("long")
2323
) and
24-
f.getDeclaringType().getAStrictAncestor() instanceof TypeSerializable
24+
f.getDeclaringType().getAStrictAncestorI() instanceof TypeSerializable
2525
select f, "'serialVersionUID' should be final, static, and of type long."

java/ql/src/Likely Bugs/Serialization/NonSerializableField.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ predicate exceptions(Class c, Field f) {
7878
f.isStatic()
7979
or
8080
// Classes that implement `Externalizable` completely take over control during serialization.
81-
externalizable(c.getAStrictAncestor())
81+
externalizable(c.getAStrictAncestorI())
8282
or
8383
// Stateless session beans are not normally serialized during their usual life-cycle
8484
// but are forced by their expected supertype to be serializable.
@@ -93,7 +93,7 @@ predicate exceptions(Class c, Field f) {
9393
from Class c, Field f, string reason
9494
where
9595
c.fromSource() and
96-
c.getAStrictAncestor() instanceof TypeSerializable and
96+
c.getAStrictAncestorI() instanceof TypeSerializable and
9797
f.getDeclaringType() = c and
9898
not exceptions(c, f) and
9999
reason = nonSerialReason(f.getType())

java/ql/src/Performance/InnerClassCouldBeStatic.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pragma[nomagic]
2222
predicate inherits(Class c, Field f) {
2323
f = c.getAField()
2424
or
25-
not f.isPrivate() and c.getAStrictAncestor().getAField() = f
25+
not f.isPrivate() and c.getAStrictAncestorI().getAField() = f
2626
}
2727

2828
/**

java/ql/src/Security/CWE/CWE-833/LockOrderInconsistency.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ predicate inDifferentBranches(MethodCall ma1, MethodCall ma2) {
134134
/** The method access `ma` occurs in method `runnable`, which is an implementation of `Runnable.run()`. */
135135
predicate inRunnable(MethodCall ma, Method runnable) {
136136
runnable.getName() = "run" and
137-
runnable.getDeclaringType().getAStrictAncestor().hasQualifiedName("java.lang", "Runnable") and
137+
runnable.getDeclaringType().getAStrictAncestorI().hasQualifiedName("java.lang", "Runnable") and
138138
ma.getEnclosingCallable() = runnable
139139
}
140140

java/ql/src/Violations of Best Practice/Magic Constants/MagicConstantsString.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ predicate trivialContext(Literal e) {
5252
or
5353
// Message in an exception.
5454
exists(ClassInstanceExpr constr |
55-
constr.getType().(RefType).getAStrictAncestor().hasName("Exception") and
55+
constr.getType().(RefType).getAStrictAncestorI().hasName("Exception") and
5656
e = constr.getArgument(0)
5757
)
5858
}

java/ql/src/Violations of Best Practice/Naming Conventions/ConfusingOverridesNames.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ where
6565
) and
6666
not exists(Method mid |
6767
confusing(m1, mid) and
68-
mid.getDeclaringType().getAStrictAncestor() = m2.getDeclaringType()
68+
mid.getDeclaringType().getAStrictAncestorI() = m2.getDeclaringType()
6969
) and
7070
not exists(Method notConfusing |
7171
notConfusing.getDeclaringType() = m1.getDeclaringType() and

0 commit comments

Comments
 (0)