diff --git a/processor/src/main/java/org/jboss/logging/processor/apt/MessageInterfaceFactory.java b/processor/src/main/java/org/jboss/logging/processor/apt/MessageInterfaceFactory.java index b404435..849c928 100644 --- a/processor/src/main/java/org/jboss/logging/processor/apt/MessageInterfaceFactory.java +++ b/processor/src/main/java/org/jboss/logging/processor/apt/MessageInterfaceFactory.java @@ -139,10 +139,15 @@ private AptMessageInterface(final TypeElement interfaceElement, final Processing } else { validIdRanges = Collections.emptyList(); } - // Determine the type for the generated annotation - final ModuleElement moduleElement = processingEnv.getElementUtils() - .getModuleElement(Generated.class.getModule().getName()); - this.generatedAnnotation = processingEnv.getElementUtils().getTypeElement(moduleElement, Generated.class.getName()); + if (addGeneratedAnnotation) { + // Determine the type for the generated annotation + final ModuleElement moduleElement = processingEnv.getElementUtils() + .getModuleElement(Generated.class.getModule().getName()); + this.generatedAnnotation = processingEnv.getElementUtils().getTypeElement(moduleElement, + Generated.class.getName()); + } else { + this.generatedAnnotation = null; + } } @Override