Skip to content

Conversation

@Hariom-kr
Copy link
Contributor

@Hariom-kr Hariom-kr commented Oct 22, 2025

#3730
Summary:
New tokens:

  • TYPECAST - Annotations on type casts
  • TYPE_ARGUMENT - Annotations on generic type arguments
  • DOT - Annotations in qualified type names
  • LITERAL_NEW - Annotations on constructor invocations
  • LITERAL_THROWS - Annotations on exception types in throws clauses
  • IMPLEMENTS_CLAUSE - Annotations on interface types in implements clauses

Decision:

  • Tokens are opt-in only (not enabled in default configurations)
  • Added to getAcceptableTokens() but not getDefaultTokens()
  • Type annotations are less common and inline formatting is often preferred
  • Users can explicitly enable these tokens when needed for their codebase

Changes:

  • Updated AnnotationLocationCheck.java to accept the six new tokens
  • Added comprehensive documentation examples (Example5-Example10)
  • Updated xdocs template with new example sections
  • Added tokens to test ignore lists for checkstyle and google configs

@Hariom-kr
Copy link
Contributor Author

Github, generate website

@Hariom-kr Hariom-kr force-pushed the annotationlocation-xdoc-ex branch from e215b85 to 05b9872 Compare October 22, 2025 10:59
@Hariom-kr
Copy link
Contributor Author

Github, generate website

@Hariom-kr Hariom-kr force-pushed the annotationlocation-xdoc-ex branch from 05b9872 to 2210ee7 Compare October 22, 2025 11:21
@Hariom-kr
Copy link
Contributor Author

@romani can u review plz?

@Hariom-kr Hariom-kr force-pushed the annotationlocation-xdoc-ex branch from 2210ee7 to b62546f Compare October 23, 2025 03:34
@Hariom-kr
Copy link
Contributor Author

Github, generate website

@Hariom-kr
Copy link
Contributor Author

Hariom-kr commented Oct 25, 2025

@romani can u review plz?

Copy link
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

items:


// xdoc section -- start
class Example5 {
List<@TypeArgAnnotation1 String> names; // ok
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove all OK comments.
in all files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@romani
Copy link
Member

romani commented Oct 27, 2025

annotation is not over "implements" it is over type that is after implements.
same for ..

I need a bit more time to this issue, something is weird in it.

@Hariom-kr
Copy link
Contributor Author

yes, annotation on keyword is not allowed na i will wait for further instructions..

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants