jflex icon indicating copy to clipboard operation
jflex copied to clipboard

Add @Generated on generated code

Open regisd opened this issue 7 years ago • 2 comments
trafficstars

In order to work around the error-prone fall-though violations in the generated code (#222), I tried using using -XepDisableWarningsInGeneratedCode.

Unfortunately this javac option only works if the generated code is annotated with @Generated.

regisd avatar Oct 15 '18 12:10 regisd

Adding this annotation will create a dependency on 'javax.annotation:javax.annotation-api:jar' The current workaround which is with @SuppressWarnings #454 should be sufficient for now. I'll defer the decision about adding a dep on this annotation to 1.8 and let Gerwin make the call.

regisd avatar Oct 18 '18 18:10 regisd

@lsf37 So actually, there is a problem using @SuppressWarnings on the class: There can be only one such annotation, which can be problematic if the custom header wants to define one.

regisd avatar Mar 28 '20 15:03 regisd

There is now a mechanism for leaving out the default SuppressWarnings annotation, so I think we can close this one.

lsf37 avatar Jan 07 '23 02:01 lsf37