mirror of
https://github.com/github/codeql.git
synced 2026-02-17 23:43:42 +01:00
Java/C#/GO: Use instanceof in more places
This commit is contained in:
@@ -7,17 +7,12 @@ import semmle.code.java.frameworks.Servlets
|
||||
* Any class which extends the `Servlet` interface is intended to be constructed reflectively by a
|
||||
* servlet container.
|
||||
*/
|
||||
class ServletConstructedClass extends ReflectivelyConstructedClass {
|
||||
class ServletConstructedClass extends ReflectivelyConstructedClass instanceof ServletClass {
|
||||
ServletConstructedClass() {
|
||||
this instanceof ServletClass and
|
||||
// If we have seen any `web.xml` files, this servlet will be considered to be live only if it is
|
||||
// referred to as a servlet-class in at least one. If no `web.xml` files are found, we assume
|
||||
// that XML extraction was not enabled, and therefore consider all `Servlet` classes as live.
|
||||
(
|
||||
isWebXmlIncluded()
|
||||
implies
|
||||
exists(WebServletClass servletClass | this = servletClass.getClass())
|
||||
)
|
||||
isWebXmlIncluded() implies exists(WebServletClass servletClass | this = servletClass.getClass())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,6 +107,4 @@ class GwtUiBinderEntryPoint extends CallableEntryPoint {
|
||||
/**
|
||||
* Fields that may be reflectively read or written to by the UiBinder framework.
|
||||
*/
|
||||
class GwtUiBinderReflectivelyReadField extends ReflectivelyReadField {
|
||||
GwtUiBinderReflectivelyReadField() { this instanceof GwtUiField }
|
||||
}
|
||||
class GwtUiBinderReflectivelyReadField extends ReflectivelyReadField instanceof GwtUiField { }
|
||||
|
||||
Reference in New Issue
Block a user