Bump spotless to 2.35 and Eclipse Java Formatter to 4.26 (#14645)

Signed-off-by: Jan N. Klug <github@klug.nrw>
This commit is contained in:
J-N-K 2023-03-21 21:03:05 +01:00 committed by GitHub
parent b47a205f44
commit 8e902f6324
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 110 additions and 115 deletions

View File

@ -137,10 +137,10 @@ public class SensorThermostatThingHandler extends SensorBaseThingHandler {
String mode = thermostatMode != null ? thermostatMode.name() : ThermostatMode.UNKNOWN.name();
switch (channelUID.getId()) {
case CHANNEL_THERMOSTAT_LOCKED -> updateSwitchChannel(channelUID, newConfig.locked);
case CHANNEL_HEATSETPOINT -> updateQuantityTypeChannel(channelUID, newConfig.heatsetpoint, CELSIUS,
1.0 / 100);
case CHANNEL_TEMPERATURE_OFFSET -> updateQuantityTypeChannel(channelUID, newConfig.offset, CELSIUS,
1.0 / 100);
case CHANNEL_HEATSETPOINT ->
updateQuantityTypeChannel(channelUID, newConfig.heatsetpoint, CELSIUS, 1.0 / 100);
case CHANNEL_TEMPERATURE_OFFSET ->
updateQuantityTypeChannel(channelUID, newConfig.offset, CELSIUS, 1.0 / 100);
case CHANNEL_THERMOSTAT_MODE -> updateState(channelUID, new StringType(mode));
case CHANNEL_EXTERNAL_WINDOW_OPEN -> {
Boolean open = newConfig.externalwindowopen;

View File

@ -157,8 +157,8 @@ public class SensorThingHandler extends SensorBaseThingHandler {
case CHANNEL_VIBRATION -> updateSwitchChannel(channelUID, newState.vibration);
case CHANNEL_CARBONMONOXIDE -> updateSwitchChannel(channelUID, newState.carbonmonoxide);
case CHANNEL_AIRQUALITY -> updateStringChannel(channelUID, newState.airquality);
case CHANNEL_AIRQUALITYPPB -> updateQuantityTypeChannel(channelUID, newState.airqualityppb,
PARTS_PER_BILLION);
case CHANNEL_AIRQUALITYPPB ->
updateQuantityTypeChannel(channelUID, newState.airqualityppb, PARTS_PER_BILLION);
case CHANNEL_MOISTURE -> updateQuantityTypeChannel(channelUID, newState.moisture, PERCENT);
case CHANNEL_BUTTON -> updateDecimalTypeChannel(channelUID, newState.buttonevent);
case CHANNEL_BUTTONEVENT -> {

View File

@ -162,7 +162,8 @@ public class DsDeviceThingTypeProvider extends BaseDsI18n implements ThingTypePr
channelDefinitions.add(new ChannelDefinitionBuilder(
DsChannelTypeProvider.getMeteringChannelID(meteringType, MeteringUnitsEnum.WH, false),
new ChannelTypeUID(DigitalSTROMBindingConstants.BINDING_ID, DsChannelTypeProvider
.getMeteringChannelID(meteringType, MeteringUnitsEnum.WH, false))).build());
.getMeteringChannelID(meteringType, MeteringUnitsEnum.WH, false)))
.build());
}
thingTypeBuilder.withChannelDefinitions(channelDefinitions);
}

View File

@ -106,8 +106,8 @@ public class FreeboxCommandExtension extends AbstractConsoleCommandExtension imp
if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> FreeboxBindingConstants.FREEBOX_BRIDGE_TYPE_SERVER.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args,
cursorArgumentIndex, cursorPosition, candidates);
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
.complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]);
if (thing != null && FreeboxBindingConstants.FREEBOX_BRIDGE_TYPE_SERVER.equals(thing.getThingTypeUID())) {

View File

@ -127,8 +127,8 @@ public class HueCommandExtension extends AbstractConsoleCommandExtension impleme
return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> HueBindingConstants.THING_TYPE_BRIDGE.equals(t.getThingTypeUID())
|| HueBindingConstants.THING_TYPE_GROUP.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args,
cursorArgumentIndex, cursorPosition, candidates);
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
.complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]);
if (thing != null && HueBindingConstants.THING_TYPE_BRIDGE.equals(thing.getThingTypeUID())) {

View File

@ -116,8 +116,8 @@ public class LGWebOSCommandExtension extends AbstractConsoleCommandExtension imp
if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> LGWebOSBindingConstants.THING_TYPE_WEBOSTV.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args,
cursorArgumentIndex, cursorPosition, candidates);
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
.complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]);
if (thing != null && LGWebOSBindingConstants.THING_TYPE_WEBOSTV.equals(thing.getThingTypeUID())) {

View File

@ -140,8 +140,8 @@ public class LinkyCommandExtension extends AbstractConsoleCommandExtension imple
if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> LinkyBindingConstants.THING_TYPE_LINKY.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args,
cursorArgumentIndex, cursorPosition, candidates);
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
.complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]);
if (thing != null && LinkyBindingConstants.THING_TYPE_LINKY.equals(thing.getThingTypeUID())) {

View File

@ -83,20 +83,17 @@ public class AlarmControlPanel extends AbstractComponent<AlarmControlPanel.Chann
if (commandTopic != null) {
buildChannel(SWITCH_DISARM_CHANNEL_ID, new TextValue(new String[] { channelConfiguration.payloadDisarm }),
channelConfiguration.getName(), componentConfiguration.getUpdateListener())
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos())
.build();
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()).build();
buildChannel(SWITCH_ARM_HOME_CHANNEL_ID,
new TextValue(new String[] { channelConfiguration.payloadArmHome }), channelConfiguration.getName(),
componentConfiguration.getUpdateListener())
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos())
.build();
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()).build();
buildChannel(SWITCH_ARM_AWAY_CHANNEL_ID,
new TextValue(new String[] { channelConfiguration.payloadArmAway }), channelConfiguration.getName(),
componentConfiguration.getUpdateListener())
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos())
.build();
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()).build();
}
}
}

