This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 60989b0 CAMEL-13663: camel-main-maven-plugin to generte spring-boot tooling metadata to fool Java editors to have code completions for Camel Main application.properties files. 60989b0 is described below commit 60989b0d3e5313b7043cf67944bc49f21195d22d Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Jun 21 14:54:03 2019 +0200 CAMEL-13663: camel-main-maven-plugin to generte spring-boot tooling metadata to fool Java editors to have code completions for Camel Main application.properties files. --- .../src/main/java/org/apache/camel/maven/GenerateHelper.java | 2 +- .../src/main/java/org/apache/camel/maven/GenerateMojo.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateHelper.java b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateHelper.java index 9f6f8ef..f6199d5 100644 --- a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateHelper.java +++ b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateHelper.java @@ -30,7 +30,7 @@ public final class GenerateHelper { * @return the text that is valid as json */ public static String sanitizeDescription(String javadoc, boolean summary) { - if (javadoc == null || javadoc.isEmpty()) { + if (javadoc == null || javadoc.trim().isEmpty()) { return null; } diff --git a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java index 51b2989..fe76815 100644 --- a/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java +++ b/catalog/camel-main-maven-plugin/src/main/java/org/apache/camel/maven/GenerateMojo.java @@ -221,10 +221,14 @@ public class GenerateMojo extends AbstractMainMojo { // find the setter method and grab the javadoc String desc = extractJavaDocFromMethod(javaClassSource, m); desc = sanitizeDescription(desc, false); - if (desc == null || desc.isEmpty()) { + if (desc == null) { desc = ""; } else { - desc += ". "; + if (desc.endsWith(".")) { + desc += " "; + } else { + desc += ". "; + } } desc += "Auto discovered option from class: " + best.getName() + " to set the option via setter: " + m.getName();