[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-6466) Several class loader related unsafe places in JBoss Tools

Rob Stryker (JIRA) jira-events at lists.jboss.org
Thu Jun 24 06:22:46 EDT 2010


    [ https://jira.jboss.org/browse/JBIDE-6466?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12536916#action_12536916 ] 

Rob Stryker commented on JBIDE-6466:
------------------------------------

I would like to note that in JMX, the removal of the 'concerned' is almost guaranteed not to throw an exception as it's a simple list removal with a null check. Removals on a collection don't throw exceptions unless the argument is null. In this case the only way the argument is null is if the server is null (might throw exception) or the id is null (not a real server?). In either of these cases, you're removing some listener as concerned with a nonexistant server, and thus, a server that could not have possibly changed the classloader. 

> Several class loader related unsafe places in JBoss Tools
> ---------------------------------------------------------
>
>                 Key: JBIDE-6466
>                 URL: https://jira.jboss.org/browse/JBIDE-6466
>             Project: Tools (JBoss Tools)
>          Issue Type: Sub-task
>          Components: Archives, bpel, jbpm, jmx
>    Affects Versions: 3.1.1
>            Reporter: Vitali Yemialyanchyk
>            Assignee: Max Rydahl Andersen
>
> I find several unsafe places which are related with Thread.currentThread().getContextClassLoader() and Thread.currentThread().setContextClassLoader(). These places in code could have dramatic outcome during JBoss Tools normal work.
> Especially Hibernate Tools depends on it - and this result will be visible ONLY in JPA confoguration.
> Here are code places:
> 1) \jbosstools\trunk\jbpm\plugins\org.jboss.tools.flow.jpdl4.multipage\src\org\jboss\tools\flow\jpdl4\multipage\validator\Jpdl4Validator.java 
> 2) \jbosstools\trunk\archives\plugins\org.jboss.ide.eclipse.archives.core\src\main\org\jboss\ide\eclipse\archives\core\model\internal\xb\XMLBinding.java 
> 1 and 2 - are dangerous cause in case of execution exception - here there are no restore of Thread.currentThread() - ContextClassLoader;
> 3) \jbosstools\trunk\as\plugins\org.jboss.ide.eclipse.as.core\jbosscore\org\jboss\ide\eclipse\as\core\extensions\jmx\JMXSafeRunner.java 
> 3 - here also Hibernate Tools dangerous place in finally block - if we get exception in 
> JMXClassLoaderRepository.getDefault().removeConcerned(s, r);
> 4) \jbosstools\trunk\common\plugins\org.jboss.tools.common\src\org\jboss\tools\common\xml\SAXValidator.java 
> 4 - here also Hibernate Tools dangerous place in finally block - if we get exception in 
> ErrorHandlerImpl h = new ErrorHandlerImpl();
> 5) \jbosstools\trunk\bpel\plugins\org.eclipse.bpel.ui\src\org\eclipse\bpel\ui\util\BPELEditorUtil.java 
> - here is potential unsafe code commented;
> 6) \jbosstools\trunk\smooks\plugins\org.jboss.tools.smooks.ui\src\org\jboss\tools\smooks\edimap\editor\EDIMapFormPage.java 
> - here is potential unsafe code commented;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list