Skip to content

Commit

Permalink
Merge pull request #29024 from geoand/recorder-final
Browse files Browse the repository at this point in the history
Ensure (at extension build time) that @recorder classes are not final
  • Loading branch information
geoand authored Nov 3, 2022
2 parents 14b80d7 + b2b6cc3 commit ee60a15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ private void validateRecordBuildSteps(TypeElement clazz) {
allTypesResolvable = false;
} else {
if (isAnnotationPresent(parameterTypeElement, Constants.ANNOTATION_RECORDER)) {
if (parameterTypeElement.getModifiers().contains(Modifier.FINAL)) {
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR,
"Class '" + parameterTypeElement.getQualifiedName()
+ "' is annotated with @Recorder and therefore cannot be made as a final class.");
}
hasRecorder = true;
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* - Objects with a no-arg constructor and getter/setters for all properties (or public fields)
* - Objects with a constructor annotated with @RecordableConstructor with parameter names that match field names
* - Any arbitrary object via the
* {@link io.quarkus.deployment.recording.RecorderContext#registerSubstitution(Class, Class, Class)} mechanism
* {@code io.quarkus.deployment.recording.RecorderContext#registerSubstitution(Class, Class, Class)} mechanism
* - arrays, lists and maps of the above
*
*/
Expand Down

0 comments on commit ee60a15

Please sign in to comment.