-
Notifications
You must be signed in to change notification settings - Fork 3
Remove possibility to subclass AndroidEvent #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Remove AndroidEventFactory because it's not meant to be subclassed anymore
Contributor
There was a problem hiding this 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. |
d1ee1fe to
032fe6f
Compare
sunkup
pushed a commit
that referenced
this pull request
Jan 14, 2026
* - Move features from LocalEvent to AndroidEvent - Remove AndroidEventFactory because it's not meant to be subclassed anymore * AndroidEvent: use private methods * Move tests * Move InitCalendarProviderRule
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
LocalEventtoAndroidEventAndroidEventFactory