Patch: Window and Dialog fixes

Tom Tromey tromey@redhat.com
Wed Sep 10 17:26:00 GMT 2003


>>>>> "Tom" == Thomas Fitzsimmons <fitzsim@redhat.com> writes:

More comments...

Tom> +    parent = owner;
Tom> +    owner.ownedWindows.add(new WeakReference(this));

Synchronization is needed here, when changing owner.ownedWindows, as
the other users of ownedWindows also synchronize.

Should we synchronize on the tree lock instead of on the Window?

Tom> +  public synchronized Window[] getOwnedWindows()

This method needs to be implemented a different way.  The problem is
that a WeakReference can be cleared between the two loops.

Maybe the only way to do this is to allocate a possibly-too-large
array, fill it, and then create a new, smaller array if need be.

Tom



More information about the Java-patches mailing list