[jboss-jira] [JBoss JIRA] (WFCORE-4707) OperationContext.getCapabilityServiceName(String, String...) generates wrong ServiceName if capability is not registered and dynamic part contains a DOT
Paul Ferraro (Jira)
issues at jboss.org
Thu Oct 10 17:06:00 EDT 2019
Paul Ferraro created WFCORE-4707:
------------------------------------
Summary: OperationContext.getCapabilityServiceName(String, String...) generates wrong ServiceName if capability is not registered and dynamic part contains a DOT
Key: WFCORE-4707
URL: https://issues.jboss.org/browse/WFCORE-4707
Project: WildFly Core
Issue Type: Bug
Components: Management
Affects Versions: 10.0.0.Final
Reporter: Paul Ferraro
Assignee: Jeff Mesnil
Consider the call:
{code:java}
OperationContext.getCapabilityServiceName("test", "foo.bar");
{code}
This method first resolves the qualified capability name as "test.foo.bar". If no capability is registered with that name, the service name is generated using:
{code:java}
ServiceNameFactory.parseServiceName("test.foo.bar");
{code}
This generates a ServiceName with 3 elements.
However, when this capability is actually created with name of "test" and dynamic part "foo.bar", its service name will contain 2 elements, not 3.
i.e.
{code:java}
RuntimeCapability.Builder.of("test", true, ServiceType.class).fromBaseCapability("foo.bar").getCapabilityServiceName();
{code}
Interestingly, the correspond method return by the OperationContext.getCapabilityServiceSupport() implementation does this correctly.
i.e.
{code:java}
OperationContext.getCapabilityServiceSupport().getCapabilityServiceName("test", "foo.bar");
{code}
returns the result of:
{code:java}
ServiceNameFactory.parseServiceName("test").append("foo.bar");
{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list