Examples of errors detected by the V6058 diagnostic


V6058. Comparing objects of incompatible types.


Elasticsearch

V6058 The 'equals' function compares objects of incompatible types: Integer, TimeValue. DatafeedUpdate.java(375)


....
private final TimeValue queryDelay;
private final TimeValue frequency;
....
private final Integer scrollSize;
....

boolean isNoop(DatafeedConfig datafeed)
{
  return (frequency == null
          || Objects.equals(frequency, datafeed.getFrequency()))
    && (queryDelay == null
        || Objects.equals(queryDelay, datafeed.getQueryDelay()))
    && (scrollSize == null
        || Objects.equals(scrollSize, datafeed.getQueryDelay())) // <=
    && ....)
}


Bugs Found

Checked Projects
354
Collected Errors
13 290