[Geoserver-devel] [JIRA] (GEOS-7661) NumberFormatException on DecimalTextField with value NaN

Torben Barsballe created an issue

GeoServer / BugGEOS-7661

NumberFormatException on DecimalTextField with value NaN

Issue Type:

BugBug

Affects Versions:

2.8.4, 2.9.0

Assignee:

Unassigned

Created:

27/Jul/16 10:37 PM

Priority:

MediumMedium

Reporter:

Torben Barsballe

This issue appears to have been introduced by GEOS-7621 Resolved .

When a DecimalTextField or similar is passed the value NaN, then validated, a NumberFormatException is thrown:

Caused by: java.lang.NumberFormatException
	at java.math.BigDecimal.<init>(BigDecimal.java:494)
	at java.math.BigDecimal.<init>(BigDecimal.java:383)
	at java.math.BigDecimal.<init>(BigDecimal.java:806)
	at org.apache.wicket.util.convert.converter.AbstractNumberConverter.parse(AbstractNumberConverter.java:126)
	at org.apache.wicket.util.convert.converter.DoubleConverter.convertToObject(DoubleConverter.java:51)
	at org.geoserver.web.wicket.DecimalConverter.convertToObject(DecimalConverter.java:48)
	at org.apache.wicket.util.convert.converter.DoubleConverter.convertToObject(DoubleConverter.java:31)
	at org.apache.wicket.markup.html.form.FormComponent.convertInput(FormComponent.java:1183)
	at org.apache.wicket.markup.html.form.AbstractTextComponent.convertInput(AbstractTextComponent.java:129)
	at org.apache.wicket.markup.html.form.FormComponent.validate(FormComponent.java:1130)
	at org.apache.wicket.markup.html.form.Form$18.validate(Form.java:1948)
	at org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:177)
	at org.apache.wicket.markup.html.form.Form$ValidationVisitor.component(Form.java:161)
	at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:274)
	at org.apache.wicket.util.visit.Visits.visitPostOrderHelper(Visits.java:262)
	at org.apache.wicket.util.visit.Visits.visitPostOrder(Visits.java:245)
	at org.apache.wicket.markup.html.form.FormComponent.visitFormComponentsPostOrder(FormComponent.java:382)
	at org.apache.wicket.markup.html.form.Form.visitFormComponentsPostOrder(Form.java:1153)
	at org.apache.wicket.markup.html.form.Form.validateComponents(Form.java:1940)
	at org.apache.wicket.markup.html.form.Form.validate(Form.java:1882)
	at org.apache.wicket.markup.html.form.Form.process(Form.java:943)
	at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:795)
	at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:708)
	... 45 more

This occurs because the wicket AbstractNumberConverter uses BigDecimals, which cannot handle NaN or +/- infinity.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.184.1#100008-sha1:1fb1cc9)

Atlassian logo