Skip to content

Conversation

@axunonb
Copy link
Collaborator

@axunonb axunonb commented May 31, 2025

Calendar: Remove Equals and GetHashCode overrides
CalendarEvent (RecurringComponent): Remove Equals and GetHashCode overrides
CalendarCollection: Remove Equals and GetHashCode overrides
RecurringComponent: Remove Equals and GetHashCode overrides
Journal (RecurringComponent): Remove Equals and GetHashCode overrides
Alarm (RecurringComponent): Remove Equals and GetHashCode overrides
VTimeZone (RecurringComponent): Remove Equals and GetHashCode overrides
AlarmOccurrence (RecurringComponent): Remove Equals and GetHashCode overrides, IComparable
Attachment: Remove Equals and GetHashCode overrides
Attendee: Remove Equals and GetHashCode overrides
GeographicLocation: Remove Equals and GetHashCode overrides
Organizer: Remove Equals and GetHashCode overrides
PeriodList: Remove Equals and GetHashCode overrides
RecurrencePattern: Remove Equals and GetHashCode overrides
Trigger: Remove Equals and GetHashCode overrides
VTimeZoneInfo: Remove Equals and GetHashCode overrides

Resolves #274

@axunonb axunonb requested a review from minichma May 31, 2025 13:23
@axunonb axunonb marked this pull request as ready for review May 31, 2025 13:23
minichma
minichma previously approved these changes May 31, 2025
Copy link
Collaborator

@minichma minichma left a comment

Choose a reason for hiding this comment

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

LGTM. JFYI, I tried to set breakpoints on the main branch in the methods being removed by this branch and ran the updated unit tests. There are still quite some invocations throughout the test cases, mostly comparing some components for equality or adding them to HashSets. Not sure any of them need to be updated.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 1, 2025

@axunonb
Copy link
Collaborator Author

axunonb commented Jun 1, 2025

LGTM. JFYI, I tried to set breakpoints on the main branch in the methods being removed by this branch and ran the updated unit tests. There are still quite some invocations throughout the test cases, mostly comparing some components for equality or adding them to HashSets. Not sure any of them need to be updated.

Thanks for the review. Indeed there were a some of tests left to be removed using Equals and GetHashCode explicily.
The other hits of the breakpoints are implicit calls, mostly from using HashSets, that can't be avoided, but but have no impact on test results.

@axunonb axunonb merged commit d1b58c7 into ical-org:main Jun 1, 2025
4 checks passed
@axunonb axunonb deleted the wip/axunonb/pr/equality branch June 1, 2025 11:30
axunonb added a commit to axunonb/ical.net that referenced this pull request Jun 4, 2025
…#810)

* `Calendar`: Remove Equals and GetHashCode overrides

* `CalendarEvent`: Remove Equals and GetHashCode overrides

* `CalendarCollection`: Remove Equals and GetHashCode overrides

* `RecurringComponent`: Remove Equals and GetHashCode overrides

* `Journal`: Remove Equals and GetHashCode overrides

* `AlarmOccurrence` (`RecurringComponent`): Remove Equals and GetHashCode overrides, IComparable<AlarmOccurrence>

* `Attachment`: Remove Equals and GetHashCode overrides

* `Attendee`: Remove Equals and GetHashCode overrides

* `GeographicLocation`: Remove Equals and GetHashCode overrides

* `Organizer`, `PeriodList`: Remove Equals and GetHashCode overrides

* `RecurrencePattern`: Remove Equals and GetHashCode overrides

* `Trigger`: Remove Equals and GetHashCode overrides

* `VTimeZoneInfo`: Remove Equals and GetHashCode overrides

* Remove remaining test with explict calls to `Equals` and `GetHashCode`
axunonb added a commit to axunonb/ical.net that referenced this pull request Jun 5, 2025
…#810)

* `Calendar`: Remove Equals and GetHashCode overrides

* `CalendarEvent`: Remove Equals and GetHashCode overrides

* `CalendarCollection`: Remove Equals and GetHashCode overrides

* `RecurringComponent`: Remove Equals and GetHashCode overrides

* `Journal`: Remove Equals and GetHashCode overrides

* `AlarmOccurrence` (`RecurringComponent`): Remove Equals and GetHashCode overrides, IComparable<AlarmOccurrence>

* `Attachment`: Remove Equals and GetHashCode overrides

* `Attendee`: Remove Equals and GetHashCode overrides

* `GeographicLocation`: Remove Equals and GetHashCode overrides

* `Organizer`, `PeriodList`: Remove Equals and GetHashCode overrides

* `RecurrencePattern`: Remove Equals and GetHashCode overrides

* `Trigger`: Remove Equals and GetHashCode overrides

* `VTimeZoneInfo`: Remove Equals and GetHashCode overrides

* Remove remaining test with explict calls to `Equals` and `GetHashCode`

Remove redundant `Equals` and `GetHashCode` implementations (ical-org#810)

* `Calendar`: Remove Equals and GetHashCode overrides

* `CalendarEvent`: Remove Equals and GetHashCode overrides

* `CalendarCollection`: Remove Equals and GetHashCode overrides

* `RecurringComponent`: Remove Equals and GetHashCode overrides

* `Journal`: Remove Equals and GetHashCode overrides

* `AlarmOccurrence` (`RecurringComponent`): Remove Equals and GetHashCode overrides, IComparable<AlarmOccurrence>

* `Attachment`: Remove Equals and GetHashCode overrides

* `Attendee`: Remove Equals and GetHashCode overrides

* `GeographicLocation`: Remove Equals and GetHashCode overrides

* `Organizer`, `PeriodList`: Remove Equals and GetHashCode overrides

* `RecurrencePattern`: Remove Equals and GetHashCode overrides

* `Trigger`: Remove Equals and GetHashCode overrides

* `VTimeZoneInfo`: Remove Equals and GetHashCode overrides

* Remove remaining test with explict calls to `Equals` and `GetHashCode`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement GetHashCode and Equals in terms of the type hierarchy

2 participants