You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by cl...@apache.org on 2007/12/04 17:56:11 UTC

svn commit: r600996 - in /db/jdo/trunk: api2-legacy/src/java/javax/jdo/spi/JDOImplHelper.java api2/src/java/javax/jdo/spi/JDOImplHelper.java

Author: clr
Date: Tue Dec  4 08:56:10 2007
New Revision: 600996

URL: http://svn.apache.org/viewvc?rev=600996&view=rev
Log:
JDO-499 Protect JDOImplHelper from errant implementations of StateInterrogation

Modified:
    db/jdo/trunk/api2-legacy/src/java/javax/jdo/spi/JDOImplHelper.java
    db/jdo/trunk/api2/src/java/javax/jdo/spi/JDOImplHelper.java

Modified: db/jdo/trunk/api2-legacy/src/java/javax/jdo/spi/JDOImplHelper.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2-legacy/src/java/javax/jdo/spi/JDOImplHelper.java?rev=600996&r1=600995&r2=600996&view=diff
==============================================================================
--- db/jdo/trunk/api2-legacy/src/java/javax/jdo/spi/JDOImplHelper.java (original)
+++ db/jdo/trunk/api2-legacy/src/java/javax/jdo/spi/JDOImplHelper.java Tue Dec  4 08:56:10 2007
@@ -980,7 +980,11 @@
         Iterator sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
             StateInterrogation si = (StateInterrogation)sit.next();
-            if (si.makeDirty(pc, fieldName)) return;
+            try {
+                if (si.makeDirty(pc, fieldName)) return;
+            } catch (Throwable t) {
+                continue; // ignore exceptions from errant StateInterrogations
+            }
         }
     }
     
@@ -1003,7 +1007,12 @@
         Iterator sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
             StateInterrogation si = (StateInterrogation)sit.next();
-            Boolean result = sibr.is(pc, si);
+            Boolean result;
+            try {
+                result = sibr.is(pc, si);
+            } catch (Throwable t) {
+                continue; // ignore exceptions from errant StateInterrogations
+            }
             if (result != null) return result.booleanValue();
         }
         return false;
@@ -1026,7 +1035,12 @@
         Iterator sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
             StateInterrogation si = (StateInterrogation)sit.next();
-            Object result = sibr.get(pc, si);
+            Object result;
+            try {
+                result = sibr.get(pc, si);
+            } catch (Throwable t) {
+                continue; // ignore exceptions from errant StateInterrogations
+            }
             if (result != null) return result;
         }
         return null;

Modified: db/jdo/trunk/api2/src/java/javax/jdo/spi/JDOImplHelper.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api2/src/java/javax/jdo/spi/JDOImplHelper.java?rev=600996&r1=600995&r2=600996&view=diff
==============================================================================
--- db/jdo/trunk/api2/src/java/javax/jdo/spi/JDOImplHelper.java (original)
+++ db/jdo/trunk/api2/src/java/javax/jdo/spi/JDOImplHelper.java Tue Dec  4 08:56:10 2007
@@ -980,7 +980,11 @@
         Iterator sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
             StateInterrogation si = (StateInterrogation)sit.next();
-            if (si.makeDirty(pc, fieldName)) return;
+            try {
+                if (si.makeDirty(pc, fieldName)) return;
+            } catch (Throwable t) {
+                continue; // ignore exceptions from errant StateInterrogations
+            }
         }
     }
     
@@ -1003,7 +1007,12 @@
         Iterator sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
             StateInterrogation si = (StateInterrogation)sit.next();
-            Boolean result = sibr.is(pc, si);
+            Boolean result;
+            try {
+                result = sibr.is(pc, si);
+            } catch (Throwable t) {
+                continue; // ignore exceptions from errant StateInterrogations
+            }
             if (result != null) return result.booleanValue();
         }
         return false;
@@ -1026,7 +1035,12 @@
         Iterator sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
             StateInterrogation si = (StateInterrogation)sit.next();
-            Object result = sibr.get(pc, si);
+            Object result;
+            try {
+                result = sibr.get(pc, si);
+            } catch (Throwable t) {
+                continue; // ignore exceptions from errant StateInterrogations
+            }
             if (result != null) return result;
         }
         return null;