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

relativize shouldn't return null #89

Open
johnomalley opened this issue Oct 12, 2013 · 2 comments
Open

relativize shouldn't return null #89

johnomalley opened this issue Oct 12, 2013 · 2 comments

Comments

@johnomalley
Copy link

The following returns null:

val a = Path.fromString("/Users")
val b = Path.fromString("/etc")
a.relativize(b)

I think there's an implicit guarantee not to return null from a scala API. I think relativize should be either deprecated or fixed. Some suggestions:

  • deprecate relativize and add relativizeOption (if backward compatibility is a must)
  • change relativize to throw an exception if it's not possible to relativize (maybe add relativizeOption as well).
  • change relativize to return an Option[Path]
@dcsobral
Copy link

I entirely agree. I'd never expect any of this API to return null.

@jesseeichar
Copy link
Owner

I absolutely agree with that. I will make the change.

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

No branches or pull requests

3 participants