Fix SAT warnings (#14202)

* Fix SAT warnings

- checkstyle.ModifierOrderCheck
- checkstyle.OneStatementPerLineCheck
- checkstyle.NeedBracesCheck
- PMD.UseStandardCharsets
- PMD.UseCollectionIsEmpty
- PMD.UnusedLocalVariable
- PMD.SimplifyBooleanReturns where reasonable, suppress where
readability is better without change
- PMD.SimplifyBooleanExpressions

* Include StandardCharsets

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-01-13 08:11:06 +01:00
committed by GitHub
parent 6aa0dcbc70
commit 4e44de3894
86 changed files with 148 additions and 157 deletions

View File

@@ -33,7 +33,7 @@ import com.google.gson.JsonSyntaxException;
@NonNullByDefault
public class GreeException extends Exception {
private static final long serialVersionUID = -2337258558995287405L;
private static String EX_NONE = "none";
private static final String EX_NONE = "none";
public GreeException(@Nullable Exception exception) {
super(exception);

View File

@@ -60,7 +60,7 @@ import com.google.gson.JsonSyntaxException;
@NonNullByDefault
public class GreeAirDevice {
private final Logger logger = LoggerFactory.getLogger(GreeAirDevice.class);
private final static Gson gson = new Gson();
private static final Gson gson = new Gson();
private boolean isBound = false;
private final InetAddress ipAddress;
private int port = 0;
@@ -80,7 +80,6 @@ public class GreeAirDevice {
}
public void getDeviceStatus(DatagramSocket clientSocket) throws GreeException {
if (!isBound) {
throw new GreeException("Device not bound");
}