mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-27 14:23:56 +00:00
addressed some sonar issues
This commit is contained in:
@@ -21,6 +21,6 @@ public class FeatureListener {
|
||||
|
||||
@EventListener
|
||||
public void handleContextRefreshEvent(ContextRefreshedEvent ctxStartEvt) {
|
||||
|
||||
// Do nothing yet, because of a race condition between features and commands
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,9 +177,4 @@ public class BotServiceBean implements BotService {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,6 +154,7 @@ public class MessageCacheBean implements MessageCache {
|
||||
reactions.add(cachedReaction);
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
log.error("Error while executing future to retrieve reaction.", e);
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
});
|
||||
return reactions;
|
||||
|
||||
@@ -42,7 +42,8 @@ public class ChannelManagementServiceBean implements ChannelManagementService {
|
||||
.build();
|
||||
return repository.save(build);
|
||||
} else {
|
||||
return loadChannel(id).get();
|
||||
Optional<AChannel> channelOptional = loadChannel(id);
|
||||
return channelOptional.orElse(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.util.HashMap;
|
||||
|
||||
public class IncorrectParameter extends AbstractoRunTimeException implements Templatable {
|
||||
|
||||
private final Command command;
|
||||
private final transient Command command;
|
||||
private final String parameterName;
|
||||
private final Class clazz;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.HashMap;
|
||||
@Getter
|
||||
public class InsufficientParameters extends AbstractoRunTimeException implements Templatable {
|
||||
|
||||
private final Command command;
|
||||
private final transient Command command;
|
||||
private final String parameterName;
|
||||
|
||||
public InsufficientParameters(String s, Command command, String parameterName) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.HashMap;
|
||||
public class ParameterTooLong extends AbstractoRunTimeException implements Templatable {
|
||||
|
||||
|
||||
private final Command command;
|
||||
private final transient Command command;
|
||||
private final String parameterName;
|
||||
private final Integer actualLength;
|
||||
private final Integer maximumLength;
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.List;
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class CachedMessage implements Serializable {
|
||||
public class CachedMessage {
|
||||
private Long serverId;
|
||||
private Long channelId;
|
||||
private Long messageId;
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.dv8tion.jda.api.entities.ChannelType;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -17,7 +18,7 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AChannel implements SnowFlake {
|
||||
public class AChannel implements SnowFlake, Serializable {
|
||||
|
||||
@Id
|
||||
@Getter
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -16,7 +17,7 @@ import java.util.Objects;
|
||||
@Getter
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AChannelGroup {
|
||||
public class AChannelGroup implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Entity
|
||||
@@ -15,7 +16,7 @@ import java.util.Objects;
|
||||
@Getter
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AChannelGroupCommand {
|
||||
public class AChannelGroupCommand implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -15,7 +16,7 @@ import java.util.Objects;
|
||||
@Getter
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AConfig {
|
||||
public class AConfig implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -3,6 +3,7 @@ package dev.sheldan.abstracto.core.models.database;
|
||||
import lombok.*;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
|
||||
@Entity
|
||||
@@ -11,7 +12,7 @@ import java.time.Instant;
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
public class ADefaultConfig {
|
||||
public class ADefaultConfig implements Serializable {
|
||||
@javax.persistence.Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Integer Id;
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -15,7 +16,7 @@ import java.util.Objects;
|
||||
@Getter
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AEmote {
|
||||
public class AEmote implements Serializable {
|
||||
|
||||
@javax.persistence.Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -16,7 +17,7 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AFeature implements SnowFlake {
|
||||
public class AFeature implements SnowFlake, Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -14,7 +15,7 @@ import java.util.Objects;
|
||||
@AllArgsConstructor
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AFeatureFlag {
|
||||
public class AFeatureFlag implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
|
||||
@Entity
|
||||
@@ -13,7 +14,7 @@ import java.time.Instant;
|
||||
@AllArgsConstructor
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AFeatureMode {
|
||||
public class AFeatureMode implements Serializable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Getter
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -16,7 +17,7 @@ import java.util.Objects;
|
||||
@Getter
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class AUser {
|
||||
public class AUser implements Serializable {
|
||||
|
||||
@Id
|
||||
private Long id;
|
||||
|
||||
@@ -4,6 +4,7 @@ import lombok.*;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -14,7 +15,7 @@ import java.util.Objects;
|
||||
@NoArgsConstructor
|
||||
@Cacheable
|
||||
@org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
|
||||
public class PostTarget {
|
||||
public class PostTarget implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
||||
@@ -32,5 +32,4 @@ public interface BotService {
|
||||
Optional<Guild> getGuildById(Long serverId);
|
||||
Guild getGuildByIdNullable(Long serverId);
|
||||
Member getBotInGuild(AServer server);
|
||||
void shutdown();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user