private void resolveConstantPoolReferences(ConstantInfo[] constantPool) {
        for (ConstantInfo constant : constantPool) {
            if (constant instanceof ConstantInfo.Class) {
                ConstantInfo.Class info = (ConstantInfo.Class)constant;
                info.setName(((ConstantInfo.Utf8)constantPool[info.getNameIndex() - 1]).getString());
            } else if (constant instanceof ConstantInfo.Fieldref) {
                ConstantInfo.Fieldref info = (ConstantInfo.Fieldref)constant;
                info.setClassInfo((ConstantInfo.Class)constantPool[info.getClassIndex() - 1]);
                info.setNameAndType((ConstantInfo.NameAndType)constantPool[info.getNameAndTypeIndex() - 1]);
            } else if (constant instanceof ConstantInfo.Methodref) {
                ConstantInfo.Methodref info = (ConstantInfo.Methodref)constant;
                info.setClassInfo((ConstantInfo.Class)constantPool[info.getClassIndex() - 1]);
                info.setNameAndType((ConstantInfo.NameAndType)constantPool[info.getNameAndTypeIndex() - 1]);
            } else if (constant instanceof ConstantInfo.InterfaceMethodref) {
                ConstantInfo.InterfaceMethodref info = (ConstantInfo.InterfaceMethodref)constant;
                info.setClassInfo((ConstantInfo.Class)constantPool[info.getClassIndex() - 1]);
                info.setNameAndType((ConstantInfo.NameAndType)constantPool[info.getNameAndTypeIndex() - 1]);
            } else if (constant instanceof ConstantInfo.String) {
                ConstantInfo.String info = (ConstantInfo.String)constant;
                info.setString(((ConstantInfo.Utf8)constantPool[info.getStringIndex() - 1]).getString());
            } else if (constant instanceof ConstantInfo.Integer
                    || constant instanceof ConstantInfo.Float
                    || constant instanceof ConstantInfo.Long
                    || constant instanceof ConstantInfo.Double) {
                // not needed
            } else if (constant instanceof ConstantInfo.NameAndType) {
                ConstantInfo.NameAndType info = (ConstantInfo.NameAndType)constant;
                info.setName(((ConstantInfo.Utf8)constantPool[info.getNameIndex() - 1]).getString());
                info.setDescriptor(((ConstantInfo.Utf8)constantPool[info.getDescriptorIndex() - 1]).getString());
            } else if (constant instanceof ConstantInfo.Utf8) {
                // not needed
            } else if (constant instanceof ConstantInfo.MethodHandle
                    || constant instanceof ConstantInfo.MethodType
                    || constant instanceof ConstantInfo.InvokeDynamic) {
                // not used yet
            } else if (constant != null) { // Long/Double may leave create a blank space
                throw new UnsupportedOperationException("Unhandled ConstantType: " + constant);
            }
        }
    }
