<AWT Dev> [PATCH] ComponentAccessor
Artem Ananiev
Artem.Ananiev at Sun.COM
Mon Jan 19 09:43:21 PST 2009
Hi, Roman,
the idea you're proposing is fine, actually so fine that we have already
partly implemented it in the latest JDK6 update releases :) The fix
itself is also fine from my perspective.
Unfortunately, our implementation is slightly different - I'm not sure
if you have access to 6u10/6u12 sources, though - so if we integrate
your fix as proposed to OpenJDK, we'll have some troubles with upcoming
merge with 6u10/6u12 codebase... The only thing I'd suggest for you now
is to rewrite your fix using the same approach as we have.
BTW, to save your (and our) efforts next time, it may be worth notifying
everybody from this dev group about what you're going to start working
on - probably, someone else has almost implemented this in other manner.
This is by no means not a requirement, I'm just trying to avoid
conflicts like this in the future.
Thanks,
Artem
Roman Kennke wrote:
> 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
>
More information about the awt-dev
mailing list