From f887d69927056c39ae3ed239498d8bc746966c0c Mon Sep 17 00:00:00 2001 From: Luke Bemish Date: Wed, 11 Oct 2023 17:33:01 +0100 Subject: [PATCH] Fix empty params tags generating --- build.gradle | 2 +- .../docpatcher/plugin/impl/SpoonJavadocVisitor.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index e550fa2..90a1806 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group = 'dev.lukebemish.docpatcher' -version = '0.1.3' +version = '0.1.4' java { // I don't feel like dealing with old java... diff --git a/src/main/java/dev/lukebemish/docpatcher/plugin/impl/SpoonJavadocVisitor.java b/src/main/java/dev/lukebemish/docpatcher/plugin/impl/SpoonJavadocVisitor.java index ec77f2a..3e8a6e3 100644 --- a/src/main/java/dev/lukebemish/docpatcher/plugin/impl/SpoonJavadocVisitor.java +++ b/src/main/java/dev/lukebemish/docpatcher/plugin/impl/SpoonJavadocVisitor.java @@ -200,6 +200,9 @@ private static ProcessedJavadoc processJavadocs(CtJavaDoc javadoc, CtJavaDoc ori parametersOut.add(""); } } + if (params.isEmpty()) { + tags.remove("param"); + } } List typeParametersOut = null; if (typeParameters != null && tags.containsKey("param")) { @@ -214,6 +217,9 @@ private static ProcessedJavadoc processJavadocs(CtJavaDoc javadoc, CtJavaDoc ori typeParametersOut.add(""); } } + if (params.isEmpty()) { + tags.remove("param"); + } } String contentDiff = content; if (originalJavadoc != null) {