mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
small refactoring
This commit is contained in:
@@ -222,24 +222,26 @@ public class FeedEntryStatusDAO extends GenericDAO<FeedEntryStatus> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<FeedEntryStatus> statusPlaceholders = set.asList();
|
List<FeedEntryStatus> placeholders = set.asList();
|
||||||
int size = statusPlaceholders.size();
|
int size = placeholders.size();
|
||||||
if (size < offset) {
|
if (size < offset) {
|
||||||
return Lists.newArrayList();
|
return Lists.newArrayList();
|
||||||
}
|
}
|
||||||
|
placeholders = placeholders.subList(Math.max(offset, 0), size);
|
||||||
|
|
||||||
statusPlaceholders = statusPlaceholders.subList(Math.max(offset, 0), size);
|
List<FeedEntryStatus> statuses = null;
|
||||||
|
if (onlyIds) {
|
||||||
if (!onlyIds) {
|
statuses = placeholders;
|
||||||
List<FeedEntryStatus> statuses = Lists.newArrayList();
|
} else {
|
||||||
for (FeedEntryStatus status : statusPlaceholders) {
|
statuses = Lists.newArrayList();
|
||||||
Long statusId = status.getId();
|
for (FeedEntryStatus placeholder : placeholders) {
|
||||||
FeedEntry entry = em.find(FeedEntry.class, status.getEntry().getId());
|
Long statusId = placeholder.getId();
|
||||||
statuses.add(handleStatus(statusId == null ? null : findById(statusId), status.getSubscription(), entry));
|
FeedEntry entry = em.find(FeedEntry.class, placeholder.getEntry().getId());
|
||||||
|
statuses.add(handleStatus(statusId == null ? null : findById(statusId), placeholder.getSubscription(), entry));
|
||||||
}
|
}
|
||||||
statusPlaceholders = lazyLoadContent(includeContent, statuses);
|
statuses = lazyLoadContent(includeContent, statuses);
|
||||||
}
|
}
|
||||||
return statusPlaceholders;
|
return statuses;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
|
|||||||
Reference in New Issue
Block a user