mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
fix modernizer warnings
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.wordnik.swagger.annotations.ApiModel;
|
||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@@ -24,10 +24,10 @@ public class Category implements Serializable {
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("category children categories")
|
||||
private List<Category> children = Lists.newArrayList();
|
||||
private List<Category> children = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty("category feeds")
|
||||
private List<Subscription> feeds = Lists.newArrayList();
|
||||
private List<Subscription> feeds = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty("wether the category is expanded or collapsed")
|
||||
private boolean expanded;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.wordnik.swagger.annotations.ApiModel;
|
||||
import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Entries implements Serializable {
|
||||
private int limit;
|
||||
|
||||
@ApiModelProperty("list of entries")
|
||||
private List<Entry> entries = Lists.newArrayList();
|
||||
private List<Entry> entries = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty("if true, the unread flag was ignored in the request, all entries are returned regardless of their read status")
|
||||
private boolean ignoredReadStatus;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.commafeed.frontend.resource;
|
||||
|
||||
import io.dropwizard.hibernate.UnitOfWork;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -36,7 +37,6 @@ import com.commafeed.frontend.auth.SecurityCheck;
|
||||
import com.commafeed.frontend.model.UserModel;
|
||||
import com.commafeed.frontend.model.request.IDRequest;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
@@ -136,7 +136,7 @@ public class AdminREST {
|
||||
@UnitOfWork
|
||||
@ApiOperation(value = "Get all users", notes = "Get all users", response = UserModel.class, responseContainer = "List")
|
||||
public Response getUsers(@SecurityCheck(Role.ADMIN) User user) {
|
||||
Map<Long, UserModel> users = Maps.newHashMap();
|
||||
Map<Long, UserModel> users = new HashMap<>();
|
||||
for (UserRole role : userRoleDAO.findAll()) {
|
||||
User u = role.getUser();
|
||||
Long key = u.getId();
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -59,7 +60,6 @@ import com.commafeed.frontend.model.request.CategoryModificationRequest;
|
||||
import com.commafeed.frontend.model.request.CollapseRequest;
|
||||
import com.commafeed.frontend.model.request.IDRequest;
|
||||
import com.commafeed.frontend.model.request.MarkRequest;
|
||||
import com.google.common.base.Optional;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.rometools.rome.feed.synd.SyndFeed;
|
||||
@@ -132,7 +132,7 @@ public class CategoryREST {
|
||||
}
|
||||
|
||||
if (ALL.equals(id)) {
|
||||
entries.setName(Optional.fromNullable(tag).or("All"));
|
||||
entries.setName(Optional.ofNullable(tag).orElse("All"));
|
||||
List<FeedSubscription> subs = feedSubscriptionDAO.findAll(user);
|
||||
removeExcludedSubscriptions(subs, excludedIds);
|
||||
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, subs, unreadOnly, entryKeywords, newerThanDate,
|
||||
|
||||
Reference in New Issue
Block a user