mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-02 14:38:28 +00:00
8345987: java.management has two Util.newObjectName methods (remove one)
Reviewed-by: cjplummer, amenkov, lmesnik
This commit is contained in:
parent
f647d4d908
commit
e7fc0eb522
@ -35,7 +35,6 @@ import com.sun.jmx.mbeanserver.ModifiableClassLoaderRepository;
|
||||
import com.sun.jmx.mbeanserver.NamedObject;
|
||||
import com.sun.jmx.mbeanserver.Repository;
|
||||
import com.sun.jmx.mbeanserver.Repository.RegistrationContext;
|
||||
import com.sun.jmx.mbeanserver.Util;
|
||||
import com.sun.jmx.remote.util.EnvHelp;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
@ -81,6 +80,8 @@ import javax.management.RuntimeMBeanException;
|
||||
import javax.management.RuntimeOperationsException;
|
||||
import javax.management.loading.ClassLoaderRepository;
|
||||
|
||||
import sun.management.Util;
|
||||
|
||||
/**
|
||||
* This is the default class for MBean manipulation on the agent side. It
|
||||
* contains the methods necessary for the creation, registration, and
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -281,7 +281,7 @@ public class Repository {
|
||||
|
||||
// Set domain to default if domain is empty and not already set
|
||||
if (dom.length() == 0)
|
||||
name = Util.newObjectName(domain + name.toString());
|
||||
name = sun.management.Util.newObjectName(domain + name.toString());
|
||||
|
||||
// Do we have default domain ?
|
||||
if (dom == domain) { // ES: OK (dom & domain are interned)
|
||||
@ -438,10 +438,9 @@ public class Repository {
|
||||
if (allNames)
|
||||
result.addAll(moiTb.values());
|
||||
else
|
||||
addAllMatching(moiTb, result, Util.newObjectName(domain + name.getCanonicalName()));
|
||||
addAllMatching(moiTb, result, sun.management.Util.newObjectName(domain + name.getCanonicalName()));
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!name.isDomainPattern()) {
|
||||
final Map<String,NamedObject> moiTb = domainTb.get(dom2Match);
|
||||
if (moiTb == null) return Collections.emptySet();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -43,13 +43,6 @@ import javax.management.MalformedObjectNameException;
|
||||
import javax.management.ObjectName;
|
||||
|
||||
public class Util {
|
||||
public static ObjectName newObjectName(String string) {
|
||||
try {
|
||||
return new ObjectName(string);
|
||||
} catch (MalformedObjectNameException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
|
||||
static <K, V> Map<K, V> newMap() {
|
||||
return new HashMap<>();
|
||||
|
||||
@ -28,7 +28,7 @@ package javax.management;
|
||||
import java.lang.System.Logger.Level;
|
||||
import com.sun.jmx.defaults.JmxProperties;
|
||||
import com.sun.jmx.defaults.ServiceName;
|
||||
import com.sun.jmx.mbeanserver.Util;
|
||||
import sun.management.Util;
|
||||
|
||||
/**
|
||||
* Represents the MBean server from the management point of view.
|
||||
|
||||
@ -1222,7 +1222,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
|
||||
public static ObjectName getInstance(ObjectName name) {
|
||||
if (name.getClass().equals(ObjectName.class))
|
||||
return name;
|
||||
return Util.newObjectName(name.getSerializedNameString());
|
||||
return sun.management.Util.newObjectName(name.getSerializedNameString());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1813,7 +1813,7 @@ public class ObjectName implements Comparable<ObjectName>, QueryExp {
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public static final ObjectName WILDCARD = Util.newObjectName("*:*");
|
||||
public static final ObjectName WILDCARD = sun.management.Util.newObjectName("*:*");
|
||||
|
||||
// Category : Utilities <===================================
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user