Update of /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24795/input/javasrc/biz/xsoftware/mock2
Modified Files:
Tag: branchForOffice
MockObjectFactory.java
Log Message:
clean codes
Index: MockObjectFactory.java
===================================================================
RCS file: /cvsroot/mocklib/mocklib2/input/javasrc/biz/xsoftware/mock2/MockObjectFactory.java,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -C2 -d -r1.4.2.1 -r1.4.2.2
*** MockObjectFactory.java 14 Jan 2006 18:24:05 -0000 1.4.2.1
--- MockObjectFactory.java 15 Jan 2006 05:32:38 -0000 1.4.2.2
***************
*** 3,10 ****
- import biz.xsoftware.mock2.impl.MockObjectFactoryImpl;
-
-
-
/**
* The factory class that creates MockObjects
--- 3,6 ----
***************
*** 15,25 ****
public abstract class MockObjectFactory {
! private static MockObjectFactoryImpl instance=null;
private static MockObjectFactory singleton() {
! //fix this using reflection....
! if(instance==null){
! return new MockObjectFactoryImpl();
! }
! return instance;
}
--- 11,30 ----
public abstract class MockObjectFactory {
!
private static MockObjectFactory singleton() {
! //fix this using reflection.... ClassLoader cl=MockObjectFactory.class.getClassLoader();
! MockObjectFactory factory=null;
! try{
! String className="biz.xsoftware.mock2.MockObjectFactoryImpl";
! Class<? extends MockObjectFactory> c=Class.forName(className).asSubclass(MockObjectFactory.class);
! factory=c.newInstance();
! }catch(ClassNotFoundException e){
! throw new RuntimeException("create mockFactory failed", e);
! }catch(IllegalAccessException e){
! throw new RuntimeException("create mockFactory failed", e);
! }catch(InstantiationException e){
! throw new RuntimeException("create mockFactory failed", e);
! }
! return factory;
}
|