< prev index next >

src/java.xml/share/classes/javax/xml/catalog/Util.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()


 204                             }
 205                         } else {
 206                             return true;
 207                         }
 208                         break;
 209                 }
 210             }
 211         }
 212         return false;
 213     }
 214 
 215     /**
 216      * Find catalog file paths by reading the system property, and then
 217      * jaxp.properties if the system property is not specified.
 218      *
 219      * @param sysPropertyName the name of system property
 220      * @return the catalog file paths, or null if not found.
 221      */
 222     static String[] getCatalogFiles(String sysPropertyName) {
 223         String value = SecuritySupport.getJAXPSystemProperty(sysPropertyName);
 224         if (value != null && !value.equals("")) {
 225             return value.split(";");
 226         }
 227         return null;
 228     }
 229 
 230     /**
 231      * Checks whether the specified string is null or empty, returns the
 232      * original string with leading and trailing spaces removed if not.
 233      *
 234      * @param test the string to be tested
 235      * @return the original string with leading and trailing spaces removed, or
 236      * null if it is null or empty
 237      *
 238      */
 239     static String getNotNullOrEmpty(String test) {
 240         if (test == null) {
 241             return test;
 242         } else {
 243             String temp = test.trim();
 244             if (temp.length() == 0) {




 204                             }
 205                         } else {
 206                             return true;
 207                         }
 208                         break;
 209                 }
 210             }
 211         }
 212         return false;
 213     }
 214 
 215     /**
 216      * Find catalog file paths by reading the system property, and then
 217      * jaxp.properties if the system property is not specified.
 218      *
 219      * @param sysPropertyName the name of system property
 220      * @return the catalog file paths, or null if not found.
 221      */
 222     static String[] getCatalogFiles(String sysPropertyName) {
 223         String value = SecuritySupport.getJAXPSystemProperty(sysPropertyName);
 224         if (value != null && !value.isEmpty()) {
 225             return value.split(";");
 226         }
 227         return null;
 228     }
 229 
 230     /**
 231      * Checks whether the specified string is null or empty, returns the
 232      * original string with leading and trailing spaces removed if not.
 233      *
 234      * @param test the string to be tested
 235      * @return the original string with leading and trailing spaces removed, or
 236      * null if it is null or empty
 237      *
 238      */
 239     static String getNotNullOrEmpty(String test) {
 240         if (test == null) {
 241             return test;
 242         } else {
 243             String temp = test.trim();
 244             if (temp.length() == 0) {


< prev index next >