[jboss-jira] [JBoss JIRA] (WFCORE-572) Review usage of the two different NoSuchResourceException's

Brian Stansberry (JIRA) issues at jboss.org
Tue Mar 3 13:56:50 EST 2015


    [ https://issues.jboss.org/browse/WFCORE-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045836#comment-13045836 ] 

Brian Stansberry commented on WFCORE-572:
-----------------------------------------

In hipchat I proposed deprecating org.jboss.as.controller.registry.Resource.NoSuchResourceException, switching to org.jboss.as.controller.NoSuchResourceException, and dropping the NoSuchElementException aspect. I think I'll not do any of that, except hiding NoSuchElementException in the javadoc and specifying Resource throws org.jboss.as.controller.registry.Resource.NoSuchResourceException.

1) DMR ModelNode.require(...) throws NoSuchElementException, which is likely where Resource throwing it came from. Don't much like that exception (it's specified as being specifically for use by java.util.Enumeration) but since DMR throws it and we've thrown it in the past, I'll keep it for compatibility.

2) org.jboss.as.controller.NoSuchResourceException is little used, while org.jboss.as.controller.registry.Resource.NoSuchResourceException is used quite a lot. And, the latter is more closely associated with Resource. So, I'll deprecate the former and switch to the latter.

> Review usage of the two different NoSuchResourceException's
> -----------------------------------------------------------
>
>                 Key: WFCORE-572
>                 URL: https://issues.jboss.org/browse/WFCORE-572
>             Project: WildFly Core
>          Issue Type: Task
>          Components: Domain Management
>            Reporter: James Perkins
>            Assignee: Brian Stansberry
>
> There are two versions of the {{NoSuchResourceException}}, [{{org.jboss.as.controller.NoSuchResourceException}}|https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/java/org/jboss/as/controller/NoSuchResourceException.java] and [{{org.jboss.as.controller.registry.Resource.NoSuchResourceException}}|https://github.com/wildfly/wildfly-core/blob/master/controller/src/main/java/org/jboss/as/controller/registry/Resource.java#L299]. The usages should be reviewed as some code seems to catch one where the other is likely thrown.



--
This message was sent by Atlassian JIRA
(v6.3.11#6341)


More information about the jboss-jira mailing list