Bug 576197 - Improve "Argument not valid" message for disposed parent containers
Summary: Improve "Argument not valid" message for disposed parent containers
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-22 10:05 EDT by Lars Vogel CLA
Modified: 2021-09-22 10:05 EDT (History)
0 users

See Also:


Attachments

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