Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 289367 - MasterDetailsRidget should throw a IllegalStateException if no IMasterDetailsDelegate was supplied
Summary: MasterDetailsRidget should throw a IllegalStateException if no IMasterDetails...
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: ridget (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: 1.2.0.M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-14 11:12 EDT by Steffen Kriese CLA
Modified: 2011-05-19 05:48 EDT (History)
0 users

See Also:


Attachments
Patch (968 bytes, patch)
2009-09-21 05:43 EDT, Steffen Kriese CLA
christian.campo: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Kriese CLA 2009-09-14 11:12:53 EDT
If a MasterDetailsComposite gets created and no IMasterDetailsComposite gets supplied via the setDelegate-Method a NullPointerException is thrown, when the User selects a row in the Table: 

java.lang.NullPointerException
	at org.eclipse.riena.internal.ui.ridgets.swt.MasterDetailsRidget.updateDetails(MasterDetailsRidget.java:341)
	at org.eclipse.riena.internal.ui.ridgets.swt.MasterDetailsRidget.handleSelectionChange(MasterDetailsRidget.java:415)
	at org.eclipse.riena.internal.ui.ridgets.swt.MasterDetailsRidget.access$3(MasterDetailsRidget.java:411)
	at org.eclipse.riena.internal.ui.ridgets.swt.MasterDetailsRidget$DirtyDetailsChecker.widgetSelected(MasterDetailsRidget.java:447)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.riena.navigation.ui.swt.application.SwtApplication.createView(SwtApplication.java:64)
	at org.eclipse.riena.navigation.ui.application.AbstractApplication.start(AbstractApplication.java:63)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

	
Instead it would be much more userfriendly, if a IllegalStateException would be thrown as soon as possible so the Developer gets notified that he did not implement the API correctly.
Comment 1 Elias Volanakis CLA 2009-09-17 00:50:29 EDT
+1 

I agree
Comment 2 Elias Volanakis CLA 2009-09-18 03:15:16 EDT
@Steffen: Now that the other MasterDetails patch is in - would you like to address this as well?
Comment 3 Steffen Kriese CLA 2009-09-21 05:43:51 EDT
Created attachment 147677 [details]
Patch

Throws a IllegalStateException in updateFromModel if no delegate was supplied.
Comment 4 Elias Volanakis CLA 2009-09-26 00:34:03 EDT
Thanks, resolved.