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

Unleash / unleash-java-sdk / 41025413497

30 Oct 2026 08:17AM UTC coverage: 80.544% (+0.4%) from 80.162%
41025413497

push

github

web-flow
fix: read classpath bootstrap files as a stream (#388)

ToggleBootstrapFileProvider resolved a classpath: reference to a URL and
then called Paths.get(url.toURI()). That only works when the classpath
entry is an exploded directory. Packaged in a jar the URL has the "jar:"
scheme, and Paths.get throws FileSystemNotFoundException - an unchecked
exception, so it slips past the IOException handlers in read() and comes
back out of the DefaultUnleash constructor with a null message.

Reading the resource with getResourceAsStream avoids the URL-to-Path
round trip entirely and works for directories, jars and native images
alike.

Also strip a leading "/" or "./" from the resource name.
ClassLoader.getResourceAsStream wants a name without one, so
classpath:/toggles.json previously resolved to nothing and the client
started up with no toggles and only an info-level log line.

Before, with the resource in a jar:

  classpath:toggles.json    FileSystemNotFoundException
  classpath:/toggles.json   silently empty
  classpath:./toggles.json  silently empty

The existing test only covered the first form, which passes because
test resources live in a directory rather than a jar.

Co-authored-by: Meemaw <matej.snuderl@opensea.io>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

402 of 574 branches covered (70.03%)

Branch coverage included in aggregate %.

22 of 23 new or added lines in 1 file covered. (95.65%)

1788 of 2145 relevant lines covered (83.36%)

6.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.49
/src/main/java/io/getunleash/repository/ToggleBootstrapFileProvider.java


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc