You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by rm...@apache.org on 2014/04/05 11:24:59 UTC

svn commit: r1585031 - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy: AbstractProxyFactory.java InterceptorDecoratorProxyFactory.java NormalScopeProxyFactory.java SubclassProxyFactory.java

Author: rmannibucau
Date: Sat Apr  5 09:24:59 2014
New Revision: 1585031

URL: http://svn.apache.org/r1585031
Log:
OWB-944 asm 5 release - interfaces

Modified:
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
    openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java?rev=1585031&r1=1585030&r2=1585031&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/AbstractProxyFactory.java Sat Apr  5 09:24:59 2014
@@ -651,7 +651,7 @@ public abstract class AbstractProxyFacto
                 mv.visitVarInsn(getVarInsn(parameterType), index);
 
                 mv.visitMethodInsn(Opcodes.INVOKESTATIC, wrapperType, "valueOf",
-                        "(" + Type.getDescriptor(parameterType) + ")L" + wrapperType + ";");
+                        "(" + Type.getDescriptor(parameterType) + ")L" + wrapperType + ";", false);
                 mv.visitInsn(Opcodes.AASTORE);
 
                 if (Long.TYPE.equals(parameterType) || Double.TYPE.equals(parameterType))

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java?rev=1585031&r1=1585030&r2=1585031&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/InterceptorDecoratorProxyFactory.java Sat Apr  5 09:24:59 2014
@@ -265,7 +265,7 @@ public class InterceptorDecoratorProxyFa
         final MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
         mv.visitCode();
         mv.visitVarInsn(Opcodes.ALOAD, 0);
-        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, classFileName, "<init>", "()V");
+        mv.visitMethodInsn(Opcodes.INVOKESPECIAL, classFileName, "<init>", "()V", false);
 
         mv.visitVarInsn(Opcodes.ALOAD, 0);
         mv.visitInsn(Opcodes.ACONST_NULL);
@@ -334,7 +334,7 @@ public class InterceptorDecoratorProxyFa
             }
 
             final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
-            mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);
+            mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor, false);
 
             generateReturn(mv, delegatedMethod);
 
@@ -466,7 +466,7 @@ public class InterceptorDecoratorProxyFa
 
         // invoke the invocationHandler
         mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(InterceptorHandler.class), "invoke",
-                "(Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;");
+                "(Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;", true);
 
         // cast the result
         mv.visitTypeInsn(Opcodes.CHECKCAST, getCastType(returnType));
@@ -475,7 +475,7 @@ public class InterceptorDecoratorProxyFa
         {
             // get the primitive value
             mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, getWrapperType(returnType), getPrimitiveMethod(returnType),
-                    "()" + Type.getDescriptor(returnType));
+                    "()" + Type.getDescriptor(returnType), false);
         }
 
         // push return
@@ -506,9 +506,9 @@ public class InterceptorDecoratorProxyFa
                 mv.visitLdcInsn(Type.getType("L" + exceptionType.getCanonicalName().replace('.', '/') + ";"));
                 mv.visitVarInsn(Opcodes.ALOAD, length);
                 mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/reflect/InvocationTargetException", "getCause",
-                        "()Ljava/lang/Throwable;");
-                mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Object", "getClass", "()Ljava/lang/Class;");
-                mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z");
+                        "()Ljava/lang/Throwable;", false);
+                mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Object", "getClass", "()Ljava/lang/Class;", false);
+                mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Object", "equals", "(Ljava/lang/Object;)Z", false);
 
                 final Label l6 = new Label();
                 mv.visitJumpInsn(Opcodes.IFEQ, l6);
@@ -518,7 +518,7 @@ public class InterceptorDecoratorProxyFa
 
                 mv.visitVarInsn(Opcodes.ALOAD, length);
                 mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/reflect/InvocationTargetException", "getCause",
-                        "()Ljava/lang/Throwable;");
+                        "()Ljava/lang/Throwable;", false);
                 mv.visitTypeInsn(Opcodes.CHECKCAST, getCastType(exceptionType));
                 mv.visitInsn(Opcodes.ATHROW);
                 mv.visitLabel(l6);
@@ -529,7 +529,7 @@ public class InterceptorDecoratorProxyFa
                     mv.visitInsn(Opcodes.DUP);
                     mv.visitVarInsn(Opcodes.ALOAD, length);
                     mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "java/lang/reflect/UndeclaredThrowableException", "<init>",
