On Wed, 20 May 2026 22:45:02 GMT, Phil Race <[email protected]> wrote:

> Strictly enforcing that Media in portrait mode must have width < height 
> causes recurring problems.
> However the spec requires it so we need update that spec as well as removing 
> the enforcing code.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/java.desktop/share/classes/javax/print/attribute/standard/MediaSize.java 
line 39:

> 37:  * class that indicates the dimensions of the medium in a portrait 
> orientation,
> 38:  * with the {@code X} dimension running along the bottom edge and the 
> {@code Y}
> 39:  * dimension running along the left edge. Thus, the {@code Y} dimension 
> must be

The class level documentation also should be updated. Since we allow Y < X now.

src/java.desktop/share/classes/sun/print/CustomMediaSizeName.java line 212:

> 210:                         new MediaSize(width, length, Size2DSyntax.INCH, 
> value);
> 211:                     } catch (IllegalArgumentException e) {
> 212:                         // Should not happen, keep for safety

Can we just remove this try/catch block?
Why should we consume IAE? Is there some compatibility issue?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/31226#discussion_r3394588722
PR Review Comment: https://git.openjdk.org/jdk/pull/31226#discussion_r3394621358

Reply via email to