Skip to content

Commit

Permalink
Force adding the Serial annotation import for older Java versions
Browse files Browse the repository at this point in the history
Fixes #373
  • Loading branch information
timtebeek committed Jan 2, 2025
1 parent 383358b commit 7189cb1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public J.VariableDeclarations visitVariableDeclarations(J.VariableDeclarations m
J.VariableDeclarations vd = super.visitVariableDeclarations(multiVariable, ctx);
if (isPrivateStaticFinalLongSerialVersionUID(vd) &&
FindAnnotations.find(vd, "@java.io.Serial").isEmpty()) {
maybeAddImport("java.io.Serial");
maybeAddImport("java.io.Serial", false); // GH#373
return JavaTemplate.builder("@Serial")
.imports("java.io.Serial")
.build()
Expand Down

0 comments on commit 7189cb1

Please sign in to comment.