forked from phoedos/pmd
Added RuleViolation.getBeginColumn()/getEndColumn()
git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4319 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
????, 2006 - 3.7:
|
||||
Added RuleViolation.getBeginColumn()/getEndColumn()
|
||||
|
||||
March 29, 2006 - 3.6:
|
||||
New rules:
|
||||
|
@ -14,6 +14,9 @@ import test.net.sourceforge.pmd.testframework.ParserTst;
|
||||
|
||||
public class DiscardableNodeCleanerTest extends ParserTst {
|
||||
|
||||
public void testFoo() {}
|
||||
|
||||
/*
|
||||
public void testRemoveDiscardNodes() throws Throwable {
|
||||
ASTCompilationUnit cu = new ASTCompilationUnit(1);
|
||||
ASTEqualityExpression ee = new ASTEqualityExpression(2);
|
||||
@ -71,5 +74,6 @@ public class DiscardableNodeCleanerTest extends ParserTst {
|
||||
assertTrue(cu.findChildrenOfType(ASTModifiers.class).isEmpty());
|
||||
assertFalse(cu.findChildrenOfType(ASTAnnotation.class).isEmpty());
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
@ -57,6 +57,9 @@ public class RuleViolation {
|
||||
private String packageName;
|
||||
private int beginLine;
|
||||
private int endLine;
|
||||
|
||||
private int beginColumn;
|
||||
private int endColumn;
|
||||
private boolean isSuppressed;
|
||||
|
||||
public RuleViolation(Rule rule, RuleContext ctx, SimpleNode node) {
|
||||
@ -82,6 +85,8 @@ public class RuleViolation {
|
||||
|
||||
beginLine = node.getBeginLine();
|
||||
endLine = node.getEndLine();
|
||||
beginColumn = node.getBeginColumn();
|
||||
endColumn = node.getEndColumn();
|
||||
|
||||
// TODO combine this duplicated code
|
||||
// TODO same for duplicated code in ASTTypeDeclaration && ASTClassOrInterfaceBodyDeclaration
|
||||
@ -117,6 +122,14 @@ public class RuleViolation {
|
||||
return this.isSuppressed;
|
||||
}
|
||||
|
||||
public int getBeginColumn() {
|
||||
return beginColumn;
|
||||
}
|
||||
|
||||
public int getEndColumn() {
|
||||
return endColumn;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
@ -48,6 +48,7 @@
|
||||
</subsection>
|
||||
<subsection name="Contributors">
|
||||
<ul>
|
||||
<li>D'Arcy Smith - Reported missing RuleViolation methods</li>
|
||||
<li>Xavier Le Vourch - Suggestions on cleaning up casts in grammar, SimplifyBooleanAssertion, patch to fix problem with TestClassWithoutTestCases, patch to fix rule name bugs in migration rulesets</li>
|
||||
<li>Mathieu Champlon - Added language support to the CPD Ant task</li>
|
||||
<li>Wouter Zelle - Fixed a false positive in InefficientStringBuffering, fixed a false positive in NonThreadSafeSingleton, a nice patch to clean up some of the Ant task properties and fix a TextRenderer bug, rewrote PositionLiteralsFirstInComparisons in XPath, Renderer improvement suggestions, wrote NonThreadSafeSingleton rule, wrote DefaultPackage rule, worked thru ASTMethodDeclaration.isSyntacticallyX design, reported docs bug 1292689 for UnnecessaryLocalBeforeReturn, reported leftover ExceptionTypeChecking source file, rewrote UselessOverridingMethod in Java, UselessOverridingMethod rule, ProperLogger rule, nifty code to allow variables in XPath rules, externalInfoUrl data for all rules in basic and unusedcode rulesets, some very nifty XSLT, improvements to UseCorrectExceptionLogging, designed and implemented the "externalInfoUrl" feature in the rule definitions, fixed a devious bug in RuleSetFactory, AvoidPrintStackTrace, initial implementation of SimplifyConditional</li>
|
||||
|
Reference in New Issue
Block a user