You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by rd...@apache.org on 2003/05/06 13:32:23 UTC
cvs commit: jakarta-commons/beanutils/src/java/org/apache/commons/beanutils BeanUtilsBean.java ConvertUtilsBean.java PropertyUtilsBean.java
rdonkin 2003/05/06 04:32:23
Modified: beanutils build.xml
beanutils/src/java/org/apache/commons/beanutils
BeanUtilsBean.java ConvertUtilsBean.java
PropertyUtilsBean.java
Log:
Rolled back last commit. Accidentally committed everything in commons when I just wanted to commit docs and xdocs. Doh!
Revision Changes Path
1.54 +1 -11 jakarta-commons/beanutils/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-commons/beanutils/build.xml,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- build.xml 6 May 2003 10:23:59 -0000 1.53
+++ build.xml 6 May 2003 11:32:23 -0000 1.54
@@ -263,8 +263,7 @@
test.dyna.row,
test.bean.comparator,
test.locale.convert,
- test.converters,
- test.beanification
+ test.converters
"
description="Run all unit test cases">
</target>
@@ -462,15 +461,6 @@
<sysproperty key="org.apache.commons.logging.simplelog.defaultlog"
value="${test.level}"/>
<arg value="org.apache.commons.beanutils.converters.ConverterTestSuite"/>
- <classpath refid="test.classpath"/>
- </java>
- </target>
-
- <target name="test.beanification" depends="compile.tests">
- <echo message="Running Beanification tests ..."/>
- <java classname="${test.runner}" fork="yes"
- failonerror="${test.failonerror}">
- <arg value="org.apache.commons.beanutils.BeanificationTestCase"/>
<classpath refid="test.classpath"/>
</java>
</target>
1.6 +4 -27 jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BeanUtilsBean.java
Index: BeanUtilsBean.java
===================================================================
RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/BeanUtilsBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- BeanUtilsBean.java 6 May 2003 10:24:00 -0000 1.5
+++ BeanUtilsBean.java 6 May 2003 11:32:23 -0000 1.6
@@ -73,7 +73,6 @@
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
-import java.util.WeakHashMap;
import org.apache.commons.collections.FastHashMap;
import org.apache.commons.logging.Log;
@@ -105,30 +104,8 @@
/** Singleton instance */
private static final BeanUtilsBean singleton = new BeanUtilsBean();
-
- private static final Map beansByClassLoader = new WeakHashMap();
-
- /** Basic factory method */
- protected synchronized static BeanUtilsBean getInstance() {
- // synchronizing the method guarentees nothing will go wrong
- try {
-
- ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
- if (contextClassLoader != null) {
- BeanUtilsBean instance
- = (BeanUtilsBean) beansByClassLoader.get(contextClassLoader);
-
- if (instance == null) {
- instance = new BeanUtilsBean();
- beansByClassLoader.put(contextClassLoader, instance);
- }
- System.out.println("Returning: " + instance);
- return instance;
- }
-
- } catch (SecurityException e) { /* SWALLOW - should we log this? */ }
-
- // if in doubt, return the basic
+ /** Basic factory method*/
+ protected static BeanUtilsBean getInstance() {
return singleton;
}
@@ -148,11 +125,11 @@
// --------------------------------------------------------- Constuctors
/**
- * <p>Constructs an instance using new property
+ * <p>Constructs an instance using standard (singleton) property
* and conversion instances.</p>
*/
public BeanUtilsBean() {
- this(new ConvertUtilsBean(), new PropertyUtilsBean());
+ this(ConvertUtilsBean.getInstance(),PropertyUtilsBean.getInstance());
}
/**
1.6 +5 -1 jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java
Index: ConvertUtilsBean.java
===================================================================
RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/ConvertUtilsBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ConvertUtilsBean.java 6 May 2003 10:24:00 -0000 1.5
+++ ConvertUtilsBean.java 6 May 2003 11:32:23 -0000 1.6
@@ -154,10 +154,14 @@
public class ConvertUtilsBean {
+ // ------------------------------------------------------- Class Variables
+ /** Default singleton */
+ private static final ConvertUtilsBean singleton = new ConvertUtilsBean();
+
// ------------------------------------------------------- Class Methods
/** Get singleton instance */
protected static ConvertUtilsBean getInstance() {
- return BeanUtilsBean.getInstance().getConvertUtils();
+ return singleton;
}
// ------------------------------------------------------- Variables
1.6 +2 -1 jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java
Index: PropertyUtilsBean.java
===================================================================
RCS file: /home/cvs/jakarta-commons/beanutils/src/java/org/apache/commons/beanutils/PropertyUtilsBean.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PropertyUtilsBean.java 6 May 2003 10:24:00 -0000 1.5
+++ PropertyUtilsBean.java 6 May 2003 11:32:23 -0000 1.6
@@ -143,8 +143,9 @@
// --------------------------------------------------------- Class Methods
+ private static final PropertyUtilsBean singleton = new PropertyUtilsBean();
protected static PropertyUtilsBean getInstance() {
- return BeanUtilsBean.getInstance().getPropertyUtils();
+ return singleton;
}
// --------------------------------------------------------- Variables
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org