Buggy code:
public class ParsedKernelDeploymentProcessor implements DeploymentUnitProcessor { public static final ServiceName JBOSS_MC_POJO = JBOSS . append ( "mc" , "pojo" ) ; public void deploy ( DeploymentPhaseContext phaseContext ) throws DeploymentUnitProcessingException { } public void undeploy ( final DeploymentUnit context ) { } @ SuppressWarnings ( { "unchecked" } ) private < T > void addBean ( final ServiceTarget serviceTarget , BeanMetaDataConfig beanConfig , Class < T > clazz , DeploymentReflectionIndex deploymentIndex ) throws ClassNotFoundException { final ClassReflectionIndex < T > index = deploymentIndex . getClassIndex ( clazz ) ; final Constructor < T > constructor = index . getConstructor ( ) ; final List < ? extends Value < ? > > args = Collections . emptyList ( ) ; final ServiceName beanServiceName = ParsedKernelDeploymentProcessor . JBOSS_MC_POJO . append ( beanConfig . getName ( ) ) ; final ServiceName instantiatedServiceName = beanServiceName . append ( INSTANTIATED . name ( ) ) ; <START_BUG> final ValueService < T > instantiatedService = new ValueService < T > ( new org . jboss . msc . value . ConstructedValue ( Values . immediateValue ( constructor ) , args ) ) ; <END_BUG> final ServiceBuilder < T > instantiatedServiceBuilder = serviceTarget . addService ( instantiatedServiceName , instantiatedService ) ; instantiatedServiceBuilder . install ( ) ; final ServiceName configuredServiceName = beanServiceName . append ( CONFIGURED . name ( ) ) ; final ServiceBuilder < T > configuredServiceBuilder = serviceTarget . addService ( configuredServiceName , new ValueService < T > ( instantiatedService ) ) ; configuredServiceBuilder . addDependency ( instantiatedServiceName ) . install ( ) ; final String createName = "create" ; final String destroyName = "destroy" ; final Method create = ParsedKernelDeploymentProcessor . getInstanceMethod ( index , createName ) ; final Method destroy = ParsedKernelDeploymentProcessor . getInstanceMethod ( index , destroyName ) ; final McLifecycleService < T > createService = new McLifecycleService < T > ( create , destroy ) ; final ServiceName createServiceName = beanServiceName . append ( CREATE . name ( ) ) ; final ServiceBuilder < T > createServiceBuilder = serviceTarget . addService ( createServiceName , createService ) ; createServiceBuilder . addDependency ( configuredServiceName , clazz , createService . getValueInjector ( ) ) . install ( ) ; final String startName = "start" ; final String stopName = "stop" ; final Method start = ParsedKernelDeploymentProcessor . getInstanceMethod ( index , startName ) ; final Method stop = ParsedKernelDeploymentProcessor . getInstanceMethod ( index , stopName ) ; final McLifecycleService < T > startService = new McLifecycleService < T > ( start , stop ) ; final ServiceName startServiceName = beanServiceName . append ( START . name ( ) ) ; final ServiceBuilder < T > startServiceBuilder = serviceTarget . addService ( startServiceName , startService ) ; startServiceBuilder . addDependency ( createServiceName , clazz , startService . getValueInjector ( ) ) . install ( ) ; final ServiceName installedServiceName = beanServiceName . append ( INSTALLED . name ( ) ) ; final ServiceBuilder < T > installedServiceBuilder = serviceTarget . addService ( installedServiceName , new ValueService < T > ( startService ) ) ; installedServiceBuilder . addDependency ( startServiceName ) . install ( ) ; } private static Method getInstanceMethod ( ClassReflectionIndex < ? > index , String name , Class < ? > ... params ) { } }

Fix:
final ValueService < T > instantiatedService = new ValueService < T > ( new ConstructedValue ( constructor , args ) ) ;