Remove dead code from TreeWalker. #1294

This commit is contained in:
Michal Kordas 2015-07-11 22:56:48 +02:00 committed by Roman Ivanov
parent b5f92edbe5
commit 8da777a68a
2 changed files with 6 additions and 8 deletions

View File

@ -1082,7 +1082,7 @@
<regex><pattern>.*.PropertiesExpander</pattern><branchRate>50</branchRate><lineRate>83</lineRate></regex>
<regex><pattern>.*.PropertyCacheFile</pattern><branchRate>22</branchRate><lineRate>19</lineRate></regex>
<regex><pattern>.*.checkstyle.ScopeUtils</pattern><branchRate>90</branchRate><lineRate>94</lineRate></regex>
<regex><pattern>.*.TreeWalker</pattern><branchRate>92</branchRate><lineRate>91</lineRate></regex>
<regex><pattern>.*.TreeWalker</pattern><branchRate>94</branchRate><lineRate>92</lineRate></regex>
<regex><pattern>com.puppycrawl.tools.checkstyle.Utils</pattern><branchRate>85</branchRate><lineRate>93</lineRate></regex>
<regex><pattern>.*.XMLLogger</pattern><branchRate>86</branchRate><lineRate>97</lineRate></regex>

View File

@ -584,13 +584,11 @@ public final class TreeWalker
* @return DetailAST of comment node.
*/
private static DetailAST createCommentAstFromToken(Token token) {
switch (token.getType()) {
case TokenTypes.SINGLE_LINE_COMMENT:
return createSlCommentNode(token);
case TokenTypes.BLOCK_COMMENT_BEGIN:
return createBlockCommentNode(token);
default:
throw new IllegalArgumentException("Unknown comment type");
if (token.getType() == TokenTypes.SINGLE_LINE_COMMENT) {
return createSlCommentNode(token);
}
else {
return createBlockCommentNode(token);
}
}