> returnedSet = descriptorMap.entrySet();
@@ -1057,9 +1067,12 @@ public class DescriptorSupport
return buf.toString();
}
+ @SuppressWarnings("removal")
private static String unquote(String s) throws XMLParseException {
- if (!s.startsWith("\"") || !s.endsWith("\""))
+ if (!s.startsWith("\"") || !s.endsWith("\"")) {
throw new XMLParseException("Value must be quoted: <" + s + ">");
+ // XMLParseException is deprecated for removal.
+ }
final StringBuilder buf = new StringBuilder();
final int len = s.length() - 1;
for (int i = 1; i < len; i++) {
@@ -1120,6 +1133,7 @@ public class DescriptorSupport
* - some other string, in which case the result is that string,
* without the parentheses.
*/
+ @SuppressWarnings("removal")
private static Object parseQuotedFieldValue(String s)
throws XMLParseException {
s = unquote(s);
@@ -1142,8 +1156,8 @@ public class DescriptorSupport
Class.forName(className, false, contextClassLoader);
constr = c.getConstructor(new Class>[] {String.class});
} catch (Exception e) {
- throw new XMLParseException(e,
- "Cannot parse value: <" + s + ">");
+ throw new XMLParseException(e, "Cannot parse value: <" + s + ">");
+ // XMLParseException is deprecated for removal.
}
final String arg = s.substring(slash + 1, s.length() - 1);
try {
@@ -1153,6 +1167,7 @@ public class DescriptorSupport
"Cannot construct instance of " + className +
" with arg: <" + s + ">";
throw new XMLParseException(e, msg);
+ // XMLParseException is deprecated for removal.
}
}
diff --git a/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java b/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java
index f15a8bee2b3..c29ddf60213 100644
--- a/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java
+++ b/src/java.management/share/classes/javax/management/modelmbean/RequiredModelMBean.java
@@ -91,8 +91,7 @@ import sun.reflect.misc.MethodUtil;
* from MBeans, connectors/adaptors like other MBeans. Through the
* Descriptors, values and methods in the managed application can be
* defined and mapped to attributes and operations of the ModelMBean.
- * This mapping can be defined in an XML formatted file or dynamically and
- * programmatically at runtime.
+ * This mapping can be defined dynamically and programmatically at runtime.
*
* Every RequiredModelMBean which is instantiated in the MBeanServer
* becomes manageable:
@@ -129,7 +128,6 @@ public class RequiredModelMBean
* and operations will be executed */
private Object managedResource = null;
-
/* records the registering in MBeanServer */
private boolean registered = false;
private transient MBeanServer server = null;
@@ -367,7 +365,7 @@ public class RequiredModelMBean
throw new MBeanException(x, x.getMessage());
}
- /**
+ /**
*
Captures the current state of this MBean instance and writes
* it out to the persistent store. The state stored could include
* attribute and operation values.
@@ -651,7 +649,6 @@ public class RequiredModelMBean
retStr.append("\nCLASSNAME: \t").append(info.getClassName());
retStr.append("\nDESCRIPTION: \t").append(info.getDescription());
-
try {
retStr.append("\nMBEAN DESCRIPTOR: \t").append(info.getMBeanDescriptor());
} catch (Exception e) {
diff --git a/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java b/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java
index 7d4773a49ea..efcfdf54d67 100644
--- a/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java
+++ b/src/java.management/share/classes/javax/management/modelmbean/XMLParseException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2025, 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
@@ -44,8 +44,12 @@ import java.io.ObjectStreamField;
*
* The serialVersionUID of this class is 3176664577895105181L.
*
+* @deprecated This class exists only to support XML parsing implemented privately in this module,
+* in DescriptorSupport. That feature is deprecated for removal.
+*
* @since 1.5
*/
+@Deprecated(since="25", forRemoval=true)
public class XMLParseException
extends Exception
{