-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta2
-
x86
-
windows_98
Name: bsC130419 Date: 06/28/2001
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)
We use the PROTOCOL_VERSION_1 flag in serialization to maintain compatibility
with a product first released under JDK 1.1.7. We use the following code to
set the protocol, in a subclass of ObjectOutputStream.
try {
// see if the useProtocolVersion method is implemented
Method m = getClass().getMethod("useProtocolVersion", new Class[] {
Integer.TYPE });
Field f = getClass().getField("PROTOCOL_VERSION_1");
m.invoke(this, new Object[] { new Integer(f.getInt(this)) });
} catch (NoSuchMethodException e) {
// no problem, if the method's not there, we don't call it
}
Under 1.4beta, this is throwing a NoSuchFieldException, implying that I can't
get the PROTOCOL_VERSION_1 field. This code has worked in all previous
releases of Java.
(Review ID: 127515)
======================================================================
- relates to
-
JDK-4471738 Inconsistencies in method values in calls to InvocationHandler.invoke()
-
- Closed
-