MetarParser icon indicating copy to clipboard operation
MetarParser copied to clipboard

Failed to parse java.lang.NumberFormatException: For input string: "//"

Open centralhardware opened this issue 1 year ago • 3 comments

MetarService.getInstance().retrieveFromAirport("unnt")
UNNT 170900Z 22005MPS 7000 -SN NSC M21/M25 Q1035 R25/410150 R16/////// NOSIG RMK QFE766/1021
java.lang.NumberFormatException: For input string: "//"
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054)
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
	at java.base/java.lang.Double.parseDouble(Double.java:792)
	at io.github.mivek.command.metar.RunwayCommand.parseDepositBrakingCapacity(RunwayCommand.java:131)
	at io.github.mivek.command.metar.RunwayCommand.execute(RunwayCommand.java:96)
	at io.github.mivek.parser.MetarParser.executeCommand(MetarParser.java:105)
	at io.github.mivek.parser.MetarParser.parse(MetarParser.java:88)
	at io.github.mivek.parser.MetarParser.parse(MetarParser.java:22)
	at io.github.mivek.service.MetarService.retrieveFromAirport(MetarService.java:48)
	at MainKt.getMetar(Main.kt:19)

centralhardware avatar Feb 17 '24 09:02 centralhardware

Runway information with /// are not parsed by the MetarParser

mivek avatar Feb 24 '24 12:02 mivek

Runway information with /// are not parsed by the MetarParser

@mivek OK, but why parser doesn't throw something like UnsupportedFormatException with detailed message about why this happened?

centralhardware avatar Feb 24 '24 13:02 centralhardware

That is a good idea, I'm reopening this issue as a feature

mivek avatar Feb 25 '24 11:02 mivek