nus-yam/ex-repair huggingface dataset:
Program: 96606
Project: 96606
Buggy source:
@Override public WsrSession call(){
  IoBufferAllocatorEx<?> parentAllocator=session.getBufferAllocator();
  WsrBufferAllocator wsrAllocator=new WsrBufferAllocator(parentAllocator);
  ResultAwareLoginContext loginContext=(ResultAwareLoginContext)session.getAttribute(HttpLoginSecurityFilter.LOGIN_CONTEXT_KEY);
  WsrSession wsrSession=new WsrSession(session.getIoLayer(),session.getIoThread(),session.getIoExecutor(),WsrAcceptor.this,getProcessor(),localAddress,remoteAddress,wsrAllocator,loginContext.getLoginResult(),wsExtensions0);
  wsrSession.setBridgeServiceFactory(bridgeServiceFactory);
  wsrSession.setResourceAddressFactory(resourceAddressFactory);
  wsrSession.setScheduler(scheduler);
  IoHandler handler=getHandler(localAddress);
  wsrSession.setHandler(handler);
  wsrSession.suspendWrite();
  return wsrSession;
}

Fixed version (ground truth):
@Override public WsrSession call(){
  IoBufferAllocatorEx<?> parentAllocator=session.getBufferAllocator();
  WsrBufferAllocator wsrAllocator=new WsrBufferAllocator(parentAllocator);
  ResultAwareLoginContext loginContext=(ResultAwareLoginContext)session.getAttribute(HttpLoginSecurityFilter.LOGIN_CONTEXT_KEY);
  WsrSession wsrSession=new WsrSession(session.getIoLayer(),session.getIoThread(),session.getIoExecutor(),WsrAcceptor.this,getProcessor(),localAddress,remoteAddress,wsrAllocator,loginContext.getLoginResult());
  wsrSession.setBridgeServiceFactory(bridgeServiceFactory);
  wsrSession.setResourceAddressFactory(resourceAddressFactory);
  wsrSession.setScheduler(scheduler);
  IoHandler handler=getHandler(localAddress);
  wsrSession.setHandler(handler);
  wsrSession.suspendWrite();
  return wsrSession;
}
Program: 96607
Project: 96607
Buggy source:
private void doHandleConnect(final IoSessionEx session,RtmpConnectCommandMessage request) throws Exception {
  RtmpConnectResponseCommandMessage response=new RtmpConnectResponseCommandMessage();
  response.setTransactionId(request.getTransactionId());
  response.setChunkStreamId(COMMAND_STREAM_ID);
  URI rtmpAddress=new URI(request.getTcUrl());
  WsrSession wsrSession=sessionMap.get(rtmpAddress);
  wsrSession.setParent(session);
  SESSION_KEY.set(session,wsrSession);
  final ActiveExtensions extensions=ActiveExtensions.get(wsrSession);
  codec.setExtensions(session,extensions);
  if (session.getAttribute(HttpAcceptor.SERVICE_REGISTRATION_KEY) == null) {
    session.setAttribute(HttpAcceptor.SERVICE_REGISTRATION_KEY,wsrSession.getAttribute(HttpAcceptor.SERVICE_REGISTRATION_KEY));
  }
  wsrSession.startupSessionTimeoutCommand();
  RtmpConnectResponseCommandMessage result=new RtmpConnectResponseCommandMessage();
  result.setTransactionId(request.getTransactionId());
  result.setMessageStreamId(request.getMessageStreamId());
  ScheduledFuture<?> timeoutFuture=(ScheduledFuture<?>)wsrSession.removeAttribute(TIMEOUT_FUTURE_KEY);
  if (timeoutFuture != null && !timeoutFuture.isDone()) {
    timeoutFuture.cancel(false);
  }
  wsrSession.clearTimeoutCommand();
  session.write(response);
}

Fixed version (ground truth):
private void doHandleConnect(final IoSessionEx session,RtmpConnectCommandMessage request) throws Exception {
  RtmpConnectResponseCommandMessage response=new RtmpConnectResponseCommandMessage();
  response.setTransactionId(request.getTransactionId());
  response.setChunkStreamId(COMMAND_STREAM_ID);
  URI rtmpAddress=new URI(request.getTcUrl());
  WsrSession wsrSession=sessionMap.get(rtmpAddress);
  wsrSession.setParent(session);
  SESSION_KEY.set(session,wsrSession);
  if (session.getAttribute(HttpAcceptor.SERVICE_REGISTRATION_KEY) == null) {
    session.setAttribute(HttpAcceptor.SERVICE_REGISTRATION_KEY,wsrSession.getAttribute(HttpAcceptor.SERVICE_REGISTRATION_KEY));
  }
  wsrSession.startupSessionTimeoutCommand();
  RtmpConnectResponseCommandMessage result=new RtmpConnectResponseCommandMessage();
  result.setTransactionId(request.getTransactionId());
  result.setMessageStreamId(request.getMessageStreamId());
  ScheduledFuture<?> timeoutFuture=(ScheduledFuture<?>)wsrSession.removeAttribute(TIMEOUT_FUTURE_KEY);
  if (timeoutFuture != null && !timeoutFuture.isDone()) {
    timeoutFuture.cancel(false);
  }
  wsrSession.clearTimeoutCommand();
  session.write(response);
}
Program: 96608
Project: 96608
Buggy source:
@Override public WsrSession call() throws Exception {
  IoBufferAllocatorEx<?> parentAllocator=session.getBufferAllocator();
  WsrBufferAllocator wsrAllocator=new WsrBufferAllocator(parentAllocator);
  WsrSession wsrSession=new WsrSession(WsrConnector.this,getProcessor(),connectAddress,connectAddress,session,wsrAllocator,null,null);
  wsrSession.setRtmpAddress(rtmpAddress);
  wsrSession.suspendWrite();
  return wsrSession;
}

Fixed version (ground truth):
@Override public WsrSession call() throws Exception {
  IoBufferAllocatorEx<?> parentAllocator=session.getBufferAllocator();
  WsrBufferAllocator wsrAllocator=new WsrBufferAllocator(parentAllocator);
  WsrSession wsrSession=new WsrSession(WsrConnector.this,getProcessor(),connectAddress,connectAddress,session,wsrAllocator,null);
  wsrSession.setRtmpAddress(rtmpAddress);
  wsrSession.suspendWrite();
  return wsrSession;
}
Program: 96609
Project: 96609
Buggy source:
public void addBridgeFilters(org.apache.mina.core.filterchain.IoFilterChain filterChain){
  if (logger.isTraceEnabled()) {
    filterChain.addFirst(TRACE_LOGGING_FILTER,new ObjectLoggingFilter(logger,WsrProtocol.NAME + "String_Node_Str"));
  }
 else   if (logger.isDebugEnabled()) {
    filterChain.addFirst(FAULT_LOGGING_FILTER,new ExceptionLoggingFilter(logger,WsrProtocol.NAME + "String_Node_Str"));
  }
  filterChain.addLast("String_Node_Str",codec);
  filterChain.addLast("String_Node_Str",new LoggingFilter("String_Node_Str"));
}

