[jbosstools-issues] [JBoss JIRA] (JBIDE-9520) LocalJBossBehaviorDelegate#canChangeState should not swallow Exception

Martin Malina (JIRA) jira-events at lists.jboss.org
Thu Apr 5 08:58:48 EDT 2012


     [ https://issues.jboss.org/browse/JBIDE-9520?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Malina closed JBIDE-9520.
--------------------------------


    
> LocalJBossBehaviorDelegate#canChangeState should not swallow Exception
> ----------------------------------------------------------------------
>
>                 Key: JBIDE-9520
>                 URL: https://issues.jboss.org/browse/JBIDE-9520
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: JBossAS/Servers
>    Affects Versions: 3.3.0.M3
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 3.3.0.M3
>
>
> LocalJBossBehaviorDelegate#canChangeState swallows an Exception can would occur when getting the jboss runtime for a given server:
> {code}
> 	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())); 
> 	}
> {code}
> RuntimeUtils#checkedGetJBossServerRuntime throws a CoreException if fetching failed. We should not swallow this exception but return it instead of a general purpose error status.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list