{"action":"created","issue":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/644","labels_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/644/labels{/name}","comments_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/644/comments","events_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/644/events","html_url":"https://github.com/SeleniumHQ/selenium/issues/644","id":87141928,"number":644,"title":"ClassCastException in ErrorHandler if agent sends a non-numeric lineNumber","user":{"login":"javabrett","id":1103477,"avatar_url":"https://avatars.githubusercontent.com/u/1103477?v=3","gravatar_id":"","url":"https://api.github.com/users/javabrett","html_url":"https://github.com/javabrett","followers_url":"https://api.github.com/users/javabrett/followers","following_url":"https://api.github.com/users/javabrett/following{/other_user}","gists_url":"https://api.github.com/users/javabrett/gists{/gist_id}","starred_url":"https://api.github.com/users/javabrett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javabrett/subscriptions","organizations_url":"https://api.github.com/users/javabrett/orgs","repos_url":"https://api.github.com/users/javabrett/repos","events_url":"https://api.github.com/users/javabrett/events{/privacy}","received_events_url":"https://api.github.com/users/javabrett/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-10T23:23:59Z","updated_at":"2015-06-18T22:22:55Z","closed_at":"2015-06-18T22:22:55Z","body":"Selenium 2.46.0, Firefox 38.0.5.\r\n\r\nSaw this exception during a test:\r\n\r\n    java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number\r\n        at org.openqa.selenium.remote.ErrorHandler$FrameInfoToStackFrame.apply(ErrorHandler.java:297)\r\n        at org.openqa.selenium.remote.ErrorHandler$FrameInfoToStackFrame.apply(ErrorHandler.java:1)\r\n        at com.google.common.collect.Iterators$8.next(Iterators.java:782)\r\n        at com.google.common.collect.Iterators$7.computeNext(Iterators.java:644)\r\n        at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141)\r\n        at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136)\r\n        at com.google.common.collect.Lists.newArrayList(Lists.java:138)\r\n        at com.google.common.collect.Iterables.toCollection(Iterables.java:312)\r\n        at com.google.common.collect.Iterables.toArray(Iterables.java:290)\r\n        at org.openqa.selenium.remote.ErrorHandler.rebuildServerError(ErrorHandler.java:270)\r\n        at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:118)\r\n        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)\r\n        at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:269)\r\n        at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:172)\r\n        at org.openqa.selenium.remote.RemoteWebElement.findElementById(RemoteWebElement.java:205)\r\n        at org.openqa.selenium.By$ById.findElement(By.java:215)\r\n        at org.openqa.selenium.remote.RemoteWebElement.findElement(RemoteWebElement.java:168)\r\n\r\nFrom looking at some of the agents' source, it seems possible that sometimes a stack frame might contain `lineNumber = \"\"` (empty string) or even `lineNumber = \"Not available\"`, which could explain the above CCE.\r\n\r\n`ErrorHandler$FrameInfoToStackFrame.apply` should be more defensive when pulling `LINE_NUMBER` from the map.  It also currently bails-out with no info if the line number is absent, whereas it seems reasonable that it could create a stack frame with line number = -1, negative (but not -2 == in-native) being conventional for unknown per `java.lang.StackTraceElement`.\r\n"},"comment":{"url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/comments/113304357","html_url":"https://github.com/SeleniumHQ/selenium/issues/644#issuecomment-113304357","issue_url":"https://api.github.com/repos/SeleniumHQ/selenium/issues/644","id":113304357,"user":{"login":"barancev","id":617090,"avatar_url":"https://avatars.githubusercontent.com/u/617090?v=3","gravatar_id":"","url":"https://api.github.com/users/barancev","html_url":"https://github.com/barancev","followers_url":"https://api.github.com/users/barancev/followers","following_url":"https://api.github.com/users/barancev/following{/other_user}","gists_url":"https://api.github.com/users/barancev/gists{/gist_id}","starred_url":"https://api.github.com/users/barancev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barancev/subscriptions","organizations_url":"https://api.github.com/users/barancev/orgs","repos_url":"https://api.github.com/users/barancev/repos","events_url":"https://api.github.com/users/barancev/events{/privacy}","received_events_url":"https://api.github.com/users/barancev/received_events","type":"User","site_admin":false},"created_at":"2015-06-18T22:22:55Z","updated_at":"2015-06-18T22:22:55Z","body":"Fixed by bdf4170a0332061d094fb330cc2eb7b5a9775eb4"}}