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

AnnotationUseStyleCheck defaults: mismatch between documentation and code #4966

Closed
Stephan202 opened this Issue Aug 19, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@Stephan202
Contributor

Stephan202 commented Aug 19, 2017

I was about to open a PR for this change, but I see an issue must be filed first:

diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java
index 58b809217..4bd5a7e96 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java
@@ -69,8 +69,8 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
  * array comma preference a {@link TrailingArrayComma#IGNORE IGNORE} type
  * is provided.  Set this through the {@code trailingArrayComma} property.
  *
- * <p>By default the ElementStyle is set to EXPANDED, the TrailingArrayComma
- * is set to NEVER, and the ClosingParens is set to ALWAYS.
+ * <p>By default the ElementStyle is set to COMPACT_NO_ARRAY, the
+ * TrailingArrayComma is set to NEVER, and the ClosingParens is set to NEVER.
  *
  * <p>According to the JLS, it is legal to include a trailing comma
  * in arrays used in annotations but Sun's Java 5 &amp; 6 compilers will not

Alternatively the code could be updated to reflect the documentation (but that'd be a backwards-incompatible change).

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Aug 19, 2017

Member

update is correct - https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java#L243

it is not backward-incompatible change as you update javdoc to match xdoc and code.

@Stephan202 , please do PR.

Member

romani commented Aug 19, 2017

update is correct - https://github.com/checkstyle/checkstyle/blob/master/src/main/java/com/puppycrawl/tools/checkstyle/checks/annotation/AnnotationUseStyleCheck.java#L243

it is not backward-incompatible change as you update javdoc to match xdoc and code.

@Stephan202 , please do PR.

@romani romani changed the title from `AnnotationUseStyleCheck` defaults: mismatch between documentation and code to AnnotationUseStyleCheck defaults: mismatch between documentation and code Aug 19, 2017

Stephan202 added a commit to PicnicSupermarket/checkstyle that referenced this issue Aug 19, 2017

Issue #4966: Update `AnnotationUseStyleCheck` doc
We update the documented defaults to match the code.

Stephan202 added a commit to PicnicSupermarket/checkstyle that referenced this issue Aug 19, 2017

@Stephan202

This comment has been minimized.

Show comment
Hide comment
@Stephan202

Stephan202 Aug 19, 2017

Contributor

Thanks; I opened PR #4968.

Contributor

Stephan202 commented Aug 19, 2017

Thanks; I opened PR #4968.

@romani

This comment has been minimized.

Show comment
Hide comment
@romani

romani Aug 20, 2017

Member

fix is merged.

Member

romani commented Aug 20, 2017

fix is merged.

@romani romani closed this Aug 20, 2017

ArneLimburg pushed a commit to ArneLimburg/checkstyle that referenced this issue Aug 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment