Closed Steffen911 closed 5 years ago
Hi @Steffen911, thanks for pointing that out. I fixed the index calculation for lists of odd length, which should solve your problem. Please try the current version in the development branch.
I'm not able to reproduce this issue on the development branch. Thank you @olehmberg!
What happened: I use the Median conflict resolution in one of my AttributeValueFusers and get an IndexOutOfBounds exception on some of my RecordGroups.
What I expect to happen: There should be no exception thrown in the library.
Root cause: The linked list that is used internally covers all cases that are 0 and > 1, but in case the list is of size one the exception is thrown. https://github.com/olehmberg/winter/blob/master/winter-framework/src/main/java/de/uni_mannheim/informatik/dws/winter/datafusion/conflictresolution/numeric/Median.java#L48
A possible fix would include an update to the if statement like this:
Another possibility would be to round the
list.size() / 2
correctly. In the current implementation all decimal places will just be removed. See https://stackoverflow.com/a/2654897/6059889 on how to get a correctly rounded integer value.