db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: jakarta-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess PersistentNestedFieldMaxPerformanceImpl.java PersistentFieldDefaultImpl.java
Date Tue, 24 Dec 2002 13:08:35 GMT
arminw      2002/12/24 05:08:35

  Modified:    src/java/org/apache/ojb/broker/metadata/fieldaccess
                        PersistentNestedFieldMaxPerformanceImpl.java
                        PersistentFieldDefaultImpl.java
  Log:
  code beautification
  
  Revision  Changes    Path
  1.4       +12 -13    jakarta-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentNestedFieldMaxPerformanceImpl.java
  
  Index: PersistentNestedFieldMaxPerformanceImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentNestedFieldMaxPerformanceImpl.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PersistentNestedFieldMaxPerformanceImpl.java	20 Dec 2002 01:53:31 -0000	1.3
  +++ PersistentNestedFieldMaxPerformanceImpl.java	24 Dec 2002 13:08:35 -0000	1.4
  @@ -1,11 +1,11 @@
   package org.apache.ojb.broker.metadata.fieldaccess;
   
  -import java.lang.reflect.Field;
  -
   import org.apache.ojb.broker.metadata.MetadataException;
   import org.apache.ojb.broker.util.logging.Logger;
   import org.apache.ojb.broker.util.logging.LoggerFactory;
   
  +import java.lang.reflect.Field;
  +
   /**
    *
    * This class supports using of nested attribute.
  @@ -14,11 +14,11 @@
    */
   public class PersistentNestedFieldMaxPerformanceImpl extends PersistentFieldMaxPerformanceImpl
   {
  +    private Logger logger = LoggerFactory.getLogger(PersistentNestedFieldMaxPerformanceImpl.class);
   
  +    public static final String PATH_TOKEN = "->";
       private String fieldName;
   
  -    private Logger logger = LoggerFactory.getLogger(this.getClass());
  -
       public PersistentNestedFieldMaxPerformanceImpl(Field f)
       {
           super(f);
  @@ -30,7 +30,6 @@
           this.fieldName = fieldname;
       }
   
  -    public static final String PATH_TOKEN = "->";
   
       /**
        * @see org.apache.ojb.broker.metadata.PersistentFieldMaxPerformanceImpl#getFieldRecursive(Class,
String)
  @@ -102,7 +101,7 @@
           {
               String name = fieldName.substring(0, index);
               PersistentFieldMaxPerformanceImpl pField =
  -                new PersistentFieldMaxPerformanceImpl(obj.getClass(), name);
  +                    new PersistentFieldMaxPerformanceImpl(obj.getClass(), name);
               Object attrib = pField.get(obj);
   
               if (attrib == null)
  @@ -114,17 +113,17 @@
                   catch (InstantiationException e)
                   {
                       throw new MetadataException(
  -                        "Error instantiate field:"
  +                            "Error instantiate field:"
                               + name
                               + " in object:"
                               + obj.getClass().getName(),
  -                        e);
  +                            e);
                   }
                   catch (IllegalAccessException e)
                   {
                       throw new MetadataException(
  -                        "Error getting field:" + name + " in object:" + obj.getClass().getName(),
  -                        e);
  +                            "Error getting field:" + name + " in object:" + obj.getClass().getName(),
  +                            e);
                   }
   
                   pField.set(obj, attrib);
  @@ -138,7 +137,7 @@
           {
   
               PersistentFieldMaxPerformanceImpl pField =
  -                new PersistentFieldMaxPerformanceImpl(obj.getClass(), fieldName);
  +                    new PersistentFieldMaxPerformanceImpl(obj.getClass(), fieldName);
               pField.set(obj, value);
           }
   
  @@ -159,7 +158,7 @@
           {
               String name = fieldName.substring(0, index);
               PersistentFieldMaxPerformanceImpl pField =
  -                new PersistentFieldMaxPerformanceImpl(obj.getClass(), name);
  +                    new PersistentFieldMaxPerformanceImpl(obj.getClass(), name);
               Object attrib = pField.get(obj);
   
               if (attrib != null)
  @@ -173,7 +172,7 @@
           {
   
               PersistentFieldMaxPerformanceImpl pField =
  -                new PersistentFieldMaxPerformanceImpl(obj.getClass(), fieldName);
  +                    new PersistentFieldMaxPerformanceImpl(obj.getClass(), fieldName);
               result = pField.get(obj);
           }
   
  
  
  
  1.14      +9 -9      jakarta-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDefaultImpl.java
  
  Index: PersistentFieldDefaultImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ojb/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDefaultImpl.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- PersistentFieldDefaultImpl.java	20 Dec 2002 21:49:00 -0000	1.13
  +++ PersistentFieldDefaultImpl.java	24 Dec 2002 13:08:35 -0000	1.14
  @@ -80,7 +80,7 @@
   
   	/**
   	 * Make the newInstace with no constructor call happy!
  -	 */ 
  +	 */
   	public PersistentFieldDefaultImpl()
   	{
   
  @@ -113,12 +113,12 @@
   		return getField().getDeclaringClass();
   	}
   
  -	/** 
  +	/**
   	 * Sets the field represented by this PersistentField object on the specified object argument
to the specified new value.
   	 * The new value is automatically unwrapped if the underlying field has a primitive type.
   	 * This implementation invokes set() on its underlying Field object if the argument <b>is
not null</b>.
   	 * OBS IllegalArgumentExceptions are wrapped as PersistenceBrokerExceptions.
  -	 * 
  +	 *
   	 * @throws MetadataException if there is an error setting this field value on obj
   	 * @see java.lang.reflect.Field
   	 */
  @@ -144,7 +144,7 @@
   			if ((value != null) || !type.isPrimitive())
   			{
   				f.set(ProxyHelper.getRealObject(obj), value);
  -			}	
  +			}
   		}
           catch (NullPointerException ignored)
           {
  @@ -195,7 +195,7 @@
   				"IllegalAccess error getting field:" + field.getName() + " in object:" + obj.getClass().getName(),
   				e);
   		}
  -        catch (Throwable e)
  +        catch (Exception e)
           {
               throw new MetadataException(
                   "Error getting field:" + field.getName() + " in object:" + obj.getClass().getName(),
  @@ -223,8 +223,8 @@
   		}
   		catch (NoSuchFieldException t)
   		{
  -			//             logger.error("Can't find member " 
  -			//                          + fieldname 
  +			//             logger.error("Can't find member "
  +			//                          + fieldname
   			//                          + " in "
   			//                          + c.getName() );
   			//             logger.error(t);
  @@ -274,7 +274,7 @@
   	}
   
   	/**
  -	 * 
  +	 *
   	 */
   	private class SetAccessibleAction implements PrivilegedAction, Serializable
   	{
  @@ -284,7 +284,7 @@
   			return null;
   		}
   	}
  -	
  +
   	public boolean usesAccessorsAndMutators()
   	{
   		return false;
  
  
  

Mime
View raw message