Skip to content

#694 xannotate generated new plugin#696

Closed
duttonw wants to merge 2 commits intohighsource:masterfrom
duttonw:694_XannotateGenerated_new_plugin
Closed

#694 xannotate generated new plugin#696
duttonw wants to merge 2 commits intohighsource:masterfrom
duttonw:694_XannotateGenerated_new_plugin

Conversation

@duttonw
Copy link
Copy Markdown
Contributor

@duttonw duttonw commented Apr 15, 2026

see #694 requires #691

duttonw added 2 commits April 15, 2026 15:33
…tations to all generated nodes where possible; useful for JaCoCo (which has built in support), or other style checkers and code coverage tools:

 Options value is TRUE or FALSE:
 To Disable @generated addition

	-XannotateGenerated
	-XannotateGenerated:addGeneratedAnnotation=FALSE

To use your own class for @GeneratedAnnotations, use the following variable
	-XannotateGenerated
	-XannotateGenerated:customGeneratedAnnotationClass=com.example.MyGeneratedClass

 To add the @SuppressFBWarnings annotation which is useful if you want to run SpotBugs/FindBugs on your class files. To enable this feature, make sure com.github.spotbugs:spotbugs-annotations is on the classpath when you compile, and add the following config key:

	-XannotateGenerated
	-XannotateGenerated:addSuppressFBWarnings=TRUE

 To add the @SuppressWarnings("all") annotation to all generated nodes by default.  This can be turned off which is useful if you want to use static code analyzers like Checker Framework.

	-XannotateGenerated
	-XannotateGenerated:addSuppressWarnings=FALSE

You can set multiple variables. i.e. to only have FB Warnings you can do:	-XannotateGenerated
	-XannotateGenerated:addSuppressWarnings=FALSE
	-XannotateGenerated:addSuppressFBWarnings=TRUE
	-XannotateGenerated:addGeneratedAnnotation=FALSE
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What is the advantage of using a new annotation class?

There is already:
javax.annotation.Generated

Copy link
Copy Markdown
Collaborator

@laurentschoelens laurentschoelens Apr 15, 2026

Choose a reason for hiding this comment

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

@mattrpav I've closed issue but not PR : I'll do it without merging

Copy link
Copy Markdown
Collaborator

@mattrpav mattrpav Apr 15, 2026

Choose a reason for hiding this comment

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

Most features in jaxb-tools are very shallow. Simple to use an anonymous or test-only impl class to provide similar capabilities. I'm not convinced the benefit of adding Mockito to the project outweighs the work needed to support it long term. (Mock libraries have had a short lifespan in the past and require re-write when they fall out of favor)

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.

3 participants