nus-yam/ex-repair huggingface dataset:
Program: 33380
Project: 33380
Buggy source:
@Override public boolean onTouch(View v,MotionEvent event){
  mScaleDetector.onTouchEvent(event);
  PointF curr=new PointF(event.getX(),event.getY());
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
    onSingleClick(curr);
  thisTouchTime=System.currentTimeMillis();
if (thisTouchTime - previousTouchTime <= DOUBLE_CLICK_INTERVAL) {
  onDoubleClick(curr);
}
previousTouchTime=thisTouchTime;
break;
case MotionEvent.ACTION_MOVE:
if (mode == State.DRAG) {
float deltaX=curr.x - last.x;
float deltaY=curr.y - last.y;
float fixTransX=getFixDragTrans(deltaX,viewWidth,origWidth * saveScale);
float fixTransY=getFixDragTrans(deltaY,viewHeight,origHeight * saveScale);
matrix.postTranslate(fixTransX,fixTransY);
fixTrans();
last.set(curr.x,curr.y);
}
break;
case MotionEvent.ACTION_UP:
mode=State.NONE;
int xDiff=(int)Math.abs(curr.x - start.x);
int yDiff=(int)Math.abs(curr.y - start.y);
if (xDiff < CLICK && yDiff < CLICK) performClick();
break;
case MotionEvent.ACTION_POINTER_UP:
mode=State.NONE;
break;
}
setImageMatrix(matrix);
invalidate();
return true;
}

Fixed version (ground truth):
@Override public boolean onTouch(View v,MotionEvent event){
  mScaleDetector.onTouchEvent(event);
  PointF curr=new PointF(event.getX(),event.getY());
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
    onSingleClick(curr);
  thisTouchTime=System.currentTimeMillis();
if (thisTouchTime - previousTouchTime <= DOUBLE_CLICK_INTERVAL) {
  onDoubleClick(curr);
}
previousTouchTime=thisTouchTime;
break;
case MotionEvent.ACTION_MOVE:
if (mode == State.DRAG) {
float deltaX=curr.x - last.x;
float deltaY=curr.y - last.y;
if (deltaX != 0f || deltaY != 0f) {
float fixTransX=getFixDragTrans(deltaX,viewWidth,origWidth * saveScale);
float fixTransY=getFixDragTrans(deltaY,viewHeight,origHeight * saveScale);
if (saveScale > 1f) {
matrix.getValues(m);
float absTransX=Math.abs(m[Matrix.MTRANS_X]);
float transXMax=(origWidth * (saveScale - 1f));
if ((transXMax - absTransX < 0.5f && fixTransX < 0f) || (absTransX < 0.5f && fixTransX > 0f)) getParent().requestDisallowInterceptTouchEvent(false);
 else getParent().requestDisallowInterceptTouchEvent(true);
}
matrix.postTranslate(fixTransX,fixTransY);
fixTrans();
last.set(curr.x,curr.y);
}
}
break;
case MotionEvent.ACTION_UP:
mode=State.NONE;
int xDiff=(int)Math.abs(curr.x - start.x);
int yDiff=(int)Math.abs(curr.y - start.y);
if (xDiff < CLICK && yDiff < CLICK) performClick();
break;
case MotionEvent.ACTION_POINTER_UP:
mode=State.NONE;
break;
}
setImageMatrix(matrix);
invalidate();
return true;
}
Program: 33381
Project: 33381
Buggy source:
@Override public void onSystemUiVisibilityChange(int visibility){
  if (areSystemControlsVisible(visibility)) {
    showControls();
  }
}

Fixed version (ground truth):
@Override public void onSystemUiVisibilityChange(int visibility){
  Toast.makeText(this,"String_Node_Str" + visibility,Toast.LENGTH_SHORT).show();
  if (areSystemControlsVisible(visibility) && !isFinishing()) {
    showControls();
  }
}
Program: 33382
Project: 33382
Buggy source:
private void hideSystemControls(){
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    getActivityView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_FULLSCREEN| View.SYSTEM_UI_FLAG_LOW_PROFILE| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
  }
 else {
    getActivityView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void hideSystemControls(){
  getActivityView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_FULLSCREEN| View.SYSTEM_UI_FLAG_LOW_PROFILE| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}
Program: 33383
Project: 33383
Buggy source:
@Override protected void onStart(){
  super.onStart();
  setUpVideoService();
  setUpVideoServiceBind();
}

Fixed version (ground truth):
@Override protected void onStart(){
  super.onStart();
  setUpVideoServiceBind();
}
Program: 33384
Project: 33384
Buggy source:
@Override protected void onStop(){
  super.onStop();
  getSurfaceFrame().removeOnLayoutChangeListener(this);
  getMediaPlayer().stop();
  getMediaPlayer().getVLCVout().detachViews();
  tearDownVideoServiceBind();
}

Fixed version (ground truth):
@Override protected void onStop(){
  super.onStop();
  getSurfaceFrame().removeOnLayoutChangeListener(this);
  getMediaPlayer().getVLCVout().detachViews();
  tearDownVideoServiceBind();
}
Program: 33385
Project: 33385
Buggy source:
@Override public boolean isPlaying(){
  return videoService.isVideoPlaying();
}

Fixed version (ground truth):
@Override public boolean isPlaying(){
  return getMediaPlayer().isPlaying();
}
Program: 33386
Project: 33386
Buggy source:
@Override protected void onResume(){
  super.onResume();
  showControlsForced();
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
}
Program: 33387
Project: 33387
Buggy source:
@Override public void onPause(){
  super.onPause();
  showControls();
  tearDownVideoControlsHandler();
  if (!isChangingConfigurations()) {
    pause();
  }
  if (isFinishing()) {
    tearDownVideoPlayback();
  }
}

Fixed version (ground truth):
@Override public void onPause(){
  super.onPause();
  tearDownVideoControlsHandler();
  if (!isChangingConfigurations()) {
    pause();
  }
  if (isFinishing()) {
    tearDownVideoPlayback();
  }
}
Program: 33388
Project: 33388
Buggy source:
private void setUpVideoPlayback(){
  if (videoService.isVideoStarted()) {
    showVideo();
    showControls();
  }
 else {
    videoService.startVideo(getVideoShare(),getVideoFile());
    addLayoutChangeListener();
  }
}

Fixed version (ground truth):
private void setUpVideoPlayback(){
  if (videoService.isVideoStarted()) {
    showVideo();
    showControlsDelayed();
  }
 else {
    videoService.startVideo(getVideoShare(),getVideoFile());
    addLayoutChangeListener();
  }
}
Program: 33389
Project: 33389
Buggy source:
private void showSystemControls(){
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
    getActivityView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
  }
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") private void showSystemControls(){
  getActivityView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
}
Program: 33390
Project: 33390
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_server_file_video);
  setUpInjections();
  setUpHomeNavigation();
  setUpVideo();
  setUpSystemControls();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_server_file_video);
  setUpInjections();
  setUpHomeNavigation();
  setUpVideo();
  setUpSystemControls();
  setUpVideoService();
}
Program: 33391
Project: 33391
Buggy source:
@Override public void onEvent(MediaPlayer.Event event){
switch (event.type) {
case MediaPlayer.Event.MediaChanged:
    showVideo();
  showControls();
break;
case MediaPlayer.Event.EndReached:
finish();
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void onEvent(MediaPlayer.Event event){
switch (event.type) {
case MediaPlayer.Event.MediaChanged:
    showVideo();
  break;
case MediaPlayer.Event.Playing:
showControlsForced();
break;
case MediaPlayer.Event.Paused:
showControlsForced();
break;
case MediaPlayer.Event.EndReached:
finish();
break;
case MediaPlayer.Event.Buffering:
break;
case MediaPlayer.Event.EncounteredError:
break;
}
}
Program: 33392
Project: 33392
Buggy source:
private void tearDownActivity(){
  getActivity().finish();
  Intent myIntent=new Intent(getActivity().getApplicationContext(),AuthenticationActivity.class);
  startActivity(myIntent);
}

Fixed version (ground truth):
private void tearDownActivity(){
  getActivity().finish();
  Intent myIntent=new Intent(getActivity().getApplicationContext(),AuthenticationActivity.class);
  myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
  startActivity(myIntent);
}
Program: 33393
Project: 33393
Buggy source:
@Override public void onPause(){
  super.onPause();
  if (!isChangingConfigurations()) {
    pause();
  }
  if (isFinishing()) {
    tearDownVideoPlayback();
  }
}

Fixed version (ground truth):
@Override public void onPause(){
  super.onPause();
  videoControls.hide();
  if (!isChangingConfigurations()) {
    pause();
  }
  if (isFinishing()) {
    tearDownVideoPlayback();
  }
}
Program: 33394
Project: 33394
Buggy source:
public void init(){
  mVisible=true;
  delayedHide(autoHideDelayMillis);
  if (onClickToggleEnabled) {
    mContentView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        toggle();
      }
    }
);
  }
  if (mControlsView != null) {
    mControlsView.setOnTouchListener(new View.OnTouchListener(){
      @Override public boolean onTouch(      View view,      MotionEvent motionEvent){
        if (autoHide) {
          delayedHide(autoHideDelayMillis);
        }
        return false;
      }
    }
);
  }
}

