problem with ObjectInputStream.java

Jose Orlando Pereira jop at di.uminho.pt
Thu Feb 4 11:22:31 PST 1999


Archie Cobbs wrote:
> 
> 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?

Pizza didn't complain... Anyway, it really doesn't matter if the patch that
I sent in today (which attempts to correct a couple of other remaining
serialization bugs) is applied, as it gets rid of this.

-- 
Jose Orlando Pereira
* mailto:jop at di.uminho.pt * http://gsd.di.uminho.pt/~jop *


More information about the kaffe mailing list