[jboss-svn-commits] JBL Code SVN: r9427 - in labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm: util and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Feb 10 11:47:07 EST 2007
Author: mark.proctor at jboss.com
Date: 2007-02-10 11:47:06 -0500 (Sat, 10 Feb 2007)
New Revision: 9427
Removed:
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AbstractInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AnnotationNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/ClassNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IincInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InnerClassNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IntInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/JumpInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LabelNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LdcInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LineNumberNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LocalVariableNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LookupSwitchInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MemberNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MultiANewArrayInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TableSwitchInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TryCatchBlockNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TypeInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/VarInsnNode.java
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/analysis/
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/package.html
labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/util/CheckClassAdapter.java
Log:
-removed asm tree anlysis, as we don't use it.
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AbstractInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AbstractInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AbstractInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,143 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents a bytecode instruction.
- *
- * @author Eric Bruneton
- */
-public abstract class AbstractInsnNode {
-
- /**
- * The type of {@link InsnNode} instructions.
- */
- public final static int INSN = 0;
-
- /**
- * The type of {@link IntInsnNode} instructions.
- */
- public final static int INT_INSN = 1;
-
- /**
- * The type of {@link VarInsnNode} instructions.
- */
- public final static int VAR_INSN = 2;
-
- /**
- * The type of {@link TypeInsnNode} instructions.
- */
- public final static int TYPE_INSN = 3;
-
- /**
- * The type of {@link FieldInsnNode} instructions.
- */
- public final static int FIELD_INSN = 4;
-
- /**
- * The type of {@link MethodInsnNode} instructions.
- */
- public final static int METHOD_INSN = 5;
-
- /**
- * The type of {@link JumpInsnNode} instructions.
- */
- public final static int JUMP_INSN = 6;
-
- /**
- * The type of {@link LabelNode} "instructions".
- */
- public final static int LABEL = 7;
-
- /**
- * The type of {@link LdcInsnNode} instructions.
- */
- public final static int LDC_INSN = 8;
-
- /**
- * The type of {@link IincInsnNode} instructions.
- */
- public final static int IINC_INSN = 9;
-
- /**
- * The type of {@link TableSwitchInsnNode} instructions.
- */
- public final static int TABLESWITCH_INSN = 10;
-
- /**
- * The type of {@link LookupSwitchInsnNode} instructions.
- */
- public final static int LOOKUPSWITCH_INSN = 11;
-
- /**
- * The type of {@link MultiANewArrayInsnNode} instructions.
- */
- public final static int MULTIANEWARRAY_INSN = 12;
-
- /**
- * The opcode of this instruction.
- */
- protected int opcode;
-
- /**
- * Constructs a new {@link AbstractInsnNode}.
- *
- * @param opcode the opcode of the instruction to be constructed.
- */
- protected AbstractInsnNode(final int opcode) {
- this.opcode = opcode;
- }
-
- /**
- * Returns the opcode of this instruction.
- *
- * @return the opcode of this instruction.
- */
- public int getOpcode() {
- return this.opcode;
- }
-
- /**
- * Returns the type of this instruction.
- *
- * @return the type of this instruction, i.e. one the constants defined in
- * this class.
- */
- public abstract int getType();
-
- /**
- * Makes the given code visitor visit this instruction.
- *
- * @param cv a code visitor.
- */
- public abstract void accept(final MethodVisitor cv);
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AnnotationNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AnnotationNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/AnnotationNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,192 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.asm.AnnotationVisitor;
-
-/**
- * A node that represents an annotationn.
- *
- * @author Eric Bruneton
- */
-public class AnnotationNode
- implements
- AnnotationVisitor {
-
- /**
- * The class descriptor of the annotation class.
- */
- public String desc;
-
- /**
- * The name value pairs of this annotation. Each name value pair is stored
- * as two consecutive elements in the list. The name is a {@link String},
- * and the value may be a {@link Byte}, {@link Boolean}, {@link Character},
- * {@link Short}, {@link Integer}, {@link Long}, {@link Float},
- * {@link Double}, {@link String} or {@link org.drools.asm.Type}, or an
- * two elements String array (for enumeration values), a
- * {@link AnnotationNode}, or a {@link List} of values of one of the
- * preceding types. The list may be <tt>null</tt> if there is no name
- * value pair.
- */
- public List values;
-
- /**
- * Constructs a new {@link AnnotationNode}.
- *
- * @param desc the class descriptor of the annotation class.
- */
- public AnnotationNode(final String desc) {
- this.desc = desc;
- }
-
- /**
- * Constructs a new {@link AnnotationNode} to visit an array value.
- *
- * @param values where the visited values must be stored.
- */
- AnnotationNode(final List values) {
- this.values = values;
- }
-
- // ------------------------------------------------------------------------
- // Implementation of the AnnotationVisitor interface
- // ------------------------------------------------------------------------
-
- public void visit(final String name,
- final Object value) {
- if ( this.values == null ) {
- this.values = new ArrayList( this.desc != null ? 2 : 1 );
- }
- if ( this.desc != null ) {
- this.values.add( name );
- }
- this.values.add( value );
- }
-
- public void visitEnum(final String name,
- final String desc,
- final String value) {
- if ( this.values == null ) {
- this.values = new ArrayList( this.desc != null ? 2 : 1 );
- }
- if ( this.desc != null ) {
- this.values.add( name );
- }
- this.values.add( new String[]{desc, value} );
- }
-
- public AnnotationVisitor visitAnnotation(final String name,
- final String desc) {
- if ( this.values == null ) {
- this.values = new ArrayList( this.desc != null ? 2 : 1 );
- }
- if ( this.desc != null ) {
- this.values.add( name );
- }
- final AnnotationNode annotation = new AnnotationNode( desc );
- this.values.add( annotation );
- return annotation;
- }
-
- public AnnotationVisitor visitArray(final String name) {
- if ( this.values == null ) {
- this.values = new ArrayList( this.desc != null ? 2 : 1 );
- }
- if ( this.desc != null ) {
- this.values.add( name );
- }
- final List array = new ArrayList();
- this.values.add( array );
- return new AnnotationNode( array );
- }
-
- public void visitEnd() {
- }
-
- // ------------------------------------------------------------------------
- // Accept methods
- // ------------------------------------------------------------------------
-
- /**
- * Makes the given visitor visit this annotation.
- *
- * @param av an annotation visitor.
- */
- public void accept(final AnnotationVisitor av) {
- if ( this.values != null ) {
- for ( int i = 0; i < this.values.size(); i += 2 ) {
- final String name = (String) this.values.get( i );
- final Object value = this.values.get( i + 1 );
- accept( av,
- name,
- value );
- }
- }
- av.visitEnd();
- }
-
- /**
- * Makes the given visitor visit a given annotation value.
- *
- * @param av an annotation visitor.
- * @param name the value name.
- * @param value the actual value.
- */
- static void accept(final AnnotationVisitor av,
- final String name,
- final Object value) {
- if ( value instanceof String[] ) {
- final String[] typeconst = (String[]) value;
- av.visitEnum( name,
- typeconst[0],
- typeconst[1] );
- } else if ( value instanceof AnnotationNode ) {
- final AnnotationNode an = (AnnotationNode) value;
- an.accept( av.visitAnnotation( name,
- an.desc ) );
- } else if ( value instanceof List ) {
- final AnnotationVisitor v = av.visitArray( name );
- final List array = (List) value;
- for ( int j = 0; j < array.size(); ++j ) {
- accept( v,
- null,
- array.get( j ) );
- }
- v.visitEnd();
- } else {
- av.visit( name,
- value );
- }
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/ClassNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/ClassNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/ClassNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,290 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.drools.asm.Attribute;
-import org.drools.asm.ClassVisitor;
-import org.drools.asm.FieldVisitor;
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents a class.
- *
- * @author Eric Bruneton
- */
-public class ClassNode extends MemberNode
- implements
- ClassVisitor {
-
- /**
- * The class version.
- */
- public int version;
-
- /**
- * The class's access flags (see {@link org.drools.asm.Opcodes}). This
- * field also indicates if the class is deprecated.
- */
- public int access;
-
- /**
- * The internal name of the class (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}).
- */
- public String name;
-
- /**
- * The signature of the class. Mayt be <tt>null</tt>.
- */
- public String signature;
-
- /**
- * The internal of name of the super class (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}). For
- * interfaces, the super class is {@link Object}. May be <tt>null</tt>,
- * but only for the {@link Object} class.
- */
- public String superName;
-
- /**
- * The internal names of the class's interfaces (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}). This
- * list is a list of {@link String} objects.
- */
- public List interfaces;
-
- /**
- * The name of the source file from which this class was compiled. May be
- * <tt>null</tt>.
- */
- public String sourceFile;
-
- /**
- * Debug information to compute the correspondance between source and
- * compiled elements of the class. May be <tt>null</tt>.
- */
- public String sourceDebug;
-
- /**
- * The internal name of the enclosing class of the class. May be
- * <tt>null</tt>.
- */
- public String outerClass;
-
- /**
- * The name of the method that contains the class, or <tt>null</tt> if the
- * class is not enclosed in a method.
- */
- public String outerMethod;
-
- /**
- * The descriptor of the method that contains the class, or <tt>null</tt>
- * if the class is not enclosed in a method.
- */
- public String outerMethodDesc;
-
- /**
- * Informations about the inner classes of this class. This list is a list
- * of {@link InnerClassNode} objects.
- *
- * @associates org.objectweb.asm.tree.InnerClassNode
- */
- public List innerClasses;
-
- /**
- * The fields of this class. This list is a list of {@link FieldNode}
- * objects.
- *
- * @associates org.objectweb.asm.tree.FieldNode
- */
- public List fields;
-
- /**
- * The methods of this class. This list is a list of {@link MethodNode}
- * objects.
- *
- * @associates org.objectweb.asm.tree.MethodNode
- */
- public List methods;
-
- /**
- * Constructs a new {@link ClassNode}.
- */
- public ClassNode() {
- this.interfaces = new ArrayList();
- this.innerClasses = new ArrayList();
- this.fields = new ArrayList();
- this.methods = new ArrayList();
- }
-
- // ------------------------------------------------------------------------
- // Implementation of the ClassVisitor interface
- // ------------------------------------------------------------------------
-
- public void visit(final int version,
- final int access,
- final String name,
- final String signature,
- final String superName,
- final String[] interfaces) {
- this.version = version;
- this.access = access;
- this.name = name;
- this.signature = signature;
- this.superName = superName;
- if ( interfaces != null ) {
- this.interfaces.addAll( Arrays.asList( interfaces ) );
- }
- }
-
- public void visitSource(final String file,
- final String debug) {
- this.sourceFile = file;
- this.sourceDebug = debug;
- }
-
- public void visitOuterClass(final String owner,
- final String name,
- final String desc) {
- this.outerClass = owner;
- this.outerMethod = name;
- this.outerMethodDesc = desc;
- }
-
- public void visitInnerClass(final String name,
- final String outerName,
- final String innerName,
- final int access) {
- final InnerClassNode icn = new InnerClassNode( name,
- outerName,
- innerName,
- access );
- this.innerClasses.add( icn );
- }
-
- public FieldVisitor visitField(final int access,
- final String name,
- final String desc,
- final String signature,
- final Object value) {
- final FieldNode fn = new FieldNode( access,
- name,
- desc,
- signature,
- value );
- this.fields.add( fn );
- return fn;
- }
-
- public MethodVisitor visitMethod(final int access,
- final String name,
- final String desc,
- final String signature,
- final String[] exceptions) {
- final MethodNode mn = new MethodNode( access,
- name,
- desc,
- signature,
- exceptions );
- this.methods.add( mn );
- return mn;
- }
-
- public void visitEnd() {
- }
-
- // ------------------------------------------------------------------------
- // Accept method
- // ------------------------------------------------------------------------
-
- /**
- * Makes the given class visitor visit this class.
- *
- * @param cv a class visitor.
- */
- public void accept(final ClassVisitor cv) {
- // visits header
- final String[] interfaces = new String[this.interfaces.size()];
- this.interfaces.toArray( interfaces );
- cv.visit( this.version,
- this.access,
- this.name,
- this.signature,
- this.superName,
- interfaces );
- // visits source
- if ( this.sourceFile != null || this.sourceDebug != null ) {
- cv.visitSource( this.sourceFile,
- this.sourceDebug );
- }
- // visits outer class
- if ( this.outerClass != null ) {
- cv.visitOuterClass( this.outerClass,
- this.outerMethod,
- this.outerMethodDesc );
- }
- // visits attributes
- int i, n;
- n = this.visibleAnnotations == null ? 0 : this.visibleAnnotations.size();
- for ( i = 0; i < n; ++i ) {
- final AnnotationNode an = (AnnotationNode) this.visibleAnnotations.get( i );
- an.accept( cv.visitAnnotation( an.desc,
- true ) );
- }
- n = this.invisibleAnnotations == null ? 0 : this.invisibleAnnotations.size();
- for ( i = 0; i < n; ++i ) {
- final AnnotationNode an = (AnnotationNode) this.invisibleAnnotations.get( i );
- an.accept( cv.visitAnnotation( an.desc,
- false ) );
- }
- n = this.attrs == null ? 0 : this.attrs.size();
- for ( i = 0; i < n; ++i ) {
- cv.visitAttribute( (Attribute) this.attrs.get( i ) );
- }
- // visits inner classes
- for ( i = 0; i < this.innerClasses.size(); ++i ) {
- ((InnerClassNode) this.innerClasses.get( i )).accept( cv );
- }
- // visits fields
- for ( i = 0; i < this.fields.size(); ++i ) {
- ((FieldNode) this.fields.get( i )).accept( cv );
- }
- // visits methods
- for ( i = 0; i < this.methods.size(); ++i ) {
- ((MethodNode) this.methods.get( i )).accept( cv );
- }
- // visits end
- cv.visitEnd();
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,98 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-
-/**
- * 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 {
-
- /**
- * The internal name of the field's owner class (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}).
- */
- public String owner;
-
- /**
- * The field's name.
- */
- public String name;
-
- /**
- * The field's descriptor (see {@link org.drools.asm.Type}).
- */
- public String desc;
-
- /**
- * 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
- * {@link org.drools.asm.Type#getInternalName() getInternalName}).
- * @param name the field's name.
- * @param desc the field's descriptor (see {@link org.drools.asm.Type}).
- */
- public FieldInsnNode(final int opcode,
- final String owner,
- final String name,
- final String desc) {
- super( opcode );
- this.owner = owner;
- this.name = name;
- this.desc = desc;
- }
-
- /**
- * Sets the opcode of this instruction.
- *
- * @param opcode the new instruction opcode. This opcode must be GETSTATIC,
- * PUTSTATIC, GETFIELD or PUTFIELD.
- */
- public void setOpcode(final int opcode) {
- this.opcode = opcode;
- }
-
- public void accept(final MethodVisitor cv) {
- cv.visitFieldInsn( this.opcode,
- this.owner,
- this.name,
- this.desc );
- }
-
- public int getType() {
- return AbstractInsnNode.FIELD_INSN;
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/FieldNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,129 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.Attribute;
-import org.drools.asm.ClassVisitor;
-import org.drools.asm.FieldVisitor;
-
-/**
- * A node that represents a field.
- *
- * @author Eric Bruneton
- */
-public class FieldNode extends MemberNode
- implements
- FieldVisitor {
-
- /**
- * The field's access flags (see {@link org.drools.asm.Opcodes}). This
- * field also indicates if the field is synthetic and/or deprecated.
- */
- public int access;
-
- /**
- * The field's name.
- */
- public String name;
-
- /**
- * The field's descriptor (see {@link org.drools.asm.Type}).
- */
- public String desc;
-
- /**
- * The field's signature. May be <tt>null</tt>.
- */
- public String signature;
-
- /**
- * The field's initial value. This field, 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 Object value;
-
- /**
- * Constructs a new {@link FieldNode}.
- *
- * @param access the field's access flags (see
- * {@link org.drools.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.drools.asm.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 access,
- final String name,
- final String desc,
- final String signature,
- final Object value) {
- this.access = access;
- this.name = name;
- this.desc = desc;
- this.signature = signature;
- this.value = value;
- }
-
- /**
- * Makes the given class visitor visit this field.
- *
- * @param cv a class visitor.
- */
- public void accept(final ClassVisitor cv) {
- final FieldVisitor fv = cv.visitField( this.access,
- this.name,
- this.desc,
- this.signature,
- this.value );
- int i, n;
- n = this.visibleAnnotations == null ? 0 : this.visibleAnnotations.size();
- for ( i = 0; i < n; ++i ) {
- final AnnotationNode an = (AnnotationNode) this.visibleAnnotations.get( i );
- an.accept( fv.visitAnnotation( an.desc,
- true ) );
- }
- n = this.invisibleAnnotations == null ? 0 : this.invisibleAnnotations.size();
- for ( i = 0; i < n; ++i ) {
- final AnnotationNode an = (AnnotationNode) this.invisibleAnnotations.get( i );
- an.accept( fv.visitAnnotation( an.desc,
- false ) );
- }
- n = this.attrs == null ? 0 : this.attrs.size();
- for ( i = 0; i < n; ++i ) {
- fv.visitAttribute( (Attribute) this.attrs.get( i ) );
- }
- fv.visitEnd();
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IincInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IincInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IincInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,73 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-import org.drools.asm.Opcodes;
-
-/**
- * A node that represents an IINC instruction.
- *
- * @author Eric Bruneton
- */
-public class IincInsnNode extends AbstractInsnNode {
-
- /**
- * Index of the local variable to be incremented.
- */
- public int var;
-
- /**
- * Amount to increment the local variable by.
- */
- public int incr;
-
- /**
- * 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.
- */
- public IincInsnNode(final int var,
- final int incr) {
- super( Opcodes.IINC );
- this.var = var;
- this.incr = incr;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitIincInsn( this.var,
- this.incr );
- }
-
- public int getType() {
- return AbstractInsnNode.IINC_INSN;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InnerClassNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InnerClassNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InnerClassNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,102 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.ClassVisitor;
-
-/**
- * A node that represents an inner class.
- *
- * @author Eric Bruneton
- */
-public class InnerClassNode {
-
- /**
- * The internal name of an inner class (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}).
- */
- public String name;
-
- /**
- * The internal name of the class to which the inner class belongs (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}). May
- * be <tt>null</tt>.
- */
- public String outerName;
-
- /**
- * The (simple) name of the inner class inside its enclosing class. May be
- * <tt>null</tt> for anonymous inner classes.
- */
- public String innerName;
-
- /**
- * The access flags of the inner class as originally declared in the
- * enclosing class.
- */
- public int access;
-
- /**
- * Constructs a new {@link InnerClassNode}.
- *
- * @param name the internal name of an inner class (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}).
- * @param outerName the internal name of the class to which the inner class
- * belongs (see
- * {@link org.drools.asm.Type#getInternalName() getInternalName}).
- * May be <tt>null</tt>.
- * @param innerName the (simple) name of the inner class inside its
- * enclosing class. May be <tt>null</tt> for anonymous inner
- * classes.
- * @param access the access flags of the inner class as originally declared
- * in the enclosing class.
- */
- public InnerClassNode(final String name,
- final String outerName,
- final String innerName,
- final int access) {
- this.name = name;
- this.outerName = outerName;
- this.innerName = innerName;
- this.access = access;
- }
-
- /**
- * Makes the given class visitor visit this inner class.
- *
- * @param cv a class visitor.
- */
- public void accept(final ClassVisitor cv) {
- cv.visitInnerClass( this.name,
- this.outerName,
- this.innerName,
- this.access );
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/InsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,96 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents a zero operand instruction.
- *
- * @author Eric Bruneton
- */
-public class InsnNode extends AbstractInsnNode {
-
- private final static InsnNode[] INSNS;
-
- static {
- INSNS = new InsnNode[255];
- for ( int i = 0; i < InsnNode.INSNS.length; ++i ) {
- InsnNode.INSNS[i] = new InsnNode( i );
- }
- }
-
- /**
- * Returns the {@link InsnNode} corresponding to the given opcode.
- *
- * @deprecated uses the constructor instead.
- *
- * @param opcode an instruction opcode.
- * @return the {@link InsnNode} corresponding to the given opcode.
- */
- public final static InsnNode getByOpcode(final int opcode) {
- return InsnNode.INSNS[opcode];
- }
-
- /**
- * 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,
- * FCONST_0, FCONST_1, FCONST_2, DCONST_0, DCONST_1, IALOAD, LALOAD,
- * FALOAD, DALOAD, AALOAD, BALOAD, CALOAD, SALOAD, IASTORE, LASTORE,
- * FASTORE, DASTORE, AASTORE, BASTORE, CASTORE, SASTORE, POP, POP2,
- * DUP, DUP_X1, DUP_X2, DUP2, DUP2_X1, DUP2_X2, SWAP, IADD, LADD,
- * FADD, DADD, ISUB, LSUB, FSUB, DSUB, IMUL, LMUL, FMUL, DMUL, IDIV,
- * LDIV, FDIV, DDIV, IREM, LREM, FREM, DREM, INEG, LNEG, FNEG, DNEG,
- * ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR, IAND, LAND, IOR, LOR, IXOR,
- * LXOR, I2L, I2F, I2D, L2I, L2F, L2D, F2I, F2L, F2D, D2I, D2L, D2F,
- * I2B, I2C, I2S, LCMP, FCMPL, FCMPG, DCMPL, DCMPG, IRETURN, LRETURN,
- * FRETURN, DRETURN, ARETURN, RETURN, ARRAYLENGTH, ATHROW,
- * MONITORENTER, or MONITOREXIT.
- */
- public InsnNode(final int opcode) {
- super( opcode );
- }
-
- /**
- * Makes the given visitor visit this instruction.
- *
- * @param mv a method visitor.
- */
- public void accept(final MethodVisitor mv) {
- mv.visitInsn( this.opcode );
- }
-
- public int getType() {
- return AbstractInsnNode.INSN;
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IntInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IntInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/IntInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,77 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents an instruction with a single int operand.
- *
- * @author Eric Bruneton
- */
-public class IntInsnNode extends AbstractInsnNode {
-
- /**
- * The operand of this instruction.
- */
- public int operand;
-
- /**
- * 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.
- */
- public IntInsnNode(final int opcode,
- final int operand) {
- super( opcode );
- this.operand = operand;
- }
-
- /**
- * Sets the opcode of this instruction.
- *
- * @param opcode the new instruction opcode. This opcode must be BIPUSH,
- * SIPUSH or NEWARRAY.
- */
- public void setOpcode(final int opcode) {
- this.opcode = opcode;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitIntInsn( this.opcode,
- this.operand );
- }
-
- public int getType() {
- return AbstractInsnNode.INT_INSN;
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/JumpInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/JumpInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/JumpInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,86 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.Label;
-import org.drools.asm.MethodVisitor;
-
-/**
- * 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 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 Label 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;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitJumpInsn( this.opcode,
- this.label );
- }
-
- public int getType() {
- return AbstractInsnNode.JUMP_INSN;
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LabelNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LabelNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LabelNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,54 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.Label;
-import org.drools.asm.MethodVisitor;
-
-/**
- * An {@link AbstractInsnNode} that encapsulates a {@link Label}.
- */
-public class LabelNode extends AbstractInsnNode {
-
- public Label label;
-
- public LabelNode(final Label label) {
- super( -1 );
- this.label = label;
- }
-
- public void accept(final MethodVisitor cv) {
- cv.visitLabel( this.label );
- }
-
- public int getType() {
- return AbstractInsnNode.LABEL;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LdcInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LdcInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LdcInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,68 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-import org.drools.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.drools.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;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitLdcInsn( this.cst );
- }
-
- public int getType() {
- return AbstractInsnNode.LDC_INSN;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LineNumberNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LineNumberNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LineNumberNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,75 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.Label;
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents a line number declaration.
- *
- * @author Eric Bruneton
- */
-public class LineNumberNode {
-
- /**
- * 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 Label 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 Label start) {
- this.line = line;
- this.start = start;
- }
-
- /**
- * Makes the given visitor visit this line number declaration.
- *
- * @param mv a method visitor.
- */
- public void accept(final MethodVisitor mv) {
- mv.visitLineNumber( this.line,
- this.start );
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LocalVariableNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LocalVariableNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LocalVariableNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,114 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.Label;
-import org.drools.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 type descriptor of this local variable.
- */
- public String desc;
-
- /**
- * The signature of this local variable. May be <tt>null</tt>.
- */
- public String signature;
-
- /**
- * The first instruction corresponding to the scope of this local variable
- * (inclusive).
- */
- public Label start;
-
- /**
- * The last instruction corresponding to the scope of this local variable
- * (exclusive).
- */
- public Label end;
-
- /**
- * 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 Label start,
- final Label end,
- final int index) {
- this.name = name;
- this.desc = desc;
- 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( this.name,
- this.desc,
- this.signature,
- this.start,
- this.end,
- this.index );
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LookupSwitchInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LookupSwitchInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/LookupSwitchInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,103 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.drools.asm.Label;
-import org.drools.asm.MethodVisitor;
-import org.drools.asm.Opcodes;
-
-/**
- * A node that represents a LOOKUPSWITCH instruction.
- *
- * @author Eric Bruneton
- */
-public class LookupSwitchInsnNode extends AbstractInsnNode {
-
- /**
- * Beginning of the default handler block.
- */
- public Label dflt;
-
- /**
- * The values of the keys. This list is a list of {@link Integer} objects.
- */
- public List keys;
-
- /**
- * Beginnings of the handler blocks. This list is a list of {@link Label}
- * objects.
- */
- public List 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 Label dflt,
- final int[] keys,
- final Label[] labels) {
- super( Opcodes.LOOKUPSWITCH );
- this.dflt = dflt;
- this.keys = new ArrayList( keys == null ? 0 : keys.length );
- this.labels = new ArrayList( labels == null ? 0 : labels.length );
- if ( keys != null ) {
- for ( int i = 0; i < keys.length; ++i ) {
- this.keys.add( new Integer( keys[i] ) );
- }
- }
- if ( labels != null ) {
- this.labels.addAll( Arrays.asList( labels ) );
- }
- }
-
- public void accept(final MethodVisitor mv) {
- final int[] keys = new int[this.keys.size()];
- for ( int i = 0; i < keys.length; ++i ) {
- keys[i] = ((Integer) this.keys.get( i )).intValue();
- }
- final Label[] labels = new Label[this.labels.size()];
- this.labels.toArray( labels );
- mv.visitLookupSwitchInsn( this.dflt,
- keys,
- labels );
- }
-
- public int getType() {
- return AbstractInsnNode.LOOKUPSWITCH_INSN;
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MemberNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MemberNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MemberNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,118 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.drools.asm.AnnotationVisitor;
-import org.drools.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}.
- */
- public 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) {
- final AnnotationNode an = new AnnotationNode( desc );
- if ( visible ) {
- if ( this.visibleAnnotations == null ) {
- this.visibleAnnotations = new ArrayList( 1 );
- }
- this.visibleAnnotations.add( an );
- } else {
- if ( this.invisibleAnnotations == null ) {
- this.invisibleAnnotations = new ArrayList( 1 );
- }
- this.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 ( this.attrs == null ) {
- this.attrs = new ArrayList( 1 );
- }
- this.attrs.add( attr );
- }
-
- /**
- * Visits the end of this class, field or method.
- */
- public void visitEnd() {
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,99 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-
-/**
- * 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.drools.asm.Type#getInternalName() getInternalName}).
- */
- public String owner;
-
- /**
- * The method's name.
- */
- public String name;
-
- /**
- * The method's descriptor (see {@link org.drools.asm.Type}).
- */
- public String desc;
-
- /**
- * 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.drools.asm.Type#getInternalName() getInternalName}).
- * @param name the method's name.
- * @param desc the method's descriptor (see {@link org.drools.asm.Type}).
- */
- public MethodInsnNode(final int opcode,
- final String owner,
- final String name,
- final String desc) {
- super( opcode );
- this.owner = owner;
- this.name = name;
- this.desc = desc;
- }
-
- /**
- * 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;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitMethodInsn( this.opcode,
- this.owner,
- this.name,
- this.desc );
- }
-
- public int getType() {
- return AbstractInsnNode.METHOD_INSN;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MethodNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,462 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.drools.asm.AnnotationVisitor;
-import org.drools.asm.Attribute;
-import org.drools.asm.ClassVisitor;
-import org.drools.asm.Label;
-import org.drools.asm.MethodVisitor;
-import org.drools.asm.Opcodes;
-import org.drools.asm.Type;
-
-/**
- * A node that represents a method.
- *
- * @author Eric Bruneton
- */
-public class MethodNode extends MemberNode
- implements
- MethodVisitor {
-
- /**
- * The method's access flags (see {@link Opcodes}). This field also
- * indicates if the method is synthetic and/or deprecated.
- */
- public int access;
-
- /**
- * The method's name.
- */
- public String name;
-
- /**
- * The method's descriptor (see {@link Type}).
- */
- public String desc;
-
- /**
- * The method's signature. May be <tt>null</tt>.
- */
- public String signature;
-
- /**
- * The internal names of the method's exception classes (see
- * {@link Type#getInternalName() getInternalName}). This list is a list of
- * {@link String} objects.
- */
- public List exceptions;
-
- /**
- * The default value of this annotation interface method. This field must be
- * a {@link Byte}, {@link Boolean}, {@link Character}, {@link Short},
- * {@link Integer}, {@link Long}, {@link Float}, {@link Double},
- * {@link String} or {@link Type}, or an two elements String array (for
- * enumeration values), a {@link AnnotationNode}, or a {@link List} of
- * values of one of the preceding types. May be <tt>null</tt>.
- */
- public Object annotationDefault;
-
- /**
- * The runtime visible parameter annotations of this method. These lists are
- * lists of {@link AnnotationNode} objects. May be <tt>null</tt>.
- *
- * @associates org.objectweb.asm.tree.AnnotationNode
- * @label invisible parameters
- */
- public List[] visibleParameterAnnotations;
-
- /**
- * The runtime invisible parameter annotations of this method. These lists
- * are lists of {@link AnnotationNode} objects. May be <tt>null</tt>.
- *
- * @associates org.objectweb.asm.tree.AnnotationNode
- * @label visible parameters
- */
- public List[] invisibleParameterAnnotations;
-
- /**
- * The instructions of this method. This list is a list of
- * {@link AbstractInsnNode} objects.
- *
- * @associates org.objectweb.asm.tree.AbstractInsnNode
- * @label instructions
- */
- public List instructions;
-
- /**
- * The try catch blocks of this method. This list is a list of
- * {@link TryCatchBlockNode} objects.
- *
- * @associates org.objectweb.asm.tree.TryCatchBlockNode
- */
- public List tryCatchBlocks;
-
- /**
- * The maximum stack size of this method.
- */
- public int maxStack;
-
- /**
- * The maximum number of local variables of this method.
- */
- public int maxLocals;
-
- /**
- * The local variables of this method. This list is a list of
- * {@link LocalVariableNode} objects. May be <tt>null</tt>
- *
- * @associates org.objectweb.asm.tree.LocalVariableNode
- */
- public List localVariables;
-
- /**
- * The line numbers of this method. This list is a list of
- * {@link LineNumberNode} objects. May be <tt>null</tt>
- *
- * @associates org.objectweb.asm.tree.LineNumberNode
- */
- public List lineNumbers;
-
- /**
- * Constructs a new {@link MethodNode}.
- *
- * @param access the method's access flags (see {@link Opcodes}). This
- * parameter also indicates if the method is synthetic and/or
- * deprecated.
- * @param name the method's name.
- * @param desc the method's descriptor (see {@link Type}).
- * @param signature the method's signature. May be <tt>null</tt>.
- * @param exceptions the internal names of the method's exception classes
- * (see {@link Type#getInternalName() getInternalName}). May be
- * <tt>null</tt>.
- */
- public MethodNode(final int access,
- final String name,
- final String desc,
- final String signature,
- final String[] exceptions) {
- this.access = access;
- this.name = name;
- this.desc = desc;
- this.signature = signature;
- this.exceptions = new ArrayList( exceptions == null ? 0 : exceptions.length );
- boolean isAbstract = (access & Opcodes.ACC_ABSTRACT) != 0;
- this.instructions = new ArrayList( isAbstract ? 0 : 24 );
- if ( !isAbstract ) {
- this.localVariables = new ArrayList( 5 );
- this.lineNumbers = new ArrayList( 5 );
- }
- this.tryCatchBlocks = new ArrayList();
- if ( exceptions != null ) {
- this.exceptions.addAll( Arrays.asList( exceptions ) );
- }
- }
-
- // ------------------------------------------------------------------------
- // Implementation of the MethodVisitor interface
- // ------------------------------------------------------------------------
-
- public AnnotationVisitor visitAnnotationDefault() {
- return new AnnotationNode( new ArrayList( 0 ) {
- /**
- *
- */
- private static final long serialVersionUID = -774399273497432006L;
-
- public boolean add(final Object o) {
- MethodNode.this.annotationDefault = o;
- return super.add( o );
- }
- } );
- }
-
- public AnnotationVisitor visitParameterAnnotation(final int parameter,
- final String desc,
- final boolean visible) {
- final AnnotationNode an = new AnnotationNode( desc );
- if ( visible ) {
- if ( this.visibleParameterAnnotations == null ) {
- final int params = Type.getArgumentTypes( this.desc ).length;
- this.visibleParameterAnnotations = new List[params];
- }
- if ( this.visibleParameterAnnotations[parameter] == null ) {
- this.visibleParameterAnnotations[parameter] = new ArrayList( 1 );
- }
- this.visibleParameterAnnotations[parameter].add( an );
- } else {
- if ( this.invisibleParameterAnnotations == null ) {
- final int params = Type.getArgumentTypes( this.desc ).length;
- this.invisibleParameterAnnotations = new List[params];
- }
- if ( this.invisibleParameterAnnotations[parameter] == null ) {
- this.invisibleParameterAnnotations[parameter] = new ArrayList( 1 );
- }
- this.invisibleParameterAnnotations[parameter].add( an );
- }
- return an;
- }
-
- public void visitCode() {
- }
-
- public void visitInsn(final int opcode) {
- this.instructions.add( new InsnNode( opcode ) );
- }
-
- public void visitIntInsn(final int opcode,
- final int operand) {
- this.instructions.add( new IntInsnNode( opcode,
- operand ) );
- }
-
- public void visitVarInsn(final int opcode,
- final int var) {
- this.instructions.add( new VarInsnNode( opcode,
- var ) );
- }
-
- public void visitTypeInsn(final int opcode,
- final String desc) {
- this.instructions.add( new TypeInsnNode( opcode,
- desc ) );
- }
-
- public void visitFieldInsn(final int opcode,
- final String owner,
- final String name,
- final String desc) {
- this.instructions.add( new FieldInsnNode( opcode,
- owner,
- name,
- desc ) );
- }
-
- public void visitMethodInsn(final int opcode,
- final String owner,
- final String name,
- final String desc) {
- this.instructions.add( new MethodInsnNode( opcode,
- owner,
- name,
- desc ) );
- }
-
- public void visitJumpInsn(final int opcode,
- final Label label) {
- this.instructions.add( new JumpInsnNode( opcode,
- label ) );
- }
-
- public void visitLabel(final Label label) {
- this.instructions.add( new LabelNode( label ) );
- }
-
- public void visitLdcInsn(final Object cst) {
- this.instructions.add( new LdcInsnNode( cst ) );
- }
-
- public void visitIincInsn(final int var,
- final int increment) {
- this.instructions.add( new IincInsnNode( var,
- increment ) );
- }
-
- public void visitTableSwitchInsn(final int min,
- final int max,
- final Label dflt,
- final Label[] labels) {
- this.instructions.add( new TableSwitchInsnNode( min,
- max,
- dflt,
- labels ) );
- }
-
- public void visitLookupSwitchInsn(final Label dflt,
- final int[] keys,
- final Label[] labels) {
- this.instructions.add( new LookupSwitchInsnNode( dflt,
- keys,
- labels ) );
- }
-
- public void visitMultiANewArrayInsn(final String desc,
- final int dims) {
- this.instructions.add( new MultiANewArrayInsnNode( desc,
- dims ) );
- }
-
- public void visitTryCatchBlock(final Label start,
- final Label end,
- final Label handler,
- final String type) {
- this.tryCatchBlocks.add( new TryCatchBlockNode( start,
- end,
- handler,
- type ) );
- }
-
- public void visitLocalVariable(final String name,
- final String desc,
- final String signature,
- final Label start,
- final Label end,
- final int index) {
- this.localVariables.add( new LocalVariableNode( name,
- desc,
- signature,
- start,
- end,
- index ) );
- }
-
- public void visitLineNumber(final int line,
- final Label start) {
- this.lineNumbers.add( new LineNumberNode( line,
- start ) );
- }
-
- public void visitMaxs(final int maxStack,
- final int maxLocals) {
- this.maxStack = maxStack;
- this.maxLocals = maxLocals;
- }
-
- // ------------------------------------------------------------------------
- // Accept method
- // ------------------------------------------------------------------------
-
- /**
- * Makes the given class visitor visit this method.
- *
- * @param cv a class visitor.
- */
- public void accept(final ClassVisitor cv) {
- final String[] exceptions = new String[this.exceptions.size()];
- this.exceptions.toArray( exceptions );
- final MethodVisitor mv = cv.visitMethod( this.access,
- this.name,
- this.desc,
- this.signature,
- exceptions );
- if ( mv != null ) {
- accept( mv );
- }
- }
-
- /**
- * Makes the given method visitor visit this method.
- *
- * @param mv a method visitor.
- */
- public void accept(final MethodVisitor mv) {
- // visits the method attributes
- int i, j, n;
- if ( this.annotationDefault != null ) {
- final AnnotationVisitor av = mv.visitAnnotationDefault();
- AnnotationNode.accept( av,
- null,
- this.annotationDefault );
- av.visitEnd();
- }
- n = this.visibleAnnotations == null ? 0 : this.visibleAnnotations.size();
- for ( i = 0; i < n; ++i ) {
- final AnnotationNode an = (AnnotationNode) this.visibleAnnotations.get( i );
- an.accept( mv.visitAnnotation( an.desc,
- true ) );
- }
- n = this.invisibleAnnotations == null ? 0 : this.invisibleAnnotations.size();
- for ( i = 0; i < n; ++i ) {
- final AnnotationNode an = (AnnotationNode) this.invisibleAnnotations.get( i );
- an.accept( mv.visitAnnotation( an.desc,
- false ) );
- }
- n = this.visibleParameterAnnotations == null ? 0 : this.visibleParameterAnnotations.length;
- for ( i = 0; i < n; ++i ) {
- final List l = this.visibleParameterAnnotations[i];
- if ( l == null ) {
- continue;
- }
- for ( j = 0; j < l.size(); ++j ) {
- final AnnotationNode an = (AnnotationNode) l.get( j );
- an.accept( mv.visitParameterAnnotation( i,
- an.desc,
- true ) );
- }
- }
- n = this.invisibleParameterAnnotations == null ? 0 : this.invisibleParameterAnnotations.length;
- for ( i = 0; i < n; ++i ) {
- final List l = this.invisibleParameterAnnotations[i];
- if ( l == null ) {
- continue;
- }
- for ( j = 0; j < l.size(); ++j ) {
- final AnnotationNode an = (AnnotationNode) l.get( j );
- an.accept( mv.visitParameterAnnotation( i,
- an.desc,
- false ) );
- }
- }
- n = this.attrs == null ? 0 : this.attrs.size();
- for ( i = 0; i < n; ++i ) {
- mv.visitAttribute( (Attribute) this.attrs.get( i ) );
- }
- // visits the method's code
- if ( this.instructions.size() > 0 ) {
- mv.visitCode();
- // visits try catch blocks
- for ( i = 0; i < this.tryCatchBlocks.size(); ++i ) {
- ((TryCatchBlockNode) this.tryCatchBlocks.get( i )).accept( mv );
- }
- // visits instructions
- for ( i = 0; i < this.instructions.size(); ++i ) {
- ((AbstractInsnNode) this.instructions.get( i )).accept( mv );
- }
- // visits local variables
- n = this.localVariables == null ? 0 : this.localVariables.size();
- for ( i = 0; i < n; ++i ) {
- ((LocalVariableNode) this.localVariables.get( i )).accept( mv );
- }
- // visits line numbers
- n = this.lineNumbers == null ? 0 : this.lineNumbers.size();
- for ( i = 0; i < n; ++i ) {
- ((LineNumberNode) this.lineNumbers.get( i )).accept( mv );
- }
- // visits maxs
- mv.visitMaxs( this.maxStack,
- this.maxLocals );
- }
- mv.visitEnd();
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MultiANewArrayInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MultiANewArrayInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/MultiANewArrayInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,73 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-import org.drools.asm.Opcodes;
-
-/**
- * A node that represents a MULTIANEWARRAY instruction.
- *
- * @author Eric Bruneton
- */
-public class MultiANewArrayInsnNode extends AbstractInsnNode {
-
- /**
- * An array type descriptor (see {@link org.drools.asm.Type}).
- */
- public String desc;
-
- /**
- * Number of dimensions of the array to allocate.
- */
- public int dims;
-
- /**
- * Constructs a new {@link MultiANewArrayInsnNode}.
- *
- * @param desc an array type descriptor (see {@link org.drools.asm.Type}).
- * @param dims number of dimensions of the array to allocate.
- */
- public MultiANewArrayInsnNode(final String desc,
- final int dims) {
- super( Opcodes.MULTIANEWARRAY );
- this.desc = desc;
- this.dims = dims;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitMultiANewArrayInsn( this.desc,
- this.dims );
- }
-
- public int getType() {
- return AbstractInsnNode.MULTIANEWARRAY_INSN;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TableSwitchInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TableSwitchInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TableSwitchInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,103 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.drools.asm.Label;
-import org.drools.asm.MethodVisitor;
-import org.drools.asm.Opcodes;
-
-/**
- * A node that represents a TABLESWITCH instruction.
- *
- * @author Eric Bruneton
- */
-public class TableSwitchInsnNode extends AbstractInsnNode {
-
- /**
- * The minimum key value.
- */
- public int min;
-
- /**
- * The maximum key value.
- */
- public int max;
-
- /**
- * Beginning of the default handler block.
- */
- public Label dflt;
-
- /**
- * Beginnings of the handler blocks. This list is a list of {@link Label}
- * objects.
- */
- public List labels;
-
- /**
- * Constructs a new {@link TableSwitchInsnNode}.
- *
- * @param min the minimum key value.
- * @param max the maximum key value.
- * @param dflt beginning of the default handler block.
- * @param labels beginnings of the handler blocks. <tt>labels[i]</tt> is
- * the beginning of the handler block for the <tt>min + i</tt> key.
- */
- public TableSwitchInsnNode(final int min,
- final int max,
- final Label dflt,
- final Label[] labels) {
- super( Opcodes.TABLESWITCH );
- this.min = min;
- this.max = max;
- this.dflt = dflt;
- this.labels = new ArrayList();
- if ( labels != null ) {
- this.labels.addAll( Arrays.asList( labels ) );
- }
- }
-
- public void accept(final MethodVisitor mv) {
- final Label[] labels = new Label[this.labels.size()];
- this.labels.toArray( labels );
- mv.visitTableSwitchInsn( this.min,
- this.max,
- this.dflt,
- labels );
- }
-
- public int getType() {
- return AbstractInsnNode.TABLESWITCH_INSN;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TryCatchBlockNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TryCatchBlockNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TryCatchBlockNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,94 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.Label;
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents a try catch block.
- *
- * @author Eric Bruneton
- */
-public class TryCatchBlockNode {
-
- /**
- * Beginning of the exception handler's scope (inclusive).
- */
- public Label start;
-
- /**
- * End of the exception handler's scope (exclusive).
- */
- public Label end;
-
- /**
- * Beginning of the exception handler's code.
- */
- public Label handler;
-
- /**
- * Internal name of the type of exceptions handled by the handler. May be
- * <tt>null</tt> to catch any exceptions (for "finally" blocks).
- */
- public String type;
-
- /**
- * Constructs a new {@link TryCatchBlockNode}.
- *
- * @param start beginning of the exception handler's scope (inclusive).
- * @param end end of the exception handler's scope (exclusive).
- * @param handler beginning of the exception handler's code.
- * @param type internal name of the type of exceptions handled by the
- * handler, or <tt>null</tt> to catch any exceptions (for "finally"
- * blocks).
- */
- public TryCatchBlockNode(final Label start,
- final Label end,
- final Label handler,
- final String type) {
- this.start = start;
- this.end = end;
- this.handler = handler;
- this.type = type;
- }
-
- /**
- * Makes the given visitor visit this try catch block.
- *
- * @param mv a method visitor.
- */
- public void accept(final MethodVisitor mv) {
- mv.visitTryCatchBlock( this.start,
- this.end,
- this.handler,
- this.type );
- }
-}
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TypeInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TypeInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/TypeInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,80 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents a type instruction. A type instruction is an
- * instruction that takes a type descriptor as parameter.
- *
- * @author Eric Bruneton
- */
-public class TypeInsnNode extends AbstractInsnNode {
-
- /**
- * The operand of this instruction. This operand is a type descriptor (see
- * {@link org.drools.asm.Type}).
- */
- public String desc;
-
- /**
- * Constructs a new {@link TypeInsnNode}.
- *
- * @param opcode the opcode of the type instruction to be constructed. This
- * opcode must be NEW, ANEWARRAY, CHECKCAST or INSTANCEOF.
- * @param desc the operand of the instruction to be constructed. This
- * operand is a type descriptor (see {@link org.drools.asm.Type}).
- */
- public TypeInsnNode(final int opcode,
- final String desc) {
- super( opcode );
- this.desc = desc;
- }
-
- /**
- * Sets the opcode of this instruction.
- *
- * @param opcode the new instruction opcode. This opcode must be NEW,
- * ANEWARRAY, CHECKCAST or INSTANCEOF.
- */
- public void setOpcode(final int opcode) {
- this.opcode = opcode;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitTypeInsn( this.opcode,
- this.desc );
- }
-
- public int getType() {
- return AbstractInsnNode.TYPE_INSN;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/VarInsnNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/VarInsnNode.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/VarInsnNode.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,83 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.tree;
-
-import org.drools.asm.MethodVisitor;
-
-/**
- * A node that represents a local variable instruction. A local variable
- * instruction is an instruction that loads or stores the value of a local
- * variable.
- *
- * @author Eric Bruneton
- */
-public class VarInsnNode extends AbstractInsnNode {
-
- /**
- * The operand of this instruction. This operand is the index of a local
- * variable.
- */
- public int var;
-
- /**
- * Constructs a new {@link VarInsnNode}.
- *
- * @param opcode the opcode of the local variable instruction to be
- * constructed. This opcode must be ILOAD, LLOAD, FLOAD, DLOAD,
- * ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE or RET.
- * @param var the operand of the instruction to be constructed. This operand
- * is the index of a local variable.
- */
- public VarInsnNode(final int opcode,
- final int var) {
- super( opcode );
- this.var = var;
- }
-
- /**
- * Sets the opcode of this instruction.
- *
- * @param opcode the new instruction opcode. This opcode must be ILOAD,
- * LLOAD, FLOAD, DLOAD, ALOAD, ISTORE, LSTORE, FSTORE, DSTORE, ASTORE
- * or RET.
- */
- public void setOpcode(final int opcode) {
- this.opcode = opcode;
- }
-
- public void accept(final MethodVisitor mv) {
- mv.visitVarInsn( this.opcode,
- this.var );
- }
-
- public int getType() {
- return AbstractInsnNode.VAR_INSN;
- }
-}
\ No newline at end of file
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/package.html
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/package.html 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/tree/package.html 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,149 +0,0 @@
-<html>
-<!--
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.
--->
-<body>
-
-<p>
-Provides an ASM visitor that constructs a tree representation of the
-classes it visits. This class adapter can be useful to implement "complex"
-class manipulation operations, i.e., operations that would be very hard to
-implement without using a tree representation (such as optimizing the number
-of local variables used by a method).
-</p>
-
-<p>
-However, this class adapter has a cost: it makes ASM bigger and slower. Indeed
-it requires more than twenty new classes, and multiplies the time needed to
-transform a class by almost two (it is almost two times faster to read, "modify"
-and write a class with a ClassAdapter than with a ClassNode). This is why
-this package is bundled in an optional <tt>asm-tree.jar</tt> library that
-is separated from (but requires) the <tt>asm.jar</tt> library, which contains
-the core ASM framework. This is also why <i><font color="red">it is recommanded
-not to use this class adapter when it is possible</font></i>.
-</p>
-
-<p>
-The root class is the ClassNode, that can be created from scratch or
-from existing bytecode. For example:
-</p>
-
-<pre>
- ClassReader cr = new ClassReader(source);
- ClassNode cn = new ClassNode();
- cr.accept(cn, true);
-</pre>
-
-<p>
-Now content of ClassNode can be modified and then
-serialized back into bytecode:
-</p>
-
-<pre>
- ClassWriter cw = new ClassWriter(true);
- cn.accept(cw);
-</pre>
-
-<p>
-Several strategies can be used to construct method code from scratch. The first
-possibility is to create a MethodNode, and then create and add XXXInsnNode to
-the instructions list:
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.instructions.add(new VarInsnNode(ALOAD, 0));
-...
-</pre>
-
-<p>
-Alternatively, you can use the fact that MethodNode is a MethodVisitor, and use
-that to create the XXXInsnNode and add them to the instructions list through
-the standard MethodVisitor interface:
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.visitVarInsn(ALOAD, 0);
-...
-</pre>
-
-<p>
-If you cannot generate all the instructions in sequential order, i.e. if you
-need to keep some pointers in the instruction list to insert some instructions
-at these places after other instructions have been generated, you can define
-an InsnListInsnNode pseudo instruction class that will in fact contain an
-instruction list, will possibly implement the MethodVisitor interface, and whose
-accept method will call the accept method of all the instructions of its list.
-</p>
-
-<pre>
-MethodNode m = new MethodNode(...);
-m.visitVarInsn(ALOAD, 0);
-InsnListInsnNode ptr = new InsnListInsnNode();
-m.instructions.add(ptr);
-m.visitVarInsn(ALOAD, 1);
-ptr.visitXXXInsn(...); // inserts an instruction between ALOAD 0 and ALOAD 1
-</pre>
-
-<p>
-If you need to insert instructions while iterating over an existing instruction
-list, you can also use several strategies. The first one is to use a
-ListIterator over the instruction list, and use its add method to insert
-instructions:
-</p>
-
-<pre>
-ListIterator i = m.instructions.listIterator();
-while (i.hasNext()) {
- AbstractInsnNode n = (AbstractInsnNode) i.next();
- if (...) {
- i.add(new VarInsnNode(ALOAD, 0));
- }
-}
-</pre>
-
-<p>
-If you want to insert these instructions through the MethodVisitor interface,
-you can define your own InsnListIterator class, that will implement both the
-ListIterator and MethodVisitor interface.
-</p>
-
-<p>
-Another strategy is to use ListIterator.add to insert InsnListInsnNode pseudo
-instructions, and then use these inserted pseudo instructions to insert an
-arbitrary number of instructions at these places.
-</p>
-
-<p>
- at since ASM 1.3.3
-</p>
-
-</body>
-</html>
Deleted: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/util/CheckClassAdapter.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/util/CheckClassAdapter.java 2007-02-10 16:44:43 UTC (rev 9426)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/asm/util/CheckClassAdapter.java 2007-02-10 16:47:06 UTC (rev 9427)
@@ -1,420 +0,0 @@
-/***
- * ASM: a very small and fast Java bytecode manipulation framework
- * Copyright (c) 2000-2005 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.drools.asm.util;
-
-import java.io.FileInputStream;
-import java.io.PrintWriter;
-import java.util.List;
-
-import org.drools.asm.AnnotationVisitor;
-import org.drools.asm.Attribute;
-import org.drools.asm.ClassAdapter;
-import org.drools.asm.ClassReader;
-import org.drools.asm.ClassVisitor;
-import org.drools.asm.FieldVisitor;
-import org.drools.asm.MethodVisitor;
-import org.drools.asm.Opcodes;
-import org.drools.asm.Type;
-import org.drools.asm.tree.AbstractInsnNode;
-import org.drools.asm.tree.ClassNode;
-import org.drools.asm.tree.MethodNode;
-import org.drools.asm.tree.TryCatchBlockNode;
-import org.drools.asm.tree.analysis.Analyzer;
-import org.drools.asm.tree.analysis.Frame;
-import org.drools.asm.tree.analysis.SimpleVerifier;
-
-/**
- * A {@link ClassAdapter} that checks that its methods are properly used. More
- * precisely this class adapter checks each method call individually, based
- * <i>only</i> on its arguments, but does <i>not</i> check the <i>sequence</i>
- * of method calls. For example, the invalid sequence
- * <tt>visitField(ACC_PUBLIC, "i", "I", null)</tt> <tt>visitField(ACC_PUBLIC,
- * "i", "D", null)</tt>
- * will <i>not</i> be detected by this class adapter.
- *
- * @author Eric Bruneton
- */
-public class CheckClassAdapter extends ClassAdapter {
-
- /**
- * <tt>true</tt> if the visit method has been called.
- */
- private boolean start;
-
- /**
- * <tt>true</tt> if the visitSource method has been called.
- */
- private boolean source;
-
- /**
- * <tt>true</tt> if the visitOuterClass method has been called.
- */
- private boolean outer;
-
- /**
- * <tt>true</tt> if the visitEnd method has been called.
- */
- private boolean end;
-
- /**
- * Checks a given class. <p> Usage: CheckClassAdapter <fully qualified
- * class name or class file name>
- *
- * @param args the command line arguments.
- *
- * @throws Exception if the class cannot be found, or if an IO exception
- * occurs.
- */
- public static void main(final String[] args) throws Exception {
- if ( args.length != 1 ) {
- System.err.println( "Verifies the given class." );
- System.err.println( "Usage: CheckClassAdapter " + "<fully qualified class name or class file name>" );
- return;
- }
- ClassReader cr;
- if ( args[0].endsWith( ".class" ) ) {
- cr = new ClassReader( new FileInputStream( args[0] ) );
- } else {
- cr = new ClassReader( args[0] );
- }
-
- verify( cr,
- false,
- new PrintWriter( System.err ) );
- }
-
- /**
- * Checks a given class
- *
- * @param cr a <code>ClassReader</code> that contains bytecode for the analysis.
- * @param dump true if bytecode should be printed out not only when errors are found.
- * @param pw write where results going to be printed
- */
- public static void verify(final ClassReader cr,
- boolean dump,
- final PrintWriter pw) {
- final ClassNode cn = new ClassNode();
- cr.accept( new CheckClassAdapter( cn ),
- true );
-
- final List methods = cn.methods;
- for ( int i = 0; i < methods.size(); ++i ) {
- final MethodNode method = (MethodNode) methods.get( i );
- if ( method.instructions.size() > 0 ) {
- final Analyzer a = new Analyzer( new SimpleVerifier( Type.getType( "L" + cn.name + ";" ),
- Type.getType( "L" + cn.superName + ";" ),
- (cn.access & Opcodes.ACC_INTERFACE) != 0 ) );
- try {
- a.analyze( cn.name,
- method );
- if ( !dump ) {
- continue;
- }
- } catch ( final Exception e ) {
- e.printStackTrace();
- }
- final Frame[] frames = a.getFrames();
-
- final TraceMethodVisitor mv = new TraceMethodVisitor();
-
- pw.println( method.name + method.desc );
- for ( int j = 0; j < method.instructions.size(); ++j ) {
- ((AbstractInsnNode) method.instructions.get( j )).accept( mv );
-
- final StringBuffer s = new StringBuffer();
- final Frame f = frames[j];
- if ( f == null ) {
- s.append( '?' );
- } else {
- for ( int k = 0; k < f.getLocals(); ++k ) {
- s.append( getShortName( f.getLocal( k ).toString() ) ).append( ' ' );
- }
- s.append( " : " );
- for ( int k = 0; k < f.getStackSize(); ++k ) {
- s.append( getShortName( f.getStack( k ).toString() ) ).append( ' ' );
- }
- }
- while ( s.length() < method.maxStack + method.maxLocals + 1 ) {
- s.append( ' ' );
- }
- pw.print( Integer.toString( j + 100000 ).substring( 1 ) );
- pw.print( " " + s + " : " + mv.buf ); // mv.text.get(j));
- }
- for ( int j = 0; j < method.tryCatchBlocks.size(); ++j ) {
- ((TryCatchBlockNode) method.tryCatchBlocks.get( j )).accept( mv );
- pw.print( " " + mv.buf );
- }
- pw.println();
- }
- }
- }
-
- private static String getShortName(final String name) {
- final int n = name.lastIndexOf( '/' );
- int k = name.length();
- if ( name.charAt( k - 1 ) == ';' ) {
- k--;
- }
- return n == -1 ? name : name.substring( n + 1,
- k );
- }
-
- /**
- * Constructs a new {@link CheckClassAdapter}.
- *
- * @param cv the class visitor to which this adapter must delegate calls.
- */
- public CheckClassAdapter(final ClassVisitor cv) {
- super( cv );
- }
-
- // ------------------------------------------------------------------------
- // Implementation of the ClassVisitor interface
- // ------------------------------------------------------------------------
-
- public void visit(final int version,
- final int access,
- final String name,
- final String signature,
- final String superName,
- final String[] interfaces) {
- if ( this.start ) {
- throw new IllegalStateException( "visit must be called only once" );
- } else {
- this.start = true;
- }
- checkState();
- checkAccess( access,
- Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM + Opcodes.ACC_DEPRECATED );
- CheckMethodAdapter.checkInternalName( name,
- "class name" );
- if ( "java/lang/Object".equals( name ) ) {
- if ( superName != null ) {
- throw new IllegalArgumentException( "The super class name of the Object class must be 'null'" );
- }
- } else {
- CheckMethodAdapter.checkInternalName( superName,
- "super class name" );
- }
- if ( signature != null ) {
- // TODO
- }
- if ( (access & Opcodes.ACC_INTERFACE) != 0 ) {
- if ( !"java/lang/Object".equals( superName ) ) {
- throw new IllegalArgumentException( "The super class name of interfaces must be 'java/lang/Object'" );
- }
- }
- if ( interfaces != null ) {
- for ( int i = 0; i < interfaces.length; ++i ) {
- CheckMethodAdapter.checkInternalName( interfaces[i],
- "interface name at index " + i );
- }
- }
- this.cv.visit( version,
- access,
- name,
- signature,
- superName,
- interfaces );
- }
-
- public void visitSource(final String file,
- final String debug) {
- checkState();
- if ( this.source ) {
- throw new IllegalStateException( "visitSource can be called only once." );
- }
- this.source = true;
- this.cv.visitSource( file,
- debug );
- }
-
- public void visitOuterClass(final String owner,
- final String name,
- final String desc) {
- checkState();
- if ( this.outer ) {
- throw new IllegalStateException( "visitSource can be called only once." );
- }
- this.outer = true;
- if ( owner == null ) {
- throw new IllegalArgumentException( "Illegal outer class owner" );
- }
- if ( desc != null ) {
- CheckMethodAdapter.checkMethodDesc( desc );
- }
- this.cv.visitOuterClass( owner,
- name,
- desc );
- }
-
- public void visitInnerClass(final String name,
- final String outerName,
- final String innerName,
- final int access) {
- checkState();
- CheckMethodAdapter.checkInternalName( name,
- "class name" );
- if ( outerName != null ) {
- CheckMethodAdapter.checkInternalName( outerName,
- "outer class name" );
- }
- if ( innerName != null ) {
- CheckMethodAdapter.checkIdentifier( innerName,
- "inner class name" );
- }
- checkAccess( access,
- Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_ANNOTATION + Opcodes.ACC_ENUM );
- this.cv.visitInnerClass( name,
- outerName,
- innerName,
- access );
- }
-
- public FieldVisitor visitField(final int access,
- final String name,
- final String desc,
- final String signature,
- final Object value) {
- checkState();
- checkAccess( access,
- Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL + Opcodes.ACC_VOLATILE + Opcodes.ACC_TRANSIENT + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_ENUM + Opcodes.ACC_DEPRECATED );
- CheckMethodAdapter.checkIdentifier( name,
- "field name" );
- CheckMethodAdapter.checkDesc( desc,
- false );
- if ( signature != null ) {
- // TODO
- }
- if ( value != null ) {
- CheckMethodAdapter.checkConstant( value );
- }
- final FieldVisitor av = this.cv.visitField( access,
- name,
- desc,
- signature,
- value );
- return new CheckFieldAdapter( av );
- }
-
- public MethodVisitor visitMethod(final int access,
- final String name,
- final String desc,
- final String signature,
- final String[] exceptions) {
- checkState();
- checkAccess( access,
- Opcodes.ACC_PUBLIC + Opcodes.ACC_PRIVATE + Opcodes.ACC_PROTECTED + Opcodes.ACC_STATIC + Opcodes.ACC_FINAL + Opcodes.ACC_SYNCHRONIZED + Opcodes.ACC_BRIDGE + Opcodes.ACC_VARARGS + Opcodes.ACC_NATIVE + Opcodes.ACC_ABSTRACT
- + Opcodes.ACC_STRICT + Opcodes.ACC_SYNTHETIC + Opcodes.ACC_DEPRECATED );
- CheckMethodAdapter.checkMethodIdentifier( name,
- "method name" );
- CheckMethodAdapter.checkMethodDesc( desc );
- if ( signature != null ) {
- // TODO
- }
- if ( exceptions != null ) {
- for ( int i = 0; i < exceptions.length; ++i ) {
- CheckMethodAdapter.checkInternalName( exceptions[i],
- "exception name at index " + i );
- }
- }
- return new CheckMethodAdapter( this.cv.visitMethod( access,
- name,
- desc,
- signature,
- exceptions ) );
- }
-
- public AnnotationVisitor visitAnnotation(final String desc,
- final boolean visible) {
- checkState();
- CheckMethodAdapter.checkDesc( desc,
- false );
- return new CheckAnnotationAdapter( this.cv.visitAnnotation( desc,
- visible ) );
- }
-
- public void visitAttribute(final Attribute attr) {
- checkState();
- if ( attr == null ) {
- throw new IllegalArgumentException( "Invalid attribute (must not be null)" );
- }
- this.cv.visitAttribute( attr );
- }
-
- public void visitEnd() {
- checkState();
- this.end = true;
- this.cv.visitEnd();
- }
-
- // ------------------------------------------------------------------------
- // Utility methods
- // ------------------------------------------------------------------------
-
- /**
- * Checks that the visit method has been called and that visitEnd has not
- * been called.
- */
- private void checkState() {
- if ( !this.start ) {
- throw new IllegalStateException( "Cannot visit member before visit has been called." );
- }
- if ( this.end ) {
- throw new IllegalStateException( "Cannot visit member after visitEnd has been called." );
- }
- }
-
- /**
- * Checks that the given access flags do not contain invalid flags. This
- * method also checks that mutually incompatible flags are not set
- * simultaneously.
- *
- * @param access the access flags to be checked
- * @param possibleAccess the valid access flags.
- */
- static void checkAccess(final int access,
- final int possibleAccess) {
- if ( (access & ~possibleAccess) != 0 ) {
- throw new IllegalArgumentException( "Invalid access flags: " + access );
- }
- final int pub = ((access & Opcodes.ACC_PUBLIC) != 0 ? 1 : 0);
- final int pri = ((access & Opcodes.ACC_PRIVATE) != 0 ? 1 : 0);
- final int pro = ((access & Opcodes.ACC_PROTECTED) != 0 ? 1 : 0);
- if ( pub + pri + pro > 1 ) {
- throw new IllegalArgumentException( "public private and protected are mutually exclusive: " + access );
- }
- final int fin = ((access & Opcodes.ACC_FINAL) != 0 ? 1 : 0);
- final int abs = ((access & Opcodes.ACC_ABSTRACT) != 0 ? 1 : 0);
- if ( fin + abs > 1 ) {
- throw new IllegalArgumentException( "final and abstract are mutually exclusive: " + access );
- }
- }
-}
More information about the jboss-svn-commits
mailing list