<AWT Dev> [PATCH] ComponentAccessor

Roman Kennke roman at kennke.org
Fri Jan 16 06:14:01 PST 2009


Today I found the aweful (sorry) ComponentAccessor. I quickly rewrote it
using what I call the 'friends for Java' pattern (described here:

http://kennke.org/blog/2009/01/08/friends-for-java/

).

This has a couple of advantages:

- no reflection (I don't like reflection)
- compile-time safety
- better IDE support (i.e. I was trying to trace
ComponentPeer.getGraphicsConfiguration() back today, and only got to
Window.resetGC(), because this one is only called via reflection in
ComponentAccessor).
- I'd guess that performance is slighly better, but that probably
doesn't matter much in these cases.

Do you think that should go into OpenJDK?

Webrev: http://kennke.org/~roman/componentaccess/webrev/

Cheers, Roman

-- 
http://kennke.org/blog/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20090116/cf30f192/attachment.bin 


More information about the awt-dev mailing list