Buggy code:
public abstract class AbstractDataSourceService implements Service < DataSource > { public static final ServiceName SERVICE_NAME_BASE = JBOSS . append ( "data-source" ) ; private static final DeployersLogger DEPLOYERS_LOGGER = Logger . getMessageLogger ( DeployersLogger . class , AbstractDataSourceService . AS7DataSourceDeployer . class . getName ( ) ) ; private final InjectedValue < TransactionIntegration > transactionIntegrationValue = new InjectedValue < TransactionIntegration > ( ) ; private final InjectedValue < Driver > driverValue = new InjectedValue < Driver > ( ) ; private final InjectedValue < ManagementRepository > managementRepositoryValue = new InjectedValue < ManagementRepository > ( ) ; private final InjectedValue < SubjectFactory > subjectFactory = new InjectedValue < SubjectFactory > ( ) ; private final InjectedValue < DriverRegistry > driverRegistry = new InjectedValue < DriverRegistry > ( ) ; private final String jndiName ; private DataSource sqlDataSource ; protected AbstractDataSourceService ( final String jndiName ) { } public synchronized void start ( StartContext startContext ) throws StartException { } protected abstract AbstractDataSourceService . AS7DataSourceDeployer getDeployer ( ) { } public synchronized void stop ( StopContext stopContext ) { } public synchronized DataSource getValue ( ) throws IllegalArgumentException , IllegalStateException { } public Injector < TransactionIntegration > getTransactionIntegrationInjector ( ) { } public Injector < Driver > getDriverInjector ( ) { } public Injector < ManagementRepository > getmanagementRepositoryInjector ( ) { } public Injector < DriverRegistry > getDriverRegistryInjector ( ) { } public Injector < SubjectFactory > getSubjectFactoryInjector ( ) { } protected String buildConfigPropsString ( Map < String , String > configProps ) { } protected TransactionIntegration getTransactionIntegration ( ) { } private static final AbstractDataSourceService . SetContextLoaderAction CLEAR_ACTION = new AbstractDataSourceService . SetContextLoaderAction ( null ) ; private static class SetContextLoaderAction implements PrivilegedAction < Void > { private final ClassLoader classLoader ; public SetContextLoaderAction ( final ClassLoader classLoader ) { } public Void run ( ) { } } protected class AS7DataSourceDeployer extends AbstractDsDeployer { private final DataSource dataSourceConfig ; private final XaDataSource xaDataSourceConfig ; private ServiceContainer serviceContainer ; public AS7DataSourceDeployer ( XaDataSource xaDataSourceConfig ) { } public AS7DataSourceDeployer ( org . jboss . jca . common . api . metadata . ds . DataSource dataSourceConfig ) { } public CommonDeployment deploy ( ServiceContainer serviceContainer ) throws DeployException { } @ Override protected ClassLoader getDeploymentClassLoader ( String uniqueId ) { } @ Override protected String [ ] bindConnectionFactory ( String deployment , final String jndi , Object cf ) throws Throwable { } @ Override protected Object initAndInject ( String className , List < ? extends ConfigProperty > configs , ClassLoader cl ) throws DeployException { } @ Override protected SubjectFactory getSubjectFactory ( String securityDomain ) throws DeployException { } @ Override public ManagementRepository getManagementRepository ( ) { } @ Override protected void initAndInjectClassLoaderPlugin ( ManagedConnectionFactory mcf , CommonDataSource dsMetadata ) throws DeployException { } @ Override public TransactionIntegration getTransactionIntegration ( ) { } @ Override protected ManagedConnectionFactory createMcf ( XaDataSource arg0 , String arg1 , ClassLoader arg2 ) throws NotFoundException , DeployException { } @ Override protected ManagedConnectionFactory createMcf ( org . jboss . jca . common . api . metadata . ds . DataSource arg0 , String arg1 , ClassLoader arg2 ) throws NotFoundException , DeployException { } private void setMcfProperties ( final BaseWrapperManagedConnectionFactory managedConnectionFactory , CommonDataSource dataSourceConfig , final Statement statement ) { } @ Override protected String buildJndiName ( String rawJndiName , Boolean javaContext ) { final String jndiName ; <START_BUG> if ( ! ( rawJndiName . startsWith ( "java:" ) ) ) { <END_BUG> if ( rawJndiName . startsWith ( "jboss//" ) ) { jndiName = "java:" + rawJndiName ; } else { jndiName = "java://" + rawJndiName ; } } else { jndiName = rawJndiName ; } return jndiName ; } @ Override protected DeployersLogger getLogger ( ) { } } private class MyXaMCF extends XAManagedConnectionFactory { private static final long serialVersionUID = 4876371551002746953L ; public void setXaProps ( Map < String , String > inputProperties ) { } } }

Fix:
if ( ( ! ( rawJndiName . startsWith ( "java:" ) ) ) && javaContext ) {