nus-yam/ex-repair huggingface dataset:
Program: 116815
Project: 116815
Buggy source:
public void listAvailableCartridges() throws CommandException {
  try {
    Cartridge[] multiTenantCatridges=stub.getAvailableCartridges(true);
    if (multiTenantCatridges == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      System.out.println("String_Node_Str");
    }
    RowMapper<Cartridge> cartridgeMapper=new RowMapper<Cartridge>(){
      @Override public String[] getData(      Cartridge cartridge){
        String[] data=new String[3];
        data[0]=cartridge.getCartridgeType();
        data[1]=cartridge.getDisplayName();
        data[2]=cartridge.getVersion();
        return data;
      }
    }
;
    System.out.println("String_Node_Str");
    CommandLineUtils.printTable(multiTenantCatridges,cartridgeMapper,"String_Node_Str","String_Node_Str","String_Node_Str");
    System.out.println();
    Cartridge[] singleTenantCatridges=stub.getAvailableCartridges(false);
    if (multiTenantCatridges == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      System.out.println("String_Node_Str");
    }
    System.out.println("String_Node_Str");
    CommandLineUtils.printTable(singleTenantCatridges,cartridgeMapper,"String_Node_Str","String_Node_Str","String_Node_Str");
    System.out.println();
  }
 catch (  ApplicationManagementServiceADCExceptionException e) {
    handleException("String_Node_Str",e);
  }
catch (  RemoteException e) {
    handleException(e);
  }
}

Fixed version (ground truth):
public void listAvailableCartridges() throws CommandException {
  try {
    Cartridge[] multiTenantCatridges=stub.getAvailableCartridges(true);
    if (multiTenantCatridges == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      System.out.println("String_Node_Str");
    }
    RowMapper<Cartridge> cartridgeMapper=new RowMapper<Cartridge>(){
      @Override public String[] getData(      Cartridge cartridge){
        String[] data=new String[3];
        data[0]=cartridge.getCartridgeType();
        data[1]=cartridge.getDisplayName();
        data[2]=cartridge.getVersion();
        return data;
      }
    }
;
    System.out.println("String_Node_Str");
    CommandLineUtils.printTable(multiTenantCatridges,cartridgeMapper,"String_Node_Str","String_Node_Str","String_Node_Str");
    System.out.println();
    Cartridge[] singleTenantCatridges=stub.getAvailableCartridges(false);
    if (singleTenantCatridges == null) {
      if (logger.isDebugEnabled()) {
        logger.debug("String_Node_Str");
      }
      System.out.println("String_Node_Str");
    }
    System.out.println("String_Node_Str");
    CommandLineUtils.printTable(singleTenantCatridges,cartridgeMapper,"String_Node_Str","String_Node_Str","String_Node_Str");
    System.out.println();
  }
 catch (  ApplicationManagementServiceADCExceptionException e) {
    handleException("String_Node_Str",e);
  }
catch (  RemoteException e) {
    handleException(e);
  }
}
Program: 116816
Project: 116816
Buggy source:
public String getUsagePlanName(String tenantDomain) throws Exception {
  Subscription subscription;
  try {
    subscription=stub.getActiveSubscriptionOfCustomerByTenant();
    if (subscription != null) {
      return subscription.getSubscriptionPlan();
    }
 else {
      return "String_Node_Str";
    }
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + tenantDomain;
    log.error(msg,e);
    throw new Exception(msg,e);
  }
}

Fixed version (ground truth):
public String getUsagePlanName(String tenantDomain) throws Exception {
  try {
    return "String_Node_Str";
  }
 catch (  Exception e) {
    String msg="String_Node_Str" + tenantDomain;
    log.error(msg,e);
    throw new Exception(msg,e);
  }
}
Program: 116817
Project: 116817
Buggy source:
@Override public FrameLayout createView(LayerManager layerManager){
  this.layerManager=layerManager;
  LayoutInflater inflater=layerManager.getActivity().getLayoutInflater();
  view=(FrameLayout)inflater.inflate(R.layout.playback_control_layer,null);
  setupView();
  originalContainerLayoutParams=layerManager.getContainer().getLayoutParams();
  layerManager.getControl().addCallback(this);
  textColor=DEFAULT_TEXT_COLOR;
  chromeColor=DEFAULT_CHROME_COLOR;
  controlColor=DEFAULT_CONTROL_TINT_COLOR;
  seekbarColor=DEFAULT_TEXT_COLOR;
  if (logoDrawable != null) {
    logoImageView.setImageDrawable(logoDrawable);
  }
  getLayerManager().getContainer().setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (isVisible) {
        hide();
      }
 else {
        show();
      }
    }
  }
);
  playbackControlRootView.setVisibility(View.INVISIBLE);
  return view;
}

Fixed version (ground truth):
@Override public FrameLayout createView(LayerManager layerManager){
  this.layerManager=layerManager;
  LayoutInflater inflater=layerManager.getActivity().getLayoutInflater();
  view=(FrameLayout)inflater.inflate(R.layout.playback_control_layer,null);
  setupView();
  originalContainerLayoutParams=layerManager.getContainer().getLayoutParams();
  layerManager.getControl().addCallback(this);
  savedOrientation=layerManager.getActivity().getResources().getConfiguration().orientation;
  textColor=DEFAULT_TEXT_COLOR;
  chromeColor=DEFAULT_CHROME_COLOR;
  controlColor=DEFAULT_CONTROL_TINT_COLOR;
  seekbarColor=DEFAULT_TEXT_COLOR;
  if (logoDrawable != null) {
    logoImageView.setImageDrawable(logoDrawable);
  }
  getLayerManager().getContainer().setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (isVisible) {
        hide();
      }
 else {
        show();
      }
    }
  }
);
  playbackControlRootView.setVisibility(View.INVISIBLE);
  return view;
}
Program: 116819
Project: 116819
Buggy source:
/** 
 * When you are finished using this   {@link ImaPlayer}, make sure to call this method.
 */
public void release(){
  if (adPlayer != null) {
    adPlayer.release();
  }
  adsLoader.contentComplete();
  contentPlayer.release();
}

Fixed version (ground truth):
/** 
 * When you are finished using this   {@link ImaPlayer}, make sure to call this method.
 */
