Skip to content

Lookup.setSearchPath() semantics a bit surprising #157

@nresare

Description

@nresare

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions