geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1486536 - in /geronimo/xbean/trunk: ./ xbean-finder-shaded/ xbean-finder/src/test/java/org/apache/xbean/finder/ xbean-reflect/ xbean-reflect/src/main/java/org/apache/xbean/asm4/ xbean-reflect/src/main/java/org/apache/xbean/asm4/original/ x...
Date Mon, 27 May 2013 08:23:08 GMT
Author: rmannibucau
Date: Mon May 27 08:23:07 2013
New Revision: 1486536

URL: http://svn.apache.org/r1486536
Log:
XBEAN-249 updating xbean to asm4 with a complete EmptyVisitor implementation

Added:
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/original/
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/original/EmptyVisitor.java
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/shade/
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/shade/EmptyVisitor.java
Modified:
    geronimo/xbean/trunk/pom.xml
    geronimo/xbean/trunk/xbean-finder-shaded/pom.xml
    geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassLoadersPerformancesTest.java
    geronimo/xbean/trunk/xbean-reflect/pom.xml
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java
    geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java

Modified: geronimo/xbean/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/pom.xml?rev=1486536&r1=1486535&r2=1486536&view=diff
==============================================================================
--- geronimo/xbean/trunk/pom.xml (original)
+++ geronimo/xbean/trunk/pom.xml Mon May 27 08:23:07 2013
@@ -220,6 +220,11 @@
                 <artifactId>xbean-asm-shaded</artifactId>
                 <version>${project.version}</version>
             </dependency>
+          <dependency>
+            <groupId>org.apache.xbean</groupId>
+            <artifactId>xbean-asm4-shaded</artifactId>
+            <version>${project.version}</version>
+          </dependency>
             <dependency>
                 <groupId>org.apache.xbean</groupId>
                 <artifactId>xbean-finder-shaded</artifactId>

Modified: geronimo/xbean/trunk/xbean-finder-shaded/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder-shaded/pom.xml?rev=1486536&r1=1486535&r2=1486536&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder-shaded/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-finder-shaded/pom.xml Mon May 27 08:23:07 2013
@@ -118,7 +118,7 @@
         </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
-            <artifactId>xbean-asm-shaded</artifactId>
+            <artifactId>xbean-asm4-shaded</artifactId>
             <version>${project.version}</version>
         </dependency>
     </dependencies>

