< prev index next >
src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/ReturnInstruction.java
Print this page
@@ -19,52 +19,68 @@
* limitations under the License.
*/
package com.sun.org.apache.bcel.internal.generic;
-import com.sun.org.apache.bcel.internal.Constants;
-import com.sun.org.apache.bcel.internal.ExceptionConstants;
+import com.sun.org.apache.bcel.internal.Const;
+import com.sun.org.apache.bcel.internal.ExceptionConst;
/**
* Super class for the xRETURN family of instructions.
*
- * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
+ * @version $Id: ReturnInstruction.java 1747278 2016-06-07 17:28:43Z britter $
*/
-public abstract class ReturnInstruction extends Instruction
- implements ExceptionThrower, TypedInstruction, StackConsumer {
+public abstract class ReturnInstruction extends Instruction implements ExceptionThrower,
+ TypedInstruction, StackConsumer {
+
/**
* Empty constructor needed for the Class.newInstance() statement in
* Instruction.readInstruction(). Not to be used otherwise.
*/
- ReturnInstruction() {}
+ ReturnInstruction() {
+ }
+
/**
* @param opcode of instruction
*/
- protected ReturnInstruction(short opcode) {
- super(opcode, (short)1);
+ protected ReturnInstruction(final short opcode) {
+ super(opcode, (short) 1);
}
- public Type getType() {
- switch(opcode) {
- case Constants.IRETURN: return Type.INT;
- case Constants.LRETURN: return Type.LONG;
- case Constants.FRETURN: return Type.FLOAT;
- case Constants.DRETURN: return Type.DOUBLE;
- case Constants.ARETURN: return Type.OBJECT;
- case Constants.RETURN: return Type.VOID;
+ public Type getType() {
+ final short _opcode = super.getOpcode();
+ switch (_opcode) {
+ case Const.IRETURN:
+ return Type.INT;
+ case Const.LRETURN:
+ return Type.LONG;
+ case Const.FRETURN:
+ return Type.FLOAT;
+ case Const.DRETURN:
+ return Type.DOUBLE;
+ case Const.ARETURN:
+ return Type.OBJECT;
+ case Const.RETURN:
+ return Type.VOID;
default: // Never reached
- throw new ClassGenException("Unknown type " + opcode);
+ throw new ClassGenException("Unknown type " + _opcode);
}
}
- public Class[] getExceptions() {
- return new Class[] { ExceptionConstants.ILLEGAL_MONITOR_STATE };
+
+ @Override
+ public Class<?>[] getExceptions() {
+ return new Class[] {
+ ExceptionConst.ILLEGAL_MONITOR_STATE
+ };
}
+
/** @return type associated with the instruction
*/
- public Type getType(ConstantPoolGen cp) {
+ @Override
+ public Type getType( final ConstantPoolGen cp ) {
return getType();
}
}
< prev index next >