View File

@ -71,8 +71,7 @@ public class DefaultSchemaLight extends Light {
if (channelConfiguration.brightnessStateTopic != null || channelConfiguration.brightnessCommandTopic != null) {
localBrightnessChannel = brightnessChannel = buildChannel(BRIGHTNESS_CHANNEL_ID, brightnessValue,
"Brightness", this)
.stateTopic(channelConfiguration.brightnessStateTopic,
channelConfiguration.brightnessValueTemplate)
.stateTopic(channelConfiguration.brightnessStateTopic, channelConfiguration.brightnessValueTemplate)
.commandTopic(channelConfiguration.brightnessCommandTopic, channelConfiguration.isRetain(),
channelConfiguration.getQos())
.withFormat("%.0f").commandFilter(this::handleBrightnessCommand).build(false);

View File

@ -67,7 +67,6 @@ public class DeviceTrigger extends AbstractComponent<DeviceTrigger.ChannelConfig
buildChannel(channelConfiguration.type, value, channelConfiguration.getName(),
componentConfiguration.getUpdateListener())
.stateTopic(channelConfiguration.topic, channelConfiguration.getValueTemplate()).trigger(true)
.build();
.stateTopic(channelConfiguration.topic, channelConfiguration.getValueTemplate()).trigger(true).build();
}
}

View File

@ -227,8 +227,8 @@ public class AdvancedMultisensorThingHandler extends OwBaseThingHandler {
properties.put(PROPERTY_DS2438,
ds2438configuration.getAssociatedSensorIds(OwSensorType.MS_TV).get(0).getFullPath());
}
default -> throw new OwException(
"sensorType " + sensorType.toString() + " not supported by this thing handler");
default ->
throw new OwException("sensorType " + sensorType.toString() + " not supported by this thing handler");
}
updateProperties(properties);

View File

