problem with ObjectInputStream.java

Archie Cobbs archie at whistle.com
Thu Feb 4 10:38:33 PST 1999


In ObjectInputStream.java, note the double declaration of "Integer key":

>     case ObjectStreamConstants.TC_CLASSDESC:
> 	    ObjectStreamClass cls = new ObjectStreamClass();
> 	    currObject = (Object)cls;
> 	    Integer key = new Integer(++nextKey);
> 	    objectsDone.put(key, currObject);
> 	    invokeObjectReader(currObject, ObjectStreamClass.class);
> 	    cls.clazz = resolveClass(cls);
> 	    cls.buildFieldsAndOffset();
> 	    break;
> 
>     case ObjectStreamConstants.TC_STRING:
> 	    currObject = readUTF();
> 	    Integer key = new Integer(++nextKey);
> 	    objectsDone.put(key, currObject);
> 	    break;

Clearly this makes sense, once you realize that there's no way
during execution that "key" will be declared twice.

However, jikes doesn't recognize this. Is this a Jikes bug, or
is the above code not really valid?

-Archie

___________________________________________________________________________
Archie Cobbs   *   Whistle Communications, Inc.  *   http://www.whistle.com


More information about the kaffe mailing list