Fixed version (ground truth):
public void init(){
  mVisible=true;
  delayedHide(autoHideDelayMillis);
  if (onClickToggleEnabled) {
    mContentView.setOnClickListener(new View.OnClickListener(){
      @Override public void onClick(      View view){
        toggle();
      }
    }
);
  }
  if (mControlsView != null) {
    mControlsView.setOnTouchListener(new View.OnTouchListener(){
      @Override public boolean onTouch(      View view,      MotionEvent motionEvent){
        if (autoHide) {
          delayedHide();
        }
        return false;
      }
    }
);
  }
}
Program: 33395
Project: 33395
Buggy source:
public void toggle(){
  if (mVisible) {
    hide();
  }
 else {
    show();
  }
}

Fixed version (ground truth):
public void toggle(){
  if (mVisible) {
    hide();
  }
 else {
    show();
    delayedHide();
  }
}
Program: 33396
Project: 33396
Buggy source:
@Override public boolean onTouch(View view,MotionEvent motionEvent){
  if (autoHide) {
    delayedHide(autoHideDelayMillis);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean onTouch(View view,MotionEvent motionEvent){
  if (autoHide) {
    delayedHide();
  }
  return false;
}
Program: 33397
Project: 33397
Buggy source:
public void toggle(){
  if (isVisible) {
    hideAnimated();
  }
 else {
    showAnimated();
  }
}

Fixed version (ground truth):
public void toggle(){
  if (isVisible) {
    hideAnimated();
  }
 else {
    showAnimated();
    hideControlsDelayed();
  }
}
Program: 33398
Project: 33398
Buggy source:
private void bindView(ServerFile file,View view){
  ImageView fileIconView=(ImageView)view.findViewById(R.id.icon);
  TextView fileTextView=(TextView)view.findViewById(R.id.text);
  fileTextView.setText(getFileName(file));
  if (Mimes.match(file.getMime()) == Mimes.Type.IMAGE) {
    setUpImageIcon(file,fileIconView);
  }
 else {
    fileIconView.setImageResource(getFileIcon(file));
  }
}

Fixed version (ground truth):
private void bindView(ServerFile file,View view){
  ImageView fileIconView=(ImageView)view.findViewById(R.id.icon);
  TextView fileTextView=(TextView)view.findViewById(R.id.text);
  TextView fileSize=(TextView)view.findViewById(R.id.file_size);
  TextView fileLastModified=(TextView)view.findViewById(R.id.last_modified);
  LinearLayout moreInfo=(LinearLayout)view.findViewById(R.id.more_info);
  fileTextView.setText(getFileName(file));
  long size=getFileSize(file);
  if (file.getMime().equals("String_Node_Str")) {
    moreInfo.setVisibility(View.GONE);
  }
 else {
    moreInfo.setVisibility(View.VISIBLE);
    fileSize.setText(Formatter.formatFileSize(context,size));
    Date d=getLastModified(file);
    SimpleDateFormat dt=new SimpleDateFormat("String_Node_Str");
    fileLastModified.setText(dt.format(d));
  }
  if (Mimes.match(file.getMime()) == Mimes.Type.IMAGE) {
    setUpImageIcon(file,fileIconView);
  }
 else {
    fileIconView.setImageResource(getFileIcon(file));
  }
}
Program: 33399
Project: 33399
Buggy source:
public ServerFilesAdapter(Context context,ServerClient serverClient){
  this.serverClient=serverClient;
  this.layoutInflater=LayoutInflater.from(context);
  this.files=Collections.emptyList();
}

Fixed version (ground truth):
public ServerFilesAdapter(Context context,ServerClient serverClient){
  this.serverClient=serverClient;
  this.layoutInflater=LayoutInflater.from(context);
  this.context=context;
  this.files=Collections.emptyList();
}
Program: 33400
Project: 33400
Buggy source:
private ServerFile(Parcel parcel){
  this.parentFile=parcel.readParcelable(ServerFile.class.getClassLoader());
  this.name=parcel.readString();
  this.mime=parcel.readString();
  this.modificationTime=new Date(parcel.readLong());
}

Fixed version (ground truth):
private ServerFile(Parcel parcel){
  this.parentFile=parcel.readParcelable(ServerFile.class.getClassLoader());
  this.name=parcel.readString();
  this.mime=parcel.readString();
  this.modificationTime=new Date(parcel.readLong());
  this.size=parcel.readLong();
}
Program: 33401
Project: 33401
Buggy source:
@Override public void writeToParcel(Parcel parcel,int flags){
  parcel.writeParcelable(parentFile,flags);
  parcel.writeString(name);
  parcel.writeString(mime);
  parcel.writeLong(modificationTime.getTime());
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel parcel,int flags){
  parcel.writeParcelable(parentFile,flags);
  parcel.writeString(name);
  parcel.writeString(mime);
  parcel.writeLong(modificationTime.getTime());
  parcel.writeLong(size);
}
Program: 33402
Project: 33402
Buggy source:
@Subscribe public void onAppsLoadFailed(ServerAppsLoadedEvent event){
  showAppsError();
}

Fixed version (ground truth):
@Subscribe public void onAppsLoadFailed(ServerAppsLoadFailedEvent event){
  showAppsError();
}
Program: 33403
Project: 33403
Buggy source:
private void setUpSharesContent(){
  if (serverClient.isConnected()) {
    serverClient.getShares();
  }
 else {
    showSharesError();
  }
}

Fixed version (ground truth):
private void setUpSharesContent(){
  if (serverClient.isConnected()) {
    serverClient.getShares();
  }
}
Program: 33404
Project: 33404
Buggy source:
@Override public Bundle addAccount(AccountAuthenticatorResponse response,String accountType,String authTokenType,String[] requiredFeatures,Bundle options) throws NetworkErrorException {
  if (getAccounts().isEmpty()) {
    Intent accountIntent=new Intent(context,AuthenticationActivity.class);
    accountIntent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE,response);
    Bundle accountBundle=new Bundle();
    accountBundle.putParcelable(AccountManager.KEY_INTENT,accountIntent);
    return accountBundle;
  }
 else {
    Bundle accountBundle=new Bundle();
    accountBundle.putInt(AccountManager.KEY_ERROR_CODE,AccountManager.ERROR_CODE_CANCELED);
    accountBundle.putString(AccountManager.KEY_ERROR_MESSAGE,"String_Node_Str");
    return accountBundle;
  }
}

Fixed version (ground truth):
@Override public Bundle addAccount(AccountAuthenticatorResponse response,String accountType,String authTokenType,String[] requiredFeatures,Bundle options) throws NetworkErrorException {
  Bundle accountBundle=new Bundle();
  if (getAccounts().isEmpty()) {
    Intent accountIntent=new Intent(context,AuthenticationActivity.class);
    accountIntent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE,response);
    accountBundle.putParcelable(AccountManager.KEY_INTENT,accountIntent);
  }
 else {
    accountBundle.putInt(AccountManager.KEY_ERROR_CODE,AccountManager.ERROR_CODE_CANCELED);
    accountBundle.putString(AccountManager.KEY_ERROR_MESSAGE,"String_Node_Str");
  }
  return accountBundle;
}
Program: 33405
Project: 33405
Buggy source:
private Fragment buildSettingsFragment(){
  return new SettingsFragment();
}

