Bug 103148 - [1.5][assist] Code completion breaks if using static method generics ( Class.<T>staticMethod(params) )
Summary: [1.5][assist] Code completion breaks if using static method generics ( Class....
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: All Windows XP
: P3 normal (vote)
Target Milestone: 3.1.1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-08 07:00 EDT by Luigi Lauro CLA
Modified: 2005-09-26 09:27 EDT (History)
0 users

See Also:


Attachments
Proposed patch (2.74 KB, text/plain)
2005-07-11 07:05 EDT, David Audel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luigi Lauro CLA 2005-07-08 07:00:33 EDT
Everytime I have to put a call to a generics-enabled static methods, code
completion stops to work after the method call.

Generics syntax which broke the completion
Class.<T>staticMethod(params);

Pseudo-example:
EnumSet.<MyType>of(MyType.VALUE1, MyType.VALUE2);

Real-example:
EnumSet.<Mode>of(Mode.BINDING, Mode.READABLE, Mode.WRITABLE);

Since this happens quite often for me (I'm very fond of generics enumset, they
are sooooo handy & easy to use instead of the old error-prone untyped bitsets),
it's quite a nuisance.

Anyone can confirm this?

P.s. thanks for this life-saving & deadline-saving tool! :D
Comment 1 Luigi Lauro CLA 2005-07-08 07:19:29 EDT
Minimal test case provided:

public class IBreakCodeCompletion {

	public enum MyEnum { A };
	
	public static void breakCodeCompletion() {
		// here code completion works
		EnumSet.<MyEnum>of(MyEnum.A);
		// here code completion DOESN'T work anymore
	}
}
Comment 2 Philipe Mulet CLA 2005-07-11 06:52:27 EDT
+1 for 3.1.1
Comment 3 David Audel CLA 2005-07-11 07:05:38 EDT
Created attachment 24524 [details]
Proposed patch

K_SELECTOR_QUALIFIER and K_SELECTOR_INVOCATION_TYPE are not removed form
elementStack when the method is generic.
Comment 4 David Audel CLA 2005-07-11 07:08:48 EDT
Fix released and test added
  GenericsCompletionParserTest#test0204()
Comment 5 Luigi Lauro CLA 2005-07-11 07:40:16 EDT
(In reply to comment #4)
> Fix released and test added
>   GenericsCompletionParserTest#test0204()

Thanks for the quick fix of this small (but annoying) bug.

Can't wait to have 3.1.1 in my dirty hands :P
Comment 6 David Audel CLA 2005-07-12 11:04:23 EDT
Fix released and test added in HEAD
Comment 7 Olivier Thomann CLA 2005-08-09 10:15:13 EDT
Verified in 3.2M1 (I20050808-2000)
Comment 8 Maxime Daniel CLA 2005-09-26 09:09:54 EDT
Verified for 3.1.1 using build M20050923-1430.