Update of /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/impl
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv20893/input/javasrc/biz/xsoftware/mock/impl
Modified Files:
MockSuperclass.java
Log Message:
fix everything but behavior.
Index: MockSuperclass.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/input/javasrc/biz/xsoftware/mock/impl/MockSuperclass.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MockSuperclass.java 10 Sep 2006 20:45:05 -0000 1.1
--- MockSuperclass.java 10 Sep 2006 20:50:19 -0000 1.2
***************
*** 222,232 ****
Action action = methodToDefaultRetVal.get(method);
List<Action> l = methodToReturnVal.get(method);
! if(l != null)
action = l.remove(0);
! if(l.size()<=0)
! methodToReturnVal.remove(method);
!
! return action.execute();
}
--- 222,236 ----
Action action = methodToDefaultRetVal.get(method);
List<Action> l = methodToReturnVal.get(method);
! if(l != null) {
action = l.remove(0);
+ //if that was the last one in the list, remove the list...
+ if(l.size()<=0)
+ methodToReturnVal.remove(method);
+ }
! if(action != null)
! return action.execute();
!
! return null;
}
|