Skip to content

Tidy up Path, PathStringUtils, and PathService #233

@edwardcrichton

Description

@edwardcrichton

There is a class PathStringUtils that could be replaced by implementing these functions in Path
PathService uses PathStringUtils and could use Path instead
PathService.findItemForPath uses a substring match for finding whether a path belongs to a particular version, which may match areas that are not about the version of a path
e.g.
fo:Test folder|dm:main datamodel $1.0.0|dc:label for dataclass
fo:main folder|dm:datamodel label $1.0.0|dc:label for dataclass

would both match the version string 'main'

A quick fix would be to swap out

it.path?.pathString?.contains(versionString)

for

it.path?.pathString?.contains("$${versionString}|") || it.path?.pathString?.endsWith("$${versionString}")

but ultimately, a path.getVersion() method would remove the need for PathService to need to know and parse the syntax of a Path

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions