From 52f863ac69fd2215ac43be29ce8c699492e96b78 Mon Sep 17 00:00:00 2001 From: Lorand Jakab Date: Tue, 11 Oct 2016 21:42:36 +0300 Subject: [PATCH] Bug 6925: Fix NPE in SimpleMapCache This restores performance to levels before https://git.opendaylight.org/gerrit/#/c/43473/ Change-Id: I03e935d1a1d3a4774610db6421c5705c56e26800 Signed-off-by: Lorand Jakab --- .../opendaylight/lispflowmapping/mapcache/SimpleMapCache.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mappingservice/mapcache/src/main/java/org/opendaylight/lispflowmapping/mapcache/SimpleMapCache.java b/mappingservice/mapcache/src/main/java/org/opendaylight/lispflowmapping/mapcache/SimpleMapCache.java index ebc710b12..d30ea7b7b 100644 --- a/mappingservice/mapcache/src/main/java/org/opendaylight/lispflowmapping/mapcache/SimpleMapCache.java +++ b/mappingservice/mapcache/src/main/java/org/opendaylight/lispflowmapping/mapcache/SimpleMapCache.java @@ -338,9 +338,9 @@ public class SimpleMapCache implements IMapCache { daoEntry.put(SubKeys.REGDATE, new Date(timestamp)); } + ILispDAO xtrIdTable = (ILispDAO) daoEntry.get(SubKeys.XTRID_RECORDS); XtrId xtrId = ((MappingRecord) daoEntry.get(SubKeys.RECORD)).getXtrId(); - if (xtrId != null) { - ILispDAO xtrIdTable = getXtrIdTable(eid, (ILispDAO) daoEntry.get(SubKeys.XTRID_RECORDS)); + if (xtrIdTable != null && xtrId != null) { ExtendedMappingRecord extRecord = (ExtendedMappingRecord) xtrIdTable.getSpecific(xtrId, SubKeys.EXT_RECORD); if (extRecord != null) { -- 2.36.6