Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316378 - NLS.initializeMessages() parameter description confusing
Summary: NLS.initializeMessages() parameter description confusing
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.7 M1   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-09 16:26 EDT by John Cortell CLA
Modified: 2010-07-09 09:55 EDT (History)
1 user (show)

See Also:


Attachments
javadoc patch (2.04 KB, patch)
2010-07-08 17:21 EDT, Thomas Watson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Cortell CLA 2010-06-09 16:26:38 EDT
This has been bugging me for a while and since Helios is now mostly behind us, I figured I'd take a minute and open a bug.

The first parameter for NLS.initializeMessages() is called 'bundleName' and the javadoc description for it is "fully qualified path of the class name". 

There's an obvious mismatch between the param name and the description. A bundle and a class are two completely different concepts. Which is right? The param name or the javadoc? 

Is it the class name? The second parameter is the Class file object. The NLS implementation can get the fully qualified path from that object, so why ask the caller for it? That can't be it.

OK, so the param name must be right; it's a bundle. But, that alone is also confusing. The term 'bundle' is overloaded in the Eclipse world. In many (most) cases, the term 'bundle' refers to an OSGi bundle. So, the javadoc should be explicit that we're talking about a _Java resource bundle_.

Now, I've been playing dumb here. I know exactly what the parameter represents...but that's only because when I first used the method, I looked at how clients call it and deduced the meaning from them. Developers new to that method shouldn't have to rely on that. That's my point here.
Comment 1 Thomas Watson CLA 2010-06-09 16:35:28 EDT
agreed.  I will work on fixing this.
Comment 2 Thomas Watson CLA 2010-07-08 17:21:55 EDT
Created attachment 173820 [details]
javadoc patch

Here is an attempt to improve the javadoc for initializeMessages.  I changed the bundleName param name to baseName.  I also documented that the class loader of the specified class is used to load the message properties resource.  I hope this makes things a bit more clear.
Comment 3 Thomas Watson CLA 2010-07-08 17:24:00 EDT
I released this to head.  Feel free to reopen if you have suggestions for additional improvements.
Comment 4 John Cortell CLA 2010-07-08 17:34:27 EDT
(In reply to comment #2)
> Created an attachment (id=173820) [details]
> javadoc patch
> 
> Here is an attempt to improve the javadoc for initializeMessages.  I changed
> the bundleName param name to baseName.  I also documented that the class loader
> of the specified class is used to load the message properties resource.  I hope
> this makes things a bit more clear.

Tons clearer. Thanks. BTW, I think there might be a word missing in the second sentence, specifically the section starting with "including the package...". Either "package *where*" or "located *in*" would fix the grammar, I believe. 

Regardless, the message is clear and this is a huge improvement.
Comment 5 Thomas Watson CLA 2010-07-09 09:55:19 EDT
(In reply to comment #4)
> (In reply to comment #2)
> > Created an attachment (id=173820) [details] [details]
> > javadoc patch
> > 
> > Here is an attempt to improve the javadoc for initializeMessages.  I changed
> > the bundleName param name to baseName.  I also documented that the class loader
> > of the specified class is used to load the message properties resource.  I hope
> > this makes things a bit more clear.
> 
> Tons clearer. Thanks. BTW, I think there might be a word missing in the second
> sentence, specifically the section starting with "including the package...".
> Either "package *where*" or "located *in*" would fix the grammar, I believe. 
> 
> Regardless, the message is clear and this is a huge improvement.

I released an update to add the missing word *where*.  Thanks for the review.