diff options
author | Krishnajinka <kris.jinka@samsung.com> | 2018-07-06 17:28:54 +0900 |
---|---|---|
committer | Takamune Cho <tc012c@att.com> | 2018-07-10 14:40:24 +0000 |
commit | ec248ffb74f1c038fdd6c7a77411f628ef51366f (patch) | |
tree | a790240451325798417300472b31a86993987160 /appc-dispatcher | |
parent | 72dbb19dd424ef559422bd0243d6a3179e01c382 (diff) |
null ptr check
rework based on review comments
Issue-ID: APPC-1047
Change-Id: Ia87707535dc5825d18a6c35fdae416064dcb8c14
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
Diffstat (limited to 'appc-dispatcher')
-rw-r--r-- | appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java index aa6d203a5..cd9011f4b 100644 --- a/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java +++ b/appc-dispatcher/appc-request-handler/appc-request-handler-core/src/main/java/org/onap/appc/requesthandler/impl/AbstractRequestHandlerImpl.java @@ -408,6 +408,13 @@ public abstract class AbstractRequestHandlerImpl implements RequestHandler { if (logger.isDebugEnabled()) logger.debug("Metric getting initialized"); MetricService metricService = getMetricservice(); + // Check for the metric service created before trying to create registry using + // the metricService object + if (metricService == null) { + // Cannot find service reference for org.onap.appc.metricservice.MetricService + throw new NullPointerException("org.onap.appc.metricservice.MetricService is null. " + + "Failed to init Metric"); + } metricRegistry = metricService.createRegistry("APPC"); DispatchingFuntionMetric dispatchingFuntionMetric = metricRegistry.metricBuilderFactory(). dispatchingFunctionCounterBuilder(). |