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

Re: nameObject bug?





--On Wed, Dec 29, 1999 11:30 AM -0900 Tim Brown <Tim.Brown@incenter.org>
wrote:

> Will,
> 
> Just so I understand.  This change is to allow updating of objects
> basically right?  So, if I make changes to one of my database objects I
> can now right a utility that removes those objects even though the
> signature has changed?

Um, no.

As I understand things (and I've been using Ozone for 4 days, so I'm not
expert), all Ozone objects can be named.  The first 'if' allows you to
name objects after creation, if you left the name string null when you
created the object.  The API already exists, it just threw an exception
when I tried to use it in certain situations.

The second 'if' allows you to 'unname' an object.  i.e. set its name string
back to null.

Neither of these have anything to do with the 'Two more comments' I made
earlier.

As I said above, I'm no ozone ezpert, so while these changes work for me,
I'd like more experienced coders to comment on them.  BTW, email seems to
have done strange things to the formatting of the code snippet.  Be careful
of the scope while reading it.

\x/ill       :-}

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