< prev index next >

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/generic/PUTFIELD.java

Print this page

        

*** 19,67 **** * 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; /** * PUTFIELD - Put field in object * <PRE>Stack: ..., objectref, value -&gt; ...</PRE> * OR * <PRE>Stack: ..., objectref, value.word1, value.word2 -&gt; ...</PRE> * ! * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> */ ! public class PUTFIELD ! extends FieldInstruction ! implements PopInstruction,ExceptionThrower{ /** * Empty constructor needed for the Class.newInstance() statement in * Instruction.readInstruction(). Not to be used otherwise. */ ! PUTFIELD() {} ! ! public PUTFIELD(int index) { ! super(Constants.PUTFIELD, index); } - public int consumeStack(ConstantPoolGen cpg) { return getFieldSize(cpg) + 1; } ! 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: --- 19,65 ---- * limitations under the License. */ package com.sun.org.apache.bcel.internal.generic; ! import com.sun.org.apache.bcel.internal.Const; ! import com.sun.org.apache.bcel.internal.ExceptionConst; /** * PUTFIELD - Put field in object * <PRE>Stack: ..., objectref, value -&gt; ...</PRE> * OR * <PRE>Stack: ..., objectref, value.word1, value.word2 -&gt; ...</PRE> * ! * @version $Id: PUTFIELD.java 1747278 2016-06-07 17:28:43Z britter $ */ ! public class PUTFIELD extends FieldInstruction implements PopInstruction, ExceptionThrower { ! /** * Empty constructor needed for the Class.newInstance() statement in * Instruction.readInstruction(). Not to be used otherwise. */ ! PUTFIELD() { } ! public PUTFIELD(final int index) { ! super(Const.PUTFIELD, index); ! } ! ! @Override ! public int consumeStack( final ConstantPoolGen cpg ) { ! return getFieldSize(cpg) + 1; ! } ! @Override ! public Class<?>[] getExceptions() { ! return ExceptionConst.createExceptions(ExceptionConst.EXCS.EXCS_FIELD_AND_METHOD_RESOLUTION, ! ExceptionConst.NULL_POINTER_EXCEPTION, ! ExceptionConst.INCOMPATIBLE_CLASS_CHANGE_ERROR); } /** * Call corresponding visitor method(s). The order is:
*** 69,79 **** * 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.visitPopInstruction(this); v.visitTypedInstruction(this); v.visitLoadClass(this); --- 67,78 ---- * call methods according to the class hierarchy in descending order, * i.e., the most specific visitXXX() call comes last. * * @param v Visitor object */ ! @Override ! public void accept( final Visitor v ) { v.visitExceptionThrower(this); v.visitStackConsumer(this); v.visitPopInstruction(this); v.visitTypedInstruction(this); v.visitLoadClass(this);
< prev index next >