Skip to content

Commit

Permalink
Issue checkstyle#2205: Fix not working excludeScope in JavadocMethod …
Browse files Browse the repository at this point in the history
…check
  • Loading branch information
mkordas committed Sep 18, 2015
1 parent bad81c8 commit 52d491c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Expand Up @@ -464,8 +464,8 @@ private boolean shouldCheck(final DetailAST ast, final Scope nodeScope) {

return nodeScope.isIn(scope)
&& surroundingScope.isIn(scope)
&& (excludeScope == null || !nodeScope.isIn(excludeScope)
|| !surroundingScope.isIn(excludeScope));
&& (excludeScope == null || nodeScope != excludeScope
&& surroundingScope != excludeScope);
}

/**
Expand Down
Expand Up @@ -348,36 +348,28 @@ public void testExcludeScope() throws Exception {
checkConfig.addAttribute("scope", Scope.PRIVATE.getName());
checkConfig.addAttribute("excludeScope", Scope.PROTECTED.getName());
final String[] expected = {
"10:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
"12:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
"13:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
"23:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"24:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"33:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"34:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"35:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"36:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"45:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"46:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"47:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"48:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"58:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
"59:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
"60:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
"61:5: " + getCheckMessage(MSG_JAVADOC_MISSING),
"69:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"70:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"71:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"72:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"81:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"82:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"83:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"84:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"93:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"94:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"95:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"96:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"105:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"106:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"107:9: " + getCheckMessage(MSG_JAVADOC_MISSING),
"108:9: " + getCheckMessage(MSG_JAVADOC_MISSING), };
verify(checkConfig, getPath("javadoc" + File.separator
Expand Down

0 comments on commit 52d491c

Please sign in to comment.