Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329373 - Javadoc of IContainer.findMember(String) does not match reality
Summary: Javadoc of IContainer.findMember(String) does not match reality
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Malgorzata Janczarska CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-03 12:49 EDT by Dani Megert CLA
Modified: 2010-12-03 07:54 EST (History)
2 users (show)

See Also:
malgorzata.tomczyk: review? (Szymon.Brandys)


Attachments
Modified javadoc (1.03 KB, patch)
2010-11-04 08:44 EDT, Malgorzata Janczarska CLA
no flags Details | Diff
Corrected javadoc (4.19 KB, patch)
2010-11-04 10:36 EDT, Malgorzata Janczarska CLA
no flags Details | Diff
Corrected javadoc (5.30 KB, patch)
2010-11-08 10:54 EST, Malgorzata Janczarska CLA
no flags Details | Diff
Markus comments to javadoc applied (5.96 KB, patch)
2010-12-01 08:47 EST, Malgorzata Janczarska CLA
no flags Details | Diff
findMember(String, boolean) and findMember(IPath, boolean) synchronized with eachother. (7.81 KB, patch)
2010-12-03 07:27 EST, Malgorzata Janczarska CLA
Szymon.Brandys: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2010-11-03 12:49:48 EDT
The Javadoc of IContainer.findMember(String) does not match reality: it specifies to find the members with a given *name* but actually treats the name as path.

The Javadoc should also mention that "" finds the resource itself.
Comment 1 Malgorzata Janczarska CLA 2010-11-04 08:44:26 EDT
Created attachment 182365 [details]
Modified javadoc

I've added a note to javadoc to clarify.
Comment 2 Dani Megert CLA 2010-11-04 08:48:56 EDT
We should not just add a note but rewrite the Javadoc since it clearly doesn't find a member by name but by path.
Comment 3 Markus Keller CLA 2010-11-04 09:02:03 EDT
And please write complete sentences (e.g. *a* relative path...), see also
http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html .
Comment 4 Malgorzata Janczarska CLA 2010-11-04 10:36:54 EDT
Created attachment 182373 [details]
Corrected javadoc

How do you like the javadoc now?
Comment 5 Markus Keller CLA 2010-11-04 14:23:28 EDT
(In reply to comment #4)
Looks better. But after looking more closely at the implementation, I think you should just copy the Javadocs of the corresponding findMember(IPath*) methods. That's more precise, and reducing variants is always goodness.

Then compare IPath#append(String) and IPath#append(IPath) and add the missing bits to the findMember(String*) APIs:
- The given string path must be a valid path.
- @see IPath#isValidPath(String)
... and I would add:
- @see IPath#isValidSegment(String)
Comment 6 Malgorzata Janczarska CLA 2010-11-08 10:54:29 EST
Created attachment 182627 [details]
Corrected javadoc

I used javadoc from findMember(Path*) and added some links to IPath.
Comment 7 Markus Keller CLA 2010-11-09 06:58:27 EST
(In reply to comment #6)
> Created an attachment (id=182627) [details] [diff]

We're getting close, but when I select the two corresponding methods in the Outline view and then execute Compare With ... > Each Other, I still see unnecessary differences:

#findMember(String) misses:
	 * <p>
	 * Note that no attempt is made to exclude team-private member resources
	 * as with <code>members</code>.
	 * </p>


#findMember(String, boolean) misses the following paragraph from #findMember(String):
	 * <p>Note that <code>path</code> contains a relative path to the resource
	 * and all path special characters will be interpreted. Passing an empty string
	 * will result in returning this {@link IContainer} itself.
	 * </p>

#findMember(String, boolean) contains "@see #members()", but it should be
"@see #members(boolean)".
Comment 8 Malgorzata Janczarska CLA 2010-12-01 08:47:39 EST
Created attachment 184255 [details]
Markus comments to javadoc applied

I've attached a patch with your comments applied.
Comment 9 Malgorzata Janczarska CLA 2010-12-03 07:27:55 EST
Created attachment 184456 [details]
findMember(String, boolean) and findMember(IPath, boolean) synchronized with eachother.
Comment 10 Szymon Brandys CLA 2010-12-03 07:54:44 EST
Looks good now. Committed to HEAD.