svn commit: r386056 [14/28] - in /jakarta/bcel/trunk: examples/ examples/Mini/ src/java/org/apache/bcel/ src/java/org/apache/bcel/classfile/ src/java/org/apache/bcel/generic/ src/java/org/apache/bcel/util/ src/java/org/apache/bcel/verifier/ src/java/or...

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGen.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -40,294 +39,319 @@
  * @see Field
  */
 public class FieldGen extends FieldGenOrMethodGen {
-  private Object value = null;
 
-	private static BCELComparator _cmp = new BCELComparator() {
-		public boolean equals(Object o1, Object o2) {
-			FieldGen THIS = (FieldGen)o1;
-			FieldGen THAT = (FieldGen)o2;
-
-			return THIS.getName().equals(THAT.getName())
-				&& THIS.getSignature().equals(THAT.getSignature());
-		}
-
-		public int hashCode(Object o) {
-			FieldGen THIS = (FieldGen)o;
-			return THIS.getSignature().hashCode() ^ THIS.getName().hashCode();
-		}
-	};
-
-  /**
-   * Declare a field. If it is static (isStatic() == true) and has a
-   * basic type like int or String it may have an initial value
-   * associated with it as defined by setInitValue().
-   *
-   * @param access_flags access qualifiers
-   * @param type  field type
-   * @param name field name
-   * @param cp constant pool
-   */
-  public FieldGen(int access_flags, Type type, String name, ConstantPoolGen cp) {
-    setAccessFlags(access_flags);
-    setType(type);
-    setName(name);
-    setConstantPool(cp);
-  }
-
-  /**
-   * Instantiate from existing field.
-   *
-   * @param field Field object
-   * @param cp constant pool (must contain the same entries as the field's constant pool)
-   */
-  public FieldGen(Field field, ConstantPoolGen cp) {
-    this(field.getAccessFlags(), Type.getType(field.getSignature()), field.getName(), cp);
-
-    Attribute[] attrs = field.getAttributes();
-
-    for(int i=0; i < attrs.length; i++) {
-      if(attrs[i] instanceof ConstantValue)
-	setValue(((ConstantValue)attrs[i]).getConstantValueIndex());
-      else
-	addAttribute(attrs[i]);
-    }
-  }
-
-  private void setValue(int index) {
-    ConstantPool cp  = this.cp.getConstantPool();
-    Constant     c   = cp.getConstant(index);
-    value = ((ConstantObject)c).getConstantValue(cp);
-  }
-
-  /**
-   * Set (optional) initial value of field, otherwise it will be set to null/0/false
-   * by the JVM automatically.
-   */
-  public void setInitValue(String str) {
-    checkType(new ObjectType("java.lang.String"));
-
-    if(str != null)
-      value = str;
-  }
-
-  public void setInitValue(long l) {
-    checkType(Type.LONG);
-
-    if(l != 0L)
-      value = new Long(l);
-  }
-
-  public void setInitValue(int i) {
-    checkType(Type.INT);
-
-    if(i != 0)
-      value = new Integer(i);
-  }
-
-  public void setInitValue(short s) {
-    checkType(Type.SHORT);
-
-    if(s != 0)
-      value = new Integer(s);
-  }
-
-  public void setInitValue(char c) {
-    checkType(Type.CHAR);
-
-    if(c != 0)
-      value = new Integer(c);
-  }
-
-  public void setInitValue(byte b) {
-    checkType(Type.BYTE);
-
-    if(b != 0)
-      value = new Integer(b);
-  }
-
-  public void setInitValue(boolean b) {
-    checkType(Type.BOOLEAN);
-
-    if(b)
-      value = new Integer(1);
-  }
-
-  public void setInitValue(float f) {
-    checkType(Type.FLOAT);
-
-    if(f != 0.0)
-      value = new Float(f);
-  }
-
-  public void setInitValue(double d) {
-    checkType(Type.DOUBLE);
-
-    if(d != 0.0)
-      value = new Double(d);
-  }
-
-  /** Remove any initial value.
-   */
-  public void cancelInitValue() {
-    value = null;
-  }
-
-  private void checkType(Type atype) {
-    if(type == null)
-      throw new ClassGenException("You haven't defined the type of the field yet");
-    
-    if(!isFinal())
-      throw new ClassGenException("Only final fields may have an initial value!");
-
-    if(!type.equals(atype))
-      throw new ClassGenException("Types are not compatible: " + type + " vs. " + atype);
-  }
-
-  /**
-   * Get field object after having set up all necessary values.
-   */
-  public Field getField() {
-    String      signature       = getSignature();
-    int         name_index      = cp.addUtf8(name);
-    int         signature_index = cp.addUtf8(signature);
-
-    if(value != null) {
-      checkType(type);
-      int index = addConstant();
-      addAttribute(new ConstantValue(cp.addUtf8("ConstantValue"),
-				     2, index, cp.getConstantPool()));
-    }
-
-    return new Field(access_flags, name_index, signature_index, getAttributes(),
-		     cp.getConstantPool());
-  }
-
-  private int addConstant() {
-    switch(type.getType()) {
-    case Constants.T_INT: case Constants.T_CHAR: case Constants.T_BYTE:
-    case Constants.T_BOOLEAN: case Constants.T_SHORT:
-      return cp.addInteger(((Integer)value).intValue());
-      
-    case Constants.T_FLOAT:
-      return cp.addFloat(((Float)value).floatValue());
-
-    case Constants.T_DOUBLE:
-      return cp.addDouble(((Double)value).doubleValue());
-
-    case Constants.T_LONG:
-      return cp.addLong(((Long)value).longValue());
-
-    case Constants.T_REFERENCE:
-      return cp.addString(((String)value));
-
-    default:
-      throw new RuntimeException("Oops: Unhandled : " + type.getType());
-    }
-  }
-
-  public String  getSignature()  { return type.getSignature(); }
-
-  private List observers;
-
-  /** Add observer for this object.
-   */
-  public void addObserver(FieldObserver o) {
-    if(observers == null)
-      observers = new ArrayList();
-
-    observers.add(o);
-  }
-
-  /** Remove observer for this object.
-   */
-  public void removeObserver(FieldObserver o) {
-    if(observers != null)
-      observers.remove(o);
-  }
-
-  /** Call notify() method on all observers. This method is not called
-   * automatically whenever the state has changed, but has to be
-   * called by the user after he has finished editing the object.
-   */
-  public void update() {
-    if(observers != null)
-      for(Iterator e = observers.iterator(); e.hasNext(); )
-	((FieldObserver)e.next()).notify(this);
-  }
-
-  public String getInitValue() {
-    if(value != null) {
-      return value.toString();
-    } else
-      return null;
-  }
-
-  /**
-   * Return string representation close to declaration format,
-   * `public static final short MAX = 100', e.g..
-   *
-   * @return String representation of field
-   */
-  public final String toString() {
-    String name, signature, access; // Short cuts to constant pool
-
-    access    = Utility.accessToString(access_flags);
-    access    = access.equals("")? "" : (access + " ");
-    signature = type.toString();
-    name      = getName();
-
-    StringBuffer buf = new StringBuffer(32);
-    buf.append(access).append(signature).append(" ").append(name);
-    String value = getInitValue();
-
-    if(value != null)
-      buf.append(" = ").append(value);
-
-    return buf.toString();
-  }
-
-  /** @return deep copy of this field
-   */
-  public FieldGen copy(ConstantPoolGen cp) {
-    FieldGen fg = (FieldGen)clone();
-
-    fg.setConstantPool(cp);
-    return fg;
-  }
-
-	/**
-	 * @return Comparison strategy object
-	 */
-	public static BCELComparator getComparator() {
-		return _cmp;
-	}
-
-	/**
-	 * @param comparator Comparison strategy object
-	 */
-	public static void setComparator(BCELComparator comparator) {
-		_cmp = comparator;
-	}
-
-	/**
-	 * Return value as defined by given BCELComparator strategy.
-	 * By default two FieldGen objects are said to be equal when
-	 * their names and signatures are equal.
-	 * 
-	 * @see java.lang.Object#equals(java.lang.Object)
-	 */
-	public boolean equals(Object obj) {
-		return _cmp.equals(this, obj);
-	}
-
-	/**
-	 * Return value as defined by given BCELComparator strategy.
-	 * By default return the hashcode of the field's name XOR signature.
-	 * 
-	 * @see java.lang.Object#hashCode()
-	 */
-	public int hashCode() {
-		return _cmp.hashCode(this);
-	}
-}
+    private Object value = null;
+    private static BCELComparator _cmp = new BCELComparator() {
+
+        public boolean equals( Object o1, Object o2 ) {
+            FieldGen THIS = (FieldGen) o1;
+            FieldGen THAT = (FieldGen) o2;
+            return THIS.getName().equals(THAT.getName())
+                    && THIS.getSignature().equals(THAT.getSignature());
+        }
+
+
+        public int hashCode( Object o ) {
+            FieldGen THIS = (FieldGen) o;
+            return THIS.getSignature().hashCode() ^ THIS.getName().hashCode();
+        }
+    };
+
+
+    /**
+     * Declare a field. If it is static (isStatic() == true) and has a
+     * basic type like int or String it may have an initial value
+     * associated with it as defined by setInitValue().
+     *
+     * @param access_flags access qualifiers
+     * @param type  field type
+     * @param name field name
+     * @param cp constant pool
+     */
+    public FieldGen(int access_flags, Type type, String name, ConstantPoolGen cp) {
+        setAccessFlags(access_flags);
+        setType(type);
+        setName(name);
+        setConstantPool(cp);
+    }
+
+
+    /**
+     * Instantiate from existing field.
+     *
+     * @param field Field object
+     * @param cp constant pool (must contain the same entries as the field's constant pool)
+     */
+    public FieldGen(Field field, ConstantPoolGen cp) {
+        this(field.getAccessFlags(), Type.getType(field.getSignature()), field.getName(), cp);
+        Attribute[] attrs = field.getAttributes();
+        for (int i = 0; i < attrs.length; i++) {
+            if (attrs[i] instanceof ConstantValue) {
+                setValue(((ConstantValue) attrs[i]).getConstantValueIndex());
+            } else {
+                addAttribute(attrs[i]);
+            }
+        }
+    }
+
+
+    private void setValue( int index ) {
+        ConstantPool cp = this.cp.getConstantPool();
+        Constant c = cp.getConstant(index);
+        value = ((ConstantObject) c).getConstantValue(cp);
+    }
+
+
+    /**
+     * Set (optional) initial value of field, otherwise it will be set to null/0/false
+     * by the JVM automatically.
+     */
+    public void setInitValue( String str ) {
+        checkType(new ObjectType("java.lang.String"));
+        if (str != null) {
+            value = str;
+        }
+    }
+
+
+    public void setInitValue( long l ) {
+        checkType(Type.LONG);
+        if (l != 0L) {
+            value = new Long(l);
+        }
+    }
+
+
+    public void setInitValue( int i ) {
+        checkType(Type.INT);
+        if (i != 0) {
+            value = new Integer(i);
+        }
+    }
+
+
+    public void setInitValue( short s ) {
+        checkType(Type.SHORT);
+        if (s != 0) {
+            value = new Integer(s);
+        }
+    }
+
+
+    public void setInitValue( char c ) {
+        checkType(Type.CHAR);
+        if (c != 0) {
+            value = new Integer(c);
+        }
+    }
+
+
+    public void setInitValue( byte b ) {
+        checkType(Type.BYTE);
+        if (b != 0) {
+            value = new Integer(b);
+        }
+    }
+
+
+    public void setInitValue( boolean b ) {
+        checkType(Type.BOOLEAN);
+        if (b) {
+            value = new Integer(1);
+        }
+    }
+
+
+    public void setInitValue( float f ) {
+        checkType(Type.FLOAT);
+        if (f != 0.0) {
+            value = new Float(f);
+        }
+    }
+
+
+    public void setInitValue( double d ) {
+        checkType(Type.DOUBLE);
+        if (d != 0.0) {
+            value = new Double(d);
+        }
+    }
+
+
+    /** Remove any initial value.
+     */
+    public void cancelInitValue() {
+        value = null;
+    }
+
 
