nus-yam/ex-repair huggingface dataset:
Program: 29557
Project: 29557
Buggy source:
@SuppressWarnings("String_Node_Str") private static List<NameValuePair> getPostParameterPairs(Map<String,String> postParams){
  List<NameValuePair> result=new ArrayList<NameValuePair>(postParams.size());
  for (  String key : postParams.keySet()) {
    result.add(new BasicNameValuePair(key,postParams.get(key)));
  }
  return result;
}

Fixed version (ground truth):
private static List<NameValuePair> getPostParameterPairs(Map<String,String> postParams){
  List<NameValuePair> result=new ArrayList<NameValuePair>(postParams.size());
  for (  String key : postParams.keySet()) {
    result.add(new BasicNameValuePair(key,postParams.get(key)));
  }
  return result;
}
Program: 29558
Project: 29558
Buggy source:
/** 
 * Performs an HTTP request with the given parameters. <p/> <p>A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, and the Content-Type header is set to request.getPostBodyContentType().</p>
 * @param request the request to perform
 * @return the HTTP response
 */
public HttpResponse performRequest(Request<?> request) throws IOException, AuthFailureError ;

Fixed version (ground truth):
/** 
 * Performs an HTTP request with the given parameters. <p/> <p>A GET request is sent if request.getPostBody() == null. A POST request is sent otherwise, and the Content-Type header is set to request.getPostBodyContentType().</p>
 * @param request the request to perform
 * @return the HTTP response
 */
HttpResponse performRequest(Request<?> request) throws IOException, AuthFailureError ;
Program: 29559
Project: 29559
Buggy source:
/** 
 * Synchronously retrieves an auth token.
 * @throws AuthFailureError If authentication did not succeed
 */
public String getAuthToken() throws AuthFailureError ;

Fixed version (ground truth):
/** 
 * Synchronously retrieves an auth token.
 * @throws AuthFailureError If authentication did not succeed
 */
String getAuthToken() throws AuthFailureError ;
Program: 29560
Project: 29560
Buggy source:
/** 
 * Invalidates the provided auth token.
 */
public void invalidateAuthToken(String authToken);

Fixed version (ground truth):
/** 
 * Invalidates the provided auth token.
 */
void invalidateAuthToken(String authToken);
Program: 29561
Project: 29561
Buggy source:
public void putBitmap(String url,Bitmap bitmap);

Fixed version (ground truth):
void putBitmap(String url,Bitmap bitmap);
Program: 29562
Project: 29562
Buggy source:
private void loadSdcardImage(){
  mNetworkImageView.setImageUrl(SelfImageLoader.RES_SDCARD + "String_Node_Str",mImageLoader);
}

Fixed version (ground truth):
private void loadSdcardImage(){
  mNetworkImageView.setImageUrl(SelfImageLoader.RES_SDCARD + Environment.getExternalStorageDirectory() + "String_Node_Str",mImageLoader);
}
Program: 29563
Project: 29563
Buggy source:
/** 
 * Pause this task when it status was DOWNLOADING, in fact, we just marked the request should be cancel, http request cannot stop immediately, we assume it will finish soon, thus we set the status as PAUSE, let Task Queue deploy a new Request, that will cause parallel tasks growing beyond maximum task count, but it doesn't matter, we believe that situation never longer.
 * @return true if did the pause operation.
 */
public boolean pause(){
  if (mStatus == STATUS_DOWNLOADING) {
    mStatus=STATUS_PAUSE;
    mRequest.cancel();
    schedule();
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Pause this task when it status was DOWNLOADING|WAITING. In fact, we just marked the request should be cancel, http request cannot stop immediately, we assume it will finish soon, thus we set the status as PAUSE, let Task Queue deploy a new Request. That will cause parallel tasks growing beyond maximum task count, but it doesn't matter, we expected that situation never stay longer.
 * @return true if did the pause operation.
 */
public boolean pause(){
switch (mStatus) {
case STATUS_DOWNLOADING:
    mRequest.cancel();
case STATUS_WAITING:
  mStatus=STATUS_PAUSE;
schedule();
return true;
default :
return false;
}
}
Program: 29564
Project: 29564
Buggy source:
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  DownloadTask task=mDownloadList.get(position);
switch (task.controller.getStatus()) {
case FileDownloader.DownloadController.STATUS_DOWNLOADING:
    task.controller.pause();
  task.invalidate();
break;
case FileDownloader.DownloadController.STATUS_PAUSE:
task.controller.resume();
task.invalidate();
break;
}
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> parent,View view,int position,long id){
  DownloadTask task=mDownloadList.get(position);
switch (task.controller.getStatus()) {
case DownloadController.STATUS_DOWNLOADING:
case DownloadController.STATUS_WAITING:
    task.controller.pause();
  task.invalidate();
break;
case DownloadController.STATUS_PAUSE:
task.controller.resume();
task.invalidate();
break;
}
}
Program: 29565
Project: 29565
Buggy source:
private void invalidate(){
  if (btnStatus == null)   return;
  if (!TextUtils.equals((CharSequence)btnStatus.getTag(),storeFileName))   return;
switch (controller.getStatus()) {
case FileDownloader.DownloadController.STATUS_DOWNLOADING:
    if (fileSize > 0 && downloadedSize > 0) {
      btnStatus.setText(DECIMAL_POINT.format(downloadedSize * 1.0f / fileSize * 100) + '%');
    }
 else {
      btnStatus.setText("String_Node_Str");
    }
  break;
case FileDownloader.DownloadController.STATUS_WAITING:
btnStatus.setText("String_Node_Str");
break;
case FileDownloader.DownloadController.STATUS_PAUSE:
btnStatus.setText("String_Node_Str");
break;
case FileDownloader.DownloadController.STATUS_SUCCESS:
btnStatus.setText("String_Node_Str");
break;
}
txvDownloadedSize.setText(Formatter.formatFileSize(FileDownloadActivity.this,downloadedSize));
txvFileSize.setText(Formatter.formatFileSize(FileDownloadActivity.this,fileSize));
}

Fixed version (ground truth):
private void invalidate(){
  if (btnStatus == null)   return;
  if (!TextUtils.equals((CharSequence)btnStatus.getTag(),storeFileName))   return;
switch (controller.getStatus()) {
case DownloadController.STATUS_DOWNLOADING:
    if (fileSize > 0 && downloadedSize > 0) {
      btnStatus.setText(DECIMAL_POINT.format(downloadedSize * 1.0f / fileSize * 100) + '%');
    }
 else {
      btnStatus.setText("String_Node_Str");
    }
  break;
case DownloadController.STATUS_WAITING:
btnStatus.setText("String_Node_Str");
break;
case DownloadController.STATUS_PAUSE:
btnStatus.setText("String_Node_Str");
break;
case DownloadController.STATUS_SUCCESS:
btnStatus.setText("String_Node_Str");
break;
}
txvDownloadedSize.setText(Formatter.formatFileSize(FileDownloadActivity.this,downloadedSize));
txvFileSize.setText(Formatter.formatFileSize(FileDownloadActivity.this,fileSize));
}
Program: 29566
Project: 29566
Buggy source:
/** 
 * The ListView menu is inflated and added to de DrawerLayout
 */
private void configureList(){
}

Fixed version (ground truth):
/** 
 * The ListView menu is inflated and added to de DrawerLayout
 */
private void configureList(){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mListView=(ListView)inflater.inflate(R.layout.navigation_list,this,false);
  mListView.setPadding(mListPaddingLeft,mListPaddingTop,mListPaddingRight,mListPaddingBottom);
  ((DrawerLayout.LayoutParams)mListView.getLayoutParams()).gravity=mDrawerGravity;
  if (mHeaderView != null) {
    setMenuHeader(mHeaderView,mHeaderClickable);
  }
  if (mFooterView != null) {
    setMenuFooter(mFooterView,mFooterClickable);
  }
  addView(mListView);
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int i,    long l){
      if (mHeaderView != null && i == 0 && !mHeaderClickable) {
        return;
      }
      if (mFooterView != null && i == mListView.getCount() - 1 && !mFooterClickable) {
        return;
      }
      check(i);
      if (mSelectionListener != null) {
        mSelectionListener.onSectionSelected(view,i,l);
      }
      if (mShouldChangeTitle && i != 0 && i != mListView.getCount() - 1) {
        CharSequence title=(CharSequence)mListView.getAdapter().getItem(i);
        mActivity.setTitle(title);
      }
      closeDrawerMenu();
    }
  }
);
}
Program: 29567
Project: 29567
Buggy source:
/** 
 * Set custom listener so when a ListView item is clicked, it's also checked
 * @param listener The OnNavigationSectionSelected listener. Use null to disable.
 */
public void setOnNavigationSectionSelected(OnNavigationSectionSelected listener){
  mSelectionListener=listener;
  if (mSelectionListener != null) {
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
      @Override public void onItemClick(      AdapterView<?> adapterView,      View view,      int i,      long l){
        if (mHeaderView != null && i == 0 && !mHeaderClickable) {
          return;
        }
        if (mFooterView != null && i == mListView.getCount() - 1 && !mFooterClickable) {
          return;
        }
        check(i);
        mSelectionListener.onSectionSelected(view,i,l);
        closeDrawerMenu();
      }
    }
);
  }
 else {
    mListView.setOnItemClickListener(null);
  }
}

Fixed version (ground truth):
/** 
 * Set custom listener so when a ListView item is clicked, it's also checked
 * @param listener The OnNavigationSectionSelected listener. Use null to disable.
 */
public void setOnNavigationSectionSelected(OnNavigationSectionSelected listener){
  mSelectionListener=listener;
}
Program: 29568
Project: 29568
Buggy source:
@Override public void onItemClick(AdapterView<?> adapterView,View view,int i,long l){
  if (mHeaderView != null && i == 0 && !mHeaderClickable) {
    return;
  }
  if (mFooterView != null && i == mListView.getCount() - 1 && !mFooterClickable) {
    return;
  }
  check(i);
  mSelectionListener.onSectionSelected(view,i,l);
  closeDrawerMenu();
}

Fixed version (ground truth):
@Override public void onItemClick(AdapterView<?> adapterView,View view,int i,long l){
  if (mHeaderView != null && i == 0 && !mHeaderClickable) {
    return;
  }
  if (mFooterView != null && i == mListView.getCount() - 1 && !mFooterClickable) {
    return;
  }
  check(i);
  if (mSelectionListener != null) {
    mSelectionListener.onSectionSelected(view,i,l);
  }
  closeDrawerMenu();
}
Program: 29569
Project: 29569
Buggy source:
/** 
 * The ListView menu is inflated and added to de DrawerLayout
 */
private void configureList(){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mListView=(ListView)inflater.inflate(R.layout.navigation_list,this,false);
  mListView.setPadding(mListPaddingLeft,mListPaddingTop,mListPaddingRight,mListPaddingBottom);
  ((DrawerLayout.LayoutParams)mListView.getLayoutParams()).gravity=mDrawerGravity;
  if (mHeaderView != null) {
    setMenuHeader(mHeaderView,mHeaderClickable);
  }
  if (mFooterView != null) {
    setMenuFooter(mFooterView,mFooterClickable);
  }
  addView(mListView);
}

Fixed version (ground truth):
/** 
 * The ListView menu is inflated and added to de DrawerLayout
 */
