mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
remove redundant inline casts
This commit is contained in:
@@ -150,7 +150,7 @@ private Type parameterForSubTypes(ParameterizedType type) {
|
||||
lowerBound = arg.(Wildcard).getLowerBoundType()
|
||||
|
|
||||
// `T super Foo` implies that `Foo`, or any super-type of `Foo`, may be represented.
|
||||
lowerBound.(RefType).getAnAncestor() = result
|
||||
lowerBound.getAnAncestor() = result
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -93,8 +93,8 @@ class SuppressedConstructor extends Constructor {
|
||||
not this.isDefaultConstructor() and
|
||||
// Verify that there is only one statement, which is the `super()` call. This exists
|
||||
// even for empty constructors.
|
||||
this.getBody().(BlockStmt).getNumStmt() = 1 and
|
||||
this.getBody().(BlockStmt).getAStmt().(SuperConstructorInvocationStmt).getNumArgument() = 0 and
|
||||
this.getBody().getNumStmt() = 1 and
|
||||
this.getBody().getAStmt().(SuperConstructorInvocationStmt).getNumArgument() = 0 and
|
||||
// A constructor that is called is not acting to suppress the default constructor. We permit
|
||||
// calls from suppressed and default constructors - in both cases, they can only come from
|
||||
// sub-class constructors.
|
||||
|
||||
@@ -262,7 +262,7 @@ class ManagedBeanImplEntryPoint extends EntryPoint, RegisteredManagedBeanImpl {
|
||||
// Find the method that will be called for each method on each managed bean that this class
|
||||
// implements.
|
||||
this.inherits(result) and
|
||||
result.(Method).overrides(this.getAnImplementedManagedBean().getAMethod())
|
||||
result.overrides(this.getAnImplementedManagedBean().getAMethod())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -668,7 +668,7 @@ Type inheritsMatchingMethodExceptThrows(SessionEJB ejb, Method m) {
|
||||
sig = n.getSignature() and
|
||||
sig = m.getSignature() and
|
||||
exists(Exception ex | ex = n.getAnException() and not throwsExplicitUncheckedException(n, ex) |
|
||||
not ex.getType().(RefType).hasSupertype*(m.getAnException().getType()) and
|
||||
not ex.getType().hasSupertype*(m.getAnException().getType()) and
|
||||
result = ex.getType()
|
||||
)
|
||||
)
|
||||
@@ -717,7 +717,7 @@ Type inheritsMatchingCreateMethodExceptThrows(StatefulSessionEJB ejb, EjbInterfa
|
||||
exists(Exception ex |
|
||||
ex = cm.getAnException() and not throwsExplicitUncheckedException(cm, ex)
|
||||
|
|
||||
not ex.getType().(RefType).hasSupertype*(icm.getAnException().getType()) and
|
||||
not ex.getType().hasSupertype*(icm.getAnException().getType()) and
|
||||
result = ex.getType()
|
||||
)
|
||||
)
|
||||
@@ -732,7 +732,7 @@ Type inheritsMatchingCreateMethodExceptThrows(StatefulSessionEJB ejb, EjbInterfa
|
||||
exists(Exception ex |
|
||||
ex = im.getAnException() and not throwsExplicitUncheckedException(im, ex)
|
||||
|
|
||||
not ex.getType().(RefType).hasSupertype*(icm.getAnException().getType()) and
|
||||
not ex.getType().hasSupertype*(icm.getAnException().getType()) and
|
||||
result = ex.getType()
|
||||
)
|
||||
)
|
||||
|
||||
@@ -141,8 +141,7 @@ class ExternalAPIUsedWithUntrustedData extends TExternalAPI {
|
||||
|
|
||||
this = TExternalAPIParameter(m, index) and
|
||||
result =
|
||||
m.getDeclaringType().(RefType).getQualifiedName() + "." + m.getSignature() + " [" +
|
||||
indexString + "]"
|
||||
m.getDeclaringType().getQualifiedName() + "." + m.getSignature() + " [" + indexString + "]"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user