Skip to content

Commit 404a6c1

Browse files
authored
Merge pull request github#5805 from smowton/smowton/admin/spring-setter-method-docs
Document `SpringProperty::getSetterMethod`.
2 parents c78285e + 2787c2f commit 404a6c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

java/ql/src/semmle/code/java/frameworks/spring/SpringProperty.qll

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,19 @@ class SpringProperty extends SpringXMLElement {
6969
)
7070
}
7171

72+
/**
73+
* Gets a setter method declared on this property's enclosing bean that sets this property.
74+
*/
7275
Method getSetterMethod() {
7376
this.getEnclosingBean().getClass().hasMethod(result, _) and
7477
result.getName().toLowerCase() = "set" + this.getPropertyName().toLowerCase()
7578
}
7679

80+
/**
81+
* Gets a setter method declared on bean `context` that sets this property.
82+
*
83+
* This property must be declared on a bean that is an ancestor of `context`.
84+
*/
7785
Method getSetterMethod(SpringBean context) {
7886
this.getEnclosingBean() = context.getBeanParent*() and
7987
context.getClass().hasMethod(result, _) and

0 commit comments

Comments
 (0)