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

@@ -12,7 +12,6 @@
*/
package org.openhab.binding.xmppclient.internal;
import java.util.Collections;
import java.util.Set;
import org.openhab.binding.xmppclient.internal.handler.XMPPClientHandler;
@@ -32,8 +31,8 @@ import org.osgi.service.component.annotations.Component;
*/
@Component(configurationPid = "binding.xmppclient", service = ThingHandlerFactory.class)
public class XMPPClientHandlerFactory extends BaseThingHandlerFactory {
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections
.singleton(XMPPClientBindingConstants.BRIDGE_TYPE_XMPP);
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set
.of(XMPPClientBindingConstants.BRIDGE_TYPE_XMPP);
@Override
public boolean supportsThingType(ThingTypeUID thingTypeUID) {

View File

@@ -14,9 +14,9 @@ package org.openhab.binding.xmppclient.internal.handler;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.jivesoftware.smack.SmackException;
@@ -57,7 +57,7 @@ public class XMPPClientHandler extends BaseBridgeHandler {
@Override
public Collection<Class<? extends ThingHandlerService>> getServices() {
return Collections.singleton(XMPPActions.class);
return Set.of(XMPPActions.class);
}
@Override