If all of the following are true, let C be the direct superclass of the current class:
- The resolved method is not an instance initialization method (§2.9).
- If the symbolic reference names a class (not an interface), then that class is a superclass of the current class.
- The ACC_SUPER flag is set for the class file (§4.1).
我在 invokespecial 指令描述的第一段中制作了标签(表示为: //label//)。我将在以下问题中使用这些标签。
The unsigned indexbyte1 and indexbyte2 are used to construct an index into the run-time constant pool of the current class //current class// (§2.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The run-time constant pool item at that index must be a symbolic reference to a method or an interface method (§5.1), which gives the name //method name// and descriptor //method descriptor// (§4.3.3) of the method as well as a symbolic reference to the class //referenced class// or interface in which the method is to be found. The named method is resolved //resolved method// (§5.4.3.3, §5.4.3.4).
根据标签,我现在检查了带有条件的段落。
- The resolved method is not an instance initialization method (§2.9).
问题1:所以,我需要检查//method name// 是否不等于 "<init>" 或 "<clinit>",是吗?
- If the symbolic reference names a class (not an interface), then that class is a superclass of the current class.
问题2:这是什么意思?//Referenced class//必须是直接或非直接超类(超类的超类等等)的//current class//吗?
- The ACC_SUPER flag is set for the class file (§4.1).
问题3:哪个类的class文件?//Referenced class//吗?