Eclipse Auto Complete: Java 1.7 Generics Diamond

前端 未结 4 1292
无人共我
无人共我 2020-12-20 12:40

I just upgraded to Luna (from Kepler) and I noticed some little (yet annoying) problem:
The auto completion lacks the possibility to generate diamonds \"<>\" for alre

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-20 12:53

    Set is an interface rather than an implementation so the IDE can only assume that you want an anonymous inner type which always requires the generic type parameter. You could do

    Set mySet = new HashSet + CTRL + SPACE
    

提交回复
热议问题