< prev index next >

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

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


 602     }
 603 
 604     /**
 605      * Reads from system properties, or those in jaxp.properties
 606      */
 607     private void readSystemProperties() {
 608         for (Feature cf : Feature.values()) {
 609             getSystemProperty(cf, cf.getPropertyName());
 610         }
 611     }
 612 
 613     /**
 614      * Reads from system properties, or those in jaxp.properties
 615      *
 616      * @param cf the type of the property
 617      * @param sysPropertyName the name of system property
 618      */
 619     private boolean getSystemProperty(Feature cf, String sysPropertyName) {
 620         if (cf.hasSystemProperty()) {
 621             String value = SecuritySupport.getSystemProperty(sysPropertyName);
 622             if (value != null && !value.equals("")) {
 623                 setProperty(cf, State.SYSTEMPROPERTY, value);
 624                 return true;
 625             }
 626 
 627             value = SecuritySupport.readJAXPProperty(sysPropertyName);
 628             if (value != null && !value.equals("")) {
 629                 setProperty(cf, State.JAXPDOTPROPERTIES, value);
 630                 return true;
 631             }
 632         }
 633         return false;
 634     }
 635 
 636     /**
 637      * Returns an instance of the builder for creating the CatalogFeatures object.
 638      *
 639      * @return an instance of the builder
 640      */
 641     public static Builder builder() {
 642         return new CatalogFeatures.Builder();
 643     }
 644 
 645     /**
 646      * The Builder class for building the CatalogFeatures object.
 647      */
 648     public static class Builder {




 602     }
 603 
 604     /**
 605      * Reads from system properties, or those in jaxp.properties
 606      */
 607     private void readSystemProperties() {
 608         for (Feature cf : Feature.values()) {
 609             getSystemProperty(cf, cf.getPropertyName());
 610         }
 611     }
 612 
 613     /**
 614      * Reads from system properties, or those in jaxp.properties
 615      *
 616      * @param cf the type of the property
 617      * @param sysPropertyName the name of system property
 618      */
 619     private boolean getSystemProperty(Feature cf, String sysPropertyName) {
 620         if (cf.hasSystemProperty()) {
 621             String value = SecuritySupport.getSystemProperty(sysPropertyName);
 622             if (value != null && !value.isEmpty()) {
 623                 setProperty(cf, State.SYSTEMPROPERTY, value);
 624                 return true;
 625             }
 626 
 627             value = SecuritySupport.readJAXPProperty(sysPropertyName);
 628             if (value != null && !value.isEmpty()) {
 629                 setProperty(cf, State.JAXPDOTPROPERTIES, value);
 630                 return true;
 631             }
 632         }
 633         return false;
 634     }
 635 
 636     /**
 637      * Returns an instance of the builder for creating the CatalogFeatures object.
 638      *
 639      * @return an instance of the builder
 640      */
 641     public static Builder builder() {
 642         return new CatalogFeatures.Builder();
 643     }
 644 
 645     /**
 646      * The Builder class for building the CatalogFeatures object.
 647      */
 648     public static class Builder {


< prev index next >