|
|
Re: FileURIHandlerImpl bug ? [message #422827 is a reply to message #422818] |
Tue, 16 September 2008 14:19 |
Adolfo Sanchez-Barbudo Herrera Messages: 260 Registered: July 2009 |
Senior Member |
|
|
Hi Ed,
Some in-lined comments below:
Ed Merks escribió:
> Adolfo,
>
> Comments below.
>
> Adolfo Sánchez-Barbudo Herrera wrote:
>> Hi Ed,
>>
>> I'm working with I20080617-2000 build, so I'm not sure if it has been
>> fixed in a maintenance release.
>>
>> While getting attributes map of a (File)URI managed by a
>> FileUriHandlerImpl, a NPE is thrown if you provide a null-valued
>> options map (as documentation suggests if you don't want to provide
>> options).
>>
>> A checking of no-null value of the option map is needed (before
>> calling getRequestedAttributes(options) or inside of that protected
>> method to avoid the problem in every derived URIHandlerImpl)
>>
>> Please, point me out if that bug has been already reported...
> It's actually a snarf-and-barf error in the Javadoc copying from the
> URIConverter API to the URIHandler API. The expectation is that you
> work directly with the URIConverter API which guarantees that a non-null
> map is passed to the URIHandler. Not only that, but generally
> URIHandlers might need to call back to the URIConverter recursively and
> then require the OPTION_URI_CONVERTER option...
>
> public Map<String, ?> getAttributes(URI uri, Map<?, ?> options)
> {
> URI normalizedURI = normalize(uri);
> return getURIHandler(normalizedURI).getAttributes(uri, new
> OptionsMap(OPTION_URI_CONVERTER, this, options));
> }
>
> Of course this makes me wonder why you are calling the URIHandler
> directly in the first place. What's up with that?
Ok, I think in this case, I should better use the getAttributes on
URIConverter instead. Anyway, as you say, it would be nice to fix that
javadoc just in case somebody uses or extends use any already
implemented URIHandler.
>
> I'd rather change the Javadoc than hunt down all the downstream uses for
> null guards so feel free to open a bugzilla against the Javadoc.
>>
done -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=247455
Cheers,
Adolfo.
>> Cheers,
>> Adolfo.
>>
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.02950 seconds