Add possibility to add custom annotations to Builder
See original GitHub issueIn particular edu.umd.cs.findbugs.annotations.SuppressFBWarnings
, otherweise SpotBugs detects violations which normally would be ignored in generated code.
It’s not possible to make SpotBugs process @Generated
annotation since SpotBugs process byte-code and @Generated
has source
retention type.
P.S. Nice library and nice work! I use Immutables a lot so it’s really nice to have similar funtionality for java records.
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (11 by maintainers)
Top Results From Across the Web
Implementing a Custom Lombok Annotation - Baeldung
Learn how to implement a custom annotation using Lombok handlers.
Read more >How To Create And Use Your Own Custom Annotations
Create your own custom annotations in Java!Thanks to Mailgun for sponsoring this video! Head to https://mailgun.com/john to try Mailgun ...
Read more >java - How to create custom annotation with code behind
Annotation is a metadata to a class that says based on the supplied data, do something.Had this metadata not present in the MyMessage...
Read more >Using Custom Annotation Processors - Apache NetBeans
Defining an Annotation and Creating an Annotation Processor · In this exercise you will create a class library project. · When you click...
Read more >Your Own Custom Annotations - More than Just Comments!
The second argument to this method represents the namespace of the Annotation class to be used. And for all the annotations we find,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the feedback everyone. So, at minimum copy the annotations (respecting Target, etc.). We can decide later if we can/should do more.
in my opinion, you could just keep things simple and copy all annotations as you mentioned earlier.
I don’t think you should act on them: that’s not really the job of this library. This library’s goal is to add a builder pattern to the Java record construct, IMHO.
Regarding the annotations, if the original record was acting on them, then this will still happen. if not, then how are you going to handle those annotations. for JSR-303 for example, are you going to throw an exception ?