You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by Christophe Le Saëc <ch...@gmail.com> on 2023/01/09 07:44:35 UTC

Question about CodeQL in Java

Hello,
Code QL complains here
<https://github.com/apache/avro/pull/1776/checks?check_run_id=10481957660>
about one of my PR : *Class RecordSchema overrides but not hashCode*.
But, this is still the case on master (equals is redefine for RecordSchema
class, and not hashCode, while this is computeHash that is redefined and
that is called by parent class hashCode method). On same PR (and in master
too), this also the case for FixedSchema class
<https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L1283>
for which codeQL doesn't complains (and this class doesn't have
@SuppressWarnings
annotation).

What i didn't see ?

Regards,
Christophe.

Re: Question about CodeQL in Java

Posted by Christophe Le Saëc <ch...@gmail.com>.
It seems that CodeQL targets only updated classes; so the alert about
"*overrides
but not hashCode*" also applies to other classes like FixedSchema if it is
updated.
The tools doesn't see that here, computeHash is replacing hashCode (called
by Schema.hashcode method).
Is there any clue to solve it ? or do we have to apply same kind of
strategy for equals ?

Le lun. 9 janv. 2023 à 08:44, Christophe Le Saëc <ch...@gmail.com> a
écrit :

> Hello,
> Code QL complains here
> <https://github.com/apache/avro/pull/1776/checks?check_run_id=10481957660>
> about one of my PR : *Class RecordSchema overrides but not hashCode*.
> But, this is still the case on master (equals is redefine for RecordSchema
> class, and not hashCode, while this is computeHash that is redefined and
> that is called by parent class hashCode method). On same PR (and in master
> too), this also the case for FixedSchema class
> <https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L1283>
> for which codeQL doesn't complains (and this class doesn't have @SuppressWarnings
> annotation).
>
> What i didn't see ?
>
> Regards,
> Christophe.
>