public void release(){
  if (adPlayer != null) {
    adPlayer.release();
    adPlayer=null;
  }
  if (adsManager != null) {
    adsManager.destroy();
    adsManager=null;
  }
  adsLoader.contentComplete();
  contentPlayer.release();
}
Program: 116820
Project: 116820
Buggy source:
/** 
 * Destroy the   {@link SimpleVideoPlayer} responsible for playing the ad and rmeove it.
 */
private void destroyAdPlayer(){
  if (adPlayerContainer != null) {
    container.removeView(adPlayerContainer);
  }
  if (adUiContainer != null) {
    container.removeView(adUiContainer);
  }
  if (adPlayer != null) {
    contentPlayer.setFullscreen(adPlayer.isFullscreen());
    adPlayer.release();
  }
  adPlayerContainer=null;
  adPlayer=null;
  setFullscreenCallback(fullscreenCallback);
}

Fixed version (ground truth):
/** 
 * Destroy the   {@link SimpleVideoPlayer} responsible for playing the ad and remove it.
 */
private void destroyAdPlayer(){
  if (adPlayerContainer != null) {
    container.removeView(adPlayerContainer);
  }
  if (adUiContainer != null) {
    container.removeView(adUiContainer);
  }
  if (adPlayer != null) {
    contentPlayer.setFullscreen(adPlayer.isFullscreen());
    adPlayer.release();
  }
  adPlayerContainer=null;
  adPlayer=null;
  setFullscreenCallback(fullscreenCallback);
}
Program: 116822
Project: 116822
Buggy source:
public TrackState getStateForTrackType(int type){
  return trackStateForType[type];
}

Fixed version (ground truth):
public int getStateForTrackType(int type){
  return trackStateForType[type];
}
Program: 116823
Project: 116823
Buggy source:
public void selectTrack(int type,TrackState state){
  if (trackStateForType[type] == state) {
    return;
  }
  trackStateForType[type]=state;
  if (type == TYPE_VIDEO) {
    pushSurfaceAndVideoTrack(false);
  }
 else {
    pushTrackSelection(type,true);
  }
}

Fixed version (ground truth):
public void selectTrack(int type,int state){
  if (trackStateForType[type] == state) {
    return;
  }
  trackStateForType[type]=state;
  if (type == TYPE_VIDEO) {
    pushSurfaceAndVideoTrack(false);
  }
 else {
    pushTrackSelection(type,true);
  }
}
Program: 116824
Project: 116824
Buggy source:
/** 
 * Send the renderer at trackIndex to the underlying player.
 * @param type The index of the video type (it must be one of the TYPE_* constants).
 * @param allowRendererEnable If true, the renderer is enabled.
 */
private void pushTrackSelection(int type,boolean allowRendererEnable){
  if (rendererBuildingState != RENDERER_BUILDING_STATE_BUILT) {
    return;
  }
  TrackState trackState=trackStateForType[type];
  if (trackState == TrackState.DISABLED) {
    player.setRendererEnabled(type,false);
  }
 else   if (multiTrackSources[type] == null) {
    player.setRendererEnabled(type,allowRendererEnable);
  }
 else {
    boolean playWhenReady=player.getPlayWhenReady();
    player.setPlayWhenReady(false);
    player.setRendererEnabled(type,false);
    player.sendMessage(multiTrackSources[type],MultiTrackChunkSource.MSG_SELECT_TRACK,trackState);
    player.setRendererEnabled(type,allowRendererEnable);
    player.setPlayWhenReady(playWhenReady);
  }
}

Fixed version (ground truth):
/** 
 * Send the renderer at trackIndex to the underlying player.
 * @param type The index of the video type (it must be one of the TYPE_* constants).
 * @param allowRendererEnable If true, the renderer is enabled.
 */
private void pushTrackSelection(int type,boolean allowRendererEnable){
  if (rendererBuildingState != RENDERER_BUILDING_STATE_BUILT) {
    return;
  }
  int trackState=trackStateForType[type];
  if (trackState == DISABLED_TRACK) {
    player.setRendererEnabled(type,false);
  }
 else   if (multiTrackSources[type] == null) {
    player.setRendererEnabled(type,allowRendererEnable);
  }
 else {
    boolean playWhenReady=player.getPlayWhenReady();
    player.setPlayWhenReady(false);
    player.setRendererEnabled(type,false);
    player.sendMessage(multiTrackSources[type],MultiTrackChunkSource.MSG_SELECT_TRACK,trackState);
    player.setRendererEnabled(type,allowRendererEnable);
    player.setPlayWhenReady(playWhenReady);
  }
}
Program: 116825
Project: 116825
Buggy source:
public ExoplayerWrapper(RendererBuilder rendererBuilder){
  this.rendererBuilder=rendererBuilder;
  player=ExoPlayer.Factory.newInstance(RENDERER_COUNT,1000,5000);
  player.addListener(this);
  playerControl=new ObservablePlayerControl(player);
  mainHandler=new Handler();
  playbackListeners=new CopyOnWriteArrayList<PlaybackListener>();
  lastReportedPlaybackState=ExoPlayer.STATE_IDLE;
  rendererBuildingState=RENDERER_BUILDING_STATE_IDLE;
  trackStateForType=new TrackState[RENDERER_COUNT];
  trackStateForType[TYPE_TEXT]=TrackState.DISABLED;
}

Fixed version (ground truth):
public ExoplayerWrapper(RendererBuilder rendererBuilder){
  this.rendererBuilder=rendererBuilder;
  player=ExoPlayer.Factory.newInstance(RENDERER_COUNT,1000,5000);
  player.addListener(this);
  playerControl=new ObservablePlayerControl(player);
  mainHandler=new Handler();
  playbackListeners=new CopyOnWriteArrayList<PlaybackListener>();
  lastReportedPlaybackState=ExoPlayer.STATE_IDLE;
  rendererBuildingState=RENDERER_BUILDING_STATE_IDLE;
  trackStateForType=new int[RENDERER_COUNT];
  trackStateForType[TYPE_TEXT]=DISABLED_TRACK;
}
Program: 116826
Project: 116826
Buggy source:
@Override public void surfaceCreated(SurfaceHolder surfaceHolder){
  ExoplayerWrapper wrapper=layerManager.getExoplayerWrapper();
  if (wrapper != null) {
    wrapper.setSurface(surfaceHolder.getSurface());
    if (wrapper.getSurface().isValid() || wrapper.getStateForTrackType(ExoplayerWrapper.TYPE_VIDEO) == TrackState.DISABLED) {
      wrapper.setPlayWhenReady(autoplay);
    }
  }
}

