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 229123 - Bounded wildcard incompatible types conversion leaves extraneous ">"
Summary: Bounded wildcard incompatible types conversion leaves extraneous ">"
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 7.3.1
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Lahoda
URL:
Keywords:
: 231559 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-28 16:38 UTC by MackSix
Modified: 2013-06-20 10:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Example project to reproduce issue. (14.68 KB, application/zip)
2013-04-28 16:38 UTC, MackSix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description MackSix 2013-04-28 16:38:32 UTC
Created attachment 133890 [details]
Example project to reproduce issue.

If we have this:

    Pair<Integer, Pair<? extends Pair<String, String>, ? extends Pair<String, String>>> pair7 
                = new Pair<Integer, Pair<BookAuthor, BookAuthor>>(789, 
                new Pair<>(new BookAuthor("\"Book1\"", "Author1"), 
                new BookAuthor("\"Book2\"", "Author2")));

NetBeans shows error badge with note that says:

Incompatible type
    required: Pair<Integer,? extends Pair<String,String>,? extends Pair<String,String>>>
    found: Pair<Integer,Pair<BookAuthor,BookAuthor>>

Then there is a refactoring options to:

   Chagee type of pair7 to Pair<Integer,Pair<BookAuthor,BookAuthor>>

When this is chosen, it produces:

   Pair<Integer, Pair<BookAuthor, BookAuthor>>> pair7
                = new Pair<Integer, Pair<BookAuthor, BookAuthor>>(789, 
                new Pair<>(new BookAuthor("\"Book1\"", "Author1"), 
                new BookAuthor("\"Book2\"", "Author2")));

Which is an error because there are 3 closing ">" instead of 2.

See attached project.

Product Version: NetBeans IDE 7.3.1 (Build 201304162201)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 1 Jan Lahoda 2013-04-30 14:48:05 UTC
http://hg.netbeans.org/jet-main/rev/2c3c1c32660b
Comment 2 Quality Engineering 2013-05-02 14:14:43 UTC
Integrated into 'main-golden', will be available in build *201305021042* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/2c3c1c32660b
User: Jan Lahoda <jlahoda@netbeans.org>
Log: #229123: correcting removal of a parameterized type's type parameter - removal of the ending angle bracket.
Comment 3 MackSix 2013-05-03 12:09:34 UTC
Verified fixed in:

Product Version: NetBeans IDE Dev (Build 201305022300)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 4 Marian Mirilovic 2013-05-07 09:40:03 UTC
Honza, if you want to push it into release73, please do so today .
Comment 5 Jan Lahoda 2013-05-07 13:23:02 UTC
After thinking about it, lets defer to next patch, if any, or to 7.4. Has been a problem for years, and I would like to get more confidence in the patch before backporting.
Comment 6 Jan Lahoda 2013-06-20 10:51:02 UTC
*** Bug 231559 has been marked as a duplicate of this bug. ***