Bug 576197

Summary: Improve "Argument not valid" message for disposed parent containers
Product: [Eclipse Project] Platform Reporter: Lars Vogel <Lars.Vogel>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:

Description Lars Vogel CLA 2021-09-22 10:05:19 EDT
Currently if I create a widget on a disposed container I get:

"Argument not valid"

Would it be possible to return a message which is a bit more helpful? For null parameter I get:

Caused by: java.lang.IllegalArgumentException: Argument cannot be null

Maybe we could add a new exception for argument is disposed and return it in Widget#checkParent?

Currently:

if (parent.isDisposed ()) error (SWT.ERROR_INVALID_ARGUMENT);