jon 02/04/30 16:49:48
Modified: src/java/org/apache/torque Torque.java
src/templates/om Object.vm ObjectWithManager.vm
Log:
Ah... I had assumed that all writes to that List would take place during
initialize(), but I see that isn't the case.
The attached a diff makes mapBuilders a synchronizedList and makes both
instances of fieldNames an unmodifiableList.
Jeff Schnitzer
[EMAIL PROTECTED]
Revision Changes Path
1.55 +3 -2 jakarta-turbine-torque/src/java/org/apache/torque/Torque.java
Index: Torque.java
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/Torque.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- Torque.java 29 Apr 2002 19:47:45 -0000 1.54
+++ Torque.java 30 Apr 2002 23:49:48 -0000 1.55
@@ -62,6 +62,7 @@
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Properties;
import org.apache.commons.lang.exception.NestableException;
import org.apache.log4j.Category;
@@ -90,7 +91,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">Jason van Zyl</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Rafal Krzewski</a>
* @author <a href="mailto:[EMAIL PROTECTED]">Martin Poeschl</a>
- * @version $Id: Torque.java,v 1.54 2002/04/29 19:47:45 jon Exp $
+ * @version $Id: Torque.java,v 1.55 2002/04/30 23:49:48 jon Exp $
*/
public class Torque implements Initializable, Configurable
{
@@ -166,7 +167,7 @@
* are serialized then unserialized prior to Torque being reinitialized.
* This condition exists in a normal catalina restart.
*/
- private static List mapBuilders = new ArrayList();
+ private static List mapBuilders = Collections.synchronizedList(new ArrayList());
/**
1.28 +1 -0 jakarta-turbine-torque/src/templates/om/Object.vm
Index: Object.vm
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/Object.vm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -r1.27 -r1.28
--- Object.vm 30 Apr 2002 18:52:14 -0000 1.27
+++ Object.vm 30 Apr 2002 23:49:48 -0000 1.28
@@ -650,6 +650,7 @@
#foreach ($col in $table.Columns)
fieldNames.add("${col.JavaName}");
#end
+ fieldNames = Collections.unmodifiableList(fieldNames);
}
return fieldNames;
}
1.7 +1 -0 jakarta-turbine-torque/src/templates/om/ObjectWithManager.vm
Index: ObjectWithManager.vm
===================================================================
RCS file: /home/cvs/jakarta-turbine-torque/src/templates/om/ObjectWithManager.vm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ObjectWithManager.vm 30 Apr 2002 18:55:33 -0000 1.6
+++ ObjectWithManager.vm 30 Apr 2002 23:49:48 -0000 1.7
@@ -657,6 +657,7 @@
#foreach ($col in $table.Columns)
fieldNames.add("${col.JavaName}");
#end
+ fieldNames = Collections.unmodifiableList(fieldNames);
}
return fieldNames;
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>