[OpenJDK 2D-Dev] RFR: 7183828: Invalid Image Variant when using anything other than BufferedImage

Sergey Bylokhov serb at openjdk.java.net
Wed Sep 9 22:42:14 UTC 2020

On Wed, 9 Sep 2020 16:50:22 GMT, Phil Race <prr at openjdk.org> wrote:

> I have very mixed feelings about this whole idea.
> InvalidPipeException is being co-opted for a different purpose.

We already use this exception in such cases, and I think it is intended for this:

> The user no longer gets a clear message that their image type isn't supported.
> Is there any specification we can point to ?

The spec for the Image class:
>  * The abstract class {@code Image} is the superclass of all
>  * classes that represent graphical images. The image must be
>  * obtained in a platform-specific manner.

Or the spec for the VolatileImage
>  * This image should not be subclassed directly but should be created
>  * by using the {@link java.awt.Component#createVolatileImage(int, int)
>  * Component.createVolatileImage} or
>  * {@link java.awt.GraphicsConfiguration#createCompatibleVolatileImage(int, int)
>  * GraphicsConfiguration.createCompatibleVolatileImage(int, int)} methods.


PR: https://git.openjdk.java.net/jdk/pull/85

More information about the 2d-dev mailing list