Modified: geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassLoadersPerformancesTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassLoadersPerformancesTest.java?rev=1486536&r1=1486535&r2=1486536&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassLoadersPerformancesTest.java
(original)
+++ geronimo/xbean/trunk/xbean-finder/src/test/java/org/apache/xbean/finder/ClassLoadersPerformancesTest.java
Mon May 27 08:23:07 2013
@@ -30,7 +30,7 @@ public class ClassLoadersPerformancesTes
     @Test
     public void perfs() throws IOException {
         final ClassLoader loader = Thread.currentThread().getContextClassLoader();
-        if (!URLClassLoader.class.isInstance(loader)) {
+        if (!URLClassLoader.class.isInstance(loader) || System.getProperty("surefire.real.class.path")
!= null) {
             return; // skip test
         }
 

Modified: geronimo/xbean/trunk/xbean-reflect/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/pom.xml?rev=1486536&r1=1486535&r2=1486536&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/pom.xml (original)
+++ geronimo/xbean/trunk/xbean-reflect/pom.xml Mon May 27 08:23:07 2013
@@ -33,22 +33,22 @@
     <description>xbean-reflect provides very flexible ways to create objects and graphs
of objects for DI frameworks</description>
     <dependencies>
         <dependency>
-            <groupId>asm</groupId>
+            <groupId>org.ow2.asm</groupId>
             <artifactId>asm</artifactId>
-            <version>3.2</version>
+            <version>4.1</version>
             <scope>provided</scope>
             <optional>true</optional>
         </dependency>
         <dependency>
-            <groupId>asm</groupId>
+            <groupId>org.ow2.asm</groupId>
             <artifactId>asm-commons</artifactId>
-            <version>3.2</version>
+            <version>4.1</version>
             <scope>provided</scope>
             <optional>true</optional>
         </dependency>
         <dependency>
             <groupId>org.apache.xbean</groupId>
-            <artifactId>xbean-asm-shaded</artifactId>
+            <artifactId>xbean-asm4-shaded</artifactId>
             <version>3.14-SNAPSHOT</version>
             <scope>provided</scope>
             <optional>true</optional>

Added: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/original/EmptyVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/original/EmptyVisitor.java?rev=1486536&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/original/EmptyVisitor.java
(added)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/original/EmptyVisitor.java
Mon May 27 08:23:07 2013
@@ -0,0 +1,367 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.xbean.asm4.original;
+
+import org.objectweb.asm.AnnotationVisitor;
+import org.objectweb.asm.Attribute;
+import org.objectweb.asm.ClassVisitor;
+import org.objectweb.asm.FieldVisitor;
+import org.objectweb.asm.Handle;
+import org.objectweb.asm.Label;
+import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
+
+public class EmptyVisitor extends ClassVisitor {
+    private final AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM4) {
+        @Override
+        public void visit(String name, Object value) {
+            EmptyVisitor.this.visit(name, value);
+        }
+
+        @Override
+        public void visitEnum(String name, String desc, String value) {
+            EmptyVisitor.this.visitEnum(name, desc, value);
+        }
+
+        @Override
+        public AnnotationVisitor visitAnnotation(String name, String desc) {
+            return EmptyVisitor.this.visitAnnotation(name, desc);
+        }
+
+        @Override
+        public AnnotationVisitor visitArray(String name) {
+            return EmptyVisitor.this.visitArray(name);
+        }
+
+        @Override
+        public void visitEnd() {
+            EmptyVisitor.this.visitEnd();
+        }
+    };
+
+    private final FieldVisitor fv = new FieldVisitor(Opcodes.ASM4) {
+        @Override
+        public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            return EmptyVisitor.this.visitAnnotation(desc, visible);
+        }
+
+        @Override
+        public void visitAttribute(Attribute attribute) {
+            EmptyVisitor.this.visitAttribute(attribute);
+        }
+
+        @Override
+        public void visitEnd() {
+            EmptyVisitor.this.visitEnd();
+        }
+    };
+    private final MethodVisitor mv = new MethodVisitor(Opcodes.ASM4) {
+        @Override
+        public AnnotationVisitor visitAnnotationDefault() {
+            return EmptyVisitor.this.visitAnnotationDefault();
+        }
+
+        @Override
+        public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            return EmptyVisitor.this.visitAnnotation(desc, visible);
+        }
+
+        @Override
+        public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean
visible) {
+            return EmptyVisitor.this.visitParameterAnnotation(parameter, desc, visible);
+        }
+
+        @Override
+        public void visitAttribute(Attribute attribute) {
+            EmptyVisitor.this.visitAttribute(attribute);
+        }
+
+        @Override
+        public void visitCode() {
+            EmptyVisitor.this.visitCode();
+        }
+
+        @Override
+        public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[]
stack) {
+            EmptyVisitor.this.visitFrame(type, nLocal, local, nStack, stack);
+        }
+
+        @Override
+        public void visitInsn(int opcode) {
+            EmptyVisitor.this.visitInsn(opcode);
+        }
+
+        @Override
+        public void visitJumpInsn(int i, Label label) {
+            EmptyVisitor.this.visitJumpInsn(i, label);
+        }
+
+        @Override
+        public void visitLabel(Label label) {
+            EmptyVisitor.this.visitLabel(label);
+        }
+
+        @Override
+        public void visitLdcInsn(Object cst) {
+            EmptyVisitor.this.visitLdcInsn(cst);
+        }
+
+        @Override
+        public void visitIincInsn(int var, int increment) {
+            EmptyVisitor.this.visitIincInsn(var, increment);
+        }
+
+        @Override
+        public void visitTableSwitchInsn(int i, int i2, Label label, Label... labels) {
+            EmptyVisitor.this.visitTableSwitchInsn(i, i2, label, labels);
+        }
+
+        @Override
+        public void visitLookupSwitchInsn(Label label, int[] ints, Label[] labels) {
+            EmptyVisitor.this.visitLookupSwitchInsn(label, ints, labels);
+        }
+
+        @Override
+        public void visitMultiANewArrayInsn(String desc, int dims) {
+            EmptyVisitor.this.visitMultiANewArrayInsn(desc, dims);
+        }
+
+        @Override
+        public void visitTryCatchBlock(Label label, Label label2, Label label3, String s)
{
+            EmptyVisitor.this.visitTryCatchBlock(label, label2, label3, s);
+        }
+
+        @Override
+        public void visitLocalVariable(String s, String s2, String s3, Label label, Label
label2, int i) {
+            EmptyVisitor.this.visitLocalVariable(s, s2, s3, label, label2, i);
+        }
+
+        @Override
+        public void visitLineNumber(int i, Label label) {
+            EmptyVisitor.this.visitLineNumber(i, label);
+        }
+
+        @Override
+        public void visitMaxs(int maxStack, int maxLocals) {
+            EmptyVisitor.this.visitMaxs(maxStack, maxLocals);
+        }
+
+        @Override
+        public void visitEnd() {
+            EmptyVisitor.this.visitEnd();
+        }
+
+        @Override
+        public void visitIntInsn(int opcode, int operand) {
+            EmptyVisitor.this.visitIntInsn(opcode, operand);
+        }
+
+        @Override
+        public void visitVarInsn(int opcode, int var) {
+            EmptyVisitor.this.visitVarInsn(opcode, var);
+        }
+
+        @Override
+        public void visitTypeInsn(int opcode, String type) {
+            EmptyVisitor.this.visitTypeInsn(opcode, type);
+        }
+
+        @Override
+        public void visitFieldInsn(int opcode, String owner, String name, String desc) {
+            EmptyVisitor.this.visitFieldInsn(opcode, owner, name, desc);
+        }
+
+        @Override
+        public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+            EmptyVisitor.this.visitMethodInsn(opcode, owner, name, desc);
+        }
+
+        @Override
+        public void visitInvokeDynamicInsn(String s, String s2, Handle handle, Object...
objects) {
+            EmptyVisitor.this.visitInvokeDynamicInsn(s, s2, handle, objects);
+        }
+    };
+
+    public EmptyVisitor() {
+        super(Opcodes.ASM4);
+    }
+
+    protected AnnotationVisitor visitAnnotationDefault() {
+        return av;
+    }
+
+    protected AnnotationVisitor visitArray(String name) {
+        return av;
+    }
+
+    protected AnnotationVisitor visitAnnotation(String name, String desc) {
+        return av;
+    }
+
+    protected void visitEnum(String name, String desc, String value) {
+        // no-op
+    }
+
+    protected void visit(String name, Object value) {
+        // no-op
+    }
+
+    protected void visitVarInsn(int opcode, int var) {
+        // no-op
+    }
+
+    protected void visitTypeInsn(int opcode, String type) {
+        // no-op
+    }
+
+    protected void visitFieldInsn(int opcode, String owner, String name, String desc) {
+        // no-op
+    }
+
+    protected void visitMethodInsn(int opcode, String owner, String name, String desc) {
+        // no-op
+    }
+
+    protected void visitInvokeDynamicInsn(String s, String s2, Handle handle, Object[] objects)
{
+        // no-op
+    }
+
+    protected void visitIntInsn(int opcode, int operand) {
+        // no-op
+    }
+
+    protected void visitJumpInsn(int i, Label label) {
+        // no-op
+    }
+
+    protected void visitLabel(Label label) {
+        // no-op
+    }
+
+    protected void visitLdcInsn(Object cst) {
+        // no-op
+    }
+
+    protected void visitIincInsn(int var, int increment) {
+        // no-op
+    }
+
+    protected void visitTableSwitchInsn(int i, int i2, Label label, Label[] labels) {
+        // no-op
+    }
+
+    protected void visitLookupSwitchInsn(Label label, int[] ints, Label[] labels) {
+        // no-op
+    }
+
+    protected void visitMultiANewArrayInsn(String desc, int dims) {
+        // no-op
+    }
+
+    protected void visitTryCatchBlock(Label label, Label label2, Label label3, String s)
{
+        // no-op
+    }
+
+    protected void visitLocalVariable(String s, String s2, String s3, Label label, Label
label2, int i) {
+        // no-op
+    }
+
+    protected void visitLineNumber(int i, Label label) {
+        // no-op
+    }
+
+    protected void visitMaxs(int maxStack, int maxLocals) {
+        // no-op
+    }
+
+    protected void visitInsn(int opcode) {
+        // no-op
+    }
+
+    protected void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[]
stack) {
+        // no-op
+    }
+
+    protected void visitCode() {
+        // no-op
+    }
+
+    protected AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean
visible) {
+        return av;
+    }
+
+    @Override
+    public void visit(int version, int access, String name, String signature,
+                      String superName, String[] interfaces) {
+        if (cv != null) {
+            cv.visit(version, access, name, signature, superName, interfaces);
+        }
+    }
+
+    @Override
+    public void visitSource(String source, String debug) {
+        if (cv != null) {
+            cv.visitSource(source, debug);
+        }
+    }
+
+    @Override
+    public void visitOuterClass(String owner, String name, String desc) {
+        if (cv != null) {
+            cv.visitOuterClass(owner, name, desc);
+        }
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        return av;
+    }
+
+    @Override
+    public void visitAttribute(Attribute attr) {
+        if (cv != null) {
+            cv.visitAttribute(attr);
+        }
+    }
+
+    @Override
+    public void visitInnerClass(String name, String outerName,
+                                String innerName, int access) {
+        if (cv != null) {
+            cv.visitInnerClass(name, outerName, innerName, access);
+        }
+    }
+
+    @Override
+    public FieldVisitor visitField(int access, String name, String desc,
+                                   String signature, Object value) {
+        return fv;
+    }
+
+    @Override
+    public MethodVisitor visitMethod(int access, String name, String desc,
+                                     String signature, String[] exceptions) {
+        return mv;
+    }
+
+    @Override
+    public void visitEnd() {
+        if (cv != null) {
+            cv.visitEnd();
+        }
+    }
+}

