* Upgrade Jollyday from 0.27.0 to 0.28.1.
This release includes the fixed class loader working also in OSGI
setups.
* Upgrade jackson from 2.16.0 to 2.28.1
* Upgrade threeten-extra from 1.7.2 to 1.8.0
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
* Set a default presentation pattern for String/Number/Datetime items
A default state pattern was previously provided by ChannelStateDescriptionProvider only for String and Number items linked to a channel.
It is now the class DefaultStateDescriptionFragmentProvider which is responsible for providing the default state pattern for items, whether the item is linked to a channel or not.
This new class is the lowest ranked StateDescriptionFragmentProvider so that all other providers have priority in setting the state pattern.
Default pattern for string item: %s
Default pattern for datetime item or group with datetime state: %1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS
Default pattern for number item or group with number state: %.0f
Default pattern for number+dimension item or group with number+dimension state: %.0f %unit%
Closes#4071Closes#3835
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
* Upgrade to Karaf 4.4.5 and Xtext 2.34
Upgrade Karaf from 4.4.4 to 4.4.5:
* Sync runtime dependencies with Karaf 4.4.5, most notably:
* Jetty 9.4.53.v20231009
* JNA 5.14.0
* Pax Logging 2.2.6
* Pax Web 8.0.24
* ASM 9.6
* Resolve itest runbundles
Upgrade Xtext from 2.32 to 2.34
* Sync depencencies, most notably:
* Guava 33.0.0
* classgraph 4.8.165 changing provider to io.github.classgraph
* Migrate old Xtext generator xtext.generator to xtext.xtext.generator
as xtext.generator has been removed from Xtext, affecting
org.openhab.core.model.lazygen
* resolve runbundles
* Remove org.openhab.core.model.lazygen
No longer in use since 2017, see eclipse-archived/smarthome#4122.
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Upgrades Jollyday 0.5.10 (de.jollyday) to 0.23.2 of a more actively maintained fork (de.focus-shift).
* This adds many missing holidays.
* Also removes the workaround for the Danish Great Prayer Day introduced by #3573.
For release notes, see:
https://github.com/focus-shift/jollyday/releasesFixes#3544
Signed-off-by: Wouter Born <github@maindrain.net>
Abstract classes should not have public constructors.
Constructors of abstract classes can only be called in constructors of their subclasses.
So there is no point in making them public.
The protected modifier should be enough.
Signed-off-by: Wouter Born <github@maindrain.net>
* Iterate using Map entries
Iteration using Map entries is preferred because it is more efficient and helps preventing NPEs.
Signed-off-by: Wouter Born <github@maindrain.net>
A static inner class does not keep an implicit reference to its enclosing instance.
This prevents a common cause of memory leaks and uses less memory per instance of the class.
Signed-off-by: Wouter Born <github@maindrain.net>
* Simplify assertions
Using the appropriate assertion methods results in less and easier to read code as well as better error messages when assertions fail.
Signed-off-by: Wouter Born <github@maindrain.net>
`isEmpty()` expresses the intent more clearly and is therefore preferred.
Counting the number of elements can also be an expensive operation e.g. when using linked lists.
Signed-off-by: Wouter Born <github@maindrain.net>
While cleaning up the code I found a some more code to cleanup:
* Remove unnecessary boxing
* Use `contains(..)` instead of `indexOf(..) != -1`
* Use `assertInstanceOf` in tests
* Make expensive trace logging conditional
* Remove redundant constructor
* Replace `collect(Collectors.toUnmodifiableList())` with `toList()`
* Replace `filter(..).count() == 0L` with `noneMatch(..)`
* Replace `filter(..).count() > 0` with `anyMatch(..)`
Signed-off-by: Wouter Born <github@maindrain.net>
* Use String.join instead of Collectors.joining
String.join results in less code when joining an Iterable or Array.
Signed-off-by: Wouter Born <github@maindrain.net>
Using 'UID' is confusing as method parameter because it can be mistaken for some kind of constant while reading code.
Signed-off-by: Wouter Born <github@maindrain.net>
Simplifies the code by using List.of, List.copyOf etc. where possible which results in less code and imports.
Signed-off-by: Wouter Born <github@maindrain.net>
Stream.toList was introduced in Java 16 and creates an unmodifiable List so it can be used to simplify code whenever the List is not expected to be modified.
Signed-off-by: Wouter Born <github@maindrain.net>