Fixed version (ground truth):
private Fragment buildSettingsFragment(){
  return Fragments.Builder.buildSettingsFragment();
}
Program: 33406
Project: 33406
Buggy source:
private <T extends Preference>T getPreference(int settingId){
  return (T)findPreference(getString(settingId));
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private <T extends Preference>T getPreference(int settingId){
  return (T)findPreference(getString(settingId));
}
Program: 33407
Project: 33407
Buggy source:
@Override public String getAuthTokenLabel(String s){
  return null;
}

Fixed version (ground truth):
@Override public String getAuthTokenLabel(String authTokenType){
  return null;
}
Program: 33408
Project: 33408
Buggy source:
private void setUpAudioPlayback(){
  try {
    audioPlayer.setDataSource(this,getAudioUri());
    audioPlayer.setOnPreparedListener(this);
    audioPlayer.prepareAsync();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
private void setUpAudioPlayback(){
  try {
    audioPlayer.setDataSource(this,getAudioUri());
    audioPlayer.prepareAsync();
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 33409
Project: 33409
Buggy source:
private void setUpAudioPlayer(){
  audioPlayer=new MediaPlayer();
  audioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  audioPlayer.setWakeMode(this,PowerManager.PARTIAL_WAKE_LOCK);
  audioPlayer.setOnCompletionListener(this);
  audioPlayer.setOnErrorListener(this);
}

Fixed version (ground truth):
private void setUpAudioPlayer(){
  audioPlayer=new MediaPlayer();
  audioPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  audioPlayer.setWakeMode(this,PowerManager.PARTIAL_WAKE_LOCK);
  audioPlayer.setOnPreparedListener(this);
  audioPlayer.setOnCompletionListener(this);
  audioPlayer.setOnErrorListener(this);
}
Program: 33410
Project: 33410
Buggy source:
@Override public void onDestroy(){
  super.onDestroy();
  tearDownVideoEvents();
  tearDownVideoPlayer();
}

Fixed version (ground truth):
@Override public void onDestroy(){
  super.onDestroy();
  tearDownVideoEvents();
  tearDownVideoPlayback();
}
Program: 33411
Project: 33411
Buggy source:
@Override protected BusEvent doInBackground(Void... parameters){
  MediaMetadataRetriever audioMetadataRetriever=new MediaMetadataRetriever();
  audioMetadataRetriever.setDataSource(audioUri.toString(),new HashMap<String,String>());
  String audioTitle=audioMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE);
  String audioArtist=audioMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST);
  String audioAlbum=audioMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM);
  Bitmap audioAlbumArt=extractAlbumArt(audioMetadataRetriever);
  audioMetadataRetriever.release();
  return new AudioMetadataRetrievedEvent(audioTitle,audioArtist,audioAlbum,audioAlbumArt);
}

Fixed version (ground truth):
@Override protected BusEvent doInBackground(Void... parameters){
  MediaMetadataRetriever audioMetadataRetriever=new MediaMetadataRetriever();
  try {
    audioMetadataRetriever.setDataSource(audioUri.toString(),new HashMap<String,String>());
    String audioTitle=audioMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_TITLE);
    String audioArtist=audioMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ARTIST);
    String audioAlbum=audioMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_ALBUM);
    Bitmap audioAlbumArt=extractAlbumArt(audioMetadataRetriever);
    return new AudioMetadataRetrievedEvent(audioTitle,audioArtist,audioAlbum,audioAlbumArt);
  }
 catch (  RuntimeException e) {
    return new AudioMetadataRetrievedEvent(null,null,null,null);
  }
 finally {
    audioMetadataRetriever.release();
  }
}
Program: 33412
Project: 33412
Buggy source:
private void setUpNavigation(Bundle state){
  if (isNavigationDrawerAvailable()) {
    setUpNavigationDrawer();
  }
  setUpNavigationFragment();
  if (isNavigationDrawerAvailable() && isNavigationDrawerRequired(state)) {
    showNavigationDrawer();
  }
}

