Source:
<code>public List<MetricQuery> getMatchingQueries(MetricQuery query) { requireNotDisposed(); SystemAssert.requireArgument(query != null, "MetricQuery cannot be null."); long start = System.nanoTime(); List<MetricQuery> queries = new ArrayList<>(); if(isWildcardQuery(query)) { String value = _cacheService.get(_getKey(query)); if(value == null) { _logger.info(MessageFormat.format("CACHE MISS for Wildcard Query: '{'{0}'}'. Will read from persistent storage.", query)); queries = _discoveryService.getMatchingQueries(query); _executorService.submit(new CacheInsertWorker(query, queries)); } else { _logger.info(MessageFormat.format("CACHE HIT for Wildcard Query: '{'{0}'}'", query)); try { JavaType type = MAPPER.getTypeFactory().constructCollectionType(List.class, MetricQuery.class); List<MetricQuery> matchedQueries = MAPPER.readValue(value, type); for(int i=0; i<matchedQueries.size(); i++) { MetricQuery q = new MetricQuery(query); _replaceWildcardFieldsFromCachedQuery(matchedQueries.get(i), q); queries.add(q); } <START> } catch (IOException e) { <END> _logger.warn("IOException while parsing string value from cache to list of metric queries. Will read from persistent storage.", e); queries = _discoveryService.getMatchingQueries(query); _executorService.submit(new CacheInsertWorker(query, queries)); } } } else { _logger.info(MessageFormat.format("MetricQuery'{'{0}'}' does not have any wildcards", query)); queries.add(query); } _logger.debug("Time to get matching queries in ms: " + (System.nanoTime() - start) / 1000000); return queries; }</code><technical_language>want check RuntimeException in addition IOExceptoiom. In cases fall underlying data store</technical_language>

Target:
public List<MetricQuery> getMatchingQueries(MetricQuery query) { requireNotDisposed(); SystemAssert.requireArgument(query != null, "MetricQuery cannot be null."); long start = System.nanoTime(); List<MetricQuery> queries = new ArrayList<>(); if(isWildcardQuery(query)) { String value = _cacheService.get(_getKey(query)); if(value == null) { _logger.info(MessageFormat.format("CACHE MISS for Wildcard Query: '{'{0}'}'. Will read from persistent storage.", query)); queries = _discoveryService.getMatchingQueries(query); _executorService.submit(new CacheInsertWorker(query, queries)); } else { _logger.info(MessageFormat.format("CACHE HIT for Wildcard Query: '{'{0}'}'", query)); try { JavaType type = MAPPER.getTypeFactory().constructCollectionType(List.class, MetricQuery.class); List<MetricQuery> matchedQueries = MAPPER.readValue(value, type); for(int i=0; i<matchedQueries.size(); i++) { MetricQuery q = new MetricQuery(query); _replaceWildcardFieldsFromCachedQuery(matchedQueries.get(i), q); queries.add(q); } } catch (Exception e) { _logger.warn("Failed to deserialize cached data into metric queries. Will read from persistent storage.", e); queries = _discoveryService.getMatchingQueries(query); _executorService.submit(new CacheInsertWorker(query, queries)); } } } else { _logger.info(MessageFormat.format("MetricQuery'{'{0}'}' does not have any wildcards", query)); queries.add(query); } _logger.debug("Time to get matching queries in ms: " + (System.nanoTime() - start) / 1000000); return queries; }