This closes Call toString() on the provided key in CSVRecordLookupService instead of attempting to cast to a String
@@ -139,8 +139,13 @@ public class CSVRecordLookupService extends AbstractCSVLookupService implements
return Optional.empty();
}
- final String key = (String) coordinates.get(KEY);
- if (StringUtils.isBlank(key)) {
+ final Object key = coordinates.get(KEY);
+ if (key == null) {
+ return Optional.empty();
+ }
+
+ final String keyString = key.toString();
+ if (StringUtils.isBlank(keyString)) {
return Optional.empty();
}
@@ -152,7 +157,7 @@ public class CSVRecordLookupService extends AbstractCSVLookupService implements
throw new LookupFailureException(e.getMessage(), e);
}
- return Optional.ofNullable(cache.get(key));
+ return Optional.ofNullable(cache.get(keyString));
}
@Override
