Fix/suppress PMD CompareObjectsWithEquals findings (#11476)

Newer PMD versions discover more CompareObjectsWithEquals findings.

Related to https://github.com/openhab/static-code-analysis/pull/423

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-11-02 10:43:53 +01:00
committed by GitHub
parent b67b9fcb25
commit 589400e223
82 changed files with 175 additions and 141 deletions

View File

@@ -68,6 +68,7 @@ public class VeluxDiscoveryService extends AbstractDiscoveryService implements R
// Private
@SuppressWarnings("PMD.CompareObjectsWithEquals")
private void updateLocalization() {
if (localization == Localization.UNKNOWN && localeProvider != null && i18nProvider != null) {
logger.trace("updateLocalization(): creating Localization based on locale={},translation={}).",

View File

@@ -125,6 +125,7 @@ public class VeluxHandlerFactory extends BaseThingHandlerFactory {
});
}
@SuppressWarnings("PMD.CompareObjectsWithEquals")
private void updateLocalization() {
if (localization == Localization.UNKNOWN && localeProvider != null && i18nProvider != null) {
logger.trace("updateLocalization(): creating Localization based on locale={},translation={}).",

View File

@@ -129,6 +129,7 @@ final class ChannelActuatorPosition extends ChannelHandlerTemplate {
* information for this channel.
* @return newValue ...
*/
@SuppressWarnings("PMD.CompareObjectsWithEquals")
static @Nullable Command handleCommand(ChannelUID channelUID, String channelId, Command command,
VeluxBridgeHandler thisBridgeHandler) {
LOGGER.debug("handleCommand({},{},{},{}) called.", channelUID, channelId, command, thisBridgeHandler);

View File

@@ -107,6 +107,7 @@ final class ChannelVShutterPosition extends ChannelHandlerTemplate {
* information for this channel.
* @return newValue ...
*/
@SuppressWarnings("PMD.CompareObjectsWithEquals")
static @Nullable Command handleCommand(ChannelUID channelUID, String channelId, Command command,
VeluxBridgeHandler thisBridgeHandler) {
LOGGER.debug("handleCommand({},{},{},{}) called.", channelUID, channelId, command, thisBridgeHandler);

View File

@@ -135,6 +135,7 @@ public class Thing2VeluxActuator {
*
* @return <b>bridgeProductIndex</B> for accessing the Velux device (or ProductBridgeIndex.UNKNOWN if not found).
*/
@SuppressWarnings("PMD.CompareObjectsWithEquals")
public ProductBridgeIndex getProductBridgeIndex() {
if (thisProduct == VeluxProduct.UNKNOWN) {
mapThing2Velux();
@@ -151,6 +152,7 @@ public class Thing2VeluxActuator {
*
* @return <b>isKnown</B> as boolean.
*/
@SuppressWarnings("PMD.CompareObjectsWithEquals")
public boolean isKnown() {
return (!(this.getProductBridgeIndex() == ProductBridgeIndex.UNKNOWN));
}
@@ -162,6 +164,7 @@ public class Thing2VeluxActuator {
*
* @return <b>isInverted</B> for handling of values of the Velux device (or false if not found)..
*/
@SuppressWarnings("PMD.CompareObjectsWithEquals")
public boolean isInverted() {
if (thisProduct == VeluxProduct.UNKNOWN) {
mapThing2Velux();