Exception in ImageIO when parsing Java 9 version string

Description

I get the following exception when I do things which involve the use of ImageIO with Java 9 and above.

{{java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:662)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at com.sun.media.imageioimpl.common.ImageUtil.processOnRegistration(ImageUtil.java:1408)
at com.sun.media.imageioimpl.plugins.wbmp.WBMPImageWriterSpi.onRegistration(WBMPImageWriterSpi.java:106)
at java.desktop/javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:788)
at java.desktop/javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:330)
at java.desktop/javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:212)
at java.desktop/javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:136)
at java.desktop/javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:157)
at java.desktop/javax.imageio.ImageIO.<clinit>(ImageIO.java:66)
at org.geotools.tile.Tile.loadImageTileImage(Tile.java:194)
at org.geotools.tile.Tile.getBufferedImage(Tile.java:182)
at org.geotools.tile.util.TileLayer.getTileImage(TileLayer.java:138)
at org.geotools.tile.util.TileLayer.renderTile(TileLayer.java:131)
at org.geotools.tile.util.TileLayer.renderTiles(TileLayer.java:125)
at org.geotools.tile.util.TileLayer.draw(TileLayer.java:90)
at org.geotools.renderer.lite.CompositingGroup$WrappingDirectLayer.draw(CompositingGroup.java:227)
at org.geotools.renderer.lite.StreamingRenderer$RenderDirectLayerRequest.execute(StreamingRenderer.java:3551)
at org.geotools.renderer.lite.StreamingRenderer$PainterThread.run(StreamingRenderer.java:3612)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:514)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.base/java.lang.Thread.run(Thread.java:844)}}

This is caused by ImageUtil.processOnRegistration which still does not know anything about the new Java version number scheme. This piece of code is broken for all Java version of >= 9.

Environment

MacOS but should not be relevant.

Status

Assignee

Unassigned

Reporter

Michael Paus

Triage

None

Affects versions

Priority

High
Configure