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(); String mode = thermostatMode != null ? thermostatMode.name() : ThermostatMode.UNKNOWN.name();
switch (channelUID.getId()) { switch (channelUID.getId()) {
case CHANNEL_THERMOSTAT_LOCKED -> updateSwitchChannel(channelUID, newConfig.locked); case CHANNEL_THERMOSTAT_LOCKED -> updateSwitchChannel(channelUID, newConfig.locked);
case CHANNEL_HEATSETPOINT -> updateQuantityTypeChannel(channelUID, newConfig.heatsetpoint, CELSIUS, case CHANNEL_HEATSETPOINT ->
1.0 / 100); updateQuantityTypeChannel(channelUID, newConfig.heatsetpoint, CELSIUS, 1.0 / 100);
case CHANNEL_TEMPERATURE_OFFSET -> updateQuantityTypeChannel(channelUID, newConfig.offset, CELSIUS, case CHANNEL_TEMPERATURE_OFFSET ->
1.0 / 100); updateQuantityTypeChannel(channelUID, newConfig.offset, CELSIUS, 1.0 / 100);
case CHANNEL_THERMOSTAT_MODE -> updateState(channelUID, new StringType(mode)); case CHANNEL_THERMOSTAT_MODE -> updateState(channelUID, new StringType(mode));
case CHANNEL_EXTERNAL_WINDOW_OPEN -> { case CHANNEL_EXTERNAL_WINDOW_OPEN -> {
Boolean open = newConfig.externalwindowopen; Boolean open = newConfig.externalwindowopen;

View File

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

View File

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

View File

@ -106,8 +106,8 @@ public class FreeboxCommandExtension extends AbstractConsoleCommandExtension imp
if (cursorArgumentIndex <= 0) { if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream() return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> FreeboxBindingConstants.FREEBOX_BRIDGE_TYPE_SERVER.equals(t.getThingTypeUID())) .filter(t -> FreeboxBindingConstants.FREEBOX_BRIDGE_TYPE_SERVER.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args, .map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
cursorArgumentIndex, cursorPosition, candidates); .complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) { } else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]); Thing thing = getThing(args[0]);
if (thing != null && FreeboxBindingConstants.FREEBOX_BRIDGE_TYPE_SERVER.equals(thing.getThingTypeUID())) { 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() return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> HueBindingConstants.THING_TYPE_BRIDGE.equals(t.getThingTypeUID()) .filter(t -> HueBindingConstants.THING_TYPE_BRIDGE.equals(t.getThingTypeUID())
|| HueBindingConstants.THING_TYPE_GROUP.equals(t.getThingTypeUID())) || HueBindingConstants.THING_TYPE_GROUP.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args, .map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
cursorArgumentIndex, cursorPosition, candidates); .complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) { } else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]); Thing thing = getThing(args[0]);
if (thing != null && HueBindingConstants.THING_TYPE_BRIDGE.equals(thing.getThingTypeUID())) { 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) { if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream() return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> LGWebOSBindingConstants.THING_TYPE_WEBOSTV.equals(t.getThingTypeUID())) .filter(t -> LGWebOSBindingConstants.THING_TYPE_WEBOSTV.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args, .map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
cursorArgumentIndex, cursorPosition, candidates); .complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) { } else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]); Thing thing = getThing(args[0]);
if (thing != null && LGWebOSBindingConstants.THING_TYPE_WEBOSTV.equals(thing.getThingTypeUID())) { 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) { if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream() return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> LinkyBindingConstants.THING_TYPE_LINKY.equals(t.getThingTypeUID())) .filter(t -> LinkyBindingConstants.THING_TYPE_LINKY.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args, .map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
cursorArgumentIndex, cursorPosition, candidates); .complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) { } else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]); Thing thing = getThing(args[0]);
if (thing != null && LinkyBindingConstants.THING_TYPE_LINKY.equals(thing.getThingTypeUID())) { 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) { if (commandTopic != null) {
buildChannel(SWITCH_DISARM_CHANNEL_ID, new TextValue(new String[] { channelConfiguration.payloadDisarm }), buildChannel(SWITCH_DISARM_CHANNEL_ID, new TextValue(new String[] { channelConfiguration.payloadDisarm }),
channelConfiguration.getName(), componentConfiguration.getUpdateListener()) channelConfiguration.getName(), componentConfiguration.getUpdateListener())
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()) .commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()).build();
.build();
buildChannel(SWITCH_ARM_HOME_CHANNEL_ID, buildChannel(SWITCH_ARM_HOME_CHANNEL_ID,
new TextValue(new String[] { channelConfiguration.payloadArmHome }), channelConfiguration.getName(), new TextValue(new String[] { channelConfiguration.payloadArmHome }), channelConfiguration.getName(),
componentConfiguration.getUpdateListener()) componentConfiguration.getUpdateListener())
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()) .commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()).build();
.build();
buildChannel(SWITCH_ARM_AWAY_CHANNEL_ID, buildChannel(SWITCH_ARM_AWAY_CHANNEL_ID,
new TextValue(new String[] { channelConfiguration.payloadArmAway }), channelConfiguration.getName(), new TextValue(new String[] { channelConfiguration.payloadArmAway }), channelConfiguration.getName(),
componentConfiguration.getUpdateListener()) componentConfiguration.getUpdateListener())
.commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()) .commandTopic(commandTopic, channelConfiguration.isRetain(), channelConfiguration.getQos()).build();
.build();
} }
} }
} }

View File

