ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mr...@apache.org
Subject svn commit: r547755 - /incubator/ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java
Date Fri, 15 Jun 2007 18:23:29 GMT
Author: mriou
Date: Fri Jun 15 11:23:28 2007
New Revision: 547755

URL: http://svn.apache.org/viewvc?view=rev&rev=547755
Log:
Fixed a NPE in MockScheduler.

Modified:
    incubator/ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java

Modified: incubator/ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java
URL: http://svn.apache.org/viewvc/incubator/ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java?view=diff&rev=547755&r1=547754&r2=547755
==============================================================================
--- incubator/ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java (original)
+++ incubator/ode/trunk/bpel-epr/src/main/java/org/apache/ode/il/MockScheduler.java Fri Jun
15 11:23:28 2007
@@ -49,10 +49,13 @@
     private ThreadLocal<Boolean> _transacted = new ThreadLocal<Boolean>();
     private TransactionManager _txm;
 
-    public MockScheduler() { }
+    public MockScheduler() {
+        _transacted.set(false);
+    }
 
     public MockScheduler(TransactionManager txm) {
         _txm = txm;
+        _transacted.set(false);
     }
 
     ThreadLocal<List<Synchronizer>> _synchros = new ThreadLocal<List<Scheduler.Synchronizer>>()
{
@@ -65,7 +68,7 @@
     public String schedulePersistedJob(Map<String, Object> detail, Date date) throws
ContextException {
         if (date != null) {
             try {
-                while(new Date().before(date)) Thread.sleep(100);
+                while(new Date().before(date)) { Thread.sleep(100); }
             } catch (InterruptedException e) {
                 e.printStackTrace();
             }
@@ -174,8 +177,8 @@
             }
         } else {
             _synchros.get().clear();
-            _transacted.set(Boolean.TRUE);
         }
+        _transacted.set(Boolean.TRUE);
     }
 
     public void commit() {
@@ -199,8 +202,8 @@
                 }
 
             _synchros.get().clear();
-            _transacted.set(Boolean.FALSE);
         }
+        _transacted.set(Boolean.FALSE);
     }
 
     public void rollback() {
@@ -223,8 +226,8 @@
                 } catch (Throwable t) {
                 }
             _synchros.get().clear();
-            _transacted.set(Boolean.FALSE);
         }
+        _transacted.set(Boolean.FALSE);
     }
 
     private void doExecute(JobInfo ji) {



Mime
View raw message