Menu

#21 Metar.getVisibilityInMeters Bug

v1.0 (example)
open
nobody
None
5
2014-06-04
2014-06-04
Steven Sell
No

There is an error in net.sf.jweather.metar.Metar.java at lines #397/8:

393:   if (visibilityMeters != null) {
394:       return visibilityMeters;
395:   } else if (visibilityKilometers != null) {
396:       return new Float(visibilityKilometers.floatValue() * 1000);
397:   } else if (visibilityKilometers != null) {
398:       return new Float(visibilityKilometers.floatValue() * 1609.344);
399:   }

The usage of visibilityKilometers should be replaced with visibilityMiles as this error causes the method to return null even if a value is present.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.