/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }