in object.go [500:525]
func (d *Decoder) getStructDefByIndex(idx int) (reflect.Type, *ClassInfo, error) {
var (
ok bool
cls *ClassInfo
s *structInfo
err error
)
if len(d.classInfoList) <= idx || idx < 0 {
return nil, cls, perrors.Errorf("illegal class index @idx %d", idx)
}
cls = d.classInfoList[idx]
s, ok = getStructInfo(cls.javaName)
if !ok {
// exception
if s, ok = checkAndGetException(cls); ok {
return s.typ, cls, nil
}
if !d.isSkip && d.Strict {
err = perrors.Errorf("can not find go type name %s in registry", cls.javaName)
}
return nil, cls, err
}
return s.typ, cls, nil
}