Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 84291 Details for
Bug 211718
[1.5][compiler] compiler error with nested enum in class using generics
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Java class triggering eclipse compiler bug
EnumGenericsBug.java (text/x-java), 1.04 KB, created by
Martin Stenhoff
on 2007-12-03 00:51:47 EST
(
hide
)
Description:
Java class triggering eclipse compiler bug
Filename:
MIME Type:
Creator:
Martin Stenhoff
Created:
2007-12-03 00:51:47 EST
Size:
1.04 KB
patch
obsolete
>import java.util.Arrays; >import java.util.List; > >public class EnumGenericsBug<E> { > public static enum IsABug { > TRUE, > FALSE; > } > public List<IsABug> getPossibleBugStates() { > return Arrays.asList(IsABug.values()); /* CompilerError: Type mismatch: cannot convert from List<EnumGenericsBug<E>.IsABug> to List<EnumGenericsBug.IsABug> > QuickFix: Change method return type to 'List<IsABug>' */ > } > > public String getBugResponse(String value) throws IllegalArgumentException{ > > switch (IsABug.valueOf(value)) { > case TRUE:/* CompilerError: Type mismatch: cannot convert from EnumGenericsBug.IsABug to EnumGenericsBug<E>.IsABug > QuickFix: Add cast to 'IsABug' */ > return "crap"; > case FALSE:/* CompilerError: Type mismatch: cannot convert from EnumGenericsBug.IsABug to EnumGenericsBug<E>.IsABug > QuickFix: Add cast to 'IsABug' */ > return "yeah"; > default: > throw new IllegalArgumentException("IllegalArgumentException.invalid.bugState"); > } > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 211718
: 84291 |
85073