diff --git a/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java b/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java index 8a7fe7ff11..e71f893557 100644 --- a/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java +++ b/java_console/io/src/main/java/com/rusefi/binaryprotocol/BinaryProtocol.java @@ -130,7 +130,7 @@ public class BinaryProtocol { public boolean isClosed; - public CommunicationLoggingListener communicationLoggingListener = CommunicationLoggingListener.VOID; + public CommunicationLoggingListener communicationLoggingListener; public byte[] getCurrentOutputs() { return state.getCurrentOutputs(); @@ -282,7 +282,7 @@ public class BinaryProtocol { if (needCompositeLogger) { getComposite(); } else if (isCompositeLoggerEnabled) { - byte packet[] = new byte[2]; + byte[] packet = new byte[2]; packet[0] = Fields.TS_SET_LOGGER_SWITCH; packet[1] = Fields.TS_COMPOSITE_DISABLE; executeCommand(packet, "disable composite"); @@ -614,7 +614,7 @@ public class BinaryProtocol { if (isClosed) return; - byte packet[] = new byte[1]; + byte[] packet = new byte[1]; packet[0] = Fields.TS_GET_COMPOSITE_BUFFER_DONE_DIFFERENTLY; // get command would enable composite logging in controller but we need to turn it off from our end // todo: actually if console gets disconnected composite logging might end up enabled in controller? diff --git a/java_console/io/src/main/java/com/rusefi/io/ByteReader.java b/java_console/io/src/main/java/com/rusefi/io/ByteReader.java index ffcffc67f3..b051e8e8c8 100644 --- a/java_console/io/src/main/java/com/rusefi/io/ByteReader.java +++ b/java_console/io/src/main/java/com/rusefi/io/ByteReader.java @@ -27,7 +27,7 @@ public interface ByteReader { threadExecutor.execute(() -> { log.info(loggingPrefix + "Running TCP connection loop"); - byte inputBuffer[] = new byte[Fields.BLOCKING_FACTOR * 2]; + byte[] inputBuffer = new byte[Fields.BLOCKING_FACTOR * 2]; while (!ioStream.isClosed()) { try { int result = reader.read(inputBuffer); diff --git a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java index 7b96bea800..ce68a25fd8 100644 --- a/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java +++ b/java_console/io/src/main/java/com/rusefi/io/tcp/BinaryProtocolServer.java @@ -60,7 +60,7 @@ public class BinaryProtocolServer { return serverSocket; }; - private static ConcurrentHashMap THREAD_FACTORIES_BY_NAME = new ConcurrentHashMap<>(); + private final static ConcurrentHashMap THREAD_FACTORIES_BY_NAME = new ConcurrentHashMap<>(); public void start(LinkManager linkManager) { try { diff --git a/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/IoHelperTest.java b/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/IoHelperTest.java index 0e0ca31d1a..65a147c141 100644 --- a/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/IoHelperTest.java +++ b/java_console/io/src/test/java/com/rusefi/binaryprotocol/test/IoHelperTest.java @@ -17,7 +17,7 @@ public class IoHelperTest { @Test public void testSwap16() throws IOException { - byte packet[] = {-12, 0}; + byte[] packet = {-12, 0}; DataInputStream dis = new DataInputStream(new ByteArrayInputStream(packet)); short a = dis.readShort(); int x = IoHelper.swap16(a); diff --git a/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java b/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java index 2e31e646ff..371d392dbc 100644 --- a/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java +++ b/java_console/ui/src/main/java/com/rusefi/ConsoleUI.java @@ -56,7 +56,7 @@ public class ConsoleUI { /** * We can listen to tab activation event if we so desire */ - private final Map tabSelectedListeners = new HashMap<>(); + private final Map tabSelectedListeners = new HashMap<>(); public static Frame getFrame() { return staticFrame; diff --git a/java_console/ui/src/main/java/com/rusefi/EcuStimulator.java b/java_console/ui/src/main/java/com/rusefi/EcuStimulator.java index 91f028423f..d57127b0f9 100644 --- a/java_console/ui/src/main/java/com/rusefi/EcuStimulator.java +++ b/java_console/ui/src/main/java/com/rusefi/EcuStimulator.java @@ -29,8 +29,6 @@ import java.util.concurrent.CountDownLatch; /** * Date: 3/24/13 * Andrey Belomutskiy, (c) 2013-2020 - * - * @see EcuStimulatorSandbox */ public class EcuStimulator { private static final String DELIMITER = ","; @@ -308,7 +306,7 @@ public class EcuStimulator { return result; } - private class MultipleMeasurements { + private static class MultipleMeasurements { private List dwells = new ArrayList<>(MEASURES); private List advances = new ArrayList<>(MEASURES); diff --git a/java_console/ui/src/main/java/com/rusefi/Histograms.java b/java_console/ui/src/main/java/com/rusefi/Histograms.java index 85c434673f..e8dcae54fe 100644 --- a/java_console/ui/src/main/java/com/rusefi/Histograms.java +++ b/java_console/ui/src/main/java/com/rusefi/Histograms.java @@ -34,8 +34,8 @@ public final class Histograms { @NotNull public List dumpStats() { Collection values = takeAndResetSnapshot(); - List al = new ArrayList<>(); - al.addAll(values); + List al = new ArrayList<>(values); + synchronized (total_stats) { for (StatisticsGroup source : values) { String type = source.type + ".TOTAL"; @@ -368,7 +368,7 @@ public final class Histograms { private String toString(StatisticsGroup sg, long duration) { StringBuffer sb = new StringBuffer(100 + sg.data.size() * 100); appendHeader(sb, sg, duration); - Statistics[] sts = sg.data.values().toArray(new Statistics[sg.data.size()]); + Statistics[] sts = sg.data.values().toArray(new Statistics[0]); sortStatistics(sg, sts); for (Statistics st : sts) { appendStatistics(sb, st, new ArrayList<>()); diff --git a/java_console/ui/src/main/java/com/rusefi/KeyStrokeShortcut.java b/java_console/ui/src/main/java/com/rusefi/KeyStrokeShortcut.java index df8b0f2549..4f7cd27854 100644 --- a/java_console/ui/src/main/java/com/rusefi/KeyStrokeShortcut.java +++ b/java_console/ui/src/main/java/com/rusefi/KeyStrokeShortcut.java @@ -4,5 +4,5 @@ public enum KeyStrokeShortcut { PREVIOUS_PAGE, NEXT_PAGE, ZOOM_IN, - ZOOM_OUT; + ZOOM_OUT } diff --git a/java_console/ui/src/main/java/com/rusefi/ReportReader.java b/java_console/ui/src/main/java/com/rusefi/ReportReader.java index bdb4fd7bc1..db3bae2b04 100644 --- a/java_console/ui/src/main/java/com/rusefi/ReportReader.java +++ b/java_console/ui/src/main/java/com/rusefi/ReportReader.java @@ -134,10 +134,10 @@ public class ReportReader { // System.out.println(line); Matcher m = LINE_PATTERN.matcher(line); if (m.matches()) { - int time = Integer.valueOf(m.group(1)); + int time = Integer.parseInt(m.group(1)); MafValue maf = MafValue.valueOf(m.group(2)); RpmValue rpm = RpmValue.valueOf(m.group(3)); - int wave = Integer.valueOf(m.group(4)); + int wave = Integer.parseInt(m.group(4)); if (prevMaf == maf.getValue() && prevRpm == rpm.getValue() && prevWave == wave) { // System.out.println("All the same..."); diff --git a/java_console/ui/src/main/java/com/rusefi/SensorSnifferPane.java b/java_console/ui/src/main/java/com/rusefi/SensorSnifferPane.java index 4f2d579fa8..2dfa387d69 100644 --- a/java_console/ui/src/main/java/com/rusefi/SensorSnifferPane.java +++ b/java_console/ui/src/main/java/com/rusefi/SensorSnifferPane.java @@ -130,8 +130,7 @@ public class SensorSnifferPane { maxX = keys.get(keys.size() - 1); FileLog.MAIN.logLine("Analog chart from " + minX + " to " + maxX); - TreeSet sortedValues = new TreeSet<>(); - sortedValues.addAll(values.values()); + TreeSet sortedValues = new TreeSet<>(values.values()); List values = new ArrayList<>(sortedValues); minY = values.get(0); diff --git a/java_console/ui/src/main/java/com/rusefi/StimulationInputs.java b/java_console/ui/src/main/java/com/rusefi/StimulationInputs.java index b481889724..7868777571 100644 --- a/java_console/ui/src/main/java/com/rusefi/StimulationInputs.java +++ b/java_console/ui/src/main/java/com/rusefi/StimulationInputs.java @@ -19,8 +19,6 @@ public class StimulationInputs { private final ValueRangeControl rpmRange = new ValueRangeControl("RPM", DEFAULT_RPM_MIN, 413.333374, DEFAULT_RPM_MAX); private final ValueRangeControl cltRange = new ValueRangeControl("CLR r", 100, 100, 100); - private final ValueRangeControl iatRange = new ValueRangeControl("IAT r", 100, 100, 9900); - private final ValueRangeControl tpsRange = new ValueRangeControl("TPS", 1, 0.1, 4.5); public StimulationInputs(EcuStimulator ecuStimulator) { @@ -32,7 +30,9 @@ public class StimulationInputs { content.add(rpmRange.getContent()); content.add(elRange.getContent()); content.add(cltRange.getContent()); + ValueRangeControl iatRange = new ValueRangeControl("IAT r", 100, 100, 9900); content.add(iatRange.getContent()); + ValueRangeControl tpsRange = new ValueRangeControl("TPS", 1, 0.1, 4.5); content.add(tpsRange.getContent()); content.add(new JLabel("EL resistance")); diff --git a/java_console/ui/src/main/java/com/rusefi/TriggerImage.java b/java_console/ui/src/main/java/com/rusefi/TriggerImage.java index 6e53a5fb05..e35efaf342 100644 --- a/java_console/ui/src/main/java/com/rusefi/TriggerImage.java +++ b/java_console/ui/src/main/java/com/rusefi/TriggerImage.java @@ -239,7 +239,7 @@ public class TriggerImage { @NotNull private static JPanel createWheelPanel(List wheel, boolean showTdc, TriggerWheelInfo shape) { - JPanel clock = new JPanel() { + return new JPanel() { @Override public void paint(Graphics g) { super.paint(g); @@ -297,8 +297,6 @@ public class TriggerImage { return new Dimension(WHEEL_DIAMETER + 2 * WHEEL_BORDER, WHEEL_DIAMETER + 2 * WHEEL_BORDER); } }; -// clock.setBackground(Color.orange); - return clock; } private static double arcToRusEFI(double angle) { diff --git a/java_console/ui/src/main/java/com/rusefi/ui/GaugesPanel.java b/java_console/ui/src/main/java/com/rusefi/ui/GaugesPanel.java index 095460a6f8..74f1ac27f9 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/GaugesPanel.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/GaugesPanel.java @@ -139,21 +139,15 @@ public class GaugesPanel { JPanel rightUpperPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0)); final JPopupMenu selectorMenu = new JPopupMenu(); - selectorMenu.add(new SizeSelectorPanel(new SizeSelectorPanel.SizeSelectorListener() { - @Override - public void onSelected(int row, int column) { - System.out.println("new size " + row + "/" + column); - setSensorGridDimensions(row, column); - } + selectorMenu.add(new SizeSelectorPanel((row, column) -> { + System.out.println("new size " + row + "/" + column); + setSensorGridDimensions(row, column); })); JButton selector = new JButton("O"); - selector.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - Component c = (Component) e.getSource(); - selectorMenu.show(c, -1, c.getHeight()); - } + selector.addActionListener(e -> { + Component c = (Component) e.getSource(); + selectorMenu.show(c, -1, c.getHeight()); }); rightUpperPanel.add(selector); @@ -166,29 +160,23 @@ public class GaugesPanel { private JPopupMenu createMenu(final Node config) { JPopupMenu menu = new JPopupMenu(); final JCheckBoxMenuItem saveDetailedLogs = new JCheckBoxMenuItem("Save detailed logs"); - saveDetailedLogs.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - FileLog.suspendLogging = !saveDetailedLogs.isSelected(); - getConfig().getRoot().setBoolProperty(DISABLE_LOGS, FileLog.suspendLogging); - } + saveDetailedLogs.addActionListener(e -> { + FileLog.suspendLogging = !saveDetailedLogs.isSelected(); + getConfig().getRoot().setBoolProperty(DISABLE_LOGS, FileLog.suspendLogging); }); saveDetailedLogs.setSelected(!FileLog.suspendLogging); final JCheckBoxMenuItem showRpmItem = new JCheckBoxMenuItem("Show RPM"); final JCheckBoxMenuItem showCommandsItem = new JCheckBoxMenuItem("Show Commands"); showRpmItem.setSelected(showRpmPanel); - ActionListener showCheckboxListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - showRpmPanel = showRpmItem.isSelected(); - showMessagesPanel = showCommandsItem.isSelected(); - config.setProperty(SHOW_RPM, showRpmPanel); - config.setProperty(SHOW_MESSAGES, showMessagesPanel); - applyShowFlags(); - // todo: this is not needed if we show/hide RPM panel. TODO: split into two different listeners - middleSplitPanel.setDividerLocation(0.5); - } + ActionListener showCheckboxListener = e -> { + showRpmPanel = showRpmItem.isSelected(); + showMessagesPanel = showCommandsItem.isSelected(); + config.setProperty(SHOW_RPM, showRpmPanel); + config.setProperty(SHOW_MESSAGES, showMessagesPanel); + applyShowFlags(); + // todo: this is not needed if we show/hide RPM panel. TODO: split into two different listeners + middleSplitPanel.setDividerLocation(0.5); }; showRpmItem.addActionListener(showCheckboxListener); showCommandsItem.addActionListener(showCheckboxListener); @@ -232,13 +220,10 @@ public class GaugesPanel { @NotNull private JButton createSaveImageButton() { JButton saveImageButton = UiUtils.createSaveImageButton(); - saveImageButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - String fileName = Logger.getDate() + "_gauges.png"; + saveImageButton.addActionListener(e -> { + String fileName = Logger.getDate() + "_gauges.png"; - UiUtils.saveImageWithPrompt(fileName, content, gauges.panel); - } + UiUtils.saveImageWithPrompt(fileName, content, gauges.panel); }); return saveImageButton; } diff --git a/java_console/ui/src/main/java/com/rusefi/ui/Live3DReport.java b/java_console/ui/src/main/java/com/rusefi/ui/Live3DReport.java index 509713ea43..b4a6df8a8b 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/Live3DReport.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/Live3DReport.java @@ -49,9 +49,9 @@ public class Live3DReport { if (v.length != 3) return; - int rpm = Integer.valueOf(v[0]); - float key = Integer.valueOf(v[1]) / 100.0f; - float value = Integer.valueOf(v[2]) / 100.0f; + int rpm = Integer.parseInt(v[0]); + float key = Integer.parseInt(v[1]) / 100.0f; + float value = Integer.parseInt(v[2]) / 100.0f; primary.setPoint(new Point3D(rpm, key, value)); primary.saveToFile("_mult.csv"); diff --git a/java_console/ui/src/main/java/com/rusefi/ui/RecentCommands.java b/java_console/ui/src/main/java/com/rusefi/ui/RecentCommands.java index ac17f015e2..983ee7be09 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/RecentCommands.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/RecentCommands.java @@ -185,8 +185,7 @@ public class RecentCommands { }); synchronized (entries) { - Set sorted = new TreeSet<>(); - sorted.addAll(entries.keySet()); + Set sorted = new TreeSet<>(entries.keySet()); for (Entry entry : sorted) { content.add(createButton(uiContext, reentrant, entry.command)); diff --git a/java_console/ui/src/main/java/com/rusefi/ui/SensorLiveGraph.java b/java_console/ui/src/main/java/com/rusefi/ui/SensorLiveGraph.java index 0aa99ceae2..55a472ee19 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/SensorLiveGraph.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/SensorLiveGraph.java @@ -32,7 +32,7 @@ public class SensorLiveGraph extends JPanel { private final Node config; private final JMenuItem extraItem; @NotNull - private ChangePeriod period = ChangePeriod._100; + private ChangePeriod period; private Sensor sensor; private boolean autoScale; private double customUpper; diff --git a/java_console/ui/src/main/java/com/rusefi/ui/SizeSelectorPanel.java b/java_console/ui/src/main/java/com/rusefi/ui/SizeSelectorPanel.java index 68b1e15a5c..bcd9696a52 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/SizeSelectorPanel.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/SizeSelectorPanel.java @@ -14,8 +14,6 @@ public class SizeSelectorPanel extends JPanel { public static final int WIDTH = 5; public static final int HEIGHT = 3; - private List elements = new ArrayList<>(); - private int selectedRow = 1; private int selectedColumn = 1; @@ -41,12 +39,11 @@ public class SizeSelectorPanel extends JPanel { sizeSelectorListener.onSelected(selected.row, selected.column); } }; -// addMouseListener(listener); + for (int r = 1; r <= HEIGHT; r++) { for (int c = 1; c <= WIDTH; c++) { Element e = new Element(r, c); e.addMouseListener(listener); - elements.add(e); add(e); } } diff --git a/java_console/ui/src/main/java/com/rusefi/ui/StatusWindow.java b/java_console/ui/src/main/java/com/rusefi/ui/StatusWindow.java index 7412ec001b..50636af8d9 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/StatusWindow.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/StatusWindow.java @@ -19,17 +19,17 @@ public class StatusWindow implements StatusConsumer { private final JTextArea logTextArea = new JTextArea(); private final JPanel content = new JPanel(new BorderLayout()); private final JLabel bottomStatusLabel = new JLabel(); - private final JScrollPane messagesScroll = new JScrollPane(logTextArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) { - @Override - public Dimension getPreferredSize() { - return new Dimension(400, 400); - } - }; @NotNull protected final FrameHelper frameHelper = new FrameHelper(); public StatusWindow() { logTextArea.setLineWrap(true); + JScrollPane messagesScroll = new JScrollPane(logTextArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED) { + @Override + public Dimension getPreferredSize() { + return new Dimension(400, 400); + } + }; content.add(messagesScroll, BorderLayout.CENTER); content.add(bottomStatusLabel, BorderLayout.SOUTH); } diff --git a/java_console/ui/src/main/java/com/rusefi/ui/Wizard.java b/java_console/ui/src/main/java/com/rusefi/ui/Wizard.java index cae441ae07..d41bd78495 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/Wizard.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/Wizard.java @@ -27,7 +27,7 @@ public class Wizard { Component getContent(); } - abstract class WizardStepImpl implements WizardStep { + abstract static class WizardStepImpl implements WizardStep { protected WizardStep nextStep; public WizardStepImpl() { diff --git a/java_console/ui/src/main/java/com/rusefi/ui/engine/UpDownImage.java b/java_console/ui/src/main/java/com/rusefi/ui/engine/UpDownImage.java index 2cfd4b76b8..9e333e6a0d 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/engine/UpDownImage.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/engine/UpDownImage.java @@ -30,7 +30,6 @@ import java.util.Date; */ public class UpDownImage extends JPanel { private static final int TIMESCALE_MULT = (int) (20 * EngineReport.ENGINE_SNIFFER_TICKS_PER_MS); // 20ms - private static final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss"); private static final int LINE_SIZE = 20; public static final Color TIME_SCALE_COLOR = Color.red; public static final Color ENGINE_CYCLE_COLOR = new Color(0, 153, 0); @@ -55,13 +54,6 @@ public class UpDownImage extends JPanel { private Color signalBody = Color.lightGray; private Color signalBorder = Color.GRAY; - private final Timer repaintTimer = new Timer(1000, new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - UiUtils.trueRepaint(UpDownImage.this); - } - }); - private boolean renderText = true; public void setRenderText(boolean renderText) { @@ -174,7 +166,6 @@ public class UpDownImage extends JPanel { g2.setColor(Color.black); int line = 0; - Font f = getFont(); if (!this.renderText) { return; @@ -277,7 +268,7 @@ public class UpDownImage extends JPanel { return; } - int duration = upDown.getDuration(); + final int duration = upDown.getDuration(); // don't render duration for zero duration or for trigger if (duration != 0 && upDown.upTriggerCycleIndex == -1) { @@ -286,13 +277,14 @@ public class UpDownImage extends JPanel { g.drawString(durationString, x1, 15); } - g.setColor(Color.darkGray); if (upDown.upTriggerCycleIndex != -1) { + g.setColor(Color.darkGray); g.drawString("" + upDown.upTriggerCycleIndex, x1, (int) (0.25 * d.height)); } // Skip second index if invalid or equal to start index if (upDown.downTriggerCycleIndex != -1 && upDown.upTriggerCycleIndex != upDown.downTriggerCycleIndex) { + g.setColor(Color.darkGray); g.drawString("" + upDown.downTriggerCycleIndex, x2, (int) (0.25 * d.height)); } diff --git a/java_console/ui/src/main/java/com/rusefi/ui/widgets/DetachedSensor.java b/java_console/ui/src/main/java/com/rusefi/ui/widgets/DetachedSensor.java index e0a5ba4ac4..cef9b8c249 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/widgets/DetachedSensor.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/widgets/DetachedSensor.java @@ -29,9 +29,7 @@ import java.util.concurrent.atomic.AtomicReference; public class DetachedSensor { private static final String NAME = "name"; private static final String WIDTH = "width"; - /** - * @see Fields#MOCK_IAT_COMMAND - */ + private static final Collection MOCKABLE = Arrays.asList( Sensor.CLT, Sensor.Lambda, diff --git a/java_console/ui/src/main/java/com/rusefi/ui/widgets/MafCommand.java b/java_console/ui/src/main/java/com/rusefi/ui/widgets/MafCommand.java index 63f0f73a40..581d12b227 100644 --- a/java_console/ui/src/main/java/com/rusefi/ui/widgets/MafCommand.java +++ b/java_console/ui/src/main/java/com/rusefi/ui/widgets/MafCommand.java @@ -17,7 +17,7 @@ public class MafCommand extends JPanel { setBorder(BorderFactory.createLineBorder(Color.BLACK)); setLayout(new FlowLayout(FlowLayout.LEFT)); add(new JLabel("MAF: ")); - final JSpinner maf = new JSpinner(new SpinnerNumberModel(Double.valueOf(1.5), null, null, Double.valueOf(0.11))) { + final JSpinner maf = new JSpinner(new SpinnerNumberModel(1.5, null, null, 0.11)) { @Override public Dimension getPreferredSize() { Dimension size = super.getPreferredSize(); diff --git a/java_console/ui/src/test/java/com/rusefi/livedata/LiveDataParserSandbox.java b/java_console/ui/src/test/java/com/rusefi/livedata/LiveDataParserSandbox.java index 3d1ca034be..638e3418d8 100644 --- a/java_console/ui/src/test/java/com/rusefi/livedata/LiveDataParserSandbox.java +++ b/java_console/ui/src/test/java/com/rusefi/livedata/LiveDataParserSandbox.java @@ -27,12 +27,11 @@ public class LiveDataParserSandbox { @Nullable public static VariableValueSource getVariableValueSource(Map values) { - VariableValueSource valueSource = name -> { + return name -> { Double value = values.get(name); if (value == null) return null; return new VariableValueSource.VariableState(new Field(name, 0, FieldType.BIT), value); }; - return valueSource; } } diff --git a/java_console/ui/src/test/java/com/rusefi/ui/TuneReadWriteTest.java b/java_console/ui/src/test/java/com/rusefi/ui/TuneReadWriteTest.java index 256d32162f..3a0ff8224c 100644 --- a/java_console/ui/src/test/java/com/rusefi/ui/TuneReadWriteTest.java +++ b/java_console/ui/src/test/java/com/rusefi/ui/TuneReadWriteTest.java @@ -69,13 +69,13 @@ public class TuneReadWriteTest { assertEquals("2", flow.getDigits()); Constant nonEmptyFormula = tuneFromBinary.findPage().findParameter("fsioFormulas1"); - assertNotNull(nonEmptyFormula);; + assertNotNull(nonEmptyFormula); /** * Empty strings values should be omitted from the tune */ Constant emptyFormula = tuneFromBinary.findPage().findParameter("fsioFormulas2"); - assertNull(emptyFormula);; + assertNull(emptyFormula); Constant enumField = tuneFromBinary.findPage().findParameter("acRelayPin"); // quotes are expected