Skip to content

Commit 9b5adff

Browse files
committed
Prefer JDK replace method over deprecated StringUtils method
1 parent 5e0f9a0 commit 9b5adff

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/main/java/org/apache/maven/plugins/javadoc/AbstractJavadocMojo.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,7 +2663,7 @@ private void populateCompileArtifactMap(Map<String, Artifact> compileArtifactMap
26632663
}
26642664

26652665
/**
2666-
* Method that sets the bottom text that will be displayed on the bottom of the
2666+
* Method that sets the text that will be displayed on the bottom of the
26672667
* javadocs.
26682668
*
26692669
* @return a String that contains the text that will be displayed at the bottom of the javadoc
@@ -2678,32 +2678,30 @@ private String getBottomText() {
26782678

26792679
final String currentYear = Integer.toString(localDate.getYear());
26802680

2681-
String theBottom = StringUtils.replace(this.bottom, "{currentYear}", currentYear);
2681+
String theBottom = this.bottom.replace("{currentYear}", currentYear);
26822682

26832683
if ((inceptionYear == null) || inceptionYear.equals(currentYear)) {
2684-
theBottom = StringUtils.replace(theBottom, "{inceptionYear}&#x2013;", "");
2684+
theBottom = theBottom.replace("{inceptionYear}&#x2013;", "");
26852685
} else {
2686-
theBottom = StringUtils.replace(theBottom, "{inceptionYear}", inceptionYear);
2686+
theBottom = theBottom.replace("{inceptionYear}", inceptionYear);
26872687
}
26882688

26892689
if (project.getOrganization() == null) {
2690-
theBottom = StringUtils.replace(theBottom, " {organizationName}", "");
2690+
theBottom = theBottom.replace(" {organizationName}", "");
26912691
} else {
26922692
if (StringUtils.isNotEmpty(project.getOrganization().getName())) {
26932693
if (StringUtils.isNotEmpty(project.getOrganization().getUrl())) {
2694-
theBottom = StringUtils.replace(
2695-
theBottom,
2694+
theBottom = theBottom.replace(
26962695
"{organizationName}",
26972696
"<a href=\"" + project.getOrganization().getUrl() + "\">"
26982697
+ project.getOrganization().getName() + "</a>");
26992698
} else {
2700-
theBottom = StringUtils.replace(
2701-
theBottom,
2699+
theBottom = theBottom.replace(
27022700
"{organizationName}",
27032701
project.getOrganization().getName());
27042702
}
27052703
} else {
2706-
theBottom = StringUtils.replace(theBottom, " {organizationName}", "");
2704+
theBottom = theBottom.replace(" {organizationName}", "");
27072705
}
27082706
}
27092707

@@ -4813,7 +4811,7 @@ private void addGroups(List<String> arguments) throws MavenReportException {
48134811
getLog().warn("A group option is empty. Ignore this option.");
48144812
}
48154813
} else {
4816-
String groupTitle = StringUtils.replace(group.getTitle(), ",", "&#44;");
4814+
String groupTitle = group.getTitle().replace(",", "&#44;");
48174815
addArgIfNotEmpty(
48184816
arguments,
48194817
"-group",

0 commit comments

Comments
 (0)