You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/05/30 21:20:36 UTC
[9/17] TAP5-1852: Upgrade Plastic to use ASM 4.0 - Remove unused
utility classes
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldInsnNode.java
index 85ecc25..265fb1e 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldInsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldInsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,14 +29,14 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import java.util.Map;
+
/**
* A node that represents a field instruction. A field instruction is an
* instruction that loads or stores the value of a field of an object.
- *
+ *
* @author Eric Bruneton
*/
public class FieldInsnNode extends AbstractInsnNode {
@@ -59,7 +59,7 @@ public class FieldInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link FieldInsnNode}.
- *
+ *
* @param opcode the opcode of the type instruction to be constructed. This
* opcode must be GETSTATIC, PUTSTATIC, GETFIELD or PUTFIELD.
* @param owner the internal name of the field's owner class (see
@@ -81,7 +81,7 @@ public class FieldInsnNode extends AbstractInsnNode {
/**
* Sets the opcode of this instruction.
- *
+ *
* @param opcode the new instruction opcode. This opcode must be GETSTATIC,
* PUTSTATIC, GETFIELD or PUTFIELD.
*/
@@ -89,15 +89,18 @@ public class FieldInsnNode extends AbstractInsnNode {
this.opcode = opcode;
}
+ @Override
public int getType() {
return FIELD_INSN;
}
+ @Override
public void accept(final MethodVisitor cv) {
cv.visitFieldInsn(opcode, owner, name, desc);
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new FieldInsnNode(opcode, owner, name, desc);
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldNode.java
index d99079d..a248cdf 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FieldNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,16 +29,17 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import org.apache.tapestry5.internal.plastic.asm.Attribute;
-import org.apache.tapestry5.internal.plastic.asm.ClassVisitor;
-import org.apache.tapestry5.internal.plastic.asm.FieldVisitor;
+import org.apache.tapestry5.internal.plastic.asm.*;
+
+import java.util.ArrayList;
+import java.util.List;
/**
* A node that represents a field.
- *
+ *
* @author Eric Bruneton
*/
-public class FieldNode extends MemberNode implements FieldVisitor {
+public class FieldNode extends FieldVisitor {
/**
* The field's access flags (see {@link org.apache.tapestry5.internal.plastic.asm.Opcodes}). This
@@ -69,18 +70,46 @@ public class FieldNode extends MemberNode implements FieldVisitor {
public Object value;
/**
- * Constructs a new {@link FieldNode}.
- *
+ * The runtime visible annotations of this field. This list is a list of
+ * {@link AnnotationNode} objects. May be <tt>null</tt>.
+ *
+ * @associates AnnotationNode
+ * @label visible
+ */
+ public List<AnnotationNode> visibleAnnotations;
+
+ /**
+ * The runtime invisible annotations of this field. This list is a list of
+ * {@link AnnotationNode} objects. May be <tt>null</tt>.
+ *
+ * @associates AnnotationNode
+ * @label invisible
+ */
+ public List<AnnotationNode> invisibleAnnotations;
+
+ /**
+ * The non standard attributes of this field. This list is a list of
+ * {@link org.apache.tapestry5.internal.plastic.asm.Attribute} objects. May be <tt>null</tt>.
+ *
+ * @associates Attribute
+ */
+ public List<Attribute> attrs;
+
+ /**
+ * Constructs a new {@link FieldNode}. <i>Subclasses must not use this
+ * constructor</i>. Instead, they must use the
+ * {@link #FieldNode(int, int, String, String, String, Object)} version.
+ *
* @param access the field's access flags (see
* {@link org.apache.tapestry5.internal.plastic.asm.Opcodes}). This parameter also indicates
* if the field is synthetic and/or deprecated.
* @param name the field's name.
- * @param desc the field's descriptor (see
- * {@link org.apache.tapestry5.internal.plastic.asm.Type Type}).
+ * @param desc the field's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type
+ * Type}).
* @param signature the field's signature.
* @param value the field's initial value. This parameter, which may be
- * <tt>null</tt> if the field does not have an initial value, must
- * be an {@link Integer}, a {@link Float}, a {@link Long}, a
+ * <tt>null</tt> if the field does not have an initial value, must be
+ * an {@link Integer}, a {@link Float}, a {@link Long}, a
* {@link Double} or a {@link String}.
*/
public FieldNode(
@@ -90,6 +119,37 @@ public class FieldNode extends MemberNode implements FieldVisitor {
final String signature,
final Object value)
{
+ this(Opcodes.ASM4, access, name, desc, signature, value);
+ }
+
+ /**
+ * Constructs a new {@link FieldNode}. <i>Subclasses must not use this
+ * constructor</i>. Instead, they must use the
+ * {@link #FieldNode(int, int, String, String, String, Object)} version.
+ *
+ * @param api the ASM API version implemented by this visitor. Must be one
+ * of {@link Opcodes#ASM4}.
+ * @param access the field's access flags (see
+ * {@link org.apache.tapestry5.internal.plastic.asm.Opcodes}). This parameter also indicates
+ * if the field is synthetic and/or deprecated.
+ * @param name the field's name.
+ * @param desc the field's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type
+ * Type}).
+ * @param signature the field's signature.
+ * @param value the field's initial value. This parameter, which may be
+ * <tt>null</tt> if the field does not have an initial value, must be
+ * an {@link Integer}, a {@link Float}, a {@link Long}, a
+ * {@link Double} or a {@link String}.
+ */
+ public FieldNode(
+ final int api,
+ final int access,
+ final String name,
+ final String desc,
+ final String signature,
+ final Object value)
+ {
+ super(api);
this.access = access;
this.name = name;
this.desc = desc;
@@ -97,9 +157,61 @@ public class FieldNode extends MemberNode implements FieldVisitor {
this.value = value;
}
+ // ------------------------------------------------------------------------
+ // Implementation of the FieldVisitor abstract class
+ // ------------------------------------------------------------------------
+
+ @Override
+ public AnnotationVisitor visitAnnotation(
+ final String desc,
+ final boolean visible)
+ {
+ AnnotationNode an = new AnnotationNode(desc);
+ if (visible) {
+ if (visibleAnnotations == null) {
+ visibleAnnotations = new ArrayList<AnnotationNode>(1);
+ }
+ visibleAnnotations.add(an);
+ } else {
+ if (invisibleAnnotations == null) {
+ invisibleAnnotations = new ArrayList<AnnotationNode>(1);
+ }
+ invisibleAnnotations.add(an);
+ }
+ return an;
+ }
+
+ @Override
+ public void visitAttribute(final Attribute attr) {
+ if (attrs == null) {
+ attrs = new ArrayList<Attribute>(1);
+ }
+ attrs.add(attr);
+ }
+
+ @Override
+ public void visitEnd() {
+ }
+
+ // ------------------------------------------------------------------------
+ // Accept methods
+ // ------------------------------------------------------------------------
+
+ /**
+ * Checks that this field node is compatible with the given ASM API version.
+ * This methods checks that this node, and all its nodes recursively, do not
+ * contain elements that were introduced in more recent versions of the ASM
+ * API than the given version.
+ *
+ * @param api an ASM API version. Must be one of {@link Opcodes#ASM4}.
+ */
+ public void check(final int api) {
+ // nothing to do
+ }
+
/**
* Makes the given class visitor visit this field.
- *
+ *
* @param cv a class visitor.
*/
public void accept(final ClassVisitor cv) {
@@ -110,17 +222,17 @@ public class FieldNode extends MemberNode implements FieldVisitor {
int i, n;
n = visibleAnnotations == null ? 0 : visibleAnnotations.size();
for (i = 0; i < n; ++i) {
- AnnotationNode an = (AnnotationNode) visibleAnnotations.get(i);
+ AnnotationNode an = visibleAnnotations.get(i);
an.accept(fv.visitAnnotation(an.desc, true));
}
n = invisibleAnnotations == null ? 0 : invisibleAnnotations.size();
for (i = 0; i < n; ++i) {
- AnnotationNode an = (AnnotationNode) invisibleAnnotations.get(i);
+ AnnotationNode an = invisibleAnnotations.get(i);
an.accept(fv.visitAnnotation(an.desc, false));
}
n = attrs == null ? 0 : attrs.size();
for (i = 0; i < n; ++i) {
- fv.visitAttribute((Attribute) attrs.get(i));
+ fv.visitAttribute(attrs.get(i));
}
fv.visitEnd();
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FrameNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FrameNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FrameNode.java
index 630f38c..c2564e3 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FrameNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/FrameNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,14 +29,14 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
+import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import org.apache.tapestry5.internal.plastic.asm.Opcodes;
+
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
-import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
-import org.apache.tapestry5.internal.plastic.asm.Opcodes;
-
/**
* A node that represents a stack map frame. These nodes are pseudo instruction
* nodes in order to be inserted in an instruction list. In fact these nodes
@@ -46,17 +46,17 @@ import org.apache.tapestry5.internal.plastic.asm.Opcodes;
* The stack map frame types must describe the values of the local variables and
* of the operand stack elements <i>just before</i> <b>i</b> is executed. <br>
* <br> (*) this is mandatory only for classes whose version is greater than or
- * equal to {@link Opcodes#V1_6 V1_6}.
- *
+ * equal to {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#V1_6 V1_6}.
+ *
* @author Eric Bruneton
*/
public class FrameNode extends AbstractInsnNode {
/**
- * The type of this frame. Must be {@link Opcodes#F_NEW} for expanded
- * frames, or {@link Opcodes#F_FULL}, {@link Opcodes#F_APPEND},
- * {@link Opcodes#F_CHOP}, {@link Opcodes#F_SAME} or
- * {@link Opcodes#F_APPEND}, {@link Opcodes#F_SAME1} for compressed frames.
+ * The type of this frame. Must be {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_NEW} for expanded
+ * frames, or {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_FULL}, {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_APPEND},
+ * {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_CHOP}, {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_SAME} or
+ * {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_APPEND}, {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_SAME1} for compressed frames.
*/
public int type;
@@ -66,7 +66,7 @@ public class FrameNode extends AbstractInsnNode {
* reference and uninitialized types respectively - see
* {@link MethodVisitor}).
*/
- public List local;
+ public List<Object> local;
/**
* The types of the operand stack elements of this stack map frame. Elements
@@ -74,7 +74,7 @@ public class FrameNode extends AbstractInsnNode {
* reference and uninitialized types respectively - see
* {@link MethodVisitor}).
*/
- public List stack;
+ public List<Object> stack;
private FrameNode() {
super(-1);
@@ -82,12 +82,12 @@ public class FrameNode extends AbstractInsnNode {
/**
* Constructs a new {@link FrameNode}.
- *
- * @param type the type of this frame. Must be {@link Opcodes#F_NEW} for
- * expanded frames, or {@link Opcodes#F_FULL},
- * {@link Opcodes#F_APPEND}, {@link Opcodes#F_CHOP},
- * {@link Opcodes#F_SAME} or {@link Opcodes#F_APPEND},
- * {@link Opcodes#F_SAME1} for compressed frames.
+ *
+ * @param type the type of this frame. Must be {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_NEW} for
+ * expanded frames, or {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_FULL},
+ * {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_APPEND}, {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_CHOP},
+ * {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_SAME} or {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_APPEND},
+ * {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#F_SAME1} for compressed frames.
* @param nLocal number of local variables of this stack map frame.
* @param local the types of the local variables of this stack map frame.
* Elements of this list can be Integer, String or LabelNode objects
@@ -128,15 +128,17 @@ public class FrameNode extends AbstractInsnNode {
}
}
+ @Override
public int getType() {
return FRAME;
}
/**
* Makes the given visitor visit this stack map frame.
- *
+ *
* @param mv a method visitor.
*/
+ @Override
public void accept(final MethodVisitor mv) {
switch (type) {
case Opcodes.F_NEW:
@@ -162,11 +164,12 @@ public class FrameNode extends AbstractInsnNode {
}
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
FrameNode clone = new FrameNode();
clone.type = type;
if (local != null) {
- clone.local = new ArrayList();
+ clone.local = new ArrayList<Object>();
for (int i = 0; i < local.size(); ++i) {
Object l = local.get(i);
if (l instanceof LabelNode) {
@@ -176,7 +179,7 @@ public class FrameNode extends AbstractInsnNode {
}
}
if (stack != null) {
- clone.stack = new ArrayList();
+ clone.stack = new ArrayList<Object>();
for (int i = 0; i < stack.size(); ++i) {
Object s = stack.get(i);
if (s instanceof LabelNode) {
@@ -190,11 +193,11 @@ public class FrameNode extends AbstractInsnNode {
// ------------------------------------------------------------------------
- private static List asList(final int n, final Object[] o) {
+ private static List<Object> asList(final int n, final Object[] o) {
return Arrays.asList(o).subList(0, n);
}
- private static Object[] asArray(final List l) {
+ private static Object[] asArray(final List<Object> l) {
Object[] objs = new Object[l.size()];
for (int i = 0; i < objs.length; ++i) {
Object o = l.get(i);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IincInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IincInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IincInsnNode.java
index f8e3df4..c1b13dd 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IincInsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IincInsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,14 +29,14 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
import org.apache.tapestry5.internal.plastic.asm.Opcodes;
+import java.util.Map;
+
/**
* A node that represents an IINC instruction.
- *
+ *
* @author Eric Bruneton
*/
public class IincInsnNode extends AbstractInsnNode {
@@ -53,7 +53,7 @@ public class IincInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link IincInsnNode}.
- *
+ *
* @param var index of the local variable to be incremented.
* @param incr increment amount to increment the local variable by.
*/
@@ -63,15 +63,18 @@ public class IincInsnNode extends AbstractInsnNode {
this.incr = incr;
}
+ @Override
public int getType() {
return IINC_INSN;
}
+ @Override
public void accept(final MethodVisitor mv) {
mv.visitIincInsn(var, incr);
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new IincInsnNode(var, incr);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InnerClassNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InnerClassNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InnerClassNode.java
index bc81829..bfc16b0 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InnerClassNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InnerClassNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@ import org.apache.tapestry5.internal.plastic.asm.ClassVisitor;
/**
* A node that represents an inner class.
- *
+ *
* @author Eric Bruneton
*/
public class InnerClassNode {
@@ -65,7 +65,7 @@ public class InnerClassNode {
/**
* Constructs a new {@link InnerClassNode}.
- *
+ *
* @param name the internal name of an inner class (see
* {@link org.apache.tapestry5.internal.plastic.asm.Type#getInternalName() getInternalName}).
* @param outerName the internal name of the class to which the inner class
@@ -92,7 +92,7 @@ public class InnerClassNode {
/**
* Makes the given class visitor visit this inner class.
- *
+ *
* @param cv a class visitor.
*/
public void accept(final ClassVisitor cv) {
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnList.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnList.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnList.java
index 5e0bc04..c4fa98a 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnList.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnList.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,11 +29,11 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
+import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+
import java.util.ListIterator;
import java.util.NoSuchElementException;
-import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
-
/**
* A doubly linked list of {@link AbstractInsnNode} objects. <i>This
* implementation is not thread safe</i>.
@@ -41,15 +41,6 @@ import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
public class InsnList {
/**
- * Indicates if preconditions of methods of this class must be checked.
- * <i>Checking preconditions causes the {@link #indexOf indexOf},
- * {@link #set set}, {@link #insert(AbstractInsnNode, AbstractInsnNode)},
- * {@link #insert(AbstractInsnNode, InsnList)}, {@link #remove remove} and
- * {@link #clear} methods to execute in O(n) time instead of O(1)</i>.
- */
- public static boolean check;
-
- /**
* The number of instructions in this list.
*/
private int size;
@@ -72,7 +63,7 @@ public class InsnList {
/**
* Returns the number of instructions in this list.
- *
+ *
* @return the number of instructions in this list.
*/
public int size() {
@@ -81,7 +72,7 @@ public class InsnList {
/**
* Returns the first instruction in this list.
- *
+ *
* @return the first instruction in this list, or <tt>null</tt> if the
* list is empty.
*/
@@ -91,7 +82,7 @@ public class InsnList {
/**
* Returns the last instruction in this list.
- *
+ *
* @return the last instruction in this list, or <tt>null</tt> if the list
* is empty.
*/
@@ -104,7 +95,7 @@ public class InsnList {
* of the instructions in this list to avoid scanning the whole list each
* time it is called. Once the cache is built, this method run in constant
* time. This cache is invalidated by all the methods that modify the list.
- *
+ *
* @param index the index of the instruction that must be returned.
* @return the instruction whose index is given.
* @throws IndexOutOfBoundsException if (index < 0 || index >= size()).
@@ -123,7 +114,7 @@ public class InsnList {
* Returns <tt>true</tt> if the given instruction belongs to this list.
* This method always scans the instructions of this list until it finds the
* given instruction or reaches the end of the list.
- *
+ *
* @param insn an instruction.
* @return <tt>true</tt> if the given instruction belongs to this list.
*/
@@ -141,19 +132,14 @@ public class InsnList {
* list each time it is called. Once the cache is built, this method run in
* constant time. The cache is invalidated by all the methods that modify
* the list.
- *
+ *
* @param insn an instruction <i>of this list</i>.
* @return the index of the given instruction in this list. <i>The result of
* this method is undefined if the given instruction does not belong
* to this list</i>. Use {@link #contains contains} to test if an
* instruction belongs to an instruction list or not.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt> and
- * if insn does not belong to this list.
*/
public int indexOf(final AbstractInsnNode insn) {
- if (check && !contains(insn)) {
- throw new IllegalArgumentException();
- }
if (cache == null) {
cache = toArray();
}
@@ -162,7 +148,7 @@ public class InsnList {
/**
* Makes the given visitor visit all of the instructions in this list.
- *
+ *
* @param mv the method visitor that must visit the instructions.
*/
public void accept(final MethodVisitor mv) {
@@ -175,25 +161,26 @@ public class InsnList {
/**
* Returns an iterator over the instructions in this list.
- *
+ *
* @return an iterator over the instructions in this list.
*/
- public ListIterator iterator() {
+ public ListIterator<AbstractInsnNode> iterator() {
return iterator(0);
}
/**
* Returns an iterator over the instructions in this list.
- *
+ *
* @return an iterator over the instructions in this list.
*/
- public ListIterator iterator(int index) {
+ @SuppressWarnings("unchecked")
+ public ListIterator<AbstractInsnNode> iterator(int index) {
return new InsnListIterator(index);
}
-
+
/**
* Returns an array containing all of the instructions in this list.
- *
+ *
* @return an array containing all of the instructions in this list.
*/
public AbstractInsnNode[] toArray() {
@@ -210,18 +197,12 @@ public class InsnList {
/**
* Replaces an instruction of this list with another instruction.
- *
+ *
* @param location an instruction <i>of this list</i>.
* @param insn another instruction, <i>which must not belong to any
* {@link InsnList}</i>.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if i does not belong to this list or if insn belongs to an
- * instruction list.
*/
public void set(final AbstractInsnNode location, final AbstractInsnNode insn) {
- if (check && !(contains(location) && insn.index == -1)) {
- throw new IllegalArgumentException();
- }
AbstractInsnNode next = location.next;
insn.next = next;
if (next != null) {
@@ -250,16 +231,11 @@ public class InsnList {
/**
* Adds the given instruction to the end of this list.
- *
+ *
* @param insn an instruction, <i>which must not belong to any
* {@link InsnList}</i>.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if insn belongs to an instruction list.
*/
public void add(final AbstractInsnNode insn) {
- if (check && insn.index != -1) {
- throw new IllegalArgumentException();
- }
++size;
if (last == null) {
first = insn;
@@ -275,15 +251,11 @@ public class InsnList {
/**
* Adds the given instructions to the end of this list.
- *
+ *
* @param insns an instruction list, which is cleared during the process.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if insn == this.
+ * This list must be different from 'this'.
*/
public void add(final InsnList insns) {
- if (check && insns == this) {
- throw new IllegalArgumentException();
- }
if (insns.size == 0) {
return;
}
@@ -303,16 +275,11 @@ public class InsnList {
/**
* Inserts the given instruction at the begining of this list.
- *
+ *
* @param insn an instruction, <i>which must not belong to any
* {@link InsnList}</i>.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if insn belongs to an instruction list.
*/
public void insert(final AbstractInsnNode insn) {
- if (check && insn.index != -1) {
- throw new IllegalArgumentException();
- }
++size;
if (first == null) {
first = insn;
@@ -328,15 +295,11 @@ public class InsnList {
/**
* Inserts the given instructions at the begining of this list.
- *
+ *
* @param insns an instruction list, which is cleared during the process.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if insn == this.
+ * This list must be different from 'this'.
*/
public void insert(final InsnList insns) {
- if (check && insns == this) {
- throw new IllegalArgumentException();
- }
if (insns.size == 0) {
return;
}
@@ -356,19 +319,13 @@ public class InsnList {
/**
* Inserts the given instruction after the specified instruction.
- *
+ *
* @param location an instruction <i>of this list</i> after which insn must be
* inserted.
* @param insn the instruction to be inserted, <i>which must not belong to
* any {@link InsnList}</i>.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if i does not belong to this list or if insn belongs to an
- * instruction list.
*/
public void insert(final AbstractInsnNode location, final AbstractInsnNode insn) {
- if (check && !(contains(location) && insn.index == -1)) {
- throw new IllegalArgumentException();
- }
++size;
AbstractInsnNode next = location.next;
if (next == null) {
@@ -385,18 +342,13 @@ public class InsnList {
/**
* Inserts the given instructions after the specified instruction.
- *
- * @param location an instruction <i>of this list</i> after which the instructions
- * must be inserted.
+ *
+ * @param location an instruction <i>of this list</i> after which the
+ * instructions must be inserted.
* @param insns the instruction list to be inserted, which is cleared during
- * the process.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if i does not belong to this list or if insns == this.
+ * the process. This list must be different from 'this'.
*/
public void insert(final AbstractInsnNode location, final InsnList insns) {
- if (check && !(contains(location) && insns != this)) {
- throw new IllegalArgumentException();
- }
if (insns.size == 0) {
return;
}
@@ -415,22 +367,16 @@ public class InsnList {
cache = null;
insns.removeAll(false);
}
-
+
/**
* Inserts the given instruction before the specified instruction.
- *
+ *
* @param location an instruction <i>of this list</i> before which insn must be
* inserted.
* @param insn the instruction to be inserted, <i>which must not belong to
* any {@link InsnList}</i>.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if i does not belong to this list or if insn belongs to an
- * instruction list.
*/
public void insertBefore(final AbstractInsnNode location, final AbstractInsnNode insn) {
- if (check && !(contains(location) && insn.index == -1)) {
- throw new IllegalArgumentException();
- }
++size;
AbstractInsnNode prev = location.prev;
if (prev == null) {
@@ -444,21 +390,16 @@ public class InsnList {
cache = null;
insn.index = 0; // insn now belongs to an InsnList
}
-
+
/**
* Inserts the given instructions before the specified instruction.
- *
+ *
* @param location an instruction <i>of this list</i> before which the instructions
* must be inserted.
* @param insns the instruction list to be inserted, which is cleared during
- * the process.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if i does not belong to this list or if insns == this.
+ * the process. This list must be different from 'this'.
*/
public void insertBefore(final AbstractInsnNode location, final InsnList insns) {
- if (check && !(contains(location ) && insns != this)) {
- throw new IllegalArgumentException();
- }
if (insns.size == 0) {
return;
}
@@ -477,20 +418,15 @@ public class InsnList {
cache = null;
insns.removeAll(false);
}
-
-
+
+
/**
* Removes the given instruction from this list.
- *
+ *
* @param insn the instruction <i>of this list</i> that must be removed.
- * @throws IllegalArgumentException if {@link #check} is <tt>true</tt>,
- * and if insn does not belong to this list.
*/
public void remove(final AbstractInsnNode insn) {
- if (check && !contains(insn)) {
- throw new IllegalArgumentException();
- }
--size;
AbstractInsnNode next = insn.next;
AbstractInsnNode prev = insn.prev;
@@ -519,11 +455,11 @@ public class InsnList {
/**
* Removes all of the instructions of this list.
- *
+ *
* @param mark if the instructions must be marked as no longer belonging to
* any {@link InsnList}.
*/
- private void removeAll(final boolean mark) {
+ void removeAll(final boolean mark) {
if (mark) {
AbstractInsnNode insn = first;
while (insn != null) {
@@ -544,7 +480,7 @@ public class InsnList {
* Removes all of the instructions of this list.
*/
public void clear() {
- removeAll(check);
+ removeAll(false);
}
/**
@@ -561,9 +497,12 @@ public class InsnList {
insn = insn.next;
}
}
-
- private final class InsnListIterator implements ListIterator {
+
+ // this class is not generified because it will create bridges
+ private final class InsnListIterator implements ListIterator/*<AbstractInsnNode>*/ {
+
AbstractInsnNode next;
+
AbstractInsnNode prev;
InsnListIterator(int index) {
@@ -636,5 +575,4 @@ public class InsnList {
prev = (AbstractInsnNode) o;
}
}
-
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnNode.java
index 269f9f6..6abed41 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,20 +29,20 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import java.util.Map;
+
/**
* A node that represents a zero operand instruction.
- *
+ *
* @author Eric Bruneton
*/
public class InsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link InsnNode}.
- *
+ *
* @param opcode the opcode of the instruction to be constructed. This
* opcode must be NOP, ACONST_NULL, ICONST_M1, ICONST_0, ICONST_1,
* ICONST_2, ICONST_3, ICONST_4, ICONST_5, LCONST_0, LCONST_1,
@@ -62,20 +62,23 @@ public class InsnNode extends AbstractInsnNode {
super(opcode);
}
+ @Override
public int getType() {
return INSN;
}
/**
* Makes the given visitor visit this instruction.
- *
+ *
* @param mv a method visitor.
*/
+ @Override
public void accept(final MethodVisitor mv) {
mv.visitInsn(opcode);
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new InsnNode(opcode);
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IntInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IntInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IntInsnNode.java
index e3f13b8..03c0d54 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IntInsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/IntInsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,13 +29,13 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import java.util.Map;
+
/**
* A node that represents an instruction with a single int operand.
- *
+ *
* @author Eric Bruneton
*/
public class IntInsnNode extends AbstractInsnNode {
@@ -47,7 +47,7 @@ public class IntInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link IntInsnNode}.
- *
+ *
* @param opcode the opcode of the instruction to be constructed. This
* opcode must be BIPUSH, SIPUSH or NEWARRAY.
* @param operand the operand of the instruction to be constructed.
@@ -59,7 +59,7 @@ public class IntInsnNode extends AbstractInsnNode {
/**
* Sets the opcode of this instruction.
- *
+ *
* @param opcode the new instruction opcode. This opcode must be BIPUSH,
* SIPUSH or NEWARRAY.
*/
@@ -67,15 +67,18 @@ public class IntInsnNode extends AbstractInsnNode {
this.opcode = opcode;
}
+ @Override
public int getType() {
return INT_INSN;
}
+ @Override
public void accept(final MethodVisitor mv) {
mv.visitIntInsn(opcode, operand);
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new IntInsnNode(opcode, operand);
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InvokeDynamicInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InvokeDynamicInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InvokeDynamicInsnNode.java
new file mode 100644
index 0000000..d67b72f
--- /dev/null
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/InvokeDynamicInsnNode.java
@@ -0,0 +1,100 @@
+/***
+ * ASM: a very small and fast Java bytecode manipulation framework
+ * Copyright (c) 2000-2011 INRIA, France Telecom
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holders nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+package org.apache.tapestry5.internal.plastic.asm.tree;
+
+import org.apache.tapestry5.internal.plastic.asm.Handle;
+import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import org.apache.tapestry5.internal.plastic.asm.Opcodes;
+
+import java.util.Map;
+
+/**
+ * A node that represents an invokedynamic instruction.
+ *
+ * @author Remi Forax
+ */
+public class InvokeDynamicInsnNode extends AbstractInsnNode {
+
+ /**
+ * Invokedynamic name.
+ */
+ public String name;
+
+ /**
+ * Invokedynamic descriptor.
+ */
+ public String desc;
+
+ /**
+ * Bootstrap method
+ */
+ public Handle bsm;
+
+ /**
+ * Bootstrap constant arguments
+ */
+ public Object[] bsmArgs;
+
+ /**
+ * Constructs a new {@link InvokeDynamicInsnNode}.
+ *
+ * @param name invokedynamic name.
+ * @param desc invokedynamic descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type}).
+ * @param bsm the bootstrap method.
+ * @param bsmArgs the boostrap constant arguments.
+ */
+ public InvokeDynamicInsnNode(
+ final String name,
+ final String desc,
+ final Handle bsm,
+ final Object... bsmArgs)
+ {
+ super(Opcodes.INVOKEDYNAMIC);
+ this.name = name;
+ this.desc = desc;
+ this.bsm = bsm;
+ this.bsmArgs = bsmArgs;
+ }
+
+ @Override
+ public int getType() {
+ return INVOKE_DYNAMIC_INSN;
+ }
+
+ @Override
+ public void accept(final MethodVisitor mv) {
+ mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
+ }
+
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+ return new InvokeDynamicInsnNode(name, desc, bsm, bsmArgs);
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/JumpInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/JumpInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/JumpInsnNode.java
index 211517c..d0011a2 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/JumpInsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/JumpInsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,14 +29,14 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import java.util.Map;
+
/**
* A node that represents a jump instruction. A jump instruction is an
* instruction that may jump to another instruction.
- *
+ *
* @author Eric Bruneton
*/
public class JumpInsnNode extends AbstractInsnNode {
@@ -49,7 +49,7 @@ public class JumpInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link JumpInsnNode}.
- *
+ *
* @param opcode the opcode of the type instruction to be constructed. This
* opcode must be IFEQ, IFNE, IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ,
* IF_ICMPNE, IF_ICMPLT, IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ,
@@ -65,7 +65,7 @@ public class JumpInsnNode extends AbstractInsnNode {
/**
* Sets the opcode of this instruction.
- *
+ *
* @param opcode the new instruction opcode. This opcode must be IFEQ, IFNE,
* IFLT, IFGE, IFGT, IFLE, IF_ICMPEQ, IF_ICMPNE, IF_ICMPLT,
* IF_ICMPGE, IF_ICMPGT, IF_ICMPLE, IF_ACMPEQ, IF_ACMPNE, GOTO, JSR,
@@ -75,15 +75,18 @@ public class JumpInsnNode extends AbstractInsnNode {
this.opcode = opcode;
}
+ @Override
public int getType() {
return JUMP_INSN;
}
+ @Override
public void accept(final MethodVisitor mv) {
mv.visitJumpInsn(opcode, label.getLabel());
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new JumpInsnNode(opcode, clone(label, labels));
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LabelNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LabelNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LabelNode.java
index 4282fd3..a21f0d0 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LabelNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LabelNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,11 +29,11 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.Label;
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import java.util.Map;
+
/**
* An {@link AbstractInsnNode} that encapsulates a {@link Label}.
*/
@@ -50,6 +50,7 @@ public class LabelNode extends AbstractInsnNode {
this.label = label;
}
+ @Override
public int getType() {
return LABEL;
}
@@ -61,12 +62,14 @@ public class LabelNode extends AbstractInsnNode {
return label;
}
+ @Override
public void accept(final MethodVisitor cv) {
cv.visitLabel(getLabel());
}
- public AbstractInsnNode clone(final Map labels) {
- return (LabelNode) labels.get(this);
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
+ return labels.get(this);
}
public void resetLabel() {
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LdcInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LdcInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LdcInsnNode.java
index 3d01838..82748cb 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LdcInsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LdcInsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,14 +29,14 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
import org.apache.tapestry5.internal.plastic.asm.Opcodes;
+import java.util.Map;
+
/**
* A node that represents an LDC instruction.
- *
+ *
* @author Eric Bruneton
*/
public class LdcInsnNode extends AbstractInsnNode {
@@ -50,7 +50,7 @@ public class LdcInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link LdcInsnNode}.
- *
+ *
* @param cst the constant to be loaded on the stack. This parameter must be
* a non null {@link Integer}, a {@link Float}, a {@link Long}, a
* {@link Double} or a {@link String}.
@@ -60,15 +60,18 @@ public class LdcInsnNode extends AbstractInsnNode {
this.cst = cst;
}
+ @Override
public int getType() {
return LDC_INSN;
}
+ @Override
public void accept(final MethodVisitor mv) {
mv.visitLdcInsn(cst);
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new LdcInsnNode(cst);
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LineNumberNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LineNumberNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LineNumberNode.java
index 8db4a68..fe4d39b 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LineNumberNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LineNumberNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,14 +29,14 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import java.util.Map;
+
/**
* A node that represents a line number declaration. These nodes are pseudo
* instruction nodes in order to be inserted in an instruction list.
- *
+ *
* @author Eric Bruneton
*/
public class LineNumberNode extends AbstractInsnNode {
@@ -54,7 +54,7 @@ public class LineNumberNode extends AbstractInsnNode {
/**
* Constructs a new {@link LineNumberNode}.
- *
+ *
* @param line a line number. This number refers to the source file from
* which the class was compiled.
* @param start the first instruction corresponding to this line number.
@@ -65,15 +65,18 @@ public class LineNumberNode extends AbstractInsnNode {
this.start = start;
}
+ @Override
public int getType() {
return LINE;
}
+ @Override
public void accept(final MethodVisitor mv) {
mv.visitLineNumber(line, start.getLabel());
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new LineNumberNode(line, clone(start, labels));
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableNode.java
index f8d7436..8494414 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,7 +33,7 @@ import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
/**
* A node that represents a local variable declaration.
- *
+ *
* @author Eric Bruneton
*/
public class LocalVariableNode {
@@ -72,7 +72,7 @@ public class LocalVariableNode {
/**
* Constructs a new {@link LocalVariableNode}.
- *
+ *
* @param name the name of a local variable.
* @param desc the type descriptor of this local variable.
* @param signature the signature of this local variable. May be
@@ -101,7 +101,7 @@ public class LocalVariableNode {
/**
* Makes the given visitor visit this local variable declaration.
- *
+ *
* @param mv a method visitor.
*/
public void accept(final MethodVisitor mv) {
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LookupSwitchInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LookupSwitchInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LookupSwitchInsnNode.java
index d991293..5beca30 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LookupSwitchInsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LookupSwitchInsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -33,14 +33,14 @@ import org.apache.tapestry5.internal.plastic.asm.Label;
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
import org.apache.tapestry5.internal.plastic.asm.Opcodes;
-import java.util.List;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import java.util.Map;
/**
* A node that represents a LOOKUPSWITCH instruction.
- *
+ *
* @author Eric Bruneton
*/
public class LookupSwitchInsnNode extends AbstractInsnNode {
@@ -53,17 +53,17 @@ public class LookupSwitchInsnNode extends AbstractInsnNode {
/**
* The values of the keys. This list is a list of {@link Integer} objects.
*/
- public List keys;
+ public List<Integer> keys;
/**
* Beginnings of the handler blocks. This list is a list of
* {@link LabelNode} objects.
*/
- public List labels;
+ public List<LabelNode> labels;
/**
* Constructs a new {@link LookupSwitchInsnNode}.
- *
+ *
* @param dflt beginning of the default handler block.
* @param keys the values of the keys.
* @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
@@ -76,8 +76,8 @@ public class LookupSwitchInsnNode extends AbstractInsnNode {
{
super(Opcodes.LOOKUPSWITCH);
this.dflt = dflt;
- this.keys = new ArrayList(keys == null ? 0 : keys.length);
- this.labels = new ArrayList(labels == null ? 0 : labels.length);
+ this.keys = new ArrayList<Integer>(keys == null ? 0 : keys.length);
+ this.labels = new ArrayList<LabelNode>(labels == null ? 0 : labels.length);
if (keys != null) {
for (int i = 0; i < keys.length; ++i) {
this.keys.add(new Integer(keys[i]));
@@ -88,23 +88,26 @@ public class LookupSwitchInsnNode extends AbstractInsnNode {
}
}
+ @Override
public int getType() {
return LOOKUPSWITCH_INSN;
}
+ @Override
public void accept(final MethodVisitor mv) {
int[] keys = new int[this.keys.size()];
for (int i = 0; i < keys.length; ++i) {
- keys[i] = ((Integer) this.keys.get(i)).intValue();
+ keys[i] = this.keys.get(i).intValue();
}
Label[] labels = new Label[this.labels.size()];
for (int i = 0; i < labels.length; ++i) {
- labels[i] = ((LabelNode) this.labels.get(i)).getLabel();
+ labels[i] = this.labels.get(i).getLabel();
}
mv.visitLookupSwitchInsn(dflt.getLabel(), keys, labels);
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
LookupSwitchInsnNode clone = new LookupSwitchInsnNode(clone(dflt,
labels), null, clone(this.labels, labels));
clone.keys.addAll(keys);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MemberNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MemberNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MemberNode.java
deleted file mode 100644
index 688f49a..0000000
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MemberNode.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the copyright holders nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-package org.apache.tapestry5.internal.plastic.asm.tree;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tapestry5.internal.plastic.asm.AnnotationVisitor;
-import org.apache.tapestry5.internal.plastic.asm.Attribute;
-
-/**
- * An abstract class, field or method node.
- *
- * @author Eric Bruneton
- */
-public abstract class MemberNode {
-
- /**
- * The runtime visible annotations of this class, field or method. This list
- * is a list of {@link AnnotationNode} objects. May be <tt>null</tt>.
- *
- * @associates org.objectweb.asm.tree.AnnotationNode
- * @label visible
- */
- public List visibleAnnotations;
-
- /**
- * The runtime invisible annotations of this class, field or method. This
- * list is a list of {@link AnnotationNode} objects. May be <tt>null</tt>.
- *
- * @associates org.objectweb.asm.tree.AnnotationNode
- * @label invisible
- */
- public List invisibleAnnotations;
-
- /**
- * The non standard attributes of this class, field or method. This list is
- * a list of {@link Attribute} objects. May be <tt>null</tt>.
- *
- * @associates org.objectweb.asm.Attribute
- */
- public List attrs;
-
- /**
- * Constructs a new {@link MemberNode}.
- */
- protected MemberNode() {
- }
-
- /**
- * Visits an annotation of this class, field or method.
- *
- * @param desc the class descriptor of the annotation class.
- * @param visible <tt>true</tt> if the annotation is visible at runtime.
- * @return a visitor to visit the annotation values.
- */
- public AnnotationVisitor visitAnnotation(
- final String desc,
- final boolean visible)
- {
- AnnotationNode an = new AnnotationNode(desc);
- if (visible) {
- if (visibleAnnotations == null) {
- visibleAnnotations = new ArrayList(1);
- }
- visibleAnnotations.add(an);
- } else {
- if (invisibleAnnotations == null) {
- invisibleAnnotations = new ArrayList(1);
- }
- invisibleAnnotations.add(an);
- }
- return an;
- }
-
- /**
- * Visits a non standard attribute of this class, field or method.
- *
- * @param attr an attribute.
- */
- public void visitAttribute(final Attribute attr) {
- if (attrs == null) {
- attrs = new ArrayList(1);
- }
- attrs.add(attr);
- }
-
- /**
- * Visits the end of this class, field or method.
- */
- public void visitEnd() {
- }
-}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/d6e5f413/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MethodInsnNode.java
----------------------------------------------------------------------
diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MethodInsnNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MethodInsnNode.java
index ed9c7a8..f87234c 100644
--- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MethodInsnNode.java
+++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/MethodInsnNode.java
@@ -1,6 +1,6 @@
/***
* ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2007 INRIA, France Telecom
+ * Copyright (c) 2000-2011 INRIA, France Telecom
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,14 +29,14 @@
*/
package org.apache.tapestry5.internal.plastic.asm.tree;
-import java.util.Map;
-
import org.apache.tapestry5.internal.plastic.asm.MethodVisitor;
+import java.util.Map;
+
/**
* A node that represents a method instruction. A method instruction is an
* instruction that invokes a method.
- *
+ *
* @author Eric Bruneton
*/
public class MethodInsnNode extends AbstractInsnNode {
@@ -59,13 +59,12 @@ public class MethodInsnNode extends AbstractInsnNode {
/**
* Constructs a new {@link MethodInsnNode}.
- *
+ *
* @param opcode the opcode of the type instruction to be constructed. This
- * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC,
- * INVOKEINTERFACE or INVOKEDYNAMIC.
+ * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or
+ * INVOKEINTERFACE.
* @param owner the internal name of the method's owner class (see
- * {@link org.apache.tapestry5.internal.plastic.asm.Type#getInternalName() getInternalName})
- * or {@link org.apache.tapestry5.internal.plastic.asm.Opcodes#INVOKEDYNAMIC_OWNER}.
+ * {@link org.apache.tapestry5.internal.plastic.asm.Type#getInternalName() getInternalName}).
* @param name the method's name.
* @param desc the method's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type}).
*/
@@ -83,7 +82,7 @@ public class MethodInsnNode extends AbstractInsnNode {
/**
* Sets the opcode of this instruction.
- *
+ *
* @param opcode the new instruction opcode. This opcode must be
* INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE.
*/
@@ -91,15 +90,18 @@ public class MethodInsnNode extends AbstractInsnNode {
this.opcode = opcode;
}
+ @Override
public int getType() {
return METHOD_INSN;
}
+ @Override
public void accept(final MethodVisitor mv) {
mv.visitMethodInsn(opcode, owner, name, desc);
}
- public AbstractInsnNode clone(final Map labels) {
+ @Override
+ public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) {
return new MethodInsnNode(opcode, owner, name, desc);
}
}
\ No newline at end of file