Fixed version (ground truth):
private void setUpNavigation(Bundle state){
  if (isNavigationDrawerAvailable()) {
    setUpNavigationDrawer();
  }
  setUpNavigationTitle(state);
  setUpNavigationFragment();
  if (isNavigationDrawerAvailable() && isNavigationDrawerRequired(state)) {
    showNavigationDrawer();
  }
}
Program: 33413
Project: 33413
Buggy source:
@Override public void onDrawerClosed(View drawer){
  navigationDrawerToggle.onDrawerClosed(drawer);
  setUpMenu();
}

Fixed version (ground truth):
@Override public void onDrawerClosed(View drawer){
  navigationDrawerToggle.onDrawerClosed(drawer);
  setUpTitle();
}
Program: 33414
Project: 33414
Buggy source:
@Subscribe public void onSharesSelected(SharesSelectedEvent event){
  setUpTitle("String_Node_Str");
  setUpShares();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}

Fixed version (ground truth):
@Subscribe public void onSharesSelected(SharesSelectedEvent event){
  this.navigationTitle="String_Node_Str";
  setUpTitle();
  setUpShares();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}
Program: 33415
Project: 33415
Buggy source:
@Subscribe public void onAppsSelected(AppsSelectedEvent event){
  setUpTitle("String_Node_Str");
  setUpApps();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}

Fixed version (ground truth):
@Subscribe public void onAppsSelected(AppsSelectedEvent event){
  this.navigationTitle="String_Node_Str";
  setUpTitle();
  setUpApps();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}
Program: 33416
Project: 33416
Buggy source:
@Override public void onDrawerOpened(View drawer){
  navigationDrawerToggle.onDrawerOpened(drawer);
  setUpTitle(getString(R.string.application_name));
  setUpMenu();
}

Fixed version (ground truth):
@Override public void onDrawerOpened(View drawer){
  navigationDrawerToggle.onDrawerOpened(drawer);
  setUpTitle(getString(R.string.application_name));
}
Program: 33417
Project: 33417
Buggy source:
private void setUpTitle(String title){
  getActionBar().setTitle(title);
}

Fixed version (ground truth):
private void setUpTitle(){
  setUpTitle(navigationTitle);
}
Program: 33418
Project: 33418
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  tearDownNavigationDrawerState(outState);
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  tearDownNavigationState(outState);
}
Program: 33419
Project: 33419
Buggy source:
@Override public void onDrawerClosed(View drawer){
  navigationDrawerToggle.onDrawerClosed(drawer);
  setUpTitle("String_Node_Str");
  setUpMenu();
}

Fixed version (ground truth):
@Override public void onDrawerClosed(View drawer){
  navigationDrawerToggle.onDrawerClosed(drawer);
  setUpMenu();
}
Program: 33420
Project: 33420
Buggy source:
@Subscribe public void onSharesSelected(SharesSelectedEvent event){
  setUpShares();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}

Fixed version (ground truth):
@Subscribe public void onSharesSelected(SharesSelectedEvent event){
  setUpTitle("String_Node_Str");
  setUpShares();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}
Program: 33421
Project: 33421
Buggy source:
@Subscribe public void onAppsSelected(AppsSelectedEvent event){
  setUpApps();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}

Fixed version (ground truth):
@Subscribe public void onAppsSelected(AppsSelectedEvent event){
  setUpTitle("String_Node_Str");
  setUpApps();
  if (isNavigationDrawerAvailable()) {
    hideNavigationDrawer();
  }
}
Program: 33422
Project: 33422
Buggy source:
private void setUpSharesContent(){
  serverClient.getShares();
}

Fixed version (ground truth):
private void setUpSharesContent(){
  if (serverClient.isConnected()) {
    serverClient.getShares();
  }
 else {
    showSharesError();
  }
}
Program: 33423
Project: 33423
Buggy source:
private void setUpServerConnection(){
switch (getServerConnection()) {
case AUTO:
    serverClient.connectAuto();
  break;
case LOCAL:
serverClient.connectLocal();
break;
case REMOTE:
serverClient.connectRemote();
break;
default :
break;
}
}

Fixed version (ground truth):
private void setUpServerConnection(){
  if (!serverClient.isConnected()) {
    return;
  }
switch (getServerConnection()) {
case AUTO:
    serverClient.connectAuto();
  break;
case LOCAL:
serverClient.connectLocal();
break;
case REMOTE:
serverClient.connectRemote();
break;
default :
break;
}
}
Program: 33424
Project: 33424
Buggy source:
private void setUpServerConnection(){
  if (isConnectionLocal()) {
    serverClient.connectLocal();
  }
 else {
    serverClient.connectRemote();
  }
  setUpSharesContent();
}

Fixed version (ground truth):
private void setUpServerConnection(){
  if (!isConnectionAvailable() || isConnectionLocal()) {
    serverClient.connectLocal();
  }
 else {
    serverClient.connectRemote();
  }
  setUpSharesContent();
}
Program: 33425
Project: 33425
Buggy source:
private void setUpServerConnectionIndicator(){
  getActivity().getActionBar().setBackgroundDrawable(getServerConnectionIndicator());
}

