Java 17 features (T-Z) (#15576)

- 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
- remove null check before instanceof

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich
2023-09-21 07:58:53 +02:00
committed by GitHub
parent bf1aa3deb2
commit 1b122a53b9
277 changed files with 1402 additions and 1298 deletions

View File

@@ -93,8 +93,7 @@ public final class AnalogMessage extends Message {
public AnalogValue getAnalogValue(int portNumber) {
// Get the internal index for portNumber within the message
int idx = (portNumber - 1) % 4;
AnalogValue value = new AnalogValue(this.getValue(idx), getMeasureType(idx));
return value;
return new AnalogValue(this.getValue(idx), getMeasureType(idx));
}
/**

View File

@@ -26,7 +26,7 @@ import org.openhab.core.types.State;
@NonNullByDefault
public class ApiPageEntry {
static enum Type {
enum Type {
READ_ONLY_SWITCH(true),
READ_ONLY_NUMERIC(true),
NUMERIC_FORM(false),

View File

@@ -30,7 +30,7 @@ public class ChangerX2Entry {
public static final String NUMBER_MAX = "max";
public static final String NUMBER_STEP = "step";
static enum OptionType {
enum OptionType {
NUMBER,
SELECT,
}