You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ni...@apache.org on 2005/11/27 20:29:33 UTC

svn commit: r349286 - /struts/action/trunk/src/java/org/apache/struts/util/DynaBeanInterceptor.java

Author: niallp
Date: Sun Nov 27 11:29:27 2005
New Revision: 349286

URL: http://svn.apache.org/viewcvs?rev=349286&view=rev
Log:
Correct bug in CGLib Enhanced DynaActionForm indexed properties

Modified:
    struts/action/trunk/src/java/org/apache/struts/util/DynaBeanInterceptor.java

Modified: struts/action/trunk/src/java/org/apache/struts/util/DynaBeanInterceptor.java
URL: http://svn.apache.org/viewcvs/struts/action/trunk/src/java/org/apache/struts/util/DynaBeanInterceptor.java?rev=349286&r1=349285&r2=349286&view=diff
==============================================================================
--- struts/action/trunk/src/java/org/apache/struts/util/DynaBeanInterceptor.java (original)
+++ struts/action/trunk/src/java/org/apache/struts/util/DynaBeanInterceptor.java Sun Nov 27 11:29:27 2005
@@ -108,10 +108,10 @@
 
                 // Create the indexed getter/setter method pair
                 if (dynaProperties[i].isIndexed()) {
-                    Type itype = Type.getType(Integer.class);
+                    Type itype = Type.getType(Integer.TYPE);
                     ttype = Type.getType((type.isArray() ? type.getComponentType() : Object.class));
                     Signature indexGetter = new Signature(getterName, ttype, new Type[] { itype });
-                    Signature indexSetter = new Signature(setterName, Type.VOID_TYPE, new Type[] { ttype, itype });
+                    Signature indexSetter = new Signature(setterName, Type.VOID_TYPE, new Type[] { itype, ttype });
                     im.add(indexGetter, Constants.TYPES_EMPTY);
                     im.add(indexSetter, Constants.TYPES_EMPTY);
                 }
@@ -166,9 +166,9 @@
             if (args.length == 1) {
                 dynaBean.set(property, args[0]);
                 return null;
-            } else if(args.length == 2 && args[1].getClass() == Integer.class) {
-                int index = ((Integer)args[1]).intValue();
-                dynaBean.set(property, index, args[0]);
+            } else if(args.length == 2 && args[0].getClass() == Integer.class) {
+                int index = ((Integer)args[0]).intValue();
+                dynaBean.set(property, index, args[1]);
                 return null;
             } else {
                 return proxy.invokeSuper(obj, args);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org