From af1970a767b96893c6f46edb6632ec9abf6b3933 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 3 Apr 2020 20:28:44 +0300 Subject: Cleanup some IDEA warnings --- src/main/java/com/juick/server/ServerManager.java | 8 ++++---- src/main/java/com/juick/server/api/Post.java | 2 +- .../com/juick/server/api/rss/extension/JuickModuleGenerator.java | 4 +--- 3 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/main/java/com/juick/server') diff --git a/src/main/java/com/juick/server/ServerManager.java b/src/main/java/com/juick/server/ServerManager.java index d3742503..ee8d2147 100644 --- a/src/main/java/com/juick/server/ServerManager.java +++ b/src/main/java/com/juick/server/ServerManager.java @@ -50,7 +50,7 @@ import java.util.stream.Collectors; */ @Component public class ServerManager implements NotificationListener { - private static Logger logger = LoggerFactory.getLogger("Session"); + private static final Logger logger = LoggerFactory.getLogger("Session"); @Inject private MessagesService messagesService; @@ -58,7 +58,7 @@ public class ServerManager implements NotificationListener { private SubscriptionService subscriptionService; @Inject private UserService userService; - private CopyOnWriteArrayList sessions = new CopyOnWriteArrayList<>(); + private final CopyOnWriteArrayList sessions = new CopyOnWriteArrayList<>(); @Value("${service_user:juick}") private String serviceUsername; @@ -158,8 +158,8 @@ public class ServerManager implements NotificationListener { } public static class EventSession { - private User user; - private SseEmitter emitter; + private final User user; + private final SseEmitter emitter; public EventSession(User user, SseEmitter sseEmitter) { this.user = user; diff --git a/src/main/java/com/juick/server/api/Post.java b/src/main/java/com/juick/server/api/Post.java index bfc640e9..700249cc 100644 --- a/src/main/java/com/juick/server/api/Post.java +++ b/src/main/java/com/juick/server/api/Post.java @@ -54,7 +54,7 @@ import java.util.Optional; */ @RestController public class Post { - private static Logger logger = LoggerFactory.getLogger(Post.class); + private final static Logger logger = LoggerFactory.getLogger("API"); @Inject private UserService userService; diff --git a/src/main/java/com/juick/server/api/rss/extension/JuickModuleGenerator.java b/src/main/java/com/juick/server/api/rss/extension/JuickModuleGenerator.java index a3747fc9..fc8586ea 100644 --- a/src/main/java/com/juick/server/api/rss/extension/JuickModuleGenerator.java +++ b/src/main/java/com/juick/server/api/rss/extension/JuickModuleGenerator.java @@ -41,9 +41,7 @@ public class JuickModuleGenerator implements ModuleGenerator { private static final Set NAMESPACES; static { - Set nss = new HashSet<>(); - nss.add(JUICK_NS); - NAMESPACES = Collections.unmodifiableSet(nss); + NAMESPACES = Set.of(JUICK_NS); } @Override -- cgit v1.2.3