Fixed version (ground truth):
@Override public void addBridgeFilters(org.apache.mina.core.filterchain.IoFilterChain filterChain){
  if (logger.isTraceEnabled()) {
    filterChain.addFirst(TRACE_LOGGING_FILTER,new ObjectLoggingFilter(logger,WsrProtocol.NAME + "String_Node_Str"));
  }
 else   if (logger.isDebugEnabled()) {
    filterChain.addFirst(FAULT_LOGGING_FILTER,new ExceptionLoggingFilter(logger,WsrProtocol.NAME + "String_Node_Str"));
  }
  filterChain.addLast("String_Node_Str",codec);
  filterChain.addLast("String_Node_Str",new LoggingFilter("String_Node_Str"));
}
Program: 96610
Project: 96610
Buggy source:
@Override public void operationComplete(ConnectFuture future){
  ConnectRequest<?> connectRequest=CONNECT_REQUEST_KEY.remove(createSession);
  try {
    final ResourceAddress connectAddress=connectRequest.connectAddress;
    final IoSessionEx session=(IoSessionEx)future.getSession();
    Callable<WsrSession> bridgeSessionFactory=new Callable<WsrSession>(){
      @Override public WsrSession call() throws Exception {
        IoBufferAllocatorEx<?> parentAllocator=session.getBufferAllocator();
        WsrBufferAllocator wsrAllocator=new WsrBufferAllocator(parentAllocator);
        WsrSession wsrSession=new WsrSession(WsrConnector.this,getProcessor(),connectAddress,connectAddress,session,wsrAllocator,null,null);
        wsrSession.setRtmpAddress(rtmpAddress);
        wsrSession.suspendWrite();
        return wsrSession;
      }
    }
;
    WsrSession wsrSession=newSession(connectRequest.initializer,connectRequest.connectFuture,bridgeSessionFactory);
    session.setAttribute(WSR_SESSION_KEY,wsrSession);
  }
 catch (  Exception e) {
    connectRequest.connectFuture.setException(e);
  }
}

Fixed version (ground truth):
@Override public void operationComplete(ConnectFuture future){
  ConnectRequest<?> connectRequest=CONNECT_REQUEST_KEY.remove(createSession);
  try {
    final ResourceAddress connectAddress=connectRequest.connectAddress;
    final IoSessionEx session=(IoSessionEx)future.getSession();
    Callable<WsrSession> bridgeSessionFactory=new Callable<WsrSession>(){
      @Override public WsrSession call() throws Exception {
        IoBufferAllocatorEx<?> parentAllocator=session.getBufferAllocator();
        WsrBufferAllocator wsrAllocator=new WsrBufferAllocator(parentAllocator);
        WsrSession wsrSession=new WsrSession(WsrConnector.this,getProcessor(),connectAddress,connectAddress,session,wsrAllocator,null);
        wsrSession.setRtmpAddress(rtmpAddress);
        wsrSession.suspendWrite();
        return wsrSession;
      }
    }
;
    WsrSession wsrSession=newSession(connectRequest.initializer,connectRequest.connectFuture,bridgeSessionFactory);
    session.setAttribute(WSR_SESSION_KEY,wsrSession);
  }
 catch (  Exception e) {
    connectRequest.connectFuture.setException(e);
  }
}
Program: 96611
Project: 96611
Buggy source:
public WsrSession(int ioLayer,Thread parentIoThread,Executor parentIoExecutor,IoServiceEx service,IoProcessorEx<WsrSession> processor,ResourceAddress localAddress,ResourceAddress remoteAddress,IoBufferAllocatorEx<WsrBuffer> allocator,DefaultLoginResult loginResult,ActiveExtensions wsExtensions){
  super(ioLayer,parentIoThread,parentIoExecutor,service,processor,localAddress,remoteAddress,allocator,Direction.BOTH,loginResult,wsExtensions);
}

Fixed version (ground truth):
public WsrSession(int ioLayer,Thread parentIoThread,Executor parentIoExecutor,IoServiceEx service,IoProcessorEx<WsrSession> processor,ResourceAddress localAddress,ResourceAddress remoteAddress,IoBufferAllocatorEx<WsrBuffer> allocator,DefaultLoginResult loginResult){
  super(ioLayer,parentIoThread,parentIoExecutor,service,processor,localAddress,remoteAddress,allocator,Direction.BOTH,loginResult);
}
Program: 96612
Project: 96612
Buggy source:
public ProtocolDecoder getDecoder(IoSession session){
  return new RtmpChunkDecoder();
}

Fixed version (ground truth):
@Override public ProtocolDecoder getDecoder(IoSession session){
  return new RtmpChunkDecoder();
}
Program: 96613
Project: 96613
Buggy source:
public ProtocolEncoder getEncoder(IoSession session){
  IoSessionEx sessionEx=(IoSessionEx)session;
  IoBufferAllocatorEx<?> allocator=sessionEx.getBufferAllocator();
  if (session instanceof BridgeSession) {
    BridgeSession bridgeSession=(BridgeSession)session;
    return new RtmpEncoder(bridgeSession.getMessageEncoder(),allocator);
  }
  return new RtmpEncoder(allocator);
}

Fixed version (ground truth):
@Override public ProtocolEncoder getEncoder(IoSession session){
  IoSessionEx sessionEx=(IoSessionEx)session;
  IoBufferAllocatorEx<?> allocator=sessionEx.getBufferAllocator();
  if (session instanceof BridgeSession) {
    BridgeSession bridgeSession=(BridgeSession)session;
    return new RtmpEncoder(bridgeSession.getMessageEncoder(),allocator);
  }
  return new RtmpEncoder(allocator);
}
Program: 96614
Project: 96614
Buggy source:
private void doEncodeData(IoSession session,RtmpDataMessage message,ProtocolEncoderOutput out){
switch (message.getDataKind()) {
case BINARY:
{
      RtmpBinaryDataMessage binaryMessage=(RtmpBinaryDataMessage)message;
      IoBufferEx buf=binaryMessage.getBytes();
      byte[] escapeBytes=null;
      boolean escaping=false;
      if (escapeSequencer != null) {
        escapeBytes=escapeSequencer.getEscapeBytes(buf);
        escaping=escapeBytes.length > 0;
      }
      if (escaping) {
        out.write(RtmpEncodingSupport.doBinaryEscapedEncode(allocator,buf,message,maximumChunkSize,escapeBytes));
      }
 else {
        out.write(RtmpEncodingSupport.doBinaryEncode(allocator,buf,message,maximumChunkSize));
      }
      break;
    }
case SAMPLE_ACCESS:
{
    IoBufferEx buf=allocator.wrap(allocator.allocate(100));
    Amf0Utils.encodeBoolean(buf,false);
    Amf0Utils.encodeBoolean(buf,false);
    buf.flip();
    out.write(doEncodeChunk0(DOWNSTREAM_CHUNKSTREAM_ID,buf,message));
    break;
  }
}
}

