RFR: 8345987: java.management has two Util.newObjectName methods (remove one)
Kevin Walls
kevinw at openjdk.org
Wed Dec 11 21:17:50 UTC 2024
On Wed, 11 Dec 2024 18:55:11 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:
>> Unnecessary duplication of small utility method. There should be only one Util.newObjectName().
>
> src/java.management/share/classes/javax/management/ObjectName.java line 40:
>
>> 38: import java.util.Map;
>> 39:
>> 40: import static sun.management.Util.newObjectName;
>
> What is the motivation for doing the static import? I prefer seeing Util.newObjectName().
Right, there are two Util classes, and some classes use both...
e.g. ObjectName.java uses com.sun.jmx.mbeanserver.Util (for Util.wildmatch()),
and I want to use newObjectName from sun.management.Util.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22681#discussion_r1881014021
More information about the serviceability-dev
mailing list