nus-yam/ex-repair huggingface dataset:
Program: 9772
Project: 9772
Buggy source:
/** 
 * Initialize Logback, including setting the web app root system property.
 * @param servletContext the current ServletContext
 * @see org.springframework.web.util.WebUtils#setWebAppRootSystemProperty
 */
public static void initLogging(ServletContext servletContext){
  if (exposeWebAppRoot(servletContext)) {
    WebUtils.setWebAppRootSystemProperty(servletContext);
  }
  String location=servletContext.getInitParameter(CONFIG_LOCATION_PARAM);
  if (location != null) {
    try {
      if (!ResourceUtils.isUrl(location)) {
        location=SystemPropertyUtils.resolvePlaceholders(location);
        location=WebUtils.getRealPath(servletContext,location);
      }
      servletContext.log("String_Node_Str" + location + "String_Node_Str");
      LogbackConfigurer.initLogging(location);
    }
 catch (    FileNotFoundException ex) {
      throw new IllegalArgumentException("String_Node_Str" + ex.getMessage());
    }
catch (    JoranException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
  try {
    Class<?> julBridge=ClassUtils.forName("String_Node_Str",ClassUtils.getDefaultClassLoader());
    Method install=ReflectionUtils.findMethod(julBridge,"String_Node_Str");
    if (install != null) {
      servletContext.log("String_Node_Str");
      ReflectionUtils.invokeMethod(install,null);
    }
  }
 catch (  ClassNotFoundException ignored) {
    servletContext.log("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Initialize Logback, including setting the web app root system property.
 * @param servletContext the current ServletContext
 * @see org.springframework.web.util.WebUtils#setWebAppRootSystemProperty
 */
public static void initLogging(ServletContext servletContext){
  if (exposeWebAppRoot(servletContext)) {
    WebUtils.setWebAppRootSystemProperty(servletContext);
  }
  String location=servletContext.getInitParameter(CONFIG_LOCATION_PARAM);
  if (location != null) {
    try {
      location=SystemPropertyUtils.resolvePlaceholders(location);
      if (!ResourceUtils.isUrl(location)) {
        location=WebUtils.getRealPath(servletContext,location);
      }
      servletContext.log("String_Node_Str" + location + "String_Node_Str");
      LogbackConfigurer.initLogging(location);
    }
 catch (    FileNotFoundException ex) {
      throw new IllegalArgumentException("String_Node_Str" + ex.getMessage());
    }
catch (    JoranException e) {
      throw new RuntimeException("String_Node_Str",e);
    }
  }
  try {
    Class<?> julBridge=ClassUtils.forName("String_Node_Str",ClassUtils.getDefaultClassLoader());
    Method install=ReflectionUtils.findMethod(julBridge,"String_Node_Str");
    if (install != null) {
      servletContext.log("String_Node_Str");
      ReflectionUtils.invokeMethod(install,null);
    }
  }
 catch (  ClassNotFoundException ignored) {
    servletContext.log("String_Node_Str");
  }
}
Program: 9773
Project: 9773
Buggy source:
@Override public OperableTrigger setExtraPropertiesAfterInstantiation(OperableTrigger trigger,DBObject stored){
  DailyTimeIntervalTriggerImpl t=(DailyTimeIntervalTriggerImpl)trigger;
  Object interval_unit=stored.get(TRIGGER_REPEAT_INTERVAL_UNIT);
  if (interval_unit != null) {
    t.setRepeatCount((Integer)interval_unit);
  }
  Object repeatInterval=stored.get(TRIGGER_REPEAT_INTERVAL);
  if (repeatInterval != null) {
    t.setRepeatInterval((Integer)repeatInterval);
  }
  Object timesTriggered=stored.get(TRIGGER_TIMES_TRIGGERED);
  if (timesTriggered != null) {
    t.setTimesTriggered((Integer)timesTriggered);
  }
  DBObject startTOD=(DBObject)stored.get(TRIGGER_START_TIME_OF_DAY);
  if (startTOD != null) {
    t.setStartTimeOfDay(fromDBObject(startTOD));
  }
  DBObject endTOD=(DBObject)stored.get(TRIGGER_END_TIME_OF_DAY);
  if (endTOD != null) {
    t.setEndTimeOfDay(fromDBObject(endTOD));
  }
  return t;
}

Fixed version (ground truth):
@Override public OperableTrigger setExtraPropertiesAfterInstantiation(OperableTrigger trigger,DBObject stored){
  DailyTimeIntervalTriggerImpl t=(DailyTimeIntervalTriggerImpl)trigger;
  Object interval_unit=stored.get(TRIGGER_REPEAT_INTERVAL_UNIT);
  if (interval_unit != null) {
    t.setRepeatIntervalUnit(DateBuilder.IntervalUnit.valueOf((String)interval_unit));
  }
  Object repeatInterval=stored.get(TRIGGER_REPEAT_INTERVAL);
  if (repeatInterval != null) {
    t.setRepeatInterval((Integer)repeatInterval);
  }
  Object timesTriggered=stored.get(TRIGGER_TIMES_TRIGGERED);
  if (timesTriggered != null) {
    t.setTimesTriggered((Integer)timesTriggered);
  }
  DBObject startTOD=(DBObject)stored.get(TRIGGER_START_TIME_OF_DAY);
  if (startTOD != null) {
    t.setStartTimeOfDay(fromDBObject(startTOD));
  }
  DBObject endTOD=(DBObject)stored.get(TRIGGER_END_TIME_OF_DAY);
  if (endTOD != null) {
    t.setEndTimeOfDay(fromDBObject(endTOD));
  }
  return t;
}
Program: 9774
Project: 9774
Buggy source:
private void ensureIndexes(){
  BasicDBObject keys=new BasicDBObject();
  keys.put(JOB_KEY_NAME,1);
  keys.put(JOB_KEY_GROUP,1);
  jobCollection.ensureIndex(keys,null,true);
  keys=new BasicDBObject();
  keys.put(KEY_NAME,1);
  keys.put(KEY_GROUP,1);
  keys.put(TRIGGER_NEXT_FIRE_TIME,1);
  keys.put(TRIGGER_PREVIOUS_FIRE_TIME,1);
  triggerCollection.ensureIndex(keys,null,true);
  keys=new BasicDBObject();
  keys.put(LOCK_KEY_NAME,1);
  keys.put(LOCK_KEY_GROUP,1);
  locksCollection.ensureIndex(keys,null,true);
  locksCollection.remove(new BasicDBObject(LOCK_INSTANCE_ID,instanceId));
  keys=new BasicDBObject();
  keys.put(CALENDAR_NAME,1);
  calendarCollection.ensureIndex(keys,null,true);
}

Fixed version (ground truth):
private void ensureIndexes(){
  BasicDBObject keys=new BasicDBObject();
  keys.put(JOB_KEY_NAME,1);
  keys.put(JOB_KEY_GROUP,1);
  jobCollection.ensureIndex(keys,null,true);
  keys=new BasicDBObject();
  keys.put(KEY_NAME,1);
  keys.put(KEY_GROUP,1);
  triggerCollection.ensureIndex(keys,null,true);
  keys=new BasicDBObject();
  keys.put(LOCK_KEY_NAME,1);
  keys.put(LOCK_KEY_GROUP,1);
  locksCollection.ensureIndex(keys,null,true);
  locksCollection.remove(new BasicDBObject(LOCK_INSTANCE_ID,instanceId));
  keys=new BasicDBObject();
  keys.put(CALENDAR_NAME,1);
  calendarCollection.ensureIndex(keys,null,true);
}
Program: 9776
Project: 9776
Buggy source:
public void pauseJob(JobKey jobKey) throws JobPersistenceException {
}

Fixed version (ground truth):
public void pauseJob(JobKey jobKey) throws JobPersistenceException {
  throw new UnsupportedOperationException();
}
Program: 9777
Project: 9777
Buggy source:
public Collection<String> pauseTriggers(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException {
}

Fixed version (ground truth):
public Collection<String> pauseTriggers(GroupMatcher<TriggerKey> matcher) throws JobPersistenceException {
  throw new UnsupportedOperationException();
}
Program: 9778
Project: 9778
Buggy source:
public void pauseTrigger(TriggerKey triggerKey) throws JobPersistenceException {
}

Fixed version (ground truth):
public void pauseTrigger(TriggerKey triggerKey) throws JobPersistenceException {
  throw new UnsupportedOperationException();
}
Program: 9779
Project: 9779
Buggy source:
public OperableTrigger retrieveTrigger(TriggerKey triggerKey) throws JobPersistenceException {
  DBObject dbObject=triggerCollection.findOne(keyAsDBObject(triggerKey));
  if (dbObject == null) {
    throw new JobPersistenceException("String_Node_Str" + triggerKey);
  }
  return toTrigger(triggerKey,dbObject);
}

Fixed version (ground truth):
public OperableTrigger retrieveTrigger(TriggerKey triggerKey) throws JobPersistenceException {
  DBObject dbObject=triggerCollection.findOne(keyAsDBObject(triggerKey));
  if (dbObject == null) {
    return null;
  }
  return toTrigger(triggerKey,dbObject);
}
Program: 9780
Project: 9780
Buggy source:
public void shutdown(){
}

Fixed version (ground truth):
public void shutdown(){
  mongo.close();
}
Program: 9781
Project: 9781
Buggy source:
/** 
 * Called when a file is closed.
 * @param _this {@link FileInputStream},   {@link FileOutputStream}, or   {@link RandomAccessFile}.
 */
public static synchronized void close(Object _this){
  Record r=TABLE.remove(_this);
  if (r != null && TRACE && !tracing) {
    r.dump("String_Node_Str",System.err);
    tracing=true;
    r.dump("String_Node_Str",System.err);
    tracing=false;
  }
}

Fixed version (ground truth):
/** 
 * Called when a file is closed.
 * @param _this {@link FileInputStream},   {@link FileOutputStream}, or   {@link RandomAccessFile}.
 */
public static synchronized void close(Object _this){
  Record r=TABLE.remove(_this);
  if (r != null && TRACE && !tracing) {
    tracing=true;
    r.dump("String_Node_Str",System.err);
    tracing=false;
  }
}
Program: 9783
Project: 9783
Buggy source:
private JRDesignBand getPositionBand(DJChart djChart){
  JRDesignGroup jgroup=getGroupFromColumnsGroup(djChart.getColumnsGroup());
  JRDesignGroup parentGroup=getParent(jgroup);
  JRDesignBand band;
  if (djChart.getOptions().getPosition() == DJChartOptions.POSITION_FOOTER)   band=(JRDesignBand)((parentGroup.equals(jgroup)) ? getDesign().getSummary() : parentGroup.getGroupFooter());
 else   band=(JRDesignBand)((parentGroup.equals(jgroup)) ? getDesign().getSummary() : parentGroup.getGroupHeader());
  return band;
}

Fixed version (ground truth):
private JRDesignBand getPositionBand(DJChart djChart){
  JRDesignGroup jgroup=getGroupFromColumnsGroup(djChart.getColumnsGroup());
  JRDesignGroup parentGroup=getParent(jgroup);
  JRDesignBand band;
  if (djChart.getOptions().getPosition() == DJChartOptions.POSITION_FOOTER) {
    band=(JRDesignBand)((parentGroup.equals(jgroup)) ? getDesign().getSummary() : parentGroup.getGroupFooter());
  }
 else {
    band=(JRDesignBand)((parentGroup.equals(jgroup)) ? getDesign().getSummary() : parentGroup.getGroupHeader());
  }
  return band;
}
Program: 9784
Project: 9784
Buggy source:
private JRDesignChart createChart(DJChart djChart){
  JRDesignGroup jrGroup=getGroupFromColumnsGroup(djChart.getColumnsGroup());
  JRDesignChart chart=new JRDesignChart(new JRDesignStyle().getDefaultStyleProvider(),djChart.getType());
  chart.setDataset(DataSetFactory.getDataset(djChart.getType(),jrGroup,getParent(jrGroup),registerChartVariable(djChart)));
  interpeterOptions(djChart,chart);
  return chart;
}

Fixed version (ground truth):
private JRDesignChart createChart(DJChart djChart){
  JRDesignGroup jrGroup=getGroupFromColumnsGroup(djChart.getColumnsGroup());
  JRDesignChart chart=new JRDesignChart(new JRDesignStyle().getDefaultStyleProvider(),djChart.getType());
  chart.setDataset(DataSetFactory.getDataset(djChart.getType(),jrGroup,getParent(jrGroup),registerChartVariable(djChart)));
  interpeterOptions(djChart,chart);
  chart.setEvaluationTime(JRExpression.EVALUATION_TIME_REPORT);
  return chart;
}
Program: 9785
Project: 9785
Buggy source:
private void interpeterOptions(DJChart djChart,JRDesignChart chart){
  DJChartOptions options=djChart.getOptions();
  chart.setX(options.getX());
  chart.setY(options.getY());
  if (options.isCentered())   chart.setWidth(getReport().getOptions().getPrintableWidth());
 else   chart.setWidth(options.getWidth());
  chart.setHeight(options.getHeight());
  chart.setShowLegend(options.isShowLegend());
  chart.setBackcolor(options.getBackColor());
  if (djChart.getType() == DJChart.BAR_CHART)   ((JRDesignBarPlot)chart.getPlot()).setShowTickLabels(options.isShowLabels());
}

Fixed version (ground truth):
private void interpeterOptions(DJChart djChart,JRDesignChart chart){
  DJChartOptions options=djChart.getOptions();
  if (options.isCentered())   chart.setWidth(getReport().getOptions().getPrintableWidth());
 else   chart.setWidth(options.getWidth());
  chart.setHeight(options.getHeight());
  chart.setX(options.getX());
  chart.setPadding(10);
  chart.setY(options.getY());
  arrangeBand(djChart,chart);
  chart.setShowLegend(options.isShowLegend());
  chart.setBackcolor(options.getBackColor());
  chart.setBorder(options.getBorder());
  if (djChart.getType() == DJChart.BAR_CHART)   ((JRDesignBarPlot)chart.getPlot()).setShowTickLabels(options.isShowLabels());
}
Program: 9786
Project: 9786
Buggy source:
public DJChartOptions(boolean showLegend,Color backColor,int height,int width,boolean centered,byte position,int y,int x,boolean showLabels){
  super();
  this.showLegend=showLegend;
  this.backColor=backColor;
  this.height=height;
  this.width=width;
  this.centered=centered;
  this.position=position;
  this.y=y;
  this.x=x;
  this.showLabels=showLabels;
}

Fixed version (ground truth):
public DJChartOptions(boolean showLegend,Color backColor,int height,int width,boolean centered,byte position,int y,int x,boolean showLabels,byte border){
  super();
  this.showLegend=showLegend;
  this.backColor=backColor;
  this.height=height;
  this.width=width;
  this.centered=centered;
  this.position=position;
  this.y=y;
  this.x=x;
  this.showLabels=showLabels;
  this.border=border;
}
Program: 9787
Project: 9787
Buggy source:
private DJChartOptions createDefaultOperations(){
  DJChartOptions options=new DJChartOptions(true,Color.white,300,300,true,DJChartOptions.POSITION_FOOTER,20,0,true);
  return options;
}

Fixed version (ground truth):
private DJChartOptions createDefaultOperations(){
  DJChartOptions options=new DJChartOptions(true,Color.white,300,300,true,DJChartOptions.POSITION_HEADER,0,0,true,(byte)1);
  return options;
}
Program: 9789
Project: 9789
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int d=Math.min(measure(widthMeasureSpec),measure(heightMeasureSpec));
  setMeasuredDimension(d,d);
  xPosition=(int)getWidth() / 2;
  yPosition=(int)getWidth() / 2;
  buttonRadius=(int)(d / 2 * 0.25);
  joystickRadius=(int)(d / 2 * 0.75);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  int d=Math.min(measure(widthMeasureSpec),measure(heightMeasureSpec));
  setMeasuredDimension(d,d);
}
Program: 9790
Project: 9790
Buggy source:
/** 
 * Gets the current position within this file. All reads and writes take place at the current file pointer position.
 * @return the current offset in bytes from the beginning of the file.
 * @throws IOException if an error occurs while getting the file pointer of this file.
 */
public long getFilePointer() throws IOException {
  return channel.position();
}

Fixed version (ground truth):
/** 
 * Gets the current position within this file. All reads and writes take place at the current file pointer position.
 * @return the current offset in bytes from the beginning of the file.
 * @throws IOException if an error occurs while getting the file pointer of this file.
 */
public long getFilePointer() throws IOException {
  return fd.position;
}
Program: 9791
Project: 9791
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  return new AlertDialog.Builder(getActivity()).setTitle(getString(R.string.vpn_username_dialog_title)).setView(createConnectView()).setPositiveButton(R.string.vpn_connect_button,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      cb.onSuccess(saveUsername.isChecked(),usernameView.getText(),passwordView.getText());
    }
  }
).create();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  return new AlertDialog.Builder(getActivity()).setTitle(getString(R.string.vpn_username_dialog_title)).setView(createConnectView()).setPositiveButton(R.string.vpn_connect_button,new DialogInterface.OnClickListener(){
    @Override public void onClick(    DialogInterface dialog,    int which){
      ((VpnSettings)getActivity()).doAuthDialogCallback(saveUsername.isChecked(),usernameView.getText().toString(),passwordView.getText().toString());
    }
  }
).create();
}
Program: 9792
Project: 9792
Buggy source:
@Override public void onClick(DialogInterface dialog,int which){
  cb.onSuccess(saveUsername.isChecked(),usernameView.getText(),passwordView.getText());
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  ((VpnSettings)getActivity()).doAuthDialogCallback(saveUsername.isChecked(),usernameView.getText().toString(),passwordView.getText().toString());
}
Program: 9793
Project: 9793
Buggy source:
public void onClick(DialogInterface dialog,int id){
  try {
    cb.call();
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public void onClick(DialogInterface dialog,int which){
  getActivity().finish();
}
Program: 9794
Project: 9794
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  final TextView text=new TextView(context);
  text.setPadding(10,10,10,10);
  text.setMovementMethod(new ScrollingMovementMethod());
  text.setTextIsSelectable(true);
  if (log != null)   for (  String s : log) {
    text.append(s + "String_Node_Str");
  }
 else   text.append("String_Node_Str");
  return new AlertDialog.Builder(context).setTitle(R.string.openvpn_log_dialog_title).setIcon(android.R.drawable.ic_dialog_info).setView(text).create();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  if (savedInstanceState != null)   log=savedInstanceState.getParcelable("String_Node_Str");
  final TextView text=new TextView(getActivity());
  text.setPadding(10,10,10,10);
  text.setMovementMethod(new ScrollingMovementMethod());
  text.setTextIsSelectable(true);
  if (log != null)   for (  String s : log) {
    text.append(s + "String_Node_Str");
  }
 else   text.append("String_Node_Str");
  return new AlertDialog.Builder(getActivity()).setTitle(R.string.openvpn_log_dialog_title).setIcon(android.R.drawable.ic_dialog_info).setView(text).create();
}
Program: 9797
Project: 9797
Buggy source:
private void updateOptionsMenu(){
  if (this.mMenu == null) {
    return;
  }
  MenuItem saveMenuItem=this.mMenu.findItem(R.id.save_menu_id);
  MenuItem shareMenuItem=this.mMenu.findItem(R.id.share_menu_id);
  MenuItem refreshMenuItem=this.mMenu.findItem(R.id.refresh_menu_id);
  MenuItem playVideoMenuItem=this.mMenu.findItem(R.id.play_video_menu_id);
  MenuItem searchTineyeMenuItem=this.mMenu.findItem(R.id.menu_search_tineye_id);
  MenuItem searchGoogleMenuItem=this.mMenu.findItem(R.id.menu_search_google_id);
  MenuItem imageOpsMenuItem=this.mMenu.findItem(R.id.menu_image_operations_id);
  saveMenuItem.setVisible(this.mImageLoaded);
  shareMenuItem.setVisible(this.mImageLoaded);
  refreshMenuItem.setVisible(!this.mImageLoaded);
  if (this.mCurrentImageModel != null) {
    playVideoMenuItem.setVisible(this.mImageLoaded && this.mCurrentImageModel.attachment.isVideo());
    searchTineyeMenuItem.setVisible(this.mCurrentImageModel.attachment.isImage());
    searchGoogleMenuItem.setVisible(this.mCurrentImageModel.attachment.isImage());
    imageOpsMenuItem.setVisible(this.mCurrentImageModel.attachment.isImage());
  }
 else {
    playVideoMenuItem.setVisible(false);
    searchTineyeMenuItem.setVisible(false);
    searchGoogleMenuItem.setVisible(false);
    imageOpsMenuItem.setVisible(false);
  }
}

Fixed version (ground truth):
private void updateOptionsMenu(){
  if (this.mMenu == null) {
    return;
  }
  MenuItem saveMenuItem=this.mMenu.findItem(R.id.save_menu_id);
  MenuItem shareMenuItem=this.mMenu.findItem(R.id.share_menu_id);
  MenuItem refreshMenuItem=this.mMenu.findItem(R.id.refresh_menu_id);
  MenuItem playVideoMenuItem=this.mMenu.findItem(R.id.play_video_menu_id);
  MenuItem searchTineyeMenuItem=this.mMenu.findItem(R.id.menu_search_tineye_id);
  MenuItem searchGoogleMenuItem=this.mMenu.findItem(R.id.menu_search_google_id);
  MenuItem imageOpsMenuItem=this.mMenu.findItem(R.id.menu_image_operations_id);
  saveMenuItem.setVisible(this.mImageLoaded);
  shareMenuItem.setVisible(this.mImageLoaded);
  refreshMenuItem.setVisible(!this.mImageLoaded);
  if (this.mCurrentImageModel != null) {
    boolean isImageUrl=UriUtils.isImageUri(Uri.parse(this.mCurrentImageModel.url));
    boolean isVideoUrl=UriUtils.isWebmUri(Uri.parse(this.mCurrentImageModel.url));
    playVideoMenuItem.setVisible(this.mImageLoaded && isVideoUrl);
    searchTineyeMenuItem.setVisible(isImageUrl);
    searchGoogleMenuItem.setVisible(isImageUrl);
    imageOpsMenuItem.setVisible(isImageUrl);
  }
 else {
    playVideoMenuItem.setVisible(false);
    searchTineyeMenuItem.setVisible(false);
    searchGoogleMenuItem.setVisible(false);
    imageOpsMenuItem.setVisible(false);
  }
}
Program: 9799
Project: 9799
Buggy source:
private void loadImage(ThreadImageModel model,GalleryItemViewBag viewBag){
  if (!model.attachment.isDisplayableInGallery() || (model.attachment.isVideo() && this.mApplicationSettings.isExternalVideoPlayer()) || (model.attachment.isVideo() && Constants.SDK_VERSION < 10)) {
    this.setThumbnail(model.attachment,viewBag);
    return;
  }
  if (this.mCurrentTask != null) {
    this.mCurrentTask.cancel(true);
  }
  this.mImageLoaded=false;
  this.mImageLoadedFile=null;
  this.mCurrentImageModel=model;
  this.mCurrentImageViewBag=viewBag;
  this.updateOptionsMenu();
  Uri uri=Uri.parse(model.url);
  File cachedFile=this.mCacheDirectoryManager.getCachedImageFileForRead(uri);
  if (cachedFile.exists()) {
    this.setProgress(Window.PROGRESS_END);
    this.setImage(cachedFile,viewBag);
  }
 else {
    File writeCachedFile=this.mCacheDirectoryManager.getCachedImageFileForWrite(uri);
    this.mCurrentTask=new DownloadFileTask(this,uri,writeCachedFile,new ImageDownloadView(viewBag),false);
    this.mCurrentTask.execute();
  }
}

Fixed version (ground truth):
private void loadImage(ThreadImageModel model,GalleryItemViewBag viewBag){
  if (UriUtils.isWebmUri(Uri.parse(model.url)) && this.mApplicationSettings.isExternalVideoPlayer()) {
    if (model.attachment != null) {
      this.setThumbnail(model.attachment,viewBag);
    }
 else {
      viewBag.switchToErrorView(this.getString(R.string.error_video_playing));
    }
    return;
  }
  if (this.mCurrentTask != null) {
    this.mCurrentTask.cancel(true);
  }
  this.mImageLoaded=false;
  this.mImageLoadedFile=null;
  this.mCurrentImageModel=model;
  this.mCurrentImageViewBag=viewBag;
  this.updateOptionsMenu();
  Uri uri=Uri.parse(model.url);
  File cachedFile=this.mCacheDirectoryManager.getCachedImageFileForRead(uri);
  if (cachedFile.exists()) {
    this.setProgress(Window.PROGRESS_END);
    this.setImage(cachedFile,viewBag);
  }
 else {
    File writeCachedFile=this.mCacheDirectoryManager.getCachedImageFileForWrite(uri);
    this.mCurrentTask=new DownloadFileTask(this,uri,writeCachedFile,new ImageDownloadView(viewBag),false);
    this.mCurrentTask.execute();
  }
}
Program: 9800
Project: 9800
Buggy source:
private void setImage(File file,GalleryItemViewBag viewBag){
  if (this.mCurrentImageModel.attachment.isImage()) {
    AppearanceUtils.setImage(file,this,viewBag.layout,ImageGalleryActivity.this.mBackgroundColor);
  }
 else   if (this.mCurrentImageModel.attachment.isVideo()) {
    AppearanceUtils.setVideoFile(file,this,viewBag);
  }
  this.mImageLoaded=true;
  this.mImageLoadedFile=file;
  this.updateOptionsMenu();
}

Fixed version (ground truth):
private void setImage(File file,GalleryItemViewBag viewBag){
  if (UriUtils.isImageUri(Uri.fromFile(file))) {
    AppearanceUtils.setImage(file,this,viewBag.layout,ImageGalleryActivity.this.mBackgroundColor);
  }
 else   if (UriUtils.isWebmUri(Uri.fromFile(file))) {
    AppearanceUtils.setVideoFile(file,this,viewBag);
  }
  this.mImageLoaded=true;
  this.mImageLoadedFile=file;
  this.updateOptionsMenu();
}
Program: 9801
Project: 9801
Buggy source:
@Override public void updateData(String from,PostModel[] posts){
  if (posts == null) {
    showToastIfVisible(PostsListActivity.this.getResources().getString(R.string.notification_no_new_posts));
    return;
  }
  int addedCount=PostsListActivity.this.mAdapter.updateAdapterData(from,posts);
  if (addedCount != 0) {
    mSerializationService.serializePosts(mWebsite.name(),mBoardName,mThreadNumber,mAdapter.getOriginalPosts());
    showToastIfVisible(PostsListActivity.this.getResources().getQuantityString(R.plurals.data_new_posts_quantity,addedCount,addedCount));
  }
 else {
    showToastIfVisible(PostsListActivity.this.getResources().getString(R.string.notification_no_new_posts));
  }
}

Fixed version (ground truth):
@Override public void updateData(int from,PostModel[] posts){
  if (posts == null) {
    showToastIfVisible(PostsListActivity.this.getResources().getString(R.string.notification_no_new_posts));
    return;
  }
  int addedCount=PostsListActivity.this.mAdapter.updateAdapterData(from,posts);
  if (addedCount != 0) {
    mSerializationService.serializePosts(mWebsite.name(),mBoardName,mThreadNumber,mAdapter.getOriginalPosts());
    showToastIfVisible(PostsListActivity.this.getResources().getQuantityString(R.plurals.data_new_posts_quantity,addedCount,addedCount));
  }
 else {
    showToastIfVisible(PostsListActivity.this.getResources().getString(R.string.notification_no_new_posts));
  }
}
Program: 9802
Project: 9802
Buggy source:
/** 
 * Возвращает номер последнего сообщения 
 */
public String getLastPostNumber(){
  return this.mPostsViewModel.getLastPostNumber();
}

Fixed version (ground truth):
/** 
 * Возвращает номер последнего сообщения 
 */
public int getLastPostNumber(){
  return this.mPostsViewModel.getLastPostNumber();
}
Program: 9803
Project: 9803
Buggy source:
public int updateAdapterData(String from,PostModel[] posts){
  Integer lastPostNumber;
  try {
    lastPostNumber=!StringUtils.isEmpty(from) ? Integer.valueOf(from) : 0;
  }
 catch (  NumberFormatException e) {
    lastPostNumber=0;
  }
  ArrayList<PostModel> newPosts=new ArrayList<PostModel>();
  for (  PostModel pi : posts) {
    Integer currentNumber=!StringUtils.isEmpty(pi.getNumber()) ? Integer.parseInt(pi.getNumber()) : 0;
    if (currentNumber > lastPostNumber) {
      newPosts.add(pi);
    }
  }
  List<PostItemViewModel> newModels=this.mPostsViewModel.addModels(newPosts,this.mTheme,this,this.mActivity.getResources());
  for (  PostItemViewModel model : newModels) {
    for (int i=0; i < 4; ++i) {
      AttachmentInfo attachment=model.getAttachment(i);
      this.mThreadImagesService.addThreadImage(this.mUri,attachment);
    }
    this.insert(model,this.getCount() - 1);
  }
  this.mOriginalPosts.addAll(newPosts);
  if (newPosts.size() > 0) {
    this.notifyDataSetChanged();
  }
  return newPosts.size();
}

Fixed version (ground truth):
public int updateAdapterData(int from,PostModel[] posts){
  ArrayList<PostModel> newPosts=new ArrayList<PostModel>();
  for (  PostModel pi : posts) {
    Integer currentNumber=!StringUtils.isEmpty(pi.getNumber()) ? Integer.parseInt(pi.getNumber()) : 0;
    if (currentNumber > from) {
      newPosts.add(pi);
    }
  }
  List<PostItemViewModel> newModels=this.mPostsViewModel.addModels(newPosts,this.mTheme,this,this.mActivity.getResources());
  for (  PostItemViewModel model : newModels) {
    for (int i=0; i < 4; ++i) {
      AttachmentInfo attachment=model.getAttachment(i);
      this.mThreadImagesService.addThreadImage(this.mUri,attachment);
    }
    this.insert(model,this.getCount() - 1);
  }
  this.mOriginalPosts.addAll(newPosts);
  if (newPosts.size() > 0) {
    this.notifyDataSetChanged();
  }
  return newPosts.size();
}
Program: 9804
Project: 9804
Buggy source:
@Override protected Boolean doInBackground(String... params){
  if (params.length > 0) {
    this.mLoadAfterPost=params[0];
  }
 else {
    this.mLoadAfterPost=null;
  }
  try {
    this.mPostsList=this.mJsonReader.readPostsList(this.mBoard,this.mThreadNumber,this.mLoadAfterPost,this.mIsCheckModified,this,this);
    return true;
  }
 catch (  Exception e) {
    this.mUserError=e.getMessage();
  }
  return false;
}

Fixed version (ground truth):
@Override protected Boolean doInBackground(Integer... params){
  if (params.length > 0) {
    this.mLoadAfterPost=params[0];
  }
  try {
    this.mPostsList=this.mJsonReader.readPostsList(this.mBoard,this.mThreadNumber,this.mLoadAfterPost,this.mIsCheckModified,this,this);
    return true;
  }
 catch (  Exception e) {
    this.mUserError=e.getMessage();
  }
  return false;
}
Program: 9805
Project: 9805
Buggy source:
@Override public PostModel[] readPostsList(String boardName,String threadNumber,String fromNumber,boolean checkModified,IJsonProgressChangeListener listener,ICancelled task) throws JsonApiReaderException, HtmlNotJsonException {
  String uri=this.mFourchanUriBuilder.getThreadUrlApi(boardName,threadNumber);
  JsonNode json=this.mJsonReader.readData(uri,checkModified,listener,task);
  if (json == null) {
    return null;
  }
  FourchanThreadInfo result=parseDataOrThrowError(json,FourchanThreadInfo.class);
  PostModel[] models=this.mFourchanModelsMapper.mapThreadModel(result).getPosts();
  return models;
}

Fixed version (ground truth):
@Override public PostModel[] readPostsList(String boardName,String threadNumber,int fromNumber,boolean checkModified,IJsonProgressChangeListener listener,ICancelled task) throws JsonApiReaderException, HtmlNotJsonException {
  String uri=this.mFourchanUriBuilder.getThreadUrlApi(boardName,threadNumber);
  JsonNode json=this.mJsonReader.readData(uri,checkModified,listener,task);
  if (json == null) {
    return null;
  }
  FourchanThreadInfo result=parseDataOrThrowError(json,FourchanThreadInfo.class);
  PostModel[] models=this.mFourchanModelsMapper.mapThreadModel(result).getPosts();
  return models;
}
Program: 9806
Project: 9806
Buggy source:
@Override public PostModel[] readPostsList(String boardName,String threadNumber,String fromNumber,boolean checkModified,IJsonProgressChangeListener listener,ICancelled task) throws JsonApiReaderException, HtmlNotJsonException {
  String uri=this.mApplicationSettings.isMobileApi() ? this.mMakabaUriBuilder.getThreadUrlExtendedApi(boardName,threadNumber,fromNumber) : this.mMakabaUriBuilder.getThreadUrlApi(boardName,threadNumber);
  JsonNode json=this.mJsonReader.readData(uri,checkModified,listener,task);
  if (json == null) {
    return null;
  }
  MakabaPostInfo[] data=null;
  if (this.mApplicationSettings.isMobileApi()) {
    data=this.parseDataOrThrowError(json,MakabaPostInfo[].class);
  }
 else {
    data=this.parseDataOrThrowError(json,MakabaThreadsList.class).threads[0].posts;
  }
  PostModel[] models=this.mMakabaModelsMapper.mapPostModels(data);
  return models;
}

Fixed version (ground truth):
@Override public PostModel[] readPostsList(String boardName,String threadNumber,int fromNumber,boolean checkModified,IJsonProgressChangeListener listener,ICancelled task) throws JsonApiReaderException, HtmlNotJsonException {
  boolean isExtendedUrl=this.mApplicationSettings.isMobileApi() && fromNumber != 0;
  String uri=isExtendedUrl ? this.mMakabaUriBuilder.getThreadUrlExtendedApi(boardName,threadNumber,fromNumber + "String_Node_Str") : this.mMakabaUriBuilder.getThreadUrlApi(boardName,threadNumber);
  JsonNode json=this.mJsonReader.readData(uri,checkModified,listener,task);
  if (json == null) {
    return null;
  }
  MakabaPostInfo[] data=null;
  if (isExtendedUrl) {
    data=this.parseDataOrThrowError(json,MakabaPostInfo[].class);
  }
 else {
    data=this.parseDataOrThrowError(json,MakabaThreadsList.class).threads[0].posts;
  }
  PostModel[] models=this.mMakabaModelsMapper.mapPostModels(data);
  return models;
}
Program: 9807
Project: 9807
Buggy source:
PostModel[] readPostsList(String boardName,String threadNumber,String fromNumber,boolean checkModified,IJsonProgressChangeListener listener,ICancelled task) throws JsonApiReaderException, HtmlNotJsonException ;

Fixed version (ground truth):
PostModel[] readPostsList(String boardName,String threadNumber,int fromNumber,boolean checkModified,IJsonProgressChangeListener listener,ICancelled task) throws JsonApiReaderException, HtmlNotJsonException ;
Program: 9808
Project: 9808
Buggy source:
/** 
 * Вызывается в случае успешной загрузки данных при частичном обновлении
 * @param from Пост, с которого начинается список ответов
 * @param list Список ответов
 */
void updateData(String from,PostModel[] posts);

Fixed version (ground truth):
/** 
 * Вызывается в случае успешной загрузки данных при частичном обновлении
 * @param from Пост, с которого начинается список ответов
 * @param posts Список ответов
 */
void updateData(int from,PostModel[] posts);
Program: 9809
Project: 9809
Buggy source:
public boolean isVideo(){
  return "String_Node_Str".equalsIgnoreCase(this.mSourceExtension);
}

Fixed version (ground truth):
public boolean isVideo(){
  return this.mImageUrl != null && UriUtils.isWebmUri(Uri.parse(this.mImageUrl));
}
Program: 9810
Project: 9810
Buggy source:
public boolean isImage(){
  return !StringUtils.isEmpty(this.mSourceExtension) && Constants.IMAGE_EXTENSIONS.contains(this.mSourceExtension);
}

Fixed version (ground truth):
public boolean isImage(){
  return this.mImageUrl != null && UriUtils.isImageUri(Uri.parse(this.mImageUrl));
}
Program: 9811
Project: 9811
Buggy source:
/** 
 * Возвращает номер последнего сообщения в треде
 */
public String getLastPostNumber(){
  return this.mLastPostNumber;
}

Fixed version (ground truth):
/** 
 * Возвращает номер последнего сообщения в треде
 */
public int getLastPostNumber(){
  return this.mLastPostNumber;
}
Program: 9812
Project: 9812
Buggy source:
private PostItemViewModel addModel(PostModel item,Theme theme,IURLSpanClickListener listener){
  PostItemViewModel viewModel=new PostItemViewModel(this.mWebsite,this.mBoardName,this.mThreadNumber,this.mViewModels.size(),item,theme,listener);
  this.mViewModels.put(viewModel.getNumber(),viewModel);
  this.mLastPostNumber=viewModel.getNumber();
  this.processReferences(viewModel);
  return viewModel;
}

Fixed version (ground truth):
private PostItemViewModel addModel(PostModel item,Theme theme,IURLSpanClickListener listener){
  PostItemViewModel viewModel=new PostItemViewModel(this.mWebsite,this.mBoardName,this.mThreadNumber,this.mViewModels.size(),item,theme,listener);
  this.mViewModels.put(viewModel.getNumber(),viewModel);
  this.mLastPostNumber=Math.max(Integer.parseInt(viewModel.getNumber()),this.mLastPostNumber);
  this.processReferences(viewModel);
  return viewModel;
}
Program: 9813
Project: 9813
Buggy source:
public boolean isExternalVideoPlayer(){
  return this.mSettings.getBoolean(this.mResources.getString(R.string.pref_external_video_key),false);
}

Fixed version (ground truth):
public boolean isExternalVideoPlayer(){
  return Constants.SDK_VERSION < 10 || this.mSettings.getBoolean(this.mResources.getString(R.string.pref_external_video_key),false);
}
Program: 9814
Project: 9814
Buggy source:
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  width=MeasureSpec.getSize(widthMeasureSpec);
  height=MeasureSpec.getSize(heightMeasureSpec);
  float scaleX=(float)width / (float)bmWidth;
  float scaleY=(float)height / (float)bmHeight;
  float scale=Math.min(scaleX,scaleY);
  defaultScale=Math.min(cDefaultScale,scale);
  defaultScale*=3;
  minScale=Math.min(cMinScale,scale) / defaultScale;
  maxScale=cMaxScale / defaultScale;
  matrix.setScale(defaultScale,defaultScale);
  setImageMatrix(matrix);
  saveScale=1f;
  redundantYSpace=(float)height - (defaultScale * (float)bmHeight);
  redundantXSpace=(float)width - (defaultScale * (float)bmWidth);
  redundantYSpace/=(float)2;
  redundantXSpace/=(float)2;
  matrix.postTranslate(redundantXSpace,redundantYSpace);
  origWidth=width - 2 * redundantXSpace;
  origHeight=height - 2 * redundantYSpace;
  right=width * saveScale - width - (2 * redundantXSpace * saveScale);
  bottom=height * saveScale - height - (2 * redundantYSpace * saveScale);
  setImageMatrix(matrix);
}

Fixed version (ground truth):
@Override protected void onMeasure(int widthMeasureSpec,int heightMeasureSpec){
  super.onMeasure(widthMeasureSpec,heightMeasureSpec);
  width=MeasureSpec.getSize(widthMeasureSpec);
  height=MeasureSpec.getSize(heightMeasureSpec);
  float scaleX=(float)width / (float)bmWidth;
  float scaleY=(float)height / (float)bmHeight;
  float scale=Math.min(scaleX,scaleY);
  defaultScale=Math.min(cDefaultScale,scale);
  minScale=Math.min(cMinScale,scale) / defaultScale;
  maxScale=cMaxScale / defaultScale;
  matrix.setScale(defaultScale,defaultScale);
  setImageMatrix(matrix);
  saveScale=1f;
  redundantYSpace=(float)height - (defaultScale * (float)bmHeight);
  redundantXSpace=(float)width - (defaultScale * (float)bmWidth);
  redundantYSpace/=(float)2;
  redundantXSpace/=(float)2;
  matrix.postTranslate(redundantXSpace,redundantYSpace);
  origWidth=width - 2 * redundantXSpace;
  origHeight=height - 2 * redundantYSpace;
  right=width * saveScale - width - (2 * redundantXSpace * saveScale);
  bottom=height * saveScale - height - (2 * redundantYSpace * saveScale);
  setImageMatrix(matrix);
}
Program: 9815
Project: 9815
Buggy source:
private boolean getDiscardNextActionUp(){
  if (this.mEditor == null) {
    return false;
  }
  try {
    return this.mDiscardNextActionUpField.getBoolean(this.mEditor);
  }
 catch (  Exception e) {
    return false;
  }
}

Fixed version (ground truth):
private boolean getDiscardNextActionUp(){
  if (this.mBaseEditor == null) {
    return false;
  }
  try {
    return this.mDiscardNextActionUpField.getBoolean(this.mBaseEditor);
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 9816
Project: 9816
Buggy source:
private boolean checkLinksOnTouch(MotionEvent event){
  this.copyBaseEditorIfNecessary();
  int action=event.getAction() & 0xff;
  boolean discardNextActionUp=this.getDiscardNextActionUp();
  final boolean superResult=super.onTouchEvent(event);
  MyLog.v(TAG,"String_Node_Str" + superResult);
  if (discardNextActionUp && action == MotionEvent.ACTION_UP) {
    MyLog.v(TAG,"String_Node_Str");
    return superResult;
  }
  final boolean touchIsFinished=(action == MotionEvent.ACTION_UP) && !this.getIgnoreActionUpEvent() && isFocused();
  if (touchIsFinished) {
    Spannable spannable=(Spannable)this.getText();
    int x=(int)event.getX();
    int y=(int)event.getY();
    x-=this.getTotalPaddingLeft();
    y-=this.getTotalPaddingTop();
    x+=this.getScrollX();
    y+=this.getScrollY();
    Layout layout=this.getLayout();
    int line=layout.getLineForVertical(y);
    int off=layout.getOffsetForHorizontal(line,x);
    ClickableSpan[] link=spannable.getSpans(off,off,ClickableSpan.class);
    if (link.length != 0) {
      link[0].onClick(this);
      return true;
    }
  }
  return superResult;
}

Fixed version (ground truth):
private boolean checkLinksOnTouch(MotionEvent event){
  this.copyBaseEditorIfNecessary();
  int action=event.getAction() & 0xff;
  boolean discardNextActionUp=this.getDiscardNextActionUp();
  final boolean superResult=super.onTouchEvent(event);
  if (discardNextActionUp && action == MotionEvent.ACTION_UP) {
    return superResult;
  }
  final boolean touchIsFinished=(action == MotionEvent.ACTION_UP) && !this.getIgnoreActionUpEvent() && isFocused();
  if (touchIsFinished) {
    Spannable spannable=(Spannable)this.getText();
    int x=(int)event.getX();
    int y=(int)event.getY();
    x-=this.getTotalPaddingLeft();
    y-=this.getTotalPaddingTop();
    x+=this.getScrollX();
    y+=this.getScrollY();
    Layout layout=this.getLayout();
    int line=layout.getLineForVertical(y);
    int off=layout.getOffsetForHorizontal(line,x);
    ClickableSpan[] link=spannable.getSpans(off,off,ClickableSpan.class);
    if (link.length != 0) {
      link[0].onClick(this);
      return true;
    }
  }
  return superResult;
}
Program: 9817
Project: 9817
Buggy source:
private boolean getIgnoreActionUpEvent(){
  if (this.mEditor == null) {
    return false;
  }
  try {
    return this.mIgnoreActionUpEventField.getBoolean(this.mEditor);
  }
 catch (  Exception e) {
    return false;
  }
}

Fixed version (ground truth):
private boolean getIgnoreActionUpEvent(){
  if (this.mBaseEditor == null) {
    return false;
  }
  try {
    return this.mIgnoreActionUpEventField.getBoolean(this.mBaseEditor);
  }
 catch (  Exception e) {
    return false;
  }
}
Program: 9818
Project: 9818
Buggy source:
private final void copyBaseEditorIfNecessary(){
  if (this.mEditorCreated) {
    return;
  }
  try {
    Field field=TextView.class.getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    this.mEditor=field.get(this);
    if (this.mEditor != null) {
      this.mDiscardNextActionUpField=this.mEditor.getClass().getDeclaredField("String_Node_Str");
      this.mDiscardNextActionUpField.setAccessible(true);
      this.mIgnoreActionUpEventField=this.mEditor.getClass().getDeclaredField("String_Node_Str");
      this.mIgnoreActionUpEventField.setAccessible(true);
    }
  }
 catch (  Exception e) {
    MyLog.e(TAG,e);
  }
 finally {
    this.mEditorCreated=true;
  }
}

Fixed version (ground truth):
private void copyBaseEditorIfNecessary(){
  if (this.mBaseEditorCopied) {
    return;
  }
  try {
    Field field=TextView.class.getDeclaredField("String_Node_Str");
    field.setAccessible(true);
    this.mBaseEditor=field.get(this);
    if (this.mBaseEditor != null) {
      Class editorClass=this.mBaseEditor.getClass();
      this.mDiscardNextActionUpField=editorClass.getDeclaredField("String_Node_Str");
      this.mDiscardNextActionUpField.setAccessible(true);
      this.mIgnoreActionUpEventField=editorClass.getDeclaredField("String_Node_Str");
      this.mIgnoreActionUpEventField.setAccessible(true);
    }
  }
 catch (  Exception e) {
    MyLog.e(TAG,e);
  }
 finally {
    this.mBaseEditorCopied=true;
  }
}
Program: 9819
Project: 9819
Buggy source:
@Override protected void onStart(){
  super.onStart();
  SettingsEntity newSettings=this.mSettings.getCurrentSettings();
  if (this.mCurrentSettings.theme != newSettings.theme) {
    this.resetUI();
    return;
  }
  if (this.mCurrentSettings.isDisplayNavigationBar != newSettings.isDisplayNavigationBar) {
    this.mNavigationBar.setVisibility(newSettings.isDisplayNavigationBar ? View.VISIBLE : View.GONE);
  }
  if (this.mCurrentSettings.isLoadThumbnails != newSettings.isLoadThumbnails) {
    this.mAdapter.notifyDataSetChanged();
  }
  this.mCurrentSettings=this.mSettings.getCurrentSettings();
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  SettingsEntity newSettings=this.mSettings.getCurrentSettings();
  if (this.mCurrentSettings.theme != newSettings.theme) {
    this.finish();
    Intent i=new Intent(this,this.getClass());
    i.putExtra(Constants.EXTRA_PREFER_DESERIALIZED,true);
    this.startActivity(i);
    return;
  }
  if (this.mCurrentSettings.isDisplayNavigationBar != newSettings.isDisplayNavigationBar) {
    this.mNavigationBar.setVisibility(newSettings.isDisplayNavigationBar ? View.VISIBLE : View.GONE);
  }
  if (this.mCurrentSettings.isLoadThumbnails != newSettings.isLoadThumbnails) {
    this.mAdapter.notifyDataSetChanged();
  }
  this.mCurrentSettings=this.mSettings.getCurrentSettings();
}
Program: 9820
Project: 9820
Buggy source:
@Override public PostItemViewModel getItem(int position){
  return this.isStatusView(position) ? null : super.getItem(position);
}

Fixed version (ground truth):
@Override public PostItemViewModel getItem(int position){
  return (position < super.getCount()) ? super.getItem(position) : null;
}
Program: 9821
Project: 9821
Buggy source:
private final boolean hasStatusView(){
  return this.mIsLoadingMore && super.getCount() > 0;
}

Fixed version (ground truth):
private final boolean hasStatusView(){
  return this.mIsLoadingMore;
}
Program: 9822
Project: 9822
Buggy source:
public static void showImageProgressBar(final View indeterminateProgressBar,final ImageView imageView){
  imageView.setVisibility(View.GONE);
  if (indeterminateProgressBar != null) {
    indeterminateProgressBar.setVisibility(View.VISIBLE);
  }
}

Fixed version (ground truth):
public static void showImageProgressBar(final View indeterminateProgressBar,final ImageView imageView){
  imageView.setVisibility(View.INVISIBLE);
  if (indeterminateProgressBar != null) {
    indeterminateProgressBar.setVisibility(View.VISIBLE);
  }
}
Program: 9823
Project: 9823
Buggy source:
@Override public String fromResponse(HttpResponse response){
  try {
    InputStream stream=response.getEntity().getContent();
    ByteArrayOutputStream output=new ByteArrayOutputStream();
    byte data[]=new byte[8192];
    int count;
    while ((count=stream.read(data)) != -1) {
      output.write(data,0,count);
    }
    String result=output.toString(Constants.UTF8_CHARSET.name());
    return result;
  }
 catch (  Exception e) {
    MyLog.e(TAG,e);
  }
 finally {
    ExtendedHttpClient.releaseRequestResponse(null,response);
  }
  return null;
}

Fixed version (ground truth):
@Override public String fromResponse(HttpResponse response){
  try {
    InputStream stream=response.getEntity().getContent();
    String result=IoUtils.convertStreamToString(stream);
    return result;
  }
 catch (  Exception e) {
    MyLog.e(TAG,e);
  }
 finally {
    ExtendedHttpClient.releaseRequestResponse(null,response);
  }
  return null;
}
Program: 9826
Project: 9826
Buggy source:
@Override public SqlBackendConfig apply(String t){
  SqlBackendConfig result=nameToConfig.get(t);
  return result;
}

Fixed version (ground truth):
@Override public SqlBackendConfig apply(String t){
  SqlBackendConfig result=nameToConfig.get(t.toLowerCase());
  return result;
}
Program: 9827
Project: 9827
Buggy source:
public void put(String name,SqlBackendConfig config){
  nameToConfig.put(name,config);
}

Fixed version (ground truth):
public void put(String name,SqlBackendConfig config){
  nameToConfig.put(name.toLowerCase(),config);
}
Program: 9829
Project: 9829
Buggy source:
public boolean stateRestriction(RestrictionManagerImpl rm){
  if (this.isUnsatisfiable()) {
    return false;
  }
  Set<Var> vars=rm.getVariables();
  for (  Var var : vars) {
    RestrictionImpl r=rm.getRestriction(var);
    if (r != null) {
      this.stateRestriction(var,r);
      if (r.isUnsatisfiable()) {
        this.satisfiability=Boolean.FALSE;
        return true;
      }
    }
  }
  if (rm.isUnsatisfiable()) {
    this.satisfiability=Boolean.FALSE;
    return true;
  }
  this.stateCnf(rm.getCnf());
  if (this.isUnsatisfiable()) {
    return true;
  }
  return true;
}

Fixed version (ground truth):
public boolean stateRestriction(RestrictionManagerImpl rm){
  if (this.isUnsatisfiable()) {
    return false;
  }
  if (rm == null) {
    throw new RuntimeException("String_Node_Str");
  }
  Set<Var> vars=rm.getVariables();
  for (  Var var : vars) {
    RestrictionImpl r=rm.getRestriction(var);
    if (r != null) {
      this.stateRestriction(var,r);
      if (r.isUnsatisfiable()) {
        this.satisfiability=Boolean.FALSE;
        return true;
      }
    }
  }
  if (rm.isUnsatisfiable()) {
    this.satisfiability=Boolean.FALSE;
    return true;
  }
  this.stateCnf(rm.getCnf());
  if (this.isUnsatisfiable()) {
    return true;
  }
  return true;
}