@@ -158,7 +158,7 @@ public static String deleteWhitespace( String str )
158158 */
159159 public static boolean isNotEmpty ( String str )
160160 {
161- return ( ( str != null ) && ( str .length () > 0 ) );
161+ return ( ( str != null ) && ( ! str .isEmpty () ) );
162162 }
163163
164164 /**
@@ -174,7 +174,7 @@ public static boolean isNotEmpty( String str )
174174 */
175175 public static boolean isEmpty ( String str )
176176 {
177- return ( ( str == null ) || ( str .trim ().length () == 0 ) );
177+ return ( ( str == null ) || ( str .trim ().isEmpty () ) );
178178 }
179179
180180 /**
@@ -828,7 +828,7 @@ public static String replace( String text, String repl, String with, int max )
828828 */
829829 public static String overlayString ( String text , String overlay , int start , int end )
830830 {
831- return new StringBuffer ( start + overlay .length () + text .length () - end + 1 )
831+ return new StringBuilder ( start + overlay .length () + text .length () - end + 1 )
832832 .append ( text , 0 , start )
833833 .append ( overlay )
834834 .append ( text , end , text .length () )
@@ -1475,7 +1475,7 @@ else if ( str.length() == 0 )
14751475 }
14761476 else
14771477 {
1478- return new StringBuffer ( str .length () )
1478+ return new StringBuilder ( str .length () )
14791479 .append ( Character .toLowerCase ( str .charAt ( 0 ) ) )
14801480 .append ( str , 1 , str .length () )
14811481 .toString ();
@@ -1971,7 +1971,7 @@ public static String reverse( String str )
19711971 {
19721972 return null ;
19731973 }
1974- return new StringBuffer ( str ).reverse ().toString ();
1974+ return new StringBuilder ( str ).reverse ().toString ();
19751975 }
19761976
19771977 /**
0 commit comments