• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bugsnag / bugsnag-android / 707 / 3
69%
master: 83%

Build:
Build:
LAST BUILD BRANCH: renovate/gradle-5.x
DEFAULT BRANCH: master
Ran 11 Apr 2019 07:29PM UTC
Files 49
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Apr 2019 09:53AM UTC coverage: 74.004%. Remained the same
NDK_VERSION=r12b

Pull #461

travis-ci-com

web-flow
refactor: prefer using zero-based array when converting collection

There are two styles to convert a collection to an array: either using a pre-sized array (like c.toArray(new String[c.size()])) or using an empty array (like c.toArray(new String[0]).

In older Java versions using pre-sized array was recommended, as the reflection call which is necessary to create an array of proper size was quite slow. However since late updates of OpenJDK 6 this call was intrinsified, making the performance of the empty array version the same and sometimes even better, compared to the pre-sized version. Also passing pre-sized array is dangerous for a concurrent or synchronized collection as a data race is possible between the size and toArray call which may result in extra nulls at the end of the array, if the collection was concurrently shrunk during the operation.

This inspection allows to follow the uniform style: either using an empty array (which is recommended in modern Java) or using a pre-sized array (which might be faster in older Java versions or non-HotSpot based JVMs).
Pull Request #461: Prefer using zero-based array when converting collection

2266 of 3062 relevant lines covered (74.0%)

0.74 hits per line

Source Files on job 707.3 (NDK_VERSION=r12b)
  • Tree
  • List 0
  • Changed 3
  • Source Changed 3
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1962
  • Travis Job 707.3
  • e80aa484 on github
  • Prev Job for NDK_VERSION=r12b on refactor-presized-array-call (#696.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc