ReferenceTypeImpl referenceType()

in src/main/java/com/jetbrains/jdi/VirtualMachineImpl.java [1086:1120]


    ReferenceTypeImpl referenceType(long id, int tag, String signature) {
        if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) {
            StringBuilder sb = new StringBuilder();
            sb.append("Looking up ");
            if (tag == JDWP.TypeTag.CLASS) {
                sb.append("Class");
            } else if (tag == JDWP.TypeTag.INTERFACE) {
                sb.append("Interface");
            } else if (tag == JDWP.TypeTag.ARRAY) {
                sb.append("ArrayType");
            } else {
                sb.append("UNKNOWN TAG: ").append(tag);
            }
            if (signature != null) {
                sb.append(", signature='").append(signature).append('\'');
            }
            sb.append(", id=").append(id);
            vm.printTrace(sb.toString());
        }
        if (id == 0) {
            return null;
        } else {
            ReferenceTypeImpl retType;
            synchronized (state) {
                retType = (ReferenceTypeImpl)typesByID.get(id);
                if (retType == null) {
                    retType = addReferenceType(id, tag, signature);
                }
                else if (signature != null) {
                    retType.setSignature(signature);
                }
            }
            return retType;
        }
    }