Bug 6925: Fix NPE in SimpleMapCache 99/46799/1
authorLorand Jakab <lojakab@cisco.com>
Tue, 11 Oct 2016 18:42:36 +0000 (21:42 +0300)
committerLorand Jakab <lojakab@cisco.com>
Tue, 11 Oct 2016 19:36:36 +0000 (22:36 +0300)
This restores performance to levels before
https://git.opendaylight.org/gerrit/#/c/43473/

Change-Id: I03e935d1a1d3a4774610db6421c5705c56e26800
Signed-off-by: Lorand Jakab <lojakab@cisco.com>
mappingservice/mapcache/src/main/java/org/opendaylight/lispflowmapping/mapcache/SimpleMapCache.java

index ebc710b1223dbb011c9a37872eeb433841a9c1c2..d30ea7b7b53243b70d161f7d01f1c4bb27cb3524 100644 (file)
@@ -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) {