Fixed version (ground truth):
private void doEncodeData(IoSession session,RtmpDataMessage message,ProtocolEncoderOutput out){
switch (message.getDataKind()) {
case BINARY:
{
      RtmpBinaryDataMessage binaryMessage=(RtmpBinaryDataMessage)message;
      IoBufferEx buf=binaryMessage.getBytes();
      out.write(RtmpEncodingSupport.doBinaryEncode(allocator,buf,message,maximumChunkSize));
      break;
    }
case SAMPLE_ACCESS:
{
    IoBufferEx buf=allocator.wrap(allocator.allocate(100));
    Amf0Utils.encodeBoolean(buf,false);
    Amf0Utils.encodeBoolean(buf,false);
    buf.flip();
    out.write(doEncodeChunk0(DOWNSTREAM_CHUNKSTREAM_ID,buf,message));
    break;
  }
}
}
Program: 96615
Project: 96615
Buggy source:
@Override protected Object doFilterWriteWsText(NextFilter nextFilter,IoSession session,WriteRequest writeRequest,WsTextMessage wsText) throws Exception {
  IoBufferEx buf=wsText.getBytes();
  if (buf.remaining() < CONTROL_BYTES.length) {
    return wsText;
  }
  byte[] leadingBytes=new byte[CONTROL_BYTES.length];
  int pos=buf.position();
  buf.get(leadingBytes);
  buf.position(pos);
  if (Arrays.equals(CONTROL_BYTES,leadingBytes)) {
    nextFilter.filterWrite(session,new DefaultWriteRequestEx(escapeFrame));
  }
  return wsText;
}

Fixed version (ground truth):
@Override protected Object doFilterWriteWsText(NextFilter nextFilter,IoSession session,WriteRequest writeRequest,WsTextMessage wsText) throws Exception {
  IoBufferEx buf=wsText.getBytes();
  if (buf.remaining() < CONTROL_BYTES.length) {
    return wsText;
  }
  int pos=buf.position();
  for (int i=0; i < CONTROL_BYTES.length; i++) {
    if (buf.get(pos + i) != CONTROL_BYTES[i]) {
      return wsText;
    }
  }
  nextFilter.filterWrite(session,new DefaultWriteRequestEx(escapeMessage));
  return wsText;
}
Program: 96616
Project: 96616
Buggy source:
@Override public void onPreAdd(IoFilterChain parent,String name,NextFilter nextFilter) throws Exception {
  IoSessionEx sessionEx=(IoSessionEx)parent.getSession();
  IoBufferAllocatorEx<?> allocator=sessionEx.getBufferAllocator();
  emulatedPing=createTextMessage(allocator,EMULATED_PING_FRAME_PAYLOAD);
  emulatedPong=createTextMessage(allocator,EMULATED_PONG_FRAME_PAYLOAD);
  escapeFrame=createTextMessage(allocator,CONTROL_BYTES);
}

Fixed version (ground truth):
@Override public void onPreAdd(IoFilterChain parent,String name,NextFilter nextFilter) throws Exception {
  IoSessionEx sessionEx=(IoSessionEx)parent.getSession();
  IoBufferAllocatorEx<?> allocator=sessionEx.getBufferAllocator();
  emulatedPing=createTextMessage(allocator,EMULATED_PING_FRAME_PAYLOAD);
  emulatedPong=createTextMessage(allocator,EMULATED_PONG_FRAME_PAYLOAD);
  escapeMessage=createTextMessage(allocator,CONTROL_BYTES);
}
Program: 96617
Project: 96617
Buggy source:
@Override protected void wsTextReceived(NextFilter nextFilter,IoSession session,WsTextMessage wsText) throws Exception {
  IoBufferEx buf=wsText.getBytes();
  if (buf.remaining() >= CONTROL_BYTES.length) {
  }
  super.messageReceived(nextFilter,session,wsText);
}

Fixed version (ground truth):
@Override protected void wsTextReceived(NextFilter nextFilter,IoSession session,WsTextMessage wsText) throws Exception {
  IoBufferEx buf=wsText.getBytes();
  boolean skip=false;
  if (buf.remaining() == CONTROL_BYTES.length) {
    skip=true;
    int pos=buf.position();
    for (int i=0; i < CONTROL_BYTES.length; i++) {
      if (buf.get(pos + i) != CONTROL_BYTES[i]) {
        skip=false;
        break;
      }
    }
  }
  if (!skip) {
    super.wsTextReceived(nextFilter,session,wsText);
  }
}
Program: 96619
Project: 96619
Buggy source:
@Specification("String_Node_Str") @Test(timeout=15000) public void testEchoInactiveTimeoutShouldCloseConnection() throws Exception {
  robot.finish();
}

Fixed version (ground truth):
@Specification("String_Node_Str") @Test(timeout=15000) public void testEchoInactiveTimeoutShouldCloseConnection() throws Exception {
  k3po.finish();
}
Program: 96620
Project: 96620
Buggy source:
@Specification("String_Node_Str") @Test(timeout=15000) public void testEchoInactiveTimeoutShouldNotPingOldClient() throws Exception {
  robot.finish();
}

Fixed version (ground truth):
@Specification("String_Node_Str") @Test(timeout=15000) public void testEchoInactiveTimeoutShouldNotPingOldClient() throws Exception {
  k3po.finish();
}
Program: 96621
Project: 96621
Buggy source:
/** 
 * Method instantiating a monitoring entity factory builder and building an actual monitoring entity factory based on the AGRONA_ENABLED parameter The monitoring entity factory builder is initialized here and not in the constructor in order to have the configuration Properties object injected
 */
private void buildMonitoringEntityFactory(){
  MonitoringEntityFactoryBuilder factoryBuilder;
  if (InternalSystemProperty.AGRONA_ENABLED.getBooleanProperty(configuration)) {
    factoryBuilder=new AgronaMonitoringEntityFactoryBuilder();
  }
 else {
    factoryBuilder=new DefaultMonitoringEntityFactoryBuilderStub();
  }
  monitoringEntityFactory=factoryBuilder.build();
}

