aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/juick/model/ExternalToken.java8
-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
-rw-r--r--src/main/java/com/juick/service/activities/DeleteMessageEvent.java2
-rw-r--r--src/main/java/com/juick/service/activities/DeleteUserEvent.java2
-rw-r--r--src/main/java/com/juick/service/activities/FollowEvent.java2
-rw-r--r--src/main/java/com/juick/service/component/AccountVerificationEvent.java4
-rw-r--r--src/main/java/com/juick/service/component/MailVerificationEvent.java4
-rw-r--r--src/main/java/com/juick/service/component/PingEvent.java2
-rw-r--r--src/main/java/com/juick/service/component/UserUpdatedEvent.java2
11 files changed, 19 insertions, 21 deletions
diff --git a/src/main/java/com/juick/model/ExternalToken.java b/src/main/java/com/juick/model/ExternalToken.java
index f2eac8de..65a07e55 100644
--- a/src/main/java/com/juick/model/ExternalToken.java
+++ b/src/main/java/com/juick/model/ExternalToken.java
@@ -24,10 +24,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
* Created by vitalyster on 22.11.2016.
*/
public class ExternalToken {
- private String name;
- private String type;
- private String token;
- private String secret;
+ private final String name;
+ private final String type;
+ private final String token;
+ private final String secret;
@JsonCreator
public ExternalToken(@JsonProperty("name") String name,
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
diff --git a/src/main/java/com/juick/service/activities/DeleteMessageEvent.java b/src/main/java/com/juick/service/activities/DeleteMessageEvent.java
index 8ca75122..d4aa3735 100644
--- a/src/main/java/com/juick/service/activities/DeleteMessageEvent.java
+++ b/src/main/java/com/juick/service/activities/DeleteMessageEvent.java
@@ -21,7 +21,7 @@ import com.juick.model.Message;
import org.springframework.context.ApplicationEvent;
public class DeleteMessageEvent extends ApplicationEvent {
- private Message message;
+ private final Message message;
/**
* Create a new ApplicationEvent.
*
diff --git a/src/main/java/com/juick/service/activities/DeleteUserEvent.java b/src/main/java/com/juick/service/activities/DeleteUserEvent.java
index a0b30c83..aee22115 100644
--- a/src/main/java/com/juick/service/activities/DeleteUserEvent.java
+++ b/src/main/java/com/juick/service/activities/DeleteUserEvent.java
@@ -20,7 +20,7 @@ package com.juick.service.activities;
import org.springframework.context.ApplicationEvent;
public class DeleteUserEvent extends ApplicationEvent {
- private String userUri;
+ private final String userUri;
/**
* Create a new ApplicationEvent.
*
diff --git a/src/main/java/com/juick/service/activities/FollowEvent.java b/src/main/java/com/juick/service/activities/FollowEvent.java
index 91779a20..055b79f4 100644
--- a/src/main/java/com/juick/service/activities/FollowEvent.java
+++ b/src/main/java/com/juick/service/activities/FollowEvent.java
@@ -21,7 +21,7 @@ import com.juick.server.api.activity.model.activities.Follow;
import org.springframework.context.ApplicationEvent;
public class FollowEvent extends ApplicationEvent {
- private Follow request;
+ private final Follow request;
/**
* Create a new ApplicationEvent.
*
diff --git a/src/main/java/com/juick/service/component/AccountVerificationEvent.java b/src/main/java/com/juick/service/component/AccountVerificationEvent.java
index 9ab48015..89b2bfca 100644
--- a/src/main/java/com/juick/service/component/AccountVerificationEvent.java
+++ b/src/main/java/com/juick/service/component/AccountVerificationEvent.java
@@ -20,8 +20,8 @@ package com.juick.service.component;
import org.springframework.context.ApplicationEvent;
public class AccountVerificationEvent extends ApplicationEvent {
- private String email;
- private String code;
+ private final String email;
+ private final String code;
/**
* Create a new {@code ApplicationEvent}.
*
diff --git a/src/main/java/com/juick/service/component/MailVerificationEvent.java b/src/main/java/com/juick/service/component/MailVerificationEvent.java
index 5a6a95a7..0d992159 100644
--- a/src/main/java/com/juick/service/component/MailVerificationEvent.java
+++ b/src/main/java/com/juick/service/component/MailVerificationEvent.java
@@ -20,8 +20,8 @@ package com.juick.service.component;
import org.springframework.context.ApplicationEvent;
public class MailVerificationEvent extends ApplicationEvent {
- private String email;
- private String code;
+ private final String email;
+ private final String code;
/**
* Create a new {@code ApplicationEvent}.
*
diff --git a/src/main/java/com/juick/service/component/PingEvent.java b/src/main/java/com/juick/service/component/PingEvent.java
index 45a63dd7..1dad0c2f 100644
--- a/src/main/java/com/juick/service/component/PingEvent.java
+++ b/src/main/java/com/juick/service/component/PingEvent.java
@@ -21,7 +21,7 @@ import com.juick.model.User;
import org.springframework.context.ApplicationEvent;
public class PingEvent extends ApplicationEvent {
- private User pinger;
+ private final User pinger;
/**
* Create a new ApplicationEvent.
*
diff --git a/src/main/java/com/juick/service/component/UserUpdatedEvent.java b/src/main/java/com/juick/service/component/UserUpdatedEvent.java
index f22a5a43..d2b14468 100644
--- a/src/main/java/com/juick/service/component/UserUpdatedEvent.java
+++ b/src/main/java/com/juick/service/component/UserUpdatedEvent.java
@@ -22,7 +22,7 @@ import org.springframework.context.ApplicationEvent;
import org.springframework.lang.NonNull;
public class UserUpdatedEvent extends ApplicationEvent {
- private User user;
+ private final User user;
/**
* Generated when user is updated (avatar changed, etc).
*