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

Lookup.setSearchPath() semantics a bit surprising #157

Open
nresare opened this issue Feb 3, 2021 · 0 comments
Open

Lookup.setSearchPath() semantics a bit surprising #157

nresare opened this issue Feb 3, 2021 · 0 comments

Comments

@nresare
Copy link
Member

nresare commented Feb 3, 2021

When working on improving the test coverage of Lookup I realised that the semantics of searchPath is a bit surprising and it might make sense to clean this up at some point.

  • The search Path returned by getDefaultSearchPath is always a list, that might be empty.
  • However, there is a conditional for searchPath being null, however it takes a bit of effort to trigger that path. Calling setSearchPath() with a null List<Name> will cause a NullPointerException as will a null String or null Name. It turns out that to trigger the conditional you will need to provide a (String[]) null.

I propose we address this by disallowing a null searchPath, and always set it to emptyList()

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

1 participant