@ -126,8 +126,8 @@ public class PowermaxCommandExtension extends AbstractConsoleCommandExtension im
return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> PowermaxBindingConstants.BRIDGE_TYPE_SERIAL.equals(t.getThingTypeUID())
|| PowermaxBindingConstants.BRIDGE_TYPE_IP.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args,
cursorArgumentIndex, cursorPosition, candidates);
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
.complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]);
if (thing != null && (PowermaxBindingConstants.BRIDGE_TYPE_SERIAL.equals(thing.getThingTypeUID())

View File

@ -103,8 +103,8 @@ public class SomfyTahomaCommandExtension extends AbstractConsoleCommandExtension
if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> SomfyTahomaBindingConstants.THING_TYPE_BRIDGE.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args,
cursorArgumentIndex, cursorPosition, candidates);
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
.complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]);
if (thing != null && SomfyTahomaBindingConstants.THING_TYPE_BRIDGE.equals(thing.getThingTypeUID())) {

View File

@ -43,8 +43,8 @@ public class DynamoDBBigDecimalItem extends AbstractDynamoDBItem<BigDecimal> {
.addAttribute(NULLABLE_BIGDECIMAL,
a -> a.name(ATTRIBUTE_NAME_ITEMSTATE_NUMBER).getter(DynamoDBBigDecimalItem::getState)
.setter(DynamoDBBigDecimalItem::setState))
.addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY)
.getter(AbstractDynamoDBItem::getExpiryDate).setter(AbstractDynamoDBItem::setExpiry))
.addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY).getter(AbstractDynamoDBItem::getExpiryDate)
.setter(AbstractDynamoDBItem::setExpiry))
.build();
/**

View File

@ -30,9 +30,7 @@ public class DynamoDBStringItem extends AbstractDynamoDBItem<String> {
private static Class<@Nullable String> NULLABLE_STRING = (Class<@Nullable String>) String.class;
public static final StaticTableSchema<DynamoDBStringItem> TABLE_SCHEMA_LEGACY = getBaseSchemaBuilder(
DynamoDBStringItem.class, true)
.newItemSupplier(
DynamoDBStringItem::new)
DynamoDBStringItem.class, true).newItemSupplier(DynamoDBStringItem::new)
.addAttribute(NULLABLE_STRING, a -> a.name(DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE_LEGACY)
.getter(DynamoDBStringItem::getState).setter(DynamoDBStringItem::setState))
.build();
@ -41,10 +39,10 @@ public class DynamoDBStringItem extends AbstractDynamoDBItem<String> {
DynamoDBStringItem.class, false)
.newItemSupplier(DynamoDBStringItem::new)
.addAttribute(NULLABLE_STRING,
a -> a.name(DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE_STRING)
.getter(DynamoDBStringItem::getState).setter(DynamoDBStringItem::setState))
.addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY)
.getter(AbstractDynamoDBItem::getExpiryDate).setter(AbstractDynamoDBItem::setExpiry))
a -> a.name(DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE_STRING).getter(DynamoDBStringItem::getState)
.setter(DynamoDBStringItem::setState))
.addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY).getter(AbstractDynamoDBItem::getExpiryDate)
.setter(AbstractDynamoDBItem::setExpiry))
.build();
public DynamoDBStringItem() {

View File

@ -63,7 +63,7 @@ import com.igormaznitsa.jbbp.model.JBBPFieldUShort;
* <pre>
* {@code
* JsonObject json = new Bin2Json("byte a; byte b; ubyte c;").convert("03FAFF");
* json.toString() = {"a":3,"b":-6,"c":255}
* json.toString() = {"a":3,"b":-6,"c":255}}
* </pre>
*
* @author Pauli Anttila - Initial contribution

11
pom.xml
View File

@ -77,8 +77,9 @@
<netty.version>4.1.72.Final</netty.version>
<okhttp.version>3.14.9</okhttp.version>
<sat.version>0.13.0</sat.version>
<spotless.version>2.28.0</spotless.version>
<spotless.eclipse.version>4.21.0</spotless.eclipse.version>
<spotless.version>2.35.0</spotless.version>
<spotless.eclipse.version>4.26</spotless.eclipse.version>
<spotless.eclipse.wtp.version>4.21.0</spotless.eclipse.wtp.version>
<bnd.importpackage/>
<bnd.exportpackage/>
@ -521,7 +522,7 @@ Import-Package: \\
<files>
<file>openhab_wst_xml_files.prefs</file>
</files>
<version>${spotless.eclipse.version}</version>
<version>${spotless.eclipse.wtp.version}</version>
</eclipseWtp>
<trimTrailingWhitespace/>
<endWithNewline/>
@ -536,7 +537,7 @@ Import-Package: \\
<files>
<file>openhab_wst_feature_file.prefs</file>
</files>
<version>${spotless.eclipse.version}</version>
<version>${spotless.eclipse.wtp.version}</version>
</eclipseWtp>
<trimTrailingWhitespace/>
<endWithNewline/>
@ -551,7 +552,7 @@ Import-Package: \\
<files>
<file>openhab_wst_pom_file.prefs</file>
</files>
<version>${spotless.eclipse.version}</version>
<version>${spotless.eclipse.wtp.version}</version>
</eclipseWtp>
<trimTrailingWhitespace/>
<endWithNewline/>