Added: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/shade/EmptyVisitor.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/shade/EmptyVisitor.java?rev=1486536&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/shade/EmptyVisitor.java
(added)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/asm4/shade/EmptyVisitor.java
Mon May 27 08:23:07 2013
@@ -0,0 +1,367 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.xbean.asm4.shade;
+
+import org.apache.xbean.asm4.AnnotationVisitor;
+import org.apache.xbean.asm4.Attribute;
+import org.apache.xbean.asm4.ClassVisitor;
+import org.apache.xbean.asm4.FieldVisitor;
+import org.apache.xbean.asm4.Handle;
+import org.apache.xbean.asm4.Label;
+import org.apache.xbean.asm4.MethodVisitor;
+import org.apache.xbean.asm4.Opcodes;
+
+public class EmptyVisitor extends ClassVisitor {
+    private final AnnotationVisitor av = new AnnotationVisitor(Opcodes.ASM4) {
+        @Override
+        public void visit(String name, Object value) {
+            EmptyVisitor.this.visit(name, value);
+        }
+
+        @Override
+        public void visitEnum(String name, String desc, String value) {
+            EmptyVisitor.this.visitEnum(name, desc, value);
+        }
+
+        @Override
+        public AnnotationVisitor visitAnnotation(String name, String desc) {
+            return EmptyVisitor.this.visitAnnotation(name, desc);
+        }
+
+        @Override
+        public AnnotationVisitor visitArray(String name) {
+            return EmptyVisitor.this.visitArray(name);
+        }
+
+        @Override
+        public void visitEnd() {
+            EmptyVisitor.this.visitEnd();
+        }
+    };
+
+    private final FieldVisitor fv = new FieldVisitor(Opcodes.ASM4) {
+        @Override
+        public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            return EmptyVisitor.this.visitAnnotation(desc, visible);
+        }
+
+        @Override
+        public void visitAttribute(Attribute attribute) {
+            EmptyVisitor.this.visitAttribute(attribute);
+        }
+
+        @Override
+        public void visitEnd() {
+            EmptyVisitor.this.visitEnd();
+        }
+    };
+    private final MethodVisitor mv = new MethodVisitor(Opcodes.ASM4) {
+        @Override
+        public AnnotationVisitor visitAnnotationDefault() {
+            return EmptyVisitor.this.visitAnnotationDefault();
+        }
+
+        @Override
+        public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+            return EmptyVisitor.this.visitAnnotation(desc, visible);
+        }
+
+        @Override
+        public AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean
visible) {
+            return EmptyVisitor.this.visitParameterAnnotation(parameter, desc, visible);
+        }
+
+        @Override
+        public void visitAttribute(Attribute attribute) {
+            EmptyVisitor.this.visitAttribute(attribute);
+        }
+
+        @Override
+        public void visitCode() {
+            EmptyVisitor.this.visitCode();
+        }
+
+        @Override
+        public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[]
stack) {
+            EmptyVisitor.this.visitFrame(type, nLocal, local, nStack, stack);
+        }
+
+        @Override
+        public void visitInsn(int opcode) {
+            EmptyVisitor.this.visitInsn(opcode);
+        }
+
+        @Override
+        public void visitJumpInsn(int i, Label label) {
+            EmptyVisitor.this.visitJumpInsn(i, label);
+        }
+
+        @Override
+        public void visitLabel(Label label) {
+            EmptyVisitor.this.visitLabel(label);
+        }
+
+        @Override
+        public void visitLdcInsn(Object cst) {
+            EmptyVisitor.this.visitLdcInsn(cst);
+        }
+
+        @Override
+        public void visitIincInsn(int var, int increment) {
+            EmptyVisitor.this.visitIincInsn(var, increment);
+        }
+
+        @Override
+        public void visitTableSwitchInsn(int i, int i2, Label label, Label... labels) {
+            EmptyVisitor.this.visitTableSwitchInsn(i, i2, label, labels);
+        }
+
+        @Override
+        public void visitLookupSwitchInsn(Label label, int[] ints, Label[] labels) {
+            EmptyVisitor.this.visitLookupSwitchInsn(label, ints, labels);
+        }
+
+        @Override
+        public void visitMultiANewArrayInsn(String desc, int dims) {
+            EmptyVisitor.this.visitMultiANewArrayInsn(desc, dims);
+        }
+
+        @Override
+        public void visitTryCatchBlock(Label label, Label label2, Label label3, String s)
{
+            EmptyVisitor.this.visitTryCatchBlock(label, label2, label3, s);
+        }
+
+        @Override
+        public void visitLocalVariable(String s, String s2, String s3, Label label, Label
label2, int i) {
+            EmptyVisitor.this.visitLocalVariable(s, s2, s3, label, label2, i);
+        }
+
+        @Override
+        public void visitLineNumber(int i, Label label) {
+            EmptyVisitor.this.visitLineNumber(i, label);
+        }
+
+        @Override
+        public void visitMaxs(int maxStack, int maxLocals) {
+            EmptyVisitor.this.visitMaxs(maxStack, maxLocals);
+        }
+
+        @Override
+        public void visitEnd() {
+            EmptyVisitor.this.visitEnd();
+        }
+
+        @Override
+        public void visitIntInsn(int opcode, int operand) {
+            EmptyVisitor.this.visitIntInsn(opcode, operand);
+        }
+
+        @Override
+        public void visitVarInsn(int opcode, int var) {
+            EmptyVisitor.this.visitVarInsn(opcode, var);
+        }
+
+        @Override
+        public void visitTypeInsn(int opcode, String type) {
+            EmptyVisitor.this.visitTypeInsn(opcode, type);
+        }
+
+        @Override
+        public void visitFieldInsn(int opcode, String owner, String name, String desc) {
+            EmptyVisitor.this.visitFieldInsn(opcode, owner, name, desc);
+        }
+
+        @Override
+        public void visitMethodInsn(int opcode, String owner, String name, String desc) {
+            EmptyVisitor.this.visitMethodInsn(opcode, owner, name, desc);
+        }
+
+        @Override
+        public void visitInvokeDynamicInsn(String s, String s2, Handle handle, Object...
objects) {
+            EmptyVisitor.this.visitInvokeDynamicInsn(s, s2, handle, objects);
+        }
+    };
+
+    public EmptyVisitor() {
+        super(Opcodes.ASM4);
+    }
+
+    protected AnnotationVisitor visitAnnotationDefault() {
+        return av;
+    }
+
+    protected AnnotationVisitor visitArray(String name) {
+        return av;
+    }
+
+    protected AnnotationVisitor visitAnnotation(String name, String desc) {
+        return av;
+    }
+
+    protected void visitEnum(String name, String desc, String value) {
+        // no-op
+    }
+
+    protected void visit(String name, Object value) {
+        // no-op
+    }
+
+    protected void visitVarInsn(int opcode, int var) {
+        // no-op
+    }
+
+    protected void visitTypeInsn(int opcode, String type) {
+        // no-op
+    }
+
+    protected void visitFieldInsn(int opcode, String owner, String name, String desc) {
+        // no-op
+    }
+
+    protected void visitMethodInsn(int opcode, String owner, String name, String desc) {
+        // no-op
+    }
+
+    protected void visitInvokeDynamicInsn(String s, String s2, Handle handle, Object[] objects)
{
+        // no-op
+    }
+
+    protected void visitIntInsn(int opcode, int operand) {
+        // no-op
+    }
+
+    protected void visitJumpInsn(int i, Label label) {
+        // no-op
+    }
+
+    protected void visitLabel(Label label) {
+        // no-op
+    }
+
+    protected void visitLdcInsn(Object cst) {
+        // no-op
+    }
+
+    protected void visitIincInsn(int var, int increment) {
+        // no-op
+    }
+
+    protected void visitTableSwitchInsn(int i, int i2, Label label, Label[] labels) {
+        // no-op
+    }
+
+    protected void visitLookupSwitchInsn(Label label, int[] ints, Label[] labels) {
+        // no-op
+    }
+
+    protected void visitMultiANewArrayInsn(String desc, int dims) {
+        // no-op
+    }
+
+    protected void visitTryCatchBlock(Label label, Label label2, Label label3, String s)
{
+        // no-op
+    }
+
+    protected void visitLocalVariable(String s, String s2, String s3, Label label, Label
label2, int i) {
+        // no-op
+    }
+
+    protected void visitLineNumber(int i, Label label) {
+        // no-op
+    }
+
+    protected void visitMaxs(int maxStack, int maxLocals) {
+        // no-op
+    }
+
+    protected void visitInsn(int opcode) {
+        // no-op
+    }
+
+    protected void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[]
stack) {
+        // no-op
+    }
+
+    protected void visitCode() {
+        // no-op
+    }
+
+    protected AnnotationVisitor visitParameterAnnotation(int parameter, String desc, boolean
visible) {
+        return av;
+    }
+
+    @Override
+    public void visit(int version, int access, String name, String signature,
+                      String superName, String[] interfaces) {
+        if (cv != null) {
+            cv.visit(version, access, name, signature, superName, interfaces);
+        }
+    }
+
+    @Override
+    public void visitSource(String source, String debug) {
+        if (cv != null) {
+            cv.visitSource(source, debug);
+        }
+    }
+
+    @Override
+    public void visitOuterClass(String owner, String name, String desc) {
+        if (cv != null) {
+            cv.visitOuterClass(owner, name, desc);
+        }
+    }
+
+    @Override
+    public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
+        return av;
+    }
+
+    @Override
+    public void visitAttribute(Attribute attr) {
+        if (cv != null) {
+            cv.visitAttribute(attr);
+        }
+    }
+
+    @Override
+    public void visitInnerClass(String name, String outerName,
+                                String innerName, int access) {
+        if (cv != null) {
+            cv.visitInnerClass(name, outerName, innerName, access);
+        }
+    }
+
+    @Override
+    public FieldVisitor visitField(int access, String name, String desc,
+                                                     String signature, Object value) {
+        return fv;
+    }
+
+    @Override
+    public MethodVisitor visitMethod(int access, String name, String desc,
+                                                       String signature, String[] exceptions)
{
+        return mv;
+    }
+
+    @Override
+    public void visitEnd() {
+        if (cv != null) {
+            cv.visitEnd();
+        }
+    }
+}

