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
This commit is contained in:
parent
6a848e2bce
commit
087a1cd877
|
@ -1146,7 +1146,7 @@ public class NewsServiceImpl extends RemoteServiceServlet implements NewsService
|
||||||
Calendar oneYearAgo = Calendar.getInstance();
|
Calendar oneYearAgo = Calendar.getInstance();
|
||||||
oneYearAgo.set(Calendar.YEAR, oneYearAgo.get(Calendar.YEAR) - 1);
|
oneYearAgo.set(Calendar.YEAR, oneYearAgo.get(Calendar.YEAR) - 1);
|
||||||
|
|
||||||
ArrayList<Feed> feeds = null;
|
List<Feed> feeds = null;
|
||||||
|
|
||||||
switch(action){
|
switch(action){
|
||||||
case POSTS_MADE_BY_USER:
|
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
|
// sort the list, retrieve elements in the range and enhance the feeds
|
||||||
Collections.sort(feeds, Collections.reverseOrder());
|
Collections.sort(feeds, Collections.reverseOrder());
|
||||||
int upperIndex = (from + quantity) >= feeds.size() ? feeds.size() - 1 : from + quantity;
|
int upperIndex = (from + quantity) >= feeds.size() ? feeds.size() - 1 : from + quantity;
|
||||||
feeds = (ArrayList<Feed>) feeds.subList(from, upperIndex);
|
feeds = new ArrayList<Feed>(feeds.subList(from, upperIndex));
|
||||||
return enhanceFeeds(feeds, -1);
|
return enhanceFeeds((ArrayList<Feed>) feeds, -1);
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
_log.error("Error while retrieving feeds for user " + userid + " and action " + action.toString(), e);
|
_log.error("Error while retrieving feeds for user " + userid + " and action " + action.toString(), e);
|
||||||
|
|
Loading…
Reference in New Issue