@@ -158,7 +158,7 @@ public static String deleteWhitespace( String str )
158
158
*/
159
159
public static boolean isNotEmpty ( String str )
160
160
{
161
- return ( ( str != null ) && ( str .length () > 0 ) );
161
+ return ( ( str != null ) && ( ! str .isEmpty () ) );
162
162
}
163
163
164
164
/**
@@ -174,7 +174,7 @@ public static boolean isNotEmpty( String str )
174
174
*/
175
175
public static boolean isEmpty ( String str )
176
176
{
177
- return ( ( str == null ) || ( str .trim ().length () == 0 ) );
177
+ return ( ( str == null ) || ( str .trim ().isEmpty () ) );
178
178
}
179
179
180
180
/**
@@ -828,7 +828,7 @@ public static String replace( String text, String repl, String with, int max )
828
828
*/
829
829
public static String overlayString ( String text , String overlay , int start , int end )
830
830
{
831
- return new StringBuffer ( start + overlay .length () + text .length () - end + 1 )
831
+ return new StringBuilder ( start + overlay .length () + text .length () - end + 1 )
832
832
.append ( text , 0 , start )
833
833
.append ( overlay )
834
834
.append ( text , end , text .length () )
@@ -1475,7 +1475,7 @@ else if ( str.length() == 0 )
1475
1475
}
1476
1476
else
1477
1477
{
1478
- return new StringBuffer ( str .length () )
1478
+ return new StringBuilder ( str .length () )
1479
1479
.append ( Character .toLowerCase ( str .charAt ( 0 ) ) )
1480
1480
.append ( str , 1 , str .length () )
1481
1481
.toString ();
@@ -1971,7 +1971,7 @@ public static String reverse( String str )
1971
1971
{
1972
1972
return null ;
1973
1973
}
1974
- return new StringBuffer ( str ).reverse ().toString ();
1974
+ return new StringBuilder ( str ).reverse ().toString ();
1975
1975
}
1976
1976
1977
1977
/**
0 commit comments