Uploaded image for project: 'NetBeans'
  1. NetBeans
  2. NETBEANS-2972

inspect and transform contains wrong refactoring "passing zero element array.."

    XMLWordPrintableJSON

Details

    Description

      "Passing zero element array to Collection.toArray may affect performance"

      This refactoring decreases performance according to https://shipilev.net/blog/2016/arrays-wisdom-ancients/

      On recent VMs, collection.toArray(new T[0]) is faster than collection.toArray(new T[collection.size()]). Since it is also more readable, it should now be the preferred way of collection to array conversion.

      Attachments

        Activity

          People

            Unassigned Unassigned
            chammer3 Carsten Hammer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: