Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362044

Summary: BrowserRidget/WebKit fires an exception if the URL is empty
Product: [RT] Riena Reporter: Thorsten Schenkel <thorsten.schenkel>
Component: ridgetAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nobody
Version: 4.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Thorsten Schenkel CLA 2011-10-26 05:45:31 EDT
If the URL of the BrowserRidget is empty (null or empty string ""), BrowserRidget.updateUIControl doesn't work, because the follwoing exception is thrown:

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
	at java.lang.String.charAt(String.java:686)
	at org.eclipse.swt.browser.WebKit.setUrl(WebKit.java:1300)
	at org.eclipse.swt.browser.Browser.setUrl(Browser.java:1108)
	at org.eclipse.swt.browser.Browser.setUrl(Browser.java:1076)
	at org.eclipse.riena.internal.ui.ridgets.swt.BrowserRidget.updateUIControl(BrowserRidget.java:185)
	at org.eclipse.riena.internal.ui.ridgets.swt.BrowserRidget.bindUIControl(BrowserRidget.java:69)
	at org.eclipse.riena.ui.ridgets.swt.AbstractSWTWidgetRidget.setUIControl(AbstractSWTWidgetRidget.java:271)
	at org.eclipse.riena.ui.ridgets.uibinding.DefaultBindingManager.bindRidget(DefaultBindingManager.java:194)
	at org.eclipse.riena.ui.ridgets.uibinding.DefaultBindingManager.updateBindings(DefaultBindingManager.java:184)
	at org.eclipse.riena.ui.ridgets.uibinding.DefaultBindingManager.bind(DefaultBindingManager.java:156)
	at org.eclipse.riena.ui.ridgets.swt.uibinding.AbstractViewBindingDelegate.bind(AbstractViewBindingDelegate.java:100)
	at org.eclipse.riena.navigation.ui.swt.views.SubModuleView.bind(SubModuleView.java:166)
	at org.eclipse.riena.navigation.ui.swt.views.SubModuleView.doBinding(SubModuleView.java:651)
	at org.eclipse.riena.navigation.ui.swt.views.SubModuleView.createPartControl(SubModuleView.java:236)

This error is not reproducible with Windows (no WebKit).
Comment 1 Nobody - feel free to take it CLA 2012-05-15 12:33:34 EDT
I could only reproduce this on Ubuntu + Webkit.
Passing null or an empty String to the Browser.setUrl(...) methods is not valid since it is not a valid URL (the constructor new URL(string) will fail. If a blank page should be shown in the browser widget, the String to pass is "about:blank". This works with IE, Mozilla and Webkit.