Java Code Examples for com.sun.java.util.jar.pack.ConstantPool.Entry#getTag()

The following examples show how to use com.sun.java.util.jar.pack.ConstantPool.Entry#getTag() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ClassReader.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 2
Source File: ClassReader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 3
Source File: ClassReader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 4
Source File: ClassReader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 5
Source File: ClassReader.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 6
Source File: ClassReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 7
Source File: ClassReader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 8
Source File: ClassReader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 9
Source File: ClassReader.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 10
Source File: ClassReader.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 11
Source File: ClassReader.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private SignatureEntry readSignatureRef() throws IOException {
    // The class file stores a Utf8, but we want a Signature.
    Entry e = readRef(CONSTANT_Signature);
    return (e != null && e.getTag() == CONSTANT_Utf8)
            ? ConstantPool.getSignatureEntry(e.stringValue())
            : (SignatureEntry) e;
}
 
Example 12
Source File: ClassWriter.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 13
Source File: ClassWriter.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 14
Source File: ClassWriter.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 15
Source File: ClassWriter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 16
Source File: ClassWriter.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 17
Source File: ClassWriter.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 18
Source File: ClassWriter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 19
Source File: ClassWriter.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}
 
Example 20
Source File: ClassWriter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
void writeConstantPool() throws IOException {
    Entry[] cpMap = cls.cpMap;
    writeShort(cpMap.length);
    for (int i = 0; i < cpMap.length; i++) {
        Entry e = cpMap[i];
        assert((e == null) == (i == 0 || cpMap[i-1] != null && cpMap[i-1].isDoubleWord()));
        if (e == null)  continue;
        byte tag = e.getTag();
        if (verbose > 2)  Utils.log.fine("   CP["+i+"] = "+e);
        out.write(tag);
        switch (tag) {
            case CONSTANT_Signature:
                throw new AssertionError("CP should have Signatures remapped to Utf8");
            case CONSTANT_Utf8:
                out.writeUTF(e.stringValue());
                break;
            case CONSTANT_Integer:
                out.writeInt(((NumberEntry)e).numberValue().intValue());
                break;
            case CONSTANT_Float:
                float fval = ((NumberEntry)e).numberValue().floatValue();
                out.writeInt(Float.floatToRawIntBits(fval));
                break;
            case CONSTANT_Long:
                out.writeLong(((NumberEntry)e).numberValue().longValue());
                break;
            case CONSTANT_Double:
                double dval = ((NumberEntry)e).numberValue().doubleValue();
                out.writeLong(Double.doubleToRawLongBits(dval));
                break;
            case CONSTANT_Class:
            case CONSTANT_String:
            case CONSTANT_MethodType:
                writeRef(e.getRef(0));
                break;
            case CONSTANT_MethodHandle:
                MethodHandleEntry mhe = (MethodHandleEntry) e;
                out.writeByte(mhe.refKind);
                writeRef(mhe.getRef(0));
                break;
            case CONSTANT_Fieldref:
            case CONSTANT_Methodref:
            case CONSTANT_InterfaceMethodref:
            case CONSTANT_NameandType:
                writeRef(e.getRef(0));
                writeRef(e.getRef(1));
                break;
            case CONSTANT_InvokeDynamic:
                writeRef(e.getRef(0), bsmIndex);
                writeRef(e.getRef(1));
                break;
            case CONSTANT_BootstrapMethod:
                throw new AssertionError("CP should have BootstrapMethods moved to side-table");
            default:
                throw new IOException("Bad constant pool tag "+tag);
        }
    }
}