Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362044 - BrowserRidget/WebKit fires an exception if the URL is empty
Summary: BrowserRidget/WebKit fires an exception if the URL is empty
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: 4.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-26 05:45 EDT by Thorsten Schenkel CLA
Modified: 2012-05-15 12:33 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.