[Checkers] Eclipse Plugin (sorry)

Mahmood Ali mahmood at MIT.EDU
Mon Jun 23 13:18:02 EDT 2008


>> ::Random bugs::
>> - jarFile.getLocation() returns null when jar file is not part of the
>> project.
>> I needed to replace the jarFile.getLocation() in
>> JSR308Worker.getAbsolutePath() to jarFile.getFullPath() to avoid a  
>> null
>> pointer exception.
>
> this is incorrect because getFullPath returns workspace-relative  
> paths.


Thanks for the correction.  I didn't notice that before.

I just consulted the java docs of IResource and (I think that I  
identified that problem as):
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/resources/IResource.html

> public IPath getLocation()
>
> Returns the absolute path in the local file system to this resource,  
> or null if no path can be determined.
> [...]
> If this resource is a project that does not exist in the workspace,  
> or a file or folder below such a project, this method returns null.  
> This method also returns null if called on a resource that is not  
> stored in the local file system. For such resources getLocationURI()  
> should be used instead.

getLocation() returns 'null' when I merely linked checkers.jar from my  
private lib folder rather than copying it there.  This is my guess.

- Mahmood




More information about the checkers mailing list