Fixed version (ground truth):
/** 
 * Method instantiating a monitoring entity factory builder and building an actual monitoring entity factory The monitoring entity factory builder is initialized here and not in the constructor in order to have the configuration Properties object injected
 */
private void buildMonitoringEntityFactory(){
  MonitoringEntityFactoryInjector monitoringEntityFactoryInjector=new MonitoringEntityFactoryInjectorImpl(configuration);
  monitoringEntityFactory=monitoringEntityFactoryInjector.makeMonitoringEntityFactory();
}
Program: 96622
Project: 96622
Buggy source:
@Override public LongMonitoringCounter incrementByValue(long value){
  return null;
}

Fixed version (ground truth):
@Override public LongMonitoringCounter incrementByValue(long value){
  return this;
}
Program: 96623
Project: 96623
Buggy source:
@Override public LongMonitoringCounter decrement(){
  return null;
}

Fixed version (ground truth):
@Override public LongMonitoringCounter decrement(){
  return this;
}
Program: 96624
Project: 96624
Buggy source:
@Override public LongMonitoringCounter setValue(long value){
  return null;
}

Fixed version (ground truth):
@Override public LongMonitoringCounter setValue(long value){
  return this;
}
Program: 96625
Project: 96625
Buggy source:
@Override public LongMonitoringCounter increment(){
  return null;
}

Fixed version (ground truth):
@Override public LongMonitoringCounter increment(){
  return this;
}
Program: 96626
Project: 96626
Buggy source:
@Override public LongMonitoringCounter reset(){
  return null;
}

Fixed version (ground truth):
@Override public LongMonitoringCounter reset(){
  return this;
}
Program: 96627
Project: 96627
Buggy source:
@Override public LongMonitoringCounter decrementByValue(long value){
  return null;
}

Fixed version (ground truth):
@Override public LongMonitoringCounter decrementByValue(long value){
  return this;
}
Program: 96628
Project: 96628
Buggy source:
@Override public ManagementFilter getManagementFilter(ServiceContext serviceContext){
  ManagementFilter managementFilter=managementFilters.get(serviceContext);
  if (managementFilter == null) {
    ServiceManagementBean serviceBean=serviceManagementBeans.get(serviceContext);
    buildMonitoringEntityFactory();
    managementFilter=addManagementFilter(serviceContext,serviceBean);
  }
  return managementFilter;
}

Fixed version (ground truth):
@Override public ManagementFilter getManagementFilter(ServiceContext serviceContext){
  ManagementFilter managementFilter=managementFilters.get(serviceContext);
  if (managementFilter == null) {
    ServiceManagementBean serviceBean=serviceManagementBeans.get(serviceContext);
    managementFilter=addManagementFilter(serviceContext,serviceBean);
  }
  return managementFilter;
}
Program: 96629
Project: 96629
Buggy source:
@Resource(name="String_Node_Str") public void setConfiguration(Properties configuration){
  this.configuration=configuration;
}

Fixed version (ground truth):
@Resource(name="String_Node_Str") public void setConfiguration(Properties configuration){
  this.configuration=configuration;
  buildMonitoringEntityFactory();
}
Program: 96630
Project: 96630
Buggy source:
@Override protected void removeInternal(SslSession session){
  try {
    IoSession parent=session.getParent();
    IoFilterChain filterChain=parent.getFilterChain();
    Entry entry=filterChain.getEntry(SslFilter.class);
    if (entry != null) {
      SslFilter sslFilter=(SslFilter)entry.getFilter();
      if (parent.getWrittenBytes() > 0L && sslFilter.isSslStarted(parent)) {
        sslFilter.stopSsl(parent);
        return;
      }
    }
  }
 catch (  SSLException e) {
    logger.debug("String_Node_Str",e);
  }
  super.removeInternal(session);
}

Fixed version (ground truth):
@Override protected void removeInternal(SslSession session){
  super.removeInternal(session);
}
Program: 96631
Project: 96631
Buggy source:
@Override protected void doSessionClosed(IoSessionEx session) throws Exception {
  SslSession sslSession=(SslSession)session.removeAttribute(SESSION_KEY);
  if (sslSession != null && !sslSession.isClosing()) {
    sslSession.reset(new Exception("String_Node_Str").fillInStackTrace());
  }
}

Fixed version (ground truth):
@Override protected void doSessionClosed(IoSessionEx session) throws Exception {
  SslSession sslSession=(SslSession)session.removeAttribute(SESSION_KEY);
  if (sslSession != null) {
    if (!sslSession.isClosing()) {
      sslSession.reset(new Exception("String_Node_Str").fillInStackTrace());
    }
 else {
      sslSession.getProcessor().remove(sslSession);
    }
  }
}
Program: 96632
Project: 96632
Buggy source:
@Override protected void doMessageReceived(final IoSessionEx session,Object message) throws Exception {
  if (message == SslFilter.SESSION_SECURED) {
    IoFilterChain filterChain=session.getFilterChain();
    removeFilter(filterChain,certificateSelection);
    IoSession sslSession=(IoSession)session.getAttribute(SESSION_KEY);
    assert(sslSession == null);
    IoSession newSslSession=createSslSession(session);
    session.setAttribute(SESSION_KEY,newSslSession);
  }
 else   if (message == SslFilter.SESSION_UNSECURED) {
    session.close(false);
  }
 else {
    IoSession sslSession=(IoSession)session.getAttribute(SESSION_KEY);
    assert(sslSession != null);
    IoFilterChain filterChain=sslSession.getFilterChain();
    filterChain.fireMessageReceived(message);
  }
}

