From 06b5401c5b05053f469e7b0312a16708b677182a Mon Sep 17 00:00:00 2001 From: aclement Date: Sun, 4 Oct 2009 03:21:45 +0000 Subject: [PATCH] formatted --- .../org/aspectj/apache/bcel/generic/RET.java | 84 +++++++++++-------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/RET.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/RET.java index 1bb6b843f..1dc19d446 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/RET.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/RET.java @@ -53,54 +53,68 @@ package org.aspectj.apache.bcel.generic; * information on the Apache Software Foundation, please see * . */ -import java.io.*; +import java.io.DataOutputStream; +import java.io.IOException; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.ConstantPool; -/** +/** * RET - Return from subroutine - * - *
Stack: ..., -> ..., address
- * - * @version $Id: RET.java,v 1.3 2008/05/28 23:53:00 aclement Exp $ - * @author M. Dahm + * + *
+ * Stack: ..., -> ..., address
+ * 
+ * + * @version $Id: RET.java,v 1.4 2009/10/04 03:21:45 aclement Exp $ + * @author M. Dahm */ public class RET extends Instruction { - private boolean wide; - private int index; // index to local variable containg the return address + private boolean wide; + private int index; // index to local variable containg the return address + public RET(int index, boolean wide) { + super(Constants.RET); + this.index = index; + this.wide = wide; + // this.wide = index > org.aspectj.apache.bcel.Constants.MAX_BYTE; + } - public RET(int index,boolean wide) { - super(Constants.RET); - this.index = index; - this.wide = wide; - //this.wide = index > org.aspectj.apache.bcel.Constants.MAX_BYTE; - } + public void dump(DataOutputStream out) throws IOException { + if (wide) { + out.writeByte(org.aspectj.apache.bcel.Constants.WIDE); + } + out.writeByte(opcode); + if (wide) { + out.writeShort(index); + } else { + out.writeByte(index); + } + } - public void dump(DataOutputStream out) throws IOException { - if (wide) out.writeByte(org.aspectj.apache.bcel.Constants.WIDE); - out.writeByte(opcode); - if(wide) out.writeShort(index); - else out.writeByte(index); - } + public int getLength() { + if (wide) { + return 4; + } else { + return 2; + } + } - public int getLength() { - if (wide) return 4; else return 2; - } + public final int getIndex() { + return index; + } - public final int getIndex() { return index; } - public final void setIndex(int index) { - this.index = index; - this.wide = index > org.aspectj.apache.bcel.Constants.MAX_BYTE; - } + public final void setIndex(int index) { + this.index = index; + this.wide = index > org.aspectj.apache.bcel.Constants.MAX_BYTE; + } - public String toString(boolean verbose) { - return super.toString(verbose) + " " + index; - } + public String toString(boolean verbose) { + return super.toString(verbose) + " " + index; + } - public Type getType(ConstantPool cp) { - return ReturnaddressType.NO_TARGET; - } + public Type getType(ConstantPool cp) { + return ReturnaddressType.NO_TARGET; + } } -- 2.39.5