Skip to content

Using Java 6 instead of Java 1 and custom code #31

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

Closed
wants to merge 2 commits into from
Closed
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
10 changes: 5 additions & 5 deletions src/main/java/org/codehaus/plexus/util/StringUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ public static String deleteWhitespace( String str )
*/
public static boolean isNotEmpty( String str )
{
return ( ( str != null ) && ( str.length() > 0 ) );
return ( ( str != null ) && ( !str.isEmpty() ) );
}

/**
Expand All @@ -174,7 +174,7 @@ public static boolean isNotEmpty( String str )
*/
public static boolean isEmpty( String str )
{
return ( ( str == null ) || ( str.trim().length() == 0 ) );
return ( ( str == null ) || ( str.trim().isEmpty() ) );
}

/**
Expand Down Expand Up @@ -828,7 +828,7 @@ public static String replace( String text, String repl, String with, int max )
*/
public static String overlayString( String text, String overlay, int start, int end )
{
return new StringBuffer( start + overlay.length() + text.length() - end + 1 )
return new StringBuilder( start + overlay.length() + text.length() - end + 1 )
.append( text, 0, start )
.append( overlay )
.append( text, end, text.length() )
Expand Down Expand Up @@ -1475,7 +1475,7 @@ else if ( str.length() == 0 )
}
else
{
return new StringBuffer( str.length() )
return new StringBuilder( str.length() )
.append( Character.toLowerCase( str.charAt( 0 ) ) )
.append( str, 1, str.length() )
.toString();
Expand Down Expand Up @@ -1971,7 +1971,7 @@ public static String reverse( String str )
{
return null;
}
return new StringBuffer( str ).reverse().toString();
return new StringBuilder( str ).reverse().toString();
}

/**
Expand Down