Community
Participate
Working Groups
Created attachment 271158 [details] test project The following code does not compile in the workspace with I20171023-2000 build and gives the following error: Type mismatch: cannot convert from ArrayList<Map.Entry> to List<Map.Entry> This code compiles fine using Oxygen.1 <java-code> package test.compileBug; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; public class TestCompileBug { @SuppressWarnings({ "rawtypes" }) private static void cannotCompile(Object token) { // change the type to List<Entry> and ArrayList<Entry> and it compiles @SuppressWarnings("unchecked") List<Map.Entry> identityServicesToTokensMap = new ArrayList<Map.Entry>(((LinkedHashMap) token).entrySet()); } } </java-code>
javac 1.8.0_144 and 9 compiles the snippet without errors. If one removes suppress warnings annotation and fix the warnings, the code compiles in Eclipse too: List<Map.Entry<?,?>> identityServicesToTokensMap = new ArrayList<Map.Entry<?,?>>(((LinkedHashMap<?,?>) token).entrySet());
Caused by the change for bug 518157.
New Gerrit change created: https://git.eclipse.org/r/110587
(In reply to Eclipse Genie from comment #3) > New Gerrit change created: https://git.eclipse.org/r/110587 Contains a regression test (bug is fixed by reverting the commit for bug 518157 ).
Gerrit change https://git.eclipse.org/r/110587 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=b4703cd3177b31f98429d60ab965ab16955ecd20
(In reply to Eclipse Genie from comment #5) > Gerrit change https://git.eclipse.org/r/110587 was merged to [master]. > Commit: > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > ?id=b4703cd3177b31f98429d60ab965ab16955ecd20 Released for 4.8M3
(In reply to Till Brychcy from comment #6) > (In reply to Eclipse Genie from comment #5) > > Gerrit change https://git.eclipse.org/r/110587 was merged to [master]. > > Commit: > > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > > ?id=b4703cd3177b31f98429d60ab965ab16955ecd20 > > Released for 4.8M3 Till, what about backport for 4.7.2?
(In reply to Andrey Loskutov from comment #7) > (In reply to Till Brychcy from comment #6) > > (In reply to Eclipse Genie from comment #5) > > > Gerrit change https://git.eclipse.org/r/110587 was merged to [master]. > > > Commit: > > > http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/ > > > ?id=b4703cd3177b31f98429d60ab965ab16955ecd20 > > > > Released for 4.8M3 > > Till, what about backport for 4.7.2? The code that caused the bug was not yet on the maintenance branch. Just backporting the test case doesn't sound useful :-)
Verified for 4.8 M3 using I20171025-2000 build