Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » FileURIHandlerImpl bug ?
FileURIHandlerImpl bug ? [message #422817] Tue, 16 September 2008 10:41 Go to next message
Adolfo Sanchez-Barbudo Herrera is currently offline Adolfo Sanchez-Barbudo HerreraFriend
Messages: 260
Registered: July 2009
Senior Member
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...

Cheers,
Adolfo.
Re: FileURIHandlerImpl bug ? [message #422818 is a reply to message #422817] Tue, 16 September 2008 11:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30810
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060908030707000204080609
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Adolfo,

Comments below.

Adolfo S
Re: FileURIHandlerImpl bug ? [message #422827 is a reply to message #422818] Tue, 16 September 2008 14:19 Go to previous message
Adolfo Sanchez-Barbudo Herrera is currently offline Adolfo Sanchez-Barbudo HerreraFriend
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.
>>
>>
>>
Previous Topic:[CDO] Explicit locking / Changes to EPackages
Next Topic:[databinding] Properties do not show from selections in non-EMF managed viewer
Goto Forum:
  


Current Time: Tue Jan 21 07:47:44 GMT 2020

Powered by FUDForum. Page generated in 0.02394 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top