This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 204107 - EnumSet suggestions for method arguments/fields that are Sets of an enum type
Summary: EnumSet suggestions for method arguments/fields that are Sets of an enum type
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.1
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-23 01:14 UTC by dbell
Modified: 2011-10-23 01:14 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dbell 2011-10-23 01:14:41 UTC
[ JDK VERSION : 1.6.26 ]

In situations when a method is being called in Java, and that method takes an
argument whose type is Set<SomeEnumType>, it would be great if the editor
suggested EnumSet.of(SomeEnumType.A_CONSTANT), and
EnumSet.allOf(SomeEnumType.class) at the top of the code completion results, as
this is quite a common idiom.

e.g.
void myMethod(Set<MyEnumType> options) {
    ...
}

void doSomething() {
    myMethod(|
}


Invoking code completion at the carat above would yield
EnumSet.allOf(MyEnumType.class) as the top result, followed by EnumSet.of(|
(whereupon code code completion is automatically invoked again, suggesting all
enum constants of the given type.