Modified: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java?rev=1486536&r1=1486535&r2=1486536&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java
(original)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/AsmParameterNameLoader.java
Mon May 27 08:23:07 2013
@@ -30,11 +30,12 @@ import java.util.Map;
 import java.util.WeakHashMap;
 import java.util.Arrays;
 
+import org.apache.xbean.asm4.original.EmptyVisitor;
 import org.objectweb.asm.ClassReader;
 import org.objectweb.asm.Label;
 import org.objectweb.asm.MethodVisitor;
+import org.objectweb.asm.Opcodes;
 import org.objectweb.asm.Type;
-import org.objectweb.asm.commons.EmptyVisitor;
 
 /**
  * Implementation of ParameterNameLoader that uses ASM to read the parameter names from the
local variable table in the
@@ -285,7 +286,7 @@ public class AsmParameterNameLoader impl
                     isStaticMethod = Modifier.isStatic(method.getModifiers());
                 }
 
-                return new EmptyVisitor() {
+                return new MethodVisitor(Opcodes.ASM4) {
                     // assume static method until we get a first parameter name
                     public void visitLocalVariable(String name, String description, String
signature, Label start, Label end, int index) {
                         if (isStaticMethod) {

Modified: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java?rev=1486536&r1=1486535&r2=1486536&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java
(original)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/ReflectionUtil.java
Mon May 27 08:23:07 2013
@@ -43,10 +43,12 @@ public final class ReflectionUtil {
     private static ParameterNameLoader parameterNamesLoader;
     
     static {
-        if (isClassAvailable("org.apache.xbean.asm.ClassReader")) {
+        if (isClassAvailable("org.apache.xbean.asm4.ClassReader")) {
             parameterNamesLoader = new XbeanAsmParameterNameLoader();
         } else if (isClassAvailable("org.objectweb.asm.ClassReader")) {
             parameterNamesLoader = new AsmParameterNameLoader();                    
+        } else if (isClassAvailable("org.apache.xbean.asm.ClassReader")) {
+            throw new RuntimeException("Your xbean-asm-shade is too old, please upgrade to
xbean-asm4-shade");
         }
     }
     

Modified: geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java?rev=1486536&r1=1486535&r2=1486536&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
(original)
+++ geronimo/xbean/trunk/xbean-reflect/src/main/java/org/apache/xbean/recipe/XbeanAsmParameterNameLoader.java
Mon May 27 08:23:07 2013
@@ -17,24 +17,30 @@
  */
 package org.apache.xbean.recipe;
 