Fixed version (ground truth):
private void setUpServerConnectionIndicator(){
  if (isConnectionAvailable()) {
    getActivity().getActionBar().setBackgroundDrawable(getServerConnectionIndicator());
  }
}
Program: 33426
Project: 33426
Buggy source:
private void setUpSettingsSummary(){
  Preference applicationVersion=getSetting(R.string.preference_key_application_version);
  applicationVersion.setSummary(getApplicationVersionSummary());
  ListPreference serverConnection=getSetting(R.string.preference_key_server_connection);
  serverConnection.setSummary(String.format("String_Node_Str",serverConnection.getEntry()));
}

Fixed version (ground truth):
private void setUpSettingsSummary(){
  Preference applicationVersion=getPreference(R.string.preference_key_application_version);
  ListPreference serverConnection=getPreference(R.string.preference_key_server_connection);
  applicationVersion.setSummary(getApplicationVersionSummary());
  serverConnection.setSummary(getServerConnection());
}
Program: 33427
Project: 33427
Buggy source:
private void setUpSettingsListeners(){
  Preference accountSignOut=getSetting(R.string.preference_key_account_sign_out);
  Preference applicationFeedback=getSetting(R.string.preference_key_application_feedback);
  Preference applicationRating=getSetting(R.string.preference_key_application_rating);
  accountSignOut.setOnPreferenceClickListener(this);
  applicationFeedback.setOnPreferenceClickListener(this);
  applicationRating.setOnPreferenceClickListener(this);
}

Fixed version (ground truth):
private void setUpSettingsListeners(){
  Preference accountSignOut=getPreference(R.string.preference_key_account_sign_out);
  Preference applicationFeedback=getPreference(R.string.preference_key_application_feedback);
  Preference applicationRating=getPreference(R.string.preference_key_application_rating);
  accountSignOut.setOnPreferenceClickListener(this);
  applicationFeedback.setOnPreferenceClickListener(this);
  applicationRating.setOnPreferenceClickListener(this);
}
Program: 33428
Project: 33428
Buggy source:
private boolean isServerConnectionLocal(){
  ListPreference serverConnection=getSetting(R.string.preference_key_server_connection);
  return serverConnection.getValue().equals(getString(R.string.preference_key_server_connection_local));
}

Fixed version (ground truth):
private boolean isServerConnectionLocal(){
  ListPreference serverConnection=getPreference(R.string.preference_key_server_connection);
  return serverConnection.getValue().equals(getString(R.string.preference_key_server_connection_local));
}
Program: 33429
Project: 33429
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem menuItem){
switch (menuItem.getItemId()) {
case R.id.menu_sort:
    setUpFilesContentSortIcon(menuItem);
  setUpFilesContentSortSwitched();
return true;
default :
return super.onOptionsItemSelected(menuItem);
}
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem menuItem){
switch (menuItem.getItemId()) {
case R.id.menu_sort:
    setUpFilesContentSortSwitched();
  setUpFilesContentSortIcon(menuItem);
return true;
default :
return super.onOptionsItemSelected(menuItem);
}
}
Program: 33430
Project: 33430
Buggy source:
/** 
 * Creates new bitmap for the position specified
 * @param position position
 * @return Bitmap created
 */
protected abstract Bitmap createBitmap(int position);

Fixed version (ground truth):
/** 
 * Creates new bitmap for the position specified.
 * @param position position
 * @return Bitmap created
 */
protected abstract Bitmap createBitmap(int position);
Program: 33431
Project: 33431
Buggy source:
@Override public void report(HealthStatusScope scope,HealthStatusItemConsumer resultConsumer){
  Map<String,Object> params=new HashMap<>();
  params.put("String_Node_Str",myWebHookTeamCityRestApiZipPluginFixer.getFoundApiZipFilesContainingJaxbJars().size() + myWebHookTeamCityRestApiZipPluginFixer.getFoundUnpackedApiZipFilesContainingJaxbJars().size());
  params.put("String_Node_Str",stripTrailingSlash(mySBuildServer.getRootUrl()) + "String_Node_Str" + WebHookRestApiAdminPage.TC_WEB_HOOK_REST_API_ADMIN_ID);
  final HealthStatusItem item=new HealthStatusItem("String_Node_Str",myCategory,params);
  resultConsumer.consumeGlobal(item);
}

Fixed version (ground truth):
@Override public void report(HealthStatusScope scope,HealthStatusItemConsumer resultConsumer){
  Map<String,Object> params=new HashMap<>();
  params.put("String_Node_Str",myWebHookTeamCityRestApiZipPluginFixer.getFoundApiZipFilesContainingJaxbJars().size());
  params.put("String_Node_Str",stripTrailingSlash(mySBuildServer.getRootUrl()) + "String_Node_Str" + WebHookRestApiAdminPage.TC_WEB_HOOK_REST_API_ADMIN_ID);
  final HealthStatusItem item=new HealthStatusItem("String_Node_Str",myCategory,params);
  resultConsumer.consumeGlobal(item);
}
Program: 33432
Project: 33432
Buggy source:
protected boolean deleteFilesFromRestApiZipFile(File restApiZip,String[] filenames) throws IOException {
  Map<String,String> zip_properties=new HashMap<>();
  zip_properties.put("String_Node_Str","String_Node_Str");
  URI zip_disk=null;
  try {
    Path path=Paths.get(restApiZip.getAbsolutePath());
    zip_disk=new URI("String_Node_Str",path.toUri().toString().replace("String_Node_Str","String_Node_Str"),null);
  }
 catch (  URISyntaxException e) {
  }
  boolean fileDeletedInZip=false;
  try (FileSystem zipfs=FileSystems.newFileSystem(zip_disk,zip_properties)){
    for (    String filename : filenames) {
      Path pathInZipfile=zipfs.getPath(filename);
      if (Files.exists(pathInZipfile)) {
        Files.delete(pathInZipfile);
        fileDeletedInZip=true;
      }
    }
  }
   return fileDeletedInZip;
}

