<AWT Dev> <Swing Dev> Review request #3: 6852592 (revalidate() must be smarter)

Anthony Petrov Anthony.Petrov at Sun.COM
Tue Jul 28 10:59:03 PDT 2009


Hi Alex, Artem,

On 7/28/2009 8:05 PM Alexander Potochkin wrote:
> As for the second question about making Window/Applet validate roots,
> I just don't see any practical benefits of this
> 
> Could you please give more details why it is worth doing?

As to the Applet class, there's a valid justification: the user does not 
have a direct access to the underlying embedded frame which therefore 
might be left invalid forever. Please see [1] for the detailed description.

Regarding the Window: Artem proposed that at [2]. I didn't come up with 
any failing scenario, so I considered this change harmless and applied 
it. IMO, it isn't technically needed, but is conceptually correct. 
Perhaps Artem might comment on that?


On 7/28/2009 8:29 PM Alexander Potochkin wrote:
>> 1. What about making the 'c' variable a Container instead of the 
>> Component at the first loop of the addInvalidComponent() method? Would 
>> it require promoting isValidateRoot() up to the Component afterwards? 
>> Obviously, no additional type casting or instanceof-checking is 
>> required after that change.
> 
> Hm, getParent() returns Container?!
> Now I am fine with Container.isValidateRoot()

Great to hear that! Usually arguing gives birth to the truth. :)


>> I would also like to mention that since you claim that 6862117 is not 
>> a bug, then there's actually no any known issue that would require any 
>> changes to the addInvalidComponent() right now - generally we don't 
>> have any "problem" at all.
> 
> I didn't claim that 6862117 is not a bug
> I actually said that using Swing components in AWT application is incorrect
> Swing components need a top level RootContainer for various needs
> In the test case for 6862117 I can see that Swing and AWT component
> are placed inside JFrame, so this is a valid case

I guess I got the point. Just my example was sort of wrong. Thanks for 
clarifying that.


[1] http://mail.openjdk.java.net/pipermail/awt-dev/2009-July/000778.html

[2] http://mail.openjdk.java.net/pipermail/awt-dev/2009-July/000765.html

--
best regards,
Anthony



More information about the awt-dev mailing list