private ReferenceTypeImpl addReferenceType()

in core/src/main/java/com/jetbrains/sa/jdi/VirtualMachineImpl.java [264:280]


    private ReferenceTypeImpl addReferenceType(Klass kk) {
        ReferenceTypeImpl newRefType;
        if (kk instanceof ObjArrayKlass || kk instanceof TypeArrayKlass) {
            newRefType = new ArrayTypeImpl(this, (ArrayKlass)kk);
        } else if (kk instanceof InstanceKlass) {
            if (kk.isInterface()) {
                newRefType = new InterfaceTypeImpl(this, (InstanceKlass)kk);
            } else {
                newRefType = new ClassTypeImpl(this, (InstanceKlass)kk);
            }
        } else {
            throw new RuntimeException("should not reach here:" + kk);
        }

        typesById.put(newRefType.uniqueID(), newRefType);
        return newRefType;
    }