1 package com.sun.org.apache.bcel.internal.generic; 2 3 56 57 import com.sun.org.apache.bcel.internal.Constants; 58 import com.sun.org.apache.bcel.internal.ExceptionConstants; 59 60 69 public class GETFIELD extends FieldInstruction 70 implements ExceptionThrower, StackConsumer, StackProducer { 71 75 GETFIELD() {} 76 77 public GETFIELD(int index) { 78 super(Constants.GETFIELD, index); 79 } 80 81 public int produceStack(ConstantPoolGen cpg) { return getFieldSize(cpg); } 82 83 public Class [] getExceptions() { 84 Class [] cs = new Class [2 + ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length]; 85 86 System.arraycopy(ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION, 0, 87 cs, 0, ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length); 88 89 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length+1] = 90 ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR; 91 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = 92 ExceptionConstants.NULL_POINTER_EXCEPTION; 93 94 return cs; 95 } 96 97 98 106 public void accept(Visitor v) { 107 v.visitExceptionThrower(this); 108 v.visitStackConsumer(this); 109 v.visitStackProducer(this); 110 v.visitTypedInstruction(this); 111 v.visitLoadClass(this); 112 v.visitCPInstruction(this); 113 v.visitFieldOrMethod(this); 114 v.visitFieldInstruction(this); 115 v.visitGETFIELD(this); 116 } 117 } 118 | Popular Tags |