niallp 2004/06/08 17:25:15 Modified: src/share/org/apache/struts/action DynaActionFormClass.java ActionServlet.java Log: Changes for bug 28668/22207 Revision Changes Path 1.19 +10 -60 jakarta-struts/src/share/org/apache/struts/action/DynaActionFormClass.java Index: DynaActionFormClass.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/DynaActionFormClass.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- DynaActionFormClass.java 8 Apr 2004 22:07:56 -0000 1.18 +++ DynaActionFormClass.java 9 Jun 2004 00:25:15 -0000 1.19 @@ -65,7 +65,7 @@ * specified in the configuration is not DynaActionForm (or a subclass * of DynaActionForm) */ - private DynaActionFormClass(FormBeanConfig config) { + public DynaActionFormClass(FormBeanConfig config) { introspect(config); @@ -109,23 +109,6 @@ protected HashMap propertiesMap = new HashMap(); - // ------------------------------------------------------- Static Variables - - - /** - * <p>The set of <code>DynaActionFormClass</code> instances that have - * ever been created, keyed by the form bean name.</p> - */ - protected transient static HashMap dynaClasses = new HashMap(); - - - /** - * <p>The lockable object we can synchronize on, even if dynaClasses - * is null.</p> - */ - protected static String lock = ""; - - // ------------------------------------------------------ DynaClass Methods @@ -235,53 +218,20 @@ /** - * <p>Clear our cache of <code>DynaActionFormClass</code> instances.</p> + * @deprecated No longer need to Clear our cache of <code>DynaActionFormClass</code> instances. */ public static void clear() { - - synchronized (lock) { - if (dynaClasses == null) { - dynaClasses = new HashMap(); - } - dynaClasses.clear(); - } - } /** - * <p>Create (if necessary) and return a new - * <code>DynaActionFormClass</code> instance for the specified form bean - * configuration instance.</p> - * - * @param config The FormBeanConfig instance describing the properties - * of the bean to be created - * @param moduleConfig The ModuleConfig instance containing all the - * configuration information for the current module - * - * @exception IllegalArgumentException if the bean implementation class - * specified in the configuration is not DynaActionForm (or a subclass - * of DynaActionForm) + * Return the <code>DynaActionFormClass</code> instance for the specified form bean + * configuration instance. */ public static DynaActionFormClass - createDynaActionFormClass(FormBeanConfig config, ModuleConfig moduleConfig) { + createDynaActionFormClass(FormBeanConfig config) { - synchronized (lock) { - if (dynaClasses == null) { - dynaClasses = new HashMap(); - } - String key = config.getName(); - if (moduleConfig != null) { - key += moduleConfig.getPrefix(); - } - DynaActionFormClass dynaClass = - (DynaActionFormClass) dynaClasses.get(key); - if (dynaClass == null) { - dynaClass = new DynaActionFormClass(config); - dynaClasses.put(key, dynaClass); - } - return (dynaClass); - } + return config.getDynaActionFormClass(); } 1.177 +5 -5 jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java Index: ActionServlet.java =================================================================== RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/ActionServlet.java,v retrieving revision 1.176 retrieving revision 1.177 diff -u -r1.176 -r1.177 --- ActionServlet.java 24 Apr 2004 05:13:28 -0000 1.176 +++ ActionServlet.java 9 Jun 2004 00:25:15 -0000 1.177 @@ -679,7 +679,7 @@ FormBeanConfig fbs[] = config.findFormBeanConfigs(); for (int i = 0; i < fbs.length; i++) { if (fbs[i].getDynamic()) { - DynaActionFormClass.createDynaActionFormClass(fbs[i], config); + fbs[i].getDynaActionFormClass(); } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]