mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
ensure that the existence of non-synthetic constructor is checked correctly
This commit is contained in:
@@ -37,7 +37,10 @@ where
|
||||
( // Assume that a "new" method is intentional if the class has an explicit constructor.
|
||||
name = "new" and
|
||||
container instanceof ClassDefinition and
|
||||
not container.getMember("constructor").(ConstructorDeclaration).isSynthetic()
|
||||
exists(ConstructorDeclaration constructor |
|
||||
container.getMember("constructor") = constructor and
|
||||
not constructor.isSynthetic()
|
||||
)
|
||||
)
|
||||
or
|
||||
( // Explicitly declared static methods are fine.
|
||||
|
||||
Reference in New Issue
Block a user