bug-classpath
[Top][All Lists]
Advanced

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

[Bug swing/24359] JPopupMenu broken due to BoxLayout/SizeRequirements ch


From: roman at kennke dot org
Subject: [Bug swing/24359] JPopupMenu broken due to BoxLayout/SizeRequirements changes
Date: 24 Oct 2005 19:53:21 -0000


------- Comment #7 from roman at kennke dot org  2005-10-24 19:53 -------
<<<
But despite Marks explanation, I still fail to see why SizeRequirements
should ever see a null child component, even when building the application 
in the main thread and calling show() from there...
>>>

This is because invalidateLayout() sets all fields to null. When this happens
when another thread is in one of the other methods, it can occur that these
fields are null.

<<<
... personally, I would argue for a few null-checks in SizeRequirements 
to avoid crashing there. Just for safety :-) (skipping null components 
should leave the rest of the layout intact).
>>>

We actually have null-checks here. This is the condition for when the bodies of
the check* methods are executed. Synchronizing the public methods should avoid
the problem of the fields becoming null during the execution of another method.
And yes, it will probably slow down the whole thing a bit, since only one
method can be executed at any one time and we have a little overhead for
obtaining the lock here.

<<<
BTW: most components in Swing report Integer.MAX_VALUE as their maximum 
size, but Box uses Short.MAX_VALUE. Is this intentional? It made looking
at component sizes in the debugger even more bewildering...
>>>

Most components inherit from JComponent, which has Integer.MAX_VALUE. However,
some components have Short.MAX_VALUE, honestly I don't know why. I could think
that the reason is to avoid overflow somewhere in the layout calculations, but
then again, it should be the same for all components. We have adopted these
values from the JDK (see mauve testsuite). When we differ from the JDK, then
this is a bug that should be reported.

I'll close this bug for now.


-- 

roman at kennke dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24359





reply via email to

[Prev in Thread] Current Thread [Next in Thread]