On Fri, 31 May 2024 06:41:26 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> It is easy to add new constants to a public API but there is no way to 
>> remove them.
>> OutpuBin constants work only if they are listed among the supported output 
>> bins.
>> There is always a way to lookup `tray-n` output bin through the supported 
>> ones and it would work in the same way if it was included as a predefined 
>> constant.
>
> If it's only about adding tray-1 to tray-11 in the above list and not about 
> whole lot of changes in other areas, so that supported list contains those 
> "tray-N" values, I guess we should add them..
> I guess isSupportedAttributedValues(tray-N) will not return false in that 
> case..

Suppose `getSupportedAttributeValues(OutputBin.class, null, null)` returns 
[`top`, `face-down`] output bins.
`isSupportedAttributedValues(...)` returns `true` for `OutputBin.TOP` and 
`OutputBin.FACE_DOWN` constants and `false` for `OutputBin.TRAY_1` if it was 
added in current implementation.

To make a one to one correspondence between `OutputBin.TOP` and 
`OutputBin.TRAY_1` constants it needs to add some logic and may be even make 
them equal in terms of `OutputBin` class which extends `EnumSyntax` class. 
It is not clear should such logic be provided in the current release or it is 
better to provide its proper implementation in the next release if necessary.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16166#discussion_r1622841662

Reply via email to