diff --git a/lib/src/main/kotlin/at/bitfire/ical4android/validation/EventValidator.kt b/lib/src/main/kotlin/at/bitfire/ical4android/validation/EventValidator.kt index dcc14b53..6bee7881 100644 --- a/lib/src/main/kotlin/at/bitfire/ical4android/validation/EventValidator.kt +++ b/lib/src/main/kotlin/at/bitfire/ical4android/validation/EventValidator.kt @@ -170,16 +170,17 @@ object EventValidator { /** * Removes all recurrence information of exceptions of (potentially recurring) events. This is: * `RRULE`, `RDATE` and `EXDATE`. - * Note: This repair step needs to be applied after all exceptions have been found + * Note: This repair step needs to be applied after all exceptions have been found. * * @param exceptions exceptions of an event */ @VisibleForTesting internal fun removeRecurrenceOfExceptions(exceptions: List) { for (exception in exceptions) { - exception.rRules.clear() // Drop all RRULEs for the exception - exception.rDates.clear() // Drop all RDATEs for the exception - exception.exDates.clear() // Drop all EXDATEs for the exception + // Drop all RRULEs, RDATEs, EXDATEs for the exception + exception.rRules.clear() + exception.rDates.clear() + exception.exDates.clear() } } diff --git a/lib/src/test/kotlin/at/bitfire/ical4android/validation/EventValidatorTest.kt b/lib/src/test/kotlin/at/bitfire/ical4android/validation/EventValidatorTest.kt index 78fa2828..6dadd08f 100644 --- a/lib/src/test/kotlin/at/bitfire/ical4android/validation/EventValidatorTest.kt +++ b/lib/src/test/kotlin/at/bitfire/ical4android/validation/EventValidatorTest.kt @@ -371,7 +371,7 @@ class EventValidatorTest { } @Test - fun testRemoveRrulesOfRruleExceptions() { + fun testRemoveRecurrencesOfRecurringWithExceptions() { // Test manually created event val tz = DateUtils.ical4jTimeZone("Europe/Paris") val manualEvent = Event().apply { @@ -475,6 +475,8 @@ class EventValidatorTest { )).first() assertTrue(eventFromReader.rRules.size == 1) assertTrue(eventFromReader.exceptions.first().rRules.isEmpty()) + assertTrue(eventFromReader.exceptions.first().rDates.isEmpty()) + assertTrue(eventFromReader.exceptions.first().exDates.isEmpty()) } @Test