Java 17 features (H-M) (#15520)
- 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:
@@ -149,7 +149,7 @@ public class Tailer implements Runnable {
|
||||
/**
|
||||
* Buffer on top of RandomAccessFile.
|
||||
*/
|
||||
private final byte inbuf[];
|
||||
private final byte[] inbuf;
|
||||
|
||||
/**
|
||||
* The file which will be tailed.
|
||||
|
||||
@@ -184,7 +184,7 @@ public class LogHandler extends BaseThingHandler implements FileReaderListener {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(thing.getStatus() == ThingStatus.ONLINE)) {
|
||||
if (thing.getStatus() != ThingStatus.ONLINE) {
|
||||
updateStatus(ThingStatus.ONLINE);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ public class SearchEngine {
|
||||
private List<Pattern> compilePatterns(@Nullable String patterns) throws PatternSyntaxException {
|
||||
List<Pattern> patternsList = new ArrayList<>();
|
||||
if (patterns != null && !patterns.isEmpty()) {
|
||||
String list[] = patterns.split("\\|");
|
||||
String[] list = patterns.split("\\|");
|
||||
if (list.length > 0) {
|
||||
for (String patternStr : list) {
|
||||
patternsList.add(Pattern.compile(patternStr));
|
||||
|
||||
Reference in New Issue
Block a user