Java Reference
In-Depth Information
with a new method that is identical except for the types of the aforementioned
formal parameters, which now have the new erasure of the type parameter as their
type.
• If the type parameter is used as a return type of a method, but not as the type of
any formal parameter of the method, the effect is as if that method were removed,
and replaced with a new method that is identical except for the return type, which
is now the new erasure of the type parameter.
• If the type parameter is used as a return type of a method and as the type of one or
more formal parameters of the method, the effect is as if that method were re-
moved, and replaced with a new method that is identical except for the return type,
which is now the new erasure of the type parameter, and except for the types of the
aforementioned formal parameters, which now have the new erasure of the type
parameter as their types.
Changing any other bound has no effect on binary compatibility.
13.4.14. Method and Constructor Formal Parameters
Changing the name of a formal parameter of a method or constructor does not impact pre-
existing binaries.
Changing the name of a method, or the type of a formal parameter to a method or con-
structor, or adding a parameter to or deleting a parameter from a method or constructor
declaration creates a method or constructor with a new signature, and has the combined ef-
fect of deleting the method or constructor with the old signature and adding a method or
constructor with the new signature (§ 13.4.12 ) .
Changing the type of the last formal parameter of a method from T [] to a variable arity para-
meter (§ 8.4.1 ) of type T (i.e. to T ... ), and vice versa, does not impact pre-existing binaries.
For purposes of binary compatibility, adding or removing a method or constructor m whose
signature involves type variables (§ 4.4 ) or parameterized types (§ 4.5 ) is equivalent to the
addition (respectively, removal) of an otherwise equivalent method whose signature is the
erasure (§ 4.6 ) of the signature of m .
13.4.15. Method Result Type
Changing the result type of a method, or replacing a result type with void , or replacing void
with a result type, has the combined effect of deleting the old method and adding a new
method with the new result type or newly void result (see § 13.4.12 ).
Search WWH ::




Custom Search