db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r589924 - in /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess: PersistentFieldAutoProxyImpl.java PersistentFieldDirectImpl.java PersistentFieldDynaBeanImpl.java
Date Tue, 30 Oct 2007 01:21:21 GMT
Author: arminw
Date: Mon Oct 29 18:21:21 2007
New Revision: 589924

URL: http://svn.apache.org/viewvc?rev=589924&view=rev
Log:
minor improved log

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldAutoProxyImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDirectImpl.java
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDynaBeanImpl.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldAutoProxyImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldAutoProxyImpl.java?rev=589924&r1=589923&r2=589924&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldAutoProxyImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldAutoProxyImpl.java
Mon Oct 29 18:21:21 2007
@@ -75,7 +75,7 @@
                 index = 0;
                 currentPF = null;
                 String eol = SystemUtils.LINE_SEPARATOR;
-                throw new AutoDetectException(eol + "Can't autodetect valid PersistentField
implementation using "
+                throw new AutoDetectException(eol + "Field '" + getName() + "', can't autodetect
valid PersistentField implementation: "
                         + eol + ArrayUtils.toString(persistentFieldClasses)
                         + eol + "Last exception message was: "
                         + eol + latestException.message, latestException.exception);

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDirectImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDirectImpl.java?rev=589924&r1=589923&r2=589924&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDirectImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDirectImpl.java
Mon Oct 29 18:21:21 2007
@@ -25,6 +25,7 @@
 
 import org.apache.ojb.broker.metadata.MetadataException;
 import org.apache.ojb.broker.util.ClassHelper;
+import org.apache.ojb.broker.util.logging.Logger;
 
 /**
  * This {@link org.apache.ojb.broker.metadata.fieldaccess.PersistentField} implementation
@@ -195,6 +196,8 @@
         }
         catch (IllegalAccessException e)
         {
+            String msg = buildErrorGetMsg(target, field);
+            getLog().error(msg);
             throw new MetadataException(
                     "IllegalAccess error reading field: " +
                     (field != null ? field.getName() : null) + " from object: "
@@ -202,9 +205,12 @@
         }
         catch (IllegalArgumentException e)
         {
+            String msg = buildErrorGetMsg(target, field);
+            getLog().error(msg);
             throw new MetadataException(
                     "IllegalArgument error reading field: " +
-                    buildErrorGetMsg(target, field), e);
+                    (field != null ? field.getName() : null) + " from object: "
+                    + (target != null ? target.getClass().getName() : null), e);
         }
     }
 
@@ -227,15 +233,18 @@
         }
         catch (NullPointerException ignored)
         {
-            getLog().info("Target object '" + (target != null ? target.getClass().getName()
: null)
-                    + "' for field '" + (field != null ? field.getName() : null)
-                    + "' of type '" + (field != null ? field.getType().getName() : null)
-                    + "' seems to be null. Can't write into null.", ignored);
+            if(getLog().isEnabledFor(Logger.INFO))
+            {
+                getLog().info("Target object '" + (target != null ? target.getClass().getName()
: null)
+                        + "' for field '" + (field != null ? field.getName() : null)
+                        + "' of type '" + (field != null ? field.getType().getName() : null)
+                        + "' seems to be null. Can't write into null.", ignored);
+            }
         }
         catch (Exception e)
         {
             getLog().error("while set field: " + buildErrorSetMsg(target, value, field));
-            throw new MetadataException("IllegalAccess error setting field:" +
+            throw new MetadataException("Error setting field:" +
                     (field != null ? field.getName() : null) + " in object:" + target.getClass().getName(),
e);
         }
     }

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDynaBeanImpl.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDynaBeanImpl.java?rev=589924&r1=589923&r2=589924&view=diff
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDynaBeanImpl.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/metadata/fieldaccess/PersistentFieldDynaBeanImpl.java
Mon Oct 29 18:21:21 2007
@@ -136,7 +136,7 @@
     {
         String eol = SystemUtils.LINE_SEPARATOR;
         StringBuffer buf = new StringBuffer();
-        buf.append("Error in [set] operation: " + msg);
+        buf.append("Error in [set] operation: " + eol + "  " + msg);
         buf.append(eol + "  Property Name [" + getName() + "]");
         if (anObject instanceof DynaBean)
         {
@@ -165,7 +165,7 @@
     {
         String eol = SystemUtils.LINE_SEPARATOR;
         StringBuffer buf = new StringBuffer();
-        buf.append("Error in [get] operation: " + msg);
+        buf.append("Error in [get] operation: " + eol + "  " + msg);
         buf.append(eol + "  Property Name [" + getName() + "]");
         if (anObject instanceof DynaBean)
         {



---------------------------------------------------------------------
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