You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2004/01/27 18:19:14 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/util ObjectFactory.java

mrglavas    2004/01/27 09:19:14

  Modified:    java/src/org/apache/xerces/util ObjectFactory.java
  Log:
  Reducing creation of short lived objects. The debug print
  method calls were creating instances of StringBuffer
  and String which are never read.
  
  Revision  Changes    Path
  1.14      +9 -9      xml-xerces/java/src/org/apache/xerces/util/ObjectFactory.java
  
  Index: ObjectFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/ObjectFactory.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ObjectFactory.java	19 Feb 2003 15:04:04 -0000	1.13
  +++ ObjectFactory.java	27 Jan 2004 17:19:13 -0000	1.14
  @@ -2,7 +2,7 @@
    * The Apache Software License, Version 1.1
    *
    *
  - * Copyright (c) 2001, 2002 The Apache Software Foundation.  All rights 
  + * Copyright (c) 2001-2004 The Apache Software Foundation.  All rights 
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -161,7 +161,7 @@
                                         String fallbackClassName)
           throws ConfigurationError
       {
  -        debugPrintln("debug is on");
  +        if (DEBUG) debugPrintln("debug is on");
   
           SecuritySupport ss = SecuritySupport.getInstance();
           ClassLoader cl = findClassLoader();
  @@ -170,7 +170,7 @@
           try {
               String systemProp = ss.getSystemProperty(factoryId);
               if (systemProp != null) {
  -                debugPrintln("found system property, value=" + systemProp);
  +                if (DEBUG) debugPrintln("found system property, value=" + systemProp);
                   return newInstance(systemProp, cl, true);
               }
           } catch (SecurityException se) {
  @@ -249,7 +249,7 @@
               }
           }
           if (factoryClassName != null) {
  -            debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName);
  +            if (DEBUG) debugPrintln("found in " + propertiesFilename + ", value=" + factoryClassName);
               return newInstance(factoryClassName, cl, true);
           }
   
  @@ -264,7 +264,7 @@
                   "Provider for " + factoryId + " cannot be found", null);
           }
   
  -        debugPrintln("using fallback, value=" + fallbackClassName);
  +        if (DEBUG) debugPrintln("using fallback, value=" + fallbackClassName);
           return newInstance(fallbackClassName, cl, true);
       } // createObject(String,String,String):Object
   
  @@ -350,7 +350,7 @@
           try{
               Class providerClass = findProviderClass(className, cl, doFallback);
               Object instance = providerClass.newInstance();
  -            debugPrintln("created new instance of " + providerClass +
  +            if (DEBUG) debugPrintln("created new instance of " + providerClass +
                      " using ClassLoader: " + cl);
               return instance;
           } catch (ClassNotFoundException x) {
  @@ -437,7 +437,7 @@
               return null;
           }
   
  -        debugPrintln("found jar resource=" + serviceId +
  +        if (DEBUG) debugPrintln("found jar resource=" + serviceId +
                  " using ClassLoader: " + cl);
   
           // Read the service provider name in UTF-8 as specified in
  @@ -476,7 +476,7 @@
   
           if (factoryClassName != null &&
               ! "".equals(factoryClassName)) {
  -            debugPrintln("found in resource, value="
  +            if (DEBUG) debugPrintln("found in resource, value="
                      + factoryClassName);
   
               // Note: here we do not want to fall back to the current
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org