Fixed version (ground truth):
@Override protected void doMessageReceived(final IoSessionEx session,Object message) throws Exception {
  if (message == SslFilter.SESSION_SECURED) {
    IoFilterChain filterChain=session.getFilterChain();
    removeFilter(filterChain,certificateSelection);
    IoSession sslSession=(IoSession)session.getAttribute(SESSION_KEY);
    assert(sslSession == null);
    IoSession newSslSession=createSslSession(session);
    session.setAttribute(SESSION_KEY,newSslSession);
  }
 else   if (message == SslFilter.SESSION_UNSECURED) {
    SslSession sslSession=(SslSession)session.removeAttribute(SESSION_KEY);
    if (sslSession != null && !sslSession.isClosing()) {
      sslSession.getProcessor().remove(sslSession);
    }
  }
 else {
    IoSession sslSession=(IoSession)session.getAttribute(SESSION_KEY);
    assert(sslSession != null);
    IoFilterChain filterChain=sslSession.getFilterChain();
    filterChain.fireMessageReceived(message);
  }
}
Program: 96633
Project: 96633
Buggy source:
@Test public void testNoJMXBindingNameConflictsOnMultiServicesUsingSameAccept() throws Exception {
  boolean correctPath=false;
  GatewayConfigurationBuilder configBuilder=new GatewayConfigurationBuilder();
  GatewayConfiguration gatewayConfiguration=configBuilder.service().accept(FRONTEND_URI_1).connect(BACKEND_URI_1).type(PROXY).done().service().name("String_Node_Str").accept(FRONTEND_URI_1).connect(BACKEND_URI_2).type(PROXY).done().done();
  Gateway gateway=new Gateway();
  try {
    gateway.start(gatewayConfiguration);
  }
 catch (  Exception e) {
    System.out.println(e.getMessage());
    Assert.assertTrue("String_Node_Str" + e.getMessage(),e.getMessage().contains("String_Node_Str"));
    correctPath=true;
  }
 finally {
    gateway.stop();
  }
  Assert.assertTrue("String_Node_Str",correctPath);
}

Fixed version (ground truth):
@Test public void testNoJMXBindingNameConflictsOnMultiServicesUsingSameAccept() throws Exception {
  boolean correctPath=false;
  GatewayConfigurationBuilder configBuilder=new GatewayConfigurationBuilder();
  GatewayConfiguration gatewayConfiguration=configBuilder.service().accept(FRONTEND_URI_1).connect(BACKEND_URI_1).type(PROXY).done().service().name("String_Node_Str").accept(FRONTEND_URI_1).connect(BACKEND_URI_2).type(PROXY).done().done();
  Gateway gateway=new Gateway();
  try {
    gateway.start(gatewayConfiguration);
  }
 catch (  Exception e) {
    e.printStackTrace(System.out);
    System.out.println(e.getMessage());
    String message=e.getMessage();
    Assert.assertTrue("String_Node_Str" + message,(message != null && message.contains("String_Node_Str")));
    correctPath=true;
  }
 finally {
    gateway.stop();
  }
  Assert.assertTrue("String_Node_Str",correctPath);
}
Program: 96635
Project: 96635
Buggy source:
public T getItem(int position){
  if (position >= dataList.size()) {
    if (bottomReachedCallback != null) {
      bottomReachedCallback.bottomReached();
    }
  }
  return dataList.get(position);
}

Fixed version (ground truth):
public T getItem(int position){
  if (position >= dataList.size()) {
    if (bottomReachedCallback != null) {
      bottomReachedCallback.bottomReached();
    }
  }
  if (position < 0 || position >= dataList.size())   return null;
  return dataList.get(position);
}
Program: 96636
Project: 96636
Buggy source:
public KeyFile fromXml(byte[] inputBytes){
  try {
    ByteArrayInputStream inputStream=new ByteArrayInputStream(inputBytes);
    return parser.fromXml(inputStream,KeyFile.class);
  }
 catch (  DataBindingException e) {
    return new KeyFile(false);
  }
}

Fixed version (ground truth):
public KeyFile fromXml(byte[] inputBytes){
  try {
    ByteArrayInputStream inputStream=new ByteArrayInputStream(inputBytes);
    return parser.fromXml(inputStream,KeyFile.class);
  }
 catch (  KeePassDatabaseUnreadableException e) {
    return new KeyFile(false);
  }
}
Program: 96637
Project: 96637
Buggy source:
private byte[] marshallXml(KeePassFile keePassFile,KeePassHeader header){
  ProtectedStringCrypto protectedStringCrypto=Salsa20.createInstance(header.getProtectedStreamKey());
  new ProtectedValueProcessor().processProtectedValues(new EncryptionStrategy(protectedStringCrypto),keePassFile);
  return new KeePassDatabaseXmlParser().toXml(keePassFile).toByteArray();
}

Fixed version (ground truth):
private byte[] marshallXml(KeePassFile keePassFile,KeePassHeader header){
  KeePassFile clonedKeePassFile=new GroupZipper(keePassFile).cloneKeePassFile();
  ProtectedStringCrypto protectedStringCrypto=Salsa20.createInstance(header.getProtectedStreamKey());
  new ProtectedValueProcessor().processProtectedValues(new EncryptionStrategy(protectedStringCrypto),clonedKeePassFile);
  return new KeePassDatabaseXmlParser().toXml(keePassFile).toByteArray();
}
Program: 96638
Project: 96638
Buggy source:
@Override public Group next(){
  if (canDown()) {
    return down().getNode();
  }
  if (canRight()) {
    return right().getNode();
  }
  return getNextRightNode(parent);
}

Fixed version (ground truth):
@Override public Group next(){
  if (isFirst) {
    isFirst=false;
    return getNode();
  }
  if (canDown()) {
    return down().getNode();
  }
  if (canRight()) {
    return right().getNode();
  }
  return getNextRightNode(parent);
}
Program: 96639
Project: 96639
Buggy source:
/** 
 * Replaces the current node with the given one. <p> Can be used to modify the tree.
 * @param group the replacement node
 * @return
 */
public GroupZipper replace(Group group){
  parent.getNode().getGroups().set(index,group);
  return this;
}

Fixed version (ground truth):
/** 
 * Replaces the current node with the given one. <p> Can be used to modify the tree.
 * @param group the replacement node
 * @return
 */
public GroupZipper replace(Group group){
  if (parent == null) {
    node=group;
  }
 else {
    parent.getNode().getGroups().set(index,group);
  }
  return this;
}
Program: 96640
Project: 96640
Buggy source:
@Override public boolean hasNext(){
  if (canDown() || canRight()) {
    return true;
  }
  return canGoRightAtAnyLevel(parent);
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  if (isFirst) {
    return true;
  }
  if (canDown() || canRight()) {
    return true;
  }
  return canGoRightAtAnyLevel(parent);
}
Program: 96641
Project: 96641
Buggy source:
private Group getNextRightNode(GroupZipper parent){
  if (parent == null) {
    return null;
  }
  if (parent.canRight()) {
    return parent.right().getNode();
  }
 else {
    return getNextRightNode(parent);
  }
}

Fixed version (ground truth):
private Group getNextRightNode(GroupZipper parent){
  if (parent == null) {
    return null;
  }
  if (parent.canRight()) {
    return up().right().getNode();
  }
 else {
    return getNextRightNode(up());
  }
}
Program: 96642
Project: 96642
Buggy source:
/** 
 * Navigates up the tree to the parent node of the current node. <p> If the current node has no parent an exception will be thrown.
 * @return
 * @throws RuntimeException if the current node has no parent node
 */
