From cb88e72aaf76c5727847783b5a172e7b8bf29c3f Mon Sep 17 00:00:00 2001 From: Brian Remedios Date: Fri, 23 Sep 2011 07:17:26 +0000 Subject: [PATCH] +contribution credit git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@7307 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/changelog.txt | 1 + .../sourceforge/pmd/lang/java/xpath/GetCommentOnFunction.java | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 {