How to use content-assist using inferred type arguments in Java 7? [message #805669] |
Thu, 23 February 2012 21:14  |
Eclipse User |
|
|
|
Hi.
I'm using Eclipse 3.7 under Java 7, so I want to keep my complier compilance level in 1.7.
By the way, I'm working togehter who use Eclipse 3.6 (which one does not support compilance level 1.7). So although JRE is JavaSE-1.7, it compiles codes with 1.6 compilance level.
The problem is, because compiler under 1.7 does not support implicit type arguments (diamond) it marks error.
for example:
List<String> list1 = new ArrayList<>(); // It marked as error in eclipse 3.6
So I hope to set content assist to insert explicit type arguments (old style) rather than implicit type arguments (current style).
There is a way to change how the content assist works?
|
|
|
Re: How to use content-assist using inferred type arguments in Java 7? [message #805863 is a reply to message #805669] |
Fri, 24 February 2012 03:22  |
Eclipse User |
|
|
|
On 24.02.2012 03:14, a bc wrote:
> Hi.
>
> I'm using Eclipse 3.7 under Java 7, so I want to keep my complier
> compilance level in 1.7.
>
> By the way, I'm working togehter who use Eclipse 3.6 (which one does
> not support compilance level 1.7). So although JRE is JavaSE-1.7, it
> compiles codes with 1.6 compilance level.
>
> The problem is, because compiler under 1.7 does not support implicit
> type arguments (diamond) it marks error.
> for example:
> List<String> list1 = new ArrayList<>(); // It marked as error in
> eclipse 3.6
>
> So I hope to set content assist to insert explicit type arguments (old
> style) rather than implicit type arguments (current style).
>
>
> There is a way to change how the content assist works?
Yes, set the compliance to 1.6 on the projects which are shared with
co-workers using Eclipse 3.6. Content assist is not the only thing: if
you continue to use 1.7, then you might introduce/use APIs from the JRE
which won't be able for your co-workers.
Dani
|
|
|
Powered by
FUDForum. Page generated in 0.02829 seconds