From: Steve F. <sm...@us...> - 2002-10-27 22:29:26
|
Update of /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic In directory usw-pr-cvs1:/tmp/cvs-serv31168/src/core/com/mockobjects/dynamic Modified Files: Mock.java Log Message: introduced a couple of variables to remove duplication Index: Mock.java =================================================================== RCS file: /cvsroot/mockobjects/mockobjects-java/src/core/com/mockobjects/dynamic/Mock.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Mock.java 27 Oct 2002 11:45:59 -0000 1.4 +++ Mock.java 27 Oct 2002 22:29:23 -0000 1.5 @@ -99,9 +99,10 @@ * The call to be mocked. */ public void setup( ExpectedCall call ) { - _expectations.put( call.getMethodName(), call ); - _not_called_expectations.remove( call.getMethodName() ); - _called_methods.add( call.getMethodName() ); + String methodName = call.getMethodName(); + _expectations.put( methodName, call ); + _not_called_expectations.remove( methodName ); + _called_methods.add( methodName ); } /** @@ -157,9 +158,10 @@ * An object describing the expected call and mocking its behaviour. */ public void expect( ExpectedCall call ) { - _expectations.put( call.getMethodName(), call ); - _not_called_expectations.remove( call.getMethodName() ); - _called_methods.remove( call.getMethodName() ); + String methodName = call.getMethodName(); + _expectations.put( methodName, call ); + _not_called_expectations.remove( methodName ); + _called_methods.remove( methodName ); } /** |