@ -71,8 +71,7 @@ public class DefaultSchemaLight extends Light {
if (channelConfiguration.brightnessStateTopic != null || channelConfiguration.brightnessCommandTopic != null) { if (channelConfiguration.brightnessStateTopic != null || channelConfiguration.brightnessCommandTopic != null) {
localBrightnessChannel = brightnessChannel = buildChannel(BRIGHTNESS_CHANNEL_ID, brightnessValue, localBrightnessChannel = brightnessChannel = buildChannel(BRIGHTNESS_CHANNEL_ID, brightnessValue,
"Brightness", this) "Brightness", this)
.stateTopic(channelConfiguration.brightnessStateTopic, .stateTopic(channelConfiguration.brightnessStateTopic, channelConfiguration.brightnessValueTemplate)
channelConfiguration.brightnessValueTemplate)
.commandTopic(channelConfiguration.brightnessCommandTopic, channelConfiguration.isRetain(), .commandTopic(channelConfiguration.brightnessCommandTopic, channelConfiguration.isRetain(),
channelConfiguration.getQos()) channelConfiguration.getQos())
.withFormat("%.0f").commandFilter(this::handleBrightnessCommand).build(false); .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(), buildChannel(channelConfiguration.type, value, channelConfiguration.getName(),
componentConfiguration.getUpdateListener()) componentConfiguration.getUpdateListener())
.stateTopic(channelConfiguration.topic, channelConfiguration.getValueTemplate()).trigger(true) .stateTopic(channelConfiguration.topic, channelConfiguration.getValueTemplate()).trigger(true).build();
.build();
} }
} }

View File

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

View File

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

View File

@ -103,8 +103,8 @@ public class SomfyTahomaCommandExtension extends AbstractConsoleCommandExtension
if (cursorArgumentIndex <= 0) { if (cursorArgumentIndex <= 0) {
return new StringsCompleter(thingRegistry.getAll().stream() return new StringsCompleter(thingRegistry.getAll().stream()
.filter(t -> SomfyTahomaBindingConstants.THING_TYPE_BRIDGE.equals(t.getThingTypeUID())) .filter(t -> SomfyTahomaBindingConstants.THING_TYPE_BRIDGE.equals(t.getThingTypeUID()))
.map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true).complete(args, .map(t -> t.getUID().getAsString()).collect(Collectors.toList()), true)
cursorArgumentIndex, cursorPosition, candidates); .complete(args, cursorArgumentIndex, cursorPosition, candidates);
} else if (cursorArgumentIndex == 1) { } else if (cursorArgumentIndex == 1) {
Thing thing = getThing(args[0]); Thing thing = getThing(args[0]);
if (thing != null && SomfyTahomaBindingConstants.THING_TYPE_BRIDGE.equals(thing.getThingTypeUID())) { 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, .addAttribute(NULLABLE_BIGDECIMAL,
a -> a.name(ATTRIBUTE_NAME_ITEMSTATE_NUMBER).getter(DynamoDBBigDecimalItem::getState) a -> a.name(ATTRIBUTE_NAME_ITEMSTATE_NUMBER).getter(DynamoDBBigDecimalItem::getState)
.setter(DynamoDBBigDecimalItem::setState)) .setter(DynamoDBBigDecimalItem::setState))
.addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY) .addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY).getter(AbstractDynamoDBItem::getExpiryDate)
.getter(AbstractDynamoDBItem::getExpiryDate).setter(AbstractDynamoDBItem::setExpiry)) .setter(AbstractDynamoDBItem::setExpiry))
.build(); .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; private static Class<@Nullable String> NULLABLE_STRING = (Class<@Nullable String>) String.class;
public static final StaticTableSchema<DynamoDBStringItem> TABLE_SCHEMA_LEGACY = getBaseSchemaBuilder( public static final StaticTableSchema<DynamoDBStringItem> TABLE_SCHEMA_LEGACY = getBaseSchemaBuilder(
DynamoDBStringItem.class, true) DynamoDBStringItem.class, true).newItemSupplier(DynamoDBStringItem::new)
.newItemSupplier(
DynamoDBStringItem::new)
.addAttribute(NULLABLE_STRING, a -> a.name(DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE_LEGACY) .addAttribute(NULLABLE_STRING, a -> a.name(DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE_LEGACY)
.getter(DynamoDBStringItem::getState).setter(DynamoDBStringItem::setState)) .getter(DynamoDBStringItem::getState).setter(DynamoDBStringItem::setState))
.build(); .build();
@ -41,10 +39,10 @@ public class DynamoDBStringItem extends AbstractDynamoDBItem<String> {
DynamoDBStringItem.class, false) DynamoDBStringItem.class, false)
.newItemSupplier(DynamoDBStringItem::new) .newItemSupplier(DynamoDBStringItem::new)
.addAttribute(NULLABLE_STRING, .addAttribute(NULLABLE_STRING,
a -> a.name(DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE_STRING) a -> a.name(DynamoDBItem.ATTRIBUTE_NAME_ITEMSTATE_STRING).getter(DynamoDBStringItem::getState)
.getter(DynamoDBStringItem::getState).setter(DynamoDBStringItem::setState)) .setter(DynamoDBStringItem::setState))
.addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY) .addAttribute(NULLABLE_LONG, a -> a.name(ATTRIBUTE_NAME_EXPIRY).getter(AbstractDynamoDBItem::getExpiryDate)
.getter(AbstractDynamoDBItem::getExpiryDate).setter(AbstractDynamoDBItem::setExpiry)) .setter(AbstractDynamoDBItem::setExpiry))
.build(); .build();
public DynamoDBStringItem() { public DynamoDBStringItem() {

View File

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

11
pom.xml
View File

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