Source:
<code>private EmbeddedCacheManager startCacheManager( EmbeddedCacheManager cacheMgr, String configFile, Boolean isCluster ) { new MarshallableTypeHints().getBufferSizePredictor( CacheHandle.class ); File confDir = indyConfiguration.getIndyConfDir(); File ispnConf = new File( confDir, configFile ); EmbeddedCacheManager mgr = cacheMgr; try(InputStream resouceStream = Thread.currentThread().getContextClassLoader().getResourceAsStream( configFile )) { String resourceStr = interpolateStrFromStream( resouceStream, "CLASSPATH:" + configFile ); if ( ispnConf.exists() ) { try (InputStream confStream = FileUtils.openInputStream( ispnConf )) { String confStr = interpolateStrFromStream( confStream, ispnConf.getPath() ); mgr = mergedCachesFromConfig( mgr, confStr, "CUSTOMER" ); mgr = mergedCachesFromConfig( mgr, resourceStr, "CLASSPATH" ); } catch ( IOException e ) { throw new RuntimeException( "Cannot read infinispan configuration from file: " + ispnConf, e ); } } else { try { logger.info( "Using CLASSPATH resource Infinispan configuration:\n\n{}\n\n", resourceStr ); <START> mgr = new DefaultCacheManager( <END> new ByteArrayInputStream( resourceStr.getBytes( StandardCharsets.UTF_8 ) ) ); if ( isCluster ) { mgr.startCaches( String.join( ",", clusterCacheManager.getCacheNames()) ); } } catch ( IOException e ) { throw new RuntimeException( "Failed to construct ISPN cacheManger due to CLASSPATH xml stream read error.", e ); } } } catch ( IOException e ) { throw new RuntimeException( "Failed to construct ISPN cacheManger due to CLASSPATH xml stream read error.", e ); } return mgr; }</code><technical_language>This discard pre-existing CacheManager instance passed in...is intention here</technical_language>

Target:
private EmbeddedCacheManager startCacheManager( EmbeddedCacheManager cacheMgr, String configFile, Boolean isCluster ) { new MarshallableTypeHints().getBufferSizePredictor( CacheHandle.class ); File confDir = indyConfiguration.getIndyConfDir(); File ispnConf = new File( confDir, configFile ); EmbeddedCacheManager mgr = cacheMgr; try(InputStream resouceStream = Thread.currentThread().getContextClassLoader().getResourceAsStream( configFile )) { String resourceStr = interpolateStrFromStream( resouceStream, "CLASSPATH:" + configFile ); if ( ispnConf.exists() ) { try (InputStream confStream = FileUtils.openInputStream( ispnConf )) { String confStr = interpolateStrFromStream( confStream, ispnConf.getPath() ); mgr = mergedCachesFromConfig( mgr, confStr, "CUSTOMER" ); mgr = mergedCachesFromConfig( mgr, resourceStr, "CLASSPATH" ); } catch ( IOException e ) { throw new RuntimeException( "Cannot read infinispan configuration from file: " + ispnConf, e ); } } else { try { logger.info( "Using CLASSPATH resource Infinispan configuration:\n\n{}\n\n", resourceStr ); if ( mgr == null ) { mgr = new DefaultCacheManager( new ByteArrayInputStream( resourceStr.getBytes( StandardCharsets.UTF_8 ) ) ); } if ( isCluster ) { mgr.startCaches( String.join( ",", clusterCacheManager.getCacheNames() ) ); } } catch ( IOException e ) { throw new RuntimeException( "Failed to construct ISPN cacheManger due to CLASSPATH xml stream read error.", e ); } } } catch ( IOException e ) { throw new RuntimeException( "Failed to construct ISPN cacheManger due to CLASSPATH xml stream read error.", e ); } return mgr; }