RecurrenceRule.setByDayPart doesn't remove BYDAY part when given an empty list
Closed this issue · 1 comments
janusvm commented
Calling RecurrenceRule#setByDayPart
with an empty list seems to include that empty list in the parts map — I believe it's due to a missing else
or return
in the method:
lib-recur/src/main/java/org/dmfs/rfc5545/recur/RecurrenceRule.java
Lines 1957 to 1965 in d59e866
This makes the resulting rule have an empty BYDAY-value, e.g. "FREQ=MONTHLY;BYMONTHDAY=31;BYDAY="
, eventually leading to an "too many empty recurrence sets" exception when expanding the rule.
dmfs commented
Admittedly, the setters never were a real use case for me so far, that's probably why they are so poorly tested. Thanks for reporting and fixing this. I hope there are no other bad surprises there.