Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property excludeScope in JavadocMethod check does not work correctly #2205

Closed
damianszczepanik opened this issue Sep 18, 2015 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@damianszczepanik
Copy link
Contributor

Based on this http://checkstyle.sourceforge.net/config_javadoc.html#JavadocMethod documentation I understand that by default it checks all scopes except private. In other words this is relevant to:

        <module name="JavadocMethod">
            <property name="excludeScope" value="private"/>
        </module>

However I found in damianszczepanik/silencio/pull/42 that above comments generates 0 errors while following one

        <module name="JavadocMethod">
        </module>

complains that https://github.com/damianszczepanik/silencio/blob/b65764da81d118f40f19ee5e640fb2540bbba7c6/src/main/java/pl/szczepanik/silencio/diagnostics/ProcessorSmokeChecker.java#L45 has violation ProcessorSmokeChecker.java:45:5: Missing a Javadoc comment

Is that correct that excluding private from checker generates errors for public?

@romani romani added the javadoc label Sep 18, 2015
@mkordas
Copy link
Contributor

mkordas commented Sep 18, 2015

The problem is in JavadocMethodCheck.java#L465-L468. There are even tests proving this incorrect behavior...
I'm on it.

@mkordas
Copy link
Contributor

mkordas commented Sep 18, 2015

There is also another problem with excludeScope property. If it is set to protected as in com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheckTest#testExcludeScope, it still reports missing Javadoc on protected members. Test proves that incorrect behaviour e.g. by

"46:9: " + getCheckMessage(MSG_JAVADOC_MISSING),

when this line is just

protected void foo2() {}

@mkordas mkordas changed the title excludeScope:private skips all errors Property excludeScope in JavadocMethod check does not work correctly Sep 18, 2015
mkordas added a commit to mkordas/checkstyle that referenced this issue Sep 18, 2015
@romani romani added this to the 6.11 milestone Sep 18, 2015
@romani romani closed this as completed Sep 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants