[seam-commits] Seam SVN: r14240 - branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/util.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Fri Oct 28 13:36:09 EDT 2011


Author: manaRH
Date: 2011-10-28 13:36:08 -0400 (Fri, 28 Oct 2011)
New Revision: 14240

Modified:
   branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/util/ProxyFactory.java
Log:
JBSEAM-4840 aplied JAVASSIST fix for JASSIST-66

Modified: branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/util/ProxyFactory.java
===================================================================
--- branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/util/ProxyFactory.java	2011-10-28 17:13:21 UTC (rev 14239)
+++ branches/community/Seam_2_3/jboss-seam/src/main/java/org/jboss/seam/util/ProxyFactory.java	2011-10-28 17:36:08 UTC (rev 14240)
@@ -860,6 +860,9 @@
         code.addGetstatic(thisClassName, HOLDER, HOLDER_TYPE);
         code.addAstore(arrayVar);
         code.addAload(arrayVar);
+        
+        callFind2Methods(code, meth.getName(), delegatorName, origIndex, desc, arrayVar);
+        /*
         code.addIconst(origIndex);
         code.addOpcode(Opcode.AALOAD);
         code.addOpcode(Opcode.IFNONNULL);
@@ -870,7 +873,7 @@
         callFindMethod(code, "findMethod", arrayVar, delIndex, delegatorName, desc);
 
         int pc2 = code.currentPc();
-        code.write16bit(pc, pc2 - pc + 1);
+        code.write16bit(pc, pc2 - pc + 1);*/
         code.addAload(0);
         code.addGetfield(thisClassName, HANDLER, HANDLER_TYPE);
         code.addAload(0);
@@ -893,10 +896,10 @@
 
         CodeAttribute ca = code.toCodeAttribute();
         forwarder.setCodeAttribute(ca);
-        StackMapTable.Writer writer = new StackMapTable.Writer(32);
+        /*StackMapTable.Writer writer = new StackMapTable.Writer(32);
         writer.appendFrame(pc2, new int[] { StackMapTable.OBJECT },
                            new int[] { cp.addClassInfo(HOLDER_TYPE) });
-        ca.setAttribute(writer.toStackMapTable(cp));
+        ca.setAttribute(writer.toStackMapTable(cp));*/
         return forwarder;
     }
 
@@ -995,6 +998,27 @@
         }
     }
 
+    private static void callFind2Methods(Bytecode code, String superMethod, String thisMethod,
+          int index, String desc, int arrayVar) 
+    {
+      String findClass = RuntimeSupport.class.getName();
+      String findDesc = "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/reflect/Method;)V";
+      code.addAload(0);
+      code.addLdc(superMethod);
+      if (thisMethod == null)
+      {
+         code.addOpcode(Opcode.ACONST_NULL);
+      }
+      else
+      {
+         code.addLdc(thisMethod);
+      }
+      code.addIconst(index);
+      code.addLdc(desc);
+      code.addAload(arrayVar);
+      code.addInvokestatic(findClass, "find2Methods", findDesc);
+   }
+
     private static int makeWrapper(Bytecode code, Class type, int regno) {
         int index = FactoryHelper.typeIndex(type);
         String wrapper = FactoryHelper.wrapperTypes[index]; 



More information about the seam-commits mailing list