private void configureList(){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mListView=(ListView)inflater.inflate(R.layout.navigation_list,this,false);
  mListView.setPadding(mListPaddingLeft,mListPaddingTop,mListPaddingRight,mListPaddingBottom);
  ((DrawerLayout.LayoutParams)mListView.getLayoutParams()).gravity=mDrawerGravity;
  if (mHeaderView != null) {
    setMenuHeader(mHeaderView,mHeaderClickable);
  }
  if (mFooterView != null) {
    setMenuFooter(mFooterView,mFooterClickable);
  }
  addView(mListView);
  mListView.setOnItemClickListener(new AdapterView.OnItemClickListener(){
    @Override public void onItemClick(    AdapterView<?> adapterView,    View view,    int i,    long l){
      if (mHeaderView != null && i == 0 && !mHeaderClickable) {
        return;
      }
      if (mFooterView != null && i == mListView.getCount() - 1 && !mFooterClickable) {
        return;
      }
      check(i);
      if (mSelectionListener != null) {
        mSelectionListener.onSectionSelected(view,i,l);
      }
      closeDrawerMenu();
    }
  }
);
}
Program: 29570
Project: 29570
Buggy source:
public AudioAnalysisSection createModelObject(JsonObject jsonObject){
  if (jsonObject == null || jsonObject.isJsonNull()) {
    return null;
  }
  return new AudioAnalysisSection.Builder().setKey(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsInt() : null).setKeyConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudness(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setMeasure(hasAndNotNull(jsonObject,"String_Node_Str") ? new AudioAnalysisMeasure.JsonUtil().createModelObject(jsonObject.getAsJsonObject("String_Node_Str")) : null).setMode(hasAndNotNull(jsonObject,"String_Node_Str") ? Modality.keyOf(jsonObject.get("String_Node_Str").getAsInt()) : null).setModeConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setTempo(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setTempoConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setTimeSignature(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsInt() : null).setTimeSignatureConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).build();
}

Fixed version (ground truth):
public AudioAnalysisSection createModelObject(JsonObject jsonObject){
  if (jsonObject == null || jsonObject.isJsonNull()) {
    return null;
  }
  return new AudioAnalysisSection.Builder().setKey(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsInt() : null).setKeyConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudness(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setMeasure((hasAndNotNull(jsonObject,"String_Node_Str") && hasAndNotNull(jsonObject,"String_Node_Str") && hasAndNotNull(jsonObject,"String_Node_Str")) ? new AudioAnalysisMeasure.JsonUtil().createModelObject(jsonObject) : null).setMode(hasAndNotNull(jsonObject,"String_Node_Str") ? Modality.keyOf(jsonObject.get("String_Node_Str").getAsInt()) : null).setModeConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setTempo(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setTempoConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setTimeSignature(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsInt() : null).setTimeSignatureConfidence(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).build();
}
Program: 29571
Project: 29571
Buggy source:
public AudioAnalysisSegment createModelObject(JsonObject jsonObject){
  if (jsonObject == null || jsonObject.isJsonNull()) {
    return null;
  }
  return new AudioAnalysisSegment.Builder().setLoudnessEnd(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudnessMax(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudnessMaxTime(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudnessStart(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setMeasure(hasAndNotNull(jsonObject,"String_Node_Str") ? new AudioAnalysisMeasure.JsonUtil().createModelObject(jsonObject.getAsJsonObject("String_Node_Str")) : null).setPitches(hasAndNotNull(jsonObject,"String_Node_Str") ? new Gson().fromJson(jsonObject.getAsJsonArray("String_Node_Str"),float[].class) : null).setTimbre(hasAndNotNull(jsonObject,"String_Node_Str") ? new Gson().fromJson(jsonObject.getAsJsonArray("String_Node_Str"),float[].class) : null).build();
}

Fixed version (ground truth):
public AudioAnalysisSegment createModelObject(JsonObject jsonObject){
  if (jsonObject == null || jsonObject.isJsonNull()) {
    return null;
  }
  return new AudioAnalysisSegment.Builder().setLoudnessEnd(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudnessMax(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudnessMaxTime(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setLoudnessStart(hasAndNotNull(jsonObject,"String_Node_Str") ? jsonObject.get("String_Node_Str").getAsFloat() : null).setMeasure((hasAndNotNull(jsonObject,"String_Node_Str") && hasAndNotNull(jsonObject,"String_Node_Str") && hasAndNotNull(jsonObject,"String_Node_Str")) ? new AudioAnalysisMeasure.JsonUtil().createModelObject(jsonObject) : null).setPitches(hasAndNotNull(jsonObject,"String_Node_Str") ? new Gson().fromJson(jsonObject.getAsJsonArray("String_Node_Str"),float[].class) : null).setTimbre(hasAndNotNull(jsonObject,"String_Node_Str") ? new Gson().fromJson(jsonObject.getAsJsonArray("String_Node_Str"),float[].class) : null).build();
}
Program: 29572
Project: 29572
Buggy source:
/** 
 * Get information about an users available devices.
 * @return A {@link GetUsersAvailableDevices.Builder}.
 */
public GetUsersAvailableDevicesRequest.Builder getUsersAvailableDevices(){
  return new GetUsersAvailableDevicesRequest.Builder(accessToken).setDefaults(httpManager,scheme,host,port);
}

Fixed version (ground truth):
/** 
 * Get information about an users available devices.
 * @return A {@link GetUsersAvailableDevicesRequest.Builder}.
 */
public GetUsersAvailableDevicesRequest.Builder getUsersAvailableDevices(){
  return new GetUsersAvailableDevicesRequest.Builder(accessToken).setDefaults(httpManager,scheme,host,port);
}
Program: 29573
Project: 29573
Buggy source:
@Test public void shouldCreatePlaylist_sync() throws Exception {
  final Api api=Api.builder().accessToken("String_Node_Str").build();
  final PlaylistCreationRequest request=api.createPlaylist("String_Node_Str","String_Node_Str").publicAccess(true).httpManager(TestUtil.MockedHttpManager.returningJson("String_Node_Str")).build();
  final Playlist playlist=request.get();
  assertFalse(playlist.isCollaborative());
  assertNull(playlist.getDescription());
  assertEquals("String_Node_Str",playlist.getExternalUrls().get("String_Node_Str"));
  assertNull(playlist.getFollowers());
  assertEquals("String_Node_Str",playlist.getHref());
  assertEquals("String_Node_Str",playlist.getId());
  assertEquals(1,playlist.getImages().size());
  assertNull(playlist.getImages().get(0));
  assertEquals("String_Node_Str",playlist.getName());
  assertNotNull(playlist.getOwner());
  assertTrue(playlist.isPublicAccess());
  assertNull(playlist.getTracks());
  assertEquals(ObjectType.PLAYLIST,playlist.getType());
  assertEquals("String_Node_Str",playlist.getUri());
}

Fixed version (ground truth):
@Test public void shouldCreatePlaylist_sync() throws Exception {
  final Api api=Api.builder().accessToken("String_Node_Str").build();
  final PlaylistCreationRequest request=api.createPlaylist("String_Node_Str","String_Node_Str").publicAccess(true).httpManager(TestUtil.MockedHttpManager.returningJson("String_Node_Str")).build();
  final Playlist playlist=request.get();
  assertFalse(playlist.getIsCollaborative());
  assertNull(playlist.getDescription());
  assertEquals("String_Node_Str",playlist.getExternalUrls().get("String_Node_Str"));
  assertNull(playlist.getFollowers());
  assertEquals("String_Node_Str",playlist.getHref());
  assertEquals("String_Node_Str",playlist.getId());
  assertEquals(1,playlist.getImages().size());
  assertNull(playlist.getImages().get(0));
  assertEquals("String_Node_Str",playlist.getName());
  assertNotNull(playlist.getOwner());
  assertTrue(playlist.getIsPublicAccess());
  assertNull(playlist.getTracks());
  assertEquals(ObjectType.PLAYLIST,playlist.getType());
  assertEquals("String_Node_Str",playlist.getUri());
}
Program: 29575
Project: 29575
Buggy source:
@Override public void onSuccess(Playlist playlist){
  assertNotNull(playlist);
  assertFalse(playlist.isCollaborative());
  assertNull(playlist.getDescription());
  assertEquals("String_Node_Str",playlist.getExternalUrls().get("String_Node_Str"));
  assertNull(playlist.getFollowers());
  assertEquals("String_Node_Str",playlist.getHref());
  assertEquals("String_Node_Str",playlist.getId());
  assertEquals(1,playlist.getImages().size());
  assertNull(playlist.getImages().get(0));
  assertEquals("String_Node_Str",playlist.getName());
  assertNotNull(playlist.getOwner());
  assertTrue(playlist.isPublicAccess());
  assertNull(playlist.getTracks());
  assertEquals(ObjectType.PLAYLIST,playlist.getType());
  assertEquals("String_Node_Str",playlist.getUri());
  asyncCompleted.countDown();
}

Fixed version (ground truth):
@Override public void onSuccess(Playlist playlist){
  assertNotNull(playlist);
  assertFalse(playlist.getIsCollaborative());
  assertNull(playlist.getDescription());
  assertEquals("String_Node_Str",playlist.getExternalUrls().get("String_Node_Str"));
  assertNull(playlist.getFollowers());
  assertEquals("String_Node_Str",playlist.getHref());
  assertEquals("String_Node_Str",playlist.getId());
  assertEquals(1,playlist.getImages().size());
  assertNull(playlist.getImages().get(0));
  assertEquals("String_Node_Str",playlist.getName());
  assertNotNull(playlist.getOwner());
  assertTrue(playlist.getIsPublicAccess());
  assertNull(playlist.getTracks());
  assertEquals(ObjectType.PLAYLIST,playlist.getType());
  assertEquals("String_Node_Str",playlist.getUri());
  asyncCompleted.countDown();
}
Program: 29577
Project: 29577
Buggy source:
@Test public void shouldGetTracksResult_sync() throws Exception {
  final Api api=Api.DEFAULT_API;
  final TopTracksRequest request=api.getTopTracksForArtist("String_Node_Str","String_Node_Str").httpManager(TestUtil.MockedHttpManager.returningJson("String_Node_Str")).build();
  final List<Track> tracks=request.get();
  assertTrue(tracks.size() > 0);
  Track firstTrack=tracks.get(0);
  assertNotNull(firstTrack.getAlbum());
  assertNotNull(firstTrack.getArtists());
  assertNotNull(firstTrack.getAvailableMarkets());
  assertTrue(firstTrack.getDiscNumber() > 0);
  assertTrue(firstTrack.getDuration() > 0);
  assertNotNull(firstTrack.isExplicit());
  assertNotNull(firstTrack.getExternalIds());
  String id=firstTrack.getId();
  assertNotNull(firstTrack.getId());
  assertEquals("String_Node_Str" + id,firstTrack.getExternalUrls().get("String_Node_Str"));
  assertEquals("String_Node_Str" + id,firstTrack.getHref());
  assertTrue(firstTrack.getPopularity() >= 0 && firstTrack.getPopularity() <= 100);
  assertNotNull(firstTrack.getPreviewUrl());
  assertTrue(firstTrack.getTrackNumber() >= 0);
  assertEquals(ObjectType.TRACK,firstTrack.getType());
  assertEquals("String_Node_Str" + id,firstTrack.getUri());
}

Fixed version (ground truth):
@Test public void shouldGetTracksResult_sync() throws Exception {
  final Api api=Api.DEFAULT_API;
  final TopTracksRequest request=api.getTopTracksForArtist("String_Node_Str","String_Node_Str").httpManager(TestUtil.MockedHttpManager.returningJson("String_Node_Str")).build();
  final List<Track> tracks=request.get();
  assertTrue(tracks.size() > 0);
  Track firstTrack=tracks.get(0);
  assertNotNull(firstTrack.getAlbum());
  assertNotNull(firstTrack.getArtists());
  assertNotNull(firstTrack.getAvailableMarkets());
  assertTrue(firstTrack.getDiscNumber() > 0);
  assertTrue(firstTrack.getDurationMs() > 0);
  assertNotNull(firstTrack.getIsExplicit());
  assertNotNull(firstTrack.getExternalIds());
  String id=firstTrack.getId();
  assertNotNull(firstTrack.getId());
  assertEquals("String_Node_Str" + id,firstTrack.getExternalUrls().get("String_Node_Str"));
  assertEquals("String_Node_Str" + id,firstTrack.getHref());
  assertTrue(firstTrack.getPopularity() >= 0 && firstTrack.getPopularity() <= 100);
  assertNotNull(firstTrack.getPreviewUrl());
  assertTrue(firstTrack.getTrackNumber() >= 0);
  assertEquals(ObjectType.TRACK,firstTrack.getType());
  assertEquals("String_Node_Str" + id,firstTrack.getUri());
}
Program: 29578
Project: 29578
Buggy source:
@Override public void onSuccess(List<Track> tracks){
  assertTrue(tracks.size() > 0);
  Track firstTrack=tracks.get(0);
  assertNotNull(firstTrack.getAlbum());
  assertNotNull(firstTrack.getArtists());
  assertNotNull(firstTrack.getAvailableMarkets());
  assertTrue(firstTrack.getDiscNumber() > 0);
  assertTrue(firstTrack.getDuration() > 0);
  assertNotNull(firstTrack.isExplicit());
  assertNotNull(firstTrack.getExternalIds());
  String id=firstTrack.getId();
  assertNotNull(firstTrack.getId());
  assertEquals("String_Node_Str" + id,firstTrack.getExternalUrls().get("String_Node_Str"));
  assertEquals("String_Node_Str" + id,firstTrack.getHref());
  assertTrue(firstTrack.getPopularity() >= 0 && firstTrack.getPopularity() <= 100);
  assertNotNull(firstTrack.getPreviewUrl());
  assertTrue(firstTrack.getTrackNumber() >= 0);
  assertEquals(ObjectType.TRACK,firstTrack.getType());
  assertEquals("String_Node_Str" + id,firstTrack.getUri());
  asyncCompleted.countDown();
}

Fixed version (ground truth):
@Override public void onSuccess(List<Track> tracks){
  assertTrue(tracks.size() > 0);
  Track firstTrack=tracks.get(0);
  assertNotNull(firstTrack.getAlbum());
  assertNotNull(firstTrack.getArtists());
  assertNotNull(firstTrack.getAvailableMarkets());
  assertTrue(firstTrack.getDiscNumber() > 0);
  assertTrue(firstTrack.getDurationMs() > 0);
  assertNotNull(firstTrack.getIsExplicit());
  assertNotNull(firstTrack.getExternalIds());
  String id=firstTrack.getId();
  assertNotNull(firstTrack.getId());
  assertEquals("String_Node_Str" + id,firstTrack.getExternalUrls().get("String_Node_Str"));
  assertEquals("String_Node_Str" + id,firstTrack.getHref());
  assertTrue(firstTrack.getPopularity() >= 0 && firstTrack.getPopularity() <= 100);
  assertNotNull(firstTrack.getPreviewUrl());
  assertTrue(firstTrack.getTrackNumber() >= 0);
  assertEquals(ObjectType.TRACK,firstTrack.getType());
  assertEquals("String_Node_Str" + id,firstTrack.getUri());
  asyncCompleted.countDown();
}
Program: 29581
Project: 29581
Buggy source:
@Override public void onSuccess(Paging<PlaylistSimplified> playlistsPage){
  assertTrue(playlistsPage.getTotal() >= 0);
  assertNull(playlistsPage.getNext());
  assertEquals("String_Node_Str",playlistsPage.getPrevious());
  assertEquals(10,playlistsPage.getLimit());
  assertEquals(2,playlistsPage.getOffset());
  assertEquals("String_Node_Str",playlistsPage.getHref());
  final PlaylistSimplified simplePlaylist=playlistsPage.getItems().get(0);
  final String playlistId=simplePlaylist.getId();
  assertNotNull(playlistId);
  assertTrue(playlistId.length() > 0);
  assertEquals(false,simplePlaylist.isCollaborative());
  assertEquals("String_Node_Str" + playlistId,simplePlaylist.getExternalUrls().get("String_Node_Str"));
  assertNotNull(simplePlaylist.getName());
  assertNotNull(simplePlaylist.getOwner());
  assertNotNull(simplePlaylist.isPublicAccess());
  assertNotNull(simplePlaylist.getTracks().getHref());
  assertNotNull(simplePlaylist.getTracks().getTotal());
  assertEquals(ObjectType.PLAYLIST,simplePlaylist.getType());
  assertEquals("String_Node_Str" + playlistId,simplePlaylist.getUri());
  assertEquals(1,simplePlaylist.getImages().size());
  assertEquals("String_Node_Str",simplePlaylist.getImages().get(0).getUrl());
  assertNull(simplePlaylist.getImages().get(0).getWidth());
  assertNull(simplePlaylist.getImages().get(0).getHeight());
  asyncCompleted.countDown();
}

Fixed version (ground truth):
@Override public void onSuccess(Paging<PlaylistSimplified> playlistsPage){
  assertTrue(playlistsPage.getTotal() >= 0);
  assertNull(playlistsPage.getNext());
  assertEquals("String_Node_Str",playlistsPage.getPrevious());
  assertEquals(10,playlistsPage.getLimit());
  assertEquals(2,playlistsPage.getOffset());
  assertEquals("String_Node_Str",playlistsPage.getHref());
  final PlaylistSimplified simplePlaylist=playlistsPage.getItems().get(0);
  final String playlistId=simplePlaylist.getId();
  assertNotNull(playlistId);
  assertTrue(playlistId.length() > 0);
  assertEquals(false,simplePlaylist.getIsCollaborative());
  assertEquals("String_Node_Str" + playlistId,simplePlaylist.getExternalUrls().get("String_Node_Str"));
  assertNotNull(simplePlaylist.getName());
  assertNotNull(simplePlaylist.getOwner());
  assertNotNull(simplePlaylist.getIsPublicAccess());
  assertNotNull(simplePlaylist.getTracks().getHref());
  assertNotNull(simplePlaylist.getTracks().getTotal());
  assertEquals(ObjectType.PLAYLIST,simplePlaylist.getType());
  assertEquals("String_Node_Str" + playlistId,simplePlaylist.getUri());
  assertEquals(1,simplePlaylist.getImages().size());
  assertEquals("String_Node_Str",simplePlaylist.getImages().get(0).getUrl());
  assertNull(simplePlaylist.getImages().get(0).getWidth());
  assertNull(simplePlaylist.getImages().get(0).getHeight());
  asyncCompleted.countDown();
}
Program: 29582
Project: 29582
Buggy source:
public static String assemble(UtilProtos.Url url){
  try {
    if (!url.getPath().contains("String_Node_Str")) {
      final URIBuilder uriBuilder=new URIBuilder();
      URI uri=uriBuilder.build();
      return uri.toString();
    }
 else {
      final URI uri=new URI(SCHEME_NAMES.get(url.getScheme()),null,url.getHost(),url.getPort(),null,null,null);
      return uri.toString() + url.getPath();
    }
  }
 catch (  Throwable e) {
    throw new IllegalStateException(e);
  }
}

Fixed version (ground truth):
public static String assemble(UtilProtos.Url url){
  try {
    if (!url.getPath().contains("String_Node_Str")) {
      final URIBuilder uriBuilder=new URIBuilder();
      final URI uri=new URIBuilder().setScheme(SCHEME_NAMES.get(url.getScheme())).setPath(url.getPath()).setHost(url.getHost()).setPort(url.getPort()).build();
      return uri.toString();
    }
 else {
      final URI uri=new URI(SCHEME_NAMES.get(url.getScheme()),null,url.getHost(),url.getPort(),null,null,null);
      return uri.toString() + url.getPath();
    }
  }
 catch (  Throwable e) {
    throw new IllegalStateException(e);
  }
}
Program: 29583
Project: 29583
Buggy source:
private static String readFromFile(File file) throws IOException {
  Reader reader=new FileReader(file);
  CharBuffer charBuffer=CharBuffer.allocate(MAX_TEST_DATA_FILE_SIZE);
  reader.read(charBuffer);
  charBuffer.position(0);
  return charBuffer.toString();
}

Fixed version (ground truth):
private static String readFromFile(File file) throws IOException {
  BufferedReader in=new BufferedReader(new InputStreamReader(new FileInputStream(file),"String_Node_Str"));
  StringBuilder out=new StringBuilder();
  String line;
  while ((line=in.readLine()) != null) {
    out.append(line);
  }
  in.close();
  return out.toString();
}
Program: 29584
Project: 29584
Buggy source:
/** 
 * Create a list of Copyright object.
 * @param copyrightsJson A JSON array containing copyright information retrieved from the Web API.
 * @return A list of Copyright objects.
 */
public static List<Copyright> createCopyrights(JSONArray copyrightsJson){
  List<Copyright> copyrights=new ArrayList<Copyright>();
  for (int i=0; i < copyrightsJson.size(); i++) {
    Copyright copyright=new Copyright();
    JSONObject copyrightJson=copyrightsJson.getJSONObject(i);
    if (existsAndNotNull("String_Node_Str",copyrightJson)) {
      copyright.setText(copyrightJson.getString("String_Node_Str"));
    }
    if (existsAndNotNull("String_Node_Str",copyrightJson)) {
      copyright.setType(copyrightJson.getString("String_Node_Str"));
    }
    copyrights.add(copyright);
  }
  return copyrights;
}

Fixed version (ground truth):
/** 
 * Create a list of Copyright object.
 * @param copyrightsJson A JSON array containing copyright information retrieved from the Web API.
 * @return A list of Copyright objects.
 */
public static List<Copyright> createCopyrights(JSONArray copyrightsJson){
  List<Copyright> copyrights=new ArrayList<Copyright>();
  for (int i=0; i < copyrightsJson.size(); i++) {
    Copyright copyright=new Copyright();
    JSONObject copyrightJson=copyrightsJson.getJSONObject(i);
    if (existsAndNotNull("String_Node_Str",copyrightJson)) {
      copyright.setText(copyrightJson.getString("String_Node_Str"));
    }
    if (existsAndNotNull("String_Node_Str",copyrightJson)) {
      copyright.setType(CopyrightType.valueOf(copyrightJson.getString("String_Node_Str")));
    }
    copyrights.add(copyright);
  }
  return copyrights;
}
Program: 29585
Project: 29585
Buggy source:
public static List<String> createAvailableMarkets(JSONArray availableMarketsJson){
  List<String> availableMarkets=new ArrayList<String>();
  for (int i=0; i < availableMarketsJson.size(); i++) {
    availableMarkets.add(availableMarketsJson.getString(i));
  }
  return availableMarkets;
}

Fixed version (ground truth):
public static List<CountryCode> createAvailableMarkets(JSONArray availableMarketsJson){
  List<CountryCode> availableMarkets=new ArrayList<>();
  for (int i=0; i < availableMarketsJson.size(); i++) {
    availableMarkets.add(CountryCode.getByCode(availableMarketsJson.getString(i)));
  }
  return availableMarkets;
}
Program: 29586
Project: 29586
Buggy source:
private static Album createAlbum(JSONObject albumJson){
  if (albumJson == null || albumJson.isNullObject()) {
    return null;
  }
  Album album=new Album();
  album.setAlbumType(createAlbumType(albumJson.getString("String_Node_Str")));
  album.setArtists(createSimpleArtists(albumJson.getJSONArray("String_Node_Str")));
  album.setAvailableMarkets(createAvailableMarkets(albumJson.getJSONArray("String_Node_Str")));
  album.setCopyrights(createCopyrights(albumJson.getJSONArray("String_Node_Str")));
  album.setExternalIds(createExternalIds(albumJson.getJSONObject("String_Node_Str")));
  album.setExternalUrls(createExternalUrls(albumJson.getJSONObject("String_Node_Str")));
  album.setGenres(createGenres(albumJson.getJSONArray("String_Node_Str")));
  album.setHref(albumJson.getString("String_Node_Str"));
  album.setId(albumJson.getString("String_Node_Str"));
  album.setImages(createImages(albumJson.getJSONArray("String_Node_Str")));
  album.setName(albumJson.getString("String_Node_Str"));
  album.setPopularity(albumJson.getInt("String_Node_Str"));
  album.setReleaseDate(albumJson.getString("String_Node_Str"));
  album.setReleaseDatePrecision(albumJson.getString("String_Node_Str"));
  album.setTracks(createSimpleTrackPage(albumJson.getJSONObject("String_Node_Str")));
  album.setType(createObjectType(albumJson.getString("String_Node_Str")));
  album.setUri(albumJson.getString("String_Node_Str"));
  return album;
}

Fixed version (ground truth):
private static Album createAlbum(JSONObject albumJson){
  if (albumJson == null || albumJson.isNullObject()) {
    return null;
  }
  Album album=new Album();
  album.setAlbumType(createAlbumType(albumJson.getString("String_Node_Str")));
  album.setArtists(createSimpleArtists(albumJson.getJSONArray("String_Node_Str")));
  album.setAvailableMarkets(createAvailableMarkets(albumJson.getJSONArray("String_Node_Str")));
  album.setCopyrights(createCopyrights(albumJson.getJSONArray("String_Node_Str")));
  album.setExternalIds(createExternalIds(albumJson.getJSONObject("String_Node_Str")));
  album.setExternalUrls(createExternalUrls(albumJson.getJSONObject("String_Node_Str")));
  album.setGenres(createGenres(albumJson.getJSONArray("String_Node_Str")));
  album.setHref(albumJson.getString("String_Node_Str"));
  album.setId(albumJson.getString("String_Node_Str"));
  album.setImages(createImages(albumJson.getJSONArray("String_Node_Str")));
  album.setName(albumJson.getString("String_Node_Str"));
  album.setPopularity(albumJson.getInt("String_Node_Str"));
  album.setReleaseDate(albumJson.getString("String_Node_Str"));
  album.setReleaseDatePrecision(ReleaseDatePrecision.valueOf(albumJson.getString("String_Node_Str")));
  album.setTracks(createSimpleTrackPage(albumJson.getJSONObject("String_Node_Str")));
  album.setType(createObjectType(albumJson.getString("String_Node_Str")));
  album.setUri(albumJson.getString("String_Node_Str"));
  return album;
}
Program: 29587
Project: 29587
Buggy source:
private static Track createTrack(JSONObject trackJson){
  Track track=new Track();
  track.setAlbum(createSimpleAlbum(trackJson.getJSONObject("String_Node_Str")));
  track.setArtists(createSimpleArtists(trackJson.getJSONArray("String_Node_Str")));
  track.setAvailableMarkets(createAvailableMarkets(trackJson.getJSONArray("String_Node_Str")));
  track.setDiscNumber(trackJson.getInt("String_Node_Str"));
  track.setDuration(trackJson.getInt("String_Node_Str"));
  track.setExplicit(trackJson.getBoolean("String_Node_Str"));
  track.setExternalIds(createExternalIds(trackJson.getJSONObject("String_Node_Str")));
  track.setExternalUrls(createExternalUrls(trackJson.getJSONObject("String_Node_Str")));
  track.setHref(trackJson.getString("String_Node_Str"));
  track.setId(trackJson.getString("String_Node_Str"));
  track.setName(trackJson.getString("String_Node_Str"));
  track.setPopularity(trackJson.getInt("String_Node_Str"));
  track.setPreviewUrl(trackJson.getString("String_Node_Str"));
  track.setTrackNumber(trackJson.getInt(("String_Node_Str")));
  track.setType(createObjectType(trackJson.getString("String_Node_Str")));
  track.setUri(trackJson.getString("String_Node_Str"));
  return track;
}

Fixed version (ground truth):
private static Track createTrack(JSONObject trackJson){
  Track track=new Track();
  track.setAlbum(createSimpleAlbum(trackJson.getJSONObject("String_Node_Str")));
  track.setArtists(createSimpleArtists(trackJson.getJSONArray("String_Node_Str")));
  track.setAvailableMarkets(createAvailableMarkets(trackJson.getJSONArray("String_Node_Str")));
  track.setDiscNumber(trackJson.getInt("String_Node_Str"));
  track.setDurationMs(trackJson.getInt("String_Node_Str"));
  track.setExplicit(trackJson.getBoolean("String_Node_Str"));
  track.setExternalIds(createExternalIds(trackJson.getJSONObject("String_Node_Str")));
  track.setExternalUrls(createExternalUrls(trackJson.getJSONObject("String_Node_Str")));
  track.setHref(trackJson.getString("String_Node_Str"));
  track.setId(trackJson.getString("String_Node_Str"));
  track.setName(trackJson.getString("String_Node_Str"));
  track.setPopularity(trackJson.getInt("String_Node_Str"));
  track.setPreviewUrl(trackJson.getString("String_Node_Str"));
  track.setTrackNumber(trackJson.getInt(("String_Node_Str")));
  track.setType(createObjectType(trackJson.getString("String_Node_Str")));
  track.setUri(trackJson.getString("String_Node_Str"));
  return track;
}
Program: 29588
Project: 29588
Buggy source:
public static List<String> createGenres(JSONArray genres){
  List<String> returnedGenres=new ArrayList<String>();
  for (int i=0; i < genres.size(); i++) {
    returnedGenres.add(genres.getString(i));
  }
  return returnedGenres;
}

Fixed version (ground truth):
public static List<String> createGenres(JSONArray genres){
  List<String> returnedGenres=new ArrayList<>();
  for (int i=0; i < genres.size(); i++) {
    returnedGenres.add(genres.getString(i));
  }
  return returnedGenres;
}
Program: 29589
Project: 29589
Buggy source:
public static List<Album> createAlbums(JSONArray jsonArray){
  List<Album> returnedAlbums=new ArrayList<Album>();
  for (int i=0; i < jsonArray.size(); i++) {
    returnedAlbums.add(createSimpleAlbum(jsonArray.getJSONObject(i)));
  }
  return returnedAlbums;
}

Fixed version (ground truth):
public static List<Album> createAlbums(JSONArray jsonArray){
  List<Album> returnedAlbums=new ArrayList<Album>();
  for (int i=0; i < jsonArray.size(); i++) {
    returnedAlbums.add(createAlbum(jsonArray.getJSONObject(i)));
  }
  return returnedAlbums;
}
Program: 29590
Project: 29590
Buggy source:
public static List<Boolean> createBooleans(String response){
  List<Boolean> returnedArray=new ArrayList<Boolean>();
  JSONArray tracksContainedArray=JSONArray.fromObject(response);
  for (  Object tracksContainedString : tracksContainedArray) {
    if (String.valueOf(tracksContainedString).equals("String_Node_Str")) {
      returnedArray.add(false);
    }
 else {
      returnedArray.add(true);
    }
  }
  return returnedArray;
}

Fixed version (ground truth):
public static List<Boolean> createBooleans(String response){
  List<Boolean> returnedArray=new ArrayList<>();
  JSONArray tracksContainedArray=JSONArray.fromObject(response);
  for (  Object tracksContainedString : tracksContainedArray) {
    if (String.valueOf(tracksContainedString).equals("String_Node_Str")) {
      returnedArray.add(false);
    }
 else {
      returnedArray.add(true);
    }
  }
  return returnedArray;
}
Program: 29591
Project: 29591
Buggy source:
public static Paging<AlbumSimplified> createSimpleAlbumPage(JSONObject simpleAlbumPageJson){
  Paging<AlbumSimplified> page=createItemlessSimpleAlbumPage(simpleAlbumPageJson);
  page.setItems(createSimpleAlbums(simpleAlbumPageJson.getJSONArray("String_Node_Str")));
  return page;
}

Fixed version (ground truth):
public static Paging<AlbumSimplified> createSimpleAlbumPage(JSONObject simpleAlbumPageJson){
  Paging<AlbumSimplified> page=createItemlessSimpleAlbumPage(simpleAlbumPageJson);
  page.setItems(createAlbumsSimplified(simpleAlbumPageJson.getJSONArray("String_Node_Str")));
  return page;
}
Program: 29592
Project: 29592
Buggy source:
public static TrackSimplified createSimpleTrack(JSONObject simpleTrackJson){
  TrackSimplified track=new TrackSimplified();
  track.setArtists(createSimpleArtists(simpleTrackJson.getJSONArray("String_Node_Str")));
  track.setAvailableMarkets(createAvailableMarkets(simpleTrackJson.getJSONArray("String_Node_Str")));
  track.setDiscNumber(simpleTrackJson.getInt("String_Node_Str"));
  track.setDuration(simpleTrackJson.getInt("String_Node_Str"));
  track.setExplicit(simpleTrackJson.getBoolean("String_Node_Str"));
  track.setExternalUrls(createExternalUrls(simpleTrackJson.getJSONObject("String_Node_Str")));
  track.setHref(simpleTrackJson.getString("String_Node_Str"));
  track.setId(simpleTrackJson.getString("String_Node_Str"));
  track.setName(simpleTrackJson.getString("String_Node_Str"));
  track.setPreviewUrl(simpleTrackJson.getString("String_Node_Str"));
  track.setTrackNumber(simpleTrackJson.getInt("String_Node_Str"));
  track.setType(createObjectType(simpleTrackJson.getString("String_Node_Str")));
  track.setUri(simpleTrackJson.getString("String_Node_Str"));
  return track;
}

Fixed version (ground truth):
public static TrackSimplified createSimpleTrack(JSONObject simpleTrackJson){
  TrackSimplified track=new TrackSimplified();
  track.setArtists(createSimpleArtists(simpleTrackJson.getJSONArray("String_Node_Str")));
  track.setAvailableMarkets(createAvailableMarkets(simpleTrackJson.getJSONArray("String_Node_Str")));
  track.setDiscNumber(simpleTrackJson.getInt("String_Node_Str"));
  track.setDurationMs(simpleTrackJson.getInt("String_Node_Str"));
  track.setExplicit(simpleTrackJson.getBoolean("String_Node_Str"));
  track.setExternalUrls(createExternalUrls(simpleTrackJson.getJSONObject("String_Node_Str")));
  track.setHref(simpleTrackJson.getString("String_Node_Str"));
  track.setId(simpleTrackJson.getString("String_Node_Str"));
  track.setName(simpleTrackJson.getString("String_Node_Str"));
  track.setPreviewUrl(simpleTrackJson.getString("String_Node_Str"));
  track.setTrackNumber(simpleTrackJson.getInt("String_Node_Str"));
  track.setType(createObjectType(simpleTrackJson.getString("String_Node_Str")));
  track.setUri(simpleTrackJson.getString("String_Node_Str"));
  return track;
}
Program: 29593
Project: 29593
Buggy source:
public static User createUser(JSONObject userJson){
  User user=new User();
  user.setExternalUrls(createExternalUrls(userJson.getJSONObject("String_Node_Str")));
  user.setHref(userJson.getString("String_Node_Str"));
  user.setId(userJson.getString("String_Node_Str"));
  user.setType(createObjectType(userJson.getString("String_Node_Str")));
  user.setUri(userJson.getString("String_Node_Str"));
  user.setFollowers(createFollowers(userJson.getJSONObject("String_Node_Str")));
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setDisplayName(userJson.getString("String_Node_Str"));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setEmail(userJson.getString("String_Node_Str"));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setImages(createImages(userJson.getJSONArray("String_Node_Str")));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setProduct(createProductType(userJson.getString("String_Node_Str")));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setCountry(userJson.getString("String_Node_Str"));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setBirthdate(userJson.getString("String_Node_Str"));
  }
  return user;
}

Fixed version (ground truth):
public static User createUser(JSONObject userJson){
  User user=new User();
  user.setExternalUrls(createExternalUrls(userJson.getJSONObject("String_Node_Str")));
  user.setHref(userJson.getString("String_Node_Str"));
  user.setId(userJson.getString("String_Node_Str"));
  user.setType(createObjectType(userJson.getString("String_Node_Str")));
  user.setUri(userJson.getString("String_Node_Str"));
  user.setFollowers(createFollowers(userJson.getJSONObject("String_Node_Str")));
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setDisplayName(userJson.getString("String_Node_Str"));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setEmail(userJson.getString("String_Node_Str"));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setImages(createImages(userJson.getJSONArray("String_Node_Str")));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setProduct(createProductType(userJson.getString("String_Node_Str")));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setCountry(CountryCode.getByCode(userJson.getString("String_Node_Str")));
  }
  if (existsAndNotNull("String_Node_Str",userJson)) {
    user.setBirthdate(userJson.getString("String_Node_Str"));
  }
  return user;
}
Program: 29594
Project: 29594
Buggy source:
public SnapshotResult get() throws IOException, WebApiException {
  return JsonUtil.createSnapshotResponse(postJson());
}

Fixed version (ground truth):
public SnapshotResult get() throws IOException, WebApiException {
  return JsonUtil.createSnapshotResult(postJson());
}
Program: 29595
Project: 29595
Buggy source:
public SettableFuture<SnapshotResult> getAsync(){
  final SettableFuture<SnapshotResult> addTrackFuture=SettableFuture.create();
  try {
    addTrackFuture.set(JsonUtil.createSnapshotResponse(postJson()));
  }
 catch (  Exception e) {
    addTrackFuture.setException(e);
  }
  return addTrackFuture;
}

Fixed version (ground truth):
public SettableFuture<SnapshotResult> getAsync(){
  final SettableFuture<SnapshotResult> addTrackFuture=SettableFuture.create();
  try {
    addTrackFuture.set(JsonUtil.createSnapshotResult(postJson()));
  }
 catch (  Exception e) {
    addTrackFuture.setException(e);
  }
  return addTrackFuture;
}
Program: 29596
Project: 29596
Buggy source:
public Page<SimpleAlbum> get() throws IOException, WebApiException {
  final JSONObject jsonObject=JSONObject.fromObject(getJson());
  return JsonUtil.createSimpleAlbumPage(JSONObject.fromObject(jsonObject).getJSONObject("String_Node_Str"));
}

Fixed version (ground truth):
public Paging<AlbumSimplified> get() throws IOException, WebApiException {
  final JSONObject jsonObject=JSONObject.fromObject(getJson());
  return JsonUtil.createSimpleAlbumPage(JSONObject.fromObject(jsonObject).getJSONObject("String_Node_Str"));
}
Program: 29597
Project: 29597
Buggy source:
public Page<SimpleAlbum> get() throws IOException, WebApiException {
  final JSONObject jsonObject=JSONObject.fromObject(getJson());
  return JsonUtil.createSimpleAlbumPage(jsonObject);
}

Fixed version (ground truth):
public Paging<AlbumSimplified> get() throws IOException, WebApiException {
  final JSONObject jsonObject=JSONObject.fromObject(getJson());
  return JsonUtil.createSimpleAlbumPage(jsonObject);
}