arraylist cast fixed

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@130995 82a268e6-3cf1-43bd-a215-b396298e98cf
Feature/26194
Costantino Perciante 8 years ago
parent 6a848e2bce
commit 087a1cd877

@ -1146,7 +1146,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
Calendar oneYearAgo = Calendar.getInstance();
oneYearAgo.set(Calendar.YEAR, oneYearAgo.get(Calendar.YEAR) - 1);
ArrayList<Feed> feeds = null;
List<Feed> feeds = null;
switch(action){
case POSTS_MADE_BY_USER:
@ -1197,8 +1197,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
// sort the list, retrieve elements in the range and enhance the feeds
Collections.sort(feeds, Collections.reverseOrder());
int upperIndex = (from + quantity) >= feeds.size() ? feeds.size() - 1 : from + quantity;
feeds = (ArrayList<Feed>) feeds.subList(from, upperIndex);
return enhanceFeeds(feeds, -1);
feeds = new ArrayList<Feed>(feeds.subList(from, upperIndex));
return enhanceFeeds((ArrayList<Feed>) feeds, -1);
}catch(Exception e){
_log.error("Error while retrieving feeds for user " + userid + " and action " + action.toString(), e);

Loading…
Cancel
Save