Examples of errors detected by the V6066 diagnostic
V6066. Passing objects of incompatible types to the method of collection.
Apache Flink
V6066 The type of object passed as argument is incompatible with the type of collection: String, ListStateDescriptor<NextTransactionalIdHint>. FlinkKafkaProducer.java(1083)
public interface OperatorStateStore
{
Set<String> getRegisteredStateNames();
}
public class FlinkKafkaProducer<IN> extends ....
{
....
private static final
ListStateDescriptor<FlinkKafkaProducer.NextTransactionalIdHint>
NEXT_TRANSACTIONAL_ID_HINT_DESCRIPTOR = ....;
@Override
public void initializeState(FunctionInitializationContext context)....
{
....
if (context.getOperatorStateStore()
.getRegisteredStateNames()
.contains(NEXT_TRANSACTIONAL_ID_HINT_DESCRIPTOR)) // <=
{
migrateNextTransactionalIdHindState(context);
}
....
}
}
NGB
V6066 The type of object passed as argument is incompatible with the type of collection: String, Allele. VcfGa4ghReader.java(535)
private static OrganismType determineHeterozygousGenotypeGA4GH(
VariantGA4GH ga4GHEntity, List<Allele> alleles, int[] genotypeArray) {
OrganismType organismType = null;
for (int i = 0; i < genotypeArray.length; i++) {
if (alleles.get(i).isReference()) {
genotypeArray[i] = 0;
organismType = OrganismType.HETEROZYGOUS;
} else {
if (organismType == null) {
organismType = OrganismType.HETERO_VAR;
}
genotypeArray[i] = ga4GHEntity.getAlternateBases()
.indexOf(alleles.get(i)) + 1; // <=
}
}
return organismType;
}
Apache Kafka
V6066 The type of object passed as argument is incompatible with the type of collection: String, Uuid. MockAdminClient.java 569
private final Map<String, Uuid> topicIds = new HashMap();
private Map<String, KafkaFutureVoid> handleDeleteTopicsUsingNames(....) {
....
Collection<String> topicNames = new ArrayList<>(topicNameCollection);
for (final String topicName : topicNames) {
KafkaFutureImpl<Void> future = new KafkaFutureImpl<>();
if (allTopics.remove(topicName) == null) {
....
} else {
topicNames.remove(topicIds.remove(topicName)); // <=
future.complete(null);
}
....
}
}