This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 163967

Summary: [67cat] Internal compiler regression with generics
Product: java Reporter: matthies <matthies>
Component: CompilerAssignee: Dusan Balek <dbalek>
Status: RESOLVED FIXED    
Severity: blocker CC: mmirilovic
Priority: P1 Keywords: REGRESSION
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Exception Reporter:

Description matthies 2009-04-28 18:00:51 UTC
Example:

    import java.util.Comparator;
    import java.util.List;

    class Test
    {
        static final <T extends Comparable<? super T>> Comparator<List<T>> comparator() { return null; }

        static <T extends Comparable<? super T>> void f()
        {
            Comparator<List<T>> comparator = comparator();  // [*]
        }
    }

For the statement marked with [*], the editor shows the following error:

    type parameters of <T>java.util.Comparator<java.util.List<T>> cannot be determined;
    no unique maximal instance exists for type variable T with upper bounds java.lang.Comparable<? super T>

The code though is correct and compiles without errors with JDK 1.6, and no error is shown by the NetBeans 6.5 editor.
Comment 1 Dusan Balek 2009-04-29 12:56:37 UTC
It is a regression in recent 1.7 javac caused by fix of http://bugs.sun.com/view_bug.do?bug_id=6315770.
Comment 2 Dusan Balek 2009-04-29 13:07:03 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/bcd1ea2f60c4
changeset 1b5486023a58 in main/nb-javac
details: http://hg.netbeans.org/main/nb-javac?cmd=changeset;node=1b5486023a58
Comment 3 Quality Engineering 2009-04-30 07:37:59 UTC
Integrated into 'main-golden', will be available in build *200904300201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/bcd1ea2f60c4
User: Dusan Balek <dbalek@netbeans.org>
Log: Issues #159166, #163746, and #163967 fixed.
Comment 4 matthies 2009-07-16 17:05:54 UTC
Verified in 6.7.