Replace deprecated toString methods (#126)
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 @@
/**
* {@inheritDoc}
*/
+ @Override
public void execute() throws MojoExecutionException, MojoFailureException {
StringBuilder descriptionBuffer = new StringBuilder();
@@ -397,7 +398,7 @@
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 @@
append(
buffer,
"Goal Prefix",
- MessageUtils.buffer().strong(pd.getGoalPrefix()).toString(),
+ MessageUtils.buffer().strong(pd.getGoalPrefix()).build(),
0);
buffer.append(LS);
@@ -469,7 +470,7 @@
*/
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 @@
if (deprecation != null && !deprecation.isEmpty()) {
append(
buffer,
- MessageUtils.buffer().warning("Deprecated. " + deprecation).toString(),
+ MessageUtils.buffer().warning("Deprecated. " + deprecation).build(),
1);
}
@@ -612,7 +613,7 @@
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 @@
// ----------------------------------------------------------------------
/** {@inheritDoc} */
+ @Override
public void execute() throws MojoExecutionException {
if (artifact != null && !artifact.isEmpty()) {
project = getMavenProject(artifact);
@@ -131,7 +132,7 @@
} 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);