Inference with wildcard types causes selection of inapplicable method

Bug #792492 reported by Craig
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
openjdk-6 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

$ lsb_release -rd
Description: Ubuntu 11.04
Release: 11.04
$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.1) (6b22-1.10.1-0ubuntu1)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

Running javac against "Comp.java" (attached):
$ javac Comp.java
Comp.java:24: invalid inferred types for T; actual arguments do not conforms to inferred formal arguments
required: java.lang.Iterable<? extends java.util.Comparator<? super java.lang.String>>
found: java.util.List<java.util.Comparator<?>>
    Comparator<String> c3 = compound(x);
                                    ^
1 error

This error should not occur (successful compilation should result).

This issue was a bug in javac that has since been fixed: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6638712
It was fixed in OpenJDK 6 1.10: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=648

Seeing as Ubuntu has 1.10.1, the bug should be fixed for it - but it is still present.

In the OpenJDK Ubuntu package changelog, I see that this particular change was reverted for Maverick: https://launchpad.net/ubuntu/+source/openjdk-6/6b20-1.9.2-0ubuntu2 I wonder if somehow the reversion persisted for Natty.

This problem is pretty major, as it means Ubuntu's shipping javac is not able to compile a variety of valid Java source.

Revision history for this message
Craig (candrews-integralblue) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in openjdk-6 (Ubuntu):
status: New → Confirmed
Revision history for this message
Benjamin Prosnitz (aetherane) wrote :

This appears to not have been fixed in Ubuntu 12.04

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.