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 PUTSTATIC extends FieldInstruction 70 implements ExceptionThrower, PopInstruction { 71 75 PUTSTATIC() {} 76 77 public PUTSTATIC(int index) { 78 super(Constants.PUTSTATIC, index); 79 } 80 81 public int consumeStack(ConstantPoolGen cpg) { return getFieldSize(cpg); } 82 83 public Class [] getExceptions() { 84 Class [] cs = new Class [1 + 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 cs[ExceptionConstants.EXCS_FIELD_AND_METHOD_RESOLUTION.length] = 89 ExceptionConstants.INCOMPATIBLE_CLASS_CHANGE_ERROR; 90 91 return cs; 92 } 93 94 95 103 public void accept(Visitor v) { 104 v.visitExceptionThrower(this); 105 v.visitStackConsumer(this); 106 v.visitPopInstruction(this); 107 v.visitTypedInstruction(this); 108 v.visitLoadClass(this); 109 v.visitCPInstruction(this); 110 v.visitFieldOrMethod(this); 111 v.visitFieldInstruction(this); 112 v.visitPUTSTATIC(this); 113 } 114 } 115 | Popular Tags |