Program: 14165
Project: 14165
Buggy source:
@Override public ChannelPipeline getPipeline() throws Exception {
  final ChannelHandler limitSockets=new SimpleChannelHandler(){
    private final String uuid=UUID.randomUUID().toString();
    @Override public void writeRequested(    ChannelHandlerContext ctx,    MessageEvent e) throws Exception {
      try {
        final MappingHttpRequest message=((MappingHttpRequest)e.getMessage());
        final String logMessage=message.getMessage() != null ? message.getMessage().getClass().toString().replaceAll("String_Node_Str","String_Node_Str") : message.toString();
        LOG.debug(Joiner.on("String_Node_Str").join(uuid,"String_Node_Str",ctx.getChannel(),"String_Node_Str",logMessage));
      }
 catch (      Exception e1) {
        LOG.debug(e1);
      }
      super.writeRequested(ctx,e);
    }
    /** 
 * @see org.jboss.netty.channel.ChannelEvent()
 */
    @Override public void connectRequested(    final ChannelHandlerContext ctx,    ChannelStateEvent e) throws Exception {
      try {
        final InetSocketAddress remoteAddress=((InetSocketAddress)e.getValue());
        final Semaphore sem=counters.getUnchecked(remoteAddress.getAddress());
        final int semAvailable=sem.availablePermits();
        final int semQueued=sem.getQueueLength();
        final long start=System.nanoTime();
        sem.acquire();
        final long waitTime=System.nanoTime();
        e.getChannel().getCloseFuture().addListener(new ChannelFutureListener(){
          @Override public void operationComplete(          ChannelFuture future) throws Exception {
            try {
              final long end=System.nanoTime();
              LOG.trace(Joiner.on("String_Node_Str").join(uuid,remoteAddress,String.format("String_Node_Str",semAvailable,CLUSTER_CLIENT_PERMITS,semQueued),String.format("String_Node_Str",TimeUnit.NANOSECONDS.toMillis(waitTime - start),TimeUnit.NANOSECONDS.toMillis(end - waitTime),TimeUnit.NANOSECONDS.toMillis(end - start))));
            }
 catch (            Exception e1) {
              LOG.trace(e1);
            }
 finally {
              sem.release();
            }
          }
        }
);
      }
 catch (      Exception e1) {
        LOG.trace(e1);
      }
      super.connectRequested(ctx,e);
    }
  }
;
  final ChannelPipeline pipeline=Channels.pipeline();
  for (  final Map.Entry<String,ChannelHandler> e : Handlers.channelMonitors(TimeUnit.SECONDS,StackConfiguration.CLIENT_INTERNAL_TIMEOUT_SECS).entrySet()) {
    pipeline.addLast(e.getKey(),e.getValue());
  }
  pipeline.addLast("String_Node_Str",Handlers.newHttpResponseDecoder());
  pipeline.addLast("String_Node_Str",Handlers.newHttpChunkAggregator());
  pipeline.addLast("String_Node_Str",Handlers.httpRequestEncoder());
  pipeline.addLast("String_Node_Str",Handlers.soapMarshalling());
  pipeline.addLast("String_Node_Str",wsSecHandler.get());
  pipeline.addLast("String_Node_Str",Handlers.newAddressingHandler("String_Node_Str"));
  pipeline.addLast("String_Node_Str",Handlers.soapHandler());
  pipeline.addLast("String_Node_Str",Handlers.bindingHandler("String_Node_Str"));
  pipeline.addLast("String_Node_Str",limitSockets);
  return pipeline;
}

Fixed version (ground truth):
@Override public ChannelPipeline getPipeline() throws Exception {
  final ChannelHandler limitSockets=new SimpleChannelHandler(){
    private final String uuid=UUID.randomUUID().toString();
    @Override public void writeRequested(    ChannelHandlerContext ctx,    MessageEvent e) throws Exception {
      try {
        final MappingHttpRequest message=((MappingHttpRequest)e.getMessage());
        final String logMessage=message.getMessage() != null ? message.getMessage().getClass().toString().replaceAll("String_Node_Str","String_Node_Str") : message.toString();
        LOG.debug(Joiner.on("String_Node_Str").join(uuid,"String_Node_Str",ctx.getChannel(),"String_Node_Str",logMessage));
      }
 catch (      Exception e1) {
        LOG.debug(e1);
      }
      super.writeRequested(ctx,e);
    }
    /** 
 * @see org.jboss.netty.channel.ChannelEvent()
 */
    @Override public void connectRequested(    final ChannelHandlerContext ctx,    ChannelStateEvent e) throws Exception {
      try {
        final InetSocketAddress remoteAddress=((InetSocketAddress)e.getValue());
        final Semaphore sem=counters.getUnchecked(remoteAddress.getAddress());
        final int semAvailable=sem.availablePermits();
        final int semQueued=sem.getQueueLength();
        final long start=System.nanoTime();
        sem.acquire();
        final long waitTime=System.nanoTime();
        e.getChannel().getCloseFuture().addListener(new ChannelFutureListener(){
          @Override public void operationComplete(          ChannelFuture future) throws Exception {
            try {
              final long end=System.nanoTime();
              LOG.trace(Joiner.on("String_Node_Str").join(uuid,remoteAddress,String.format("String_Node_Str",semAvailable,CLUSTER_CLIENT_PERMITS.get(),semQueued),String.format("String_Node_Str",TimeUnit.NANOSECONDS.toMillis(waitTime - start),TimeUnit.NANOSECONDS.toMillis(end - waitTime),TimeUnit.NANOSECONDS.toMillis(end - start))));
            }
 catch (            Exception e1) {
              LOG.trace(e1);
            }
 finally {
              sem.release();
            }
          }
        }
);
      }
 catch (      Exception e1) {
        LOG.trace(e1);
      }
      super.connectRequested(ctx,e);
    }
  }
;
  final ChannelPipeline pipeline=Channels.pipeline();
  for (  final Map.Entry<String,ChannelHandler> e : Handlers.channelMonitors(TimeUnit.SECONDS,StackConfiguration.CLIENT_INTERNAL_TIMEOUT_SECS).entrySet()) {
    pipeline.addLast(e.getKey(),e.getValue());
  }
  pipeline.addLast("String_Node_Str",Handlers.newHttpResponseDecoder());
  pipeline.addLast("String_Node_Str",Handlers.newHttpChunkAggregator());
  pipeline.addLast("String_Node_Str",Handlers.httpRequestEncoder());
  pipeline.addLast("String_Node_Str",Handlers.soapMarshalling());
  pipeline.addLast("String_Node_Str",wsSecHandler.get());
  pipeline.addLast("String_Node_Str",Handlers.newAddressingHandler("String_Node_Str"));
  pipeline.addLast("String_Node_Str",Handlers.soapHandler());
  pipeline.addLast("String_Node_Str",Handlers.bindingHandler("String_Node_Str"));
  pipeline.addLast("String_Node_Str",limitSockets);
  return pipeline;
}