Repository: camel Updated Branches: refs/heads/master 9090acfe4 -> bdca8ba55
CAMEL-11607: Fix npe in MBeanInfoAssembler when debug is enabled. If debug is enabled and cache is not initialised an npe is thrown when stopping the component. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/bdca8ba5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/bdca8ba5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/bdca8ba5 Branch: refs/heads/master Commit: bdca8ba550c80aea108ff60130100afce453adbb Parents: 9090acf Author: sarelp <sa...@yannitech.com> Authored: Thu Jul 27 15:06:36 2017 +1000 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Thu Jul 27 11:43:57 2017 +0200 ---------------------------------------------------------------------- .../java/org/apache/camel/management/MBeanInfoAssembler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/bdca8ba5/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java b/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java index 07713a1..c4c6930 100644 --- a/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java +++ b/camel-core/src/main/java/org/apache/camel/management/MBeanInfoAssembler.java @@ -74,10 +74,10 @@ public class MBeanInfoAssembler implements Service { @Override public void stop() throws Exception { - if (LOG.isDebugEnabled()) { - LOG.debug("Clearing cache[size={}, hits={}, misses={}, evicted={}]", new Object[]{cache.size(), cache.getHits(), cache.getMisses(), cache.getEvicted()}); - } if (cache != null) { + if (LOG.isDebugEnabled()) { + LOG.debug("Clearing cache[size={}, hits={}, misses={}, evicted={}]", new Object[]{cache.size(), cache.getHits(), cache.getMisses(), cache.getEvicted()}); + } cache.clear(); } }