+    private void checkType( Type atype ) {
+        if (type == null) {
+            throw new ClassGenException("You haven't defined the type of the field yet");
+        }
+        if (!isFinal()) {
+            throw new ClassGenException("Only final fields may have an initial value!");
+        }
+        if (!type.equals(atype)) {
+            throw new ClassGenException("Types are not compatible: " + type + " vs. " + atype);
+        }
+    }
+
+
+    /**
+     * Get field object after having set up all necessary values.
+     */
+    public Field getField() {
+        String signature = getSignature();
+        int name_index = cp.addUtf8(name);
+        int signature_index = cp.addUtf8(signature);
+        if (value != null) {
+            checkType(type);
+            int index = addConstant();
+            addAttribute(new ConstantValue(cp.addUtf8("ConstantValue"), 2, index, cp
+                    .getConstantPool()));
+        }
+        return new Field(access_flags, name_index, signature_index, getAttributes(), cp
+                .getConstantPool());
+    }
+
+
+    private int addConstant() {
+        switch (type.getType()) {
+            case Constants.T_INT:
+            case Constants.T_CHAR:
+            case Constants.T_BYTE:
+            case Constants.T_BOOLEAN:
+            case Constants.T_SHORT:
+                return cp.addInteger(((Integer) value).intValue());
+            case Constants.T_FLOAT:
+                return cp.addFloat(((Float) value).floatValue());
+            case Constants.T_DOUBLE:
+                return cp.addDouble(((Double) value).doubleValue());
+            case Constants.T_LONG:
+                return cp.addLong(((Long) value).longValue());
+            case Constants.T_REFERENCE:
+                return cp.addString(((String) value));
+            default:
+                throw new RuntimeException("Oops: Unhandled : " + type.getType());
+        }
+    }
+
+
+    public String getSignature() {
+        return type.getSignature();
+    }
+
+    private List observers;
+
+
+    /** Add observer for this object.
+     */
+    public void addObserver( FieldObserver o ) {
+        if (observers == null) {
+            observers = new ArrayList();
+        }
+        observers.add(o);
+    }
+
+
+    /** Remove observer for this object.
+     */
+    public void removeObserver( FieldObserver o ) {
+        if (observers != null) {
+            observers.remove(o);
+        }
+    }
+
+
+    /** Call notify() method on all observers. This method is not called
+     * automatically whenever the state has changed, but has to be
+     * called by the user after he has finished editing the object.
+     */
+    public void update() {
+        if (observers != null) {
+            for (Iterator e = observers.iterator(); e.hasNext();) {
+                ((FieldObserver) e.next()).notify(this);
+            }
+        }
+    }
+
+
+    public String getInitValue() {
+        if (value != null) {
+            return value.toString();
+        } else {
+            return null;
+        }
+    }
+
+
+    /**
+     * Return string representation close to declaration format,
+     * `public static final short MAX = 100', e.g..
+     *
+     * @return String representation of field
+     */
+    public final String toString() {
+        String name, signature, access; // Short cuts to constant pool
+        access = Utility.accessToString(access_flags);
+        access = access.equals("") ? "" : (access + " ");
+        signature = type.toString();
+        name = getName();
+        StringBuffer buf = new StringBuffer(32);
+        buf.append(access).append(signature).append(" ").append(name);
+        String value = getInitValue();
+        if (value != null) {
+            buf.append(" = ").append(value);
+        }
+        return buf.toString();
+    }
+
+
+    /** @return deep copy of this field
+     */
+    public FieldGen copy( ConstantPoolGen cp ) {
+        FieldGen fg = (FieldGen) clone();
+        fg.setConstantPool(cp);
+        return fg;
+    }
+
+
+    /**
+     * @return Comparison strategy object
+     */
+    public static BCELComparator getComparator() {
+        return _cmp;
+    }
+
+
+    /**
+     * @param comparator Comparison strategy object
+     */
+    public static void setComparator( BCELComparator comparator ) {
+        _cmp = comparator;
+    }
+
+
+    /**
+     * Return value as defined by given BCELComparator strategy.
+     * By default two FieldGen objects are said to be equal when
+     * their names and signatures are equal.
+     * 
+     * @see java.lang.Object#equals(java.lang.Object)
+     */
+    public boolean equals( Object obj ) {
+        return _cmp.equals(this, obj);
+    }
+
+
+    /**
+     * Return value as defined by given BCELComparator strategy.
+     * By default return the hashcode of the field's name XOR signature.
+     * 
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode() {
+        return _cmp.hashCode(this);
+    }
+}

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldGenOrMethodGen.java Wed Mar 15 03:31:56 2006
@@ -1,4 +1,5 @@
 package org.apache.bcel.generic;
+
 import java.util.ArrayList;
 import java.util.List;
 import org.apache.bcel.Constants;
@@ -12,71 +13,103 @@
  * @version $Id$
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
-public abstract class FieldGenOrMethodGen extends AccessFlags
-  implements NamedAndTyped, Cloneable
-{
-  protected String          name;
-  protected Type            type;
-  protected ConstantPoolGen cp;
-  private   List       		attribute_vec = new ArrayList();
-
-  protected FieldGenOrMethodGen() {}
-
-  public void            setType(Type type)   {
-    if(type.getType() == Constants.T_ADDRESS)
-      throw new IllegalArgumentException("Type can not be " + type);
-
-    this.type = type;
-  }
-  public Type            getType()            { return type; }
-
-  /** @return name of method/field.
-   */
-  public String          getName()            { return name; }
-  public void            setName(String name) { this.name = name; }
-
-  public ConstantPoolGen getConstantPool()                   { return cp; }
-  public void            setConstantPool(ConstantPoolGen cp) { this.cp = cp; }    
-
-  /**
-   * Add an attribute to this method. Currently, the JVM knows about
-   * the `Code', `ConstantValue', `Synthetic' and `Exceptions'
-   * attributes. Other attributes will be ignored by the JVM but do no
-   * harm.
-   *
-   * @param a attribute to be added
-   */
-  public void addAttribute(Attribute a) { attribute_vec.add(a); }
-
-  /**
-   * Remove an attribute.
-   */
-  public void removeAttribute(Attribute a) { attribute_vec.remove(a); }
-
-  /**
-   * Remove all attributes.
-   */
-  public void removeAttributes() { attribute_vec.clear(); }
-   
-  /**
-   * @return all attributes of this method.
-   */
-  public Attribute[] getAttributes() {
-    Attribute[] attributes = new Attribute[attribute_vec.size()];
-    attribute_vec.toArray(attributes);
-    return attributes;
-  }
-
-  /** @return signature of method/field.
-   */
-  public abstract String  getSignature();
-
-  public Object clone() {
-    try {
-      return super.clone();
-    } catch(CloneNotSupportedException e) {
-      System.err.println(e);
-      return null;
+public abstract class FieldGenOrMethodGen extends AccessFlags implements NamedAndTyped, Cloneable {
+
+    protected String name;
+    protected Type type;
+    protected ConstantPoolGen cp;
+    private List attribute_vec = new ArrayList();
+
+
+    protected FieldGenOrMethodGen() {
+    }
+
+
+    public void setType( Type type ) {
+        if (type.getType() == Constants.T_ADDRESS) {
+            throw new IllegalArgumentException("Type can not be " + type);
+        }
+        this.type = type;
+    }
+
+
+    public Type getType() {
+        return type;
+    }
+
+
+    /** @return name of method/field.
+     */
+    public String getName() {
+        return name;
+    }
+
+
+    public void setName( String name ) {
+        this.name = name;
+    }
+
+
+    public ConstantPoolGen getConstantPool() {
+        return cp;
+    }
+
+
+    public void setConstantPool( ConstantPoolGen cp ) {
+        this.cp = cp;
+    }
+
+
+    /**
+     * Add an attribute to this method. Currently, the JVM knows about
+     * the `Code', `ConstantValue', `Synthetic' and `Exceptions'
+     * attributes. Other attributes will be ignored by the JVM but do no
+     * harm.
+     *
+     * @param a attribute to be added
+     */
+    public void addAttribute( Attribute a ) {
+        attribute_vec.add(a);
+    }
+
+
+    /**
+     * Remove an attribute.
+     */
+    public void removeAttribute( Attribute a ) {
+        attribute_vec.remove(a);
+    }
+
+
+    /**
+     * Remove all attributes.
+     */
+    public void removeAttributes() {
+        attribute_vec.clear();
+    }
+
+
+    /**
+     * @return all attributes of this method.
+     */
+    public Attribute[] getAttributes() {
+        Attribute[] attributes = new Attribute[attribute_vec.size()];
+        attribute_vec.toArray(attributes);
+        return attributes;
+    }
+
+
+    /** @return signature of method/field.
+     */
+    public abstract String getSignature();
+
+
+    public Object clone() {
+        try {
+            return super.clone();
+        } catch (CloneNotSupportedException e) {
+            System.err.println(e);
+            return null;
+        }
     }
-  }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldInstruction.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldInstruction.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldInstruction.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldInstruction.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 import org.apache.bcel.classfile.ConstantPool;
 
 /**
@@ -25,51 +24,57 @@
  * @version $Id$
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
-public abstract class FieldInstruction extends FieldOrMethod
-  implements TypedInstruction {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  FieldInstruction() {}
-
-  /**
-   * @param index to constant pool
-   */
-  protected FieldInstruction(short opcode, int index) {
-    super(opcode, index);
-  }
-
-  /**
-   * @return mnemonic for instruction with symbolic references resolved
-   */
-  public String toString(ConstantPool cp) {
-    return org.apache.bcel.Constants.OPCODE_NAMES[opcode] + " " +
-      cp.constantToString(index, org.apache.bcel.Constants.CONSTANT_Fieldref);
-  }
-  
-  /** @return size of field (1 or 2)
-   */
-  protected int getFieldSize(ConstantPoolGen cpg) {
-    return getType(cpg).getSize();
-  }
-
-  /** @return return type of referenced field
-   */
-  public Type getType(ConstantPoolGen cpg) {
-    return getFieldType(cpg);
-  }
-
-  /** @return type of field
-   */
-  public Type getFieldType(ConstantPoolGen cpg) {
-    return Type.getType(getSignature(cpg));
-  }
-
-  /** @return name of referenced field.
-   */
-  public String getFieldName(ConstantPoolGen cpg) {
-    return getName(cpg);
-  }
-}
+public abstract class FieldInstruction extends FieldOrMethod implements TypedInstruction {
 
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    FieldInstruction() {
+    }
+
+
+    /**
+     * @param index to constant pool
+     */
+    protected FieldInstruction(short opcode, int index) {
+        super(opcode, index);
+    }
+
+
+    /**
+     * @return mnemonic for instruction with symbolic references resolved
+     */
+    public String toString( ConstantPool cp ) {
+        return org.apache.bcel.Constants.OPCODE_NAMES[opcode] + " "
+                + cp.constantToString(index, org.apache.bcel.Constants.CONSTANT_Fieldref);
+    }
+
+
+    /** @return size of field (1 or 2)
+     */
+    protected int getFieldSize( ConstantPoolGen cpg ) {
+        return getType(cpg).getSize();
+    }
+
+
+    /** @return return type of referenced field
+     */
+    public Type getType( ConstantPoolGen cpg ) {
+        return getFieldType(cpg);
+    }
+
+
+    /** @return type of field
+     */
+    public Type getFieldType( ConstantPoolGen cpg ) {
+        return Type.getType(getSignature(cpg));
+    }
+
+
+    /** @return name of referenced field.
+     */
+    public String getFieldName( ConstantPoolGen cpg ) {
+        return getName(cpg);
+    }
+}

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldObserver.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldObserver.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldObserver.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldObserver.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /**
  * Imnplement this interface if you're interested in changes to a FieldGen object
  * and register yourself with addObserver().
@@ -25,6 +24,6 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public interface FieldObserver {
-  public void notify(FieldGen field);
-}
 
+    public void notify( FieldGen field );
+}

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldOrMethod.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldOrMethod.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldOrMethod.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/FieldOrMethod.java Wed Mar 15 03:31:56 2006
@@ -13,7 +13,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
 import org.apache.bcel.classfile.ConstantCP;
@@ -29,90 +29,100 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public abstract class FieldOrMethod extends CPInstruction implements LoadClass {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  FieldOrMethod() {}
-
-  /**
-   * @param index to constant pool
-   */
-  protected FieldOrMethod(short opcode, int index) {
-    super(opcode, index);
-  }
-
-  /** @return signature of referenced method/field.
-   */
-  public String getSignature(ConstantPoolGen cpg) {
-    ConstantPool        cp   = cpg.getConstantPool();
-    ConstantCP          cmr  = (ConstantCP)cp.getConstant(index);
-    ConstantNameAndType cnat = (ConstantNameAndType)cp.getConstant(cmr.getNameAndTypeIndex());
-
-    return ((ConstantUtf8)cp.getConstant(cnat.getSignatureIndex())).getBytes();
-  }
-
-  /** @return name of referenced method/field.
-   */
-  public String getName(ConstantPoolGen cpg) {
-    ConstantPool        cp   = cpg.getConstantPool();
-    ConstantCP          cmr  = (ConstantCP)cp.getConstant(index);
-    ConstantNameAndType cnat = (ConstantNameAndType)cp.getConstant(cmr.getNameAndTypeIndex());
-    return ((ConstantUtf8)cp.getConstant(cnat.getNameIndex())).getBytes();
-  }
-
-  /** @return name of the referenced class/interface
-   *  @deprecated If the instruction references an array class,
-   *    this method will return "java.lang.Object".
-   *    For code generated by Java 1.5, this answer is
-   *    sometimes wrong (e.g., if the "clone()" method is
-   *    called on an array).  A better idea is to use
-   *    the getReferenceType() method, which correctly distinguishes
-   *    between class types and array types.
-   */
-  public String getClassName(ConstantPoolGen cpg) {
-    ConstantPool cp  = cpg.getConstantPool();
-    ConstantCP   cmr = (ConstantCP)cp.getConstant(index);
-    String className = cp.getConstantString(cmr.getClassIndex(), org.apache.bcel.Constants.CONSTANT_Class);
-    if (className.startsWith("[")) {
-      // Turn array classes into java.lang.Object.
-       return "java.lang.Object";
-    }
-    return className.replace('/', '.');
-  }
-
-  /** @return type of the referenced class/interface
-   * @deprecated If the instruction references an array class,
-   *    the ObjectType returned will be invalid.  Use
-   *    getReferenceType() instead.
-   */
-  public ObjectType getClassType(ConstantPoolGen cpg) {
-    return new ObjectType(getClassName(cpg));
-  }
-
-  /**
-   * Return the reference type representing the class, interface,
-   * or array class referenced by the instruction.
-   * @param cpg the ConstantPoolGen used to create the instruction
-   * @return an ObjectType (if the referenced class type is a class
-   *   or interface), or an ArrayType (if the referenced class
-   *   type is an array class)
-   */
-  public ReferenceType getReferenceType(ConstantPoolGen cpg) {
-    ConstantPool cp  = cpg.getConstantPool();
-    ConstantCP   cmr = (ConstantCP)cp.getConstant(index);
-    String className = cp.getConstantString(cmr.getClassIndex(), org.apache.bcel.Constants.CONSTANT_Class);
-    if (className.startsWith("[")) {
-      return (ArrayType) Type.getType(className);
-    } else {
-      className = className.replace('/', '.');
-      return new ObjectType(className);
-    }
-  }
-
-  /** @return type of the referenced class/interface
-   */
-  public ObjectType getLoadClassType(ConstantPoolGen cpg) {
-    return getClassType(cpg);
-  }
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    FieldOrMethod() {
+    }
+
+
+    /**
+     * @param index to constant pool
+     */
+    protected FieldOrMethod(short opcode, int index) {
+        super(opcode, index);
+    }
+
+
+    /** @return signature of referenced method/field.
+     */
+    public String getSignature( ConstantPoolGen cpg ) {
+        ConstantPool cp = cpg.getConstantPool();
+        ConstantCP cmr = (ConstantCP) cp.getConstant(index);
+        ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex());
+        return ((ConstantUtf8) cp.getConstant(cnat.getSignatureIndex())).getBytes();
+    }
+
+
+    /** @return name of referenced method/field.
+     */
+    public String getName( ConstantPoolGen cpg ) {
+        ConstantPool cp = cpg.getConstantPool();
+        ConstantCP cmr = (ConstantCP) cp.getConstant(index);
+        ConstantNameAndType cnat = (ConstantNameAndType) cp.getConstant(cmr.getNameAndTypeIndex());
+        return ((ConstantUtf8) cp.getConstant(cnat.getNameIndex())).getBytes();
+    }
+
+
+    /** @return name of the referenced class/interface
+     *  @deprecated If the instruction references an array class,
+     *    this method will return "java.lang.Object".
+     *    For code generated by Java 1.5, this answer is
+     *    sometimes wrong (e.g., if the "clone()" method is
+     *    called on an array).  A better idea is to use
+     *    the getReferenceType() method, which correctly distinguishes
+     *    between class types and array types.
+     */
+    public String getClassName( ConstantPoolGen cpg ) {
+        ConstantPool cp = cpg.getConstantPool();
+        ConstantCP cmr = (ConstantCP) cp.getConstant(index);
+        String className = cp.getConstantString(cmr.getClassIndex(),
+                org.apache.bcel.Constants.CONSTANT_Class);
+        if (className.startsWith("[")) {
+            // Turn array classes into java.lang.Object.
+            return "java.lang.Object";
+        }
+        return className.replace('/', '.');
+    }
+
+
+    /** @return type of the referenced class/interface
+     * @deprecated If the instruction references an array class,
+     *    the ObjectType returned will be invalid.  Use
+     *    getReferenceType() instead.
+     */
+    public ObjectType getClassType( ConstantPoolGen cpg ) {
+        return new ObjectType(getClassName(cpg));
+    }
+
+
+    /**
+     * Return the reference type representing the class, interface,
+     * or array class referenced by the instruction.
+     * @param cpg the ConstantPoolGen used to create the instruction
+     * @return an ObjectType (if the referenced class type is a class
+     *   or interface), or an ArrayType (if the referenced class
+     *   type is an array class)
+     */
+    public ReferenceType getReferenceType( ConstantPoolGen cpg ) {
+        ConstantPool cp = cpg.getConstantPool();
+        ConstantCP cmr = (ConstantCP) cp.getConstant(index);
+        String className = cp.getConstantString(cmr.getClassIndex(),
+                org.apache.bcel.Constants.CONSTANT_Class);
+        if (className.startsWith("[")) {
+            return (ArrayType) Type.getType(className);
+        } else {
+            className = className.replace('/', '.');
+            return new ObjectType(className);
+        }
+    }
+
+
+    /** @return type of the referenced class/interface
+     */
+    public ObjectType getLoadClassType( ConstantPoolGen cpg ) {
+        return getClassType(cpg);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETFIELD.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETFIELD.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETFIELD.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETFIELD.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 import org.apache.bcel.Constants;
 import org.apache.bcel.ExceptionConstants;
 
@@ -29,52 +28,54 @@
  * @version $Id$
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
-public class GETFIELD extends FieldInstruction
-  implements ExceptionThrower, StackConsumer, StackProducer {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  GETFIELD() {}
-
-  public GETFIELD(int index) {
-    super(Constants.GETFIELD, index);
-  }
-
-  public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); }
-
-  public Class[] getExceptions() {
-    Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
-    System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
-		     cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-
-    cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] =
-      ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
-    cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] =
-      ExceptionConstants.NULL_POINTER_EXCEPTION;
-
-    return cs;
-  }
-
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitExceptionThrower(this);
-    v.visitStackConsumer(this);
-    v.visitStackProducer(this);
-    v.visitTypedInstruction(this);
-    v.visitLoadClass(this);
-    v.visitCPInstruction(this);
-    v.visitFieldOrMethod(this);
-    v.visitFieldInstruction(this);
-    v.visitGETFIELD(this);
-  }
+public class GETFIELD extends FieldInstruction implements ExceptionThrower, StackConsumer,
+        StackProducer {
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    GETFIELD() {
+    }
+
+
+    public GETFIELD(int index) {
+        super(Constants.GETFIELD, index);
+    }
+
+
+    public int produceStack( ConstantPoolGen cpg ) {
+        return getFieldSize(cpg);
+    }
+
+
+    public Class[] getExceptions() {
+        Class[] cs = new Class[2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
+        System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, cs, 0,
+                ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
+        cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length + 1] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
+        cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.NULL_POINTER_EXCEPTION;
+        return cs;
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitExceptionThrower(this);
+        v.visitStackConsumer(this);
+        v.visitStackProducer(this);
+        v.visitTypedInstruction(this);
+        v.visitLoadClass(this);
+        v.visitCPInstruction(this);
+        v.visitFieldOrMethod(this);
+        v.visitFieldInstruction(this);
+        v.visitGETFIELD(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETSTATIC.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETSTATIC.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETSTATIC.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GETSTATIC.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 import org.apache.bcel.Constants;
 import org.apache.bcel.ExceptionConstants;
 
@@ -30,47 +29,51 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class GETSTATIC extends FieldInstruction implements PushInstruction, ExceptionThrower {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  GETSTATIC() {}
-
-  public GETSTATIC(int index) {
-    super(Constants.GETSTATIC, index);
-  }
-
-  public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); }
-
-  public Class[] getExceptions() {
-    Class[] cs = new Class[1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
-
-    System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0,
-		     cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
-    cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = 
-      ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
-
-    return cs;
-  }
-
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitStackProducer(this);
-    v.visitPushInstruction(this);
-    v.visitExceptionThrower(this);
-    v.visitTypedInstruction(this);
-    v.visitLoadClass(this);
-    v.visitCPInstruction(this);
-    v.visitFieldOrMethod(this);
-    v.visitFieldInstruction(this);
-    v.visitGETSTATIC(this);
-  }
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    GETSTATIC() {
+    }
+
+
+    public GETSTATIC(int index) {
+        super(Constants.GETSTATIC, index);
+    }
+
+
+    public int produceStack( ConstantPoolGen cpg ) {
+        return getFieldSize(cpg);
+    }
+
+
+    public Class[] getExceptions() {
+        Class[] cs = new Class[1 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length];
+        System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, cs, 0,
+                ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length);
+        cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR;
+        return cs;
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitStackProducer(this);
+        v.visitPushInstruction(this);
+        v.visitExceptionThrower(this);
+        v.visitTypedInstruction(this);
+        v.visitLoadClass(this);
+        v.visitCPInstruction(this);
+        v.visitFieldOrMethod(this);
+        v.visitFieldInstruction(this);
+        v.visitGETSTATIC(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO.java Wed Mar 15 03:31:56 2006
@@ -13,7 +13,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
 import java.io.DataOutputStream;
@@ -26,61 +26,64 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class GOTO extends GotoInstruction implements VariableLengthInstruction {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  GOTO() {}
-
-  public GOTO(InstructionHandle target) {
-    super(org.apache.bcel.Constants.GOTO, target);
-  }
-
-  /**
-   * Dump instruction as byte code to stream out.
-   * @param out Output stream
-   */
-  public void dump(DataOutputStream out) throws IOException {
-    index = getTargetOffset();
-    if(opcode == org.apache.bcel.Constants.GOTO)
-      super.dump(out);
-    else { // GOTO_W
-      index = getTargetOffset();
-      out.writeByte(opcode);
-      out.writeInt(index);
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    GOTO() {
+    }
+
+
+    public GOTO(InstructionHandle target) {
+        super(org.apache.bcel.Constants.GOTO, target);
     }
-  }
 
-  /** Called in pass 2 of InstructionList.setPositions() in order to update
-   * the branch target, that may shift due to variable length instructions.
-   */
-  protected int updatePosition(int offset, int max_offset) {
-    int i = getTargetOffset(); // Depending on old position value
-
-    position += offset; // Position may be shifted by preceding expansions
-
-    if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
-      opcode = org.apache.bcel.Constants.GOTO_W;
-      length = 5;
-      return 2; // 5 - 3
+
+    /**
+     * Dump instruction as byte code to stream out.
+     * @param out Output stream
+     */
+    public void dump( DataOutputStream out ) throws IOException {
+        index = getTargetOffset();
+        if (opcode == org.apache.bcel.Constants.GOTO) {
+            super.dump(out);
+        } else { // GOTO_W
+            index = getTargetOffset();
+            out.writeByte(opcode);
+            out.writeInt(index);
+        }
     }
 
-    return 0;
-  }
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitVariableLengthInstruction(this);
-    v.visitUnconditionalBranch(this);
-    v.visitBranchInstruction(this);
-    v.visitGotoInstruction(this);
-    v.visitGOTO(this);
-  }
+    /** Called in pass 2 of InstructionList.setPositions() in order to update
+     * the branch target, that may shift due to variable length instructions.
+     */
+    protected int updatePosition( int offset, int max_offset ) {
+        int i = getTargetOffset(); // Depending on old position value
+        position += offset; // Position may be shifted by preceding expansions
+        if (Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
+            opcode = org.apache.bcel.Constants.GOTO_W;
+            length = 5;
+            return 2; // 5 - 3
+        }
+        return 0;
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitVariableLengthInstruction(this);
+        v.visitUnconditionalBranch(this);
+        v.visitBranchInstruction(this);
+        v.visitGotoInstruction(this);
+        v.visitGOTO(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO_W.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO_W.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO_W.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GOTO_W.java Wed Mar 15 03:31:56 2006
@@ -13,7 +13,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
 import java.io.DataOutputStream;
@@ -27,48 +27,53 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class GOTO_W extends GotoInstruction {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  GOTO_W() {}
-
-  public GOTO_W(InstructionHandle target) {
-    super(org.apache.bcel.Constants.GOTO_W, target);
-    length = 5;
-  }
-
-  /**
-   * Dump instruction as byte code to stream out.
-   * @param out Output stream
-   */
-  public void dump(DataOutputStream out) throws IOException {
-    index = getTargetOffset();
-    out.writeByte(opcode);
-    out.writeInt(index);
-  }
-
-  /**
-   * Read needed data (e.g. index) from file.
-   */
-  protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
-  {
-    index  = bytes.readInt();
-    length = 5;
-  }
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitUnconditionalBranch(this);
-    v.visitBranchInstruction(this);
-    v.visitGotoInstruction(this);
-    v.visitGOTO_W(this);
-  }
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    GOTO_W() {
+    }
+
+
+    public GOTO_W(InstructionHandle target) {
+        super(org.apache.bcel.Constants.GOTO_W, target);
+        length = 5;
+    }
+
+
+    /**
+     * Dump instruction as byte code to stream out.
+     * @param out Output stream
+     */
+    public void dump( DataOutputStream out ) throws IOException {
+        index = getTargetOffset();
+        out.writeByte(opcode);
+        out.writeInt(index);
+    }
+
+
+    /**
+     * Read needed data (e.g. index) from file.
+     */
+    protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException {
+        index = bytes.readInt();
+        length = 5;
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitUnconditionalBranch(this);
+        v.visitBranchInstruction(this);
+        v.visitGotoInstruction(this);
+        v.visitGOTO_W(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GotoInstruction.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GotoInstruction.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GotoInstruction.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/GotoInstruction.java Wed Mar 15 03:31:56 2006
@@ -13,26 +13,26 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * Super class for GOTO
  *
  * @version $Id$
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
-public abstract class GotoInstruction extends BranchInstruction
-  implements UnconditionalBranch
-{
-  GotoInstruction(short opcode, InstructionHandle target) {
-    super(opcode, target);
-  }
+public abstract class GotoInstruction extends BranchInstruction implements UnconditionalBranch {
+
+    GotoInstruction(short opcode, InstructionHandle target) {
+        super(opcode, target);
+    }
+
 
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  GotoInstruction(){}
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    GotoInstruction() {
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2B.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2B.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2B.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2B.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * I2B - Convert int to byte
  * <PRE>Stack: ..., value -&gt; ..., result</PRE>
@@ -25,26 +24,27 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class I2B extends ConversionInstruction {
-  /** Convert int to byte
-   */
-  public I2B() {
-    super(org.apache.bcel.Constants.I2B);
-  }
+
+    /** Convert int to byte
+     */
+    public I2B() {
+        super(org.apache.bcel.Constants.I2B);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitConversionInstruction(this);
-    v.visitI2B(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitConversionInstruction(this);
+        v.visitI2B(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2C.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2C.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2C.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2C.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * I2C - Convert int to char
  * <PRE>Stack: ..., value -&gt; ..., result</PRE>
@@ -25,26 +24,27 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class I2C extends ConversionInstruction {
-  /** Convert int to char
-   */
-  public I2C() {
-    super(org.apache.bcel.Constants.I2C);
-  }
+
+    /** Convert int to char
+     */
+    public I2C() {
+        super(org.apache.bcel.Constants.I2C);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitConversionInstruction(this);
-    v.visitI2C(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitConversionInstruction(this);
+        v.visitI2C(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2D.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2D.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2D.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2D.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /**
  * I2D - Convert int to double
  * <PRE>Stack: ..., value -&gt; ..., result.word1, result.word2</PRE>
@@ -25,26 +24,27 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class I2D extends ConversionInstruction {
-  /** Convert int to double
-   */
-  public I2D() {
-    super(org.apache.bcel.Constants.I2D);
-  }
+
+    /** Convert int to double
+     */
+    public I2D() {
+        super(org.apache.bcel.Constants.I2D);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitConversionInstruction(this);
-    v.visitI2D(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitConversionInstruction(this);
+        v.visitI2D(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2F.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2F.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2F.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2F.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * I2F - Convert int to float
  * <PRE>Stack: ..., value -&gt; ..., result</PRE>
@@ -25,26 +24,27 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class I2F extends ConversionInstruction {
-  /** Convert int to float
-   */
-  public I2F() {
-    super(org.apache.bcel.Constants.I2F);
-  }
+
+    /** Convert int to float
+     */
+    public I2F() {
+        super(org.apache.bcel.Constants.I2F);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitConversionInstruction(this);
-    v.visitI2F(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitConversionInstruction(this);
+        v.visitI2F(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2L.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2L.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2L.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2L.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /**
  * I2L - Convert int to long
  * <PRE>Stack: ..., value -&gt; ..., result.word1, result.word2</PRE>
@@ -25,26 +24,27 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class I2L extends ConversionInstruction {
-  /** Convert int to long
-   */
-  public I2L() {
-    super(org.apache.bcel.Constants.I2L);
-  }
+
+    /** Convert int to long
+     */
+    public I2L() {
+        super(org.apache.bcel.Constants.I2L);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitConversionInstruction(this);
-    v.visitI2L(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitConversionInstruction(this);
+        v.visitI2L(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2S.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2S.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2S.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/I2S.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /**
  * I2S - Convert int to short
  * <PRE>Stack: ..., value -&gt; ..., result</PRE>
@@ -25,24 +24,25 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class I2S extends ConversionInstruction {
-  public I2S() {
-    super(org.apache.bcel.Constants.I2S);
-  }
+
+    public I2S() {
+        super(org.apache.bcel.Constants.I2S);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitConversionInstruction(this);
-    v.visitI2S(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitConversionInstruction(this);
+        v.visitI2S(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IADD.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IADD.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IADD.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IADD.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * IADD - Add ints
  * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
@@ -25,26 +24,27 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IADD extends ArithmeticInstruction {
-  /** Add ints
-   */
-  public IADD() {
-    super(org.apache.bcel.Constants.IADD);
-  }
+
+    /** Add ints
+     */
+    public IADD() {
+        super(org.apache.bcel.Constants.IADD);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitArithmeticInstruction(this);
-    v.visitIADD(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitArithmeticInstruction(this);
+        v.visitIADD(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IALOAD.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IALOAD.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IALOAD.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IALOAD.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * IALOAD - Load int from array
  * <PRE>Stack: ..., arrayref, index -&gt; ..., value</PRE>
@@ -25,27 +24,28 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IALOAD extends ArrayInstruction implements StackProducer {
-  /** 
-   * Load int from array
-   */
-  public IALOAD() {
-    super(org.apache.bcel.Constants.IALOAD);
-  }
+
+    /** 
+     * Load int from array
+     */
+    public IALOAD() {
+        super(org.apache.bcel.Constants.IALOAD);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitStackProducer(this);
-    v.visitExceptionThrower(this);
-    v.visitTypedInstruction(this);
-    v.visitArrayInstruction(this);
-    v.visitIALOAD(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitStackProducer(this);
+        v.visitExceptionThrower(this);
+        v.visitTypedInstruction(this);
+        v.visitArrayInstruction(this);
+        v.visitIALOAD(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IAND.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IAND.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IAND.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IAND.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * IAND - Bitwise AND int
  * <PRE>Stack: ..., value1, value2 -&gt; ..., result</PRE>
@@ -25,24 +24,25 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IAND extends ArithmeticInstruction {
-  public IAND() {
-    super(org.apache.bcel.Constants.IAND);
-  }
+
+    public IAND() {
+        super(org.apache.bcel.Constants.IAND);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitArithmeticInstruction(this);
-    v.visitIAND(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitArithmeticInstruction(this);
+        v.visitIAND(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IASTORE.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IASTORE.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IASTORE.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IASTORE.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * IASTORE -  Store into int array
  * <PRE>Stack: ..., arrayref, index, value -&gt; ...</PRE>
@@ -25,27 +24,28 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IASTORE extends ArrayInstruction implements StackConsumer {
-  /** 
-   * Store into int array
-   */
-  public IASTORE() {
-    super(org.apache.bcel.Constants.IASTORE);
-  }
+
+    /** 
+     * Store into int array
+     */
+    public IASTORE() {
+        super(org.apache.bcel.Constants.IASTORE);
+    }
 
 
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitStackConsumer(this);
-    v.visitExceptionThrower(this);
-    v.visitTypedInstruction(this);
-    v.visitArrayInstruction(this);
-    v.visitIASTORE(this);
-  }
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitStackConsumer(this);
+        v.visitExceptionThrower(this);
+        v.visitTypedInstruction(this);
+        v.visitArrayInstruction(this);
+        v.visitIASTORE(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ICONST.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ICONST.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ICONST.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/ICONST.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * ICONST - Push value between -1, ..., 5, other values cause an exception
  *
@@ -25,48 +24,55 @@
  * @version $Id$
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
-public class ICONST extends Instruction
-  implements ConstantPushInstruction, TypedInstruction {
-  private int value;
-
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  ICONST() {}
-
-  public ICONST(int i) {
-    super(org.apache.bcel.Constants.ICONST_0, (short)1);
-
-    if((i >= -1) && (i <= 5))
-      opcode = (short)(org.apache.bcel.Constants.ICONST_0 + i); // Even works for i == -1
-    else
-      throw new ClassGenException("ICONST can be used only for value between -1 and 5: " +
-				  i);
-    value = i;
-  }
-  
-  public Number getValue() { return new Integer(value); }
-
-  /** @return Type.INT
-   */
-  public Type getType(ConstantPoolGen cp) {
-    return Type.INT;
-  }
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitPushInstruction(this);
-    v.visitStackProducer(this);
-    v.visitTypedInstruction(this);
-    v.visitConstantPushInstruction(this);
-    v.visitICONST(this);
-  }
+public class ICONST extends Instruction implements ConstantPushInstruction, TypedInstruction {
+
+    private int value;
+
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    ICONST() {
+    }
+
+
+    public ICONST(int i) {
+        super(org.apache.bcel.Constants.ICONST_0, (short) 1);
+        if ((i >= -1) && (i <= 5)) {
+            opcode = (short) (org.apache.bcel.Constants.ICONST_0 + i); // Even works for i == -1
+        } else {
+            throw new ClassGenException("ICONST can be used only for value between -1 and 5: " + i);
+        }
+        value = i;
+    }
+
+
+    public Number getValue() {
+        return new Integer(value);
+    }
+
+
+    /** @return Type.INT
+     */
+    public Type getType( ConstantPoolGen cp ) {
+        return Type.INT;
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitPushInstruction(this);
+        v.visitStackProducer(this);
+        v.visitTypedInstruction(this);
+        v.visitConstantPushInstruction(this);
+        v.visitICONST(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IDIV.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IDIV.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IDIV.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IDIV.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /**
  * IDIV - Divide ints
  * <PRE>Stack: ..., value1, value2 -&gt; result</PRE>
@@ -25,33 +24,37 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IDIV extends ArithmeticInstruction implements ExceptionThrower {
-  /** Divide ints
-   */
-  public IDIV() {
-    super(org.apache.bcel.Constants.IDIV);
-  }
-
-  /** @return exceptions this instruction may cause
-   */
-  public Class[] getExceptions() {
-    return new Class[] { org.apache.bcel.ExceptionConstants.ARITHMETIC_EXCEPTION };
-  }
-
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitExceptionThrower(this);
-    v.visitTypedInstruction(this);
-    v.visitStackProducer(this);
-    v.visitStackConsumer(this);
-    v.visitArithmeticInstruction(this);
-    v.visitIDIV(this);
-  }
+
+    /** Divide ints
+     */
+    public IDIV() {
+        super(org.apache.bcel.Constants.IDIV);
+    }
+
+
+    /** @return exceptions this instruction may cause
+     */
+    public Class[] getExceptions() {
+        return new Class[] {
+            org.apache.bcel.ExceptionConstants.ARITHMETIC_EXCEPTION
+        };
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitExceptionThrower(this);
+        v.visitTypedInstruction(this);
+        v.visitStackProducer(this);
+        v.visitStackConsumer(this);
+        v.visitArithmeticInstruction(this);
+        v.visitIDIV(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFEQ.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFEQ.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFEQ.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFEQ.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * IFEQ - Branch if int comparison with zero succeeds
  *
@@ -26,36 +25,40 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IFEQ extends IfInstruction {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  IFEQ() {}
-
-  public IFEQ(InstructionHandle target) {
-    super(org.apache.bcel.Constants.IFEQ, target);
-  }
-
-  /**
-   * @return negation of instruction, e.g. IFEQ.negate() == IFNE
-   */
-  public IfInstruction negate() {
-    return new IFNE(target);
-  }
-
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitStackConsumer(this);
-    v.visitBranchInstruction(this);
-    v.visitIfInstruction(this);
-    v.visitIFEQ(this);
-  }
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    IFEQ() {
+    }
+
+
+    public IFEQ(InstructionHandle target) {
+        super(org.apache.bcel.Constants.IFEQ, target);
+    }
+
+
+    /**
+     * @return negation of instruction, e.g. IFEQ.negate() == IFNE
+     */
+    public IfInstruction negate() {
+        return new IFNE(target);
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitStackConsumer(this);
+        v.visitBranchInstruction(this);
+        v.visitIfInstruction(this);
+        v.visitIFEQ(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGE.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGE.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGE.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGE.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * IFGE - Branch if int comparison with zero succeeds
  *
@@ -26,36 +25,40 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IFGE extends IfInstruction {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  IFGE() {}
-
-  public IFGE(InstructionHandle target) {
-    super(org.apache.bcel.Constants.IFGE, target);
-  }
-
-  /**
-   * @return negation of instruction
-   */
-  public IfInstruction negate() {
-    return new IFLT(target);
-  }
-
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitStackConsumer(this);
-    v.visitBranchInstruction(this);
-    v.visitIfInstruction(this);
-    v.visitIFGE(this);
-  }
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    IFGE() {
+    }
+
+
+    public IFGE(InstructionHandle target) {
+        super(org.apache.bcel.Constants.IFGE, target);
+    }
+
+
+    /**
+     * @return negation of instruction
+     */
+    public IfInstruction negate() {
+        return new IFLT(target);
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitStackConsumer(this);
+        v.visitBranchInstruction(this);
+        v.visitIfInstruction(this);
+        v.visitIFGE(this);
+    }
 }

Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGT.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGT.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGT.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/IFGT.java Wed Mar 15 03:31:56 2006
@@ -13,10 +13,9 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License. 
  *
- */ 
+ */
 package org.apache.bcel.generic;
 
-
 /** 
  * IFGT - Branch if int comparison with zero succeeds
  *
@@ -26,36 +25,40 @@
  * @author  <A HREF="mailto:[email protected]">M. Dahm</A>
  */
 public class IFGT extends IfInstruction {
-  /**
-   * Empty constructor needed for the Class.newInstance() statement in
-   * Instruction.readInstruction(). Not to be used otherwise.
-   */
-  IFGT() {}
-
-  public IFGT(InstructionHandle target) {
-    super(org.apache.bcel.Constants.IFGT, target);
-  }
-
-  /**
-   * @return negation of instruction
-   */
-  public IfInstruction negate() {
-    return new IFLE(target);
-  }
-
-
-  /**
-   * Call corresponding visitor method(s). The order is:
-   * Call visitor methods of implemented interfaces first, then
-   * call methods according to the class hierarchy in descending order,
-   * i.e., the most specific visitXXX() call comes last.
-   *
-   * @param v Visitor object
-   */
-  public void accept(Visitor v) {
-    v.visitStackConsumer(this);
-    v.visitBranchInstruction(this);
-    v.visitIfInstruction(this);
-    v.visitIFGT(this);
-  }
+
+    /**
+     * Empty constructor needed for the Class.newInstance() statement in
+     * Instruction.readInstruction(). Not to be used otherwise.
+     */
+    IFGT() {
+    }
+
+
+    public IFGT(InstructionHandle target) {
+        super(org.apache.bcel.Constants.IFGT, target);
+    }
+
+
+    /**
+     * @return negation of instruction
+     */
+    public IfInstruction negate() {
+        return new IFLE(target);
+    }
+
+
+    /**
+     * Call corresponding visitor method(s). The order is:
+     * Call visitor methods of implemented interfaces first, then
+     * call methods according to the class hierarchy in descending order,
+     * i.e., the most specific visitXXX() call comes last.
+     *
+     * @param v Visitor object
+     */
+    public void accept( Visitor v ) {
+        v.visitStackConsumer(this);
+        v.visitBranchInstruction(this);
+        v.visitIfInstruction(this);
+        v.visitIFGT(this);
+    }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.