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 committed May 22, 2023
1 parent 472ed5a commit 9ebda63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import com.puppycrawl.tools.checkstyle.api.AuditListener;
import com.puppycrawl.tools.checkstyle.api.AutomaticBean.OutputStreamOptions;
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.model.Dependency;
Expand Down Expand Up @@ -602,7 +601,7 @@ private List<Artifact> getCheckstylePluginDependenciesAsArtifacts(Map<String, Pl
protected AuditListener getListener() throws MavenReportException {
AuditListener listener = null;

if (StringUtils.isNotEmpty(outputFileFormat)) {
if (outputFileFormat != null && !outputFileFormat.isEmpty()) {
File resultFile = outputFile;

OutputStream out = getOutputStream(resultFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import com.puppycrawl.tools.checkstyle.api.AuditListener;
import com.puppycrawl.tools.checkstyle.api.AutomaticBean.OutputStreamOptions;
import com.puppycrawl.tools.checkstyle.api.CheckstyleException;
import org.apache.commons.lang3.StringUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Plugin;
Expand Down Expand Up @@ -772,7 +771,7 @@ private OutputStream getOutputStream(File file) throws MojoExecutionException {
private AuditListener getListener() throws MojoFailureException, MojoExecutionException {
AuditListener listener = null;

if (StringUtils.isNotEmpty(outputFileFormat)) {
if (outputFileFormat != null && !outputFileFormat.isEmpty()) {
File resultFile = outputFile;

OutputStream out = getOutputStream(resultFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ private Properties getOverridingProperties(CheckstyleExecutorRequest request) th
getLogger().debug("headerLocation " + headerLocation);
}

if (StringUtils.isNotEmpty(headerLocation)) {
if (headerLocation != null && !headerLocation.isEmpty()) {
try {
File headerFile = licenseLocator.getResourceAsFile(headerLocation, "checkstyle-header.txt");

Expand Down Expand Up @@ -551,15 +551,15 @@ private void addResourceFilesToProcess(
if (resourcesDirectory.equals(request.getProject().getBasedir())) {
String resourceIncludes =
StringUtils.join(resource.getIncludes().iterator(), ",");
if (StringUtils.isEmpty(includes)) {
if (includes == null || includes.isEmpty()) {
includes = resourceIncludes;
} else {
includes += "," + resourceIncludes;
}

String resourceExcludes =
StringUtils.join(resource.getExcludes().iterator(), ",");
if (StringUtils.isEmpty(excludes)) {
if (excludes == null || excludes.isEmpty()) {
excludes = resourceExcludes;
} else {
excludes += "," + resourceExcludes;
Expand Down Expand Up @@ -594,7 +594,7 @@ private FilterSet getSuppressionsFilterSet(final String suppressionsFilePath) th

private String getSuppressionsFilePath(final CheckstyleExecutorRequest request) throws CheckstyleExecutorException {
final String suppressionsLocation = request.getSuppressionsLocation();
if (StringUtils.isEmpty(suppressionsLocation)) {
if (suppressionsLocation == null || suppressionsLocation.isEmpty()) {
return null;
}

Expand Down

0 comments on commit 9ebda63

Please sign in to comment.