You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tamaya.apache.org by "P. Ottlinger" <po...@apache.org> on 2016/08/31 18:28:22 UTC

question concerning a findbugs warning / PropertySourceChangeBuilder.java:102/110

Hi!

When I tried to find out why the build broke I stumbled upon the
findbugs warnings, the high priority one looks like a bug to me: a
string is compared to a PropertyValue .... do we need to call
getProperty(String) first before comparing?

<snip>
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).
</snip>

Please adapt the buildnumber to the latest one:

https://builds.apache.org/job/Tamaya-Master-branch/708/findbugsResult/HIGH/

Phil

Re: question concerning a findbugs warning / PropertySourceChangeBuilder.java:102/110

Posted by "P. Ottlinger" <po...@apache.org>.
Am 31.08.2016 um 20:45 schrieb Anatole Tresch:
> THANKS.

https://issues.apache.org/jira/browse/TAMAYA-172
it is :-)

Cheers,
Phil


Re: question concerning a findbugs warning / PropertySourceChangeBuilder.java:102/110

Posted by Anatole Tresch <at...@gmail.com>.
THANKS.

2016-08-31 20:44 GMT+02:00 Anatole Tresch <at...@gmail.com>:

> Yeah. Then I can have a look at it when I am back from MesosCon ;)
>
> 2016-08-31 20:43 GMT+02:00 P. Ottlinger <po...@apache.org>:
>
>> Am 31.08.2016 um 20:32 schrieb Anatole Tresch:
>> > Basically comparing an object of type A with an instance of type B
>> without
>> > any inheritance relationship beyond Object makes no sense. The question
>> is
>> > what the String is representing: a value or the key and what the code
>> there
>> > is supposed to do. A fact is that equals will (and should) always return
>> > false.
>>
>> I assumed we want to compare the keys of the properties .... but maybe
>> the actual values would make more sense.
>>
>> Shall I file a bug ticket for that warning?
>>
>> Phil
>>
>
>
>
> --
> *Anatole Tresch*
> PPMC Member Apache Tamaya
> JCP Star Spec Lead
> *Switzerland, Europe Zurich, GMT+1*
> *maketechsimple.wordpress.com <http://maketechsimple.wordpress.com/> *
> *Twitter:  @atsticks, @tamayaconf*
>
>


-- 
*Anatole Tresch*
PPMC Member Apache Tamaya
JCP Star Spec Lead
*Switzerland, Europe Zurich, GMT+1*
*maketechsimple.wordpress.com <http://maketechsimple.wordpress.com/> *
*Twitter:  @atsticks, @tamayaconf*

Re: question concerning a findbugs warning / PropertySourceChangeBuilder.java:102/110

Posted by Anatole Tresch <at...@gmail.com>.
Yeah. Then I can have a look at it when I am back from MesosCon ;)

2016-08-31 20:43 GMT+02:00 P. Ottlinger <po...@apache.org>:

> Am 31.08.2016 um 20:32 schrieb Anatole Tresch:
> > Basically comparing an object of type A with an instance of type B
> without
> > any inheritance relationship beyond Object makes no sense. The question
> is
> > what the String is representing: a value or the key and what the code
> there
> > is supposed to do. A fact is that equals will (and should) always return
> > false.
>
> I assumed we want to compare the keys of the properties .... but maybe
> the actual values would make more sense.
>
> Shall I file a bug ticket for that warning?
>
> Phil
>



-- 
*Anatole Tresch*
PPMC Member Apache Tamaya
JCP Star Spec Lead
*Switzerland, Europe Zurich, GMT+1*
*maketechsimple.wordpress.com <http://maketechsimple.wordpress.com/> *
*Twitter:  @atsticks, @tamayaconf*

Re: question concerning a findbugs warning / PropertySourceChangeBuilder.java:102/110

Posted by "P. Ottlinger" <po...@apache.org>.
Am 31.08.2016 um 20:32 schrieb Anatole Tresch:
> Basically comparing an object of type A with an instance of type B without
> any inheritance relationship beyond Object makes no sense. The question is
> what the String is representing: a value or the key and what the code there
> is supposed to do. A fact is that equals will (and should) always return
> false.

I assumed we want to compare the keys of the properties .... but maybe
the actual values would make more sense.

Shall I file a bug ticket for that warning?

Phil

Re: question concerning a findbugs warning / PropertySourceChangeBuilder.java:102/110

Posted by Anatole Tresch <at...@gmail.com>.
Basically comparing an object of type A with an instance of type B without
any inheritance relationship beyond Object makes no sense. The question is
what the String is representing: a value or the key and what the code there
is supposed to do. A fact is that equals will (and should) always return
false.

J Anatole


2016-08-31 20:28 GMT+02:00 P. Ottlinger <po...@apache.org>:

> Hi!
>
> When I tried to find out why the build broke I stumbled upon the
> findbugs warnings, the high priority one looks like a bug to me: a
> string is compared to a PropertyValue .... do we need to call
> getProperty(String) first before comparing?
>
> <snip>
> 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).
> </snip>
>
> Please adapt the buildnumber to the latest one:
>
> https://builds.apache.org/job/Tamaya-Master-branch/708/
> findbugsResult/HIGH/
>
> Phil
>



-- 
*Anatole Tresch*
PPMC Member Apache Tamaya
JCP Star Spec Lead
*Switzerland, Europe Zurich, GMT+1*
*maketechsimple.wordpress.com <http://maketechsimple.wordpress.com/> *
*Twitter:  @atsticks, @tamayaconf*