Commit Graph

643 Commits

Author SHA1 Message Date
Michael Reitler (former Michael Dicke)
e7f49dc462
[ThingManagerImpl] Prevent multiple handler inits on thing enabling (#1353)
When a thing is enabled, the `ThingManagerImpl` takes care of calling `ThingHandler#initialize()`.
That makes totally sense if the thing was disabled before. However, if `setEnabled(thingUID, true)` is called for a thing which was already enabled, it causes an additional initialization.
Since concurrent hanlder initializations may cause trouble, it is safer to prevent this. Therefore enabling a thing (including starting its thing handler) should only be performed if the thing is disabled.

Signed-off-by: Michael Reitler <michael.dicke@smail.inf.h-brs.de>
2020-02-02 21:53:25 +01:00
Nagy Attila Gábor
487db7e7ea
Added and fixed units for reactive and apparent power (#1347)
* var and varh were missing
* var is basically an alternate form of WATT
* kvarh was incorrectly marked as a division between kvar and hour
* Volt-Ampere added to the units

This unit for apparent power in an electrical circuit. Useful for smart meters and solar inverters.

Signed-off-by: Nagy Attila Gabor <mrbig@sneaker.hu>
2020-02-01 21:47:19 +01:00
Christoph Weitkamp
8b8b5fa0b4 [voice] Simplify lifecycle by using constructor injection (#1343)
* [voice] Simplify lifecycle by using constructor injection
* Removed usage of org.apache.commons.lang.ArrayUtils

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-27 17:55:49 +01:00
Christoph Weitkamp
28afe7d866 Remove not needed object array creation for logging (#1344)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-27 09:22:17 +01:00
Christoph Weitkamp
ac537c53d9 Added public method to remove all members from a group (#1283)
* Added public method to remove all members from a group
* Spelling in itest method names
* File encoding

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-26 12:54:37 +01:00
Kai Kreuzer
86899daf1a replaced Joda Time by Java Time (#1342)
* replaced Joda Time by Java Time

Signed-off-by: Kai Kreuzer <kai@openhab.org>

* removed joda from target platform feature

Signed-off-by: Kai Kreuzer <kai@openhab.org>

* updated tests

Signed-off-by: Kai Kreuzer <kai@openhab.org>

* fixed persistence extension tests

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-01-25 22:44:03 +01:00
Kai Kreuzer
32c1978a1a Added hashCode and equals method to StringListType to fix object comparison (#1341)
* Added hashCode and equals method to StringListType to fix object comparison

Signed-off-by: Kai Kreuzer <kai@openhab.org>
2020-01-25 20:35:24 +01:00
Christoph Weitkamp
7d8296ed81 [persistence] Fixed JavaDoc for persistence extension (#1338)
* Fixed JavaDoc for persistence extension

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-25 20:07:55 +01:00
Christoph Weitkamp
8a9d007e0b Added nullness annotations to 'ThingActions' and 'ThingHandlerService' (#1317)
* Minor code improvements; Added nullness annotations to ThingActions and ThingHandlerService
* Revert renaming of 'thingRegistry' property

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-25 16:21:47 +01:00
Christoph Weitkamp
b30c1da741 Added unit test for persistence extension (#1337)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-25 16:17:18 +01:00
Yannick Schaus
d4b0ecb122 Add filters to some REST getAll endpoints (#1340)
These filters help reduce payloads for UIs which
retrieve ad-hoc information rather than maintaining
a global state.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-24 19:25:25 +01:00
Christoph Weitkamp
2c8de49231 Applied spotless formatter (#1335)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-19 14:40:09 +01:00
Mark Hilbush
8121fec350 [oauthclient] Reduce log level to debug for token refresh (#1332)
Signed-off-by: Mark Hilbush <mark@hilbush.com>
2020-01-17 22:44:38 +01:00
Christoph Weitkamp
08da8de5cf Moved "ESH-INF/" folders to "OH-INF/" folders (#1328)
* Moved ESH-INF folders to OH-INF folders

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-17 15:29:18 +01:00
Yannick Schaus
cc702266fe Refactor dashboard tiles into core (#1329)
* Refactor dashboard tiles into core

Move the tile concept from the dashboard UI to the
org.openhab.core.ui bundle, and add a REST resource
(/rest/ui/tiles) to retrieve the list of tiles i.e.
registered UIs.

Signed-off-by: Yannick Schaus <github@schaus.net>
2020-01-17 15:28:05 +01:00
Jochen Klein
cc3f1407bd [mqtt] Keep track of retained messages
Closes #1279

Signed-off-by: Jochen Klein <git@jochen.susca.de>
2020-01-15 09:42:27 +01:00
Wouter Born
18d0a52d02 Switch to Java 11 and drop Java 8 support (#1305)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-01-12 22:32:28 +01:00
Christoph Weitkamp
2c01cd7f3b Fixed storage configurationPids (#1323)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-09 15:05:51 +01:00
Christoph Weitkamp
7d42607e4c Streamline format of event outputs (#1318)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-09 12:40:25 +01:00
Christoph Weitkamp
7e3e333dbc [rest] Suppress error message in REST response (#1307)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-09 12:36:54 +01:00
Markkuuss
a8232e4b1c Correction of unit spellings Ampere hour (#1316)
Signed-off-by: Markus Schraufstetter <markus.schraufstetter@gmail.com>
2020-01-05 12:20:35 +01:00
Wouter Born
9d0cb4d9af Fix FolderObserver configuration PID (#1315)
Signed-off-by: Wouter Born <github@maindrain.net>
2020-01-03 08:06:28 +01:00
Christoph Weitkamp
84009652a8 Changed configurationPid prefixes from 'org.openhab.core' ot 'org.openhab' (#1314)
* Changed configurationPid prefixes from 'org.openhab.core' ot 'org.openhab'

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2020-01-02 09:12:34 +01:00
Wouter Born
3811cb9560 Update copyright headers to 2020 (#1309)
* Update copyright headers to 2020

Signed-off-by: Wouter Born <github@maindrain.net>
2020-01-01 18:06:34 +01:00
Karel Goderis
e0c9542690 [magic] Update channel-types.xml (#1312)
Added missing `item-type`

Signed-off-by: Karel Goderis <karel.goderis@me.com>
2019-12-31 17:21:39 +01:00
Gaël L'hopital
1c1bde0ef7 Add Ampere hour (A h) and electrolytic conductivity (µS/cm) units (#1308)
* Adressing issues #1295 and #1296

Fixes #1295
Fixes #1296

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
2019-12-31 11:31:44 +01:00
Christoph Weitkamp
800956598b Applied spotless formatter (#1302)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-30 22:55:19 +01:00
Christoph Weitkamp
b505847544 Simplify code for 'updateProperty' method (#1300)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-30 09:38:46 +01:00
Wouter Born
406f9b262f Correct Xtext version in bnd.bnd files (#1304)
Related to: https://github.com/openhab/openhab-core/pull/1171

Signed-off-by: Wouter Born <github@maindrain.net>
2019-12-29 17:23:52 +01:00
Christoph Weitkamp
dd4368e23f Added nullness annotations; Some minor improvements; Unit tests for 'ItemCommandEvent' on group (#1299)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-28 22:25:07 +01:00
Christoph Weitkamp
b03b3e9b00 Changes in ScriptImportSectionNamespaceScopeProvider
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-28 12:18:16 +01:00
Christoph Weitkamp
59675788e0 Renamed packages
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-28 12:18:16 +01:00
Christoph Weitkamp
fca7c215a5 Moved files to new location
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-28 12:18:16 +01:00
Christoph Weitkamp
be89210019 Fixed link in JavaDoc (#1289)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-21 18:41:32 +01:00
Kai Kreuzer
650f895620 removed 1.x compatibility layer (#1284)
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2019-12-21 11:32:29 +01:00
jimtng
ec2958a072 [DSL] Add the ability to send HTTP headers in sendHttpXXXRequest (#1272)
* Add the ability to send HTTP headers in HTTP.sendHttpXXXRequest actions

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
2019-12-19 13:36:51 +01:00
Christoph Weitkamp
7130988901 Added missing JavaDoc to 'createGroupStateChangedEvent' method (#1276)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-18 23:04:09 +01:00
Christoph Weitkamp
f32d779894 Simplify lifecycle by using constructor injection (#1278)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-12-18 23:02:56 +01:00
Markus Rathgeb
853179e8f2 contains + get can be replaced by get and a null check (#1269)
contains + get will do its job as long as all collection access uses the
same synchronization locks and as long as every put ensures there will
never by a null value be inserted.

If the map implementation checks if a key is available, we can also get
the value already (IMHO there is no need for the overhead to first
lookup if the key is present and after that is checked, we call the get
function). It should be better to get the value and check if it differs
from null.

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2019-12-16 00:23:18 +01:00
Markus Rathgeb
a19680e35d slf4j logging: remove not needed object array creation (#1268)
* slf4j logging: remove not needed object array creation
* remove explicit `toString()` calls and check if debug is enabled

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2019-12-16 00:22:56 +01:00
jenkins
bc6a380297 [unleash-maven-plugin] Preparation for next development cycle. 2019-12-15 14:55:36 +00:00
J-N-K
ea2ef7e25b fix failing subscriptions (#1267)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2019-12-11 08:51:18 +01:00
Scott Rushworth
218bb79dfd Prepare automation for ScriptEngineFactory projects (#1251)
These changes prepare for custom ScriptEngineFactories and does not
include any breaking changes.
* Moved AbstractScriptEngineFactory out of internal so that it can be
used by custom factories
* Modified ScriptEngineModuleTypeProvider to include engines from custom
factories
* Cleaned up some logging

Signed-off-by: Scott Rushworth <openhab@5iver.com>
2019-12-11 08:35:01 +01:00
J-N-K
cb5838837b make MQTT subscription tracking thread-safe (#1261)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2019-12-08 22:10:23 +01:00
J-N-K
6e962d9dbc fix multiple MQTT subscriptions (#1259)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2019-12-07 18:44:35 +01:00
J-N-K
4efa7ec625 Fix MQTT reconnection and add some debug logging (#1254)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2019-12-02 05:30:14 +01:00
Abdullah Imal
991a8fd850 Fix check which allows QoS 3 (#1248)
Signed-off-by: A-Imal <Abdullah.Imal@dc-square.de>
2019-11-29 19:54:42 +01:00
Christoph Weitkamp
2d14814549 Reduce logging level in FeatureInstaller for uninstalling a binding (#1247)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-29 17:24:43 +01:00
Christoph Weitkamp
e85e1a6f44 Removed dependency on 'org.apache.commons.collections' (#1244)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-28 18:43:10 +01:00
Christoph Weitkamp
0046774eb6 Set UNINITIALIZED -> HANDLER_MISSING_ERROR after enabling a Thing and handler is missing (#1243)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-28 15:55:59 +01:00
Wouter Born
c50766d7c3 Use default SslContextFactory excludes for weak ciphers and protocols (#1241)
To prevent weak cipher/protocol warnings it's better to not customize the default excluded ciphers and protocols.
The MD5 ciphers have already been excluded by default since Jetty 9.3.11.v20160721.

Fixes #1064

Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-25 23:22:32 +01:00
Gaël L'hopital
b9105bde38 Correcting Issue #1231 (#1240)
Forgot to test decimal negatives

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
2019-11-25 23:21:44 +01:00
Christoph Weitkamp
abb558851f Removed duplicate brackets (#1235)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-22 09:38:48 +01:00
jmelhus
44d486b007 [semantics] Norwegian translation (#1228)
* Created tags_no.properties

Norwegian translation

Signed-off-by: Jørgen Melhus <jmelhus@gmail.com>
2019-11-20 07:44:08 +01:00
Christoph Weitkamp
764b5845a6 [thing] Call removeItem() with item name instead of ThingUID (#1230)
* Added unit test to cover #1226
* Call 'removeItem()' with item name instead of ThingUID
* Added nullness annotations
* Use constructor injection

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-19 17:34:05 +01:00
Markus Rathgeb
fc0c61e4b4 use correct wildcard for mandatory path parameters (#1224)
Fixes: https://github.com/openhab/openhab-core/issues/1217

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2019-11-17 21:44:51 +01:00
Christoph Weitkamp
931b2007c5 Removed access to 'BundleContext' from 'BaseThingHandler' (#1214)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-17 21:44:08 +01:00
Christoph Weitkamp
d23fb59ed7 Use constructor injection (#1212)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-14 20:58:47 +01:00
Wouter Born
403b55c8fc Parameterized logging fixes (#1213)
Make sure Throwables are not be substituted into log messages so they can be formatted according to the logging configuration.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-14 20:08:06 +01:00
Christoph Weitkamp
fdf060dab2 Use constructor injection (#1211)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-14 19:40:06 +01:00
Christoph Weitkamp
b34ef3cf13 Use constructor injection (#1210)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-14 19:31:14 +01:00
Christoph Weitkamp
d77d8b763e Added check for invalid duration (#1209)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-13 18:35:42 +01:00
Christoph Weitkamp
8c4fb060ed Minor clean-ups in 'SmartHomeUnits', 'SIUnits' and 'ImperialUnits' (#1208)
* Minor clean-us in SmartHomeUnits
* Clean-up in 'SIUnits' and 'ImperialUnits'

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-13 18:35:17 +01:00
lolodomo
16a9ff0877 [mqtt] PeriodicReconnectStrategy: fix fields init (#1203)
Fixes #1200

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2019-11-11 22:24:50 +01:00
Gaël L'hopital
694ff49954 Issue #1157 Enhance DecimalType to accept epoch seconds and milliseconds. (#1158)
* Issue 1157 Enhance DecimalType to accept epoch seconds and milliseconds.

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
2019-11-10 21:45:38 +01:00
Markus Rathgeb
492526d74f add console command extension for serial inspection (#1172)
* add console command extension for serial inspection

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
2019-11-10 21:41:31 +01:00
Wouter Born
cd3f33738f Fix unstable MqttBrokerConnectionTests (#1191)
Using waitForAssert instead of sleeping 10ms makes the tests stable when the system has some load.

Fixes #1139

Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-08 10:53:13 +01:00
Wouter Born
e943ec8970 Upgrade to Xtext 2.19, LSP4J 0.8.0 and fix LSP server (#1171)
Every connection to the LSP server failed because it always threw a org.eclipse.smarthome.model.ide.SitemapIdeSetup NoClassDefFoundError.
Which is caused by the SitemapIdeSetup residing in a package that is split between both the org.openhab.core.model.item.ide and the org.openhab.core.model.sitemap.ide bundles.
The SitemapIdeSetup class is also using classes from the org.eclipse.smarthome.model package which is also a package split between the org.openhab.core.model.items and org.openhab.core.model.sitemap bundles.
After renaming the packages used for the sitemap classes the NoClassDefFoundError is resolved and LSP works properly again.
Many imports were updated for the sitemap model package changes.

Fixes #1030

Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-07 16:26:59 +01:00
Christoph Weitkamp
ce404e0a84 Added German translations for profiles (#1182)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-06 10:45:22 +01:00
Christoph Weitkamp
fc929c22c1 Added links for (available) docs of all Add-Ons (#1186)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-06 10:44:50 +01:00
Christoph Weitkamp
be378625cc Use constructor injection to simplify lifecycle (#1187)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-06 10:41:21 +01:00
J-N-K
07d10dba3d move MQTT client from Paho to HiveMQ (#1125)
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
2019-11-05 07:51:59 +01:00
Gaël L'hopital
4fef0100cb [ephemeris] Evolutions of the Ephemeris module (#1169)
* Evolutions of the Ephemeris module

Signed-off-by: Gaël L'hopital <gael@lhopital.org>
2019-11-04 21:50:43 +01:00
Christoph Weitkamp
9ba4f55bb5 Added unit test for 'CommandDescriptionBuilder' (#1181)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-03 19:16:43 +01:00
Christoph Weitkamp
bab5ff276d Added 'ConfigDescriptionBuilder' (#1180)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-03 19:14:46 +01:00
Wouter Born
f002a21da5 Fix SAT errors/warnings in resources and tests (#1178)
Fixes SAT errors/warnings in resources and tests reported by SAT 0.8.0-SNAPSHOT.

Related to openhab/static-code-analysis#363

Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-03 11:04:19 +01:00
Christoph Weitkamp
1f9a6f685d Consider more than one value when applying the default value(s) for Things and Channels (#1067)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-01 22:23:52 +01:00
Wouter Born
10d2fe7cc8 Add null annotations to audio package (#1174)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-11-01 17:10:21 +01:00
Christoph Weitkamp
2f86782c9d Added 'InstaceCreator' for 'PersistedItem' (#1173)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-11-01 16:28:53 +01:00
Christoph Weitkamp
80dce80ad9 Added constructor injection to config xml (#1168)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-28 10:01:12 +01:00
Kai Kreuzer
3ae82d1558 Added "resources" folder as a resource folder to bnd instructions (#1160)
* Added "resources" folder as a resource folder to bnd instructions

Co-Authored-By: Wouter Born <github@maindrain.net>
Signed-off-by: Kai Kreuzer <kai@openhab.org>
2019-10-28 09:58:39 +01:00
Christoph Weitkamp
8351a2f8d4 [binding] Added nullness annotations (#1165)
* Added nullness annotations to o.o.c.binding.xml
* Use local variables
* Removed unuused import

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-28 08:14:10 +01:00
Christoph Weitkamp
45602fa184 [xml] Feature thing xml constructor injection (#1167)
* Added contructor injection to thing xml
* Removed Nullable from getChannels and getChannelGroups

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-27 19:24:12 +01:00
Christoph Weitkamp
12d91f7da9 [i18n] Refactoring and annotations (#1161)
* Added nullness annotations to 'RuleTemplateI18nUtil'
* Added nullness annotations to 'ConfigDescriptionGroupI18nUtil'
* Moved 'ConfigDescriptionI18nUtil' into internal package
* Moved 'ConfigDescriptionGroupI18nUtil' into internal package
* Moved 'ThingTypeI18nUtil' into internal package
* Use 'ConfigI18nLocalizationService' instead of 'ConfigDescriptionI18nUtil'
* Use default labels / descriptions if application of localization is not successful
* Resolved itest.bndrun files

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-27 11:17:52 +01:00
Hilbrand Bouwkamp
d39b6bd35b [automation] Fix typos in EphemerisConditions.json (#1164)
Closes #1163

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2019-10-24 20:37:24 +02:00
Feras Almannaa
144fc8b56f [automation] Fix the created cron to run only once at the trigger minute. (#1162)
Fixes #1156

Signed-off-by: Feras AlManna <firas.almanna3@gmail.com>
2019-10-23 18:11:42 +02:00
Wouter Born
2430256b6a Add null annotations to registries (#1134)
Adds null annotations to all registries, the interfaces they implement and a few other classes.

Also-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-23 07:36:56 +02:00
Christoph Weitkamp
09170d1b43 Fixed cron parsing for Day-Of-Week sub-expression (#1159)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-22 22:29:31 +02:00
Wouter Born
a53e29235b Fix ItemResourceOSGiTest on Windows (#1150)
Fixes #1002

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-22 22:06:09 +02:00
Wouter Born
be69d2254e Use !isEmpty() instead of "size() > 0" or "size() != 0" (#1155)
* Use !isEmpty() instead of "size() > 0" or "size() != 0"

!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.

Co-Authored-By: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-21 09:00:52 +02:00
Wouter Born
55ddaa25fb Add null annotations to semantics (#1133)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-20 01:39:21 +02:00
Christoph Weitkamp
a3d91bebfc [automation] Added EphemerisConditions for NGRE (#915)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-20 01:37:56 +02:00
Christoph Weitkamp
36ca073ff4 Use constructor injection to simplify lifecycle (#1153)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-20 01:32:44 +02:00
Wouter Born
4895977966 Use isEmpty() instead of "size() == 0" (#1151)
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>
2019-10-20 01:27:11 +02:00
Christoph Weitkamp
8d6d650d2e Fixed potential NPE if 'defaultValue' is null (#1149)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-19 20:08:56 +02:00
Christoph Weitkamp
22ba5d92c1 Minor profile improvements (#1132)
* Minor code improvements in profile factory
* Added integration test to check if factory creates all available profiles

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-19 15:14:57 +02:00
Wouter Born
42a0217386 Fixes a few more SAT findings (#1145)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-19 14:10:18 +02:00
Wouter Born
e35a218a30 [xml] Improve ThingTypeXmlProvider exception handling (#1136)
* Improve ThingTypeXmlProvider exception handling

When a binding such as ZWave has hundereds of ThingTypes it's hard to debug thing type definition issues.
This PR adds a UID (ConfigDescription, ChannelType, ChannelGroupType and ThingType) to the logging so it will be easier to find the root cause of exceptions.
Because the exceptions are caught, an error in one ThingType definition will no longer prevent other perfectly fine ThingTypes to be registered so the impact of definition issues is reduced.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-18 22:54:45 +02:00
Christoph Weitkamp
21744d22b1 Normalized instantiation of loggers (#1138)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-18 22:29:27 +02:00
Christoph Weitkamp
0fdd691c22 Removed superflous resources (#1137)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-18 22:28:37 +02:00
Christoph Weitkamp
e7c8be33b2 Fixed minor spelling issue (#1143)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-18 22:28:07 +02:00
Mark Hilbush
8396a17d2d Add system profile for a 'rawbutton-on-off-switch' (#1131)
* Add `rawbutton-on-off-switch` profile and tests

Signed-off-by: Mark Hilbush <mark@hilbush.com>
2019-10-14 22:22:18 +02:00
Christoph Weitkamp
d8a0225b48 [rest] Added support for default values containing a list of configuration options (#1031)
* Added support for default values containing a list of configuration options

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-14 12:51:22 +02:00
Wouter Born
933a4ae66a Fix unstable PersistentInboxTest (#1129)
Activating the PersistentInbox after the mocks are initialized prevents the TimeToLiveCheckingThread calling the storage mock which would cause the exception.

Fixes #1091

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-14 07:17:25 +02:00
Wouter Born
627007d32e Fix InstallServiceCommand SAT findings (#1124)
Suppresses the SystemPrintln SAT findings because this class is a Karaf shell command which prints to the console.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-13 21:52:44 +02:00
Christoph Weitkamp
91617d8af8 Fixed POM XML Shema Definition path (#1119)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-12 08:52:16 +02:00
Christoph Weitkamp
73d55a9fe9 Changed pid from 'org.eclipse.smarthome.core.i18nprovider' to 'org.eclipse.smarthome.i18n' (#1112)
* Changed pid from 'org.eclipse.smarthome.core.i18nprovider' to 'org.eclipse.smarthome.i18n'

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-11 19:50:04 +02:00
Wouter Born
12e8edc039 Use diamond operator (#1114)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-11 02:29:47 -07:00
Wouter Born
4e10e0d116 Fix SAT JavadocMethodStyleCheck findings (#1109)
* Fix SAT JavadocMethodStyleCheck findings

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-10 14:18:54 +02:00
Wouter Born
3d52c72a91 Fix SAT AuthorContributionDescriptionCheck findings (#1110)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-10 11:36:05 +02:00
Wouter Born
90005e4a56 Fix NoEmptyLineSeparatorCheck and NewlineAtEndOfFileCheck SAT findings (#1108)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-08 22:19:54 -07:00
Wouter Born
08a1f9a86d Fix SAT constant/variable name findings (#1106)
Fixes wrong names identified by the following rules:

* ConstantNameCheck
* LocalFinalVariableNameCheck
* LocalVariableNameCheck
* StaticVariableNameCheck

Most mismatches identified by the MemberNameCheck have also been fixed except for those where the variables are used in events/DTOs etc which would cause issues.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-08 22:19:00 -07:00
Christoph Weitkamp
c86300e420 Fixed wrong trimmed properties (#1105)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-08 09:52:14 -07:00
Wouter Born
12b3c1030f Fix SAT "Initial contribution" warnings (#1100)
Fixes the SAT warning: First javadoc author should have "Initial contribution" contribution description.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-07 21:25:40 -07:00
Wouter Born
3dacba3510 Fix SAT ModifierOrderCheck findings by using JLS suggested modifier order (#1103)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-07 21:24:16 -07:00
Wouter Born
7d3c5a1874 Remove @since JavaDoc tags (#1102)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-07 21:21:51 -07:00
Christoph Weitkamp
c31a5aa7ef [storage] Added nullness annotations (#1099)
* Added nullness annotations

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-07 20:50:39 +02:00
Christoph Weitkamp
6a3c9b03ac Replaced orphaned 'registerHandlerLock' by 'thingLocks' (#1060)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-06 11:17:51 +02:00
Wouter Born
9ae7bbe2e8 Move remaining unit tests (#1095)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-04 21:35:13 -07:00
Christoph Weitkamp
2bb5cb7f64 [ephemeris] Adopted configuration for Ephemeris service (#919)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-04 21:33:43 -07:00
Christoph Weitkamp
e1d2ae1c43 [config dispatch] Added support for values containing a list of configuration options (#999)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-03 21:21:12 -07:00
Wouter Born
49f6afc72a Move IO HTTP unit tests (#1081)
* Move IO HTTP unit tests

All IO HTTP tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 22:22:00 +02:00
Wouter Born
f5f58643f4 Move thing XML unit tests (#1079)
* Move thing XML unit tests

Moves the thing XML unit tests from the itests project to the bundle project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 22:21:10 +02:00
Wouter Born
eba9be756b Move UI unit tests (#1078)
* Move UI unit tests

All UI tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 22:20:20 +02:00
Wouter Born
8c17753006 Move voice unit tests (#1077)
* Move voice unit tests

Moves the voice unit tests from the itests project to the bundle project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 22:19:30 +02:00
Wouter Born
8bed617a48 Move compat1x unit tests (#1080)
* Move compat1x unit tests

All compat1x tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 20:00:57 +02:00
Wouter Born
f1f0e9e52b Move IO Net unit tests (#1082)
* Move IO Net unit tests

All IO Net tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 20:00:04 +02:00
Wouter Born
4e07b56279 Move magic unit tests (#1083)
* Move magic unit tests

All magic tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:59:02 +02:00
Wouter Born
28bc05e774 Move model LSP unit tests (#1084)
* Move model LSP unit tests

All model LSP tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:57:48 +02:00
Wouter Born
8af30cc53b Move semantics unit tests (#1085)
* Move semantics unit tests

All semantics tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:57:01 +02:00
Wouter Born
7fc9fa65e9 Move transform unit tests (#1076)
* Move transform unit tests

All transform tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:54:20 +02:00
Wouter Born
c2c57dbf10 Move UI icon unit tests (#1075)
* Move UI icon unit tests

All UI icon tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:53:26 +02:00
Wouter Born
f53beab04c Move thing unit tests (#1074)
* Move thing unit tests

Moves the thing unit tests from the itests project to the bundle project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:52:40 +02:00
Wouter Born
7926b2280e Move core unit tests (#1070)
* Move core unit tests

Moves the core unit tests from the itests project to the bundle project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:51:53 +02:00
Wouter Born
41e95ac16b Move audio unit tests (#1068)
* Move audio unit tests

All audio tests are unit tests so there is no need for an itests project.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-10-03 19:50:16 +02:00
Christoph Weitkamp
8d6bb2d9ff Removed FQN from servie declaration (#1088)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-03 13:30:04 +02:00
Hilbrand Bouwkamp
2f7689e0a7 [OAuth2] redirectURI should be optional on getAccessTokenResponseByAu… (#1073)
* [OAuth2] redirectURI should be optional on getAccessTokenResponseByAuthorizationCode

The redirectURI should be optional (Nullable) on getAccessTokenResponseByAuthorizationCode as in the JavaDoc is stated (as is stated in the refered specification).

* [OAuth2] Removed redundant NonNull

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
2019-10-03 10:27:20 +02:00
Christoph Weitkamp
8e3a521083 Contructor injection; SAT findings (#1036)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-10-01 15:20:50 +02:00
Christoph Weitkamp
e8fcba2ccf [DSL] Removed deleted things from internal map (#1058)
* Applied formatter
* Fixed warnings
* Removed deleted things from internal map

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-09-30 18:53:47 +02:00
Wouter Born
8b72770bf3 Fix MQTT gracefulStop test (#1059)
Wait for stop future to complete and fix the NPE that would cause the future not to complete.
When disconnecting the client the callback is null.

Signed-off-by: Wouter Born <github@maindrain.net>
2019-09-30 15:57:19 +02:00
Wouter Born
0b2de2bfea Reenable org.openhab.core.io.transport.upnp.tests (#1057)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-09-30 10:41:39 +02:00
Wouter Born
40418414b2 Reenable org.openhab.core.io.transport.mqtt.tests (#1056)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-09-30 08:23:06 +02:00
Wouter Born
f721a30a36 Reenable org.openhab.core.io.rest.tests (#1055)
Signed-off-by: Wouter Born <github@maindrain.net>
2019-09-29 22:52:26 +02:00
Wouter Born
c9232d9651 Inject SchedulerImpl into DelegatedSchedulerImpl to fix waiting bundles (#1054)
Fixes #1053

Signed-off-by: Wouter Born <github@maindrain.net>
2019-09-29 16:47:19 +02:00
Feras Almannaa
b48f1c1925 [rest] Allow colons and dashes in sse topic filter validator (#1052)
Fixes #1043 

Signed-off-by: Feras Almanna <firas.almanna3@gmail.com>
2019-09-29 15:06:37 +02:00
Christoph Weitkamp
d2af7a350b [core] Removed access to 'ThingRegistry' from 'BaseThingHandler' (#1041)
* Removed access to ThingRegistry from BaseThingHandler

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-09-29 12:26:46 +02:00
Christoph Weitkamp
978be4cf0f Fixed activation of inbox (#1051)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-09-28 22:24:05 +02:00
lolodomo
7b49f27823 Fix dynamic options in UI (#1050)
* Fix dynamic options in UI
* Added unit tests

Fixes #1040

Also-by: Christoph Weitkamp <github@christophweitkamp.de>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
2019-09-28 21:02:29 +02:00
Christoph Weitkamp
b9d9135771 Use constructor injection to simplify lifecycle (#1037)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-09-27 12:19:50 +02:00
Christoph Weitkamp
3087c4a427 Moved test from integration to unit test (#1044)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
2019-09-25 22:19:01 +02:00