db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject svn commit: r524862 - /db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/ExceptionHelper.java
Date Mon, 02 Apr 2007 18:12:45 GMT
Author: arminw
Date: Mon Apr  2 11:12:44 2007
New Revision: 524862

URL: http://svn.apache.org/viewvc?view=rev&rev=524862
Log:
add try-catch

Modified:
    db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/ExceptionHelper.java

Modified: db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/ExceptionHelper.java
URL: http://svn.apache.org/viewvc/db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/ExceptionHelper.java?view=diff&rev=524862&r1=524861&r2=524862
==============================================================================
--- db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/ExceptionHelper.java
(original)
+++ db/ojb/branches/OJB_1_0_RELEASE/src/java/org/apache/ojb/broker/util/ExceptionHelper.java
Mon Apr  2 11:12:44 2007
@@ -268,30 +268,37 @@
             msg.append(eol).append("Target class is '")
                     .append(cld.getClassNameOfObject())
                     .append("'");
-            FieldDescriptor[] fields = cld.getPkFields();
-            msg.append(eol).append("PK of the target object is [");
-            for(int i = 0; i < fields.length; i++)
+            try
             {
-                try
+                FieldDescriptor[] fields = cld.getPkFields();
+                msg.append(eol).append("PK of the target object is [");
+                for(int i = 0; i < fields.length; i++)
                 {
-                    if(i > 0) msg.append(", ");
-                    msg.append(fields[i].getPersistentField().getName());
-                    if(obj != null)
+                    try
                     {
-                        msg.append("=");
-                        msg.append(fields[i].getPersistentField().get(obj));
+                        if(i > 0) msg.append(", ");
+                        msg.append(fields[i].getPersistentField().getName());
+                        if(obj != null)
+                        {
+                            msg.append("=");
+                            msg.append(fields[i].getPersistentField().get(obj));
+                        }
+                        else
+                        {
+                            msg.append("=null");
+                        }
                     }
-                    else
+                    catch(Exception ignore)
                     {
-                        msg.append("=null");
+                        msg.append(" PK field build FAILED! ");
                     }
                 }
-                catch(Exception ignore)
-                {
-                    msg.append(" PK field build FAILED! ");
-                }
+                msg.append("]");
+            }
+            catch(Exception e)
+            {
+                // ignore
             }
-            msg.append("]");
         }
         if(values != null)
         {



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