Buggy code:
@ Activate ( group = { Constants . CONSUMER } ) public class RemoteFacadeCircuitBreaker implements Filter { private static final Logger logger = LoggerFactory . getLogger ( RemoteFacadeCircuitBreaker . class ) ; private volatile ConcurrentHashMap < String , BreakCounter > breakCounterMap = new ConcurrentHashMap < String , BreakCounter > ( ) ; private BreakCounterLoop [ ] breakCounterLoops = new BreakCounterLoop [ Runtime . getRuntime ( ) . availableProcessors ( ) ] ; private static final ProxyFactory proxyFactory = ExtensionLoader . getExtensionLoader ( ProxyFactory . class ) . getAdaptiveExtension ( ) ; private static final ConcurrentHashMap < String , Invoker > CIRCUIT_BREAKER_INVOKER_CACHE = new ConcurrentHashMap < String , Invoker > ( ) ; private volatile AtomicLong loopCount = new AtomicLong ( 0 ) ; public RemoteFacadeCircuitBreaker ( ) { } private BreakCounterLoop nextLoop ( ) { } public Result invoke ( Invoker < ? > invoker , Invocation invocation ) throws RpcException { } private Result wrapBreakerInvoke ( Invoker < ? > invoker , Invocation invocation ) throws RpcException { } private void toBeNormal ( Invoker < ? > invoker , Invocation invocation ) { } private boolean checkNeedCircuitBreak ( Invoker < ? > invoker , Invocation invocation ) { } private boolean needRetry ( Invoker < ? > invoker , Invocation invocation , long currentBreakCount ) { } private < T extends Object > Result doCircuitBreak ( Invoker < ? > invoker , Invocation invocation ) throws RpcException { String interfaceName = invoker . getUrl ( ) . getParameter ( INTERFACE_KEY ) ; String circuitBreaker = interfaceName + "CircuitBreak" ; incrementBreakCount ( invoker , invocation ) ; try { if ( RemoteFacadeCircuitBreaker . logger . isDebugEnabled ( ) ) { RemoteFacadeCircuitBreaker . logger . debug ( ( ( "check<seq2seq4repair_space>has<seq2seq4repair_space>class<seq2seq4repair_space>" + circuitBreaker ) + "<seq2seq4repair_space>to<seq2seq4repair_space>handle<seq2seq4repair_space>circuit<seq2seq4repair_space>break" ) ) ; } Invoker < ? > breakerInvoker = null ; <START_BUG> if ( RemoteFacadeCircuitBreaker . CIRCUIT_BREAKER_INVOKER_CACHE . contains ( circuitBreaker ) ) { <END_BUG> breakerInvoker = RemoteFacadeCircuitBreaker . CIRCUIT_BREAKER_INVOKER_CACHE . get ( circuitBreaker ) ; } else { Class < T > breakerType = ( ( Class < T > ) ( Class . forName ( circuitBreaker ) ) ) ; Class < T > interfaceType = ( ( Class < T > ) ( Class . forName ( interfaceName ) ) ) ; if ( interfaceType . isAssignableFrom ( breakerType ) ) { if ( RemoteFacadeCircuitBreaker . logger . isDebugEnabled ( ) ) { RemoteFacadeCircuitBreaker . logger . debug ( ( "handle<seq2seq4repair_space>circuit<seq2seq4repair_space>break<seq2seq4repair_space>by<seq2seq4repair_space>class<seq2seq4repair_space>" + circuitBreaker ) ) ; } T breaker = breakerType . newInstance ( ) ; breakerInvoker = RemoteFacadeCircuitBreaker . proxyFactory . getInvoker ( breaker , interfaceType , invoker . getUrl ( ) ) ; Invoker < ? > oldInvoker = RemoteFacadeCircuitBreaker . CIRCUIT_BREAKER_INVOKER_CACHE . putIfAbsent ( circuitBreaker , breakerInvoker ) ; if ( oldInvoker != null ) { breakerInvoker = oldInvoker ; } } } if ( breakerInvoker != null ) { return breakerInvoker . invoke ( invocation ) ; } } catch ( Exception e ) { RemoteFacadeCircuitBreaker . logger . error ( "failed<seq2seq4repair_space>to<seq2seq4repair_space>invoke<seq2seq4repair_space>circuit<seq2seq4repair_space>breaker" , e ) ; } if ( RemoteFacadeCircuitBreaker . logger . isDebugEnabled ( ) ) { RemoteFacadeCircuitBreaker . logger . debug ( "handle<seq2seq4repair_space>circuit<seq2seq4repair_space>break<seq2seq4repair_space>by<seq2seq4repair_space>exception" ) ; } CricuitBreakerException baseBusinessException = new CricuitBreakerException ( Config . DEFAULT_CIRCUIT_BREAKER_ERROR_CODE , "哎哟，系统异常，请稍后再试" ) ; RpcException rpcException = new RpcException ( RpcException . BIZ_EXCEPTION , baseBusinessException ) ; throw rpcException ; } private void incrementBreakCount ( Invoker < ? > invoker , Invocation invocation ) { } private void caughtException ( Invoker < ? > invoker , Invocation invocation , Exception e ) { } }

Fix:
if ( RemoteFacadeCircuitBreaker . CIRCUIT_BREAKER_INVOKER_CACHE . containsKey ( circuitBreaker ) ) {