Skip to content

Commit 814acc9

Browse files
committed
Make org.jboss.logging.tools.addGeneratedAnnotation actually ignore the rendering of the @Generated annotation
1 parent 6a8bdf9 commit 814acc9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

processor/src/main/java/org/jboss/logging/processor/apt/MessageInterfaceFactory.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,15 @@ private AptMessageInterface(final TypeElement interfaceElement, final Processing
139139
} else {
140140
validIdRanges = Collections.emptyList();
141141
}
142-
// Determine the type for the generated annotation
143-
final ModuleElement moduleElement = processingEnv.getElementUtils()
144-
.getModuleElement(Generated.class.getModule().getName());
145-
this.generatedAnnotation = processingEnv.getElementUtils().getTypeElement(moduleElement, Generated.class.getName());
142+
if (addGeneratedAnnotation) {
143+
// Determine the type for the generated annotation
144+
final ModuleElement moduleElement = processingEnv.getElementUtils()
145+
.getModuleElement(Generated.class.getModule().getName());
146+
this.generatedAnnotation = processingEnv.getElementUtils().getTypeElement(moduleElement,
147+
Generated.class.getName());
148+
} else {
149+
this.generatedAnnotation = null;
150+
}
146151
}
147152

148153
@Override

0 commit comments

Comments
 (0)