Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-9520

LocalJBossBehaviorDelegate#canChangeState should not swallow Exception

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 3.3.0.M3
    • 3.3.0.M3
    • server
    • None

      LocalJBossBehaviorDelegate#canChangeState swallows an Exception can would occur when getting the jboss runtime for a given server:

      	public IStatus canChangeState(String launchMode) {
      		try {
      		if( getServer() != null 
      				&& getServer().getRuntime() != null 
      				&& RuntimeUtils.checkedGetJBossServerRuntime(getServer()).getVM() != null )
      			return Status.OK_STATUS;
      		} catch(Exception e) {
      			// ignore
      		}
      		return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 
      				MessageFormat.format(Messages.ServerHasNoRuntime, getServer().getName())); 
      	}
      

      RuntimeUtils#checkedGetJBossServerRuntime throws a CoreException if fetching failed. We should not swallow this exception but return it instead of a general purpose error status.

            adietish@redhat.com André Dietisheim
            adietish@redhat.com André Dietisheim
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: