Java 17 features (N-S) (#15565)
- add missing @override - Java style array syntax - remove redundant modifiers - always move String constants to left side in comparisons - simplify lambda expressions and return statements - use replace instead of replaceAll w/o regex - instanceof matching and multiline strings Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -37,7 +37,7 @@ public class OpenSprinklerState {
|
||||
public List<StateOption> stations = new ArrayList<>();
|
||||
|
||||
public static class JsResponse {
|
||||
public int sn[] = new int[8];
|
||||
public int[] sn = new int[8];
|
||||
public int nstations = 8;
|
||||
}
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ public class OpenSprinklerDiscoveryService extends AbstractDiscoveryService {
|
||||
InetAddress currentIP = InetAddress.getByAddress(ByteBuffer.allocate(4).putInt(i).array());
|
||||
// Try to reach each IP with a timeout of 500ms which is enough for local network
|
||||
if (currentIP.isReachable(500)) {
|
||||
String host = currentIP.getHostAddress().toString();
|
||||
String host = currentIP.getHostAddress();
|
||||
logger.debug("Unknown device was found at: {}", host);
|
||||
discoverySearchPool.execute(new OpenSprinklerDiscoveryJob(this, host));
|
||||
}
|
||||
|
||||
@@ -47,9 +47,7 @@ public class Hash {
|
||||
sb.append(String.format("%02x", b & 0xff));
|
||||
}
|
||||
|
||||
String digest = sb.toString();
|
||||
|
||||
return digest;
|
||||
return sb.toString();
|
||||
} catch (Exception exp) {
|
||||
// Instead of null we return the unhashed password.
|
||||
return unhashed;
|
||||
|
||||
Reference in New Issue
Block a user