[OpenJDK 2D-Dev] [PATCH] 4494651: Wrong width and height in BufferedImage GraphicsConfiguration objects

Jennifer Godinez Jennifer.Godinez at Sun.COM
Tue Feb 3 17:25:28 UTC 2009


Hi Torsten,

Thank you for submitting a patch.  We need you to sign Sun Contributor Agreement before we can start 
working on your patch.  The SCA information can be found here: http://openjdk.java.net/contribute/

Once we get the confirmation we will give you an update on the patch.

Sincerely,

Jennifer

Torsten Landschoff wrote:
> Hello List,
> 
> A few days before I ran into bug 4494651, after more than 7 years of its 
> existence. See 
> 
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4494651
> 
> I was curious how hard it would be to build a fixed OpenJDK, so I spent 
> half of the saturday to get OpenJDK build and its unit tests running.
> 
> Turned out that it wasn't that hard so here are my changes for you to 
> consider.
> 
> The first diff contains a trivial unit test derived from the example code 
> in the bug log. The code should speak for itself.
> 
> Tracing the bug to its origin, I found the interesting lookup table in 
> BufferedImageGraphicsConfig.java which maps each imageType supported by 
> BufferedImage to a BufferedImageGraphicsConfig. I have no idea why that 
> would be a good idea (apart from performance), so the second diff just 
> removes that feature and creates a new graphics configuration each time 
> it is requested.
> 
> As the only reason why one would create such a lookup table would be to 
> get around performance problems, I wrote a third patch which caches 
> the graphics configurations already retrieved in a weak hash map.
> 
> Comments welcome. Feel free to apply my code to the OpenJDK code base, 
> I'd be glad to sign the Sun Contributor Agreement if needed for such 
> a trivial contribution.
> 
> 
> Thanks for all your work, I really enjoy working with Java (and even 
> more with its virtual machine and great libraries).
> 
> Greetings, Torsten
> 



More information about the 2d-dev mailing list