diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index 59f2fa8601..9d5c10798e 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -319,6 +319,7 @@ Rules can now be flagged with deprecated='true' in the RuleSet XML to allow the XPathRules can now query using XPath 2.0 with 'version=2.0"', or XPath 2.0 in XPath 1.0 compatibility mode using 'version="1.0 compatibility"'. Many thanks to Saxon! Rules can now use property values in messages, for example ${propertyName} will expand to the value of the 'propertyName' property on the Rule. Rules can now use violation specific values in messages, specifically ${variableName}, ${methodName}, ${className}, ${packageName}. +New XPath function 'getCommentOn' can be used to search for strings in comments - Thanks to Andy Throgmorton Other changes: Rule property API upgrades: diff --git a/pmd/src/net/sourceforge/pmd/lang/java/xpath/GetCommentOnFunction.java b/pmd/src/net/sourceforge/pmd/lang/java/xpath/GetCommentOnFunction.java index 9586c7e1e2..9f7e59e5c7 100644 --- a/pmd/src/net/sourceforge/pmd/lang/java/xpath/GetCommentOnFunction.java +++ b/pmd/src/net/sourceforge/pmd/lang/java/xpath/GetCommentOnFunction.java @@ -14,7 +14,9 @@ import org.jaxen.SimpleFunctionContext; import org.jaxen.XPathFunctionContext; /** - * + * The XPath query "//VariableDeclarator[contains(getCommentOn(), '//password')]" + * will find all variables declared that are annotated with the password comment. + * * @author Andy Throgmorton */ public class GetCommentOnFunction implements Function {