only: refactoring: get rid of redundant class instantiation when we need just call a static method
This commit is contained in:
parent
07ce7f5691
commit
c7fefcef25
|
@ -77,12 +77,9 @@ public class DfuFlasher {
|
|||
callbacks.logLine("Using selected " + port + "\n");
|
||||
IoStream stream = BufferedSerialIoStream.openPort(port);
|
||||
AtomicReference<String> signature = new AtomicReference<>();
|
||||
new SerialAutoChecker(PortDetector.DetectorMode.DETECT_TS, port, new CountDownLatch(1)).checkResponse(stream, new Function<SerialAutoChecker.CallbackContext, Void>() {
|
||||
@Override
|
||||
public Void apply(SerialAutoChecker.CallbackContext callbackContext) {
|
||||
signature.set(callbackContext.getSignature());
|
||||
return null;
|
||||
}
|
||||
SerialAutoChecker.checkResponse(stream, callbackContext -> {
|
||||
signature.set(callbackContext.getSignature());
|
||||
return null;
|
||||
});
|
||||
if (signature.get() == null) {
|
||||
callbacks.appendLine("");
|
||||
|
|
Loading…
Reference in New Issue