Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not override toString() for the Identifier anymore #1266

Merged
merged 6 commits into from
Feb 7, 2019

Conversation

sschuberth
Copy link
Member

@sschuberth sschuberth commented Feb 5, 2019

Please have a look at the individual commit messages for the details.


This change is Reviewable

@sschuberth sschuberth force-pushed the id-no-tostring branch 6 times, most recently from fd49f8a to fb27ae4 Compare February 5, 2019 20:25
@sschuberth sschuberth changed the title Do not override toString() for the Identifier anymore [WIP] Do not override toString() for the Identifier anymore Feb 6, 2019
@sschuberth sschuberth force-pushed the id-no-tostring branch 9 times, most recently from cf28e50 to e0e5a80 Compare February 7, 2019 10:47
This is a fixup for 3209b28.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
getValue() throws an exception if the key does not exist and thus always
returns a non-nullable value.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Besides the known benefits when refactoring, this allows for adding e.g.
a toPurl() function instead of having to decide for toString() to return
either coordinates or a package URL [1].

[1] https://github.com/package-url/purl-spec

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
This is unused so far, but serves as a reference.

Signed-off-by: Sebastian Schuberth <sebastian.schuberth@here.com>
@sschuberth sschuberth changed the title [WIP] Do not override toString() for the Identifier anymore Do not override toString() for the Identifier anymore Feb 7, 2019
@sschuberth
Copy link
Member Author

@mnonnenmacher, this is now also ready for review. I've removed the BOOM! commit as overriding the different toString() functions did not trigger any exceptions anymore.

@sschuberth sschuberth merged commit 81e2048 into master Feb 7, 2019
@sschuberth sschuberth deleted the id-no-tostring branch February 7, 2019 16:33
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.

2 participants