@Override public void visitConstantPool(ConstantPool obj) { super.visitConstantPool(obj); Constant[] constant_pool = obj.getConstantPool(); for (int i = 1; i < constant_pool.length; i++) { constant_pool[i].accept(this); byte tag = constant_pool[i].getTag(); if ((tag == Const.CONSTANT_Double) || (tag == Const.CONSTANT_Long)) { i++; } } }
String str; int i, j, k; byte tag = c.getTag();
/** * Dump constant package to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeShort(name_index); }
/** * Dump String in Utf8 format to file stream. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeUTF(bytes); }
/** * Dump constant field reference to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeShort(string_index); }
/** * Dump name and signature index to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeShort(descriptor_index); }
/** * Dumps constant class to file stream in binary format. * * @param file Output file stream * @throws IOException if an I/O error occurs writing to the DataOutputStream. */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeShort(name_index); }
/** * Dump constant float to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeFloat(bytes); }
/** * Dump constant module to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeShort(name_index); }
/** * Dump constant double to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeDouble(bytes); }
/** * Dump constant integer to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeInt(bytes); }
/** * Dump constant long to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeLong(bytes); }
/** * Dump constant field reference to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeShort(class_index); file.writeShort(name_and_type_index); }
/** * Dump name and signature index to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeShort(name_index); file.writeShort(signature_index); }
/** * Dump method kind and index to file stream in binary format. * * @param file Output file stream * @throws IOException */ @Override public final void dump( final DataOutputStream file ) throws IOException { file.writeByte(super.getTag()); file.writeByte(reference_kind); file.writeShort(reference_index); }
public Type getType(ConstantPoolGen cpg) { switch(cpg.getConstantPool().getConstant(index).getTag()) { case org.apache.bcel.Constants.CONSTANT_Long: return Type.LONG; case org.apache.bcel.Constants.CONSTANT_Double: return Type.DOUBLE; default: // Never reached throw new RuntimeException("Unknown constant type " + opcode); } }
public Type getType(ConstantPoolGen cpg) { switch(cpg.getConstantPool().getConstant(index).getTag()) { case org.apache.bcel.Constants.CONSTANT_String: return Type.STRING; case org.apache.bcel.Constants.CONSTANT_Float: return Type.FLOAT; case org.apache.bcel.Constants.CONSTANT_Integer: return Type.INT; default: // Never reached throw new RuntimeException("Unknown or invalid constant type at " + index); } }
@Override public Type getType( final ConstantPoolGen cpg ) { switch (cpg.getConstantPool().getConstant(super.getIndex()).getTag()) { case org.apache.bcel.Const.CONSTANT_Long: return Type.LONG; case org.apache.bcel.Const.CONSTANT_Double: return Type.DOUBLE; default: // Never reached throw new RuntimeException("Unknown constant type " + super.getOpcode()); } }
@Override public void visitConstantPool(ConstantPool obj) { super.visitConstantPool(obj); Constant[] constant_pool = obj.getConstantPool(); for (int i = 1; i < constant_pool.length; i++) { constant_pool[i].accept(this); byte tag = constant_pool[i].getTag(); if ((tag == CONSTANT_Double) || (tag == CONSTANT_Long)) { i++; } } }
public Number getValue( final ConstantPoolGen cpg ) { final org.apache.bcel.classfile.Constant c = cpg.getConstantPool().getConstant(super.getIndex()); switch (c.getTag()) { case org.apache.bcel.Const.CONSTANT_Long: return Long.valueOf(((org.apache.bcel.classfile.ConstantLong) c).getBytes()); case org.apache.bcel.Const.CONSTANT_Double: return new Double(((org.apache.bcel.classfile.ConstantDouble) c).getBytes()); default: // Never reached throw new RuntimeException("Unknown or invalid constant type at " + super.getIndex()); } }