Skip to content

Conversation

@rfc2822
Copy link
Member

@rfc2822 rfc2822 commented Jun 27, 2025

  • Move missing features from DAVx5 LocalEvent to AndroidEvent
  • Remove AndroidEventFactory

- Remove AndroidEventFactory because it's not meant to be subclassed anymore
@rfc2822 rfc2822 added the refactoring Quality improvement of existing functions label Jun 27, 2025
@rfc2822 rfc2822 changed the title Remove subclassing of AndroidEvent Remove possibility to subclass AndroidEvent Jun 27, 2025
@rfc2822 rfc2822 marked this pull request as ready for review June 27, 2025 11:03
@rfc2822 rfc2822 requested a review from Copilot June 27, 2025 11:03
@rfc2822 rfc2822 self-assigned this Jun 27, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aims to remove the possibility of subclassing AndroidEvent by moving any missing DAVx5 LocalEvent features directly into AndroidEvent and eliminating the AndroidEventFactory.

  • Removed AndroidEventFactory entirely.
  • Converted various protected methods in AndroidEvent to private and updated the generic constraints in AndroidCalendar and AndroidCalendarFactory to align with the removal of subclassing.
  • Updated test cases to directly instantiate AndroidEvent instead of a subclass (TestEvent).

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/src/main/kotlin/at/bitfire/ical4android/AndroidEventFactory.kt Deleted the factory interface, as subclassing is no longer supported.
lib/src/main/kotlin/at/bitfire/ical4android/AndroidEvent.kt Changed method access modifiers (protected → private), updated constructors, and refined internal implementation to prevent subclassing.
lib/src/main/kotlin/at/bitfire/ical4android/AndroidCalendarFactory.kt Updated generic parameter constraints to remove dependency on AndroidEvent.
lib/src/main/kotlin/at/bitfire/ical4android/AndroidCalendar.kt Adjusted generic parameters and updated the instantiation of events using AndroidEvent.
lib/src/androidTest/kotlin/at/bitfire/ical4android/impl/TestEvent.kt Removed TestEvent by deleting the file since subclassing has been removed.
lib/src/androidTest/kotlin/at/bitfire/ical4android/impl/TestCalendar.kt Updated TestCalendar to use the updated AndroidCalendar constructor.
lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidEventTest.kt Replaced usages of TestEvent with AndroidEvent and updated assertions accordingly.
lib/src/androidTest/kotlin/at/bitfire/ical4android/AndroidCalendarTest.kt Updated test event additions to reflect changes in event instantiation.

@rfc2822 rfc2822 force-pushed the localevent-features branch from d1ee1fe to 032fe6f Compare June 27, 2025 12:14
@rfc2822 rfc2822 linked an issue Jun 27, 2025 that may be closed by this pull request
@rfc2822 rfc2822 merged commit 46c18b9 into main Jun 27, 2025
9 checks passed
@rfc2822 rfc2822 deleted the localevent-features branch June 27, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Quality improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AndroidEvent must not be subclassed anymore

1 participant