Closed joshmoore closed 4 years ago
In Insight (merge-ci build) I now get a
java.lang.NumberFormatException: Infinite or NaN
at java.math.BigDecimal.<init>(BigDecimal.java:898)
at java.math.BigDecimal.<init>(BigDecimal.java:875)
at ome.model.units.Conversion$Sym.convert(Conversion.java:271)
at ome.model.units.Conversion$Mul.convert(Conversion.java:189)
at omero.model.LengthI.<init>(LengthI.java:1453)
at omero.model.LengthI.<init>(LengthI.java:1471)
at omero.gateway.model.PixelsData.getPixelSizeY(PixelsData.java:291)
at org.openmicroscopy.shoola.agents.util.EditorUtil.transformPixelsData(EditorUtil.java:723)
at org.openmicroscopy.shoola.agents.util.EditorUtil.formatObjectTooltip(EditorUtil.java:2531)
at
Is that expected? But to be honest, I don't even know which gateway or blitz jar the merge-ci Insight build uses...
Btw, created an image with inf
and nan
pixel sizes on mergeci, Image id: 93961 (user-3)
But the changes make sense. Might just have to handle that better in Insight. Although it's a really completely artificial case.
Is that expected?
if (Double.isInfinite(orig)) {
// Do nothing. Use orig
} else {
BigDecimal big = conversion.convert(orig); // line 1453
converted = big.doubleValue();
If orig
is a NaN in this case, then it would make sense. I'll update my PR to check for that as well.
I don't even know which gateway or blitz jar the merge-ci Insight build uses...
All the builds are chained together, so it should be testing what you expect.
Ah of course. Sorry, yes, I created the image with both inf
and nan
like it was mentioned on the trello card. Don't know if that case actually needs to be handled too or can be ignored.
Pushed.
Updated with specific RuntimeException subclass (InvalidArgument) and docs.
cc: @mtbc
If an input is an infinity, then do not perform the conversion. Throw InvalidArgumentException if nulls, PIXELS, or other unconvertible source/target pairs are passed.
see:
cc: @dominikl @jburel @mtbc