db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess PersistentFieldAutoProxyImpl.java
Date Sat, 08 May 2004 08:45:01 GMT
tomdz       2004/05/08 01:45:01

  Modified:    src/java/org/apache/ojb/broker/metadata/fieldaccess
                        PersistentFieldAutoProxyImpl.java
  Log:
  Removed unused code and imports
  
  Revision  Changes    Path
  1.9       +1 -57     db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldAutoProxyImpl.java
  
  Index: PersistentFieldAutoProxyImpl.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldAutoProxyImpl.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- PersistentFieldAutoProxyImpl.java	7 May 2004 20:15:57 -0000	1.8
  +++ PersistentFieldAutoProxyImpl.java	8 May 2004 08:45:01 -0000	1.9
  @@ -15,14 +15,9 @@
    * limitations under the License.
    */
   
  -import java.lang.reflect.Field;
  -import java.util.Map;
  -
   import org.apache.commons.beanutils.DynaBean;
  -import org.apache.commons.collections.FastHashMap;
   import org.apache.ojb.broker.metadata.MetadataException;
   import org.apache.ojb.broker.util.ClassHelper;
  -import org.apache.ojb.broker.util.logging.LoggerFactory;
   
   /**
    * PeristentField implementation that attempts to detect the nature of
  @@ -42,27 +37,6 @@
       private boolean hasBeenDetermined = false;
       
       /**
  -     * Contains additional maps with name to PersistentFactory implementation Class
  -     * instances
  -     */
  -    private static Map classToName = new FastHashMap();
  -
  -    private static synchronized void addToCache(Class type, String name, Class pfClass)
  -    {
  -        Map nameToImpl = null;
  -        if (classToName.containsKey(type))
  -        {
  -            nameToImpl = (Map) classToName.get(type);
  -        }
  -        else
  -        {
  -            nameToImpl = new FastHashMap();
  -        }
  -        nameToImpl.put(name, pfClass);
  -    }
  -
  -
  -    /**
        * Being nice to Class.newInstance() seems popular.
        */
       public PersistentFieldAutoProxyImpl()
  @@ -144,36 +118,6 @@
       }
   
       /**
  -     * If it finds an implementation in the cache it will load it into the
  -     * wrapped field and return true.
  -     */
  -    private AbstractPersistentField tryLoadFromCache(Class type, String name)
  -    {
  -        if (classToName.containsKey(name))
  -        {
  -            Map nameToImpl = (Map) classToName.get(name);
  -            if (nameToImpl.containsKey(name))
  -            {
  -                Class[] types = { Class.class, String.class };
  -                Object[] args = { type, name };
  -                Class clazz = (Class) nameToImpl.get(type);
  -                try
  -                {
  -                    return (AbstractPersistentField)ClassHelper.newInstance(clazz, types,
args);
  -                }
  -                catch (Exception e2)
  -                {
  -                    LoggerFactory.getLogger(this.getClass()).warn(
  -                        "Unable to use cached PersistentField: " + clazz.getName(),
  -                        e2);
  -                    throw new MetadataException("Unable to use cached PersistentField:
", e2);
  -                }
  -            }
  -        }
  -        return null;
  -    }
  -
  -    /**
        * Returns the actual field handler. If none is determined yet, it first tries to
        * find one for the field.
        * 
  @@ -198,7 +142,7 @@
   
           try
           {
  -            Field field = AbstractPersistentField.computeField(rootObjectType, fieldName,
isNestedField(), false);
  +            AbstractPersistentField.computeField(rootObjectType, fieldName, isNestedField(),
false);
   
               wrapped           = getDirectImpl();
               hasBeenDetermined = true;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message