Minor: refactoring of TreeWalker to increase readability

This commit is contained in:
Andrei Selkin 2015-09-02 01:15:19 +03:00 committed by Roman Ivanov
parent 6f7dfc3c69
commit ed280ebd0b
1 changed files with 1 additions and 1 deletions

View File

@ -305,8 +305,8 @@ public final class TreeWalker
* @throws CheckstyleException when validation of default tokens fails
*/
private static void validateDefaultTokens(Check check) throws CheckstyleException {
final int[] defaultTokens = check.getDefaultTokens();
if (check.getRequiredTokens().length != 0) {
final int[] defaultTokens = check.getDefaultTokens();
Arrays.sort(defaultTokens);
for (final int token : check.getRequiredTokens()) {
if (Arrays.binarySearch(defaultTokens, token) < 0) {