mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
intellij autofixes
This commit is contained in:
@@ -21,8 +21,8 @@ import lombok.RequiredArgsConstructor;
|
||||
@Singleton
|
||||
public class SecurityCheckFactoryProvider extends AbstractValueParamProvider {
|
||||
|
||||
private UserService userService;
|
||||
private HttpServletRequest request;
|
||||
private final UserService userService;
|
||||
private final HttpServletRequest request;
|
||||
|
||||
@Inject
|
||||
public SecurityCheckFactoryProvider(final MultivaluedParameterExtractorProvider extractorProvider, UserService userService,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.commafeed.frontend.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -158,13 +158,13 @@ public class Entry implements Serializable {
|
||||
|
||||
SyndContentImpl content = new SyndContentImpl();
|
||||
content.setValue(getContent());
|
||||
entry.setContents(Arrays.<SyndContent> asList(content));
|
||||
entry.setContents(Collections.<SyndContent> singletonList(content));
|
||||
|
||||
if (getEnclosureUrl() != null) {
|
||||
SyndEnclosureImpl enclosure = new SyndEnclosureImpl();
|
||||
enclosure.setType(getEnclosureType());
|
||||
enclosure.setUrl(getEnclosureUrl());
|
||||
entry.setEnclosures(Arrays.<SyndEnclosure> asList(enclosure));
|
||||
entry.setEnclosures(Collections.<SyndEnclosure> singletonList(enclosure));
|
||||
}
|
||||
|
||||
entry.setLink(getUrl());
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.commafeed.frontend.resource;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.net.URI;
|
||||
import java.util.Arrays;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
@@ -171,7 +171,7 @@ public class FeedREST {
|
||||
entries.setErrorCount(subscription.getFeed().getErrorCount());
|
||||
entries.setFeedLink(subscription.getFeed().getLink());
|
||||
|
||||
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, Arrays.asList(subscription), unreadOnly,
|
||||
List<FeedEntryStatus> list = feedEntryStatusDAO.findBySubscriptions(user, Collections.singletonList(subscription), unreadOnly,
|
||||
entryKeywords, newerThanDate, offset, limit + 1, order, true, onlyIds, null);
|
||||
|
||||
for (FeedEntryStatus status : list) {
|
||||
@@ -323,7 +323,7 @@ public class FeedREST {
|
||||
|
||||
FeedSubscription subscription = feedSubscriptionDAO.findById(user, Long.valueOf(req.getId()));
|
||||
if (subscription != null) {
|
||||
feedEntryService.markSubscriptionEntries(user, Arrays.asList(subscription), olderThan, entryKeywords);
|
||||
feedEntryService.markSubscriptionEntries(user, Collections.singletonList(subscription), olderThan, entryKeywords);
|
||||
}
|
||||
return Response.ok().build();
|
||||
}
|
||||
@@ -522,7 +522,7 @@ public class FeedREST {
|
||||
return Response.status(Status.FORBIDDEN).entity("Import is disabled for the demo account").build();
|
||||
}
|
||||
try {
|
||||
String opml = IOUtils.toString(input, "UTF-8");
|
||||
String opml = IOUtils.toString(input, StandardCharsets.UTF_8);
|
||||
opmlImporter.importOpml(user, opml);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.commafeed.frontend.resource;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
@@ -227,7 +227,8 @@ public class UserREST {
|
||||
public Response registerUser(@Valid @ApiParam(required = true) RegistrationRequest req,
|
||||
@Context @ApiParam(hidden = true) SessionHelper sessionHelper) {
|
||||
try {
|
||||
User registeredUser = userService.register(req.getName(), req.getPassword(), req.getEmail(), Arrays.asList(Role.USER));
|
||||
User registeredUser = userService.register(req.getName(), req.getPassword(), req.getEmail(),
|
||||
Collections.singletonList(Role.USER));
|
||||
userService.login(req.getName(), req.getPassword());
|
||||
sessionHelper.setLoggedInUser(registeredUser);
|
||||
return Response.ok().build();
|
||||
|
||||
@@ -17,7 +17,7 @@ import org.glassfish.jersey.server.spi.internal.ValueParamProvider;
|
||||
@Singleton
|
||||
public class SessionHelperFactoryProvider extends AbstractValueParamProvider {
|
||||
|
||||
private HttpServletRequest request;
|
||||
private final HttpServletRequest request;
|
||||
|
||||
@Inject
|
||||
public SessionHelperFactoryProvider(final MultivaluedParameterExtractorProvider extractorProvider, HttpServletRequest request) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import lombok.experimental.UtilityClass;
|
||||
@UtilityClass
|
||||
public class WebSocketMessageBuilder {
|
||||
|
||||
public static final String newFeedEntries(FeedSubscription subscription) {
|
||||
public static String newFeedEntries(FeedSubscription subscription) {
|
||||
return String.format("%s:%s", "new-feed-entries", subscription.getId());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user