Some updates thx to Andrew Glover
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1456 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -10,6 +10,7 @@
|
||||
<section name="Credits">
|
||||
<subsection name="Individuals">
|
||||
<ul>
|
||||
<li>Andrew Glover - documentation tweaks</li>
|
||||
<li>Adam Nemeth - bug report on missing final attribute for local variable declarations</li>
|
||||
<li>Gunnlaugur Thor Briem - bug report on JavaCC parser's use of java.lang.Error</li>
|
||||
<li>Carl Gilbert - ConstructorCallsOverridableMethodRule, bug reports, feature requests, and documentation improvements</li>
|
||||
|
@ -116,11 +116,11 @@ WhileStatement
|
||||
|
||||
<subsection name="Write a rule class">
|
||||
<p>
|
||||
Create a new Java class that extends <code>net.sourceforge.pmd.AbstractRule</code>:
|
||||
Create a new Java class that extends <code>net.sourceforge.pmd.AbstractRule</code> and implements <code>net.sourceforge.pmd.Rule</code>:
|
||||
</p>
|
||||
<source>
|
||||
<![CDATA[
|
||||
public class WhileLoopsMustUseBracesRule extends AbstractRule {
|
||||
public class WhileLoopsMustUseBracesRule extends AbstractRule implements Rule {
|
||||
}
|
||||
]]>
|
||||
</source>
|
||||
@ -130,9 +130,10 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule {
|
||||
</p>
|
||||
<source>
|
||||
<![CDATA[
|
||||
public class WhileLoopsMustUseBracesRule extends AbstractRule {
|
||||
public class WhileLoopsMustUseBracesRule extends AbstractRule implements Rule {
|
||||
public Object visit(ASTWhileStatement node, Object data) {
|
||||
System.out.println("hello world");
|
||||
return data;
|
||||
}
|
||||
}
|
||||
]]>
|
||||
@ -178,7 +179,7 @@ public class WhileLoopsMustUseBracesRule extends AbstractRule {
|
||||
</p>
|
||||
<source>
|
||||
<![CDATA[
|
||||
public class WhileLoopsMustUseBracesRule extends AbstractRule {
|
||||
public class WhileLoopsMustUseBracesRule extends AbstractRule implements Rule {
|
||||
public Object visit(ASTWhileStatement node, Object data) {
|
||||
SimpleNode firstStmt = (SimpleNode)node.jjtGetChild(1);
|
||||
if (!hasBlockAsFirstChild(firstStmt)) {
|
||||
|
@ -18,9 +18,9 @@
|
||||
<item name="Running PMD" href="/running.html" />
|
||||
<item name="Plugins" href="/integrations.html" />
|
||||
<item name="Using the Ant Task" href="/ant-task.html" />
|
||||
<item name="How to write a PMD rule" href="/howtowritearule.html" />
|
||||
<item name="How to write a rule" href="/howtowritearule.html" />
|
||||
<item name="How to make a rule set" href="/howtomakearuleset.html" />
|
||||
<item name="How PMD works" href="/howitworks.html" />
|
||||
<item name="How it works" href="/howitworks.html" />
|
||||
<item name="Finding copied and pasted code" href="/cpd.html" />
|
||||
<item name="Similar projects" href="/similar-projects.html" />
|
||||
<item name="Credits" href="/credits.html" />
|
||||
|
Reference in New Issue
Block a user