[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nameObject bug?



Hi,
  Two things:

  i) You have to use self() if you want to name youself, right?

  ii) I seem to be hitting the bug described in this FIXME:

Line 104 of org.ozoneDB.core.ObjectSpace.java:
>    /*
>    FIXME: Explicit call after object creation doesn¥t check state.name()
>           for null-Pointer. Result: Null-Pointer-Exception in function
>           removeForKey().
>    */
>    public void nameObject (ObjectState state, String name) {
>       nameTable.removeForKey (state.name());
>       nameTable.addForKey (state.encapObjID().clone(), new String(name));
>       state.setName (name);
>       }

Is anything more here required than:

>    public void nameObject (ObjectState state, String name) {
>	String oldName = state.name();
>	if (oldName != null)
>       	nameTable.removeForKey (oldName);
>       nameTable.addForKey (state.encapObjID().clone(), new String(name));
>       state.setName (name);
>       }

It seems like that fix is shorter than the FIXME comment and makes me
wonder why the FIXME comment is there at all.

I guess I'll try it and see...

\x/ill        :-}