diff --git a/opensca/sca/java/xml/marshal.go b/opensca/sca/java/xml/marshal.go index 07b6042d..b2f4864d 100644 --- a/opensca/sca/java/xml/marshal.go +++ b/opensca/sca/java/xml/marshal.go @@ -415,9 +415,9 @@ func (p *printer) popPrefix() { } var ( - marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() - marshalerAttrType = reflect.TypeOf((*MarshalerAttr)(nil)).Elem() - textMarshalerType = reflect.TypeOf((*encoding.TextMarshaler)(nil)).Elem() + marshalerType = reflect.TypeFor[Marshaler]() + marshalerAttrType = reflect.TypeFor[MarshalerAttr]() + textMarshalerType = reflect.TypeFor[encoding.TextMarshaler]() ) // marshalValue writes one or more XML elements representing val. diff --git a/opensca/sca/java/xml/read.go b/opensca/sca/java/xml/read.go index ed669485..2306a1a8 100644 --- a/opensca/sca/java/xml/read.go +++ b/opensca/sca/java/xml/read.go @@ -303,10 +303,10 @@ func (d *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error { } var ( - attrType = reflect.TypeOf(Attr{}) - unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() - unmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem() - textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() + attrType = reflect.TypeFor[Attr]() + unmarshalerType = reflect.TypeFor[Unmarshaler]() + unmarshalerAttrType = reflect.TypeFor[UnmarshalerAttr]() + textUnmarshalerType = reflect.TypeFor[encoding.TextUnmarshaler]() ) const ( diff --git a/opensca/sca/java/xml/typeinfo.go b/opensca/sca/java/xml/typeinfo.go index 058a384d..edd70b0c 100644 --- a/opensca/sca/java/xml/typeinfo.go +++ b/opensca/sca/java/xml/typeinfo.go @@ -48,7 +48,7 @@ const ( var tinfoMap sync.Map // map[reflect.Type]*typeInfo -var nameType = reflect.TypeOf(Name{}) +var nameType = reflect.TypeFor[Name]() // getTypeInfo returns the typeInfo structure with details necessary // for marshaling and unmarshaling typ.