ImageIO.read(...) is not really thread-safe, as calling it on several threads at the same time can cause NullPointerExceptions and ConcurrentModificationExceptions, as reported in https://bugs.openjdk.java.net/browse/JDK-8058973 and https://bugs.openjdk.java.net/browse/JDK-6986863.
This commit changes all usages of this method to synchronize on ImageIO.class, so the method is never run asynchronously.
When request fails, entire response needs to be wrapped in try with
resources in order to close the connection properly and not only
response body.
Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
* Add remaining Hiscore parameters to HiscoreSkill
* Add remaining Hiscore parameters to HiscoreResult
* Add remaining Hiscore parameters to HiscoreResultBuilder
* Add new Hiscore panel icons (from offical Hiscore website, so they don't match very well) and subpanel for Clue Scrolls, Bounty Hunter - Hunter, Bounty Hunter - Rogue, and Last Man Standing
* Add logic to catch unranked hiscores and display them properly. Not currently checking for combat level calculations, but other cases should be covered.
* Make HiscoreService and HiscoreClient aware of different hiscore endpoints
* Add Spring Editor to convert path variable String to enum, add pretty versions of HiscoreEndpoint names, add new icons for endpoint selection
* Fix HiscoreEndpoint.valueof failing silently and preventing lookup, update HiscoreService tests, add Hiscore endpoint selection buttons to HiscorePanel
* Replace HiscorePanel skill icons with smaller versions from the official hiscore website
* Fix details listing rank instead of experience
* Fix details listing rank instead of experience, fix skill panels not being cleared when selecting a different hiscore category, make HiscoreService respond 404 when a Hiscore entry is not found instead of 500.
* Fix skill panels not being cleared when selecting a different hiscore category, make HiscoreService respond 404 when a Hiscore entry is not found instead of 500.
* Revert changing RuneliteAPI base URL, those changes should not have been committed (local testing only)
* Add ClueScrollAll and ClueScrollMaster to HiscoreService tests.
* Style cleanup and relocate NotFoundException to http-service package
* Use relative path for small skill icons
* Move Jagex Hiscore urls from HiscoreService to HiscoreEndpoint
* Create new util package in http-service for common exceptions and Spring converters, clean up HiscoreService by streamlining error handling and removing methods for old unit test
* Change HiscoreService unit test to use new HiscoreTestService subclass which handles setting the test URL
* Change HiscoreEndpoint hiscoreUrls to HttpUrl instead of String
* Cleanup formatting, remove unused http-service exception
* http-api: cleanup HiscoreEndpoint