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>
* 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>
* Added nullness annotations to o.o.c.binding.xml
* Use local variables
* Removed unuused import
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
* Added contructor injection to thing xml
* Removed Nullable from getChannels and getChannelGroups
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
* 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>
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>
* 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>
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>
* 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>
* 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>
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>
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>
* Changed pid from 'org.eclipse.smarthome.core.i18nprovider' to 'org.eclipse.smarthome.i18n'
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
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>
Fixes the SAT warning: First javadoc author should have "Initial contribution" contribution description.
Signed-off-by: Wouter Born <github@maindrain.net>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* [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>
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>
* Fix DateTimeType parsing of strings with 2 nano digits
Some formatters such as the DateTimeFormatter.ISO_LOCAL_DATE_TIME may also output a string containing 2 nano digits which fail to be parsed by DateTimeValue.
* Fix parsing of arbitrary number of nano digits for Java 11
Signed-off-by: Wouter Born <github@maindrain.net>
* Bump SAT version; Fixed high priority findings
* Defined path to feature file to avoid warnings
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>