code inspection cleanups

This commit is contained in:
Matthew Kennedy 2023-10-31 01:08:12 -07:00
parent 56abb0c3b6
commit e506b69f4a
8 changed files with 8 additions and 26 deletions

View File

@ -1,14 +0,0 @@
package com.rusefi.autoupdate;
import java.io.IOException;
/**
* IO Exception which was already reported with a UI dialog
*/
public class ReportedIOException extends IOException {
private final IOException e;
public ReportedIOException(IOException e) {
this.e = e;
}
}

View File

@ -34,7 +34,6 @@ public class IniFileModel {
public Map<String, String> tooltips = new TreeMap<>();
public Map<String, String> protocolMeta = new TreeMap<>();
private boolean isConstantsSection;
private String currentSection;
public static void main(String[] args) {
log.info("Dialogs: " + IniFileModel.getInstance().dialogs);
@ -143,7 +142,6 @@ public class IniFileModel {
if (first.startsWith("[") && first.endsWith("]")) {
log.info("Section " + first);
currentSection = first;
isConstantsSection = first.equals("[Constants]");
}

View File

@ -215,10 +215,11 @@ public class BinaryProtocol {
// FileLog.rlog("queue: " + LinkManager.COMMUNICATION_QUEUE.toString());
if (linkManager.COMMUNICATION_QUEUE.isEmpty() && linkManager.getNeedPullData()) {
linkManager.submit(new Runnable() {
private final boolean verbose = false; // todo: programmatically detect run under gradle?
@Override
public void run() {
isGoodOutputChannels = requestOutputChannels();
// todo: programmatically detect run under gradle?
boolean verbose = false;
if (verbose)
System.out.println("requestOutputChannels " + isGoodOutputChannels);
if (isGoodOutputChannels)

View File

@ -55,7 +55,7 @@ public class Entry {
int ch4 = in.read();
if ((ch1 | ch2 | ch3 | ch4) < 0)
throw new EOFException();
return ((ch4 << 24) + (ch3 << 16) + (ch2 << 8) + (ch1 << 0));
return ((ch4 << 24) + (ch3 << 16) + (ch2 << 8) + ch1);
}

View File

@ -32,7 +32,6 @@ public class PerfJsonOutputTest {
",{\"name\":\"hello2\",\"ph\":\"B\",\"tid\":0,\"pid\":0,\"ts\":0.2}\n" +
",{\"name\":\"hello2\",\"ph\":\"E\",\"tid\":0,\"pid\":0,\"ts\":0.3}\n" +
",{\"name\":\"hello\",\"ph\":\"E\",\"tid\":0,\"pid\":0,\"ts\":0.4}\n" +
"]}", new String(baos.toByteArray()));
"]}", baos.toString());
}
}

View File

@ -151,7 +151,7 @@ public enum SerialPortScanner {
}
// two steps to avoid ConcurrentModificationException
toRemove.stream().forEach(portCache::remove);
toRemove.forEach(portCache::remove);
}
boolean hasAnyEcu = ecuCount > 0;

View File

@ -12,7 +12,6 @@ public class StructLayout extends Layout {
public final String typeName;
private final String name;
private final String comment;
private final Boolean noPrefix;
private final int size;
@ -46,7 +45,9 @@ public class StructLayout extends Layout {
this.typeName = parsedStruct.name;
this.name = name;
this.comment = parsedStruct.comment;
// TODO: should comment be used?
String comment = parsedStruct.comment;
this.noPrefix = parsedStruct.noPrefix;
int initialOffest = offset;

View File

@ -14,8 +14,6 @@ import org.jetbrains.annotations.NotNull;
* Configuration consumer which writes C header file
*/
public class CHeaderConsumer extends BaseCHeaderConsumer {
@NotNull
private final ReaderStateImpl state;
/**
* looks like sometimes we want to not include "define XXX value" into generated C headers
* TODO: document the use-case better
@ -26,7 +24,6 @@ public class CHeaderConsumer extends BaseCHeaderConsumer {
public CHeaderConsumer(ReaderStateImpl state, String destCHeader, boolean withC_Defines) {
this.variableRegistry = state.getVariableRegistry();
this.state = state;
this.withC_Defines = withC_Defines;
SystemOut.println("Writing C header to " + destCHeader);
cHeader = new LazyFile(destCHeader);