mirror of https://github.com/FOME-Tech/fome-fw.git
more code inspection cleanups
This commit is contained in:
parent
9293ee78b7
commit
e89cba2b67
|
@ -6,7 +6,7 @@ import java.io.IOException;
|
|||
* IO Exception which was already reported with a UI dialog
|
||||
*/
|
||||
public class ReportedIOException extends IOException {
|
||||
private IOException e;
|
||||
private final IOException e;
|
||||
|
||||
public ReportedIOException(IOException e) {
|
||||
this.e = e;
|
||||
|
|
|
@ -79,8 +79,8 @@ public class RawIniFile {
|
|||
* Immutable representation of since ini file line
|
||||
*/
|
||||
public static class Line {
|
||||
private String rawText;
|
||||
private String[] tokens;
|
||||
private final String rawText;
|
||||
private final String[] tokens;
|
||||
|
||||
private static final String namePattern = "[[\\w\\d\\s_]]+";
|
||||
private static final Pattern DIRECTIVE = Pattern.compile("#(if\\s" + namePattern + "|else|elif\\s\" + namePattern + \"|endif)");
|
||||
|
|
|
@ -240,12 +240,7 @@ public class LinkManager implements Closeable {
|
|||
@Override
|
||||
public IoStream call() {
|
||||
messageListener.postMessage(getClass(), "Opening port: " + port);
|
||||
IoStream stream = BufferedSerialIoStream.openPort(port);
|
||||
if (stream == null) {
|
||||
// error already reported
|
||||
return null;
|
||||
}
|
||||
return stream;
|
||||
return BufferedSerialIoStream.openPort(port);
|
||||
}
|
||||
};
|
||||
setConnector(new StreamConnector(this, ioStreamCallable));
|
||||
|
|
|
@ -21,7 +21,7 @@ public class SignatureHelper {
|
|||
return null;
|
||||
|
||||
String fileName = s.getHash() + ".ini";
|
||||
return new Pair("https://rusefi.com/online/ini/rusefi/" + s.getBranch() + SLASH + s.getYear() + SLASH +
|
||||
return new Pair<>("https://rusefi.com/online/ini/rusefi/" + s.getBranch() + SLASH + s.getYear() + SLASH +
|
||||
s.getMonth() + SLASH +
|
||||
s.getDay() + SLASH +
|
||||
s.getBundleTarget() + SLASH +
|
||||
|
|
|
@ -17,7 +17,7 @@ public class ChartScrollControl {
|
|||
private final JPanel content = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 0));
|
||||
private final AtomicInteger index = new AtomicInteger();
|
||||
private static final JLabel info = new JLabel();
|
||||
private ChartRepository.ChartRepositoryListener listener;
|
||||
private final ChartRepository.ChartRepositoryListener listener;
|
||||
|
||||
public ChartScrollControl(final ChartRepository.ChartRepositoryListener listener) {
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.Random;
|
||||
|
||||
public class SoftLimiterSandbox {
|
||||
private Random r = new Random();
|
||||
private final Random r = new Random();
|
||||
|
||||
public static void main(String[] args) {
|
||||
new SoftLimiterSandbox().testSoftLimit();
|
||||
|
|
|
@ -18,8 +18,7 @@ public class IoUtil2 {
|
|||
try {
|
||||
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(fileName))) {
|
||||
while (true) {
|
||||
if (!((line = reader.readLine()) != null)) break;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
stringBuilder.append(line);
|
||||
stringBuilder.append(ls);
|
||||
}
|
||||
|
|
|
@ -130,12 +130,12 @@ public class LiveDataProcessor {
|
|||
if (constexpr != null) {
|
||||
sdCardFieldsConsumer.home = constexpr;
|
||||
sdCardFieldsConsumer.isPtr = isPtr;
|
||||
state.addDestination((state1, structure) -> sdCardFieldsConsumer.handleEndStruct(state1, structure));
|
||||
state.addDestination(sdCardFieldsConsumer::handleEndStruct);
|
||||
|
||||
outputValueConsumer.currentSectionPrefix = constexpr;
|
||||
outputValueConsumer.conditional = conditional;
|
||||
outputValueConsumer.isPtr = isPtr;
|
||||
state.addDestination((state1, structure) -> outputValueConsumer.handleEndStruct(state1, structure));
|
||||
state.addDestination(outputValueConsumer::handleEndStruct);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue