Details
-
Bug
-
Resolution: Done
-
Major
-
4.1.0.Beta1
-
None
Description
The OpenShift Explorer was developed using jface actions (we'll replace those with commands when the workload is lower). In those actions a base class offers #validate to execute basic enablement tasks etc.
#validate is executed whenever a context-menu - that contains those actions - is about to pop up. Thus #validate should not do any long running tasks since they would potentially block the UI.
example of bad code:
Another issue is the validation in the various Actions of the OpenShift Explorer. The above stack-trace shows that the error is caused by DeleteDomainAction#validate:
at org.jboss.tools.openshift.express.internal.ui.action.DeleteDomainAction.validate(DeleteDomainAction.java:47)
@Override public void validate() { boolean enable = false; final Connection connection = UIUtils.getFirstElement(getSelection(), Connection.class); if (connection != null) { if (connection.isConnected()) { try { if (connection.getDefaultDomain() != null) { enable = true; } } catch (OpenShiftException e) { Logger.warn("Failed to retrieve User domain, prompting for creation", e); } } } setEnabled(enable); }
Validate should not do long-running taks, should not do remoting like the one here.
We should review all actions to NOT do remoting (above: connection.getDefaultDomain()). They should all fail lenient:
Stay enabled even though eventually not possible (ex. there's no domain) and fail when executed: "no domain present, cannot delete".
Attachments
Issue Links
- blocks
-
JBIDE-14632 Explorer: "could not store password" logged whenever right clicking user/navigating tree
- Closed