Java: add isParameterless predicate to Constructor class

This commit is contained in:
Jami Cogswell
2022-12-09 15:51:40 -05:00
parent 083b8d1de6
commit cde93a39cd
2 changed files with 7 additions and 6 deletions

View File

@@ -638,6 +638,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, _, _, _) }