You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tamaya.apache.org by "Anatole Tresch (JIRA)" <ji...@apache.org> on 2016/09/11 20:17:20 UTC

[jira] [Resolved] (TAMAYA-172) Fix findbugs warning about wrong comparison via equals in PropertySourceChangeBuilder

     [ https://issues.apache.org/jira/browse/TAMAYA-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anatole Tresch resolved TAMAYA-172.
-----------------------------------
    Resolution: Fixed

> Fix findbugs warning about wrong comparison via equals in PropertySourceChangeBuilder
> -------------------------------------------------------------------------------------
>
>                 Key: TAMAYA-172
>                 URL: https://issues.apache.org/jira/browse/TAMAYA-172
>             Project: Tamaya
>          Issue Type: Bug
>          Components: Modules
>    Affects Versions: 0.2-incubating
>         Environment: https://builds.apache.org/job/Tamaya-Master-branch/708/findbugsResult/HIGH/
>            Reporter: Philipp Ottlinger
>            Assignee: Anatole Tresch
>             Fix For: 0.3-incubating
>
>
> The findbugs warning indicates an error while comparing/merging property values:
> {code}
> PropertySourceChangeBuilder.java:102, EC_UNRELATED_TYPES, Priority: High
> Call to org.apache.tamaya.spi.PropertyValue.equals(String) in org.apache.tamaya.events.PropertySourceChangeBuilder.compare(PropertySource, PropertySource)
> This method calls equals(Object) on two references of different class types and analysis suggests they will be to objects of different classes at runtime. Further, examination of the equals methods that would be invoked suggest that either this call will always return false, or else the equals method is not be symmetric (which is a property required by the contract for equals in class Object). 
> {code}
> It's not really clear whether values or entry keys need to be compared here, but its definitely wrong to compare String to PropertyValue at line 102 and 110.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)