Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MNG-6829] Replace StringUtils#isEmpty(String) and #isNotEmpty(String) #189

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
return;
}

if (StringUtils.isEmpty(encoding)) {
if (encoding == null || encoding.isEmpty()) {
getLog().warn("File encoding has not been set, using platform encoding " + ReaderFactory.FILE_ENCODING
+ ", i.e. build is platform dependent!");
}
Expand Down Expand Up @@ -1477,7 +1477,7 @@ private CharSequence resolveExternalJreVersion() {
private File interpolatePomFile(File pomFile, File basedir) throws MojoExecutionException {
File interpolatedPomFile = null;
if (pomFile != null) {
if (StringUtils.isNotEmpty(filteredPomPrefix)) {
if (filteredPomPrefix != null && !filteredPomPrefix.isEmpty()) {
interpolatedPomFile = new File(basedir, filteredPomPrefix + pomFile.getName());
buildInterpolatedFile(pomFile, interpolatedPomFile);
} else {
Expand Down Expand Up @@ -1640,7 +1640,7 @@ private MessageBuilder pad(BuildJob buildJob) {
* @param interpolatedPomFile The interpolated pom file.
*/
private void deleteInterpolatedPomFile(File interpolatedPomFile) {
if (interpolatedPomFile != null && StringUtils.isNotEmpty(filteredPomPrefix)) {
if (interpolatedPomFile != null && (filteredPomPrefix != null && !filteredPomPrefix.isEmpty())) {
interpolatedPomFile.delete();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import java.util.List;
import java.util.Locale;

import org.apache.commons.lang3.StringUtils;
import org.apache.maven.doxia.sink.Sink;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.Mojo;
Expand Down Expand Up @@ -260,8 +259,8 @@ private void renderBuildJob(BuildJob buildJob) {
private String getBuildJobReportName(BuildJob buildJob) {
String buildJobName = buildJob.getName();
String buildJobDescription = buildJob.getDescription();
boolean emptyJobName = StringUtils.isEmpty(buildJobName);
boolean emptyJobDescription = StringUtils.isEmpty(buildJobDescription);
boolean emptyJobName = buildJobName == null || buildJobName.isEmpty();
boolean emptyJobDescription = buildJobDescription == null || buildJobDescription.isEmpty();
boolean isReportJobNameComplete = !emptyJobName && !emptyJobDescription;
if (isReportJobNameComplete) {
return getFormattedName(buildJobName, buildJobDescription);
Expand Down