On Thu, 19 Nov 2026 01:58:25 GMT, Joe Wang <[email protected]> wrote:

>> src/java.xml/share/classes/jdk/xml/internal/XMLSecurityManager.java line 936:
>> 
>>> 934:          * @return the mapped integer, or the configured integer 
>>> representation
>>> 935:          * for unmapped values
>>> 936:          * @throws IllegalArgumentException if the value is not in the 
>>> provided map
>> 
>> Should the `IAE` clause mention that it is thrown when the value is not in 
>> the map **AND** there is no fallback value provided?
>
> I'd say no need to add the "and" as there's no fallback mechanism. For the 
> case where there's a dedicated validator, note that the value is in the map.

By fallback value I meant the `unmappedValue`.

Am I misunderstanding, but as far as I can tell, given,

`iVal = map.getOrDefault(stringValue.toLowerCase(Locale.ROOT), unmappedValue);`

the code implies that if the value does not exist in the map, it will use 
`unmappedValue`, but if that fallback value (`unmappedValue`) is itself `null`, 
only then will `IllegalArgumentException` be thrown. Which is relevant for 
`RAMAPPER` because values other than "*" and "" are not in the `RA_MAP`, but do 
not throw `IAE` since that mapper is given an `unmappedValue` of 
`JdkConstants.ALLOW` (0).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33938#discussion_r4632740320

Reply via email to