r = new XmlReader(new URL(u));
XmlReader.setDefaultEncoding("UTF-8");
- return new SyndFeedInput().build(r);
-
+ return new SyndFeedInput().build(r);
}
private static Map<Category, String[]> getFeeds() {
LOG.severe("No feed for category " + cat);
}
+ /**
+ * Returns a copy.
+ */
public List<Article> getArticles(Category cat)
throws IllegalArgumentException, MalformedURLException, FeedException, IOException {
synchronized (articlesByCategory) {
- return articlesByCategory.get(cat);
+ return new ArrayList<>(articlesByCategory.get(cat));
}
}