From 50667a690c466664749948ad0969155d98a75eed Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Tue, 22 Apr 2003 20:42:25 +0000 Subject: [PATCH] tweaking git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1852 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/xdocs/howtowritearule.xml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/pmd/xdocs/howtowritearule.xml b/pmd/xdocs/howtowritearule.xml index 70c6bb21dc..6eb59775aa 100644 --- a/pmd/xdocs/howtowritearule.xml +++ b/pmd/xdocs/howtowritearule.xml @@ -14,12 +14,11 @@ Writing PMD rules is cool because you don't have to wait for us to get around to

@@ -124,7 +123,7 @@ WhileStatement ]]>

- Ah ha! We see that the curly braces add a couple more AST elements - a Block + Ah ha! We see that the curly braces add a couple more AST nodes - a Block and a BlockStatement. So all we have to do is write a rule to detect a WhileStatement that has a Statement that's not followed by a Block, and we've got a rule violation. @@ -202,8 +201,8 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule { ]]>

OK, well, it won't look exactly like that - you'll need to wrap - the example in a CDATA tag. But I couldn't figure out how to do that with this document getting - confused. If you know how, please let me know.

+ the example in a CDATA tag. But I couldn't figure out how to do that without Maven getting confused. + If you know how to do this, please let me know.

@@ -253,10 +252,7 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule { //WhileStatement[not(Statement/Block)] -

Concise, eh? There'll be more documentation on this later - in the form of - an O'Reilly article - so for now, use the Astviewer utility - to experiment with how XPath expressions interact with the AST. Now that I've said - "XPath expression" 5 times, I'll stop. XPath expression.

+

Concise, eh? Here's an article with a lot more detail.