Summary: | Generics compilation: error reported in javac, but not in Eclipse | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Aled Sage <aled.sage> |
Component: | Core | Assignee: | Ayushman Jain <amj87.iitr> |
Status: | VERIFIED INVALID | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | amj87.iitr, satyam.kandula, srikanth_sankaran |
Version: | 3.7.1 | ||
Target Milestone: | 3.8 M5 | ||
Hardware: | Macintosh | ||
OS: | Mac OS X - Carbon (unsup.) | ||
Whiteboard: |
Description
Aled Sage
2011-12-06 17:55:59 EST
the magic to get it to compile with javac is to add <Integer,String> for the call to build: public static void main(String[] args) { String image = "abc"; Map<Integer, String> imageMap = GenericsBug.of(1, image); Supplier<Cache<Integer, ? extends String>> imageCache = GenericsBug.<Cache<Integer, ? extends String>> ofInstance( CacheBuilder.newBuilder().<Integer,String>build(GenericsBug.from(GenericsBug.forMap(imageMap)))); } This a javac bug which has been fixed now in java 7 (javac7b147). The code is legal, however horrible it looks :) Verified for 3.8M5 using build I20120122-2000 |