RFR: 8359809: AttributeList, RoleList and UnresolvedRoleList should never accept other types of Object

Kevin Walls kevinw at openjdk.org
Wed Jun 18 11:39:04 UTC 2025


On Tue, 17 Jun 2025 16:54:15 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

> javax.management classes AttributeList, 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 195:

> 193: 
> 194:         if (role == null) {
> 195:             throw new IllegalArgumentException("Invalid parameter");

Removing the trailing dot from "parameter.", here and new line 247 below, to be in line with the rest.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25856#discussion_r2154370578


More information about the serviceability-dev mailing list