http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index 21fb269..c604cb4 --- 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 @@ -1,102 +1,92 @@ -/*** - * 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. - */ +// 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 java.util.Map; - import org.apache.tapestry5.internal.plastic.asm.Handle; import org.apache.tapestry5.internal.plastic.asm.MethodVisitor; import org.apache.tapestry5.internal.plastic.asm.Opcodes; /** * A node that represents an invokedynamic instruction. - * + * * @author Remi Forax */ public class InvokeDynamicInsnNode extends AbstractInsnNode { - /** - * Invokedynamic name. - */ - public String name; + /** The method's name. */ + public String name; - /** - * Invokedynamic descriptor. - */ - public String desc; + /** The method's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type}). */ + public String desc; - /** - * Bootstrap method - */ - public Handle bsm; + /** The bootstrap method. */ + public Handle bsm; - /** - * Bootstrap constant arguments - */ - public Object[] bsmArgs; + /** The bootstrap method constant arguments. */ + public Object[] bsmArgs; - /** - * Constructs a new {@link InvokeDynamicInsnNode}. - * - * @param name - * invokedynamic name. - * @param desc - * invokedynamic descriptor (see {@link org.objectweb.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; - } + /** + * Constructs a new {@link InvokeDynamicInsnNode}. + * + * @param name the method's name. + * @param descriptor the method's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type}). + * @param bootstrapMethodHandle the bootstrap method. + * @param bootstrapMethodArguments the bootstrap method constant arguments. Each argument must be + * an {@link Integer}, {@link Float}, {@link Long}, {@link Double}, {@link String}, {@link + * org.apache.tapestry5.internal.plastic.asm.Type} or {@link Handle} value. This method is allowed to modify the + * content of the array so a caller should expect that this array may change. + */ + public InvokeDynamicInsnNode( + final String name, + final String descriptor, + final Handle bootstrapMethodHandle, + final Object... bootstrapMethodArguments) { // NOPMD(ArrayIsStoredDirectly): public field. + super(Opcodes.INVOKEDYNAMIC); + this.name = name; + this.desc = descriptor; + this.bsm = bootstrapMethodHandle; + this.bsmArgs = bootstrapMethodArguments; + } - @Override - public int getType() { - return INVOKE_DYNAMIC_INSN; - } + @Override + public int getType() { + return INVOKE_DYNAMIC_INSN; + } - @Override - public void accept(final MethodVisitor mv) { - mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs); - acceptAnnotations(mv); - } + @Override + public void accept(final MethodVisitor methodVisitor) { + methodVisitor.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs); + acceptAnnotations(methodVisitor); + } - @Override - public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { - return new InvokeDynamicInsnNode(name, desc, bsm, bsmArgs) - .cloneAnnotations(this); - } -} \ No newline at end of file + @Override + public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { + return new InvokeDynamicInsnNode(name, desc, bsm, bsmArgs).cloneAnnotations(this); + } +}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index 386c900..e033874 --- 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,97 +1,87 @@ -/*** - * 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. - */ +// 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 java.util.Map; - import org.apache.tapestry5.internal.plastic.asm.MethodVisitor; /** - * A node that represents a jump instruction. A jump instruction is an - * instruction that may jump to another instruction. - * + * 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 { - /** - * The operand of this instruction. This operand is a label that designates - * the instruction to which this instruction may jump. - */ - public LabelNode label; + /** + * The operand of this instruction. This operand is a label that designates the instruction to + * which this instruction may jump. + */ + public LabelNode label; - /** - * 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, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL. - * @param label - * the operand of the instruction to be constructed. This operand - * is a label that designates the instruction to which the jump - * instruction may jump. - */ - public JumpInsnNode(final int opcode, final LabelNode label) { - super(opcode); - this.label = label; - } + /** + * 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, IF_ACMPNE, GOTO, JSR, IFNULL or IFNONNULL. + * @param label the operand of the instruction to be constructed. This operand is a label that + * designates the instruction to which the jump instruction may jump. + */ + public JumpInsnNode(final int opcode, final LabelNode label) { + super(opcode); + this.label = label; + } - /** - * 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, IFNULL or IFNONNULL. - */ - public void setOpcode(final int opcode) { - this.opcode = opcode; - } + /** + * 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, IFNULL or IFNONNULL. + */ + public void setOpcode(final int opcode) { + this.opcode = opcode; + } - @Override - public int getType() { - return JUMP_INSN; - } + @Override + public int getType() { + return JUMP_INSN; + } - @Override - public void accept(final MethodVisitor mv) { - mv.visitJumpInsn(opcode, label.getLabel()); - acceptAnnotations(mv); - } + @Override + public void accept(final MethodVisitor methodVisitor) { + methodVisitor.visitJumpInsn(opcode, label.getLabel()); + acceptAnnotations(methodVisitor); + } - @Override - public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { - return new JumpInsnNode(opcode, clone(label, labels)) - .cloneAnnotations(this); - } + @Override + public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { + return new JumpInsnNode(opcode, clone(label, clonedLabels)).cloneAnnotations(this); + } } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index 39c08ef..5711525 --- 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,78 +1,79 @@ -/*** - * 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. - */ +// 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 java.util.Map; - import org.apache.tapestry5.internal.plastic.asm.Label; import org.apache.tapestry5.internal.plastic.asm.MethodVisitor; -/** - * An {@link AbstractInsnNode} that encapsulates a {@link Label}. - */ +/** An {@link AbstractInsnNode} that encapsulates a {@link Label}. */ public class LabelNode extends AbstractInsnNode { - private Label label; + private Label value; - public LabelNode() { - super(-1); - } + public LabelNode() { + super(-1); + } - public LabelNode(final Label label) { - super(-1); - this.label = label; - } + public LabelNode(final Label label) { + super(-1); + this.value = label; + } - @Override - public int getType() { - return LABEL; - } + @Override + public int getType() { + return LABEL; + } - public Label getLabel() { - if (label == null) { - label = new Label(); - } - return label; + /** + * Returns the label encapsulated by this node. A new label is created and associated with this + * node if it was created without an encapsulated label. + * + * @return the label encapsulated by this node. + */ + public Label getLabel() { + if (value == null) { + value = new Label(); } + return value; + } - @Override - public void accept(final MethodVisitor cv) { - cv.visitLabel(getLabel()); - } + @Override + public void accept(final MethodVisitor methodVisitor) { + methodVisitor.visitLabel(getLabel()); + } - @Override - public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { - return labels.get(this); - } + @Override + public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { + return clonedLabels.get(this); + } - public void resetLabel() { - label = null; - } -} \ No newline at end of file + public void resetLabel() { + value = null; + } +} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index 458086d..06ef516 --- 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,79 +1,74 @@ -/*** - * 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. - */ +// 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 java.util.Map; - import org.apache.tapestry5.internal.plastic.asm.MethodVisitor; import org.apache.tapestry5.internal.plastic.asm.Opcodes; /** * A node that represents an LDC instruction. - * + * * @author Eric Bruneton */ public class LdcInsnNode extends AbstractInsnNode { - /** - * 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}, a - * {@link String} or a {@link org.objectweb.asm.Type}. - */ - public Object 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}, a {@link String} or a {@link + * org.apache.tapestry5.internal.plastic.asm.Type}. + */ + public Object cst; - /** - * 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}. - */ - public LdcInsnNode(final Object cst) { - super(Opcodes.LDC); - this.cst = cst; - } + /** + * Constructs a new {@link LdcInsnNode}. + * + * @param value 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}. + */ + public LdcInsnNode(final Object value) { + super(Opcodes.LDC); + this.cst = value; + } - @Override - public int getType() { - return LDC_INSN; - } + @Override + public int getType() { + return LDC_INSN; + } - @Override - public void accept(final MethodVisitor mv) { - mv.visitLdcInsn(cst); - acceptAnnotations(mv); - } + @Override + public void accept(final MethodVisitor methodVisitor) { + methodVisitor.visitLdcInsn(cst); + acceptAnnotations(methodVisitor); + } - @Override - public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { - return new LdcInsnNode(cst).cloneAnnotations(this); - } -} \ No newline at end of file + @Override + public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { + return new LdcInsnNode(cst).cloneAnnotations(this); + } +} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index c475ee8..e02faac --- 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,84 +1,74 @@ -/*** - * 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. - */ +// 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 java.util.Map; - import org.apache.tapestry5.internal.plastic.asm.MethodVisitor; /** - * A node that represents a line number declaration. These nodes are pseudo - * instruction nodes in order to be inserted in an instruction list. - * + * 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 { - /** - * A line number. This number refers to the source file from which the class - * was compiled. - */ - public int line; + /** A line number. This number refers to the source file from which the class was compiled. */ + public int line; - /** - * The first instruction corresponding to this line number. - */ - public LabelNode start; + /** The first instruction corresponding to this line number. */ + public LabelNode start; - /** - * 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. - */ - public LineNumberNode(final int line, final LabelNode start) { - super(-1); - this.line = line; - this.start = start; - } + /** + * 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. + */ + public LineNumberNode(final int line, final LabelNode start) { + super(-1); + this.line = line; + this.start = start; + } - @Override - public int getType() { - return LINE; - } + @Override + public int getType() { + return LINE; + } - @Override - public void accept(final MethodVisitor mv) { - mv.visitLineNumber(line, start.getLabel()); - } + @Override + public void accept(final MethodVisitor methodVisitor) { + methodVisitor.visitLineNumber(line, start.getLabel()); + } - @Override - public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { - return new LineNumberNode(line, clone(start, labels)); - } + @Override + public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { + return new LineNumberNode(line, clone(start, clonedLabels)); + } } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableAnnotationNode.java ---------------------------------------------------------------------- diff --git a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableAnnotationNode.java b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableAnnotationNode.java old mode 100644 new mode 100755 index 8da8627..ac1bc9c --- a/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableAnnotationNode.java +++ b/plastic/src/external/java/org/apache/tapestry5/internal/plastic/asm/tree/LocalVariableAnnotationNode.java @@ -1,157 +1,140 @@ -/*** - * 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 java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -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 org.apache.tapestry5.internal.plastic.asm.TypePath; -import org.apache.tapestry5.internal.plastic.asm.TypeReference; - -/** - * A node that represents a type annotation on a local or resource variable. - * - * @author Eric Bruneton - */ -public class LocalVariableAnnotationNode extends TypeAnnotationNode { - - /** - * The fist instructions corresponding to the continuous ranges that make - * the scope of this local variable (inclusive). Must not be <tt>null</tt>. - */ - public List<LabelNode> start; - - /** - * The last instructions corresponding to the continuous ranges that make - * the scope of this local variable (exclusive). This list must have the - * same size as the 'start' list. Must not be <tt>null</tt>. - */ - public List<LabelNode> end; - - /** - * The local variable's index in each range. This list must have the same - * size as the 'start' list. Must not be <tt>null</tt>. - */ - public List<Integer> index; - - /** - * Constructs a new {@link LocalVariableAnnotationNode}. <i>Subclasses must - * not use this constructor</i>. Instead, they must use the - * {@link #LocalVariableAnnotationNode(int, TypePath, LabelNode[], LabelNode[], int[], String)} - * version. - * - * @param typeRef - * a reference to the annotated type. See {@link TypeReference}. - * @param typePath - * the path to the annotated type argument, wildcard bound, array - * element type, or static inner type within 'typeRef'. May be - * <tt>null</tt> if the annotation targets 'typeRef' as a whole. - * @param start - * the fist instructions corresponding to the continuous ranges - * that make the scope of this local variable (inclusive). - * @param end - * the last instructions corresponding to the continuous ranges - * that make the scope of this local variable (exclusive). This - * array must have the same size as the 'start' array. - * @param index - * the local variable's index in each range. This array must have - * the same size as the 'start' array. - * @param desc - * the class descriptor of the annotation class. - */ - public LocalVariableAnnotationNode(int typeRef, TypePath typePath, - LabelNode[] start, LabelNode[] end, int[] index, String desc) { - this(Opcodes.ASM6, typeRef, typePath, start, end, index, desc); - } - - /** - * Constructs a new {@link LocalVariableAnnotationNode}. - * - * @param api - * the ASM API version implemented by this visitor. Must be one - * of {@link Opcodes#ASM4}, {@link Opcodes#ASM5} or {@link Opcodes#ASM6}. - * @param typeRef - * a reference to the annotated type. See {@link TypeReference}. - * @param start - * the fist instructions corresponding to the continuous ranges - * that make the scope of this local variable (inclusive). - * @param end - * the last instructions corresponding to the continuous ranges - * that make the scope of this local variable (exclusive). This - * array must have the same size as the 'start' array. - * @param index - * the local variable's index in each range. This array must have - * the same size as the 'start' array. - * @param typePath - * the path to the annotated type argument, wildcard bound, array - * element type, or static inner type within 'typeRef'. May be - * <tt>null</tt> if the annotation targets 'typeRef' as a whole. - * @param desc - * the class descriptor of the annotation class. - */ - public LocalVariableAnnotationNode(int api, int typeRef, TypePath typePath, - LabelNode[] start, LabelNode[] end, int[] index, String desc) { - super(api, typeRef, typePath, desc); - this.start = new ArrayList<LabelNode>(start.length); - this.start.addAll(Arrays.asList(start)); - this.end = new ArrayList<LabelNode>(end.length); - this.end.addAll(Arrays.asList(end)); - this.index = new ArrayList<Integer>(index.length); - for (int i : index) { - this.index.add(i); - } - } - - /** - * Makes the given visitor visit this type annotation. - * - * @param mv - * the visitor that must visit this annotation. - * @param visible - * <tt>true</tt> if the annotation is visible at runtime. - */ - public void accept(final MethodVisitor mv, boolean visible) { - Label[] start = new Label[this.start.size()]; - Label[] end = new Label[this.end.size()]; - int[] index = new int[this.index.size()]; - for (int i = 0; i < start.length; ++i) { - start[i] = this.start.get(i).getLabel(); - end[i] = this.end.get(i).getLabel(); - index[i] = this.index.get(i); - } - accept(mv.visitLocalVariableAnnotation(typeRef, typePath, start, end, - index, desc, visible)); - } -} +// 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 java.util.List; +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 org.apache.tapestry5.internal.plastic.asm.TypePath; + +/** + * A node that represents a type annotation on a local or resource variable. + * + * @author Eric Bruneton + */ +public class LocalVariableAnnotationNode extends TypeAnnotationNode { + + /** + * The fist instructions corresponding to the continuous ranges that make the scope of this local + * variable (inclusive). Must not be {@literal null}. + */ + public List<LabelNode> start; + + /** + * The last instructions corresponding to the continuous ranges that make the scope of this local + * variable (exclusive). This list must have the same size as the 'start' list. Must not be + * {@literal null}. + */ + public List<LabelNode> end; + + /** + * The local variable's index in each range. This list must have the same size as the 'start' + * list. Must not be {@literal null}. + */ + public List<Integer> index; + + /** + * Constructs a new {@link LocalVariableAnnotationNode}. <i>Subclasses must not use this + * constructor</i>. Instead, they must use the {@link #LocalVariableAnnotationNode(int, TypePath, + * LabelNode[], LabelNode[], int[], String)} version. + * + * @param typeRef a reference to the annotated type. See {@link org.apache.tapestry5.internal.plastic.asm.TypeReference}. + * @param typePath the path to the annotated type argument, wildcard bound, array element type, or + * static inner type within 'typeRef'. May be {@literal null} if the annotation targets + * 'typeRef' as a whole. + * @param start the fist instructions corresponding to the continuous ranges that make the scope + * of this local variable (inclusive). + * @param end the last instructions corresponding to the continuous ranges that make the scope of + * this local variable (exclusive). This array must have the same size as the 'start' array. + * @param index the local variable's index in each range. This array must have the same size as + * the 'start' array. + * @param descriptor the class descriptor of the annotation class. + */ + public LocalVariableAnnotationNode( + final int typeRef, + final TypePath typePath, + final LabelNode[] start, + final LabelNode[] end, + final int[] index, + final String descriptor) { + this(Opcodes.ASM7, typeRef, typePath, start, end, index, descriptor); + } + + /** + * Constructs a new {@link LocalVariableAnnotationNode}. + * + * @param api the ASM API version implemented by this visitor. Must be one of {@link + * Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link Opcodes#ASM6} or {@link Opcodes#ASM7}. + * @param typeRef a reference to the annotated type. See {@link org.apache.tapestry5.internal.plastic.asm.TypeReference}. + * @param start the fist instructions corresponding to the continuous ranges that make the scope + * of this local variable (inclusive). + * @param end the last instructions corresponding to the continuous ranges that make the scope of + * this local variable (exclusive). This array must have the same size as the 'start' array. + * @param index the local variable's index in each range. This array must have the same size as + * the 'start' array. + * @param typePath the path to the annotated type argument, wildcard bound, array element type, or + * static inner type within 'typeRef'. May be {@literal null} if the annotation targets + * 'typeRef' as a whole. + * @param descriptor the class descriptor of the annotation class. + */ + public LocalVariableAnnotationNode( + final int api, + final int typeRef, + final TypePath typePath, + final LabelNode[] start, + final LabelNode[] end, + final int[] index, + final String descriptor) { + super(api, typeRef, typePath, descriptor); + this.start = Util.asArrayList(start); + this.end = Util.asArrayList(end); + this.index = Util.asArrayList(index); + } + + /** + * Makes the given visitor visit this type annotation. + * + * @param methodVisitor the visitor that must visit this annotation. + * @param visible {@literal true} if the annotation is visible at runtime. + */ + public void accept(final MethodVisitor methodVisitor, final boolean visible) { + Label[] startLabels = new Label[this.start.size()]; + Label[] endLabels = new Label[this.end.size()]; + int[] indices = new int[this.index.size()]; + for (int i = 0, n = startLabels.length; i < n; ++i) { + startLabels[i] = this.start.get(i).getLabel(); + endLabels[i] = this.end.get(i).getLabel(); + indices[i] = this.index.get(i); + } + accept( + methodVisitor.visitLocalVariableAnnotation( + typeRef, typePath, startLabels, endLabels, indices, desc, visible)); + } +} http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index 775a6e8..e00438b --- 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,112 +1,92 @@ -/*** - * 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. - */ +// 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.MethodVisitor; /** * A node that represents a local variable declaration. - * + * * @author Eric Bruneton */ public class LocalVariableNode { - /** - * The name of a local variable. - */ - public String name; + /** The name of a local variable. */ + public String name; - /** - * The type descriptor of this local variable. - */ - public String desc; + /** The type descriptor of this local variable. */ + public String desc; - /** - * The signature of this local variable. May be <tt>null</tt>. - */ - public String signature; + /** The signature of this local variable. May be {@literal null}. */ + public String signature; - /** - * The first instruction corresponding to the scope of this local variable - * (inclusive). - */ - public LabelNode start; + /** The first instruction corresponding to the scope of this local variable (inclusive). */ + public LabelNode start; - /** - * The last instruction corresponding to the scope of this local variable - * (exclusive). - */ - public LabelNode end; + /** The last instruction corresponding to the scope of this local variable (exclusive). */ + public LabelNode end; - /** - * The local variable's index. - */ - public int index; + /** The local variable's index. */ + public int index; - /** - * 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 <tt>null</tt>. - * @param start - * the first instruction corresponding to the scope of this local - * variable (inclusive). - * @param end - * the last instruction corresponding to the scope of this local - * variable (exclusive). - * @param index - * the local variable's index. - */ - public LocalVariableNode(final String name, final String desc, - final String signature, final LabelNode start, final LabelNode end, - final int index) { - this.name = name; - this.desc = desc; - this.signature = signature; - this.start = start; - this.end = end; - this.index = index; - } + /** + * Constructs a new {@link LocalVariableNode}. + * + * @param name the name of a local variable. + * @param descriptor the type descriptor of this local variable. + * @param signature the signature of this local variable. May be {@literal null}. + * @param start the first instruction corresponding to the scope of this local variable + * (inclusive). + * @param end the last instruction corresponding to the scope of this local variable (exclusive). + * @param index the local variable's index. + */ + public LocalVariableNode( + final String name, + final String descriptor, + final String signature, + final LabelNode start, + final LabelNode end, + final int index) { + this.name = name; + this.desc = descriptor; + this.signature = signature; + this.start = start; + this.end = end; + this.index = index; + } - /** - * Makes the given visitor visit this local variable declaration. - * - * @param mv - * a method visitor. - */ - public void accept(final MethodVisitor mv) { - mv.visitLocalVariable(name, desc, signature, start.getLabel(), - end.getLabel(), index); - } + /** + * Makes the given visitor visit this local variable declaration. + * + * @param methodVisitor a method visitor. + */ + public void accept(final MethodVisitor methodVisitor) { + methodVisitor.visitLocalVariable( + name, desc, signature, start.getLabel(), end.getLabel(), index); + } } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index 0ecad60..f339b17 --- 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,118 +1,93 @@ -/*** - * 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. - */ +// 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 java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Map; - import org.apache.tapestry5.internal.plastic.asm.Label; import org.apache.tapestry5.internal.plastic.asm.MethodVisitor; import org.apache.tapestry5.internal.plastic.asm.Opcodes; /** * A node that represents a LOOKUPSWITCH instruction. - * + * * @author Eric Bruneton */ public class LookupSwitchInsnNode extends AbstractInsnNode { - /** - * Beginning of the default handler block. - */ - public LabelNode dflt; + /** Beginning of the default handler block. */ + public LabelNode dflt; - /** - * The values of the keys. This list is a list of {@link Integer} objects. - */ - public List<Integer> keys; + /** The values of the keys. */ + public List<Integer> keys; - /** - * Beginnings of the handler blocks. This list is a list of - * {@link LabelNode} objects. - */ - public List<LabelNode> labels; + /** Beginnings of the handler blocks. */ + 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 the - * beginning of the handler block for the <tt>keys[i]</tt> key. - */ - public LookupSwitchInsnNode(final LabelNode dflt, final int[] keys, - final LabelNode[] labels) { - super(Opcodes.LOOKUPSWITCH); - this.dflt = dflt; - 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(keys[i]); - } - } - if (labels != null) { - this.labels.addAll(Arrays.asList(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. {@code labels[i]} is the beginning of the + * handler block for the {@code keys[i]} key. + */ + public LookupSwitchInsnNode(final LabelNode dflt, final int[] keys, final LabelNode[] labels) { + super(Opcodes.LOOKUPSWITCH); + this.dflt = dflt; + this.keys = Util.asArrayList(keys); + this.labels = Util.asArrayList(labels); + } - @Override - public int getType() { - return LOOKUPSWITCH_INSN; - } + @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] = this.keys.get(i).intValue(); - } - Label[] labels = new Label[this.labels.size()]; - for (int i = 0; i < labels.length; ++i) { - labels[i] = this.labels.get(i).getLabel(); - } - mv.visitLookupSwitchInsn(dflt.getLabel(), keys, labels); - acceptAnnotations(mv); + @Override + public void accept(final MethodVisitor methodVisitor) { + int[] keysArray = new int[this.keys.size()]; + for (int i = 0, n = keysArray.length; i < n; ++i) { + keysArray[i] = this.keys.get(i).intValue(); } - - @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); - return clone.cloneAnnotations(this); + Label[] labelsArray = new Label[this.labels.size()]; + for (int i = 0, n = labelsArray.length; i < n; ++i) { + labelsArray[i] = this.labels.get(i).getLabel(); } + methodVisitor.visitLookupSwitchInsn(dflt.getLabel(), keysArray, labelsArray); + acceptAnnotations(methodVisitor); + } + + @Override + public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { + LookupSwitchInsnNode clone = + new LookupSwitchInsnNode(clone(dflt, clonedLabels), null, clone(labels, clonedLabels)); + clone.keys.addAll(keys); + return clone.cloneAnnotations(this); + } } http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/1c71aec7/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 old mode 100644 new mode 100755 index 8d86df7..530ea1d --- 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,141 +1,126 @@ -/*** - * 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. - */ +// 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 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 a method instruction. A method instruction is an - * instruction that invokes a method. - * + * 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 { - /** - * The internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() getInternalName}). - */ - public String owner; + /** + * The internal name of the method's owner class (see {@link + * org.apache.tapestry5.internal.plastic.asm.Type#getInternalName()}). + * + * <p>For methods of arrays, e.g., {@code clone()}, the array type descriptor. + */ + public String owner; - /** - * The method's name. - */ - public String name; + /** The method's name. */ + public String name; - /** - * The method's descriptor (see {@link org.objectweb.asm.Type}). - */ - public String desc; + /** The method's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type}). */ + public String desc; - /** - * If the method's owner class if an interface. - */ - public boolean itf; + /** Whether the method's owner class if an interface. */ + public boolean itf; - /** - * Constructs a new {@link MethodInsnNode}. - * - * @param opcode - * the opcode of the type instruction to be constructed. This - * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or - * INVOKEINTERFACE. - * @param owner - * the internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() - * getInternalName}). - * @param name - * the method's name. - * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type}). - */ - @Deprecated - public MethodInsnNode(final int opcode, final String owner, - final String name, final String desc) { - this(opcode, owner, name, desc, opcode == Opcodes.INVOKEINTERFACE); - } + /** + * Constructs a new {@link MethodInsnNode}. + * + * @param opcode the opcode of the type instruction to be constructed. This 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()}). + * @param name the method's name. + * @param descriptor the method's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type}). + * @deprecated use {@link #MethodInsnNode(int, String, String, String, boolean)} instead. + */ + @Deprecated + public MethodInsnNode( + final int opcode, final String owner, final String name, final String descriptor) { + this(opcode, owner, name, descriptor, opcode == Opcodes.INVOKEINTERFACE); + } - /** - * Constructs a new {@link MethodInsnNode}. - * - * @param opcode - * the opcode of the type instruction to be constructed. This - * opcode must be INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or - * INVOKEINTERFACE. - * @param owner - * the internal name of the method's owner class (see - * {@link org.objectweb.asm.Type#getInternalName() - * getInternalName}). - * @param name - * the method's name. - * @param desc - * the method's descriptor (see {@link org.objectweb.asm.Type}). - * @param itf - * if the method's owner class is an interface. - */ - public MethodInsnNode(final int opcode, final String owner, - final String name, final String desc, final boolean itf) { - super(opcode); - this.owner = owner; - this.name = name; - this.desc = desc; - this.itf = itf; - } + /** + * Constructs a new {@link MethodInsnNode}. + * + * @param opcode the opcode of the type instruction to be constructed. This 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()}). + * @param name the method's name. + * @param descriptor the method's descriptor (see {@link org.apache.tapestry5.internal.plastic.asm.Type}). + * @param isInterface if the method's owner class is an interface. + */ + public MethodInsnNode( + final int opcode, + final String owner, + final String name, + final String descriptor, + final boolean isInterface) { + super(opcode); + this.owner = owner; + this.name = name; + this.desc = descriptor; + this.itf = isInterface; + } - /** - * Sets the opcode of this instruction. - * - * @param opcode - * the new instruction opcode. This opcode must be INVOKEVIRTUAL, - * INVOKESPECIAL, INVOKESTATIC or INVOKEINTERFACE. - */ - public void setOpcode(final int opcode) { - this.opcode = opcode; - } + /** + * Sets the opcode of this instruction. + * + * @param opcode the new instruction opcode. This opcode must be INVOKEVIRTUAL, INVOKESPECIAL, + * INVOKESTATIC or INVOKEINTERFACE. + */ + public void setOpcode(final int opcode) { + this.opcode = opcode; + } - @Override - public int getType() { - return METHOD_INSN; - } + @Override + public int getType() { + return METHOD_INSN; + } - @Override - public void accept(final MethodVisitor mv) { - mv.visitMethodInsn(opcode, owner, name, desc, itf); - acceptAnnotations(mv); - } + @Override + public void accept(final MethodVisitor methodVisitor) { + methodVisitor.visitMethodInsn(opcode, owner, name, desc, itf); + acceptAnnotations(methodVisitor); + } - @Override - public AbstractInsnNode clone(final Map<LabelNode, LabelNode> labels) { - return new MethodInsnNode(opcode, owner, name, desc, itf); - } -} \ No newline at end of file + @Override + public AbstractInsnNode clone(final Map<LabelNode, LabelNode> clonedLabels) { + return new MethodInsnNode(opcode, owner, name, desc, itf).cloneAnnotations(this); + } +}
