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 163969 - [67cat] Internal compiler regression with generics (#2)
Summary: [67cat] Internal compiler regression with generics (#2)
Status: RESOLVED WONTFIX
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2009-04-28 18:15 UTC by matthies
Modified: 2009-05-14 13:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description matthies 2009-04-28 18:15:37 UTC
Example:



    class Test
    {
        interface Interval<T extends Comparable<? super T>>
        {
            T minimum();
            T maximum();
        }

        void f(Object obj)
        {
            if (obj instanceof Interval
               && ((Interval<?>) obj).minimum() instanceof Integer)
            {
                // ...
            }
        }
    }

The editor shows the following compiler error for the second "instanceof" expression:

    inconvertible types
    required: java.lang.Integer
    found: capture #nnn of ?

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 10:27:13 UTC
Seems like a regression in the JDK1.7 compiler (1.6 compiles fine, errors while using 1.7).
Comment 2 Dusan Balek 2009-04-30 08:00:40 UTC
Copy & paste from the e-mail I've got from the javac people:
-------------------------------------------------------------------------------------------------------------------------
This seems a regression from 6548436 - cast conversion has a lot of problems in javac - and I'm trying to address
them... I guess this is one of those areas in which you do two steps further and a step beyond  :-(
I might need to spend some time on this - I'll keep you informed as soon as I discover a fix.
-------------------------------------------------------------------------------------------------------------------------
Comment 3 Dusan Balek 2009-05-14 13:56:06 UTC
Bug in JDK1.7 compiler. WONTFIX on NB side.