Indoorhelper crashes when level is a float
Closed this issue · 4 comments
How to reproduce:
Set level of an object to e.g. '-0.5', select -0.5 in the level selector.
Expected behaviour:
All Objects on Level -0.5 are selected.
Actual behaviour:
The extension crashes repeatedly until deactivated.
Reason for crashing:
=== STACK TRACE ===
Thread: AWT-EventQueue-0 (19) of main
java.lang.NumberFormatException: For input string: "-0.5"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:652)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at org.openstreetmap.josm.plugins.indoorhelper.controller.IndoorHelperController.unsetSpecificKeyFilter(IndoorHelperController.java:382)
Idea for solving:
In
and
change
Integer.parseInt
to Float.parseFloat
Related to #22100
@wielandb Thanks for the bug report. There is still a discussion about the use of intermediate levels (see related JOSM issue). For sure we need to catch the exception. For now I would suggest to only accept integer values for levels. What is your usecase to make use of float values?
What is your usecase to make use of float values?
I am working for DYNAMIK, who afaik are in active exchange with many people in OSM-indoor-tagging, so I was convinced that the use of commas in level-attributes is accepted.
We use comma numbers to indicate half-levels, so if a staircase makes a "turn", the flat area between two levels X and Y will be on level X.5.
For sure we need to catch the exception.
I mean, if that would mean that I could use half levels without the extension crashing while still beeing able to use it for normal levels I would be more than happy. :)
Release v1.2.2 should be able to handle float values for level tags. The release is not yet available via JOSM plugin updates. This will probably happen within the next 2 or 3 weeks. If you need the update right now, grab the indoorhelper.jar
from release v1.2.2 version page and replace it with the indoorhelper.jar
within your local Indoorhelper folder. Please let me know if you need some help with that.
Please note: the plugin actually can handle the repeat_on=*
key and will enable/disable a node or way if the repeat_on=*
key contains the current active level value (e.g. selecting the active level via JOSM Autofilters). This functionality is currently not supported for float level values.
The fix should now be available via the integrated update tool in JOSM.