-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved handling of null values in AbstractEditPartViewer #433
Comments
You are right, I also don't think that there should be a null in the list of selected EditParts. A protection should be added. I looked a bit into the code and I think the However while writing this I had a second look. In all methods where you would update the selection with a null |
I already know what the problem is. I called My point is that the error message is rather cryptic, and I think we should directly check whether the argument is null, when invoking |
The selection inside a GEF viewer is assumed to always be non-null. Trying to do so silently puts the viewer in an inconsistent state and only cause an error when the selection is changed again. To avoid any changes in behavior, this change only adds a log message but doesn't change the execution flow. Resolves eclipse#433
The selection inside a GEF viewer is assumed to always be non-null. Trying to do so puts the viewer in an inconsistent state because the edit part is added to the internal selection, before an exception is fired. To avoid this, we check the editpart and skip it, if it happens to be null. Resolves eclipse#433
The selection inside a GEF viewer is assumed to always be non-null. But because the (implicit) null check is done after the editpart is added to the internal list, it leaves the viewer in an inconsistent state. To avoid this, the null check is done earlier, so that the exception is thrown before the internal model is modified. Resolves eclipse#433
The selection inside a GEF viewer is assumed to always be non-null. But because the (implicit) null check is done after the editpart is added to the internal list, it leaves the viewer in an inconsistent state. To avoid this, the null check is done earlier, so that the exception is thrown before the internal model is modified. Resolves eclipse#433
The selection inside a GEF viewer is assumed to always be non-null. But because the (implicit) null check is done after the editpart is added to the internal list, it leaves the viewer in an inconsistent state. To avoid this, the null check is done earlier, so that the exception is thrown before the internal model is modified. Resolves #433
This is an error I just encountered while implementing a new graphical viewer:
Cause seems to be that
null
is among the selected edit parts. Based on the exception, I assume that this is an unexpected state.I think the
select()
method should either ignore those values or all methods working on the selection should have an additional null-check.The text was updated successfully, but these errors were encountered: