Chapter 2 Using the Signature Test Tool 9
Note – Instatic mode you can test specifiedclasses in another runtime environment.
For example, this can be useful to analyze APIs that are part of a Java SE platform
1.4.2environment when the SignatureTest command is run on a Java SE platform
version 5.0.
Constant Checking in Differing Run Modes
The requirements related to constant checking differin binary and source
compatibility testing. Although constant checking can be applied to binary
compatibility,it is a necessary prerequisite for source code compatibility. Use the
-static mode to enforce strict constant checking in source code compatibility
testing.
When running a signature test in source compatibility mode and using the static
mode,constant checking is strict and two way.This means that all the constant fields
and their related values specified in the referenceAPI must have the same values in
the API under test. Likewise, all the constant fields and their relatedvalues specified
in the API under test must have the same values in the reference API.
In binary compatibility mode, the requirements relatedto constant checking are less
strict. The signature test verifies that all the constant fields and associated values
contained in the reference API are also available in the API under test. If any field
values are missing or different, it reportsan error. However, the signature test does
not report an error if constant values are found in the API under test that are not
available in the reference API.
Generics Checking in Binary Mode
The information related to generics is not used by the Java VirtualMachine1at
runtime. This information is used only by the compiler at compile time.
In binary mode the SignatureTest command compares the signatures of
parameterized types after omitting the type parameters and arguments from both
the signature file and the analyzed API (termed type erasure). This is to ensurethat
they are compatible at runtime. See The Java Language Specification, Third Edition, for
a detailed description of type erasure.
The bridge methods that are generated by the compiler during type erasure are not
a part of the API and so they are ignored by the SigTesttool.
1. The terms "Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java™ platform