Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 350559

Summary: [1.7] propose diamond when completing allocation expression
Product: [Eclipse Project] JDT Reporter: Stephan Herrmann <stephan.herrmann>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: enhancement    
Priority: P3 CC: daniel_megert, deepakazad
Version: 3.7   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Whiteboard:

Description Stephan Herrmann CLA 2011-06-28 07:36:38 EDT
While playing with the example from bug 343693 I noticed that
  new X|
completes to
  new X<T>(param)

This happens even if T is not in scope, creating bogus code 
(i.e., both parameters T and param must be manually specified).

Moreover, if a bound is added to T, say "T extends Number",
completion proposes
  new X<Number>(param)

Wouldn't it be educative for users if we propose the new syntax
  new X<>(param)

?

Please excuse, if this has been discussed before.
Comment 1 Deepak Azad CLA 2011-06-28 08:37:23 EDT
A more general solution is proposed in bug 283950. (Note that JDT/Core only proposes the types, the type arguments are inserted by JDT/Text)

*** This bug has been marked as a duplicate of bug 283950 ***
Comment 2 Dani Megert CLA 2011-07-07 10:03:01 EDT

*** This bug has been marked as a duplicate of bug 351444 ***