Project: Eclipse_Platform_UI
Bug 194988 [Workbench] Create Browser says it accepts null but it fails with null pointer if you do.
Reported: 2007-06-29 20:32:41 | Status: verified fixed

/** * Creates the new web browser instance. This is a simplified method that * creates the instance using default values for style, name and tooltip * parameters. The method can be used to quickly open the URL by calling * <code>createBrowser(id).openURL(url)</code>. * <p> * * @return the browser instance that can be used to open the URL. Clients * intending to reuse the instance for all the URLs should cache the * instance and call IWebBrowser#openURL() on it. Clients are * responsible for closing the browser instance when not needed. * @exception PartInitException * if the operation failed for some reason */ IWebBrowser createBrowser(String browserId) throws PartInitException; The createBrowser method has the following documentation: * @param browserId * if an instance of a browser with the same id is already * opened, it will be returned instead of creating a new one. * Passing <code>null</code> will create a new instance with a * generated id every time. However whenever I pass null I get a null pointer exception on the create call. This was in code that worked in 3.2. Once I changed the code to pass in the url as the browser id it started working fine.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/browser/DefaultWorkbenchBrowserSupport.java