Bug 208260

Summary: [search] Document the pattern syntax for SearchPattern#createPattern(String, ..)
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: david_audel
Version: 3.4   
Target Milestone: 3.4 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch
none
Nitpicking none

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.