Java Reference
In-Depth Information
• The binary name of a type variable declared by a generic class or interface
8.1.2 , § 9.1.2 ) is the binary name of its immediately enclosing type, followed
by $, followed by the simple name of the type variable.
• The binary name of a type variable declared by a generic method (§ 8.4.4 ) is the
binary name of the type declaring the method, followed by $, followed by the
descriptor of the method as defined in The Java Virtual Machine Specification,
Java SE 7 Edition , followed by $, followed by the simple name of the type vari-
able.
• The binary name of a type variable declared by a generic constructor (§ 8.8.4 ) is
the binary name of the type declaring the constructor, followed by $, followed
by the descriptor of the constructor as defined in The Java Virtual Machine
Specification, Java SE 7 Edition , followed by $, followed by the simple name
of the type variable.
2. A reference to another class or interface type must be symbolic, using the binary
name of the type.
3. References to fields that are constant variables (§ 4.12.4 ) are resolved at compile
time to the constant value that is denoted. No reference to such a field should be
present in the code in a binary file (except in the class or interface containing the
field, which will have code to initialize it). Such a field must always appear to
have been initialized (§ 12.4.2 ) ; the default initial value for the type of such a field
must never be observed. See § 13.4.9 for a discussion.
4. Given a legal expression denoting a field access in a class C , referencing a non-
constant (§ 13.4.9 ) field named f declared in a (possibly distinct) class or interface
D , we define the qualifying type of the field reference as follows:
• If the expression is of the form Primary . f then:
♦ If the compile-time type of Primary is an intersection type (§ 4.9 ) V 1 & ... &
V n , then the qualifying type of the reference is V 1 .
♦ Otherwise, the compile-time type of Primary is the qualifying type of the
reference.
• If the expression is of the form super. f then the superclass of C is the qualifying
type of the reference.
• If the expression is of the form X .super. f then the superclass of X is the qualify-
ing type of the reference.
• If the reference is of the form X . f , where X denotes a class or interface, then the
class or interface denoted by X is the qualifying type of the reference.
Search WWH ::




Custom Search