Java Bytecode Signatures

走远了吗. 提交于 2019-12-01 18:17:23
Obicere

There is a defined syntax that changed as of JSR 14 to specify the bounds of a generic type.

variable_name:class_type_bound:interface_type_bounds

So for your example of:

<T::Ljava/lang/Comparable<-TT;>;>

Which would reflect:

<T extends Comparable<T>>

The variable name is T, there is no class type bound so it was omitted, and there was an interface bound of type Comparable<T>.

All your example follow this, but there any many different forms:

<T:Ljava/lang/Object;>(Ljava/util/Collection<TT;>;)TT;
<T::Ljava/lang/Comparable;>(Ljava/util/Collection<TT;>;)TT;
<T:Ljava/lang/Object;:Ljava/lang/Comparable;(Ljava/util/Collection<TT;>;)TT;

Source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!