< prev index next >

src/java.xml/share/classes/jdk/xml/internal/JdkXmlFeatures.java

Print this page
rev 52881 : 8214971: Replace use of string.equals("") with isEmpty()
Reviewed-by: jlaskey, prappo, lancea, dfuchs, redestad

@@ -381,17 +381,17 @@
      * @return true if the system property is found, false otherwise
      */
     private boolean getSystemProperty(XmlFeature feature, String sysPropertyName) {
         try {
             String value = SecuritySupport.getSystemProperty(sysPropertyName);
-            if (value != null && !value.equals("")) {
+            if (value != null && !value.isEmpty()) {
                 setFeature(feature, State.SYSTEMPROPERTY, Boolean.parseBoolean(value));
                 return true;
             }
 
             value = SecuritySupport.readJAXPProperty(sysPropertyName);
-            if (value != null && !value.equals("")) {
+            if (value != null && !value.isEmpty()) {
                 setFeature(feature, State.JAXPDOTPROPERTIES, Boolean.parseBoolean(value));
                 return true;
             }
         } catch (NumberFormatException e) {
             //invalid setting
< prev index next >