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 250509 - invalid hint "Suspicious call to Collections.toArray"; useless fix
Summary: invalid hint "Suspicious call to Collections.toArray"; useless fix
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Hints (show other bugs)
Version: 8.0.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-18 22:54 UTC by err
Modified: 2015-04-23 02:11 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 err 2015-02-18 22:54:20 UTC
The following

    class General {
        class Item { }

        static Item[] gen(
                Collection<? extends Item> col)
        {

            Item[] items = col.toArray(new Item[0]);  //<<<<<< hint

            return items;
        }
    }


gives the bogus hint. Applying the fix does *not* change the code.
Comment 1 Svata Dedic 2015-04-15 07:12:50 UTC
Will be fixed in jet-main#4367b6a6edf1
Comment 2 Quality Engineering 2015-04-23 02:11:06 UTC
Integrated into 'main-silver', will be available in build *201504230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/4367b6a6edf1
User: Svata Dedic <sdedic@netbeans.org>
Log: #250509: support for generified types