Fixed version (ground truth):
protected boolean deleteFilesFromRestApiZipFile(File restApiZip,String[] filenames,JarReport jarReport) throws IOException {
  Map<String,String> zip_properties=new HashMap<>();
  zip_properties.put("String_Node_Str","String_Node_Str");
  URI zip_disk=null;
  try {
    Path path=Paths.get(restApiZip.getAbsolutePath());
    zip_disk=new URI("String_Node_Str",path.toUri().toString().replace("String_Node_Str","String_Node_Str"),null);
  }
 catch (  URISyntaxException e) {
  }
  boolean fileDeletedInZip=false;
  try (FileSystem zipfs=FileSystems.newFileSystem(zip_disk,zip_properties)){
    for (    String filename : filenames) {
      Path pathInZipfile=zipfs.getPath(filename);
      if (Files.exists(pathInZipfile)) {
        Files.delete(pathInZipfile);
        fileDeletedInZip=true;
        jarReport.setJarAsRemovedFromZip(filename,true);
      }
    }
  }
   return fileDeletedInZip;
}
Program: 33433
Project: 33433
Buggy source:
protected boolean doesRestApiZipFileContainJaxJars(File restApiZip,String[] filenames) throws IOException {
  Map<String,String> zip_properties=new HashMap<>();
  zip_properties.put("String_Node_Str","String_Node_Str");
  URI zip_disk=null;
  try {
    Path path=Paths.get(restApiZip.getAbsolutePath());
    zip_disk=new URI("String_Node_Str",path.toUri().toString(),null);
  }
 catch (  URISyntaxException e) {
  }
  boolean fileFoundInZip=false;
  try (FileSystem zipfs=FileSystems.newFileSystem(zip_disk,zip_properties)){
    for (    String filename : filenames) {
      Path pathInZipfile=zipfs.getPath(filename);
      if (Files.exists(pathInZipfile)) {
        fileFoundInZip=true;
      }
    }
  }
 catch (  IllegalArgumentException e) {
    Loggers.SERVER.error("String_Node_Str" + e.getMessage());
    Loggers.SERVER.debug(e);
  }
  return fileFoundInZip;
}

Fixed version (ground truth):
protected boolean doesRestApiZipFileContainJaxJars(File restApiZip,String[] filenames,JarReport jarReport) throws IOException {
  Map<String,String> zip_properties=new HashMap<>();
  zip_properties.put("String_Node_Str","String_Node_Str");
  URI zip_disk=null;
  try {
    Path path=Paths.get(restApiZip.getAbsolutePath());
    zip_disk=new URI("String_Node_Str",path.toUri().toString(),null);
  }
 catch (  URISyntaxException e) {
  }
  boolean fileFoundInZip=false;
  try (FileSystem zipfs=FileSystems.newFileSystem(zip_disk,zip_properties)){
    for (    String filename : filenames) {
      Path pathInZipfile=zipfs.getPath(filename);
      if (Files.exists(pathInZipfile)) {
        fileFoundInZip=true;
        jarReport.setJarFoundInZipFile(filename,true);
      }
 else {
        jarReport.setJarFoundInZipFile(filename,false);
      }
    }
  }
 catch (  IllegalArgumentException e) {
    Loggers.SERVER.error("String_Node_Str" + e.getMessage());
    Loggers.SERVER.debug(e);
  }
  return fileFoundInZip;
}
Program: 33434
Project: 33434
Buggy source:
public boolean foundApiZipFilesContainingJaxbJars(){
  return foundApiZipFilesContainingJaxbJars.size() > 0 || foundUnpackedApiZipFilesContainingJaxbJars.size() > 0;
}

Fixed version (ground truth):
public boolean foundApiZipFilesContainingJaxbJars(){
  for (  JarReport jarReport : jarReports.values()) {
    if (jarReport.isjarFileFound()) {
      return true;
    }
  }
  return false;
}
Program: 33435
Project: 33435
Buggy source:
protected boolean doFilesExistInPluginsUnpackedDir(String pluginsDir,String[] filenames) throws IOException {
  File restPluginUnpackedDir=new File(pluginsDir + unpackedLocation);
  boolean fileExists=false;
  if (restPluginUnpackedDir.exists() && restPluginUnpackedDir.isDirectory()) {
    for (    String filename : filenames) {
      File jaxbjar=new File(restPluginUnpackedDir + File.separator + filename.replace("String_Node_Str",File.separator));
      if (jaxbjar.exists()) {
        fileExists=true;
      }
    }
  }
 else {
    Loggers.SERVER.debug("String_Node_Str" + restPluginUnpackedDir);
  }
  return fileExists;
}

Fixed version (ground truth):
protected boolean doFilesExistInPluginsUnpackedDir(String pluginsDir,String[] filenames,JarReport jarReport) throws IOException {
  File restPluginUnpackedDir=new File(pluginsDir + unpackedLocation);
  boolean fileExists=false;
  if (restPluginUnpackedDir.exists() && restPluginUnpackedDir.isDirectory()) {
    for (    String filename : filenames) {
      File jaxbjar=new File(restPluginUnpackedDir + File.separator + filename.replace("String_Node_Str",File.separator));
      if (jaxbjar.exists()) {
        fileExists=true;
        jarReport.setJarFoundInUnpackedLocation(filename,true);
      }
 else {
        jarReport.setJarFoundInUnpackedLocation(filename,false);
      }
    }
  }
 else {
    Loggers.SERVER.debug("String_Node_Str" + restPluginUnpackedDir);
  }
  return fileExists;
}
Program: 33437
Project: 33437
Buggy source:
protected boolean deleteFilesFromPluginsUnpackedDir(String pluginsDir,String[] filenames) throws IOException {
  File restPluginUnpackedDir=new File(pluginsDir + unpackedLocation);
  boolean fileDeletedFromDir=false;
  if (restPluginUnpackedDir.exists() && restPluginUnpackedDir.isDirectory()) {
    for (    String filename : filenames) {
      Path jaxbjar=new File(restPluginUnpackedDir + File.separator + filename.replace("String_Node_Str",File.separator)).toPath();
      if (Files.exists(jaxbjar)) {
        Files.delete(jaxbjar);
        if (Files.notExists(jaxbjar)) {
          fileDeletedFromDir=true;
        }
      }
    }
  }
  return fileDeletedFromDir;
}