-                            "(Ljava/lang/Throwable;)V");
+                            "(Ljava/lang/Throwable;)V", false);
                     mv.visitInsn(Opcodes.ATHROW);
                 }
             }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java?rev=1585031&r1=1585030&r2=1585031&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/NormalScopeProxyFactory.java Sat Apr  5 09:24:59 2014
@@ -324,7 +324,7 @@ public class NormalScopeProxyFactory ext
             final MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", descriptor, null, null);
             mv.visitCode();
             mv.visitVarInsn(Opcodes.ALOAD, 0);
-            mv.visitMethodInsn(Opcodes.INVOKESPECIAL, parentClassFileName, "<init>", descriptor);
+            mv.visitMethodInsn(Opcodes.INVOKESPECIAL, parentClassFileName, "<init>", descriptor, false);
 
             // the instance provider field
             mv.visitVarInsn(Opcodes.ALOAD, 0);
@@ -404,7 +404,7 @@ public class NormalScopeProxyFactory ext
             mv.visitFieldInsn(Opcodes.GETFIELD, proxyClassFileName, FIELD_INSTANCE_PROVIDER, Type.getDescriptor(Provider.class));
 
             // invoke the get() method on the Provider
-            mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Provider.class), "get", "()Ljava/lang/Object;");
+            mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Provider.class), "get", "()Ljava/lang/Object;", true);
 
             // and convert the Object to the target class type
             mv.visitTypeInsn(Opcodes.CHECKCAST, Type.getInternalName(classToProxy));
@@ -423,7 +423,7 @@ public class NormalScopeProxyFactory ext
             final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
             boolean interfaceMethod = Modifier.isInterface(delegatedMethod.getDeclaringClass().getModifiers());
             mv.visitMethodInsn(interfaceMethod ? Opcodes.INVOKEINTERFACE : Opcodes.INVOKEVIRTUAL,
-                               declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);
+                               declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor, interfaceMethod);
 
             generateReturn(mv, delegatedMethod);
 
@@ -464,7 +464,7 @@ public class NormalScopeProxyFactory ext
         mv.visitFieldInsn(Opcodes.GETFIELD, proxyClassFileName, FIELD_INSTANCE_PROVIDER, Type.getDescriptor(Provider.class));
 
         // invoke the get() method on the Provider
-        mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Provider.class), "get", "()Ljava/lang/Object;");
+        mv.visitMethodInsn(Opcodes.INVOKEINTERFACE, Type.getInternalName(Provider.class), "get", "()Ljava/lang/Object;", true);
 
 
         // prepare the parameter array as Object[] and store it on the stack
@@ -473,7 +473,7 @@ public class NormalScopeProxyFactory ext
 
         // this invokes NormalScopeProxyFactory.delegateProtectedMethod
         mv.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(NormalScopeProxyFactory.class), "delegateProtectedMethod",
-                "(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;");
+                "(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;", false);
 
         // cast the result
         mv.visitTypeInsn(Opcodes.CHECKCAST, getCastType(returnType));
@@ -483,7 +483,7 @@ public class NormalScopeProxyFactory ext
         {
             // get the primitive value
             mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, getWrapperType(returnType), getPrimitiveMethod(returnType),
-                    "()" + Type.getDescriptor(returnType));
+                    "()" + Type.getDescriptor(returnType), false);
         }
 
         mv.visitInsn(getReturnInsn(returnType));

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java?rev=1585031&r1=1585030&r2=1585031&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/proxy/SubclassProxyFactory.java Sat Apr  5 09:24:59 2014
@@ -137,7 +137,7 @@ public class SubclassProxyFactory extend
             final MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", descriptor, null, null);
             mv.visitCode();
             mv.visitVarInsn(Opcodes.ALOAD, 0);
-            mv.visitMethodInsn(Opcodes.INVOKESPECIAL, parentClassFileName, "<init>", descriptor);
+            mv.visitMethodInsn(Opcodes.INVOKESPECIAL, parentClassFileName, "<init>", descriptor, false);
 
             mv.visitInsn(Opcodes.RETURN);
             mv.visitMaxs(-1, -1);
@@ -214,7 +214,7 @@ public class SubclassProxyFactory extend
             else
             {
                 // invoke the method on the super class;
-                mv.visitMethodInsn(Opcodes.INVOKESPECIAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);
+                mv.visitMethodInsn(Opcodes.INVOKESPECIAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor, false);
             }
 
             generateReturn(mv, delegatedMethod);