Fixed version (ground truth):
@Override public void surfaceCreated(SurfaceHolder surfaceHolder){
  ExoplayerWrapper wrapper=layerManager.getExoplayerWrapper();
  if (wrapper != null) {
    wrapper.setSurface(surfaceHolder.getSurface());
    if (wrapper.getSurface().isValid() || wrapper.getStateForTrackType(ExoplayerWrapper.TYPE_VIDEO) == ExoplayerWrapper.DISABLED_TRACK) {
      wrapper.setPlayWhenReady(autoplay);
    }
  }
}
Program: 116827
Project: 116827
Buggy source:
void socketServerLoop() throws JsonGenerationException, JsonMappingException, IOException {
  BufferedReader br;
  Socket clientSocket=null;
  String commandstr=null;
  initializeSocketServer();
  while (true) {
    commandstr=null;
    try {
      clientSocket=getSocketConnection();
      br=new BufferedReader(new InputStreamReader(new DataInputStream(clientSocket.getInputStream())));
      commandstr=br.readLine();
    }
 catch (    IOException e) {
      e.printStackTrace();
      continue;
    }
    JsonNode result=parseAndRunCommand(commandstr);
    writeResultToStream(result,clientSocket.getOutputStream());
    checkTimings();
  }
}

Fixed version (ground truth):
void socketServerLoop() throws JsonGenerationException, JsonMappingException, IOException {
  BufferedReader br;
  Socket clientSocket=null;
  String commandstr=null;
  initializeSocketServer();
  while (true) {
    commandstr=null;
    try {
      clientSocket=getSocketConnection();
      br=new BufferedReader(new InputStreamReader(new DataInputStream(clientSocket.getInputStream())));
      commandstr=br.readLine();
    }
 catch (    IOException e) {
      e.printStackTrace();
      continue;
    }
    if (commandstr == null) {
      continue;
    }
    JsonNode result=parseAndRunCommand(commandstr);
    writeResultToStream(result,clientSocket.getOutputStream());
    checkTimings();
  }
}
Program: 116828
Project: 116828
Buggy source:
private DBObject populateDocument(DocumentFieldDefinition fd,String document){
  DBObject dbObject=null;
  final String delimiter=fd.getDelimiter();
  if (!StringUtils.isEmpty(delimiter)) {
    String[] documentAsArrray=document.split(delimiter);
    dbObject=new BasicDBObject();
    Map<String,FieldDefinition> documentMapping=new LinkedHashMap<String,FieldDefinition>(fd.getDocumentMapping());
    int i=0;
    for (    Map.Entry<String,FieldDefinition> documentField : documentMapping.entrySet()) {
      if (DOCUMENT_TYPE.equalsIgnoreCase(documentField.getValue().getType().name())) {
        dbObject.put(documentField.getKey(),parseValue(documentField.getValue(),StringUtils.join(Arrays.copyOfRange(documentAsArrray,i,documentAsArrray.length),"String_Node_Str")));
        i+=((DocumentFieldDefinition)documentField.getValue()).getDocumentMapping().size();
      }
 else {
        dbObject.put(documentField.getKey(),parseValue(documentField.getValue(),documentAsArrray[i++]));
      }
    }
  }
 else {
    throw new MongoSinkException("String_Node_Str");
  }
  return dbObject;
}

Fixed version (ground truth):
private DBObject populateDocument(DocumentFieldDefinition fd,String document){
  DBObject dbObject=null;
  final String delimiter=fd.getDelimiter();
  if (!StringUtils.isEmpty(delimiter)) {
    String[] documentAsArrray=document.split(delimiter);
    dbObject=new BasicDBObject();
    Map<String,FieldDefinition> documentMapping=new LinkedHashMap<String,FieldDefinition>(fd.getDocumentMapping());
    int i=0;
    for (    Map.Entry<String,FieldDefinition> documentField : documentMapping.entrySet()) {
      if (DOCUMENT_TYPE.equalsIgnoreCase(documentField.getValue().getType().name())) {
        dbObject.put(documentField.getKey(),parseValue(documentField.getValue(),StringUtils.join(Arrays.copyOfRange(documentAsArrray,i,documentAsArrray.length),fd.getDelimiter())));
        i+=((DocumentFieldDefinition)documentField.getValue()).getDocumentMapping().size();
      }
 else {
        dbObject.put(documentField.getKey(),parseValue(documentField.getValue(),documentAsArrray[i++]));
      }
    }
  }
 else {
    throw new MongoSinkException("String_Node_Str");
  }
  return dbObject;
}
Program: 116829
Project: 116829
Buggy source:
@Before public void setUpES() throws IOException {
  FileUtils.deleteDirectory(new File("String_Node_Str"));
  String jsonMapping=IOUtils.toString(this.getClass().getResourceAsStream(MAPPING_PATH));
  expectedESMapping=trimAllWhitespace("String_Node_Str" + INDEX_TYPE + "String_Node_Str"+ jsonMapping+ "String_Node_Str");
  conf=ConfigFactory.load();
  LOGGER.debug("String_Node_Str" + conf.getStringList("String_Node_Str").toString());
  List<String> elasticSearchHosts=conf.getStringList("String_Node_Str");
  String elasticSearchClusterName=conf.getString("String_Node_Str");
}

Fixed version (ground truth):
@Before public void setUpES() throws IOException {
  FileUtils.deleteDirectory(new File("String_Node_Str"));
  String jsonMapping=IOUtils.toString(this.getClass().getResourceAsStream(MAPPING_PATH));
  expectedESMapping=trimAllWhitespace("String_Node_Str" + INDEX_TYPE + "String_Node_Str"+ jsonMapping+ "String_Node_Str");
  conf=ConfigFactory.load();
  List<String> elasticSearchHosts=conf.getStringList("String_Node_Str");
  String elasticSearchClusterName=conf.getString("String_Node_Str");
}
Program: 116830
Project: 116830
Buggy source:
@Test public void checkProcess() throws EventDeliveryException {
  rest.configure(contextSource);
  rest.start();
  PollableSource.Status status=rest.process();
  rest.stop();
  Assert.assertEquals(status,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void checkProcess() throws EventDeliveryException {
  rest.configure(contextSource);
  rest.start();
  PollableSource.Status status=rest.process();
  rest.stop();
  Assert.assertEquals(status,PollableSource.Status.READY);
}
Program: 116831
Project: 116831
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Status process() throws EventDeliveryException {
  Status status=Status.BACKOFF;
  Transaction transaction=this.getChannel().getTransaction();
  try {
    transaction.begin();
    List<Event> eventList=this.takeEventsFromChannel(this.getChannel(),this.batchSize);
    status=Status.READY;
    if (!eventList.isEmpty()) {
      if (eventList.size() == this.batchSize) {
        this.sinkCounter.incrementBatchCompleteCount();
      }
 else {
        this.sinkCounter.incrementBatchUnderflowCount();
      }
      for (      Event event : eventList) {
        final DBObject document=this.eventParser.parse(event);
        getDBCollection(event).save(document);
      }
      this.sinkCounter.addToEventDrainSuccessCount(eventList.size());
    }
 else {
      this.sinkCounter.incrementBatchEmptyCount();
    }
    transaction.commit();
    status=Status.READY;
  }
 catch (  ChannelException e) {
    e.printStackTrace();
    transaction.rollback();
    status=Status.BACKOFF;
    this.sinkCounter.incrementConnectionFailedCount();
  }
catch (  Throwable t) {
    t.printStackTrace();
    transaction.rollback();
    status=Status.BACKOFF;
    if (t instanceof Error) {
      throw new MongoSinkException(t);
    }
  }
 finally {
    transaction.close();
  }
  return status;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Status process() throws EventDeliveryException {
  Status status=Status.BACKOFF;
  Transaction transaction=this.getChannel().getTransaction();
  log.debug("String_Node_Str");
  try {
    transaction.begin();
    List<Event> eventList=this.takeEventsFromChannel(this.getChannel(),this.batchSize);
    status=Status.BACKOFF;
    if (!eventList.isEmpty()) {
      if (eventList.size() == this.batchSize) {
        this.sinkCounter.incrementBatchCompleteCount();
      }
 else {
        this.sinkCounter.incrementBatchUnderflowCount();
      }
      for (      Event event : eventList) {
        final DBObject document=this.eventParser.parse(event);
        getDBCollection(event).save(document);
      }
      this.sinkCounter.addToEventDrainSuccessCount(eventList.size());
    }
 else {
      this.sinkCounter.incrementBatchEmptyCount();
    }
    transaction.commit();
    status=Status.READY;
  }
 catch (  ChannelException e) {
    log.error("String_Node_Str",e);
    transaction.rollback();
    status=Status.BACKOFF;
    this.sinkCounter.incrementConnectionFailedCount();
  }
catch (  Throwable t) {
    log.error("String_Node_Str",t);
    transaction.rollback();
    status=Status.BACKOFF;
    if (t instanceof Error) {
      throw new MongoSinkException(t);
    }
  }
 finally {
    transaction.close();
  }
  return status;
}
Program: 116832
Project: 116832
Buggy source:
@Before public void setUpES() throws IOException {
  FileUtils.deleteDirectory(new File("String_Node_Str"));
  String jsonMapping=IOUtils.toString(this.getClass().getResourceAsStream(MAPPING_PATH));
  expectedESMapping=trimAllWhitespace("String_Node_Str" + INDEX_TYPE + "String_Node_Str"+ jsonMapping+ "String_Node_Str");
  conf=ConfigFactory.load();
  LOGGER.debug("String_Node_Str" + conf.getString("String_Node_Str").toString());
  String elasticSearchHosts=conf.getString("String_Node_Str");
  String elasticSearchClusterName=conf.getString("String_Node_Str");
}

Fixed version (ground truth):
@Before public void setUpES() throws IOException {
  FileUtils.deleteDirectory(new File("String_Node_Str"));
  String jsonMapping=IOUtils.toString(this.getClass().getResourceAsStream(MAPPING_PATH));
  expectedESMapping=trimAllWhitespace("String_Node_Str" + INDEX_TYPE + "String_Node_Str"+ jsonMapping+ "String_Node_Str");
  conf=ConfigFactory.load();
  LOGGER.debug("String_Node_Str" + conf.getStringList("String_Node_Str").toString());
  List<String> elasticSearchHosts=conf.getStringList("String_Node_Str");
  String elasticSearchClusterName=conf.getString("String_Node_Str");
}
Program: 116834
Project: 116834
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void start(){
  this.jobDetail=JobBuilder.newJob(RequestJob.class).withIdentity(DEFAULT_JOBNAME).build();
  Trigger trigger=TriggerBuilder.newTrigger().withIdentity(DEFAULT_JOBNAME).withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(frequency).repeatForever()).build();
  try {
    scheduler=new StdSchedulerFactory().getScheduler();
    scheduler.getContext().put("String_Node_Str",client);
    scheduler.getContext().put("String_Node_Str",queue);
    scheduler.getContext().put("String_Node_Str",properties);
    scheduler.getContext().put("String_Node_Str",restSourceHandler);
    scheduler.getContext().put("String_Node_Str",urlHandler);
    scheduler.start();
    scheduler.scheduleJob(jobDetail,trigger);
  }
 catch (  SchedulerException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void start(){
  this.jobDetail=JobBuilder.newJob(RequestJob.class).withIdentity(DEFAULT_JOBNAME).build();
  Trigger trigger=TriggerBuilder.newTrigger().withIdentity(DEFAULT_JOBNAME).withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(frequency).repeatForever()).build();
  try {
    scheduler=new StdSchedulerFactory().getScheduler();
    scheduler.getContext().put("String_Node_Str",client);
    scheduler.getContext().put("String_Node_Str",queue);
    scheduler.getContext().put("String_Node_Str",properties);
    scheduler.getContext().put("String_Node_Str",restSourceHandler);
    scheduler.getContext().put("String_Node_Str",urlHandler);
    scheduler.start();
    scheduler.scheduleJob(jobDetail,trigger);
  }
 catch (  SchedulerException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
}
Program: 116835
Project: 116835
Buggy source:
private UrlHandler initUrlHandler(Context context){
  UrlHandler handler=null;
  try {
    handler=(UrlHandler)Class.forName((String)properties.get("String_Node_Str")).newInstance();
    handler.configure(context);
  }
 catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
  return handler;
}

Fixed version (ground truth):
private UrlHandler initUrlHandler(Context context){
  UrlHandler handler=null;
  try {
    handler=(UrlHandler)Class.forName((String)properties.get(URL_HANDLER)).newInstance();
    handler.configure(context);
  }
 catch (  InstantiationException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
catch (  IllegalAccessException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
catch (  ClassNotFoundException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
  return handler;
}
Program: 116836
Project: 116836
Buggy source:
/** 
 * Look at the queue and poll and   {@code Event}
 * @return an {@code Event} or null if is empty.
 */
private Event poll(){
  if (!queue.isEmpty()) {
    return queue.poll();
  }
 else {
    try {
      Thread.sleep(frequency * 1000);
    }
 catch (    InterruptedException e) {
      e.printStackTrace();
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Look at the queue and poll and   {@code Event}
 * @return an {@code Event} or null if is empty.
 */
private Event poll(){
  if (!queue.isEmpty()) {
    return queue.poll();
  }
 else {
    try {
      Thread.sleep(frequency * 1000);
    }
 catch (    InterruptedException e) {
      log.error("String_Node_Str" + e.getMessage());
    }
  }
  return null;
}
Program: 116837
Project: 116837
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void stop(){
  client.destroy();
  try {
    scheduler.interrupt(jobDetail.getKey());
  }
 catch (  UnableToInterruptJobException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void stop(){
  client.destroy();
  try {
    scheduler.interrupt(jobDetail.getKey());
  }
 catch (  UnableToInterruptJobException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
}
Program: 116838
Project: 116838
Buggy source:
private RestSourceHandler initRestSourceHandler(Context context){
  RestSourceHandler handler=null;
  try {
    handler=(RestSourceHandler)Class.forName((String)properties.get(CONF_HANDLER)).newInstance();
    handler.configure(context);
  }
 catch (  InstantiationException e) {
    e.printStackTrace();
  }
catch (  IllegalAccessException e) {
    e.printStackTrace();
  }
catch (  ClassNotFoundException e) {
    e.printStackTrace();
  }
  return handler;
}

Fixed version (ground truth):
private RestSourceHandler initRestSourceHandler(Context context){
  RestSourceHandler handler=null;
  try {
    handler=(RestSourceHandler)Class.forName((String)properties.get(CONF_HANDLER)).newInstance();
    handler.configure(context);
  }
 catch (  InstantiationException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
catch (  IllegalAccessException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
catch (  ClassNotFoundException e) {
    log.error("String_Node_Str" + e.getMessage());
  }
  return handler;
}
Program: 116839
Project: 116839
Buggy source:
@Test public void test() throws EventDeliveryException, UnsupportedEncodingException {
  Transaction tx=channel.getTransaction();
  tx.begin();
  ObjectNode jsonBody=new ObjectNode(JsonNodeFactory.instance);
  jsonBody.put("String_Node_Str","String_Node_Str");
  jsonBody.put("String_Node_Str",32);
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  Event event=EventBuilder.withBody(jsonBody.toString().getBytes(Charsets.UTF_8),headers);
  channel.put(event);
  tx.commit();
  tx.close();
  kafkaSink.process();
  kafka.api.FetchRequest req=new FetchRequestBuilder().clientId(CLIENT_ID).addFetch("String_Node_Str",0,0L,100).build();
  FetchResponse fetchResponse=simpleConsumer.fetch(req);
  ByteBufferMessageSet messageSet=fetchResponse.messageSet("String_Node_Str",0);
  Assert.assertTrue(messageSet.sizeInBytes() > 0);
  for (  MessageAndOffset messageAndOffset : messageSet) {
    ByteBuffer payload=messageAndOffset.message().payload();
    byte[] bytes=new byte[payload.limit()];
    payload.get(bytes);
    String message=new String(bytes,"String_Node_Str");
    Assert.assertNotNull(message);
    Assert.assertEquals(message,"String_Node_Str");
  }
}

Fixed version (ground truth):
@Test public void test() throws EventDeliveryException, UnsupportedEncodingException {
  Transaction tx=channel.getTransaction();
  tx.begin();
  ObjectNode jsonBody=new ObjectNode(JsonNodeFactory.instance);
  jsonBody.put("String_Node_Str","String_Node_Str");
  jsonBody.put("String_Node_Str",32);
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  headers.put("String_Node_Str","String_Node_Str");
  Event event=EventBuilder.withBody(jsonBody.toString().getBytes(Charsets.UTF_8),headers);
  channel.put(event);
  tx.commit();
  tx.close();
  kafkaSink.process();
  kafka.api.FetchRequest req=new FetchRequestBuilder().clientId(CLIENT_ID).addFetch("String_Node_Str",0,0L,100).build();
  FetchResponse fetchResponse=simpleConsumer.fetch(req);
  ByteBufferMessageSet messageSet=fetchResponse.messageSet("String_Node_Str",0);
  for (  MessageAndOffset messageAndOffset : messageSet) {
    ByteBuffer payload=messageAndOffset.message().payload();
    byte[] bytes=new byte[payload.limit()];
    payload.get(bytes);
    String message=new String(bytes,"String_Node_Str");
    Assert.assertNotNull(message);
    Assert.assertEquals(message,"String_Node_Str");
  }
}
Program: 116840
Project: 116840
Buggy source:
/** 
 * Loads the context configured in the parameter 'checkpointConfiguration'
 * @param context
 * @return
 * @throws Exception
 */
private Map<String,String> loadCheckpointContext(Map<String,String> context){
  Map<String,String> checkpointContext=null;
  JsonNode jsonNode;
  final String string=context.get(FILTER_CONF);
  if (StringUtils.isNotBlank(string)) {
    try {
      File checkpointFile=new File(context.get(FILTER_CONF));
      if (checkpointFile.exists()) {
        checkpointContext=new HashMap<String,String>();
        ObjectMapper mapper=new ObjectMapper();
        jsonNode=mapper.readTree(checkpointFile);
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
      }
 else {
        throw new RestSourceException("String_Node_Str");
      }
    }
 catch (    Exception e) {
      throw new RestSourceException("String_Node_Str",e);
    }
  }
  return checkpointContext;
}

Fixed version (ground truth):
/** 
 * Loads the context configured in the parameter 'checkpointConfiguration'
 * @param context
 * @return
 * @throws Exception
 */
protected Map<String,String> loadCheckpointContext(Map<String,String> context){
  Map<String,String> checkpointContext=null;
  JsonNode jsonNode;
  final String string=context.get(FILTER_CONF);
  if (StringUtils.isNotBlank(string)) {
    try {
      File checkpointFile=new File(string);
      if (checkpointFile.exists()) {
        checkpointContext=new HashMap<String,String>();
        ObjectMapper mapper=new ObjectMapper();
        jsonNode=mapper.readTree(checkpointFile);
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
        checkpointContext.put("String_Node_Str",jsonNode.findValue("String_Node_Str").asText());
      }
 else {
        throw new RestSourceException("String_Node_Str");
      }
    }
 catch (    Exception e) {
      throw new RestSourceException("String_Node_Str",e);
    }
  }
  return checkpointContext;
}
Program: 116841
Project: 116841
Buggy source:
@Override public List<Event> getEvents(String body,Map<String,String> headers){
  List<Event> events=new ArrayList<Event>(0);
  ObjectMapper mapper=new ObjectMapper();
  try {
    JsonNode jsonNode=mapper.readTree(body);
    if (jsonNode.isObject()) {
      events.add(buildSingleEvent(headers,findValue(jsonNode,path)));
    }
    if (jsonNode.isArray()) {
      final Iterator<JsonNode> elements=jsonNode.getElements();
      JsonNode element;
      while (elements.hasNext()) {
        element=elements.next();
        events.add(buildSingleEvent(headers,findValue(element,path)));
      }
    }
  }
 catch (  Exception e) {
    throw new RestSourceException("String_Node_Str",e);
  }
  return events;
}

Fixed version (ground truth):
@Override public List<Event> getEvents(String body,Map<String,String> headers){
  List<Event> events=new ArrayList<Event>(0);
  ObjectMapper mapper=new ObjectMapper();
  try {
    JsonNode jsonNode=mapper.readTree(body);
    if (jsonNode.isObject()) {
      events.add(buildSingleEvent(headers,findValue(jsonNode,path)));
    }
    if (jsonNode.isArray()) {
      final Iterator<JsonNode> elements=jsonNode.getElements();
      JsonNode element;
      while (elements.hasNext()) {
        element=elements.next();
        events.add(buildSingleEvent(headers,findValue(element,path)));
      }
    }
  }
 catch (  Exception e) {
    LOG.warn("String_Node_Str" + body);
  }
  return events;
}
Program: 116843
Project: 116843
Buggy source:
/** 
 * Map raw Json to an object and add each key-value to a headers request.
 * @param request Current REST request.
 * @param jsonHeaders raw json.
 * @return
 */
private Builder addHeaders(Builder request,String jsonHeaders){
  ObjectMapper mapper=new ObjectMapper();
  try {
    Map<String,Object> headers=mapper.readValue(jsonHeaders,Map.class);
    for (    Map.Entry<String,Object> entry : headers.entrySet()) {
      request.header(entry.getKey(),entry.getKey());
    }
  }
 catch (  JsonParseException e) {
    e.printStackTrace();
  }
catch (  JsonMappingException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return request;
}

Fixed version (ground truth):
/** 
 * Map raw Json to an object and add each key-value to a headers request.
 * @param request Current REST request.
 * @param jsonHeaders raw json.
 * @return
 */
private Builder addHeaders(Builder request,String jsonHeaders){
  ObjectMapper mapper=new ObjectMapper();
  try {
    Map<String,Object> headers=mapper.readValue(jsonHeaders,Map.class);
    for (    Map.Entry<String,Object> entry : headers.entrySet()) {
      request.header(entry.getKey(),entry.getValue());
    }
  }
 catch (  JsonParseException e) {
    e.printStackTrace();
  }
catch (  JsonMappingException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return request;
}
Program: 116844
Project: 116844
Buggy source:
/** 
 * Initialize properties that are received in the   {@code SchedulerContext}.
 * @param context
 */
@SuppressWarnings("String_Node_Str") public void initProperties(SchedulerContext context){
  queue=(LinkedBlockingQueue<Event>)context.get("String_Node_Str");
  properties=(Map<String,Object>)context.get("String_Node_Str");
  client=(Client)context.get("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Initialize properties that are received in the   {@code SchedulerContext}.
 * @param context
 */
@SuppressWarnings("String_Node_Str") public void initProperties(SchedulerContext context){
  queue=(LinkedBlockingQueue<Event>)context.get("String_Node_Str");
  properties=(Map<String,String>)context.get("String_Node_Str");
  client=(Client)context.get("String_Node_Str");
}
Program: 116845
Project: 116845
Buggy source:
/** 
 * Set an Application Type to the request depending on a parameter and its corresponding  {@code MediaType}.
 * @param targetURL Current target url.
 * @param applicationType ApplicationType to set.
 * @return
 */
public Builder setApplicationType(WebTarget targetURL,String applicationType){
  Builder builder=null;
  if ("String_Node_Str".equals(applicationType)) {
    mediaType=MediaType.TEXT_PLAIN_TYPE;
  }
 else {
    mediaType=MediaType.APPLICATION_JSON_TYPE;
  }
  builder=targetURL.request(mediaType);
  return builder;
}

Fixed version (ground truth):
/** 
 * Set an Application Type to the request depending on a parameter and its corresponding  {@code MediaType}.
 * @param targetURL Current target url.
 * @param applicationType ApplicationType to set.
 * @return
 */
public Builder setApplicationType(WebTarget targetURL,String applicationType){
  Builder builder;
  if ("String_Node_Str".equals(applicationType)) {
    mediaType=MediaType.TEXT_PLAIN_TYPE;
  }
 else {
    mediaType=MediaType.APPLICATION_JSON_TYPE;
  }
  builder=targetURL.request(mediaType);
  return builder;
}
Program: 116846
Project: 116846
Buggy source:
/** 
 * {@inheritDoc}
 * @param context
 */
@Override public void execute(JobExecutionContext context) throws JobExecutionException {
  SchedulerContext schedulerContext=null;
  try {
    schedulerContext=context.getScheduler().getContext();
    initProperties(schedulerContext);
    WebTarget target=client.target((String)properties.get(URL));
    Builder request=setApplicationType(target,(String)properties.get(APPLICATION_TYPE));
    request=addHeaders(request,(String)properties.get(HEADERS));
    Response response=null;
    final String method=(String)properties.get(METHOD);
    if ("String_Node_Str".equals(method)) {
      response=request.post(Entity.entity((String)properties.get(APPLICATION_TYPE),mediaType));
    }
 else {
      response=request.get();
    }
    if (response != null) {
      String responseString=response.readEntity(String.class);
      queue.add(EventBuilder.withBody(responseString,Charsets.UTF_8));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @param context
 */
@Override public void execute(JobExecutionContext context) throws JobExecutionException {
  this.context=context;
  SchedulerContext schedulerContext=null;
  try {
    log.debug("String_Node_Str");
    schedulerContext=context.getScheduler().getContext();
    initProperties(schedulerContext);
    WebTarget target=client.target(properties.get(URL));
    Builder request=setApplicationType(target,properties.get(APPLICATION_TYPE));
    request=addHeaders(request,properties.get(HEADERS));
    Response response=null;
    final String method=properties.get(METHOD);
    if ("String_Node_Str".equals(method)) {
      response=request.post(Entity.entity(properties.get(APPLICATION_TYPE),mediaType));
    }
 else {
      response=request.get();
    }
    if (response != null) {
      String responseString=response.readEntity(String.class);
      queue.add(EventBuilder.withBody(responseString,Charsets.UTF_8,responseToHeaders(response.getStringHeaders())));
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 116847
Project: 116847
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void stop(){
  client.close();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void stop(){
  client.close();
  try {
    scheduler.interrupt(jobDetail.getKey());
  }
 catch (  UnableToInterruptJobException e) {
    e.printStackTrace();
  }
}
Program: 116848
Project: 116848
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void start(){
  client=ClientBuilder.newClient();
  JobDetail job=JobBuilder.newJob(RequestJob.class).withIdentity(DEFAULT_JOBNAME).build();
  Trigger trigger=TriggerBuilder.newTrigger().withIdentity(DEFAULT_JOBNAME).withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(frequency).repeatForever()).build();
  Scheduler scheduler;
  try {
    scheduler=new StdSchedulerFactory().getScheduler();
    scheduler.getContext().put("String_Node_Str",client);
    scheduler.getContext().put("String_Node_Str",queue);
    scheduler.getContext().put("String_Node_Str",properties);
    scheduler.start();
    scheduler.scheduleJob(job,trigger);
  }
 catch (  SchedulerException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void start(){
  this.jobDetail=JobBuilder.newJob(RequestJob.class).withIdentity(DEFAULT_JOBNAME).build();
  Trigger trigger=TriggerBuilder.newTrigger().withIdentity(DEFAULT_JOBNAME).withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(frequency).repeatForever()).build();
  try {
    scheduler=new StdSchedulerFactory().getScheduler();
    scheduler.getContext().put("String_Node_Str",client);
    scheduler.getContext().put("String_Node_Str",queue);
    scheduler.getContext().put("String_Node_Str",properties);
    scheduler.start();
    scheduler.scheduleJob(jobDetail,trigger);
  }
 catch (  SchedulerException e) {
    e.printStackTrace();
  }
}
Program: 116849
Project: 116849
Buggy source:
/** 
 * {@inheritDoc}
 * @param context
 */
@Override public void configure(Context context){
  frequency=context.getInteger(CONF_FREQUENCY,DEFAULT_FREQUENCY);
  properties.put(CONF_URL,context.getString(CONF_URL));
  properties.put(CONF_METHOD,context.getString(CONF_METHOD,DEFAULT_METHOD).toUpperCase());
  properties.put(CONF_APPLICATION_TYPE,context.getString(CONF_APPLICATION_TYPE,DEFAULT_APPLICATION_TYPE).toUpperCase());
  properties.put(CONF_HEADERS,context.getString(CONF_HEADERS,DEFAULT_HEADERS));
  properties.put(CONF_BODY,context.getString(CONF_BODY,DEFAULT_BODY));
  if (queue != null) {
    log.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @param context
 */
@Override public void configure(Context context){
  frequency=context.getInteger(CONF_FREQUENCY,DEFAULT_FREQUENCY);
  properties.put(CONF_URL,context.getString(CONF_URL));
  properties.put(CONF_METHOD,context.getString(CONF_METHOD,DEFAULT_METHOD).toUpperCase());
  properties.put(CONF_APPLICATION_TYPE,context.getString(CONF_APPLICATION_TYPE,DEFAULT_APPLICATION_TYPE).toUpperCase());
  properties.put(CONF_HEADERS,context.getString(CONF_HEADERS,DEFAULT_HEADERS));
  properties.put(CONF_BODY,context.getString(CONF_BODY,DEFAULT_BODY));
}
Program: 116850
Project: 116850
Buggy source:
@Override public void reset() throws IOException {
  ensureOpen();
  int index=markIt.previousIndex();
  currentIt=index >= 0 ? list.listIterator(markIt.previousIndex()) : list.listIterator(0);
  currentIt.next();
}

Fixed version (ground truth):
@Override public void reset() throws IOException {
  ensureOpen();
  int index=markIt.previousIndex();
  currentIt=index >= 0 ? list.listIterator(markIt.previousIndex()) : list.listIterator(0);
  if (currentIt.hasNext()) {
    currentIt.next();
  }
}
Program: 116851
Project: 116851
Buggy source:
@Override public void mark() throws IOException {
  ensureOpen();
  int index=currentIt.previousIndex();
  markIt=index >= 0 ? list.listIterator(currentIt.previousIndex()) : list.listIterator(0);
  markIt.next();
}

Fixed version (ground truth):
@Override public void mark() throws IOException {
  ensureOpen();
  int index=currentIt.previousIndex();
  markIt=index >= 0 ? list.listIterator(currentIt.previousIndex()) : list.listIterator(0);
  if (markIt.hasNext()) {
    markIt.next();
  }
}
Program: 116852
Project: 116852
Buggy source:
@Override public Object getMetadata(){
  return null;
}

Fixed version (ground truth):
@Override public Object getMetadata(){
  try {
    Object[] ports=_state.snapshot().keySet().toArray();
    return PersistentVector.create(ports);
  }
 catch (  IOException ex) {
    throw new RuntimeException(ex);
  }
}
Program: 116855
Project: 116855
Buggy source:
@Override public void processProperties(KrollDict d){
  if (d.containsKey(PROPERTY_LEFT_VIEW)) {
    Object leftView=d.get(PROPERTY_LEFT_VIEW);
    if (leftView != null && leftView instanceof TiViewProxy) {
      if (leftView instanceof WindowProxy)       throw new IllegalStateException("String_Node_Str");
      this.leftView=(TiViewProxy)leftView;
      this.menu.addView(this.leftView.getOrCreateView().getOuterView());
    }
 else {
      Log.e(TAG,"String_Node_Str");
    }
  }
  if (d.containsKey(PROPERTY_CENTER_VIEW)) {
    Object centerView=d.get(PROPERTY_CENTER_VIEW);
    if (centerView != null && centerView instanceof TiViewProxy) {
      if (centerView instanceof WindowProxy)       throw new IllegalStateException("String_Node_Str");
      this.centerView=(TiViewProxy)centerView;
      this.content.addView(this.centerView.getOrCreateView().getOuterView());
    }
 else {
      Log.e(TAG,"String_Node_Str");
    }
  }
  if (d.containsKey(PROPERTY_LEFT_VIEW_WIDTH)) {
    menuWidth=getDevicePixels(d.get(PROPERTY_LEFT_VIEW_WIDTH));
    Log.e(TAG,"String_Node_Str" + d.get(PROPERTY_LEFT_VIEW_WIDTH) + "String_Node_Str"+ menuWidth);
    menu.getLayoutParams().width=menuWidth;
  }
  super.processProperties(d);
}

Fixed version (ground truth):
@Override public void processProperties(KrollDict d){
  if (d.containsKey(PROPERTY_LEFT_VIEW)) {
    Object leftView=d.get(PROPERTY_LEFT_VIEW);
    if (leftView != null && leftView instanceof TiViewProxy) {
      if (leftView instanceof WindowProxy)       throw new IllegalStateException("String_Node_Str");
      this.leftView=(TiViewProxy)leftView;
      this.menu.addView(this.leftView.getOrCreateView().getOuterView());
    }
 else {
      Log.e(TAG,"String_Node_Str");
    }
  }
  if (d.containsKey(PROPERTY_CENTER_VIEW)) {
    Object centerView=d.get(PROPERTY_CENTER_VIEW);
    if (centerView != null && centerView instanceof TiViewProxy) {
      if (centerView instanceof WindowProxy)       throw new IllegalStateException("String_Node_Str");
      this.centerView=(TiViewProxy)centerView;
      this.content.addView(this.centerView.getOrCreateView().getOuterView());
    }
 else {
      Log.e(TAG,"String_Node_Str");
    }
  }
  if (d.containsKey(PROPERTY_LEFT_VIEW_WIDTH)) {
    menuWidth=getDevicePixels(d.get(PROPERTY_LEFT_VIEW_WIDTH));
    Log.d(TAG,"String_Node_Str" + d.get(PROPERTY_LEFT_VIEW_WIDTH) + "String_Node_Str"+ menuWidth);
    menu.getLayoutParams().width=menuWidth;
  }
  super.processProperties(d);
}
Program: 116856
Project: 116856
Buggy source:
Php_srl_itm_ary Parse_array(int bgn,int subs_len){
  Php_srl_itm_ary rv=factory.Ary(bgn,bgn);
  for (int i=0; i < subs_len; i++) {
    Php_srl_itm_kv kv=factory.Kv();
    Php_srl_itm key_itm=Parse_itm(pos);
    kv.Key_(key_itm);
    Php_srl_itm val_itm=Parse_itm(pos);
    kv.Val_(val_itm);
    rv.Subs_add(kv);
  }
  return rv;
}

Fixed version (ground truth):
Php_srl_itm_ary Parse_array(int bgn,int subs_len){
  Php_srl_itm_ary rv=factory.Ary(bgn,bgn);
  for (int i=0; i < subs_len; i++) {
    Php_srl_itm_kv kv=factory.Kv();
    Php_srl_itm key_itm=Parse_itm(pos);
    if (key_itm.Tid() == Php_srl_itm_.Tid_string && String_.Eq(Php_srl_parser.NULL_ARRAY_ITEM,(String)key_itm.Val())) {
      rv.Subs_add(null);
      continue;
    }
    kv.Key_(key_itm);
    Php_srl_itm val_itm=Parse_itm(pos);
    kv.Val_(val_itm);
    rv.Subs_add(kv);
  }
  return rv;
}
Program: 116857
Project: 116857
Buggy source:
Keyval Xto_kv(Php_srl_itm_kv itm){
  Php_srl_itm itm_key=itm.Key();
  Object key=itm_key == null ? null : itm_key.Val();
  Php_srl_itm itm_val=itm.Val();
  Object val=null;
switch (itm_val.Tid()) {
case Php_srl_itm_.Tid_array:
    Php_srl_itm_ary ary=(Php_srl_itm_ary)itm_val;
  val=Xto_kv_ary(ary);
break;
case Php_srl_itm_.Tid_function:
val=new gplx.xowa.xtns.scribunto.Scrib_lua_proc(Object_.Xto_str_strict_or_null_mark(key),Int_.Cast(itm_val.Val()));
break;
default :
val=itm_val.Val();
break;
}
return Keyval_.obj_(key,val);
}

Fixed version (ground truth):
Keyval Xto_kv(Php_srl_itm_kv itm){
  if (itm == null)   return null;
  Php_srl_itm itm_key=itm.Key();
  Object key=itm_key == null ? null : itm_key.Val();
  Php_srl_itm itm_val=itm.Val();
  Object val=null;
switch (itm_val.Tid()) {
case Php_srl_itm_.Tid_array:
    Php_srl_itm_ary ary=(Php_srl_itm_ary)itm_val;
  val=Xto_kv_ary(ary);
break;
case Php_srl_itm_.Tid_function:
val=new gplx.xowa.xtns.scribunto.Scrib_lua_proc(Object_.Xto_str_strict_or_null_mark(key),Int_.Cast(itm_val.Val()));
break;
default :
val=itm_val.Val();
break;
}
return Keyval_.obj_(key,val);
}