This is an automated email from the ASF dual-hosted git repository. elharo pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-help-plugin.git
The following commit(s) were added to refs/heads/master by this push: new 764c2cf Replace deprecated toString methods (#126) 764c2cf is described below commit 764c2cf2cf98f07005e28eb4347e179b199ccc4b Author: Elliotte Rusty Harold <elh...@users.noreply.github.com> AuthorDate: Sat Dec 7 11:33:03 2024 +0000 Replace deprecated toString methods (#126) --- src/main/java/org/apache/maven/plugins/help/DescribeMojo.java | 11 ++++++----- .../java/org/apache/maven/plugins/help/EffectivePomMojo.java | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java b/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java index 19a8118..522bd39 100644 --- a/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java +++ b/src/main/java/org/apache/maven/plugins/help/DescribeMojo.java @@ -209,6 +209,7 @@ public class DescribeMojo extends AbstractHelpMojo { /** * {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException, MojoFailureException { StringBuilder descriptionBuffer = new StringBuilder(); @@ -397,7 +398,7 @@ public class DescribeMojo extends AbstractHelpMojo { name = pd.getId(); } } - append(buffer, "Name", MessageUtils.buffer().strong(name).toString(), 0); + append(buffer, "Name", MessageUtils.buffer().strong(name).build(), 0); appendAsParagraph(buffer, "Description", toDescription(pd.getDescription()), 0); append(buffer, "Group Id", pd.getGroupId(), 0); append(buffer, "Artifact Id", pd.getArtifactId(), 0); @@ -405,7 +406,7 @@ public class DescribeMojo extends AbstractHelpMojo { append( buffer, "Goal Prefix", - MessageUtils.buffer().strong(pd.getGoalPrefix()).toString(), + MessageUtils.buffer().strong(pd.getGoalPrefix()).build(), 0); buffer.append(LS); @@ -469,7 +470,7 @@ public class DescribeMojo extends AbstractHelpMojo { */ private void describeMojoGuts(MojoDescriptor md, StringBuilder buffer, boolean fullDescription) throws MojoFailureException, MojoExecutionException { - append(buffer, MessageUtils.buffer().strong(md.getFullGoalName()).toString(), 0); + append(buffer, MessageUtils.buffer().strong(md.getFullGoalName()).build(), 0); // indent 1 appendAsParagraph(buffer, "Description", toDescription(md.getDescription()), 1); @@ -482,7 +483,7 @@ public class DescribeMojo extends AbstractHelpMojo { if (deprecation != null && !deprecation.isEmpty()) { append( buffer, - MessageUtils.buffer().warning("Deprecated. " + deprecation).toString(), + MessageUtils.buffer().warning("Deprecated. " + deprecation).build(), 1); } @@ -612,7 +613,7 @@ public class DescribeMojo extends AbstractHelpMojo { buffer, MessageUtils.buffer() .warning("Deprecated. " + deprecation) - .toString(), + .build(), 3); } } diff --git a/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java b/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java index 4e42148..c38e2c5 100644 --- a/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java +++ b/src/main/java/org/apache/maven/plugins/help/EffectivePomMojo.java @@ -90,6 +90,7 @@ public class EffectivePomMojo extends AbstractEffectiveMojo { // ---------------------------------------------------------------------- /** {@inheritDoc} */ + @Override public void execute() throws MojoExecutionException { if (artifact != null && !artifact.isEmpty()) { project = getMavenProject(artifact); @@ -131,7 +132,7 @@ public class EffectivePomMojo extends AbstractEffectiveMojo { } else { if (MessageUtils.isColorEnabled()) { // add color to comments - String comment = MessageUtils.buffer().project("<!--.-->").toString(); + String comment = MessageUtils.buffer().project("<!--.-->").build(); int dotIndex = comment.indexOf("."); String commentStart = comment.substring(0, dotIndex); String commentEnd = comment.substring(dotIndex + 1);