Fixed version (ground truth):
protected boolean deleteFilesFromPluginsUnpackedDir(String pluginsDir,String[] filenames,JarReport jarReport) throws IOException {
  File restPluginUnpackedDir=new File(jarReport.getApiZipFileUnpackedLocation());
  boolean fileDeletedFromDir=false;
  if (restPluginUnpackedDir.exists() && restPluginUnpackedDir.isDirectory()) {
    for (    String filename : filenames) {
      Path jaxbjar=new File(restPluginUnpackedDir + File.separator + filename.replace("String_Node_Str",File.separator)).toPath();
      if (Files.exists(jaxbjar)) {
        try {
          Files.delete(jaxbjar);
          if (Files.notExists(jaxbjar)) {
            fileDeletedFromDir=true;
            jarReport.setJarAsRemovedFromUnpackedLocation(filename,true);
          }
        }
 catch (        IOException e) {
          jarReport.setUnpackedLocationFailureMessage(filename,e.getMessage());
          Loggers.SERVER.warnAndDebugDetails("String_Node_Str" + e.getMessage(),e);
        }
      }
    }
  }
  return fileDeletedFromDir;
}
Program: 33439
Project: 33439
Buggy source:
public static ProjectWebHooksBean build(WebHookProjectSettings projSettings,SBuildType sBuildType,SProject project,Collection<WebHookPayload> registeredPayloads,List<WebHookPayloadTemplate> templateList){
  ProjectWebHooksBean bean=new ProjectWebHooksBean();
  List<SBuildType> projectBuildTypes=TeamCityIdResolver.getOwnBuildTypes(project);
  Set<String> enabledBuildTypes=new HashSet<>();
  enabledBuildTypes.add(sBuildType.getBuildTypeId());
  bean.projectId=TeamCityIdResolver.getInternalProjectId(project);
  bean.externalProjectId=TeamCityIdResolver.getExternalProjectId(project);
  bean.webHookProjectSettings=projSettings;
  bean.webHookList=new LinkedHashMap<>();
  WebHookConfig newBlankConfig=new WebHookConfig("String_Node_Str",true,new BuildState().setAllEnabled(),null,null,false,false,enabledBuildTypes,null);
  newBlankConfig.setUniqueKey("String_Node_Str");
  addWebHookConfigHolder(bean,projectBuildTypes,newBlankConfig,registeredPayloads,templateList);
  for (  WebHookConfig config : projSettings.getBuildWebHooksAsList(sBuildType)) {
    addWebHookConfigHolder(bean,projectBuildTypes,config,registeredPayloads,templateList);
  }
  return bean;
}

Fixed version (ground truth):
public static ProjectWebHooksBean build(WebHookProjectSettings projSettings,SBuildType sBuildType,SProject project,Collection<WebHookPayload> registeredPayloads,List<WebHookPayloadTemplate> templateList){
  ProjectWebHooksBean bean=new ProjectWebHooksBean(projSettings,project);
  List<SBuildType> projectBuildTypes=TeamCityIdResolver.getOwnBuildTypes(project);
  Set<String> enabledBuildTypes=new HashSet<>();
  enabledBuildTypes.add(sBuildType.getBuildTypeId());
  WebHookConfig newBlankConfig=new WebHookConfig("String_Node_Str",true,new BuildState().setAllEnabled(),null,null,false,false,enabledBuildTypes,null);
  newBlankConfig.setUniqueKey("String_Node_Str");
  addWebHookConfigHolder(bean,projectBuildTypes,newBlankConfig,registeredPayloads,templateList);
  for (  WebHookConfig config : projSettings.getBuildWebHooksAsList(sBuildType)) {
    addWebHookConfigHolder(bean,projectBuildTypes,config,registeredPayloads,templateList);
  }
  return bean;
}
Program: 33440
Project: 33440
Buggy source:
public static ProjectWebHooksBean buildWithoutNew(WebHookProjectSettings projSettings,SBuildType sBuildType,SProject project,Collection<WebHookPayload> registeredPayloads,List<WebHookPayloadTemplate> templateList){
  ProjectWebHooksBean bean=new ProjectWebHooksBean();
  List<SBuildType> projectBuildTypes=TeamCityIdResolver.getOwnBuildTypes(project);
  Set<String> enabledBuildTypes=new HashSet<>();
  enabledBuildTypes.add(sBuildType.getBuildTypeId());
  bean.projectId=TeamCityIdResolver.getInternalProjectId(project);
  bean.externalProjectId=TeamCityIdResolver.getExternalProjectId(project);
  bean.webHookProjectSettings=projSettings;
  bean.webHookList=new LinkedHashMap<>();
  for (  WebHookConfig config : projSettings.getBuildWebHooksAsList(sBuildType)) {
    addWebHookConfigHolder(bean,projectBuildTypes,config,registeredPayloads,templateList);
  }
  return bean;
}

Fixed version (ground truth):
public static ProjectWebHooksBean buildWithoutNew(WebHookProjectSettings projSettings,SBuildType sBuildType,SProject project,Collection<WebHookPayload> registeredPayloads,List<WebHookPayloadTemplate> templateList){
  ProjectWebHooksBean bean=new ProjectWebHooksBean(projSettings,project);
  List<SBuildType> projectBuildTypes=TeamCityIdResolver.getOwnBuildTypes(project);
  Set<String> enabledBuildTypes=new HashSet<>();
  enabledBuildTypes.add(sBuildType.getBuildTypeId());
  for (  WebHookConfig config : projSettings.getBuildWebHooksAsList(sBuildType)) {
    addWebHookConfigHolder(bean,projectBuildTypes,config,registeredPayloads,templateList);
  }
  return bean;
}
Program: 33441
Project: 33441
Buggy source:
/** 
 * WebHooksConfig constructor. Unchecked version. Use with caution!! This constructor does not check if the payloadFormat is valid. It will still allow you to add the format, but the webhook might not fire at runtime if the payloadFormat configured is not available.
 * @param url
 * @param enabled
 * @param stateMask
 * @param payloadFormat (unvalidated)
 * @param webHookAuthConfig 
 */
public WebHookConfig(String url,Boolean enabled,BuildState states,String payloadFormat,String payloadTemplate,boolean buildTypeAllEnabled,boolean buildTypeSubProjects,Set<String> enabledBuildTypes,WebHookAuthConfig webHookAuthConfig){
  int Min=1000000, Max=1000000000;
  Integer Rand=Min + (int)(Math.random() * ((Max - Min) + 1));
  this.uniqueKey="String_Node_Str" + Rand.toString();
  this.extraParameters=new TreeMap<>();
  this.templates=new TreeMap<>();
  this.setUrl(url);
  this.setEnabled(enabled);
  this.setBuildStates(states);
  this.setPayloadFormat(payloadFormat);
  this.setPayloadTemplate(payloadTemplate);
  this.subProjectsEnabled=buildTypeSubProjects;
  this.allBuildTypesEnabled=buildTypeAllEnabled;
  if (!this.allBuildTypesEnabled) {
    this.enabledBuildTypesSet=enabledBuildTypes;
  }
  if (webHookAuthConfig != null) {
    this.authType=webHookAuthConfig.type;
    this.authPreemptive=webHookAuthConfig.preemptive;
    this.authEnabled=true;
    this.authParameters.putAll(webHookAuthConfig.parameters);
  }
}

Fixed version (ground truth):
/** 
 * WebHooksConfig constructor. Unchecked version. Use with caution!! This constructor does not check if the payloadFormat is valid. It will still allow you to add the format, but the webhook might not fire at runtime if the payloadFormat configured is not available.
 * @param url
 * @param enabled
 * @param stateMask
 * @param payloadFormat (unvalidated)
 * @param webHookAuthConfig 
 */
public WebHookConfig(String url,Boolean enabled,BuildState states,String payloadFormat,String payloadTemplate,boolean buildTypeAllEnabled,boolean buildTypeSubProjects,Set<String> enabledBuildTypes,WebHookAuthConfig webHookAuthConfig){
  int Min=1000000, Max=1000000000;
  Integer Rand=Min + (int)(Math.random() * ((Max - Min) + 1));
  this.uniqueKey="String_Node_Str" + Rand.toString();
  this.extraParameters=new TreeMap<>();
  this.templates=new TreeMap<>();
  this.filters=new ArrayList<>();
  this.setUrl(url);
  this.setEnabled(enabled);
  this.setBuildStates(states);
  this.setPayloadFormat(payloadFormat);
  this.setPayloadTemplate(payloadTemplate);
  this.subProjectsEnabled=buildTypeSubProjects;
  this.allBuildTypesEnabled=buildTypeAllEnabled;
  if (!this.allBuildTypesEnabled) {
    this.enabledBuildTypesSet=enabledBuildTypes;
  }
  if (webHookAuthConfig != null) {
    this.authType=webHookAuthConfig.type;
    this.authPreemptive=webHookAuthConfig.preemptive;
    this.authEnabled=true;
    this.authParameters.putAll(webHookAuthConfig.parameters);
  }
}
Program: 33444
Project: 33444
Buggy source:
public static ProjectWebHooksBean buildWithoutNew(WebHookProjectSettings projSettings,SProject project,Collection<WebHookPayload> registeredPayloads,List<WebHookTemplate> templateList){
  ProjectWebHooksBean bean=new ProjectWebHooksBean();
  List<SBuildType> projectBuildTypes=TeamCityIdResolver.getOwnBuildTypes(project);
  bean.projectId=TeamCityIdResolver.getInternalProjectId(project);
  bean.webHookList=new LinkedHashMap<String,WebhookConfigAndBuildTypeListHolder>();
  for (  WebHookConfig config : projSettings.getWebHooksAsList()) {
    addWebHookConfigHolder(bean,projectBuildTypes,config,registeredPayloads,templateList);
  }
  return bean;
}

Fixed version (ground truth):
public static ProjectWebHooksBean buildWithoutNew(WebHookProjectSettings projSettings,SBuildType sBuildType,SProject project,Collection<WebHookPayload> registeredPayloads,List<WebHookTemplate> templateList){
  ProjectWebHooksBean bean=new ProjectWebHooksBean();
  List<SBuildType> projectBuildTypes=TeamCityIdResolver.getOwnBuildTypes(project);
  Set<String> enabledBuildTypes=new HashSet<String>();
  enabledBuildTypes.add(sBuildType.getBuildTypeId());
  bean.projectId=TeamCityIdResolver.getInternalProjectId(project);
  bean.webHookList=new LinkedHashMap<String,WebhookConfigAndBuildTypeListHolder>();
  for (  WebHookConfig config : projSettings.getBuildWebHooksAsList(sBuildType)) {
    addWebHookConfigHolder(bean,projectBuildTypes,config,registeredPayloads,templateList);
  }
  return bean;
}
Program: 33445
Project: 33445
Buggy source:
/** 
 * WebHooksConfig constructor. Unchecked version. Use with caution!! This constructor does not check if the payloadFormat is valid. It will still allow you to add the format, but the webhook might not fire at runtime if the payloadFormat configured is not available.
 * @param url
 * @param enabled
 * @param stateMask
 * @param payloadFormat (unvalidated)
 */
public WebHookConfig(String url,Boolean enabled,BuildState states,String payloadFormat,String payloadTemplate,boolean buildTypeAllEnabled,boolean buildTypeSubProjects,Set<String> enabledBuildTypes){
  int Min=1000000, Max=1000000000;
  Integer Rand=Min + (int)(Math.random() * ((Max - Min) + 1));
  this.uniqueKey=Rand.toString();
  this.extraParameters=new TreeMap<>();
  this.templates=new TreeMap<>();
  this.setUrl(url);
  this.setEnabled(enabled);
  this.setBuildStates(states);
  this.setPayloadFormat(payloadFormat);
  this.setPayloadTemplate(payloadTemplate);
  this.subProjectsEnabled=buildTypeSubProjects;
  this.allBuildTypesEnabled=buildTypeAllEnabled;
  if (!this.allBuildTypesEnabled) {
    this.enabledBuildTypesSet=enabledBuildTypes;
  }
}

Fixed version (ground truth):
/** 
 * WebHooksConfig constructor. Unchecked version. Use with caution!! This constructor does not check if the payloadFormat is valid. It will still allow you to add the format, but the webhook might not fire at runtime if the payloadFormat configured is not available.
 * @param url
 * @param enabled
 * @param stateMask
 * @param payloadFormat (unvalidated)
 */
public WebHookConfig(String url,Boolean enabled,BuildState states,String payloadFormat,String payloadTemplate,boolean buildTypeAllEnabled,boolean buildTypeSubProjects,Set<String> enabledBuildTypes){
  int Min=1000000, Max=1000000000;
  Integer Rand=Min + (int)(Math.random() * ((Max - Min) + 1));
  this.uniqueKey=Rand.toString();
  this.extraParameters=new TreeMap<>();
  this.templates=new TreeMap<>();
  this.filters=new ArrayList<>();
  this.setUrl(url);
  this.setEnabled(enabled);
  this.setBuildStates(states);
  this.setPayloadFormat(payloadFormat);
  this.setPayloadTemplate(payloadTemplate);
  this.subProjectsEnabled=buildTypeSubProjects;
  this.allBuildTypesEnabled=buildTypeAllEnabled;
  if (!this.allBuildTypesEnabled) {
    this.enabledBuildTypesSet=enabledBuildTypes;
  }
}