projectwonder/wonder — pull request #82 by lbane (2011-12-21 11:12:37+00:00)
Title: Don't throw an exception when discovering a "unknown version" browser string

ERXBasicBrowser throws an exception, when it can't determine the browser version number. This exception prevents any further processing of the request (see below).
A "unknown version" string is used in various places throughout ERXBrowserFactory, e.g. when there is no user-agent string. No user-agent string may be send, when curl or something alike is used.
I propose to use the number -1 instead of an exception, when there is a malformed version string.

java.lang.reflect.InvocationTargetException
at com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:269)
at com.webobjects.appserver._private.WOActionRequestHandler.handleRequest(WOActionRequestHandler.java:158)
at er.extensions.appserver.ERXDirectActionRequestHandler.handleRequest(ERXDirectActionRequestHandler.java:126)
at com.webobjects.appserver.WOApplication.dispatchRequest(WOApplication.java:1687)
at er.extensions.appserver.ERXApplication.dispatchRequestImmediately(ERXApplication.java:2029)
at er.extensions.appserver.ERXApplication.dispatchRequest(ERXApplication.java:1994)
at com.cx.toolkit.application.wonder.CXERXApplication.dispatchRequest(CXERXApplication.java:94)
at com.webobjects.appserver._private.WOWorkerThread.runOnce(WOWorkerThread.java:144)
at com.webobjects.appserver._private.WOWorkerThread.run(WOWorkerThread.java:226)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.NumberFormatException: For input string: "Unknown Version"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.valueOf(Integer.java:554)
at er.extensions.appserver.ERXBasicBrowser.(ERXBasicBrowser.java:190)
at er.extensions.appserver.ERXBrowserFactory.createBrowser(ERXBrowserFactory.java:287)
at er.extensions.appserver.ERXBrowserFactory.getBrowserInstance(ERXBrowserFactory.java:246)
at er.extensions.appserver.ERXBrowserFactory.browserMatchingRequest(ERXBrowserFactory.java:209)
at er.extensions.appserver.ERXRequest.browser(ERXRequest.java:230)
at er.extensions.appserver.ERXSession.browser(ERXSession.java:331)
at er.extensions.appserver.ERXSession.setLanguages(ERXSession.java:252)
at com.jip.prostata4.Session.setLanguages(Session.java:175)
at com.webobjects.appserver.WOSession.languages(WOSession.java:1198)
at com.jip.prostata4.Session.languages(Session.java:186)
at er.extensions.appserver.ERXSession.localizer(ERXSession.java:182)
at er.extensions.appserver.ERXSession.awake(ERXSession.java:425)
at com.cx.toolkit.application.wonder.CXERXSession.awake(CXERXSession.java:94)
at com.jip.prostata4.Session.awake(Session.java:120)
at com.webobjects.appserver.WOSession._awakeInContext(WOSession.java:838)
at com.webobjects.appserver.WOApplication._initializeSessionInContext(WOApplication.java:2120)
at com.webobjects.appserver.WOContext.session(WOContext.java:369)
at com.webobjects.appserver.WOAction.session(WOAction.java:165)
at com.jip.prostata4.DirectAction.session(DirectAction.java:179)
at com.jip.prostata4.DirectAction.loginUser(DirectAction.java:294)
at com.jip.prostata4.DirectAction.checkeBerechtigung(DirectAction.java:463)
at com.jip.prostata4.DirectAction.prepareLoginAction(DirectAction.java:555)
at sun.reflect.GeneratedMethodAccessor1560.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.webobjects.appserver.WODirectAction.performActionNamed(WODirectAction.java:144)
at er.extensions.appserver.ERXDirectAction.performActionNamed(ERXDirectAction.java:401)
at com.webobjects.appserver._private.WOActionRequestHandler._handleRequest(WOActionRequestHandler.java:259)
... 9 more