-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
5.0
-
None
-
generic
-
generic
Name: siR10004 Date: 02/10/2004
For source compatibility check made by the JCK Signature test, it is
important to verify that any field, declared as compile-time constant
in reference implementation, is not changed to run-time constant in
tested implementation, because such change can lead to source
incompatibility between the two API. Further details on this in
the bugreport
4935988 sigtest does not check constants in source mode.
Currently sigtest can distinguish between compile-time and run-time
constants by means of classfile parsing (the static mode of sigtest).
Using reflection API (the basic mode of sigtest), it is impossible
to implement this check. Indeed, the only way to get information
about field value is calling
public Object get(Object obj)
method of 'java.lang.Field' class. However, this method will
always return (current) value of the underlying field, irrespective
of whether the field is initialized in classfile or not.
The problem could be solved by introducing new method, for example
public Object getPrimitive()
which returns value only for fields which are initialized in classfile
(i.e. compile-time constants) and returns null (or throws some
exception) otherwise.
Also, the new method must not attempt to initialize class if it
was not initialized before call. This is important, because sigtest
may not initialize classes that are checked - there are classes in
JDK with nontrivial initialization and serious side effect (for
example, class 'java.awt.dnd.DragSource' tries to connect to X11
window server during class initialization).
======================================================================
- relates to
-
CODETOOLS-4935988 sigtest does not check constants in source mode.
-
- Closed
-