[ 
https://issues.apache.org/jira/browse/WICKET-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16617686#comment-16617686
 ] 

Thomas Heigl commented on WICKET-6589:
--------------------------------------

What about wrapping the integer parsing in a try-catch, log a warning and keep 
the minor version as -1 if it can't be parsed?

 

> ClientInfo fails with NumberFormatException for unusual browser versions
> ------------------------------------------------------------------------
>
>                 Key: WICKET-6589
>                 URL: https://issues.apache.org/jira/browse/WICKET-6589
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 8.1.0
>            Reporter: Thomas Heigl
>            Priority: Major
>
> Determining browser versions from the user agent can fail with an exception. 
> As seen on our PROD environment for the following user agent:
> "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 
> Firefox/50.01537112190982"
> I'm not sure this is a valid UA, but Wicket should probably never fail with 
> an exception in this case.
> {code:java}
> Details: java.lang.NumberFormatException: For input string: "01537112190982"
>         at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
>         at java.lang.Integer.parseInt(Integer.java:583)
>         at java.lang.Integer.parseInt(Integer.java:615)
>         at 
> org.apache.wicket.protocol.http.request.WebClientInfo.setMajorMinorVersionByPattern(WebClientInfo.java:354)
>         at 
> org.apache.wicket.protocol.http.request.WebClientInfo.setMozillaProperties(WebClientInfo.java:285)
>         at 
> org.apache.wicket.protocol.http.request.WebClientInfo.init(WebClientInfo.java:198)
>         at 
> org.apache.wicket.protocol.http.request.WebClientInfo.<init>(WebClientInfo.java:112)
>         at 
> org.apache.wicket.protocol.http.request.WebClientInfo.<init>(WebClientInfo.java:76)
>         at 
> org.apache.wicket.protocol.http.request.WebClientInfo.<init>(WebClientInfo.java:65)
>         at 
> org.apache.wicket.protocol.http.WebSession.getClientInfo(WebSession.java:88){code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to