< prev index next >

src/java.base/share/classes/java/net/URLDecoder.java

Print this page
rev 52979 : 8215281: Use String.isEmpty() when applicable in java.base
Reviewed-by: TBD

@@ -131,11 +131,11 @@
      *             named character encoding is not supported
      * @see URLEncoder#encode(java.lang.String, java.lang.String)
      * @since 1.4
      */
     public static String decode(String s, String enc) throws UnsupportedEncodingException {
-        if (enc.length() == 0) {
+        if (enc.isEmpty()) {
             throw new UnsupportedEncodingException ("URLDecoder: empty string enc parameter");
         }
 
         try {
             Charset charset = Charset.forName(enc);
< prev index next >