@Override protected void processFiltered(File file, FileText fileText) throws CheckstyleException { // check if already checked and passed the file if (!ordinaryChecks.isEmpty() || !commentChecks.isEmpty()) { final FileContents contents = new FileContents(fileText); final DetailAST rootAST = JavaParser.parse(contents); if (!ordinaryChecks.isEmpty()) { walk(rootAST, contents, AstState.ORDINARY); } if (!commentChecks.isEmpty()) { final DetailAST astWithComments = JavaParser.appendHiddenCommentNodes(rootAST); walk(astWithComments, contents, AstState.WITH_COMMENTS); } if (filters.isEmpty()) { addMessages(messages); } else { final SortedSet<LocalizedMessage> filteredMessages = getFilteredMessages(file.getAbsolutePath(), contents, rootAST); addMessages(filteredMessages); } messages.clear(); } }
@Override protected void processFiltered(File file, FileText fileText) throws CheckstyleException { // check if already checked and passed the file if (!ordinaryChecks.isEmpty() || !commentChecks.isEmpty()) { final FileContents contents = new FileContents(fileText); final DetailAST rootAST = JavaParser.parse(contents); if (!ordinaryChecks.isEmpty()) { walk(rootAST, contents, AstState.ORDINARY); } if (!commentChecks.isEmpty()) { final DetailAST astWithComments = JavaParser.appendHiddenCommentNodes(rootAST); walk(astWithComments, contents, AstState.WITH_COMMENTS); } if (filters.isEmpty()) { addMessages(messages); } else { final SortedSet<LocalizedMessage> filteredMessages = getFilteredMessages(file.getAbsolutePath(), contents, rootAST); addMessages(filteredMessages); } messages.clear(); } }