only:final

This commit is contained in:
rusefillc 2023-11-26 22:38:59 -05:00
parent 5405e910ff
commit 26eb5ca044
12 changed files with 16 additions and 16 deletions

View File

@ -53,7 +53,7 @@ public class BinaryProtocol {
* This properly allows to switch to non-CRC32 mode * This properly allows to switch to non-CRC32 mode
* todo: finish this feature, assuming we even need it. * todo: finish this feature, assuming we even need it.
*/ */
public static boolean PLAIN_PROTOCOL = Boolean.getBoolean(USE_PLAIN_PROTOCOL_PROPERTY); public static final boolean PLAIN_PROTOCOL = Boolean.getBoolean(USE_PLAIN_PROTOCOL_PROPERTY);
private final LinkManager linkManager; private final LinkManager linkManager;
private final IoStream stream; private final IoStream stream;
@ -105,7 +105,7 @@ public class BinaryProtocol {
public boolean isClosed; public boolean isClosed;
public CommunicationLoggingListener communicationLoggingListener; public final CommunicationLoggingListener communicationLoggingListener;
public BinaryProtocol(LinkManager linkManager, IoStream stream) { public BinaryProtocol(LinkManager linkManager, IoStream stream) {
this.linkManager = linkManager; this.linkManager = linkManager;

View File

@ -27,7 +27,7 @@ public class ConnectionStatusLogic {
} }
} }
public static ConnectionStatusLogic INSTANCE = new ConnectionStatusLogic(); public static final ConnectionStatusLogic INSTANCE = new ConnectionStatusLogic();
private final List<Listener> listeners = new CopyOnWriteArrayList<>(); private final List<Listener> listeners = new CopyOnWriteArrayList<>();
private ConnectionStatusLogic() { private ConnectionStatusLogic() {

View File

@ -37,9 +37,9 @@ public class LinkManager implements Closeable {
public static final String SOCKET_CAN = "SocketCAN"; public static final String SOCKET_CAN = "SocketCAN";
@NotNull @NotNull
public static LogLevel LOG_LEVEL = LogLevel.INFO; public static final LogLevel LOG_LEVEL = LogLevel.INFO;
public static LinkDecoder ENCODER = new LinkDecoder() { public static final LinkDecoder ENCODER = new LinkDecoder() {
@Override @Override
public String unpack(String packedLine) { public String unpack(String packedLine) {
return packedLine; return packedLine;

View File

@ -17,7 +17,7 @@ import java.io.IOException;
import static com.devexperts.logging.Logging.getLogging; import static com.devexperts.logging.Logging.getLogging;
public class SerialIoStream extends AbstractIoStream { public class SerialIoStream extends AbstractIoStream {
static Logging log = getLogging(SerialIoStream.class); static final Logging log = getLogging(SerialIoStream.class);
@Nullable // null in case of port open error, for instance lack of permissions on Unix @Nullable // null in case of port open error, for instance lack of permissions on Unix
protected final SerialPort sp; protected final SerialPort sp;

View File

@ -55,7 +55,7 @@ public class BinaryProtocolServer {
log.configureDebugEnabled(false); log.configureDebugEnabled(false);
} }
public AtomicInteger unknownCommands = new AtomicInteger(); public final AtomicInteger unknownCommands = new AtomicInteger();
public static final ServerSocketFunction SECURE_SOCKET_FACTORY = rusEFISSLContext::getSSLServerSocket; public static final ServerSocketFunction SECURE_SOCKET_FACTORY = rusEFISSLContext::getSSLServerSocket;

View File

@ -74,7 +74,7 @@ public class TcpServerSandbox {
static class EcuState { static class EcuState {
private final byte[] outputs = new byte[Fields.TS_TOTAL_OUTPUT_SIZE]; private final byte[] outputs = new byte[Fields.TS_TOTAL_OUTPUT_SIZE];
long startUpTime = System.currentTimeMillis(); final long startUpTime = System.currentTimeMillis();
public void onCommand() { public void onCommand() {
int seconds = (int) ((System.currentTimeMillis() - startUpTime) / 1000); int seconds = (int) ((System.currentTimeMillis() - startUpTime) / 1000);

View File

@ -15,8 +15,8 @@ import java.util.TreeMap;
* 2/15/2015 * 2/15/2015
*/ */
public class AverageAngles { public class AverageAngles {
static String PRIMARY = "T_PRIMARY"; static final String PRIMARY = "T_PRIMARY";
static String SECONDARY = "T_SECONDARY"; static final String SECONDARY = "T_SECONDARY";
private int count; private int count;
enum trigger_event_e { enum trigger_event_e {
@ -34,7 +34,7 @@ public class AverageAngles {
private static final int MAX_RPM_CHANGE = 20; private static final int MAX_RPM_CHANGE = 20;
private int rpmAtPrevChart; private int rpmAtPrevChart;
Map<Integer, List<AngleEvent>> angleData = new TreeMap<>(); final Map<Integer, List<AngleEvent>> angleData = new TreeMap<>();
public AverageAngles() { public AverageAngles() {
clear(); clear();

View File

@ -13,7 +13,7 @@ public class UIContext {
public SensorLogger sensorLogger = new SensorLogger(this); public SensorLogger sensorLogger = new SensorLogger(this);
public GaugesPanel.DetachedRepository DetachedRepositoryINSTANCE = new GaugesPanel.DetachedRepository(this); public GaugesPanel.DetachedRepository DetachedRepositoryINSTANCE = new GaugesPanel.DetachedRepository(this);
public SensorSnifferCentral sensorSnifferCentral = new SensorSnifferCentral(linkManager); public final SensorSnifferCentral sensorSnifferCentral = new SensorSnifferCentral(linkManager);
@NotNull @NotNull
public LinkManager getLinkManager() { public LinkManager getLinkManager() {

View File

@ -54,7 +54,7 @@ public class MainFrame {
} }
}; };
public ConnectionFailedListener listener; public final ConnectionFailedListener listener;
public MainFrame(ConsoleUI consoleUI, TabbedPanel tabbedPane) { public MainFrame(ConsoleUI consoleUI, TabbedPanel tabbedPane) {
this.consoleUI = Objects.requireNonNull(consoleUI); this.consoleUI = Objects.requireNonNull(consoleUI);

View File

@ -41,7 +41,7 @@ import javax.swing.text.DocumentFilter;
import java.awt.*; import java.awt.*;
public class DocumentSizeFilter extends DocumentFilter { public class DocumentSizeFilter extends DocumentFilter {
int maxCharacters; final int maxCharacters;
public DocumentSizeFilter(int maxChars) { public DocumentSizeFilter(int maxChars) {
maxCharacters = maxChars; maxCharacters = maxChars;

View File

@ -11,7 +11,7 @@ import java.util.List;
*/ */
public class FieldIterator { public class FieldIterator {
private final List<ConfigField> fields; private final List<ConfigField> fields;
BitState bitState = new BitState(); final BitState bitState = new BitState();
private ConfigField prev = ConfigField.VOID; private ConfigField prev = ConfigField.VOID;
ConfigField next; ConfigField next;
ConfigField cf; ConfigField cf;

View File

@ -40,7 +40,7 @@ public class VariableRegistry {
private final Pattern VAR = Pattern.compile("(@@(.*?)@@)"); private final Pattern VAR = Pattern.compile("(@@(.*?)@@)");
private final Pattern VAR_REMOVE_QUOTE = Pattern.compile("(@#(.*?)#@)"); private final Pattern VAR_REMOVE_QUOTE = Pattern.compile("(@#(.*?)#@)");
public Map<String, Integer> intValues = new HashMap<>(); public final Map<String, Integer> intValues = new HashMap<>();
private final Map<String, String> cAllDefinitions = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); private final Map<String, String> cAllDefinitions = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
// todo: move thid logic to JavaFieldsConsumer since that's the consumer? // todo: move thid logic to JavaFieldsConsumer since that's the consumer?