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()
When working on improving the test coverage of
LookupI realised that the semantics of searchPath is a bit surprising and it might make sense to clean this up at some point.setSearchPath()with a nullList<Name>will cause aNullPointerExceptionas 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()