From 615cc38b18105951e0c12ec8a9851c0baee13d19 Mon Sep 17 00:00:00 2001 From: Steve Rowe Date: Wed, 26 Jul 2017 12:21:02 -0400 Subject: [PATCH] SOLR-11151: SolrInfoMBeanHandler.getDiff() ADD case non-functional: NPE when a bean value goes from null -> non-null --- solr/CHANGES.txt | 3 ++ .../handler/admin/SolrInfoMBeanHandler.java | 14 ++++---- .../solr/handler/admin/MBeansHandlerTest.java | 34 +++++++++++++++++++ 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 3d6c5a12747..821f9facf51 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -391,6 +391,9 @@ Bug Fixes * SOLR-11130: V2Request in SolrJ should return the correct collection name so that the request is forwarded to the correct node (noble) + +* SOLR-11151: SolrInfoMBeanHandler.getDiff() ADD case non-functional: NPE when a bean value goes from null -> non-null. + (Steve Rowe) Optimizations ---------------------- diff --git a/solr/core/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java index 4faa466f4ee..f9a3c053cdc 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/SolrInfoMBeanHandler.java @@ -209,14 +209,16 @@ public class SolrInfoMBeanHandler extends RequestHandlerBase { for(int i=0; i[^<]*", ""); + + LocalSolrQueryRequest req = lrf.makeRequest( + CommonParams.QT,"/admin/mbeans", + "stats","true", + CommonParams.WT,"xml", + "diff","true"); + req.setContentStreams(Collections.singletonList(new ContentStreamBase.StringStream(xml))); + xml = h.query(req); + + NamedList>> nl = SolrInfoMBeanHandler.fromXML(xml); + assertNotNull(((NamedList)nl.get("ADMIN").get("/admin/mbeans").get("stats")).get("ADD ADMIN./admin/mbeans.totalTime")); + } + @Test public void testXMLDiffWithExternalEntity() throws Exception { String file = getFile("mailing_lists.pdf").toURI().toASCIIString();