Skip to content

Conversation

@ArnyminerZ
Copy link
Member

No description provided.

@ArnyminerZ ArnyminerZ requested review from Copilot and rfc2822 October 29, 2025 14:43
@ArnyminerZ ArnyminerZ self-assigned this Oct 29, 2025
@ArnyminerZ ArnyminerZ added the refactoring Internal improvement of existing functions label Oct 29, 2025
@ArnyminerZ ArnyminerZ linked an issue Oct 29, 2025 that may be closed by this pull request
Copy link

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 pull request refactors the HREF constant definition by moving it from DavResource.Companion to HrefListProperty.Companion, improving code organization and reducing coupling between classes.

Key changes:

  • Added HREF constant to HrefListProperty.Companion
  • Updated references within HrefListProperty to use the local HREF constant
  • Removed dependency on DavResource import in HrefListProperty

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

fun create(parser: XmlPullParser, list: HrefListProperty): HrefListProperty {
val hrefs = list.hrefs.toMutableList()
XmlReader(parser).readTextPropertyList(DavResource.Companion.HREF, hrefs)
XmlReader(parser).readTextPropertyList(HREF, hrefs)
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The HREF constant is now referenced without qualification, but it's defined in a companion object at the end of the same abstract class. Other usages in the codebase (e.g., Response.kt at line 134 and Owner.kt at line 36) still reference DavResource.Companion.HREF. These should be updated to use HrefListProperty.HREF instead for consistency, or this change creates fragmentation where the same constant exists in two places with different usages across the codebase.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Well, it's a good point. But I don't know if I want to update all usages. At least right now.

) -> PropertyType): PropertyType {
val hrefs = mutableListOf<String>()
XmlReader(parser).readTextPropertyList(DavResource.Companion.HREF, hrefs)
XmlReader(parser).readTextPropertyList(HREF, hrefs)
Copy link

Copilot AI Oct 29, 2025

Choose a reason for hiding this comment

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

The HREF constant is now referenced without qualification, but it's defined in a companion object at the end of the same abstract class. Other usages in the codebase (e.g., Response.kt at line 134 and Owner.kt at line 36) still reference DavResource.Companion.HREF. These should be updated to use HrefListProperty.HREF instead for consistency, or this change creates fragmentation where the same constant exists in two places with different usages across the codebase.

Suggested change
XmlReader(parser).readTextPropertyList(HREF, hrefs)
XmlReader(parser).readTextPropertyList(HrefListProperty.HREF, hrefs)

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring Internal improvement of existing functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix misimport of ktor variable in common module

1 participant