aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server')
-rw-r--r--src/main/java/com/juick/server/ServerManager.java8
-rw-r--r--src/main/java/com/juick/server/api/Post.java2
-rw-r--r--src/main/java/com/juick/server/api/rss/extension/JuickModuleGenerator.java4
3 files changed, 6 insertions, 8 deletions
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<EventSession> sessions = new CopyOnWriteArrayList<>();
+ private final CopyOnWriteArrayList<EventSession> 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<Namespace> NAMESPACES;
static {
- Set<Namespace> nss = new HashSet<>();
- nss.add(JUICK_NS);
- NAMESPACES = Collections.unmodifiableSet(nss);
+ NAMESPACES = Set.of(JUICK_NS);
}
@Override