Conversation
…or first property
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates how href properties are processed by using HrefList only for multiple href elements and removing deprecated shortcuts and helpers.
- Updated tests to reflect that only a single href is used from the provided list.
- Removed the shortcut “href” from HrefListProperty and replaced webdav imports with common imports.
- Removed the deprecated UrlUtils.equals() method and updated the XmlReader logic to capture only the first matching tag.
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/test/kotlin/at/bitfire/dav4jvm/property/OwnerTest.kt | Added tests for empty, multiple, and invalid owner hrefs |
| src/main/kotlin/at/bitfire/dav4jvm/property/webdav/Owner.kt | Switched from extending HrefListProperty to using a dedicated href property |
| src/main/kotlin/at/bitfire/dav4jvm/property/common/HrefListProperty.kt | Removed the first-element shortcut and updated package and API usage |
| Other property files (GroupMembership, AddressbookHomeSet, Source, CalendarUserAddressSet, CalendarProxyWriteFor, CalendarProxyReadFor, CalendarHomeSet) | Updated imports to reference the common HrefListProperty |
| src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt | Adjusted tag processing to capture only the first matching entry |
| src/main/kotlin/at/bitfire/dav4jvm/UrlUtils.kt | Removed the deprecated equals() method |
Comments suppressed due to low confidence (2)
src/main/kotlin/at/bitfire/dav4jvm/XmlReader.kt:93
- It would be helpful to document that the extra condition 'result == null' is purposely used to capture only the first matching tag, ensuring consistent processing of multiple href elements.
if (eventType == XmlPullParser.START_TAG && parser.depth == depth + 1 && parser.propertyName() == name && result == null)
src/main/kotlin/at/bitfire/dav4jvm/property/common/HrefListProperty.kt:24
- Since the shortcut accessor 'href' was removed in favor of processing all href values separately, please consider adding a comment clarifying this change for future maintainability.
abstract class HrefListProperty(
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
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.
UrlUtils.equals()