diff --git a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java
index c490a566..12aaa681 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/AbstractProjectInfoRenderer.java
@@ -24,7 +24,6 @@
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.reporting.AbstractMavenReportRenderer;
import org.codehaus.plexus.i18n.I18N;
-import org.codehaus.plexus.util.StringUtils;
/**
* @author Hervé Boutemy
@@ -78,7 +77,7 @@ protected String getI18nString(String section, String key) {
@Override
protected void text(String text) {
- if (StringUtils.isEmpty(text)) // Take care of spaces
+ if (text == null || text.isEmpty()) // Take care of spaces
{
sink.text("-");
} else {
@@ -112,7 +111,7 @@ protected void verbatimText(String text) {
*/
@Override
protected void verbatimLink(String text, String href) {
- if (StringUtils.isEmpty(href)) {
+ if (href == null || href.isEmpty()) {
verbatimText(text);
} else {
sink.verbatim(null);
diff --git a/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java
index 27ab6500..be41b7f8 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/CiManagementReport.java
@@ -30,7 +30,6 @@
import org.apache.maven.model.Notifier;
import org.apache.maven.plugins.annotations.Mojo;
import org.codehaus.plexus.i18n.I18N;
-import org.codehaus.plexus.util.StringUtils;
/**
* Generates the Project Continuous Integration Management report.
@@ -137,7 +136,7 @@ public void renderBody() {
// Access
startSection(getI18nString("access"));
- if (!StringUtils.isEmpty(url)) {
+ if (!(url == null || url.isEmpty())) {
paragraph(getI18nString("url"));
verbatimLink(url, url);
@@ -186,7 +185,7 @@ public void renderBody() {
* @return system description from properties
*/
private String getIntroForCiManagementSystem(String system) {
- if (StringUtils.isEmpty(system)) {
+ if (system == null || system.isEmpty()) {
return getI18nString("general.intro");
}
diff --git a/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java
index fdcb7605..50f664ac 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/DistributionManagementReport.java
@@ -165,7 +165,7 @@ public void renderBody() {
}
private void internalLink(String url) {
- if (StringUtils.isEmpty(url)) {
+ if (url == null || url.isEmpty()) {
return;
}
@@ -178,7 +178,7 @@ private void internalLink(String url) {
}
private String getRepoName(String name) {
- if (StringUtils.isNotEmpty(name)) {
+ if (name != null && !name.isEmpty()) {
return " - " + name;
}
diff --git a/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java b/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java
index efb640c7..2d1a4a56 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/IssueManagementReport.java
@@ -25,7 +25,6 @@
import org.apache.maven.model.Model;
import org.apache.maven.plugins.annotations.Mojo;
import org.codehaus.plexus.i18n.I18N;
-import org.codehaus.plexus.util.StringUtils;
/**
* Generates the Project Issue Management report.
@@ -145,11 +144,11 @@ public void renderBody() {
* @return true if the issue management system is Jira, bugzilla, false otherwise.
*/
private boolean isIssueManagementSystem(String system, String actual) {
- if (StringUtils.isEmpty(system)) {
+ if (system == null || system.isEmpty()) {
return false;
}
- if (StringUtils.isEmpty(actual)) {
+ if (actual == null || actual.isEmpty()) {
return false;
}
diff --git a/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java b/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java
index 350cdc4b..9c0c6bff 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/LicensesReport.java
@@ -250,7 +250,7 @@ public void renderBody() {
sink.list();
for (License license : licenses) {
String name = license.getName();
- if (StringUtils.isEmpty(name)) {
+ if (name == null || name.isEmpty()) {
name = getI18nString("unnamed");
}
@@ -264,7 +264,7 @@ public void renderBody() {
for (License license : licenses) {
String name = license.getName();
- if (StringUtils.isEmpty(name)) {
+ if (name == null || name.isEmpty()) {
name = getI18nString("unnamed");
}
@@ -273,7 +273,7 @@ public void renderBody() {
startSection(name);
- if (!StringUtils.isEmpty(comments)) {
+ if (!(comments == null || comments.isEmpty())) {
paragraph(comments);
}
diff --git a/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java b/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
index ed4400ef..40c83d88 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/ProjectInfoReportUtils.java
@@ -114,7 +114,7 @@ public static String getContent(URL url, MavenProject project, Settings settings
throws IOException {
String scheme = url.getProtocol();
- if (StringUtils.isEmpty(encoding)) {
+ if (encoding == null || encoding.isEmpty()) {
encoding = DEFAULT_ENCODING;
}
@@ -144,7 +144,7 @@ public static String getContent(URL url, MavenProject project, Settings settings
}
String host = proxy.getHost();
- if (!StringUtils.isEmpty(host)) {
+ if (!(host == null || host.isEmpty())) {
Properties p = System.getProperties();
p.setProperty(scheme + "proxySet", "true");
p.setProperty(scheme + "proxyHost", host);
@@ -154,7 +154,7 @@ public static String getContent(URL url, MavenProject project, Settings settings
}
final String userName = proxy.getUsername();
- if (!StringUtils.isEmpty(userName)) {
+ if (!(userName == null || userName.isEmpty())) {
final String pwd = StringUtils.isEmpty(proxy.getPassword()) ? "" : proxy.getPassword();
Authenticator.setDefault(new Authenticator() {
/** {@inheritDoc} */
@@ -225,7 +225,7 @@ public static String getArtifactUrl(
* @see AbstractMavenReportRenderer#linkPatternedText(String)
*/
public static String getArtifactIdCell(String artifactId, String link) {
- if (StringUtils.isEmpty(link)) {
+ if (link == null || link.isEmpty()) {
return artifactId;
}
@@ -237,7 +237,7 @@ public static String getArtifactIdCell(String artifactId, String link) {
* @return true
if the url is valid, false
otherwise.
*/
public static boolean isArtifactUrlValid(String url) {
- if (StringUtils.isEmpty(url)) {
+ if (url == null || url.isEmpty()) {
return false;
}
diff --git a/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java b/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
index 53bbbc4e..91a0ca0b 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/ScmReport.java
@@ -110,8 +110,8 @@ public boolean canGenerateReport() {
result = scm != null;
if (result
- && StringUtils.isEmpty(anonymousConnection)
- && StringUtils.isEmpty(developerConnection)
+ && (anonymousConnection == null || anonymousConnection.isEmpty())
+ && (developerConnection == null || developerConnection.isEmpty())
&& StringUtils.isEmpty(scm.getUrl())) {
result = false;
}
@@ -217,8 +217,8 @@ protected String getI18Nsection() {
public void renderBody() {
Scm scm = model.getScm();
if (scm == null
- || StringUtils.isEmpty(anonymousConnection)
- && StringUtils.isEmpty(devConnection)
+ || (anonymousConnection == null || anonymousConnection.isEmpty())
+ && (devConnection == null || devConnection.isEmpty())
&& StringUtils.isEmpty(scm.getUrl())) {
startSection(getTitle());
@@ -303,7 +303,7 @@ private void renderOverviewSection(ScmRepository anonymousRepository, ScmReposit
private void renderWebAccessSection(String scmUrl) {
startSection(getI18nString("webaccess.title"));
- if (StringUtils.isEmpty(scmUrl)) {
+ if (scmUrl == null || scmUrl.isEmpty()) {
paragraph(getI18nString("webaccess.nourl"));
} else {
paragraph(getI18nString("webaccess.url"));
@@ -326,7 +326,7 @@ private void renderAnonymousAccessSection(ScmRepository anonymousRepository) {
if (isScmSystem(anonymousRepository, "clearcase")
|| isScmSystem(anonymousRepository, "perforce")
|| isScmSystem(anonymousRepository, "starteam")
- || StringUtils.isEmpty(anonymousConnection)) {
+ || (anonymousConnection == null || anonymousConnection.isEmpty())) {
return;
}
@@ -366,7 +366,7 @@ private void renderAnonymousAccessSection(ScmRepository anonymousRepository) {
* @param devRepository the dev repository
*/
private void renderDeveloperAccessSection(ScmRepository devRepository) {
- if (StringUtils.isEmpty(devConnection)) {
+ if (devConnection == null || devConnection.isEmpty()) {
return;
}
@@ -503,7 +503,7 @@ private void gitClone(String url) {
url = url.substring(0, index + 4);
}
- boolean head = StringUtils.isEmpty(scmTag) || "HEAD".equals(scmTag);
+ boolean head = (scmTag == null || scmTag.isEmpty()) || "HEAD".equals(scmTag);
verbatimText("$ git clone " + (head ? "" : ("--branch " + scmTag + ' ')) + url);
}
@@ -747,7 +747,7 @@ private void developerAccessSubversion(SvnScmProviderRepository svnRepo) {
* @return a valid SCM repository or null
*/
public ScmRepository getScmRepository(String scmUrl) {
- if (StringUtils.isEmpty(scmUrl)) {
+ if (scmUrl == null || scmUrl.isEmpty()) {
return null;
}
@@ -814,7 +814,7 @@ public ScmRepository getScmRepository(String scmUrl) {
* @see maven-scm-providers
*/
private static boolean isScmSystem(ScmRepository scmRepository, String scmProvider) {
- if (StringUtils.isEmpty(scmProvider)) {
+ if (scmProvider == null || scmProvider.isEmpty()) {
return false;
}
diff --git a/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java b/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java
index e1c420e2..7e78e513 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/SummaryReport.java
@@ -170,7 +170,7 @@ private void tableRowWithLink(String[] content) {
sink.tableCell();
- if (StringUtils.isEmpty(cell)) {
+ if (cell == null || cell.isEmpty()) {
sink.text("-");
} else if (ctr == content.length - 1 && cell.length() > 0) {
sink.link(cell);
diff --git a/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java b/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java
index 1eefe5ea..e5e4431f 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/TeamReport.java
@@ -215,10 +215,10 @@ private void renderTeamMember(Contributor member, Map headersMa
if (headersMap.get(IMAGE) == Boolean.TRUE && showAvatarImages) {
Properties properties = member.getProperties();
String picUrl = properties.getProperty("picUrl");
- if (StringUtils.isEmpty(picUrl)) {
+ if (picUrl == null || picUrl.isEmpty()) {
picUrl = getGravatarUrl(member.getEmail());
}
- if (StringUtils.isEmpty(picUrl)) {
+ if (picUrl == null || picUrl.isEmpty()) {
picUrl = getSpacerGravatarUrl();
}
sink.tableCell();
@@ -498,7 +498,7 @@ private static Map checkRequiredHeaders(List extends Contribu
private void tableCellForUrl(String url) {
sink.tableCell();
- if (StringUtils.isEmpty(url)) {
+ if (url == null || url.isEmpty()) {
text(url);
} else {
link(url, url);
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
index c846c844..380a049b 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
@@ -695,9 +695,9 @@ private void renderDependenciesForScope(String scope, List artifacts,
// can't use straight artifact comparison because we want optional last
Collections.sort(artifacts, getArtifactComparator());
- String anchorByScope = (isTransitive
+ String anchorByScope = isTransitive
? getI18nString("transitive.title") + "_" + scope
- : getI18nString("title") + "_" + scope);
+ : getI18nString("title") + "_" + scope;
startSection(scope, anchorByScope);
paragraph(getI18nString("intro." + scope));
@@ -861,14 +861,14 @@ private void printDescriptionsAndURLs(DependencyNode node, String uid) {
sink.bold();
sink.text(getI18nString("column.description") + ": ");
sink.bold_();
- if (StringUtils.isNotEmpty(artifactDescription)) {
+ if (artifactDescription != null && !artifactDescription.isEmpty()) {
sink.text(artifactDescription);
} else {
sink.text(getI18nString("index", "nodescription"));
}
sink.paragraph_();
- if (StringUtils.isNotEmpty(artifactUrl)) {
+ if (artifactUrl != null && !artifactUrl.isEmpty()) {
sink.paragraph();
sink.bold();
sink.text(getI18nString("column.url") + ": ");
@@ -896,7 +896,7 @@ private void printDescriptionsAndURLs(DependencyNode node, String uid) {
if (licenseMappings != null && licenseMappings.containsKey(licenseName)) {
licenseName = licenseMappings.get(licenseName);
}
- if (StringUtils.isEmpty(licenseName)) {
+ if (licenseName == null || licenseName.isEmpty()) {
licenseName = getI18nString("unnamed");
}
@@ -979,7 +979,7 @@ private void printDescriptionsAndURLs(DependencyNode node, String uid) {
private void printGroupedLicenses() {
for (Map.Entry entry : licenseMap.entrySet()) {
String licenseName = entry.getKey();
- if (StringUtils.isEmpty(licenseName)) {
+ if (licenseName == null || licenseName.isEmpty()) {
licenseName = getI18nString("unnamed");
}
@@ -1127,7 +1127,7 @@ public StringBuffer format(long fs, StringBuffer result, FieldPosition fieldPosi
return result;
}
- result = super.format((float) fs / (1000), result, fieldPosition);
+ result = super.format((float) fs / 1000, result, fieldPosition);
result.append(" ").append(getString("report.dependencies.file.details.column.size.kb"));
return result;
}
diff --git a/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java b/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
index f1154188..a7aa2391 100644
--- a/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
+++ b/src/test/java/org/apache/maven/report/projectinfo/AbstractProjectInfoTestCase.java
@@ -32,7 +32,6 @@
import org.apache.maven.project.ProjectBuildingRequest;
import org.apache.maven.report.projectinfo.stubs.DependencyArtifactStubFactory;
import org.codehaus.plexus.i18n.I18N;
-import org.codehaus.plexus.util.StringUtils;
import org.eclipse.aether.DefaultRepositorySystemSession;
import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory;
import org.eclipse.aether.repository.LocalRepository;
@@ -89,7 +88,7 @@ protected void tearDown() throws Exception {
* @return the string for the given key
*/
protected String getString(String key) {
- if (StringUtils.isEmpty(key)) {
+ if (key == null || key.isEmpty()) {
throw new IllegalArgumentException("The key cannot be empty");
}
@@ -105,11 +104,11 @@ protected String getString(String key) {
* @since 2.8
*/
protected String prepareTitle(String name, String title) {
- if (StringUtils.isEmpty(name)) {
+ if (name == null || name.isEmpty()) {
throw new IllegalArgumentException("The name cannot be empty");
}
- if (StringUtils.isEmpty(title)) {
+ if (title == null || title.isEmpty()) {
throw new IllegalArgumentException("The title cannot be empty");
}