Skip to content

Disallow subclassing of DmfsTaskList#160

Merged
sunkup merged 1 commit intomainfrom
disallow-subclassing-DmfsTaskList
Dec 11, 2025
Merged

Disallow subclassing of DmfsTaskList#160
sunkup merged 1 commit intomainfrom
disallow-subclassing-DmfsTaskList

Conversation

@sunkup
Copy link
Member

@sunkup sunkup commented Dec 11, 2025

Rewrite of tasks handling in synctools to separate layers for storage + mapping. See #116

Disallows subclassing of DmfsTaskList (LocalTaskList in DAVx⁵) analogous to how it is already the case for AndroidCalendar and LocalCalendar.

Required for bitfireAT/davx5-ose#1882

@sunkup sunkup added the refactoring Quality improvement of existing functions label Dec 11, 2025
@sunkup sunkup self-assigned this Dec 11, 2025
@sunkup sunkup marked this pull request as ready for review December 11, 2025 14:22
@sunkup sunkup requested a review from a team as a code owner December 11, 2025 14:22
Copy link
Member

@rfc2822 rfc2822 left a comment

Choose a reason for hiding this comment

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

Looks good.

At least very few words in the PR description would be helpful to know what this PR aims to do and why.

For merging it would be good if it could be merged together with a davx5-ose PR (that should be referenced in this PR and the other way round) that reflects the changes in DAVx5 (so that there's never a situation where the newest synctools can't be used in DAVx5).

@sunkup sunkup merged commit 42e82f4 into main Dec 11, 2025
7 checks passed
@sunkup sunkup deleted the disallow-subclassing-DmfsTaskList branch December 11, 2025 14:35
@rfc2822 rfc2822 requested a review from Copilot December 11, 2025 14:55
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 refactors the task list handling to disallow subclassing of DmfsTaskList, making it analogous to how AndroidCalendar and LocalCalendar are already structured. This change removes the factory pattern in favor of direct instantiation.

Key changes:

  • Removed the factory pattern by deleting DmfsTaskListFactory interface and removing generic type parameters from factory methods
  • Made DmfsTaskList a final class (removed open keyword) to prevent subclassing
  • Converted TestTaskList from a subclass to an object with a factory method that returns DmfsTaskList

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
lib/src/main/kotlin/at/bitfire/ical4android/DmfsTaskListFactory.kt Removed the factory interface entirely as it's no longer needed
lib/src/main/kotlin/at/bitfire/ical4android/DmfsTaskList.kt Made class final, removed Factory object, and simplified findByID and find methods to return DmfsTaskList directly
lib/src/androidTest/kotlin/at/bitfire/ical4android/impl/TestTaskList.kt Converted from a subclass to an object with a create() factory method returning DmfsTaskList
lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsTaskTest.kt Updated variable type from TestTaskList to DmfsTaskList
lib/src/androidTest/kotlin/at/bitfire/ical4android/DmfsTaskListTest.kt Removed TestTaskList import and updated findByID call to remove factory parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants