nus-yam/ex-repair huggingface dataset:
Program: 94176
Project: 94176
Buggy source:
/** 
 * @param chunkPackageTimeout
 */
public RpcDataPackageDecoder(final int chunkPackageTimeout){
  super();
  if (chunkPackageTimeout <= 0) {
    return;
  }
  es=Executors.newSingleThreadExecutor();
  es.execute(new Runnable(){
    public void run(){
      while (!stopChunkPackageTimeoutClean) {
        if (!tempTrunkPackages.isEmpty()) {
          Map<Long,RpcDataPackage> currentCheckPackage;
          currentCheckPackage=new HashMap<Long,RpcDataPackage>(tempTrunkPackages);
          Iterator<Entry<Long,RpcDataPackage>> iter=currentCheckPackage.entrySet().iterator();
          while (iter.hasNext()) {
            Entry<Long,RpcDataPackage> entry=iter.next();
            if (entry.getValue().getTimeStamp() + chunkPackageTimeout > System.currentTimeMillis()) {
              tempTrunkPackages.remove(entry.getValue());
              LOG.log(Level.SEVERE,"String_Node_Str" + chunkPackageTimeout + "String_Node_Str"+ entry.getValue().getRpcMeta().getCorrelationId());
            }
          }
        }
        try {
          Thread.sleep(DEFAULT_CLEANUP_INTERVAL);
        }
 catch (        Exception e) {
          LOG.log(Level.SEVERE,e.getMessage(),e);
        }
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param chunkPackageTimeout
 */
public RpcDataPackageDecoder(final int chunkPackageTimeout){
  super();
  if (chunkPackageTimeout <= 0) {
    return;
  }
  es=Executors.newSingleThreadExecutor();
  es.execute(new Runnable(){
    public void run(){
      while (!stopChunkPackageTimeoutClean) {
        if (!tempTrunkPackages.isEmpty()) {
          Map<Long,RpcDataPackage> currentCheckPackage;
          currentCheckPackage=new HashMap<Long,RpcDataPackage>(tempTrunkPackages);
          Iterator<Entry<Long,RpcDataPackage>> iter=currentCheckPackage.entrySet().iterator();
          while (iter.hasNext()) {
            Entry<Long,RpcDataPackage> entry=iter.next();
            if (entry.getValue().getTimeStamp() > System.currentTimeMillis() + chunkPackageTimeout) {
              tempTrunkPackages.remove(entry.getKey());
              LOG.log(Level.SEVERE,"String_Node_Str" + chunkPackageTimeout + "String_Node_Str"+ entry.getValue().getRpcMeta().getCorrelationId());
            }
          }
        }
        try {
          Thread.sleep(DEFAULT_CLEANUP_INTERVAL);
        }
 catch (        Exception e) {
          LOG.log(Level.SEVERE,e.getMessage(),e);
        }
      }
    }
  }
);
}
Program: 94177
Project: 94177
Buggy source:
@Override protected Object encode(ChannelHandlerContext ctx,Channel channel,Object msg) throws Exception {
  if (!(msg instanceof RpcDataPackage)) {
    return msg;
  }
  RpcDataPackage dataPackage=(RpcDataPackage)msg;
  byte[] encodeBytes=dataPackage.write();
  if (encodeBytes != null) {
    LOG.log(Level.FINE,"String_Node_Str" + encodeBytes.length);
  }
  ChannelBuffer encodedMessage=ChannelBuffers.copiedBuffer(ctx.getChannel().getConfig().getBufferFactory().getDefaultOrder(),encodeBytes);
  if (chunkSize < 0) {
    return encodedMessage;
  }
  List<RpcDataPackage> list=dataPackage.chunk(chunkSize);
  LOG.log(Level.SEVERE,"String_Node_Str" + dataPackage.getRpcMeta().getCorrelationId() + "String_Node_Str"+ list.size()+ "String_Node_Str");
  for (  RpcDataPackage rpcDataPackage : list) {
    encodeBytes=rpcDataPackage.write();
    encodedMessage=ChannelBuffers.copiedBuffer(ctx.getChannel().getConfig().getBufferFactory().getDefaultOrder(),encodeBytes);
    write(channel,encodedMessage);
  }
  return null;
}

Fixed version (ground truth):
@Override protected Object encode(ChannelHandlerContext ctx,Channel channel,Object msg) throws Exception {
  if (!(msg instanceof RpcDataPackage)) {
    return msg;
  }
  RpcDataPackage dataPackage=(RpcDataPackage)msg;
  byte[] encodeBytes=dataPackage.write();
  if (encodeBytes != null) {
    LOG.log(Level.FINE,"String_Node_Str" + encodeBytes.length);
  }
  ChannelBuffer encodedMessage=ChannelBuffers.copiedBuffer(ctx.getChannel().getConfig().getBufferFactory().getDefaultOrder(),encodeBytes);
  if (chunkSize < 0) {
    return encodedMessage;
  }
  List<RpcDataPackage> list=dataPackage.chunk(chunkSize);
  LOG.log(Level.FINE,"String_Node_Str" + dataPackage.getRpcMeta().getCorrelationId() + "String_Node_Str"+ list.size()+ "String_Node_Str"+ chunkSize+ "String_Node_Str");
  for (  RpcDataPackage rpcDataPackage : list) {
    encodeBytes=rpcDataPackage.write();
    encodedMessage=ChannelBuffers.copiedBuffer(ctx.getChannel().getConfig().getBufferFactory().getDefaultOrder(),encodeBytes);
    write(channel,encodedMessage);
  }
  return null;
}
Program: 94178
Project: 94178
Buggy source:
@Test public void testGetRpcMethodMeta(){
  RpcClient rpcClient=new RpcClient();
  ProtobufRpcProxy<RpcServiceMetaService> pbrpcProxy=new ProtobufRpcProxy<RpcServiceMetaService>(rpcClient,RpcServiceMetaService.class);
  pbrpcProxy.setPort(PORT);
  RpcServiceMetaService proxy=pbrpcProxy.proxy();
  RpcServiceMetaList rpcServiceMetaInfo=proxy.getRpcServiceMetaInfo();
  Assert.assertEquals(4,rpcServiceMetaInfo.getRpcServiceMetas().size());
  List<RpcServiceMeta> rpcServiceMetas=rpcServiceMetaInfo.getRpcServiceMetas();
  for (  RpcServiceMeta rpcServiceMeta : rpcServiceMetas) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + rpcServiceMeta.getServiceName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getMethodName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getInputProto());
    System.out.println("String_Node_Str" + rpcServiceMeta.getOutputProto());
  }
}

Fixed version (ground truth):
@Test public void testGetRpcMethodMeta(){
  RpcClient rpcClient=new RpcClient();
  ProtobufRpcProxy<RpcServiceMetaService> pbrpcProxy=new ProtobufRpcProxy<RpcServiceMetaService>(rpcClient,RpcServiceMetaService.class);
  pbrpcProxy.setPort(PORT);
  RpcServiceMetaService proxy=pbrpcProxy.proxy();
  RpcServiceMetaList rpcServiceMetaInfo=proxy.getRpcServiceMetaInfo();
  Assert.assertEquals(5,rpcServiceMetaInfo.getRpcServiceMetas().size());
  List<RpcServiceMeta> rpcServiceMetas=rpcServiceMetaInfo.getRpcServiceMetas();
  for (  RpcServiceMeta rpcServiceMeta : rpcServiceMetas) {
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str" + rpcServiceMeta.getServiceName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getMethodName());
    System.out.println("String_Node_Str" + rpcServiceMeta.getInputProto());
    System.out.println("String_Node_Str" + rpcServiceMeta.getOutputProto());
  }
}
Program: 94179
Project: 94179
Buggy source:
/** 
 * @param method
 * @param protobufPRC
 */
public PojoRpcMethodInfo(Method method,ProtobufPRC protobufPRC){
  super(method,protobufPRC);
  Class<? extends Object> inputClass=getInputClass();
  if (inputClass != null) {
    inputCodec=ProtobufProxy.create(inputClass);
  }
  Class<? extends Object> outputClass=getOutputClass();
  if (inputClass != null) {
    outputCodec=ProtobufProxy.create(outputClass);
  }
}

Fixed version (ground truth):
/** 
 * @param method
 * @param protobufPRC
 */
public PojoRpcMethodInfo(Method method,ProtobufPRC protobufPRC){
  super(method,protobufPRC);
  Class<? extends Object> inputClass=getInputClass();
  if (inputClass != null) {
    inputCodec=ProtobufProxy.create(inputClass);
  }
  Class<? extends Object> outputClass=getOutputClass();
  if (outputClass != null) {
    outputCodec=ProtobufProxy.create(outputClass);
  }
}
Program: 94180
Project: 94180
Buggy source:
/** 
 * @param method
 * @param protobufPRC
 */
public PojoRpcMethodInfo(Method method,ProtobufPRC protobufPRC){
  super(method,protobufPRC);
  Class<? extends Object> inputClass=getInputClass();
  if (inputClass != null) {
    inputCodec=ProtobufProxy.create(inputClass);
  }
  Class<? extends Object> outputClass=getOutputClass();
  if (inputClass != null) {
    outputCodec=ProtobufProxy.create(outputClass);
  }
}

Fixed version (ground truth):
/** 
 * @param method
 * @param protobufPRC
 */
public PojoRpcMethodInfo(Method method,ProtobufPRC protobufPRC){
  super(method,protobufPRC);
  Class<? extends Object> inputClass=getInputClass();
  if (inputClass != null) {
    inputCodec=ProtobufProxy.create(inputClass);
  }
  Class<? extends Object> outputClass=getOutputClass();
  if (outputClass != null) {
    outputCodec=ProtobufProxy.create(outputClass);
  }
}
Program: 94181
Project: 94181
Buggy source:
public RpcData doHandle(RpcData data) throws Exception {
  Object input=null;
  Object[] param;
  Object ret;
  if (data.getData() != null && parseFromMethod != null) {
    input=parseFromMethod.invoke(getInputClass(),new ByteArrayInputStream(data.getData()));
    ;
    param=new Object[]{input};
  }
 else {
    param=new Object[0];
  }
  RpcData retData=new RpcData();
  if (getAttachmentHandler() != null) {
    byte[] responseAttachment=getAttachmentHandler().handleAttachement(data.getAttachment(),getServiceName(),getMethodName(),param);
    retData.setAttachment(responseAttachment);
  }
  ret=getMethod().invoke(getService(),param);
  if (ret == null) {
    return retData;
  }
  if (ret != null && ret instanceof GeneratedMessage) {
    byte[] response=((GeneratedMessage)input).toByteArray();
    retData.setData(response);
  }
  return retData;
}

Fixed version (ground truth):
public RpcData doHandle(RpcData data) throws Exception {
  Object input=null;
  Object[] param;
  Object ret;
  if (data.getData() != null && parseFromMethod != null) {
    input=parseFromMethod.invoke(getInputClass(),new ByteArrayInputStream(data.getData()));
    ;
    param=new Object[]{input};
  }
 else {
    param=new Object[0];
  }
  RpcData retData=new RpcData();
  if (getAttachmentHandler() != null) {
    byte[] responseAttachment=getAttachmentHandler().handleAttachement(data.getAttachment(),getServiceName(),getMethodName(),param);
    retData.setAttachment(responseAttachment);
  }
  ret=getMethod().invoke(getService(),param);
  if (ret == null) {
    return retData;
  }
  if (ret != null && ret instanceof GeneratedMessage) {
    byte[] response=((GeneratedMessage)ret).toByteArray();
    retData.setData(response);
  }
  return retData;
}
Program: 94182
Project: 94182
Buggy source:
private void doRegiterService(Method method,Object service,ProtobufPRCService protobufPRCService){
  boolean messageType=RpcMethodInfo.isMessageType(method);
  if (!messageType) {
    AnnotationRpcHandler rpcHandler=new AnnotationRpcHandler(method,service,protobufPRCService);
    if (StringUtils.isEmpty(rpcHandler.getServiceName())) {
      throw new IllegalArgumentException("String_Node_Str");
    }
    serviceMap.put(getMethodSignature(rpcHandler.getServiceName(),rpcHandler.getMethodName()),rpcHandler);
  }
 else {
  }
}

Fixed version (ground truth):
private void doRegiterService(Method method,Object service,ProtobufPRCService protobufPRCService){
  boolean messageType=RpcMethodInfo.isMessageType(method);
  AbstractRpcHandler rpcHandler;
  if (!messageType) {
    rpcHandler=new AnnotationRpcHandler(method,service,protobufPRCService);
  }
 else {
    rpcHandler=new MessageGeneratedRpcHandler(method,service,protobufPRCService);
  }
  if (StringUtils.isEmpty(rpcHandler.getServiceName())) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  serviceMap.put(getMethodSignature(rpcHandler.getServiceName(),rpcHandler.getMethodName()),rpcHandler);
}
Program: 94183
Project: 94183
Buggy source:
public static TvInput getTvInput(){
  return sTvInput;
}

Fixed version (ground truth):
public static TvInput getTvInput(Context context){
  if (sTvInput == null) {
    getRichChannels(context);
  }
  return sTvInput;
}
Program: 94184
Project: 94184
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  mInputId=getActivity().getIntent().getStringExtra(TvInputInfo.EXTRA_INPUT_ID);
  getChannels();
  mDorPresenter=new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
  BackgroundManager backgroundManager=BackgroundManager.getInstance(getActivity());
  backgroundManager.attach(getActivity().getWindow());
  mBackgroundTarget=new PicassoBackgroundManagerTarget(backgroundManager);
  mDefaultBackground=getResources().getDrawable(R.drawable.default_background);
  mMetrics=new DisplayMetrics();
  getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  Log.d(TAG,"String_Node_Str" + mInputId);
  new SetupRowTask().execute(mChannels);
  mDorPresenter.setSharedElementEnterTransition(getActivity(),"String_Node_Str");
  boolean hasChannels=TvContractUtils.getChannelCount(getActivity().getContentResolver(),mInputId) > 0;
  mAddChannelAction=new Action(ACTION_ADD_CHANNELS,getResources().getString(hasChannels ? R.string.rich_setup_update_channel : R.string.rich_setup_add_channel));
  mCancelAction=new Action(ACTION_CANCEL,getResources().getString(R.string.rich_setup_cancel));
  mInProgressAction=new Action(ACTION_IN_PROGRESS,getResources().getString(R.string.rich_setup_in_progress));
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  mInputId=getActivity().getIntent().getStringExtra(TvInputInfo.EXTRA_INPUT_ID);
  new SetupRowTask().execute();
}
Program: 94185
Project: 94185
Buggy source:
protected void updateBackground(String uri){
  Picasso.with(getActivity()).load(uri).resize(mMetrics.widthPixels,mMetrics.heightPixels).error(mDefaultBackground).into(mBackgroundTarget);
}

Fixed version (ground truth):
protected void updateBackground(String uri){
  BackgroundManager backgroundManager=BackgroundManager.getInstance(getActivity());
  backgroundManager.attach(getActivity().getWindow());
  mBackgroundTarget=new PicassoBackgroundManagerTarget(backgroundManager);
  mDefaultBackground=getResources().getDrawable(R.drawable.default_background);
  mMetrics=new DisplayMetrics();
  getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  Picasso.with(getActivity()).load(uri).resize(mMetrics.widthPixels,mMetrics.heightPixels).error(mDefaultBackground).into(mBackgroundTarget);
}
Program: 94186
Project: 94186
Buggy source:
@Override protected DetailsOverviewRow doInBackground(List<ChannelInfo>... channels){
  while (running) {
    Log.d(TAG,"String_Node_Str" + mInputId);
    DetailsOverviewRow row=new DetailsOverviewRow(mTvInput);
    try {
      Bitmap poster=Picasso.with(getActivity()).load(mTvInput.logoBackgroundUrl).resize(convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_WIDTH),convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_HEIGHT)).centerCrop().get();
      row.setImageBitmap(getActivity(),poster);
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
    row.addAction(mAddChannelAction);
    row.addAction(mCancelAction);
    return row;
  }
  return null;
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(Uri... params){
  mChannels=RichFeedUtil.getRichChannels(getActivity());
  mTvInput=RichFeedUtil.getTvInput(getActivity());
  if (mTvInput != null) {
    return getPoster();
  }
 else {
    publishProgress(getResources().getString(R.string.feed_error_message));
    return null;
  }
}
Program: 94187
Project: 94187
Buggy source:
@Override protected void onPostExecute(final DetailsOverviewRow detailRow){
  if (!running) {
    return;
  }
  ClassPresenterSelector presenterSelector=new ClassPresenterSelector();
  mDorPresenter.setBackgroundColor(getResources().getColor(R.color.detail_background));
  mDorPresenter.setStyleLarge(true);
  updateBackground(mTvInput.logoBackgroundUrl);
  mDorPresenter.setOnActionClickedListener(new OnActionClickedListener(){
    @Override public void onActionClicked(    Action action){
      if (action.getId() == ACTION_ADD_CHANNELS) {
        setupChannels(mInputId);
      }
 else       if (action.getId() == ACTION_CANCEL) {
        getActivity().finish();
      }
    }
  }
);
  presenterSelector.addClassPresenter(DetailsOverviewRow.class,mDorPresenter);
  presenterSelector.addClassPresenter(ListRow.class,new ListRowPresenter());
  mAdapter=new ArrayObjectAdapter(presenterSelector);
  mAdapter.add(detailRow);
  setAdapter(mAdapter);
}

Fixed version (ground truth):
@Override protected void onPostExecute(Bitmap poster){
  if (poster != null) {
    addSetupChannelDetailedRow(poster);
    updateBackground(mTvInput.logoBackgroundUrl);
  }
}
Program: 94188
Project: 94188
Buggy source:
private void setupChannels(String inputId){
  if (mChannels == null || mServiceClass == null) {
    return;
  }
  TvContractUtils.updateChannels(getActivity(),inputId,mChannels);
  SyncUtils.setUpPeriodicSync(getActivity(),inputId);
  SyncUtils.requestSync(inputId);
  mSyncRequested=true;
  if (mSyncObserverHandle == null) {
    final int mask=ContentResolver.SYNC_OBSERVER_TYPE_PENDING | ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE;
    mSyncObserverHandle=ContentResolver.addStatusChangeListener(mask,mSyncStatusObserver);
  }
}

Fixed version (ground truth):
private void setupChannels(String inputId){
  if (mChannels == null) {
    return;
  }
  TvContractUtils.updateChannels(getActivity(),inputId,mChannels);
  SyncUtils.setUpPeriodicSync(getActivity(),inputId);
  SyncUtils.requestSync(inputId);
  mSyncRequested=true;
  if (mSyncObserverHandle == null) {
    final int mask=ContentResolver.SYNC_OBSERVER_TYPE_PENDING | ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE;
    mSyncObserverHandle=ContentResolver.addStatusChangeListener(mask,mSyncStatusObserver);
  }
}
Program: 94189
Project: 94189
Buggy source:
/** 
 * Called periodically by the system in every   {@code SYNC_FREQUENCY_SEC}.
 */
@Override public void onPerformSync(Account account,Bundle extras,String authority,ContentProviderClient provider,SyncResult syncResult){
  Log.d(TAG,"String_Node_Str" + account + "String_Node_Str"+ authority+ "String_Node_Str"+ extras+ "String_Node_Str");
  String inputId=extras.getString(SyncAdapter.BUNDLE_KEY_INPUT_ID);
  if (inputId == null) {
    return;
  }
  List<ChannelInfo> channels=RichFeedUtil.createRichChannelsStatic(mContext);
  LongSparseArray<ChannelInfo> channelMap=TvContractUtils.buildChannelMap(mContext.getContentResolver(),inputId,channels);
  for (int i=0; i < channelMap.size(); ++i) {
    Uri channelUri=TvContract.buildChannelUri(channelMap.keyAt(i));
    insertPrograms(channelUri,channelMap.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Called periodically by the system in every   {@code SYNC_FREQUENCY_SEC}.
 */
@Override public void onPerformSync(Account account,Bundle extras,String authority,ContentProviderClient provider,SyncResult syncResult){
  Log.d(TAG,"String_Node_Str" + account + "String_Node_Str"+ authority+ "String_Node_Str"+ extras+ "String_Node_Str");
  String inputId=extras.getString(SyncAdapter.BUNDLE_KEY_INPUT_ID);
  if (inputId == null) {
    return;
  }
  List<ChannelInfo> channels=RichFeedUtil.getRichChannels(mContext);
  LongSparseArray<ChannelInfo> channelMap=TvContractUtils.buildChannelMap(mContext.getContentResolver(),inputId,channels);
  for (int i=0; i < channelMap.size(); ++i) {
    Uri channelUri=TvContract.buildChannelUri(channelMap.keyAt(i));
    insertPrograms(channelUri,channelMap.valueAt(i));
  }
}
Program: 94190
Project: 94190
Buggy source:
public static TvInput getTvInput(){
  return sTvInput;
}

Fixed version (ground truth):
public static TvInput getTvInput(Context context){
  if (sTvInput == null) {
    getRichChannels(context);
  }
  return sTvInput;
}
Program: 94191
Project: 94191
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  mInputId=getActivity().getIntent().getStringExtra(TvInputInfo.EXTRA_INPUT_ID);
  getChannels();
  mDorPresenter=new DetailsOverviewRowPresenter(new DetailsDescriptionPresenter());
  BackgroundManager backgroundManager=BackgroundManager.getInstance(getActivity());
  backgroundManager.attach(getActivity().getWindow());
  mBackgroundTarget=new PicassoBackgroundManagerTarget(backgroundManager);
  mDefaultBackground=getResources().getDrawable(R.drawable.default_background);
  mMetrics=new DisplayMetrics();
  getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  Log.d(TAG,"String_Node_Str" + mInputId);
  new SetupRowTask().execute(mChannels);
  mDorPresenter.setSharedElementEnterTransition(getActivity(),"String_Node_Str");
  boolean hasChannels=TvContractUtils.getChannelCount(getActivity().getContentResolver(),mInputId) > 0;
  mAddChannelAction=new Action(ACTION_ADD_CHANNELS,getResources().getString(hasChannels ? R.string.rich_setup_update_channel : R.string.rich_setup_add_channel));
  mCancelAction=new Action(ACTION_CANCEL,getResources().getString(R.string.rich_setup_cancel));
  mInProgressAction=new Action(ACTION_IN_PROGRESS,getResources().getString(R.string.rich_setup_in_progress));
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  Log.d(TAG,"String_Node_Str");
  super.onCreate(savedInstanceState);
  mInputId=getActivity().getIntent().getStringExtra(TvInputInfo.EXTRA_INPUT_ID);
  new SetupRowTask().execute();
}
Program: 94192
Project: 94192
Buggy source:
protected void updateBackground(String uri){
  Picasso.with(getActivity()).load(uri).resize(mMetrics.widthPixels,mMetrics.heightPixels).error(mDefaultBackground).into(mBackgroundTarget);
}

Fixed version (ground truth):
protected void updateBackground(String uri){
  BackgroundManager backgroundManager=BackgroundManager.getInstance(getActivity());
  backgroundManager.attach(getActivity().getWindow());
  mBackgroundTarget=new PicassoBackgroundManagerTarget(backgroundManager);
  mDefaultBackground=getResources().getDrawable(R.drawable.default_background);
  mMetrics=new DisplayMetrics();
  getActivity().getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  Picasso.with(getActivity()).load(uri).resize(mMetrics.widthPixels,mMetrics.heightPixels).error(mDefaultBackground).into(mBackgroundTarget);
}
Program: 94193
Project: 94193
Buggy source:
@Override protected DetailsOverviewRow doInBackground(List<ChannelInfo>... channels){
  while (running) {
    Log.d(TAG,"String_Node_Str" + mInputId);
    DetailsOverviewRow row=new DetailsOverviewRow(mTvInput);
    try {
      Bitmap poster=Picasso.with(getActivity()).load(mTvInput.logoBackgroundUrl).resize(convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_WIDTH),convertDpToPixel(getActivity().getApplicationContext(),DETAIL_THUMB_HEIGHT)).centerCrop().get();
      row.setImageBitmap(getActivity(),poster);
    }
 catch (    IOException e) {
      Log.e(TAG,e.toString());
    }
    row.addAction(mAddChannelAction);
    row.addAction(mCancelAction);
    return row;
  }
  return null;
}

Fixed version (ground truth):
@Override protected Bitmap doInBackground(Uri... params){
  mChannels=RichFeedUtil.getRichChannels(getActivity());
  mTvInput=RichFeedUtil.getTvInput(getActivity());
  if (mTvInput != null) {
    return getPoster();
  }
 else {
    publishProgress(getResources().getString(R.string.feed_error_message));
    return null;
  }
}
Program: 94194
Project: 94194
Buggy source:
@Override protected void onPostExecute(final DetailsOverviewRow detailRow){
  if (!running) {
    return;
  }
  ClassPresenterSelector presenterSelector=new ClassPresenterSelector();
  mDorPresenter.setBackgroundColor(getResources().getColor(R.color.detail_background));
  mDorPresenter.setStyleLarge(true);
  updateBackground(mTvInput.logoBackgroundUrl);
  mDorPresenter.setOnActionClickedListener(new OnActionClickedListener(){
    @Override public void onActionClicked(    Action action){
      if (action.getId() == ACTION_ADD_CHANNELS) {
        setupChannels(mInputId);
      }
 else       if (action.getId() == ACTION_CANCEL) {
        getActivity().finish();
      }
    }
  }
);
  presenterSelector.addClassPresenter(DetailsOverviewRow.class,mDorPresenter);
  presenterSelector.addClassPresenter(ListRow.class,new ListRowPresenter());
  mAdapter=new ArrayObjectAdapter(presenterSelector);
  mAdapter.add(detailRow);
  setAdapter(mAdapter);
}

Fixed version (ground truth):
@Override protected void onPostExecute(Bitmap poster){
  if (poster != null) {
    addSetupChannelDetailedRow(poster);
    updateBackground(mTvInput.logoBackgroundUrl);
  }
}
Program: 94195
Project: 94195
Buggy source:
private void setupChannels(String inputId){
  if (mChannels == null || mServiceClass == null) {
    return;
  }
  TvContractUtils.updateChannels(getActivity(),inputId,mChannels);
  SyncUtils.setUpPeriodicSync(getActivity(),inputId);
  SyncUtils.requestSync(inputId);
  mSyncRequested=true;
  if (mSyncObserverHandle == null) {
    final int mask=ContentResolver.SYNC_OBSERVER_TYPE_PENDING | ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE;
    mSyncObserverHandle=ContentResolver.addStatusChangeListener(mask,mSyncStatusObserver);
  }
}

Fixed version (ground truth):
private void setupChannels(String inputId){
  if (mChannels == null) {
    return;
  }
  TvContractUtils.updateChannels(getActivity(),inputId,mChannels);
  SyncUtils.setUpPeriodicSync(getActivity(),inputId);
  SyncUtils.requestSync(inputId);
  mSyncRequested=true;
  if (mSyncObserverHandle == null) {
    final int mask=ContentResolver.SYNC_OBSERVER_TYPE_PENDING | ContentResolver.SYNC_OBSERVER_TYPE_ACTIVE;
    mSyncObserverHandle=ContentResolver.addStatusChangeListener(mask,mSyncStatusObserver);
  }
}
Program: 94196
Project: 94196
Buggy source:
/** 
 * Called periodically by the system in every   {@code SYNC_FREQUENCY_SEC}.
 */
@Override public void onPerformSync(Account account,Bundle extras,String authority,ContentProviderClient provider,SyncResult syncResult){
  Log.d(TAG,"String_Node_Str" + account + "String_Node_Str"+ authority+ "String_Node_Str"+ extras+ "String_Node_Str");
  String inputId=extras.getString(SyncAdapter.BUNDLE_KEY_INPUT_ID);
  if (inputId == null) {
    return;
  }
  List<ChannelInfo> channels=RichFeedUtil.createRichChannelsStatic(mContext);
  LongSparseArray<ChannelInfo> channelMap=TvContractUtils.buildChannelMap(mContext.getContentResolver(),inputId,channels);
  for (int i=0; i < channelMap.size(); ++i) {
    Uri channelUri=TvContract.buildChannelUri(channelMap.keyAt(i));
    insertPrograms(channelUri,channelMap.valueAt(i));
  }
}

Fixed version (ground truth):
/** 
 * Called periodically by the system in every   {@code SYNC_FREQUENCY_SEC}.
 */
@Override public void onPerformSync(Account account,Bundle extras,String authority,ContentProviderClient provider,SyncResult syncResult){
  Log.d(TAG,"String_Node_Str" + account + "String_Node_Str"+ authority+ "String_Node_Str"+ extras+ "String_Node_Str");
  String inputId=extras.getString(SyncAdapter.BUNDLE_KEY_INPUT_ID);
  if (inputId == null) {
    return;
  }
  List<ChannelInfo> channels=RichFeedUtil.getRichChannels(mContext);
  LongSparseArray<ChannelInfo> channelMap=TvContractUtils.buildChannelMap(mContext.getContentResolver(),inputId,channels);
  for (int i=0; i < channelMap.size(); ++i) {
    Uri channelUri=TvContract.buildChannelUri(channelMap.keyAt(i));
    insertPrograms(channelUri,channelMap.valueAt(i));
  }
}
Program: 94198
Project: 94198
Buggy source:
private void loadRows(){
  String inputId=getActivity().getIntent().getStringExtra(TvInputInfo.EXTRA_INPUT_ID);
  String serviceName=Utils.getServiceNameFromInputId(getActivity(),inputId);
  if (!TextUtils.isEmpty(serviceName)) {
    String[] a=serviceName.split("String_Node_Str");
    serviceName=a[a.length - 1];
  }
  GridItemPresenter mGridPresenter=new GridItemPresenter();
  mRowsAdapter=new ArrayObjectAdapter(new ListRowPresenter());
  HeaderItem gridHeader=new HeaderItem(0,"String_Node_Str",null);
  ArrayObjectAdapter gridRowAdapter=new ArrayObjectAdapter(mGridPresenter);
  gridRowAdapter.add(serviceName + "String_Node_Str");
  if (serviceName.equals(RichTvInputService.class.getName())) {
    gridRowAdapter.add("String_Node_Str");
    gridRowAdapter.add("String_Node_Str");
  }
  mRowsAdapter.add(new ListRow(gridHeader,gridRowAdapter));
  setAdapter(mRowsAdapter);
}

Fixed version (ground truth):
private void loadRows(){
  String inputId=getActivity().getIntent().getStringExtra(TvInputInfo.EXTRA_INPUT_ID);
  String serviceName=Utils.getServiceNameFromInputId(getActivity(),inputId);
  if (!TextUtils.isEmpty(serviceName)) {
    String[] a=serviceName.split("String_Node_Str");
    serviceName=a[a.length - 1];
  }
  GridItemPresenter mGridPresenter=new GridItemPresenter();
  mRowsAdapter=new ArrayObjectAdapter(new ListRowPresenter());
  HeaderItem gridHeader=new HeaderItem(0,"String_Node_Str",null);
  ArrayObjectAdapter gridRowAdapter=new ArrayObjectAdapter(mGridPresenter);
  gridRowAdapter.add(serviceName + "String_Node_Str");
  if (RichTvInputService.class.getName().contains(serviceName)) {
    gridRowAdapter.add("String_Node_Str");
    gridRowAdapter.add("String_Node_Str");
  }
  mRowsAdapter.add(new ListRow(gridHeader,gridRowAdapter));
  setAdapter(mRowsAdapter);
}
Program: 94199
Project: 94199
Buggy source:
private boolean startPlayback(int resource){
  if (mPlayer == null) {
    mPlayer=new MediaPlayer();
    mPlayer.setOnInfoListener(new MediaPlayer.OnInfoListener(){
      @Override public boolean onInfo(      MediaPlayer player,      int what,      int arg){
        if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
          notifyVideoUnavailable(TvInputManager.VIDEO_UNAVAILABLE_REASON_BUFFERING);
          return true;
        }
 else         if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END || what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
          notifyVideoAvailable();
          return true;
        }
        return false;
      }
    }
);
    mPlayer.setSurface(mSurface);
    mPlayer.setVolume(mVolume,mVolume);
    mPlayer.setLooping(true);
  }
 else {
    mPlayer.reset();
  }
  AssetFileDescriptor afd=getResources().openRawResourceFd(resource);
  if (afd == null) {
    return false;
  }
  try {
    mPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getDeclaredLength());
    mPlayer.prepare();
    mPlayer.start();
  }
 catch (  IOException e) {
    return false;
  }
 finally {
    try {
      afd.close();
    }
 catch (    IOException e) {
    }
  }
  notifyContentAllowed();
  return true;
}

