From 668fc13a821d451e3b5d2ce73b54661a23c1aac9 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Mon, 25 Aug 2008 12:34:10 +0000 Subject: [PATCH] Small fix -- a null or empty name is not allowed in JMX. Don't put a name to info mbean if it is not supplied. git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@688705 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/solr/core/JmxMonitoredMap.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/solr/core/JmxMonitoredMap.java b/src/java/org/apache/solr/core/JmxMonitoredMap.java index be6319ef4fb..5fa0e11c362 100644 --- a/src/java/org/apache/solr/core/JmxMonitoredMap.java +++ b/src/java/org/apache/solr/core/JmxMonitoredMap.java @@ -184,7 +184,9 @@ public class JmxMonitoredMap extends throws MalformedObjectNameException { Hashtable map = new Hashtable(); map.put("type", key); - map.put("id", infoBean.getName()); + if (infoBean.getName() != null && !"".equals(infoBean.getName())) { + map.put("id", infoBean.getName()); + } return ObjectName.getInstance(jmxRootName, map); }