ILispDAO xtrIdTable = getXtrIdTable(eid, (ILispDAO) daoEntry.getValue().get(SubKeys.XTRID_RECORDS));
if (xtrIdTable != null) {
MappingRecord xtrIdRecord = (MappingRecord) xtrIdTable.getSpecific(xtrId, SubKeys.RECORD);
- if (MappingMergeUtil.timestampIsExpired(xtrIdRecord.getTimestamp())) {
+ if (xtrIdRecord.getTimestamp() != null &&
+ MappingMergeUtil.timestampIsExpired(xtrIdRecord.getTimestamp())) {
xtrIdTable.removeSpecific(xtrId, SubKeys.RECORD);
return null;
} else {
}
} else {
Date timestamp = (Date) daoEntry.getValue().get(SubKeys.REGDATE);
- if (MappingMergeUtil.timestampIsExpired(timestamp)) {
+ if (timestamp != null && MappingMergeUtil.timestampIsExpired(timestamp)) {
dao.removeSpecific(daoEntry.getKey(), SubKeys.REGDATE);
dao.removeSpecific(daoEntry.getKey(), SubKeys.RECORD);
return null;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import com.google.common.base.Preconditions;
+
/**
* Utility class to implement merging of locator sets
*
}
public static boolean timestampIsExpired(Date timestamp) {
+ Preconditions.checkNotNull(timestamp, "timestamp should not be null!");
return timestampIsExpired(timestamp.getTime());
}
- public static boolean timestampIsExpired(long timestamp) {
+ public static boolean timestampIsExpired(Long timestamp) {
+ Preconditions.checkNotNull(timestamp, "timestamp should not be null!");
if ((System.currentTimeMillis() - timestamp) > REGISTRATION_VALIDITY) {
return true;
}