Fixed false-positive in GenericWhitespaceCheck issue #51

This commit is contained in:
alexkravin 2014-12-12 16:57:58 +04:00 committed by Roman Ivanov
parent 95fd156d31
commit cf5686783f
3 changed files with 22 additions and 4 deletions

View File

@ -161,10 +161,7 @@ public class GenericWhitespaceCheck extends Check
log(aAST.getLineNo(), after, "ws.followed", ">");
}
}
else if ((line.charAt(after) != '>')
&& (line.charAt(after) != ',')
&& (line.charAt(after) != '['))
{
else if (line.charAt(after) == ' ') {
log(aAST.getLineNo(), after, "ws.followed", ">");
}
}

View File

@ -83,4 +83,14 @@ public class GenericWhitespaceCheckTest
final String[] expected = {};
verify(mCheckConfig, getPath("whitespace/Gh47.java"), expected);
}
@Test
public void testInnerClass() throws Exception
{
final String[] expected = {
};
verify(mCheckConfig, getPath("whitespace/"
+ "InputGenericWhitespaceInnerClassCheck.java"), expected);
}
}

View File

@ -0,0 +1,11 @@
package com.puppycrawl.tools.checkstyle.whitespace;
import java.util.List;
public class InputGenericWhitespaceInnerClassCheck<T>
{
private List<InputGenericWhitespaceInnerClassCheck<? extends T>.InnerClass> field;
public class InnerClass {
}
}