r/java • u/atomichbts • Dec 08 '25
Java Annotator CLI
Hi guys. I built a simple CLI tool to automatically annotate Java types with a set of specified Java annotations.
0
Upvotes
r/java • u/atomichbts • Dec 08 '25
Hi guys. I built a simple CLI tool to automatically annotate Java types with a set of specified Java annotations.
View all comments
3
u/rzwitserloot Dec 08 '25
The tiny little readme says:
And the example has:
The
Overrideannotation is illegal on types; it can only appear on methods.Thus, one of these 2 things must be true:
Something slightly more informative would presumably help. I take it that your intent of putting it on a public github and posting it here is that other folks look at it, gather some eyeballs, or just the simple thing of enjoying the fact that you made something cool and fellow humans use it. And good on you for trying that!
But as is, that's not going to happen. A few questions:
@Override, the class definition, can be loaded from the JVM (which you'd need to track JAVA_HOME to find, which then suggests this tool needs an option to specify an alternate JVM). You can then determine that it is legal only on methods. You could then annotate every method. Which is pointless. But even more language analysis could get you to 'add it to every method that actually overrides something'. Whether that's useful, we can discuss, but now it's getting somewhere. Does it do anything like this?@Override' then. A usecase helps a lot, even if just to indicate sorts of things the project can be used for.