On Tue, 17 Jun 2025 16:54:15 GMT, Kevin Walls <[email protected]> wrote:
> The classes javax.management.AttributeList, and
> javax.management.relation.RoleList and UnresolvedRoleList, have a historical
> feature where they accept objects of the wrong type, and only check for wrong
> objects when the "asList()" method is called.
>
> This feature should be removed, and these classes should never accept the
> wrong kind of Object.
src/java.management/share/classes/javax/management/relation/RoleList.java line
265:
> 263: @Override
> 264: public boolean add(Object o) {
> 265: checkTypeSafe(o);
Q: Is `null` allowed? The same question applies to the `addAll()` if these
methods allow null to be present in the collection.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25856#discussion_r2159436534