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

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

Build:
Build:
LAST BUILD BRANCH: renovate/gradle-5.x
DEFAULT BRANCH: master
Ran 11 Apr 2019 07:29PM UTC
Jobs 3
Files 50
Run time 21min
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

pending completion
707

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

4 of 4 new or added lines in 3 files covered. (100.0%)

2266 of 3286 relevant lines covered (68.96%)

2.07 hits per line

Jobs
ID Job ID Ran Files Coverage
3 707.3 (NDK_VERSION=r12b) 11 Apr 2019 07:29PM UTC 0
74.0
Travis Job 707.3
4 707.4 (NDK_VERSION=r16b) 11 Apr 2019 07:47PM UTC 0
74.0
Travis Job 707.4
5 707.5 (NDK_VERSION=r19) 11 Apr 2019 07:50PM UTC 0
74.0
Travis Job 707.5
Source Files on build 707
Detailed source file information is not available for this build.
  • Back to Repo
  • Build #707
  • Pull Request #461
  • PR Base - inspection-fixes (#696)
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