public GroupZipper up(){
  if (!canUp()) {
    throw new RuntimeException("String_Node_Str");
  }
  return parent;
}

Fixed version (ground truth):
/** 
 * Navigates up the tree to the parent node of the current node. <p> If the current node has no parent an exception will be thrown.
 * @return
 * @throws RuntimeException if the current node has no parent node
 */
public GroupZipper up(){
  if (!canUp()) {
    throw new RuntimeException("String_Node_Str");
  }
  this.index=parent.index;
  this.node=parent.node;
  this.parent=parent.parent;
  return this;
}
Program: 96643
Project: 96643
Buggy source:
@Test public void shouldIterateThroughAllGroups(){
  KeePassFile keePassFile=createTreeStructure();
  GroupZipper zipper=new GroupZipper(keePassFile);
  Iterator<Group> iter=zipper.iterator();
  List<Group> visitedGroups=new ArrayList<Group>();
  while (iter.hasNext()) {
    Group group=iter.next();
    visitedGroups.add(group);
  }
  Assert.assertEquals(5,visitedGroups.size());
}

Fixed version (ground truth):
@Test public void shouldIterateThroughAllGroups(){
  KeePassFile keePassFile=createTreeStructure();
  GroupZipper zipper=new GroupZipper(keePassFile);
  Iterator<Group> iter=zipper.iterator();
  List<Group> visitedGroups=new ArrayList<Group>();
  while (iter.hasNext()) {
    Group group=iter.next();
    visitedGroups.add(group);
  }
  Assert.assertEquals(6,visitedGroups.size());
}
Program: 96644
Project: 96644
Buggy source:
public int getHeaderSize(){
  int size=0;
  for (int i=2; i < 11; i++) {
    byte[] value=getValue(i);
    size+=value.length + SIZE_OF_FIELD_LENGTH_BUFFER;
  }
  size+=getEndOfHeader().length;
  return size;
}