private void resolveConstantPoolReferences(ConstantInfo[] constantPool) {
        for (ConstantInfo constant : constantPool) {
            if (constant instanceof ConstantInfo.Class) {
                ConstantInfo.Class info = (ConstantInfo.Class)constant;
                info.setName(((ConstantInfo.Utf8)constantPool[info.getNameIndex() - 1]).getString());
            } else if (constant instanceof ConstantInfo.Fieldref) {
                ConstantInfo.Fieldref info = (ConstantInfo.Fieldref)constant;
                info.setClassInfo((ConstantInfo.Class)constantPool[info.getClassIndex() - 1]);
                info.setNameAndType((ConstantInfo.NameAndType)constantPool[info.getNameAndTypeIndex() - 1]);
            } else if (constant instanceof ConstantInfo.Methodref) {
                ConstantInfo.Methodref info = (ConstantInfo.Methodref)constant;
                info.setClassInfo((ConstantInfo.Class)constantPool[info.getClassIndex() - 1]);
                info.setNameAndType((ConstantInfo.NameAndType)constantPool[info.getNameAndTypeIndex() - 1]);
            } else if (constant instanceof ConstantInfo.InterfaceMethodref) {
                ConstantInfo.InterfaceMethodref info = (ConstantInfo.InterfaceMethodref)constant;
                info.setClassInfo((ConstantInfo.Class)constantPool[info.getClassIndex() - 1]);
                info.setNameAndType((ConstantInfo.NameAndType)constantPool[info.getNameAndTypeIndex() - 1]);
            } else if (constant instanceof ConstantInfo.String) {
                ConstantInfo.String info = (ConstantInfo.String)constant;
                info.setString(((ConstantInfo.Utf8)constantPool[info.getStringIndex() - 1]).getString());
            } else if (constant instanceof ConstantInfo.Integer
                    || constant instanceof ConstantInfo.Float
                    || constant instanceof ConstantInfo.Long
                    || constant instanceof ConstantInfo.Double) {
               
            } else if (constant instanceof ConstantInfo.NameAndType) {
                ConstantInfo.NameAndType info = (ConstantInfo.NameAndType)constant;
                info.setName(((ConstantInfo.Utf8)constantPool[info.getNameIndex() - 1]).getString());
                info.setDescriptor(((ConstantInfo.Utf8)constantPool[info.getDescriptorIndex() - 1]).getString());
            } else if (constant instanceof ConstantInfo.Utf8) {
               
            } else if (constant instanceof ConstantInfo.MethodHandle
                    || constant instanceof ConstantInfo.MethodType
                    || constant instanceof ConstantInfo.InvokeDynamic) {
               
            } else if (constant != null) {
                throw new UnsupportedOperationException("Unhandled ConstantType: " + constant);
            }
        }
    }
private void resolveconstantpoolreferences(constantinfo[] constantpool) { for (constantinfo constant : constantpool) { if (constant instanceof constantinfo.class) { constantinfo.class info = (constantinfo.class)constant; info.setname(((constantinfo.utf8)constantpool[info.getnameindex() - 1]).getstring()); } else if (constant instanceof constantinfo.fieldref) { constantinfo.fieldref info = (constantinfo.fieldref)constant; info.setclassinfo((constantinfo.class)constantpool[info.getclassindex() - 1]); info.setnameandtype((constantinfo.nameandtype)constantpool[info.getnameandtypeindex() - 1]); } else if (constant instanceof constantinfo.methodref) { constantinfo.methodref info = (constantinfo.methodref)constant; info.setclassinfo((constantinfo.class)constantpool[info.getclassindex() - 1]); info.setnameandtype((constantinfo.nameandtype)constantpool[info.getnameandtypeindex() - 1]); } else if (constant instanceof constantinfo.interfacemethodref) { constantinfo.interfacemethodref info = (constantinfo.interfacemethodref)constant; info.setclassinfo((constantinfo.class)constantpool[info.getclassindex() - 1]); info.setnameandtype((constantinfo.nameandtype)constantpool[info.getnameandtypeindex() - 1]); } else if (constant instanceof constantinfo.string) { constantinfo.string info = (constantinfo.string)constant; info.setstring(((constantinfo.utf8)constantpool[info.getstringindex() - 1]).getstring()); } else if (constant instanceof constantinfo.integer || constant instanceof constantinfo.float || constant instanceof constantinfo.long || constant instanceof constantinfo.double) { } else if (constant instanceof constantinfo.nameandtype) { constantinfo.nameandtype info = (constantinfo.nameandtype)constant; info.setname(((constantinfo.utf8)constantpool[info.getnameindex() - 1]).getstring()); info.setdescriptor(((constantinfo.utf8)constantpool[info.getdescriptorindex() - 1]).getstring()); } else if (constant instanceof constantinfo.utf8) { } else if (constant instanceof constantinfo.methodhandle || constant instanceof constantinfo.methodtype || constant instanceof constantinfo.invokedynamic) { } else if (constant != null) { throw new unsupportedoperationexception("unhandled constanttype: " + constant); } } }