in src/main/java/com/jetbrains/jdi/VirtualMachineImpl.java [967:999]
private ReferenceTypeImpl addReferenceType(long id, int tag, String signature) {
ReferenceTypeImpl type;
switch(tag) {
case JDWP.TypeTag.CLASS:
type = new ClassTypeImpl(vm, id);
break;
case JDWP.TypeTag.INTERFACE:
type = new InterfaceTypeImpl(vm, id);
break;
case JDWP.TypeTag.ARRAY:
type = new ArrayTypeImpl(vm, id);
break;
default:
throw new InternalException("Invalid reference type tag");
}
if (signature == null && retrievedAllTypes) {
// do not cache if signature is not provided
return type;
}
typesByID.put(id, type);
if (signature != null) {
type.setSignature(signature);
}
if ((vm.traceFlags & VirtualMachine.TRACE_REFTYPES) != 0) {
vm.printTrace("Caching new ReferenceType, sig=" + signature +
", id=" + id);
}
return type;
}