mirror of
https://github.com/github/codeql.git
synced 2026-04-29 10:45:15 +02:00
remove redundant cast where the type is enforced by an equality comparison
This commit is contained in:
@@ -150,7 +150,7 @@ private module ControlFlowGraphImpl {
|
||||
* `TypeThrowable` which results in both `TypeError` and `TypeRuntimeException`.
|
||||
*/
|
||||
UncheckedThrowableType getAnUncheckedSubtype() {
|
||||
result = this.(UncheckedThrowableType)
|
||||
result = this
|
||||
or
|
||||
result instanceof TypeError and this instanceof TypeThrowable
|
||||
or
|
||||
|
||||
@@ -665,7 +665,7 @@ final class GenericTypeNode extends PrintAstNode, TGenericTypeNode {
|
||||
override Location getLocation() { none() }
|
||||
|
||||
override ElementNode getChild(int childIndex) {
|
||||
result.getElement().(TypeVariable) = ty.getTypeParameter(childIndex)
|
||||
result.getElement() = ty.getTypeParameter(childIndex)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -686,7 +686,7 @@ final class GenericCallableNode extends PrintAstNode, TGenericCallableNode {
|
||||
override string toString() { result = "(Generic Parameters)" }
|
||||
|
||||
override ElementNode getChild(int childIndex) {
|
||||
result.getElement().(TypeVariable) = c.getTypeParameter(childIndex)
|
||||
result.getElement() = c.getTypeParameter(childIndex)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,7 +54,7 @@ class JaxbType extends Class {
|
||||
this.getAnAnnotation() = a and
|
||||
a.getType().(JaxbAnnotationType).hasName("XmlAccessorType")
|
||||
|
|
||||
result.getAnAccess() = a.getValue("value").(VarAccess)
|
||||
result.getAnAccess() = a.getValue("value")
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -395,9 +395,7 @@ class MavenRepo extends Folder {
|
||||
/**
|
||||
* Gets a Jar file contained within this repository.
|
||||
*/
|
||||
File getAJarFile() {
|
||||
result = this.getAChildContainer*().(File) and result.getExtension() = "jar"
|
||||
}
|
||||
File getAJarFile() { result = this.getAChildContainer*() and result.getExtension() = "jar" }
|
||||
|
||||
/**
|
||||
* Gets any jar artifacts in this repository that match the POM project definition. This is an
|
||||
|
||||
@@ -159,7 +159,7 @@ predicate badMethodAccessLockOrder(
|
||||
MethodAccess outerAccess, MethodAccess innerAccess, MethodAccess other
|
||||
) {
|
||||
exists(Synched outer, Synched inner |
|
||||
inner.(MethodAccess) = innerAccess and
|
||||
inner = innerAccess and
|
||||
inner = outer.getInnerSynch() and
|
||||
inner.getLockType() = outer.getLockType() and
|
||||
exists(Parameter p, int i | outer.(Method).getAParameter() = p and p.getPosition() = i |
|
||||
|
||||
Reference in New Issue
Block a user