Fixed version (ground truth):
public int getHeaderSize(){
  int size=0;
  for (int i=2; i < 11; i++) {
    byte[] value=getValue(i);
    if (value != null) {
      size+=value.length + SIZE_OF_FIELD_LENGTH_BUFFER;
    }
  }
  size+=getEndOfHeader().length;
  return size;
}
Program: 96645
Project: 96645
Buggy source:
public String encrypt(String plainString){
  if (plainString == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    byte[] plainStringBytes=plainString.getBytes(ENCODING);
    byte[] encodedText=new byte[plainStringBytes.length];
    salsa20Engine.processBytes(plainStringBytes,0,plainStringBytes.length,encodedText,0);
    byte[] protectedBuffer=Base64.encode(encodedText);
    return new String(protectedBuffer,ENCODING);
  }
 catch (  UnsupportedEncodingException e) {
    throw new UnsupportedOperationException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public String encrypt(String plainString){
  if (plainString == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  try {
    byte[] plainStringBytes=plainString.getBytes(ENCODING);
    byte[] encodedText=new byte[plainStringBytes.length];
    salsa20Engine.update(plainStringBytes,0,plainStringBytes.length,encodedText,0);
    byte[] protectedBuffer=Base64.encode(encodedText);
    return new String(protectedBuffer,ENCODING);
  }
 catch (  UnsupportedEncodingException e) {
    throw new UnsupportedOperationException("String_Node_Str",e);
  }
catch (  ShortBufferException e) {
    throw new RuntimeException(e);
  }
}
Program: 96646
Project: 96646
Buggy source:
private Salsa20(){
}

Fixed version (ground truth):
private Salsa20(){
  Security.addProvider(new BouncyCastleProvider());
}
Program: 96647
Project: 96647
Buggy source:
private void initialize(byte[] protectedStreamKey){
  byte[] salsaKey=Sha256.hash(protectedStreamKey);
  salsa20Engine=new Salsa20Engine();
  salsa20Engine.init(true,new ParametersWithIV(new KeyParameter(salsaKey),Hex.decode(SALSA20IV)));
}

Fixed version (ground truth):
private void initialize(byte[] protectedStreamKey){
  byte[] salsaKey=Sha256.hash(protectedStreamKey);
  try {
    salsa20Engine=Cipher.getInstance(SALSA20,BouncyCastleProvider.PROVIDER_NAME);
    salsa20Engine.init(Cipher.ENCRYPT_MODE,new SecretKeySpec(salsaKey,SALSA20),new IvParameterSpec(Hex.decode(SALSA20IV)));
  }
 catch (  Exception e) {
    throw new RuntimeException("String_Node_Str" + SALSA20 + "String_Node_Str",e);
  }
}
Program: 96648
Project: 96648
Buggy source:
public String decrypt(String protectedString){
  if (protectedString == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  byte[] protectedBuffer=Base64.decode(protectedString.getBytes());
  byte[] plainText=new byte[protectedBuffer.length];
  salsa20Engine.processBytes(protectedBuffer,0,protectedBuffer.length,plainText,0);
  try {
    return new String(plainText,ENCODING);
  }
 catch (  UnsupportedEncodingException e) {
    throw new UnsupportedOperationException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public String decrypt(String protectedString){
  if (protectedString == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  byte[] protectedBuffer=Base64.decode(protectedString.getBytes());
  byte[] plainText=new byte[protectedBuffer.length];
  try {
    salsa20Engine.update(protectedBuffer,0,protectedBuffer.length,plainText,0);
    return new String(plainText,ENCODING);
  }
 catch (  ShortBufferException e) {
    throw new RuntimeException(e);
  }
catch (  UnsupportedEncodingException e) {
    throw new UnsupportedOperationException("String_Node_Str",e);
  }
}
Program: 96649
Project: 96649
Buggy source:
private void decryptAndSetValues(Entry entry,ProtectedStringCrypto protectedStringCrypto){
  List<Property> properties=entry.getProperties();
  for (  Property property : properties) {
    PropertyValue propertyValue=property.getPropertyValue();
    if (propertyValue.isProtected()) {
      String decrypted=protectedStringCrypto.decrypt(propertyValue.getValue());
      propertyValue.setValue(decrypted);
    }
  }
}

Fixed version (ground truth):
private void decryptAndSetValues(Entry entry,ProtectedStringCrypto protectedStringCrypto){
  List<Property> properties=entry.getProperties();
  for (  Property property : properties) {
    PropertyValue propertyValue=property.getPropertyValue();
    if (!propertyValue.getValue().isEmpty() && propertyValue.isProtected()) {
      String decrypted=protectedStringCrypto.decrypt(propertyValue.getValue());
      propertyValue.setValue(decrypted);
    }
  }
}
Program: 96650
Project: 96650
Buggy source:
public Set<Property> getProperties(){
  return properties;
}

Fixed version (ground truth):
public List<Property> getProperties(){
  return properties;
}
Program: 96651
Project: 96651
Buggy source:
public void setProperties(Set<Property> properties){
  this.properties=properties;
}

Fixed version (ground truth):
public void setProperties(List<Property> properties){
  this.properties=properties;
}
Program: 96652
Project: 96652
Buggy source:
public KeePassFile parse(InputStream inputStream,ProtectedStringCrypto protectedStringCrypto){
  KeePassFile keePassFile=JAXB.unmarshal(inputStream,KeePassFile.class);
  keePassFile.init();
  List<Entry> entries=keePassFile.getEntries();
  for (  Entry entry : entries) {
    decryptAndSetPassword(entry,protectedStringCrypto);
    History history=entry.getHistory();
    for (    Entry historicEntry : history.getHistoricEntries()) {
      decryptAndSetPassword(historicEntry,protectedStringCrypto);
    }
  }
  return keePassFile;
}

Fixed version (ground truth):
public KeePassFile parse(InputStream inputStream,ProtectedStringCrypto protectedStringCrypto){
  KeePassFile keePassFile=JAXB.unmarshal(inputStream,KeePassFile.class);
  keePassFile.init();
  List<Entry> entries=keePassFile.getEntries();
  for (  Entry entry : entries) {
    decryptAndSetValues(entry,protectedStringCrypto);
    History history=entry.getHistory();
    for (    Entry historicEntry : history.getHistoricEntries()) {
      decryptAndSetValues(historicEntry,protectedStringCrypto);
    }
  }
  return keePassFile;
}
Program: 96653
Project: 96653
Buggy source:
private Entry createEntry(String uuid,String title,String password){
  Entry entry=new Entry(uuid);
  Set<Property> properties=new HashSet<Property>();
  properties.add(new Property("String_Node_Str",title,false));
  properties.add(new Property("String_Node_Str",password,false));
  entry.setProperties(properties);
  return entry;
}

Fixed version (ground truth):
private Entry createEntry(String uuid,String title,String password){
  Entry entry=new Entry(uuid);
  List<Property> properties=new ArrayList<Property>();
  properties.add(new Property("String_Node_Str",title,false));
  properties.add(new Property("String_Node_Str",password,false));
  entry.setProperties(properties);
  return entry;
}
Program: 96654
Project: 96654
Buggy source:
private void decryptAndSetPassword(Entry entry,ProtectedStringCrypto protectedStringCrypto){
  if (entry.isPasswordProtected()) {
    String decrypted=protectedStringCrypto.decrypt(entry.getPassword());
    entry.setPassword(decrypted);
  }
}

Fixed version (ground truth):
private void decryptAndSetPassword(Entry entry,ProtectedStringCrypto protectedStringCrypto){
  if (entry != null && !entry.getPassword().isEmpty() && entry.isPasswordProtected()) {
    String decrypted=protectedStringCrypto.decrypt(entry.getPassword());
    entry.setPassword(decrypted);
  }
}
Program: 96655
Project: 96655
Buggy source:
public KeePassFile parse(InputStream inputStream,ProtectedStringCrypto protectedStringCrypto){
  KeePassFile keePassFile=JAXB.unmarshal(inputStream,KeePassFile.class);
  keePassFile.init();
  List<Entry> entries=keePassFile.getEntries();
  for (  Entry entry : entries) {
    if (entry.isPasswordProtected()) {
      String decrypted=protectedStringCrypto.decrypt(entry.getPassword());
      entry.setPassword(decrypted);
    }
  }
  return keePassFile;
}

Fixed version (ground truth):
public KeePassFile parse(InputStream inputStream,ProtectedStringCrypto protectedStringCrypto){
  KeePassFile keePassFile=JAXB.unmarshal(inputStream,KeePassFile.class);
  keePassFile.init();
  List<Entry> entries=keePassFile.getEntries();
  for (  Entry entry : entries) {
    decryptAndSetPassword(entry,protectedStringCrypto);
    History history=entry.getHistory();
    for (    Entry historicEntry : history.getHistoricEntries()) {
      decryptAndSetPassword(historicEntry,protectedStringCrypto);
    }
  }
  return keePassFile;
}
Program: 96656
Project: 96656
Buggy source:
private Function<Tag.Link,String> renderLinkToHtml(ClassTypeInfo type){
  return link -> {
    ClassTypeInfo rawType=link.getTargetType().getRaw();
    if (rawType.getModule() != null) {
      String label=link.getLabel().trim();
      if (rawType.getKind() == DATA_OBJECT) {
        return "String_Node_Str" + rawType.getName() + "String_Node_Str";
      }
 else {
        if (type.getKind() == ClassKind.API) {
          Element elt=link.getTargetElement();
          String eltKind=elt.getKind().name();
          String ret="String_Node_Str" + rawType.translateName(id);
          if ("String_Node_Str".equals(eltKind)) {
            ret+="String_Node_Str" + elt.getSimpleName().toString();
          }
          if (label.length() > 0) {
            ret+="String_Node_Str" + label;
          }
          ret+="String_Node_Str";
          return ret;
        }
      }
    }
    return "String_Node_Str" + rawType.getName() + "String_Node_Str";
  }
;
}

Fixed version (ground truth):
private String renderLinkToHtml(Tag.Link link){
  ClassTypeInfo rawType=link.getTargetType().getRaw();
  if (rawType.getModule() != null) {
    String label=link.getLabel().trim();
    if (rawType.getKind() == DATA_OBJECT) {
      return "String_Node_Str" + rawType.getName() + "String_Node_Str";
    }
 else {
      if (rawType.getKind() == ClassKind.API) {
        Element elt=link.getTargetElement();
        String eltKind=elt.getKind().name();
        String ret="String_Node_Str" + rawType.translateName(id);
        if ("String_Node_Str".equals(eltKind)) {
          ret+="String_Node_Str" + elt.getSimpleName().toString();
        }
        if (label.length() > 0) {
          ret+="String_Node_Str" + label;
        }
        ret+="String_Node_Str";
        return ret;
      }
    }
  }
  return "String_Node_Str" + rawType.getName() + "String_Node_Str";
}
Program: 96657
Project: 96657
Buggy source:
private void generateDoc(ClassModel model,PrintWriter writer){
  ClassTypeInfo type=model.getType();
  Doc doc=model.getDoc();
  if (doc != null) {
    writer.println("String_Node_Str");
    Token.toHtml(doc.getTokens(),"String_Node_Str",this.renderLinkToHtml(type),"String_Node_Str",writer);
    writer.println("String_Node_Str");
    writer.println("String_Node_Str");
    writer.print("String_Node_Str");
    writer.print(type.getName());
    writer.println("String_Node_Str");
    writer.println("String_Node_Str");
  }
}

Fixed version (ground truth):
private void generateDoc(ClassModel model,PrintWriter writer){
  ClassTypeInfo type=model.getType();
  Doc doc=model.getDoc();
  if (doc != null) {
    writer.println("String_Node_Str");
    Token.toHtml(doc.getTokens(),"String_Node_Str",this::renderLinkToHtml,"String_Node_Str",writer);
    writer.println("String_Node_Str");
    writer.println("String_Node_Str");
    writer.print("String_Node_Str");
    writer.print(type.getName());
    writer.println("String_Node_Str");
    writer.println("String_Node_Str");
  }
}
Program: 96659
Project: 96659
Buggy source:
@Override protected void subscribeActual(CompletableObserver observer){
  AtomicBoolean disposed=new AtomicBoolean();
  observer.onSubscribe(new Disposable(){
    @Override public void dispose(){
      disposed.set(true);
    }
    @Override public boolean isDisposed(){
      return disposed.get();
    }
  }
);
  if (!disposed.get()) {
    method.handle(ar -> {
      if (!disposed.getAndSet(false)) {
        if (ar.succeeded()) {
          try {
            observer.onComplete();
          }
 catch (          Throwable ignore) {
          }
        }
 else {
          try {
            observer.onError(ar.cause());
          }
 catch (          Throwable ignore) {
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void subscribeActual(CompletableObserver observer){
  AtomicBoolean disposed=new AtomicBoolean();
  observer.onSubscribe(new Disposable(){
    @Override public void dispose(){
      disposed.set(true);
    }
    @Override public boolean isDisposed(){
      return disposed.get();
    }
  }
);
  if (!disposed.get()) {
    method.handle(ar -> {
      if (!disposed.getAndSet(true)) {
        if (ar.succeeded()) {
          try {
            observer.onComplete();
          }
 catch (          Throwable ignore) {
          }
        }
 else {
          try {
            observer.onError(ar.cause());
          }
 catch (          Throwable ignore) {
          }
        }
      }
    }
);
  }
}
Program: 96660
Project: 96660
Buggy source:
@Override protected void subscribeActual(MaybeObserver<? super T> observer){
  AtomicBoolean disposed=new AtomicBoolean();
  observer.onSubscribe(new Disposable(){
    @Override public void dispose(){
      disposed.set(true);
    }
    @Override public boolean isDisposed(){
      return disposed.get();
    }
  }
);
  if (!disposed.get()) {
    method.handle(ar -> {
      if (!disposed.getAndSet(false)) {
        if (ar.succeeded()) {
          try {
            T val=ar.result();
            if (val != null) {
              observer.onSuccess(val);
            }
 else {
              observer.onComplete();
            }
          }
 catch (          Throwable ignore) {
          }
        }
 else         if (ar.failed()) {
          try {
            observer.onError(ar.cause());
          }
 catch (          Throwable ignore) {
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void subscribeActual(MaybeObserver<? super T> observer){
  AtomicBoolean disposed=new AtomicBoolean();
  observer.onSubscribe(new Disposable(){
    @Override public void dispose(){
      disposed.set(true);
    }
    @Override public boolean isDisposed(){
      return disposed.get();
    }
  }
);
  if (!disposed.get()) {
    method.handle(ar -> {
      if (!disposed.getAndSet(true)) {
        if (ar.succeeded()) {
          try {
            T val=ar.result();
            if (val != null) {
              observer.onSuccess(val);
            }
 else {
              observer.onComplete();
            }
          }
 catch (          Throwable ignore) {
          }
        }
 else         if (ar.failed()) {
          try {
            observer.onError(ar.cause());
          }
 catch (          Throwable ignore) {
          }
        }
      }
    }
);
  }
}
Program: 96661
Project: 96661
Buggy source:
@Override protected void subscribeActual(@NonNull SingleObserver<? super T> observer){
  AtomicBoolean disposed=new AtomicBoolean();
  observer.onSubscribe(new Disposable(){
    @Override public void dispose(){
      disposed.set(true);
    }
    @Override public boolean isDisposed(){
      return disposed.get();
    }
  }
);
  if (!disposed.get()) {
    method.handle(ar -> {
      if (!disposed.getAndSet(false)) {
        if (ar.succeeded()) {
          try {
            observer.onSuccess(ar.result());
          }
 catch (          Throwable ignore) {
          }
        }
 else         if (ar.failed()) {
          try {
            observer.onError(ar.cause());
          }
 catch (          Throwable ignore) {
          }
        }
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void subscribeActual(@NonNull SingleObserver<? super T> observer){
  AtomicBoolean disposed=new AtomicBoolean();
  observer.onSubscribe(new Disposable(){
    @Override public void dispose(){
      disposed.set(true);
    }
    @Override public boolean isDisposed(){
      return disposed.get();
    }
  }
);
  if (!disposed.get()) {
    method.handle(ar -> {
      if (!disposed.getAndSet(true)) {
        if (ar.succeeded()) {
          try {
            observer.onSuccess(ar.result());
          }
 catch (          Throwable ignore) {
          }
        }
 else         if (ar.failed()) {
          try {
            observer.onError(ar.cause());
          }
 catch (          Throwable ignore) {
          }
        }
      }
    }
);
  }
}
Program: 96662
Project: 96662
Buggy source:
public static <T>TypeArg<T> unknown(){
  return new TypeArg<>(obj -> (T)obj,obj -> obj);
}

Fixed version (ground truth):
public static <T>TypeArg<T> unknown(){
  return (TypeArg<T>)UNKNOWN;
}
Program: 96663
Project: 96663
Buggy source:
public Object unwrap(T o){
  return o != null ? unwrap.apply(o) : null;
}

Fixed version (ground truth):
public <X>X unwrap(T o){
  return o != null ? (X)unwrap.apply(o) : null;
}
Program: 96664
Project: 96664
Buggy source:
/** 
 * Create a scheduler for a   {@link Context}, actions are executed on the event loop of this context.
 * @param context the context object
 * @return the scheduler
 */
public static Scheduler scheduler(Context context){
  return new ContextScheduler(context.delegate,false);
}

Fixed version (ground truth):
/** 
 * Create a scheduler for a   {@link Context}, actions are executed on the event loop of this context.
 * @param context the context object
 * @return the scheduler
 */
public static Scheduler scheduler(Context context){
  return new ContextScheduler(context.getDelegate(),false);
}