Community
Participate
Working Groups
The following code compiles successfully with javac 1.8.0_31 but does not compile with Eclipse 4.5 (Mars) or the update published in org.eclipse.jdt.core_3.11.0.v20150602-1242.jar. package net.codefool.wildcard; public class EcjVsWildcardMethodParameter { public static void main(String[] args) { final Parameter<String, ? extends Comparable<?>> parameter = getParameter(); final Result<String> result = getResult(parameter); // final Result<String> result = getResult((Parameter) parameter); } private static Parameter<String, ? extends Comparable<?>> getParameter() { return null; } private static <K extends Comparable<K>, V extends Comparable<V>> Result<K> getResult(final Parameter<K, V> parameter) { return new Result<>(); } private static class Result<K extends Comparable<K>> { } private static class Parameter<K extends Comparable<K>, V extends Comparable<V>> { } } Casting parameter using the raw type permits compilation with a number of warnings. ********:ecjFault $ java -jar ~/Downloads/Eclipse/Mars/Eclipse.app/Contents/Eclipse/plugins/org.eclipse.jdt.core_3.11.0.v20150602-1242.jar -1.8 src/net/codefool/wildcard/EcjVsWildcardMethodParameter.java ---------- 1. ERROR in ********/ecjFault/src/net/codefool/wildcard/EcjVsWildcardMethodParameter.java (at line 10) final Result<String> result = getResult(parameter); ^^^^^^^^^ The method getResult(EcjVsWildcardMethodParameter.Parameter<K,V>) in the type EcjVsWildcardMethodParameter is not applicable for the arguments (EcjVsWildcardMethodParameter.Parameter<String,capture#3-of ? extends Comparable<?>>) ---------- 1 problem (1 error)
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.