Java: add isParameterless predicate to Constructor class

This commit is contained in:
Jami Cogswell
2022-12-09 15:07:25 -05:00
parent a8a8b03d2f
commit 5113041623
2 changed files with 4 additions and 6 deletions

View File

@@ -628,6 +628,9 @@ class Constructor extends Callable, @constructor {
/** Holds if this is a default constructor, not explicitly declared in source code. */
predicate isDefaultConstructor() { isDefConstr(this) }
/** Holds if this is a constructor without parameters. */
predicate isParameterless() { this.getNumberOfParameters() = 0 }
override Constructor getSourceDeclaration() { constrs(this, _, _, _, _, result) }
override string getSignature() { constrs(this, _, result, _, _, _) }