SeleniumHQ/selenium — pull request #140 by sevaseva (2013-12-05 07:33:03+00:00)
Title: Making RemoteWebDriver#init(Capabilities, Capabilities) overridable by subclasses.

Rationale:
Because of the "all happens in constructor" situation..., handling initialization errors is hard. E.g. is we want to clean up after browser startup/connectivity failure.
Overriding init() allows completing initialization of a RemoteWEbDriver subclass before heavy stuff (startClient(), startSession() called still by the constructor) starts: we can pass necessary values as Capabilities and save then in the overridden init().
Similar effect can already be achieved by overriding startSession(), but init() is better because it is called before startClient() (important e.g. for FirefoxDriver where browser process gets started in startClient()).