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) #187

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@

package com.example;

import org.codehaus.plexus.util.StringUtils;

public class Main
{
public static void main( String[] args ) {
System.out.println( "Hello World!" + ( isEmpty("foo") ? " is empty!" : " -- ") );
}

public static boolean isEmpty( String input ) {
return StringUtils.isEmpty( input );
return input == null || input.isEmpty();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import java.util.jar.JarOutputStream;

import org.apache.maven.plugins.shade.relocation.Relocator;
import org.codehaus.plexus.util.StringUtils;

/**
* Merges <code>META-INF/NOTICE.TXT</code> files.
Expand Down Expand Up @@ -106,7 +105,7 @@ public void processResource(String resource, InputStream is, List<Relocator> rel
}

BufferedReader reader;
if (StringUtils.isNotEmpty(encoding)) {
if (encoding != null && !encoding.isEmpty()) {
reader = new BufferedReader(new InputStreamReader(is, encoding));
} else {
reader = new BufferedReader(new InputStreamReader(is));
Expand Down Expand Up @@ -178,7 +177,7 @@ public void modifyOutputStream(JarOutputStream jos) throws IOException {
jos.putNextEntry(jarEntry);

Writer writer;
if (StringUtils.isNotEmpty(encoding)) {
if (encoding != null && !encoding.isEmpty()) {
writer = new OutputStreamWriter(jos, encoding);
} else {
writer = new OutputStreamWriter(jos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.jar.JarOutputStream;

import org.apache.maven.plugins.shade.relocation.Relocator;
import org.codehaus.plexus.util.StringUtils;

/**
* A resource processor that prevents the inclusion of an arbitrary
Expand All @@ -36,7 +35,7 @@ public class DontIncludeResourceTransformer extends AbstractCompatibilityTransfo
List<String> resources;

public boolean canTransformResource(String r) {
if (StringUtils.isNotEmpty(resource) && r.endsWith(resource)) {
if ((resource != null && !resource.isEmpty()) && r.endsWith(resource)) {
return true;
}

Expand Down