Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR.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,58 +26,61 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class JSR extends JsrInstruction implements VariableLengthInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- JSR() {}
-
- public JSR(InstructionHandle target) {
- super(org.apache.bcel.Constants.JSR, 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.JSR)
- super.dump(out);
- else { // JSR_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.
+ */
+ JSR() {
+ }
+
+
+ public JSR(InstructionHandle target) {
+ super(org.apache.bcel.Constants.JSR, target);
}
- }
- 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
+ /**
+ * 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.JSR) {
+ super.dump(out);
+ } else { // JSR_W
+ index = getTargetOffset();
+ out.writeByte(opcode);
+ out.writeInt(index);
+ }
+ }
+
- if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
- opcode = org.apache.bcel.Constants.JSR_W;
- length = 5;
- return 2; // 5 - 3
+ 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.JSR_W;
+ length = 5;
+ return 2; // 5 - 3
+ }
+ return 0;
}
- 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.visitStackProducer(this);
- v.visitVariableLengthInstruction(this);
- v.visitBranchInstruction(this);
- v.visitJsrInstruction(this);
- v.visitJSR(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.visitVariableLengthInstruction(this);
+ v.visitBranchInstruction(this);
+ v.visitJsrInstruction(this);
+ v.visitJSR(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR_W.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR_W.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR_W.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JSR_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 JSR_W extends JsrInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- JSR_W() {}
-
- public JSR_W(InstructionHandle target) {
- super(org.apache.bcel.Constants.JSR_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.visitStackProducer(this);
- v.visitBranchInstruction(this);
- v.visitJsrInstruction(this);
- v.visitJSR_W(this);
- }
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ JSR_W() {
+ }
+
+
+ public JSR_W(InstructionHandle target) {
+ super(org.apache.bcel.Constants.JSR_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.visitStackProducer(this);
+ v.visitBranchInstruction(this);
+ v.visitJsrInstruction(this);
+ v.visitJSR_W(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JsrInstruction.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JsrInstruction.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JsrInstruction.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/JsrInstruction.java Wed Mar 15 03:31:56 2006
@@ -13,66 +13,67 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
- */
+ */
package org.apache.bcel.generic;
-
/**
* Super class for JSR - Jump to subroutine
*
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public abstract class JsrInstruction extends BranchInstruction
- implements UnconditionalBranch, TypedInstruction, StackProducer
-{
- JsrInstruction(short opcode, InstructionHandle target) {
- super(opcode, target);
- }
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- JsrInstruction(){}
-
- /** @return return address type
- */
- public Type getType(ConstantPoolGen cp) {
- return new ReturnaddressType(physicalSuccessor());
- }
-
- /**
- * Returns an InstructionHandle to the physical successor
- * of this JsrInstruction. <B>For this method to work,
- * this JsrInstruction object must not be shared between
- * multiple InstructionHandle objects!</B>
- * Formally, there must not be InstructionHandle objects
- * i, j where i != j and i.getInstruction() == this ==
- * j.getInstruction().
- * @return an InstructionHandle to the "next" instruction that
- * will be executed when RETurned from a subroutine.
- */
- public InstructionHandle physicalSuccessor(){
- InstructionHandle ih = this.target;
-
- // Rewind!
- while(ih.getPrev() != null)
- ih = ih.getPrev();
-
- // Find the handle for "this" JsrInstruction object.
- while(ih.getInstruction() != this)
- ih = ih.getNext();
-
- InstructionHandle toThis = ih;
-
- while(ih != null){
- ih = ih.getNext();
- if ((ih != null) && (ih.getInstruction() == this))
- throw new RuntimeException("physicalSuccessor() called on a shared JsrInstruction.");
+public abstract class JsrInstruction extends BranchInstruction implements UnconditionalBranch,
+ TypedInstruction, StackProducer {
+
+ JsrInstruction(short opcode, InstructionHandle target) {
+ super(opcode, target);
+ }
+
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ JsrInstruction() {
+ }
+
+
+ /** @return return address type
+ */
+ public Type getType( ConstantPoolGen cp ) {
+ return new ReturnaddressType(physicalSuccessor());
+ }
+
+
+ /**
+ * Returns an InstructionHandle to the physical successor
+ * of this JsrInstruction. <B>For this method to work,
+ * this JsrInstruction object must not be shared between
+ * multiple InstructionHandle objects!</B>
+ * Formally, there must not be InstructionHandle objects
+ * i, j where i != j and i.getInstruction() == this ==
+ * j.getInstruction().
+ * @return an InstructionHandle to the "next" instruction that
+ * will be executed when RETurned from a subroutine.
+ */
+ public InstructionHandle physicalSuccessor() {
+ InstructionHandle ih = this.target;
+ // Rewind!
+ while (ih.getPrev() != null) {
+ ih = ih.getPrev();
+ }
+ // Find the handle for "this" JsrInstruction object.
+ while (ih.getInstruction() != this) {
+ ih = ih.getNext();
+ }
+ InstructionHandle toThis = ih;
+ while (ih != null) {
+ ih = ih.getNext();
+ if ((ih != null) && (ih.getInstruction() == this)) {
+ throw new RuntimeException("physicalSuccessor() called on a shared JsrInstruction.");
+ }
+ }
+ // Return the physical successor
+ return toThis.getNext();
}
-
- // Return the physical successor
- return toThis.getNext();
- }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2D.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2D.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2D.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2D.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;
-
/**
* L2D - Convert long to double
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class L2D extends ConversionInstruction {
- public L2D() {
- super(org.apache.bcel.Constants.L2D);
- }
+
+ public L2D() {
+ super(org.apache.bcel.Constants.L2D);
+ }
- /**
- * 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.visitL2D(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.visitL2D(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2F.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2F.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2F.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2F.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;
-
/**
* L2F - Convert long to float
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class L2F extends ConversionInstruction {
- public L2F() {
- super(org.apache.bcel.Constants.L2F);
- }
+
+ public L2F() {
+ super(org.apache.bcel.Constants.L2F);
+ }
- /**
- * 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.visitL2F(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.visitL2F(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2I.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2I.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2I.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/L2I.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;
-
/**
* L2I - Convert long to int
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class L2I extends ConversionInstruction {
- public L2I() {
- super(org.apache.bcel.Constants.L2I);
- }
+
+ public L2I() {
+ super(org.apache.bcel.Constants.L2I);
+ }
- /**
- * 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.visitL2I(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.visitL2I(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LADD.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LADD.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LADD.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LADD.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;
-
/**
* LADD - Add longs
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE>
@@ -26,24 +25,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LADD extends ArithmeticInstruction {
- public LADD() {
- super(org.apache.bcel.Constants.LADD);
- }
+
+ public LADD() {
+ super(org.apache.bcel.Constants.LADD);
+ }
- /**
- * 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.visitLADD(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.visitLADD(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LALOAD.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LALOAD.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LALOAD.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LALOAD.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;
-
/**
* LALOAD - Load long from array
* <PRE>Stack: ..., arrayref, index -> ..., value1, value2</PRE>
@@ -25,26 +24,27 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LALOAD extends ArrayInstruction implements StackProducer {
- /** Load long from array
- */
- public LALOAD() {
- super(org.apache.bcel.Constants.LALOAD);
- }
+
+ /** Load long from array
+ */
+ public LALOAD() {
+ super(org.apache.bcel.Constants.LALOAD);
+ }
- /**
- * 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.visitLALOAD(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.visitLALOAD(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LAND.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LAND.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LAND.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LAND.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;
-
/**
* LAND - Bitwise AND longs
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE>
@@ -26,24 +25,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LAND extends ArithmeticInstruction {
- public LAND() {
- super(org.apache.bcel.Constants.LAND);
- }
+
+ public LAND() {
+ super(org.apache.bcel.Constants.LAND);
+ }
- /**
- * 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.visitLAND(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.visitLAND(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LASTORE.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LASTORE.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LASTORE.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LASTORE.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;
-
/**
* LASTORE - Store into long array
* <PRE>Stack: ..., arrayref, index, value.word1, value.word2 -> ...</PRE>
@@ -25,26 +24,27 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LASTORE extends ArrayInstruction implements StackConsumer {
- /** Store long into array
- */
- public LASTORE() {
- super(org.apache.bcel.Constants.LASTORE);
- }
+
+ /** Store long into array
+ */
+ public LASTORE() {
+ super(org.apache.bcel.Constants.LASTORE);
+ }
- /**
- * 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.visitLASTORE(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.visitLASTORE(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCMP.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCMP.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCMP.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCMP.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;
-
/**
* LCMP - Compare longs:
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE>
@@ -25,31 +24,32 @@
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public class LCMP extends Instruction
- implements TypedInstruction, StackProducer, StackConsumer
-{
- public LCMP() {
- super(org.apache.bcel.Constants.LCMP, (short)1);
- }
-
- /** @return Type.LONG
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.LONG;
- }
-
- /**
- * 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.visitLCMP(this);
- }
+public class LCMP extends Instruction implements TypedInstruction, StackProducer, StackConsumer {
+
+ public LCMP() {
+ super(org.apache.bcel.Constants.LCMP, (short) 1);
+ }
+
+
+ /** @return Type.LONG
+ */
+ public Type getType( ConstantPoolGen cp ) {
+ return Type.LONG;
+ }
+
+
+ /**
+ * 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.visitLCMP(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCONST.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCONST.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCONST.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LCONST.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;
-
/**
* LCONST - Push 0 or 1, other values cause an exception
*
@@ -25,50 +24,57 @@
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public class LCONST extends Instruction
- implements ConstantPushInstruction, TypedInstruction {
- private long value;
-
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LCONST() {}
-
- public LCONST(long l) {
- super(org.apache.bcel.Constants.LCONST_0, (short)1);
-
- if(l == 0)
- opcode = org.apache.bcel.Constants.LCONST_0;
- else if(l == 1)
- opcode = org.apache.bcel.Constants.LCONST_1;
- else
- throw new ClassGenException("LCONST can be used only for 0 and 1: " + l);
-
- value = l;
- }
-
- public Number getValue() { return new Long(value); }
-
- /** @return Type.LONG
- */
- public Type getType(ConstantPoolGen cp) {
- return Type.LONG;
- }
-
- /**
- * 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.visitLCONST(this);
- }
+public class LCONST extends Instruction implements ConstantPushInstruction, TypedInstruction {
+
+ private long value;
+
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ LCONST() {
+ }
+
+
+ public LCONST(long l) {
+ super(org.apache.bcel.Constants.LCONST_0, (short) 1);
+ if (l == 0) {
+ opcode = org.apache.bcel.Constants.LCONST_0;
+ } else if (l == 1) {
+ opcode = org.apache.bcel.Constants.LCONST_1;
+ } else {
+ throw new ClassGenException("LCONST can be used only for 0 and 1: " + l);
+ }
+ value = l;
+ }
+
+
+ public Number getValue() {
+ return new Long(value);
+ }
+
+
+ /** @return Type.LONG
+ */
+ public Type getType( ConstantPoolGen cp ) {
+ return Type.LONG;
+ }
+
+
+ /**
+ * 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.visitLCONST(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC.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;
@@ -28,113 +28,121 @@
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public class LDC extends CPInstruction
- implements PushInstruction, ExceptionThrower, TypedInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LDC() {}
-
- public LDC(int index) {
- super(org.apache.bcel.Constants.LDC_W, index);
- setSize();
- }
-
- // Adjust to proper size
- protected final void setSize() {
- if(index <= org.apache.bcel.Constants.MAX_BYTE) { // Fits in one byte?
- opcode = org.apache.bcel.Constants.LDC;
- length = 2;
- } else {
- opcode = org.apache.bcel.Constants.LDC_W;
- length = 3;
- }
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- out.writeByte(opcode);
-
- if(length == 2)
- out.writeByte(index);
- else // Applies for LDC_W
- out.writeShort(index);
- }
-
- /**
- * Set the index to constant pool and adjust size.
- */
- public final void setIndex(int index) {
- super.setIndex(index);
- setSize();
- }
-
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- length = 2;
- index = bytes.readUnsignedByte();
- }
-
- public Object getValue(ConstantPoolGen cpg) {
- org.apache.bcel.classfile.Constant c = cpg.getConstantPool().getConstant(index);
-
- switch(c.getTag()) {
- case org.apache.bcel.Constants.CONSTANT_String:
- int i = ((org.apache.bcel.classfile.ConstantString)c).getStringIndex();
- c = cpg.getConstantPool().getConstant(i);
- return ((org.apache.bcel.classfile.ConstantUtf8)c).getBytes();
-
- case org.apache.bcel.Constants.CONSTANT_Float:
- return new Float(((org.apache.bcel.classfile.ConstantFloat)c).getBytes());
-
- case org.apache.bcel.Constants.CONSTANT_Integer:
- return new Integer(((org.apache.bcel.classfile.ConstantInteger)c).getBytes());
-
- case org.apache.bcel.Constants.CONSTANT_Class:
- return (org.apache.bcel.classfile.ConstantClass) c;
-
- default: // Never reached
- throw new RuntimeException("Unknown or invalid constant type at " + index);
- }
- }
-
- public Type getType(ConstantPoolGen cpg) {
- switch(cpg.getConstantPool().getConstant(index).getTag()) {
- case org.apache.bcel.Constants.CONSTANT_String: return Type.STRING;
- case org.apache.bcel.Constants.CONSTANT_Float: return Type.FLOAT;
- case org.apache.bcel.Constants.CONSTANT_Integer: return Type.INT;
- case org.apache.bcel.Constants.CONSTANT_Class: return Type.CLASS;
- default: // Never reached
- throw new RuntimeException("Unknown or invalid constant type at " + index);
- }
- }
-
- public Class[] getExceptions() {
- return org.apache.bcel.ExceptionConstants.EXCS_STRING_RESOLUTION;
- }
-
- /**
- * 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.visitCPInstruction(this);
- v.visitLDC(this);
- }
+public class LDC extends CPInstruction implements PushInstruction, ExceptionThrower,
+ TypedInstruction {
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ LDC() {
+ }
+
+
+ public LDC(int index) {
+ super(org.apache.bcel.Constants.LDC_W, index);
+ setSize();
+ }
+
+
+ // Adjust to proper size
+ protected final void setSize() {
+ if (index <= org.apache.bcel.Constants.MAX_BYTE) { // Fits in one byte?
+ opcode = org.apache.bcel.Constants.LDC;
+ length = 2;
+ } else {
+ opcode = org.apache.bcel.Constants.LDC_W;
+ length = 3;
+ }
+ }
+
+
+ /**
+ * Dump instruction as byte code to stream out.
+ * @param out Output stream
+ */
+ public void dump( DataOutputStream out ) throws IOException {
+ out.writeByte(opcode);
+ if (length == 2) {
+ out.writeByte(index);
+ } else {
+ out.writeShort(index);
+ }
+ }
+
+
+ /**
+ * Set the index to constant pool and adjust size.
+ */
+ public final void setIndex( int index ) {
+ super.setIndex(index);
+ setSize();
+ }
+
+
+ /**
+ * Read needed data (e.g. index) from file.
+ */
+ protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException {
+ length = 2;
+ index = bytes.readUnsignedByte();
+ }
+
+
+ public Object getValue( ConstantPoolGen cpg ) {
+ org.apache.bcel.classfile.Constant c = cpg.getConstantPool().getConstant(index);
+ switch (c.getTag()) {
+ case org.apache.bcel.Constants.CONSTANT_String:
+ int i = ((org.apache.bcel.classfile.ConstantString) c).getStringIndex();
+ c = cpg.getConstantPool().getConstant(i);
+ return ((org.apache.bcel.classfile.ConstantUtf8) c).getBytes();
+ case org.apache.bcel.Constants.CONSTANT_Float:
+ return new Float(((org.apache.bcel.classfile.ConstantFloat) c).getBytes());
+ case org.apache.bcel.Constants.CONSTANT_Integer:
+ return new Integer(((org.apache.bcel.classfile.ConstantInteger) c).getBytes());
+ case org.apache.bcel.Constants.CONSTANT_Class:
+ return c;
+ default: // Never reached
+ throw new RuntimeException("Unknown or invalid constant type at " + index);
+ }
+ }
+
+
+ public Type getType( ConstantPoolGen cpg ) {
+ switch (cpg.getConstantPool().getConstant(index).getTag()) {
+ case org.apache.bcel.Constants.CONSTANT_String:
+ return Type.STRING;
+ case org.apache.bcel.Constants.CONSTANT_Float:
+ return Type.FLOAT;
+ case org.apache.bcel.Constants.CONSTANT_Integer:
+ return Type.INT;
+ case org.apache.bcel.Constants.CONSTANT_Class:
+ return Type.CLASS;
+ default: // Never reached
+ throw new RuntimeException("Unknown or invalid constant type at " + index);
+ }
+ }
+
+
+ public Class[] getExceptions() {
+ return org.apache.bcel.ExceptionConstants.EXCS_STRING_RESOLUTION;
+ }
+
+
+ /**
+ * 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.visitCPInstruction(this);
+ v.visitLDC(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC2_W.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC2_W.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC2_W.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC2_W.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;
-
/**
* LDC2_W - Push long or double from constant pool
*
@@ -25,55 +24,59 @@
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public class LDC2_W extends CPInstruction
- implements PushInstruction, TypedInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LDC2_W() {}
-
- public LDC2_W(int index) {
- super(org.apache.bcel.Constants.LDC2_W, index);
- }
-
- public Type getType(ConstantPoolGen cpg) {
- switch(cpg.getConstantPool().getConstant(index).getTag()) {
- case org.apache.bcel.Constants.CONSTANT_Long: return Type.LONG;
- case org.apache.bcel.Constants.CONSTANT_Double: return Type.DOUBLE;
- default: // Never reached
- throw new RuntimeException("Unknown constant type " + opcode);
+public class LDC2_W extends CPInstruction implements PushInstruction, TypedInstruction {
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ LDC2_W() {
}
- }
- public Number getValue(ConstantPoolGen cpg) {
- org.apache.bcel.classfile.Constant c = cpg.getConstantPool().getConstant(index);
- switch(c.getTag()) {
- case org.apache.bcel.Constants.CONSTANT_Long:
- return new Long(((org.apache.bcel.classfile.ConstantLong)c).getBytes());
-
- case org.apache.bcel.Constants.CONSTANT_Double:
- return new Double(((org.apache.bcel.classfile.ConstantDouble)c).getBytes());
-
- default: // Never reached
- throw new RuntimeException("Unknown or invalid constant type at " + index);
- }
- }
-
- /**
- * 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.visitTypedInstruction(this);
- v.visitCPInstruction(this);
- v.visitLDC2_W(this);
- }
+ public LDC2_W(int index) {
+ super(org.apache.bcel.Constants.LDC2_W, index);
+ }
+
+
+ public Type getType( ConstantPoolGen cpg ) {
+ switch (cpg.getConstantPool().getConstant(index).getTag()) {
+ case org.apache.bcel.Constants.CONSTANT_Long:
+ return Type.LONG;
+ case org.apache.bcel.Constants.CONSTANT_Double:
+ return Type.DOUBLE;
+ default: // Never reached
+ throw new RuntimeException("Unknown constant type " + opcode);
+ }
+ }
+
+
+ public Number getValue( ConstantPoolGen cpg ) {
+ org.apache.bcel.classfile.Constant c = cpg.getConstantPool().getConstant(index);
+ switch (c.getTag()) {
+ case org.apache.bcel.Constants.CONSTANT_Long:
+ return new Long(((org.apache.bcel.classfile.ConstantLong) c).getBytes());
+ case org.apache.bcel.Constants.CONSTANT_Double:
+ return new Double(((org.apache.bcel.classfile.ConstantDouble) c).getBytes());
+ default: // Never reached
+ throw new RuntimeException("Unknown or invalid constant type at " + index);
+ }
+ }
+
+
+ /**
+ * 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.visitTypedInstruction(this);
+ v.visitCPInstruction(this);
+ v.visitLDC2_W(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC_W.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC_W.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC_W.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDC_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.IOException;
@@ -28,25 +28,27 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LDC_W extends LDC {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LDC_W() {}
-
- public LDC_W(int index) {
- super(index);
- }
-
- /**
- * Read needed data (i.e., index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide)
- throws IOException
- {
- setIndex(bytes.readUnsignedShort());
- // Override just in case it has been changed
- opcode = org.apache.bcel.Constants.LDC_W;
- length = 3;
- }
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ LDC_W() {
+ }
+
+
+ public LDC_W(int index) {
+ super(index);
+ }
+
+
+ /**
+ * Read needed data (i.e., index) from file.
+ */
+ protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException {
+ setIndex(bytes.readUnsignedShort());
+ // Override just in case it has been changed
+ opcode = org.apache.bcel.Constants.LDC_W;
+ length = 3;
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDIV.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDIV.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDIV.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LDIV.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;
-
/**
* LDIV - Divide longs
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE>
@@ -25,30 +24,34 @@
* @version $Id$
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
-public class LDIV extends ArithmeticInstruction implements ExceptionThrower {
- public LDIV() {
- super(org.apache.bcel.Constants.LDIV);
- }
-
- 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.visitLDIV(this);
- }
+public class LDIV extends ArithmeticInstruction implements ExceptionThrower {
+
+ public LDIV() {
+ super(org.apache.bcel.Constants.LDIV);
+ }
+
+
+ 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.visitLDIV(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LLOAD.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LLOAD.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LLOAD.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LLOAD.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;
-
/**
* LLOAD - Load long from local variable
*<PRE>Stack ... -> ..., result.word1, result.word2</PRE>
@@ -25,28 +24,31 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LLOAD extends LoadInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LLOAD() {
- super(org.apache.bcel.Constants.LLOAD, org.apache.bcel.Constants.LLOAD_0);
- }
-
- public LLOAD(int n) {
- super(org.apache.bcel.Constants.LLOAD, org.apache.bcel.Constants.LLOAD_0, n);
- }
-
- /**
- * 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) {
- super.accept(v);
- v.visitLLOAD(this);
- }
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ LLOAD() {
+ super(org.apache.bcel.Constants.LLOAD, org.apache.bcel.Constants.LLOAD_0);
+ }
+
+
+ public LLOAD(int n) {
+ super(org.apache.bcel.Constants.LLOAD, org.apache.bcel.Constants.LLOAD_0, n);
+ }
+
+
+ /**
+ * 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 ) {
+ super.accept(v);
+ v.visitLLOAD(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LMUL.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LMUL.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LMUL.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LMUL.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;
-
/**
* LMUL - Multiply longs
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE>
@@ -26,24 +25,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LMUL extends ArithmeticInstruction {
- public LMUL() {
- super(org.apache.bcel.Constants.LMUL);
- }
+
+ public LMUL() {
+ super(org.apache.bcel.Constants.LMUL);
+ }
- /**
- * 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.visitLMUL(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.visitLMUL(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LNEG.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LNEG.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LNEG.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LNEG.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;
-
/**
* LNEG - Negate long
* <PRE>Stack: ..., value.word1, value.word2 -> ..., result.word1, result.word2</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LNEG extends ArithmeticInstruction {
- public LNEG() {
- super(org.apache.bcel.Constants.LNEG);
- }
+
+ public LNEG() {
+ super(org.apache.bcel.Constants.LNEG);
+ }
- /**
- * 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.visitLNEG(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.visitLNEG(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOOKUPSWITCH.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOOKUPSWITCH.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOOKUPSWITCH.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOOKUPSWITCH.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;
@@ -28,70 +28,68 @@
* @see SWITCH
*/
public class LOOKUPSWITCH extends Select {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LOOKUPSWITCH() {}
-
- public LOOKUPSWITCH(int[] match, InstructionHandle[] targets,
- InstructionHandle defaultTarget) {
- super(org.apache.bcel.Constants.LOOKUPSWITCH, match, targets, defaultTarget);
-
- length = (short)(9 + match_length * 8); /* alignment remainder assumed
- * 0 here, until dump time. */
- fixed_length = length;
- }
-
- /**
- * Dump instruction as byte code to stream out.
- * @param out Output stream
- */
- public void dump(DataOutputStream out) throws IOException {
- super.dump(out);
- out.writeInt(match_length); // npairs
-
- for(int i=0; i < match_length; i++) {
- out.writeInt(match[i]); // match-offset pairs
- out.writeInt(indices[i] = getTargetOffset(targets[i]));
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ LOOKUPSWITCH() {
+ }
+
+
+ public LOOKUPSWITCH(int[] match, InstructionHandle[] targets, InstructionHandle defaultTarget) {
+ super(org.apache.bcel.Constants.LOOKUPSWITCH, match, targets, defaultTarget);
+ length = (short) (9 + match_length * 8); /* alignment remainder assumed
+ * 0 here, until dump time. */
+ fixed_length = length;
}
- }
- /**
- * Read needed data (e.g. index) from file.
- */
- protected void initFromFile(ByteSequence bytes, boolean wide) throws IOException
- {
- super.initFromFile(bytes, wide); // reads padding
-
- match_length = bytes.readInt();
- fixed_length = (short)(9 + match_length * 8);
- length = (short)(fixed_length + padding);
-
- match = new int[match_length];
- indices = new int[match_length];
- targets = new InstructionHandle[match_length];
-
- for(int i=0; i < match_length; i++) {
- match[i] = bytes.readInt();
- indices[i] = bytes.readInt();
+
+ /**
+ * Dump instruction as byte code to stream out.
+ * @param out Output stream
+ */
+ public void dump( DataOutputStream out ) throws IOException {
+ super.dump(out);
+ out.writeInt(match_length); // npairs
+ for (int i = 0; i < match_length; i++) {
+ out.writeInt(match[i]); // match-offset pairs
+ out.writeInt(indices[i] = getTargetOffset(targets[i]));
+ }
}
- }
- /**
- * 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.visitStackProducer(this);
- v.visitBranchInstruction(this);
- v.visitSelect(this);
- v.visitLOOKUPSWITCH(this);
- }
+ /**
+ * Read needed data (e.g. index) from file.
+ */
+ protected void initFromFile( ByteSequence bytes, boolean wide ) throws IOException {
+ super.initFromFile(bytes, wide); // reads padding
+ match_length = bytes.readInt();
+ fixed_length = (short) (9 + match_length * 8);
+ length = (short) (fixed_length + padding);
+ match = new int[match_length];
+ indices = new int[match_length];
+ targets = new InstructionHandle[match_length];
+ for (int i = 0; i < match_length; i++) {
+ match[i] = bytes.readInt();
+ indices[i] = bytes.readInt();
+ }
+ }
+
+
+ /**
+ * 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.visitStackProducer(this);
+ v.visitBranchInstruction(this);
+ v.visitSelect(this);
+ v.visitLOOKUPSWITCH(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOR.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOR.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOR.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LOR.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;
-
/**
* LOR - Bitwise OR long
* <PRE>Stack: ..., value1, value2 -> ..., result</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LOR extends ArithmeticInstruction {
- public LOR() {
- super(org.apache.bcel.Constants.LOR);
- }
+
+ public LOR() {
+ super(org.apache.bcel.Constants.LOR);
+ }
- /**
- * 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.visitLOR(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.visitLOR(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LREM.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LREM.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LREM.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LREM.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;
-
/**
* LREM - Remainder of long
* <PRE>Stack: ..., value1, value2 -> result</PRE>
@@ -25,27 +24,33 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LREM extends ArithmeticInstruction implements ExceptionThrower {
- public LREM() {
- super(org.apache.bcel.Constants.LREM);
- }
-
- 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.visitLREM(this);
- }
+
+ public LREM() {
+ super(org.apache.bcel.Constants.LREM);
+ }
+
+
+ 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.visitLREM(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LRETURN.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LRETURN.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LRETURN.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LRETURN.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;
-
/**
* LRETURN - Return long from method
* <PRE>Stack: ..., value.word1, value.word2 -> <empty></PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LRETURN extends ReturnInstruction {
- public LRETURN() {
- super(org.apache.bcel.Constants.LRETURN);
- }
+
+ public LRETURN() {
+ super(org.apache.bcel.Constants.LRETURN);
+ }
- /**
- * 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.visitStackConsumer(this);
- v.visitReturnInstruction(this);
- v.visitLRETURN(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.visitExceptionThrower(this);
+ v.visitTypedInstruction(this);
+ v.visitStackConsumer(this);
+ v.visitReturnInstruction(this);
+ v.visitLRETURN(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHL.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHL.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHL.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHL.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;
-
/**
* LSHL - Arithmetic shift left long
* <PRE>Stack: ..., value1.word1, value1.word2, value2 -> ..., result.word1, result.word2</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LSHL extends ArithmeticInstruction {
- public LSHL() {
- super(org.apache.bcel.Constants.LSHL);
- }
+
+ public LSHL() {
+ super(org.apache.bcel.Constants.LSHL);
+ }
- /**
- * 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.visitLSHL(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.visitLSHL(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHR.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHR.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHR.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSHR.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;
-
/**
* LSHR - Arithmetic shift right long
* <PRE>Stack: ..., value1.word1, value1.word2, value2 -> ..., result.word1, result.word2</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LSHR extends ArithmeticInstruction {
- public LSHR() {
- super(org.apache.bcel.Constants.LSHR);
- }
+
+ public LSHR() {
+ super(org.apache.bcel.Constants.LSHR);
+ }
- /**
- * 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.visitLSHR(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.visitLSHR(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSTORE.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSTORE.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSTORE.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSTORE.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;
-
/**
* LSTORE - Store long into local variable
* <PRE>Stack: ..., value.word1, value.word2 -> ... </PRE>
@@ -25,28 +24,31 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LSTORE extends StoreInstruction {
- /**
- * Empty constructor needed for the Class.newInstance() statement in
- * Instruction.readInstruction(). Not to be used otherwise.
- */
- LSTORE() {
- super(org.apache.bcel.Constants.LSTORE, org.apache.bcel.Constants.LSTORE_0);
- }
-
- public LSTORE(int n) {
- super(org.apache.bcel.Constants.LSTORE, org.apache.bcel.Constants.LSTORE_0, n);
- }
-
- /**
- * 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) {
- super.accept(v);
- v.visitLSTORE(this);
- }
+
+ /**
+ * Empty constructor needed for the Class.newInstance() statement in
+ * Instruction.readInstruction(). Not to be used otherwise.
+ */
+ LSTORE() {
+ super(org.apache.bcel.Constants.LSTORE, org.apache.bcel.Constants.LSTORE_0);
+ }
+
+
+ public LSTORE(int n) {
+ super(org.apache.bcel.Constants.LSTORE, org.apache.bcel.Constants.LSTORE_0, n);
+ }
+
+
+ /**
+ * 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 ) {
+ super.accept(v);
+ v.visitLSTORE(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSUB.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSUB.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSUB.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LSUB.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;
-
/**
* LSUB - Substract longs
* <PRE>Stack: ..., value1.word1, value1.word2, value2.word1, value2.word2 -></PRE>
@@ -26,24 +25,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LSUB extends ArithmeticInstruction {
- public LSUB() {
- super(org.apache.bcel.Constants.LSUB);
- }
+
+ public LSUB() {
+ super(org.apache.bcel.Constants.LSUB);
+ }
- /**
- * 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.visitLSUB(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.visitLSUB(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LUSHR.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LUSHR.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LUSHR.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LUSHR.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;
-
/**
* LUSHR - Logical shift right long
* <PRE>Stack: ..., value1, value2 -> ..., result</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LUSHR extends ArithmeticInstruction {
- public LUSHR() {
- super(org.apache.bcel.Constants.LUSHR);
- }
+
+ public LUSHR() {
+ super(org.apache.bcel.Constants.LUSHR);
+ }
- /**
- * 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.visitLUSHR(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.visitLUSHR(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LXOR.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LXOR.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LXOR.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LXOR.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;
-
/**
* LXOR - Bitwise XOR long
* <PRE>Stack: ..., value1, value2 -> ..., result</PRE>
@@ -25,24 +24,25 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public class LXOR extends ArithmeticInstruction {
- public LXOR() {
- super(org.apache.bcel.Constants.LXOR);
- }
+
+ public LXOR() {
+ super(org.apache.bcel.Constants.LXOR);
+ }
- /**
- * 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.visitLXOR(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.visitLXOR(this);
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LineNumberGen.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LineNumberGen.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LineNumberGen.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LineNumberGen.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.LineNumber;
/**
@@ -28,66 +27,82 @@
* @see LineNumber
* @see MethodGen
*/
-public class LineNumberGen
- implements InstructionTargeter, Cloneable, java.io.Serializable
-{
- private InstructionHandle ih;
- private int src_line;
-
- /**
- * Create a line number.
- *
- * @param ih instruction handle to reference
- */
- public LineNumberGen(InstructionHandle ih, int src_line) {
- setInstruction(ih);
- setSourceLine(src_line);
- }
-
- /**
- * @return true, if ih is target of this line number
- */
- public boolean containsTarget(InstructionHandle ih) {
- return this.ih == ih;
- }
-
- /**
- * @param old_ih old target
- * @param new_ih new target
- */
- public void updateTarget(InstructionHandle old_ih, InstructionHandle new_ih) {
- if(old_ih != ih)
- throw new ClassGenException("Not targeting " + old_ih + ", but " + ih + "}");
- else
- setInstruction(new_ih);
- }
-
- /**
- * Get LineNumber attribute .
- *
- * This relies on that the instruction list has already been dumped to byte code or
- * or that the `setPositions' methods has been called for the instruction list.
- */
- public LineNumber getLineNumber() {
- return new LineNumber(ih.getPosition(), src_line);
- }
-
- public void setInstruction(InstructionHandle ih) {
- BranchInstruction.notifyTarget(this.ih, ih, this);
-
- this.ih = ih;
- }
-
- public Object clone() {
- try {
- return super.clone();
- } catch(CloneNotSupportedException e) {
- System.err.println(e);
- return null;
- }
- }
-
- public InstructionHandle getInstruction() { return ih; }
- public void setSourceLine(int src_line) { this.src_line = src_line; }
- public int getSourceLine() { return src_line; }
+public class LineNumberGen implements InstructionTargeter, Cloneable, java.io.Serializable {
+
+ private InstructionHandle ih;
+ private int src_line;
+
+
+ /**
+ * Create a line number.
+ *
+ * @param ih instruction handle to reference
+ */
+ public LineNumberGen(InstructionHandle ih, int src_line) {
+ setInstruction(ih);
+ setSourceLine(src_line);
+ }
+
+
+ /**
+ * @return true, if ih is target of this line number
+ */
+ public boolean containsTarget( InstructionHandle ih ) {
+ return this.ih == ih;
+ }
+
+
+ /**
+ * @param old_ih old target
+ * @param new_ih new target
+ */
+ public void updateTarget( InstructionHandle old_ih, InstructionHandle new_ih ) {
+ if (old_ih != ih) {
+ throw new ClassGenException("Not targeting " + old_ih + ", but " + ih + "}");
+ } else {
+ setInstruction(new_ih);
+ }
+ }
+
+
+ /**
+ * Get LineNumber attribute .
+ *
+ * This relies on that the instruction list has already been dumped to byte code or
+ * or that the `setPositions' methods has been called for the instruction list.
+ */
+ public LineNumber getLineNumber() {
+ return new LineNumber(ih.getPosition(), src_line);
+ }
+
+
+ public void setInstruction( InstructionHandle ih ) {
+ BranchInstruction.notifyTarget(this.ih, ih, this);
+ this.ih = ih;
+ }
+
+
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ System.err.println(e);
+ return null;
+ }
+ }
+
+
+ public InstructionHandle getInstruction() {
+ return ih;
+ }
+
+
+ public void setSourceLine( int src_line ) {
+ this.src_line = src_line;
+ }
+
+
+ public int getSourceLine() {
+ return src_line;
+ }
}
Modified: jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LoadClass.java
URL: http://svn.apache.org/viewcvs/jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LoadClass.java?rev=386056&r1=386055&r2=386056&view=diff
==============================================================================
--- jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LoadClass.java (original)
+++ jakarta/bcel/trunk/src/java/org/apache/bcel/generic/LoadClass.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;
-
/**
* Denotes that an instruction may start the process of loading and resolving
* the referenced class in the Virtual Machine.
@@ -25,25 +24,27 @@
* @author <A HREF="mailto:[email protected]">M. Dahm</A>
*/
public interface LoadClass {
- /**
- * Returns the ObjectType of the referenced class or interface
- * that may be loaded and resolved.
- * @return object type that may be loaded or null if a primitive is
- * referenced
- */
- public ObjectType getLoadClassType(ConstantPoolGen cpg);
-
- /**
- * Returns the type associated with this instruction.
- * LoadClass instances are always typed, but this type
- * does not always refer to the type of the class or interface
- * that it possibly forces to load. For example, GETFIELD would
- * return the type of the field and not the type of the class
- * where the field is defined.
- * If no class is forced to be loaded, <B>null</B> is returned.
- * An example for this is an ANEWARRAY instruction that creates
- * an int[][].
- * @see #getLoadClassType(ConstantPoolGen)
- */
- public Type getType(ConstantPoolGen cpg);
+
+ /**
+ * Returns the ObjectType of the referenced class or interface
+ * that may be loaded and resolved.
+ * @return object type that may be loaded or null if a primitive is
+ * referenced
+ */
+ public ObjectType getLoadClassType( ConstantPoolGen cpg );
+
+
+ /**
+ * Returns the type associated with this instruction.
+ * LoadClass instances are always typed, but this type
+ * does not always refer to the type of the class or interface
+ * that it possibly forces to load. For example, GETFIELD would
+ * return the type of the field and not the type of the class
+ * where the field is defined.
+ * If no class is forced to be loaded, <B>null</B> is returned.
+ * An example for this is an ANEWARRAY instruction that creates
+ * an int[][].
+ * @see #getLoadClassType(ConstantPoolGen)
+ */
+ public Type getType( ConstantPoolGen cpg );
}
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.