Community
Participate
Working Groups
The following piece of piece does not compile in Eclipse 3.6 protected abstract Stream<? extends Map<String, ?>> convertToStream(String storeName, URL url, Map<String, String> movedColumns) throws IOException; @Override public long loadUrlWhileInTransaction(String storeName, URL url, Map<String, String> movedColumns, Map<String, ?> fixedColumns) throws IOException { convertToStream(storeName, url, movedColumns).map(m -> transcodeColumns(movedColumns, m)); return 0L; } public static <K1, V, K2 extends K1> Map<K1, V> transcodeColumns(Map<?, ? extends K2> mapping, Map<K1, V> map) { // https://stackoverflow.com/questions/24630963/java-8-nullpointerexception-in-collectors-tomap return map.entrySet().stream().collect(HashMap::new, (m, e) -> { K1 newKey; { if (mapping.containsKey(e.getKey())) { newKey = mapping.get(e.getKey()); } else { newKey = e.getKey(); } } m.put(newKey, e.getValue()); }, HashMap::putAll); }
Please clarify exact versions, versions 3.6 and 3.7 pre-date any support for Java 8 (please consult Help > About Eclipse).
(In reply to Stephan Herrmann from comment #1) > Please clarify exact versions, versions 3.6 and 3.7 pre-date any support for > Java 8 (please consult Help > About Eclipse). It fails on: Eclipse IDE for Java Developers Version: Oxygen Release (4.7.0) Build id: 20170620-1800 It seems I got completely wrong in the title
Reproduced. Latest version accepting the example was 4.7M1 More specifically, we reject since the fix for bug 111208. This indicates that the problem is triggered by some wildcard capture, which is a complex and thorny area of JLS. At this point I'm not sure which is the correct behavior. Will look into it after Java 9 work.
For a workaround you can change the first lambda from m -> transcodeColumns(movedColumns, m) to (Map<String, ?> m) -> transcodeColumns(movedColumns, m)
Stepping down as I see no hope without a spec update.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.