some javadoc and TODO comments
This commit is contained in:
parent
47bec440d9
commit
ffb17cde0f
|
|
@ -26,6 +26,11 @@ import com.puppycrawl.tools.checkstyle.api.Check;
|
|||
import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
||||
import com.puppycrawl.tools.checkstyle.JavaTokenTypes;
|
||||
|
||||
/**
|
||||
* Check that reports empty if/try/catch/finally blocks.
|
||||
*
|
||||
* @author Lars Kühne
|
||||
*/
|
||||
public class EmptyBlockCheck extends Check
|
||||
{
|
||||
private final Set mCheckFor = new HashSet();
|
||||
|
|
@ -59,6 +64,7 @@ public class EmptyBlockCheck extends Check
|
|||
DetailAST parent = aAST.getParent();
|
||||
String parentText = parent.getText();
|
||||
if (mCheckFor.contains(parentText)) {
|
||||
// TODO: i18n
|
||||
log(aAST.getLineNo(), "empty " + parentText + " block");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
|||
import com.puppycrawl.tools.checkstyle.JavaTokenTypes;
|
||||
|
||||
/**
|
||||
* Abstract
|
||||
* Abstract base class that provides functionality that is used in import checks.
|
||||
*/
|
||||
public abstract class ImportCheck
|
||||
extends Check
|
||||
|
|
|
|||
|
|
@ -26,7 +26,9 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
|
|||
|
||||
|
||||
/**
|
||||
* Checks for overly complicated return
|
||||
* Checks for overly complicated boolean return statements.
|
||||
*
|
||||
* Idea shamelessly stolen from the equivalent PMD rule (pmd.sourceforge.net).
|
||||
*/
|
||||
public class SimplifyBooleanReturnCheck extends Check
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ import java.util.HashSet;
|
|||
import java.util.Set;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* Checks for unused import statements.
|
||||
*/
|
||||
public class UnusedImportsCheck extends ImportCheck
|
||||
{
|
||||
private boolean mCollect;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public class WhitespaceAroundCheck extends Check
|
|||
{
|
||||
public int[] getDefaultTokens()
|
||||
{
|
||||
// TODO: add all operators
|
||||
return new int[] {JavaTokenTypes.ASSIGN};
|
||||
}
|
||||
|
||||
|
|
@ -37,6 +38,7 @@ public class WhitespaceAroundCheck extends Check
|
|||
final int before = aAST.getColumnNo() - 1;
|
||||
final int after = aAST.getColumnNo() + aAST.getText().length();
|
||||
|
||||
// TODO: i18n
|
||||
if ((before >= 0) && !Character.isWhitespace(line.charAt(before))) {
|
||||
log(aAST.getLineNo(), "NO LEADING SPACE for " + aAST.getText());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue