You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-cvs@xml.apache.org by mr...@apache.org on 2008/11/10 03:31:31 UTC

svn commit: r712602 - /xml/commons/trunk/java/src/org/apache/xml/resolver/CatalogManager.java

Author: mrglavas
Date: Sun Nov  9 18:31:31 2008
New Revision: 712602

URL: http://svn.apache.org/viewvc?rev=712602&view=rev
Log:
Eliminating unnecessary object creation. Always use the 
constants instead of creating new instances of Boolean.

Modified:
    xml/commons/trunk/java/src/org/apache/xml/resolver/CatalogManager.java

Modified: xml/commons/trunk/java/src/org/apache/xml/resolver/CatalogManager.java
URL: http://svn.apache.org/viewvc/xml/commons/trunk/java/src/org/apache/xml/resolver/CatalogManager.java?rev=712602&r1=712601&r2=712602&view=diff
==============================================================================
--- xml/commons/trunk/java/src/org/apache/xml/resolver/CatalogManager.java (original)
+++ xml/commons/trunk/java/src/org/apache/xml/resolver/CatalogManager.java Sun Nov  9 18:31:31 2008
@@ -443,7 +443,7 @@
    */
   public boolean getRelativeCatalogs () {
     if (relativeCatalogs == null) {
-      relativeCatalogs = new Boolean(queryRelativeCatalogs());
+      relativeCatalogs = queryRelativeCatalogs() ? Boolean.TRUE : Boolean.FALSE;
     }
 
     return relativeCatalogs.booleanValue();
@@ -455,7 +455,7 @@
    * @see #getRelativeCatalogs()
    */
   public void setRelativeCatalogs (boolean relative) {
-    relativeCatalogs = new Boolean(relative);
+    relativeCatalogs = relative ? Boolean.TRUE : Boolean.FALSE;
   }
 
   /**
@@ -584,7 +584,7 @@
    */
   public boolean getPreferPublic () {
     if (preferPublic == null) {
-      preferPublic = new Boolean(queryPreferPublic());
+      preferPublic = queryPreferPublic() ? Boolean.TRUE : Boolean.FALSE;
     }
     return preferPublic.booleanValue();
   }
@@ -593,7 +593,7 @@
    * Set the prefer public setting.
    */
   public void setPreferPublic (boolean preferPublic) {
-    this.preferPublic = new Boolean(preferPublic);
+    this.preferPublic = preferPublic ? Boolean.TRUE : Boolean.FALSE;
   }
 
   /**
@@ -643,7 +643,7 @@
    */
   public boolean getUseStaticCatalog() {
     if (useStaticCatalog == null) {
-      useStaticCatalog = new Boolean(queryUseStaticCatalog());
+      useStaticCatalog = queryUseStaticCatalog() ? Boolean.TRUE : Boolean.FALSE;
     }
 
     return useStaticCatalog.booleanValue();
@@ -653,7 +653,7 @@
    * Set the use static catalog setting.
    */
   public void setUseStaticCatalog(boolean useStatic) {
-    useStaticCatalog = new Boolean(useStatic);
+    useStaticCatalog = useStatic ? Boolean.TRUE : Boolean.FALSE;
   }
 
   /**
@@ -674,7 +674,7 @@
     Catalog catalog = staticCatalog;
 
     if (useStaticCatalog == null) {
-      useStaticCatalog = new Boolean(getUseStaticCatalog());
+      useStaticCatalog = getUseStaticCatalog() ? Boolean.TRUE : Boolean.FALSE;
     }
 
     if (catalog == null || !useStaticCatalog.booleanValue()) {
@@ -725,7 +725,7 @@
     Catalog catalog = staticCatalog;
 
     if (useStaticCatalog == null) {
-      useStaticCatalog = new Boolean(getUseStaticCatalog());
+      useStaticCatalog = getUseStaticCatalog() ? Boolean.TRUE : Boolean.FALSE;
     }
 
     if (catalog == null || !useStaticCatalog.booleanValue()) {
@@ -774,7 +774,7 @@
    */
   public boolean getAllowOasisXMLCatalogPI () {
     if (oasisXMLCatalogPI == null) {
-      oasisXMLCatalogPI = new Boolean(queryAllowOasisXMLCatalogPI());
+      oasisXMLCatalogPI = queryAllowOasisXMLCatalogPI() ? Boolean.TRUE : Boolean.FALSE;
     }
 
     return oasisXMLCatalogPI.booleanValue();
@@ -784,7 +784,7 @@
    * Set the XML Catalog PI setting
    */
   public void setAllowOasisXMLCatalogPI(boolean allowPI) {
-    oasisXMLCatalogPI = new Boolean(allowPI);
+    oasisXMLCatalogPI = allowPI ? Boolean.TRUE : Boolean.FALSE;
   }
 
   /**