Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-core-dev] IResource.getLocation() may return null


I want to remind clients of the core resources API that IResource.getLocation() is specified such that it may return null.  A null location has always been possible, but now it is slightly more likely.  If a user defines a linked resource relative to a workspace path variable, and then deletes that path variable definition, the location of any resource under that variable will be null.  Clients should generally treat resources with a null location as non-existent resources.

A quick inspection of the senders of this method shows that there are places where clients are not checking for null, in jdt core, the javadoc exporter, pde core, ui, and external tools.  I will enter specific bug reports as I come across them.

Back to the top