On 1. Aug 2019, at 21:41, Hai-son X Nguyen <hai-son.ngu...@kp.org> wrote: > > for (FeatureStructure attrFS : (Iterable<? extends FeatureStructure>) > aElement.getAttributes()) { > ... > } > > I don't think it is a runtime error but a bug on the DKPro side, the FSArray > contract is FSArray<T extends FeatureStructure> implements Iterable<T>
I also don't think it'd be a runtime error, but it is also not a bug in DKPro Core. UIMA 3.0.2 (before your change) generated a getter which returned only an FSArray *without* a generic type specification. For that case, the compiler did not create an error for the type cast that I used. But with UIMA 3.0.3, the getter is now generated *with* a generic type specification which makes the type cast invalid. Your proposed change to the type-cast might fix this, but the issue is that with 3.0.2 there was no problem and with 3.0.3 there is. Anyway, I'm happy to be able to entirely remove the type-cast with UIMA 3.0.3 - thank you very much for the contribution! IMHO it's just a matter of choosing the right version number and properly documenting this quirk. -- Richard