Fixed version (ground truth):
private boolean startPlayback(int resource){
  if (mPlayer == null) {
    mPlayer=new MediaPlayer();
    mPlayer.setOnInfoListener(new MediaPlayer.OnInfoListener(){
      @Override public boolean onInfo(      MediaPlayer player,      int what,      int arg){
        if (what == MediaPlayer.MEDIA_INFO_BUFFERING_START) {
          notifyVideoUnavailable(TvInputManager.VIDEO_UNAVAILABLE_REASON_BUFFERING);
          return true;
        }
 else         if (what == MediaPlayer.MEDIA_INFO_BUFFERING_END || what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) {
          notifyVideoAvailable();
          return true;
        }
        return false;
      }
    }
);
    mPlayer.setSurface(mSurface);
    mPlayer.setVolume(mVolume,mVolume);
  }
 else {
    mPlayer.reset();
  }
  mPlayer.setLooping(true);
  AssetFileDescriptor afd=getResources().openRawResourceFd(resource);
  if (afd == null) {
    return false;
  }
  try {
    mPlayer.setDataSource(afd.getFileDescriptor(),afd.getStartOffset(),afd.getDeclaredLength());
    mPlayer.prepare();
    mPlayer.start();
  }
 catch (  IOException e) {
    return false;
  }
 finally {
    try {
      afd.close();
    }
 catch (    IOException e) {
    }
  }
  notifyContentAllowed();
  return true;
}
Program: 94202
Project: 94202
Buggy source:
@Override public void run(){
  while (!mIsLoopExit) {
    byte[] buffer=new byte[mMinBufferSize];
    int ret=mAudioRecord.read(buffer,0,mMinBufferSize);
    if (ret == AudioRecord.ERROR_INVALID_OPERATION) {
      Log.e(TAG,"String_Node_Str");
    }
 else     if (ret == AudioRecord.ERROR_BAD_VALUE) {
      Log.e(TAG,"String_Node_Str");
    }
 else     if (ret == AudioRecord.ERROR_INVALID_OPERATION) {
      Log.e(TAG,"String_Node_Str");
    }
 else {
      if (mAudioFrameCapturedListener != null) {
        mAudioFrameCapturedListener.onAudioFrameCaptured(buffer);
      }
      Log.d(TAG,"String_Node_Str" + ret + "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (!mIsLoopExit) {
    byte[] buffer=new byte[mMinBufferSize];
    int ret=mAudioRecord.read(buffer,0,mMinBufferSize);
    if (ret == AudioRecord.ERROR_INVALID_OPERATION) {
      Log.e(TAG,"String_Node_Str");
    }
 else     if (ret == AudioRecord.ERROR_BAD_VALUE) {
      Log.e(TAG,"String_Node_Str");
    }
 else {
      if (mAudioFrameCapturedListener != null) {
        mAudioFrameCapturedListener.onAudioFrameCaptured(buffer);
      }
      Log.d(TAG,"String_Node_Str" + ret + "String_Node_Str");
    }
    SystemClock.sleep(10);
  }
}
Program: 94203
Project: 94203
Buggy source:
public void stopCapture(){
  if (!mIsCaptureStarted) {
    return;
  }
  mIsLoopExit=false;
  try {
    mCaptureThread.interrupt();
    mCaptureThread.join(1000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  if (mAudioRecord.getRecordingState() == AudioRecord.RECORDSTATE_RECORDING) {
    mAudioRecord.stop();
  }
  mAudioRecord.release();
  mIsCaptureStarted=false;
  mAudioFrameCapturedListener=null;
  Log.d(TAG,"String_Node_Str");
}

Fixed version (ground truth):
public void stopCapture(){
  if (!mIsCaptureStarted) {
    return;
  }
  mIsLoopExit=true;
  try {
    mCaptureThread.interrupt();
    mCaptureThread.join(1000);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
  if (mAudioRecord.getRecordingState() == AudioRecord.RECORDSTATE_RECORDING) {
    mAudioRecord.stop();
  }
  mAudioRecord.release();
  mIsCaptureStarted=false;
  mAudioFrameCapturedListener=null;
  Log.d(TAG,"String_Node_Str");
}
Program: 94204
Project: 94204
Buggy source:
public void loadExtensions(ClassLoader classLoader,List<String> extensions,List<Settings.ConfiguredExtension> extensionsWithConfiguration){
  this.extensions=new ArrayList<>();
  if (extensions != null) {
    this.extensions.addAll(loadInstances(classLoader,extensions,Extension.class));
  }
  if (extensionsWithConfiguration != null) {
    for (    ConfiguredExtension configuredExtension : extensionsWithConfiguration) {
      final Extension extension=loadInstance(classLoader,configuredExtension.className,Extension.class);
      extension.setConfiguration(Utils.mapFromNullable(configuredExtension.configuration));
      this.extensions.add(extension);
    }
  }
}

Fixed version (ground truth):
public void loadExtensions(ClassLoader classLoader,List<String> extensions,List<Settings.ConfiguredExtension> extensionsWithConfiguration){
  this.extensions=new ArrayList<>();
  if (extensions != null) {
    this.extensions.addAll(loadInstances(classLoader,extensions,EmitterExtension.class));
  }
  if (extensionsWithConfiguration != null) {
    for (    ConfiguredExtension configuredExtension : extensionsWithConfiguration) {
      final EmitterExtension emitterExtension=loadInstance(classLoader,configuredExtension.className,EmitterExtension.class);
      if (emitterExtension instanceof Extension) {
        final Extension extension=(Extension)emitterExtension;
        extension.setConfiguration(Utils.mapFromNullable(configuredExtension.configuration));
      }
      this.extensions.add(emitterExtension);
    }
  }
}
Program: 94206
Project: 94206
Buggy source:
private static TsBeanModel getBeanModelByType(TsModel model,TsType type){
  TsType originalType=extractOriginalTsType(type);
  for (  TsBeanModel curBean : model.getBeans()) {
    if (curBean.getName().equals(originalType)) {
      return curBean;
    }
  }
  return null;
}

Fixed version (ground truth):
private static TsBeanModel getBeanModelByType(TsModel model,TsType type){
  TsType originalType=extractOriginalTsType(type);
  if (!(originalType instanceof TsType.ReferenceType)) {
    return null;
  }
  TsType.ReferenceType originalTypeBean=(TsType.ReferenceType)originalType;
  for (  TsBeanModel curBean : model.getBeans()) {
    if (curBean.getName().equals(originalTypeBean.symbol)) {
      return curBean;
    }
  }
  return null;
}
Program: 94207
Project: 94207
Buggy source:
@Test public void basicTest(){
  final StringBuilder data=new StringBuilder();
  final EmitterExtension.Writer writer=new EmitterExtension.Writer(){
    @Override public void writeIndentedLine(    String line){
      data.append(line + "String_Node_Str");
    }
  }
;
  final Settings settings=new Settings();
  settings.sortDeclarations=true;
  final TypeProcessor typeProcessor=new DefaultTypeProcessor();
  final Model model=new Jackson2Parser(settings,typeProcessor).parseModel(ClassA.class);
  final TsModel tsModel=new ModelCompiler(settings,typeProcessor).javaToTypeScript(model);
  new BeanPropertyPathExtension().emitElements(writer,settings,false,tsModel);
  String dataStr=data.toString();
  Assert.assertEquals(29,dataStr.split("String_Node_Str").length);
  Assert.assertTrue(dataStr.contains("String_Node_Str"));
  Assert.assertTrue(dataStr.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void basicTest() throws Exception {
  final StringBuilder data=new StringBuilder();
  final EmitterExtension.Writer writer=new EmitterExtension.Writer(){
    @Override public void writeIndentedLine(    String line){
      data.append(line + "String_Node_Str");
    }
  }
;
  final Settings settings=new Settings();
  settings.sortDeclarations=true;
  final TypeProcessor typeProcessor=new DefaultTypeProcessor();
  final Model model=new Jackson2Parser(settings,typeProcessor).parseModel(ClassA.class);
  final TsModel tsModel=new ModelCompiler(settings,typeProcessor).javaToTypeScript(model);
  new BeanPropertyPathExtension().emitElements(writer,settings,false,tsModel);
  String dataStr=data.toString();
  final String expected=new String(Files.readAllBytes(Paths.get(getClass().getClassLoader().getResource("String_Node_Str").toURI())));
  Assert.assertEquals(expected,dataStr);
}
Program: 94208
Project: 94208
Buggy source:
private static Map<Type,TsType> getKnownTypes(){
  final Map<Type,TsType> knownTypes=new LinkedHashMap<>();
  knownTypes.put(Object.class,TsType.Any);
  knownTypes.put(Byte.class,TsType.Number);
  knownTypes.put(Byte.TYPE,TsType.Number);
  knownTypes.put(Short.class,TsType.Number);
  knownTypes.put(Short.TYPE,TsType.Number);
  knownTypes.put(Integer.class,TsType.Number);
  knownTypes.put(Integer.TYPE,TsType.Number);
  knownTypes.put(Long.class,TsType.Number);
  knownTypes.put(Long.TYPE,TsType.Number);
  knownTypes.put(Float.class,TsType.Number);
  knownTypes.put(Float.TYPE,TsType.Number);
  knownTypes.put(Double.class,TsType.Number);
  knownTypes.put(Double.TYPE,TsType.Number);
  knownTypes.put(Boolean.class,TsType.Boolean);
  knownTypes.put(Boolean.TYPE,TsType.Boolean);
  knownTypes.put(Character.class,TsType.String);
  knownTypes.put(Character.TYPE,TsType.String);
  knownTypes.put(String.class,TsType.String);
  knownTypes.put(Date.class,TsType.Date);
  return knownTypes;
}

Fixed version (ground truth):
private static Map<Type,TsType> getKnownTypes(){
  final Map<Type,TsType> knownTypes=new LinkedHashMap<>();
  knownTypes.put(Object.class,TsType.Any);
  knownTypes.put(Byte.class,TsType.Number);
  knownTypes.put(Byte.TYPE,TsType.Number);
  knownTypes.put(Short.class,TsType.Number);
  knownTypes.put(Short.TYPE,TsType.Number);
  knownTypes.put(Integer.class,TsType.Number);
  knownTypes.put(Integer.TYPE,TsType.Number);
  knownTypes.put(Long.class,TsType.Number);
  knownTypes.put(Long.TYPE,TsType.Number);
  knownTypes.put(Float.class,TsType.Number);
  knownTypes.put(Float.TYPE,TsType.Number);
  knownTypes.put(Double.class,TsType.Number);
  knownTypes.put(Double.TYPE,TsType.Number);
  knownTypes.put(Boolean.class,TsType.Boolean);
  knownTypes.put(Boolean.TYPE,TsType.Boolean);
  knownTypes.put(Character.class,TsType.String);
  knownTypes.put(Character.TYPE,TsType.String);
  knownTypes.put(String.class,TsType.String);
  knownTypes.put(Date.class,TsType.Date);
  knownTypes.put(void.class,TsType.Void);
  knownTypes.put(Void.class,TsType.Void);
  return knownTypes;
}
Program: 94209
Project: 94209
Buggy source:
@Test public void testTypeConversion(){
  TypeProcessor converter=new DefaultTypeProcessor();
  final TypeProcessor.Context context=getTestContext(converter);
  assertEquals("String_Node_Str",converter.processType(A.class,context).getTsType().toString());
  assertEquals("String_Node_Str",converter.processType(B.class,context).getTsType().toString());
}

Fixed version (ground truth):
@Test public void testTypeConversion(){
  TypeProcessor converter=new DefaultTypeProcessor();
  final TypeProcessor.Context context=getTestContext(converter);
  assertEquals("String_Node_Str",converter.processType(A.class,context).getTsType().toString());
  assertEquals("String_Node_Str",converter.processType(B.class,context).getTsType().toString());
  assertEquals(TsType.Void,converter.processType(void.class,context).getTsType());
}
Program: 94210
Project: 94210
Buggy source:
private static Map<Type,TsType> getKnownTypes(){
  final Map<Type,TsType> knownTypes=new LinkedHashMap<>();
  knownTypes.put(Object.class,TsType.Any);
  knownTypes.put(Byte.class,TsType.Number);
  knownTypes.put(Byte.TYPE,TsType.Number);
  knownTypes.put(Short.class,TsType.Number);
  knownTypes.put(Short.TYPE,TsType.Number);
  knownTypes.put(Integer.class,TsType.Number);
  knownTypes.put(Integer.TYPE,TsType.Number);
  knownTypes.put(Long.class,TsType.Number);
  knownTypes.put(Long.TYPE,TsType.Number);
  knownTypes.put(Float.class,TsType.Number);
  knownTypes.put(Float.TYPE,TsType.Number);
  knownTypes.put(Double.class,TsType.Number);
  knownTypes.put(Double.TYPE,TsType.Number);
  knownTypes.put(Boolean.class,TsType.Boolean);
  knownTypes.put(Boolean.TYPE,TsType.Boolean);
  knownTypes.put(Character.class,TsType.String);
  knownTypes.put(Character.TYPE,TsType.String);
  knownTypes.put(String.class,TsType.String);
  knownTypes.put(Date.class,TsType.Date);
  return knownTypes;
}

Fixed version (ground truth):
private static Map<Type,TsType> getKnownTypes(){
  final Map<Type,TsType> knownTypes=new LinkedHashMap<>();
  knownTypes.put(Object.class,TsType.Any);
  knownTypes.put(Byte.class,TsType.Number);
  knownTypes.put(Byte.TYPE,TsType.Number);
  knownTypes.put(Short.class,TsType.Number);
  knownTypes.put(Short.TYPE,TsType.Number);
  knownTypes.put(Integer.class,TsType.Number);
  knownTypes.put(Integer.TYPE,TsType.Number);
  knownTypes.put(Long.class,TsType.Number);
  knownTypes.put(Long.TYPE,TsType.Number);
  knownTypes.put(Float.class,TsType.Number);
  knownTypes.put(Float.TYPE,TsType.Number);
  knownTypes.put(Double.class,TsType.Number);
  knownTypes.put(Double.TYPE,TsType.Number);
  knownTypes.put(Boolean.class,TsType.Boolean);
  knownTypes.put(Boolean.TYPE,TsType.Boolean);
  knownTypes.put(Character.class,TsType.String);
  knownTypes.put(Character.TYPE,TsType.String);
  knownTypes.put(String.class,TsType.String);
  knownTypes.put(Date.class,TsType.Date);
  knownTypes.put(void.class,TsType.Void);
  knownTypes.put(Void.class,TsType.Void);
  return knownTypes;
}
Program: 94211
Project: 94211
Buggy source:
@Test public void testTypeConversion(){
  TypeProcessor converter=new DefaultTypeProcessor();
  final TypeProcessor.Context context=getTestContext(converter);
  assertEquals("String_Node_Str",converter.processType(A.class,context).getTsType().toString());
  assertEquals("String_Node_Str",converter.processType(B.class,context).getTsType().toString());
}

Fixed version (ground truth):
@Test public void testTypeConversion(){
  TypeProcessor converter=new DefaultTypeProcessor();
  final TypeProcessor.Context context=getTestContext(converter);
  assertEquals("String_Node_Str",converter.processType(A.class,context).getTsType().toString());
  assertEquals("String_Node_Str",converter.processType(B.class,context).getTsType().toString());
  assertEquals(TsType.Void,converter.processType(void.class,context).getTsType());
}
Program: 94212
Project: 94212
Buggy source:
private void handleCompleted(CompletedFrom comp){
  completed(comp.source);
  final boolean done;
  if (comp.source == Source.A) {
    aSub.unsubscribe();
    done=(completed == COMPLETED_BOTH) || (completed == COMPLETED_A && as.isEmpty());
  }
 else {
    bSub.unsubscribe();
    done=(completed == COMPLETED_BOTH) || (completed == COMPLETED_B && bs.isEmpty());
  }
  if (done) {
    clear();
    child.onCompleted();
  }
}

Fixed version (ground truth):
private void handleCompleted(CompletedFrom comp){
  completed(comp.source);
  final boolean done;
  if (comp.source == Source.A) {
    aSub.unsubscribe();
    done=(completed == COMPLETED_BOTH) || (completed == COMPLETED_A && as.isEmpty());
  }
 else {
    bSub.unsubscribe();
    done=(completed == COMPLETED_BOTH) || (completed == COMPLETED_B && bs.isEmpty());
  }
  if (done) {
    clear();
    child.onCompleted();
  }
 else {
    checkToRequestMore();
  }
}
Program: 94213
Project: 94213
Buggy source:
private int handleItem(Object value,Source source){
  int numEmitted=0;
  if (source == Source.A) {
    @SuppressWarnings("String_Node_Str") A a=(A)value;
    K key=aKey.call(a);
    Queue<B> q=bs.get(key);
    if (q == null) {
      add(as,key,a);
    }
 else {
      B b=poll(bs,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_B && bs.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromA+=1;
    }
  }
 else {
    @SuppressWarnings("String_Node_Str") B b=(B)value;
    K key=bKey.call(b);
    Queue<A> q=as.get(key);
    if (q == null) {
      add(bs,key,b);
    }
 else {
      A a=poll(as,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_A && as.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromB+=1;
    }
  }
  if (requestFromA == requestSize && completed == COMPLETED_B) {
    requestFromA=0;
    aSub.requestMore(requestSize);
  }
 else   if (requestFromB == requestSize && completed == COMPLETED_A) {
    requestFromB=0;
    bSub.requestMore(requestSize);
  }
 else   if (requestFromA == requestSize && requestFromB == requestSize) {
    requestFromA=0;
    requestFromB=0;
    aSub.requestMore(requestSize);
    bSub.requestMore(requestSize);
  }
  return numEmitted;
}

Fixed version (ground truth):
private int handleItem(Object value,Source source){
  int numEmitted=0;
  if (source == Source.A) {
    @SuppressWarnings("String_Node_Str") A a=(A)value;
    K key=aKey.call(a);
    Queue<B> q=bs.get(key);
    if (q == null) {
      add(as,key,a);
    }
 else {
      B b=poll(bs,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_B && bs.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromA+=1;
    }
  }
 else {
    @SuppressWarnings("String_Node_Str") B b=(B)value;
    K key=bKey.call(b);
    Queue<A> q=as.get(key);
    if (q == null) {
      add(bs,key,b);
    }
 else {
      A a=poll(as,q,key);
      C c=combiner.call(a,b);
      child.onNext(c);
      numEmitted=1;
    }
    if (completed == COMPLETED_A && as.isEmpty()) {
      clear();
      child.onCompleted();
    }
 else {
      requestFromB+=1;
    }
  }
  checkToRequestMore();
  return numEmitted;
}