Skip to content

[Feature]: Replace fragile string-based reference rewriting #38

Description

@samatstariongroup

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the EcoreNetto
  • I have searched open and closed issues to ensure it has not already been reported

Description

  • Summary: Cross-reference handling relies on string manipulation and hardcoded assumptions: the .ecore extension is hardcoded, %20 is the only URL escape decoded, and implicit #// references are rewritten by string concatenation. This is brittle for paths with other escaped characters or different extensions.
  • Affected files: ECoreNetto/ModelElement/EObject.cs:392-416 (ProcessAttributeValue), ECoreNetto/ECoreParser.cs:85 (Replace("%20", " ")), ECoreNetto/Resource/Resource.cs:255 (.ecore check), ECoreNetto/ModelElement/NamedElement/EPackage.cs:212
  • Proposed solution: Use Uri/Uri.UnescapeDataString for path decoding and proper URI fragment handling instead of ad-hoc string ops; avoid hardcoding the file extension where possible.
  • Acceptance criteria:
    • Paths containing escaped characters beyond %20 load correctly.
    • Reference rewriting no longer depends on a hardcoded extension string in the hot path.
    • Tests cover an escaped-path and a cross-resource reference scenario.
    • [ ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions