Java Reference
In-Depth Information
This chapter specifies minimum standards for binary compatibility guaranteed by all im-
plementations. The Java programming language guarantees compatibility when binaries of
classes and interfaces are mixed that are not known to be from compatible sources, but
whose sources have been modified in the compatible ways described here. Note that we are
discussing compatibility between releases of an application. A discussion of compatibility
among releases of the Java SE platform is beyond the scope of this chapter.
We encourage development systems to provide facilities that alert developers to the impact
of changes on pre-existing binaries that cannot be recompiled.
This chapter first specifies some properties that any binary format for the Java program-
is and what it is not (§
13.2
). It finally enumerates a large set of possible changes to pack-
ages (§
13.3
)
, classes (§
13.4
), and interfaces (§
13.5
)
, specifying which of these changes are
guaranteed to preserve binary compatibility and which are not.
13.1. The Form of a Binary
Programs must be compiled either into the
class
file format specified by
The Java Virtual
Machine Specification, Java SE 7 Edition
, or into a representation that can be mapped into
that format by a class loader written in the Java programming language.
Furthermore, the resulting
class
file must have certain properties. A number of these prop-
erties are specifically chosen to support source code transformations that preserve binary
compatibility. The required properties are:
1.
The class or interface must be named by its
binary name
, which must meet the fol-
lowing constraints:
its immediately enclosing type, followed by $, followed by the simple name of
the member.
mediately enclosing type, followed by $, followed by a non-empty sequence of
digits, followed by the simple name of the local class.
of its immediately enclosing type, followed by $, followed by a non-empty se-
quence of digits.