Bug 208260 - [search] Document the pattern syntax for SearchPattern#createPattern(String, ..)
Summary: [search] Document the pattern syntax for SearchPattern#createPattern(String, ..)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M5   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-31 11:53 EDT by Markus Keller CLA
Modified: 2008-02-05 04:52 EST (History)
1 user (show)

See Also:


Attachments
Proposed patch (6.19 KB, patch)
2008-01-25 12:26 EST, Frederic Fusier CLA
no flags Details | Diff
Nitpicking (6.81 KB, patch)
2008-01-27 14:16 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2007-10-31 11:53:22 EDT
I20071031-0010

The pattern syntax for SearchPattern#createPattern(String, ..) should be documented in createPattern's Javadoc.

Some (unpolished) documentation is available in the Javadoc of the private methods
#createMethodOrConstructorPattern(String, int, int, boolean),
#createFieldPattern(String, int, int), and
#createTypePattern(String, int, int, char)

The syntax for method and constructor patterns looks strange.
E.g. for this example:

package foo;
public class XXX<E> {
	public <T>XXX() {}
	void refs() {
		new <String>foo.XXX<Integer>();
		new <Object>foo.XXX<Float>();
	}
}

... , the syntax suggests:

    foo.<String>XXX()

... , although a fully qualified constructor reference has the first type arguments before the qualification and a second type arguments list after the method name:

    <String>foo.XXX<Integer>()
Comment 1 Frederic Fusier CLA 2007-12-08 16:29:51 EST
Move to 3.4M5 as I also want to fix the syntax problem noticed in the documentation for constructor and method patterns.
Comment 2 Frederic Fusier CLA 2008-01-25 12:26:53 EST
Created attachment 87887 [details]
Proposed patch

Now accept the following syntax for constructor:
['&lt;' typeArguments '&gt;'] [declaringQualification '.'] type ['(' parameterTypes ')']

But of cousre, still accept the old one for backward compatibility
Comment 3 Markus Keller CLA 2008-01-27 14:16:48 EST
Created attachment 87976 [details]
Nitpicking

Looks good. Please find my proposed changes in the attached patch (to HEAD).
Comment 4 Frederic Fusier CLA 2008-01-28 05:26:51 EST
(In reply to comment #3)
> Created an attachment (id=87976) [details]
> Nitpicking
> 
> Looks good. Please find my proposed changes in the attached patch (to HEAD).
> 
I would say 'improvement' rather than 'nitpicking'...
I have obviously released the proposed patch.
Thanks Markus :-)

Released for 3.4M5 in HEAD stream
Comment 5 David Audel CLA 2008-02-05 04:52:03 EST
Verified for 3.4M5 using build I20080204-0010.