+import org.apache.xbean.asm4.ClassReader;
+import org.apache.xbean.asm4.shade.EmptyVisitor;
+import org.apache.xbean.asm4.Label;
+import org.apache.xbean.asm4.MethodVisitor;
+import org.apache.xbean.asm4.Opcodes;
+import org.apache.xbean.asm4.Type;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.WeakHashMap;
-import java.util.Arrays;
 
-import org.apache.xbean.asm.ClassReader;
-import org.apache.xbean.asm.Label;
-import org.apache.xbean.asm.MethodVisitor;
-import org.apache.xbean.asm.Type;
-import org.apache.xbean.asm.commons.EmptyVisitor;
+import org.apache.xbean.asm4.ClassReader;
+import org.apache.xbean.asm4.Label;
+import org.apache.xbean.asm4.MethodVisitor;
+import org.apache.xbean.asm4.Type;
 
 /**
  * Implementation of ParameterNameLoader that uses ASM to read the parameter names from the
local variable table in the
@@ -285,7 +291,7 @@ public class XbeanAsmParameterNameLoader
                     isStaticMethod = Modifier.isStatic(method.getModifiers());
                 }
 
-                return new EmptyVisitor() {
+                return new MethodVisitor(Opcodes.ASM4) {
                     // assume static method until we get a first parameter name
                     public void visitLocalVariable(String name, String description, String
signature, Label start, Label end, int index) {
                         if (isStaticMethod) {



Mime
View raw message