Buggy code:
static final String PROFILE_DO_CHANGE = "profile-do-change" ; static final String PROPERTY_PROXYPORT = "network.proxy_port" ; static final String PROPERTY_PROXYHOST = "network.proxy_host" ; static final String SEPARATOR_LOCALE = "-" ; static final String SHUTDOWN_PERSIST = "shutdown-persist" ; static final String STARTUP = "startup" ; static final String TOKENIZER_LOCALE = "," ; static final String URI_FROMMEMORY = "file://////" ; static final String XULRUNNER_PATH = "org.eclipse.swt.browser.XULRunnerPath" ; static final String GRE_INITIALIZED = "org.eclipse.swt.browser.XULRunnerInitialized" ; public void create ( Composite parent , int style ) { } public boolean back ( ) { } void createCOMInterfaces ( ) { } void disposeCOMInterfaces ( ) { } public boolean execute ( String script ) { } static Browser findBrowser ( int handle ) { } public boolean forward ( ) { } public String getText ( ) { } public String getUrl ( ) { } public Object getWebBrowser ( ) { } public boolean isBackEnabled ( ) { } public boolean isForwardEnabled ( ) { } static String error ( int code ) { } void onDispose ( Display display ) { } void Activate ( ) { } void Deactivate ( ) { } void onResize ( ) { } public void refresh ( ) { } public boolean setText ( String html ) { } public boolean setUrl ( String url ) { } public void stop ( ) { } void hookDOMListeners ( nsIDOMEventTarget target , boolean isTop ) { } void unhookDOMListeners ( ) { } void unhookDOMListeners ( nsIDOMEventTarget target ) { } int QueryInterface ( int riid , int ppvObject ) { } int AddRef ( ) { } int Release ( ) { } int QueryReferent ( int riid , int ppvObject ) { } int GetInterface ( int riid , int ppvObject ) { } int GetWeakReference ( int ppvObject ) { } int OnStateChange ( int aWebProgress , int aRequest , int aStateFlags , int aStatus ) { } int OnProgressChange ( int aWebProgress , int aRequest , int aCurSelfProgress , int aMaxSelfProgress , int aCurTotalProgress , int aMaxTotalProgress ) { } int OnLocationChange ( int aWebProgress , int aRequest , int aLocation ) { } int OnStatusChange ( int aWebProgress , int aRequest , int aStatus , int aMessage ) { } int OnSecurityChange ( int aWebProgress , int aRequest , int state ) { } int SetStatus ( int statusType , int status ) { } int GetWebBrowser ( int aWebBrowser ) { } int SetWebBrowser ( int aWebBrowser ) { } int GetChromeFlags ( int aChromeFlags ) { } int SetChromeFlags ( int aChromeFlags ) { } int DestroyBrowserWindow ( ) { } int SizeBrowserTo ( int aCX , int aCY ) { } int ShowAsModal ( ) { } int IsWindowModal ( int retval ) { } int ExitModalEventLoop ( int aStatus ) { } int SetDimensions ( int flags , int x , int y , int cx , int cy ) { } int GetDimensions ( int flags , int x , int y , int cx , int cy ) { } int SetFocus ( ) { } int GetVisibility ( int aVisibility ) { } int SetVisibility ( int aVisibility ) { } int GetTitle ( int aTitle ) { } int SetTitle ( int aTitle ) { } int GetSiteWindow ( int aSiteWindow ) { } int FocusNextElement ( ) { } int FocusPrevElement ( ) { } int OnShowContextMenu ( int aContextFlags , int aEvent , int aNode ) { } int OnStartURIOpen ( int aURI , int retval ) { if ( ( awaitingNavigate ) || ( ( locationListeners . length ) == 0 ) ) { XPCOM . memmove ( retval , new int [ ] { 0 } , 4 ) ; return XPCOM . NS_OK ; } nsIURI location = new nsIURI ( aURI ) ; int aSpec = XPCOM . nsEmbedCString_new ( ) ; location . GetSpec ( aSpec ) ; int length = XPCOM . nsEmbedCString_Length ( aSpec ) ; int buffer = XPCOM . nsEmbedCString_get ( aSpec ) ; buffer = XPCOM . nsEmbedCString_get ( aSpec ) ; byte [ ] dest = new byte [ length ] ; XPCOM . memmove ( dest , buffer , length ) ; XPCOM . nsEmbedCString_delete ( aSpec ) ; String value = new String ( dest ) ; boolean doit = true ; if ( ( request ) == 0 ) { if ( ! ( value . startsWith ( Mozilla . PREFIX_JAVASCRIPT ) ) ) { LocationEvent event = new LocationEvent ( browser ) ; event . display = browser . getDisplay ( ) ; event . widget = browser ; event . location = value ; if ( event . location . equals ( Mozilla . URI_FROMMEMORY ) ) event . location = Mozilla . ABOUT_BLANK ; event . doit = doit ; for ( int i = 0 ; i < ( locationListeners . length ) ; i ++ ) { locationListeners [ i ] . changing ( event ) ; } <START_BUG> doit = event . doit ; <END_BUG> } } XPCOM . memmove ( retval , new int [ ] { doit ? 0 : 1 } , 4 ) ; return XPCOM . NS_OK ; } int DoContent ( int aContentType , int aIsContentPreferred , int aRequest , int aContentHandler , int retval ) { } int IsPreferred ( int aContentType , int aDesiredContentType , int retval ) { } int CanHandleContent ( int aContentType , int aIsContentPreferred , int aDesiredContentType , int retval ) { } int GetLoadCookie ( int aLoadCookie ) { } int SetLoadCookie ( int aLoadCookie ) { } int GetParentContentListener ( int aParentContentListener ) { } int SetParentContentListener ( int aParentContentListener ) { } int OnShowTooltip ( int aXCoords , int aYCoords , int aTipText ) { } int OnHideTooltip ( ) { } int HandleEvent ( int event ) { } }

Fix:
doit = ( event . doit ) && ( ! ( browser . isDisposed ( ) ) ) ;