all TODO/FIXME were removed , some of them converted to issues

This commit is contained in:
Roman Ivanov 2015-04-23 13:38:21 -04:00
parent 7f22ec265e
commit dd6b080a16
43 changed files with 30 additions and 127 deletions

View File

@ -182,7 +182,6 @@ public class Checker extends AutomaticBean implements MessageDispatcher
}
}
catch (final Exception ex) {
// TODO i18n
throw new CheckstyleException("cannot initialize module " + name
+ " - " + ex.getMessage(), ex);
}

View File

@ -131,7 +131,6 @@ public final class ConfigurationLoader
Attributes atts)
throws SAXException
{
// TODO: debug logging for support purposes
if (qName.equals(MODULE)) {
//create configuration
final String name = atts.getValue(NAME);
@ -515,9 +514,6 @@ public final class ConfigurationLoader
while (pos >= 0) {
//if there was any text before this, add it as a fragment
//TODO, this check could be modified to go if pos>prev;
//seems like this current version could stick empty strings
//into the list
if (pos > 0) {
fragments.add(value.substring(prev, pos));
}

View File

@ -72,7 +72,6 @@ public final class DefaultConfiguration implements Configuration
public String getAttribute(String name) throws CheckstyleException
{
if (!attributeMap.containsKey(name)) {
// TODO: i18n
throw new CheckstyleException(
"missing key '" + name + "' in " + getName());
}

View File

@ -159,9 +159,6 @@ public final class TreeWalker
checkContext.add("classLoader", classLoader);
checkContext.add("messages", getMessageCollector());
checkContext.add("severity", getSeverity());
// TODO: hmmm.. this looks less than elegant
// we have just parsed the string,
// now we're recreating it only to parse it again a few moments later
checkContext.add("tabWidth", String.valueOf(tabWidth));
childContext = checkContext;
@ -171,7 +168,6 @@ public final class TreeWalker
public void setupChild(Configuration childConf)
throws CheckstyleException
{
// TODO: improve the error handing
final String name = childConf.getName();
final Object module = moduleFactory.createModule(name);
if (!(module instanceof Check)) {

View File

@ -63,7 +63,7 @@ public class AutomaticBean
private static BeanUtilsBean createBeanUtilsBean()
{
final ConvertUtilsBean cub = new ConvertUtilsBean();
// TODO: is there a smarter way to tell beanutils not to use defaults?
cub.register(new BooleanConverter(), Boolean.TYPE);
cub.register(new BooleanConverter(), Boolean.class);
cub.register(new ArrayConverter(
@ -127,7 +127,6 @@ public class AutomaticBean
final BeanUtilsBean beanUtils = createBeanUtilsBean();
// TODO: debug log messages
final String[] attributes = configuration.getAttributeNames();
for (final String key : attributes) {
@ -187,7 +186,6 @@ public class AutomaticBean
{
final BeanUtilsBean beanUtils = createBeanUtilsBean();
// TODO: debug log messages
final Collection<String> attributes = context.getAttributeNames();
for (final String key : attributes) {
@ -197,8 +195,6 @@ public class AutomaticBean
beanUtils.copyProperty(this, key, value);
}
catch (final InvocationTargetException e) {
// TODO: log.debug("The bean " + this.getClass()
// + " is not interested in " + value)
throw new CheckstyleException("cannot set property "
+ key + " to value " + value + " in bean "
+ this.getClass().getName(), e);

View File

@ -191,12 +191,8 @@ public final class DetailAST extends CommonASTWithHiddenTokens
* Set the parent token.
* @param parent the parent token
*/
// TODO: should be private but that breaks the DetailASTTest
// until we manage parent in DetailAST instead of externally
void setParent(DetailAST parent)
{
// TODO: Check visibility, could be private
// if set in setFirstChild() and friends
this.parent = parent;
final DetailAST nextSibling = getNextSibling();
if (nextSibling != null) {

View File

@ -93,7 +93,6 @@ public final class FullIdent
else if (ast.getLineNo() > 0) {
lineNo = Math.min(lineNo, ast.getLineNo());
}
// TODO: make a function
if (colNo == 0) {
colNo = ast.getColumnNo();
}

View File

@ -18,10 +18,6 @@
////////////////////////////////////////////////////////////////////////////////
package com.puppycrawl.tools.checkstyle.api;
// TODO: check that this class is in the right package
// as soon as architecture has settled. At the time of writing
// this class is not necessary as a part of the public api
import com.google.common.collect.Sets;
import java.util.Set;

View File

@ -27,7 +27,7 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
/**
* <p>
* A check for TODO comments. To check for other patterns in Java comments, set
* A check for 'TODO' comments. To check for other patterns in Java comments, set
* property format.
* </p>
* <p>
@ -61,7 +61,7 @@ public class TodoCommentCheck
public static final String MSG_KEY = "todo.match";
/**
* Format of todo comment.
* Format of 'todo' comment.
*/
private String format = "TODO:";
@ -77,9 +77,9 @@ public class TodoCommentCheck
}
/**
* Setter for todo comment format.
* Setter for 'todo' comment format.
* @param format
* format of todo comment.
* format of 'todo' comment.
* @throws org.apache.commons.beanutils.ConversionException
* if unable to create Pattern object.
*/

View File

@ -96,7 +96,6 @@ public class EmptyBlockCheck
TokenTypes.INSTANCE_INIT,
TokenTypes.STATIC_INIT,
TokenTypes.LITERAL_SWITCH,
//TODO: does this handle TokenTypes.LITERAL_SYNCHRONIZED?
};
}
@ -119,7 +118,6 @@ public class EmptyBlockCheck
TokenTypes.LITERAL_SWITCH,
TokenTypes.LITERAL_DEFAULT,
TokenTypes.ARRAY_INIT,
//TODO: does this handle TokenTypes.LITERAL_SYNCHRONIZED?
};
}

View File

@ -96,7 +96,7 @@ public class LeftCurlyCheck
*/
public static final String MSG_KEY_LINE_BREAK_AFTER = "line.break.after";
/** TODO: replace this ugly hack **/
/** maxLineLength **/
private int maxLineLength = DEFAULT_MAX_LINE_LENGTH;
/** If true, Check will ignore enums*/
@ -141,8 +141,6 @@ public class LeftCurlyCheck
TokenTypes.LITERAL_IF,
TokenTypes.LITERAL_ELSE,
TokenTypes.LITERAL_FOR,
// TODO: need to handle....
//TokenTypes.STATIC_INIT,
};
}

View File

@ -172,8 +172,6 @@ public class FinalLocalVariableCheck extends Check
case TokenTypes.IDENT:
final int parentType = ast.getParent().getType();
// TODO: is there better way to check is ast
// in left part of assignment?
if ((TokenTypes.POST_DEC == parentType
|| TokenTypes.DEC == parentType
|| TokenTypes.POST_INC == parentType

View File

@ -28,7 +28,6 @@ import com.puppycrawl.tools.checkstyle.Utils;
import java.util.Set;
import java.util.StringTokenizer;
// TODO: Clean up potential duplicate code here and in UnusedImportsCheck
/**
* <p>
* Checks for illegal instantiations where a factory method is preferred.

View File

@ -35,7 +35,6 @@ import java.util.Deque;
* </p>
*
* @author <a href="mailto:simon@redhillconsulting.com.au">Simon Harris</a>
* TODO: Test for inside a static block
*/
public final class ReturnCountCheck extends AbstractFormatCheck
{

View File

@ -79,7 +79,6 @@ public class SimplifyBooleanReturnCheck
final AST elseStatement = elseLiteral.getFirstChild();
// skip '(' and ')'
// TODO: Introduce helpers in DetailAST
final AST condition = ast.getFirstChild().getNextSibling();
final AST thenStatement = condition.getNextSibling().getNextSibling();

View File

@ -110,8 +110,6 @@ public class HideUtilityClassConstructorCheck extends Check
// figure out if class extends java.lang.object directly
// keep it simple for now and get a 99% solution
// TODO: check for "extends java.lang.Object" and "extends Object"
// consider "import org.omg.CORBA.*"
final boolean extendsJLO = // J.Lo even made it into in our sources :-)
ast.findFirstToken(TokenTypes.EXTENDS_CLAUSE) == null;

View File

@ -23,34 +23,6 @@ import com.puppycrawl.tools.checkstyle.api.DetailAST;
import java.util.ArrayDeque;
import java.util.Deque;
// TODO: allow preset indentation styles (IE... GNU style, Sun style, etc...)?
// TODO: optionally make imports (and other?) statements required to start
// line? -- but maybe this should be a different check
// TODO: optionally allow array children, throws clause, etc...
// to be of any indentation > required, for emacs-style indentation
// TODO: this is not illegal, but probably should be:
// myfunc3(11, 11, Integer.
// getInteger("mytest").intValue(), // this should be in 4 more
// 11);
// TODO: any dot-based indentation doesn't work (at least not yet...) the
// problem is that we don't know which way an expression tree will be built
// and with dot trees, they are built backwards. This means code like
//
// org.blah.mystuff
// .myclass.getFactoryObject()
// .objFunc().otherMethod();
// and
// return ((MethodCallHandler) parent)
// .findContainingMethodCall(this);
// is all checked at the level of the first line. Simple dots are actually
// checked but the method call handler will have to be changed drastically
// to fix the above...
/**
* Checks correct indentation of Java Code.
*

View File

@ -32,8 +32,6 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
*
* @author <a href="mailto:simon@redhillconsulting.com.au">Simon Harris</a>
* @author o_sukhodolsky
* TODO: For every or: _value += (_orCount * (nestedValue - 1));
* TODO: For every and: ???
*/
public final class NPathComplexityCheck extends AbstractComplexityCheck
{

View File

@ -203,7 +203,6 @@ public class OperatorWrapCheck
final int lineNo = ast.getLineNo();
final String currentLine = getLine(lineNo - 1);
// TODO: Handle comments before and after operator
// Check if rest of line is whitespace, and not just the operator
// by itself. This last bit is to handle the operator on a line by
// itself.

View File

@ -129,8 +129,6 @@ public class SeparatorWrapCheck
@Override
public void visitToken(DetailAST ast)
{
// TODO: It is a copy/paste from OperatorWrapCheck.
//It should be fixed in another issue
final String text = ast.getText();
final int colNo = ast.getColumnNo();
final int lineNo = ast.getLineNo();

View File

@ -88,7 +88,6 @@ public class WhitespaceAfterCheck
final DetailAST targetAST;
if (ast.getType() == TokenTypes.TYPECAST) {
targetAST = ast.findFirstToken(TokenTypes.RPAREN);
// TODO: i18n
message = new Object[]{"cast"};
}
else {

View File

@ -157,7 +157,7 @@ public final class CheckDocsDoclet
/**
* Doclet entry point.
* @param root parsed javadoc of all java files passed to the javadoc task
* @return true (TODO: semantics of the return value is not clear to me)
* @return boolean value
* @throws IOException if there are problems writing output
*/
public static boolean start(RootDoc root) throws IOException
@ -182,8 +182,6 @@ public final class CheckDocsDoclet
for (final ClassDoc classDoc : classDocs) {
// TODO: introduce a "CheckstyleModule" interface
// so we can do better in the next line...
if (classDoc.typeName().endsWith("Check")
&& !classDoc.isAbstract())
{
@ -244,7 +242,7 @@ public final class CheckDocsDoclet
return opt[1];
}
}
return null; // TODO: throw exception here ???
return null;
}
/**

View File

@ -282,8 +282,6 @@ public class SuppressWithNearbyCommentFilter
/** The influence of the suppression comment. */
private String influenceFormat;
//TODO: Investigate performance improvement with array
/** Tagged comments */
private final List<Tag> tags = Lists.newArrayList();
@ -410,7 +408,6 @@ public class SuppressWithNearbyCommentFilter
final FileContents currentContents = FileContentsHolder.getContents();
if (currentContents == null) {
// we have no contents, so we can not filter.
// TODO: perhaps we should notify user somehow?
return true;
}
if (getFileContents() != currentContents) {

View File

@ -277,7 +277,6 @@ public class SuppressionCommentFilter
/** The message format to suppress. */
private String messageFormat;
//TODO: Investigate performance improvement with array
/** Tagged comments */
private final List<Tag> tags = Lists.newArrayList();
@ -398,7 +397,6 @@ public class SuppressionCommentFilter
final FileContents currentContents = FileContentsHolder.getContents();
if (currentContents == null) {
// we have no contents, so we can not filter.
// TODO: perhaps we should notify user somehow?
return true;
}
if (getFileContents() != currentContents) {
@ -421,8 +419,6 @@ public class SuppressionCommentFilter
private Tag findNearestMatch(AuditEvent event)
{
Tag result = null;
// TODO: try binary search if sequential search becomes a performance
// problem.
for (Tag tag : tags) {
if (tag.getLine() > event.getLine()
|| tag.getLine() == event.getLine()

View File

@ -74,14 +74,10 @@ import javax.swing.border.Border;
*/
class FileDrop
{
// TODO: Not sure that changing borders is a good idea.
// At least we should make sure that the border insets are preserved so
// that the panel layout does not change during the DnD operation.
private transient Border normalBorder;
private final transient DropTargetListener dropListener;
// TODO: Blue is not a nice color in all LookAndFeels
/* Default border color */
private static final Color DEFAULT_BORDER_COLOR =
new Color(0f, 0f, 1f, 0.25f);

View File

@ -298,8 +298,6 @@ public class ParseTreeInfoPanel extends JPanel
p.add(reloadButton);
try {
// TODO: creating an object for the side effect of the constructor
// and then ignoring the object looks strange.
new FileDrop(sp, new FileDropListener(sp));
}
catch (final TooManyListenersException ex)

View File

@ -45,7 +45,6 @@ public class ParseTreeModel extends AbstractTreeTableModel
{
final ASTFactory factory = new ASTFactory();
factory.setASTNodeClass(DetailAST.class.getName());
// TODO: Need to resolve if need a fake root node....
return (DetailAST) factory.create(TokenTypes.EOF, "ROOT");
}

View File

@ -1397,9 +1397,6 @@ typeCastParameters
: classTypeSpec[true] (BAND^ classTypeSpec[true])*
;
// TODO: handle type parameters more effectively - I think this production needs
// a refactoring like the original Antlr Java grammar got
// qualified names, array expressions, method invocation, post inc/dec
postfixExpression
: primaryExpression // start with a primary
@ -1619,8 +1616,6 @@ options {
private CommentListener mCommentListener = null;
// TODO: Check visibility of this method one parsing is done in central
// utility method
public void setCommentListener(CommentListener aCommentListener)
{
mCommentListener = aCommentListener;

View File

@ -56,13 +56,6 @@ public class TranslationCheckTest
expected);
}
// TODO: test with the same resourcebundle name in different packages
// x/messages.properties
// key1=x
// y/messages.properties
// key2=y
// should not result in error message about key1 missing in the y bundle
@Test
public void testBaseNameSeparator() throws Exception
{

View File

@ -91,7 +91,7 @@ public class FileTabCharacterCheckTest
/**
* Creates a configuration that is functionally close to that in the docs.
* @param verbose TODO
* @param verbose verbose mode
*/
private DefaultConfiguration createConfig(boolean verbose)
{

View File

@ -24,7 +24,6 @@ import org.junit.Before;
import org.junit.Test;
/** Tests SuppressElementFilter */
// TODO: this test should be removed/rewritten
public class FilterSetTest
{
private CSVFilter filter;

View File

@ -14,7 +14,7 @@ public class InputLambdaTest17{
public Object tryAdvance(SpinedBuffer<P_OUT> b)
{
// TODO Auto-generated method stub
// comment
return null;
}

View File

@ -1,8 +1,8 @@
package com.puppycrawl.tools.checkstyle.annotation;
//this file compiles in eclipse 3.4 but not with Sun's JDK 1.6.0.11
/** FIXME: CheckStyle's ANTL grammar cannot handle this syntax
@SuppressWarnings({,})
/**
*/
public class AnnotationUseWithTrailingComma
{
@ -25,16 +25,16 @@ public class AnnotationUseWithTrailingComma
}
@Test(value={(false) ? "" : "foo",}, more={(true) ? "" : "bar",})
/** FIXME: CheckStyle's ANTL grammar cannot handle this syntax
@Pooches(tokens={,},other={,})
/**
*/
enum P {
@Pooches(tokens={Pooches.class,},other={1,})
L,
/** FIXME: CheckStyle's ANTL grammar cannot handle this syntax
@Test(value={,}, more={(false) ? "" : "unchecked",})
/**
*/
Y;
}
@ -44,8 +44,8 @@ public class AnnotationUseWithTrailingComma
@interface Test {
String[] value();
String[] more() default {};
/** FIXME: CheckStyle's ANTL grammar cannot handle this syntax
String[] moreAr() default {,};
/**
*/
}

View File

@ -26,7 +26,7 @@ class InputCorrectAnnotationLocation
@MyAnnotation5
public InputCorrectAnnotationLocation()
{
// TODO Auto-generated constructor stub
//comment
}
@MyAnnotation5
@MyAnnotation6
@ -59,7 +59,7 @@ class InputCorrectAnnotationLocation
@MyAnnotation6
public InnerClass()
{
// TODO Auto-generated constructor stub
// comment
}
@MyAnnotation5
@MyAnnotation6 void foo1(int a) {}

View File

@ -55,7 +55,7 @@ class InputIncorrectAnnotationLocation
@MyAnnotation2
@MyAnnotation1(value = "") public InnerClass()
{
// TODO Auto-generated constructor stub
// comment
}
@MyAnnotation1(value = "")
@MyAnnotation2 //warn

View File

@ -26,7 +26,7 @@ class LocalCache<K, V> extends AbstractMap<K, V> implements ConcurrentMap<K, V>
enum Strength { //indent:2 exp:2
/* //indent:4 exp:4
* TODO(kevinb): If we strongly reference the value and aren't loading, we needn't wrap the //indent:5 exp:5
* (kevinb): If we strongly reference the value and aren't loading, we needn't wrap the //indent:5 exp:5
* value. This could save ~8 bytes per entry. //indent:5 exp:5
*/ //indent:5 exp:5

View File

@ -27,10 +27,10 @@ public class InputInvalidAssignIndent //indent:0 exp:0
int i //indent:8 exp:8
= //indent:9 exp:12 warn
1; //indent:10 exp:12 warn
// TODO: this should be illegal. //indent:8 exp:8
// : this should be illegal. //indent:8 exp:8
i = //indent:8 exp:8
3; //indent:12 exp:12
// TODO: add more testing //indent:8 exp:8
// : add more testing //indent:8 exp:8
} //indent:4 exp:4
private String[] mIndentCheck = null; //indent:4 exp:4

View File

@ -218,7 +218,7 @@ System.getProperty("blah"); //indent:0 exp:12 warn
System.getProperty("blah"); //indent:12 exp:12
// TODO: bother to support this style? //indent:8 exp:8
// //indent:8 exp:8
if (test) { //indent:8 exp:8
System.getProperty("blah"); //indent:12 exp:12
} else //indent:8 exp:8

View File

@ -148,7 +148,7 @@ public class InputInvalidMethodIndent { //indent:0 exp:0
6, 7, 8, 9); //indent:10 exp:12 warn
// TODO: this is not illegal, but probably should be //indent:0 exp:0
// : this is not illegal, but probably should be //indent:0 exp:0
// myfunc3(11, 11, Integer. //indent:0 exp:0
// getInteger("mytest").intValue(), //indent:0 exp:0
// 11); //indent:0 exp:0

View File

@ -49,7 +49,7 @@ public class InputInvalidWhileIndent { //indent:0 exp:0
System.getProperty("foo"); //indent:12 exp:12
} //indent:6 exp:8 warn
while (test) { // TODO: this is allowed //indent:8 exp:8
while (test) { // : this is allowed //indent:8 exp:8
if (test) { //indent:14 exp:12 warn
System.getProperty("foo"); //indent:18 exp:16 warn
} //indent:14 exp:12 warn

View File

@ -52,7 +52,7 @@ public class InputValidAssignIndent //indent:0 exp:0
// function.lastArgument().candidate //indent:0 exp:0
// = //indent:0 exp:0
// parameters; //indent:0 exp:0
// TODO: add more testing //indent:8 exp:8
// : add more testing //indent:8 exp:8
} //indent:4 exp:4
private interface AnInterfaceFooWithALongName { //indent:4 exp:4

View File

@ -89,7 +89,7 @@ final class InputValidClassDefIndent6 extends java.awt.event.MouseAdapter implem
} //indent:8 exp:8
// TODO: this is broken right now: //indent:8 exp:8
// : this is broken right now: //indent:8 exp:8
// 1) this is both an expression and an OBJBLOCK //indent:8 exp:8
// 2) methods aren't yet parsed //indent:8 exp:8
// 3) only CLASSDEF is handled now, not OBJBLOCK //indent:8 exp:8

View File

@ -200,7 +200,7 @@ public class InputValidIfIndent { //indent:0 exp:0
System.getProperty("blah"); //indent:12 exp:12
// TODO: bother to support this style? //indent:8 exp:8
// : bother to support this style? //indent:8 exp:8
if (test) { //indent:8 exp:8
System.getProperty("blah"); //indent:12 exp:12
} else //indent:8 exp:8