minor fix for user statistics retrieval at server side

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/news-feed@130993 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-08-06 13:46:28 +00:00
parent 4b3cd43ef4
commit 38ed5f1570
1 changed files with 3 additions and 3 deletions

View File

@ -1142,8 +1142,6 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
try{
ArrayList<EnhancedFeed> toReturn = new ArrayList<EnhancedFeed>();
// get reference time
Calendar oneYearAgo = Calendar.getInstance();
oneYearAgo.set(Calendar.YEAR, oneYearAgo.get(Calendar.YEAR) - 1);
@ -1178,7 +1176,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
feedsIteratorComments.remove();
}
break;
default : return toReturn;
default : return new ArrayList<EnhancedFeed>();
}
// filter the feeds according the current context
@ -1197,6 +1195,8 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
}
// enhance retrieved feeds
int upperIndex = (from + quantity) >= feeds.size() ? feeds.size() - 1 : from + quantity;
feeds = (ArrayList<Feed>) feeds.subList(from, upperIndex);
Collections.sort(feeds, Collections.reverseOrder());
return enhanceFeeds(feeds, -1);