From 0e94af782f1e6a24607eaa82119b192b56e1f39b Mon Sep 17 00:00:00 2001 From: Philipp Knobel Date: Thu, 7 Jan 2016 13:36:42 +0100 Subject: [PATCH] move metric initialisation upfront connection creation to avoid potential npe --- src/main/java/net/spy/memcached/MemcachedConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/spy/memcached/MemcachedConnection.java b/src/main/java/net/spy/memcached/MemcachedConnection.java index b3b2263fb..6f9c5441b 100644 --- a/src/main/java/net/spy/memcached/MemcachedConnection.java +++ b/src/main/java/net/spy/memcached/MemcachedConnection.java @@ -279,10 +279,10 @@ public MemcachedConnection(final int bufSize, final ConnectionFactory f, wakeupDelay = Integer.parseInt( System.getProperty("net.spy.wakeupDelay", Integer.toString(DEFAULT_WAKEUP_DELAY))); + metrics = f.getMetricCollector(); List connections = createConnections(a); locator = f.createLocator(connections); - metrics = f.getMetricCollector(); metricType = f.enableMetrics(); registerMetrics();