Skip to content

Commit

Permalink
[MNG-6829] Replace StringUtils#isEmpty(String) and #isNotEmpty(String) (
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek and TeamModerne authored May 22, 2023
1 parent 4afec1d commit 401c229
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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

0 comments on commit 401c229

Please sign in to comment.