nus-yam/ex-repair huggingface dataset:
Program: 8539
Project: 8539
Buggy source:
public void initData(Intent intent){
  String convid=intent.getStringExtra(CONVID);
  conversation=chatManager.lookUpConversationById(convid);
  if (conversation == null) {
    throw new NullPointerException("String_Node_Str");
  }
  initActionBar(ConversationHelper.titleOfConversation(conversation));
  messageAgent=new MessageAgent(conversation);
  messageAgent.setSendCallback(defaultSendCallback);
  roomsTable.clearUnread(conversation.getConversationId());
  conversationType=ConversationHelper.typeOfConversation(conversation);
  bindAdapterToListView(conversationType);
}

Fixed version (ground truth):
public void initData(Intent intent){
  String convid=intent.getStringExtra(CONVID);
  conversation=chatManager.lookUpConversationById(convid);
  if (isConversationEmpty(conversation)) {
    return;
  }
  initActionBar(ConversationHelper.titleOfConversation(conversation));
  messageAgent=new MessageAgent(conversation);
  messageAgent.setSendCallback(defaultSendCallback);
  roomsTable.clearUnread(conversation.getConversationId());
  conversationType=ConversationHelper.typeOfConversation(conversation);
  bindAdapterToListView(conversationType);
}
Program: 8540
Project: 8540
Buggy source:
public static void setCurrentChattingConvid(String currentChattingConvid){
  ChatActivity.currentChattingConvid=currentChattingConvid;
}

Fixed version (ground truth):
public static void setCurrentChattingConvid(String currentChattingConvid){
  ChatManager.currentChattingConvid=currentChattingConvid;
}
Program: 8541
Project: 8541
Buggy source:
protected void initActionBar(String title){
  ActionBar actionBar=getActionBar();
  if (actionBar == null) {
    throw new NullPointerException("String_Node_Str");
  }
  if (title != null) {
    actionBar.setTitle(title);
  }
  actionBar.setDisplayUseLogoEnabled(false);
  actionBar.setDisplayHomeAsUpEnabled(true);
}

Fixed version (ground truth):
protected void initActionBar(String title){
  ActionBar actionBar=getActionBar();
  if (actionBar != null) {
    if (title != null) {
      actionBar.setTitle(title);
    }
    actionBar.setDisplayUseLogoEnabled(false);
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
 else {
    LogUtils.i("String_Node_Str");
  }
}
Program: 8542
Project: 8542
Buggy source:
@Override public void done(List<AVIMTypedMessage> typedMessages,AVException e){
  refreshableView.finishRefreshing();
  if (filterException(e)) {
    new CacheMessagesTask(ChatActivity.this,typedMessages){
      @Override void onSucceed(      List<AVIMTypedMessage> typedMessages){
        List<AVIMTypedMessage> newMessages=new ArrayList<>();
        newMessages.addAll(typedMessages);
        newMessages.addAll(adapter.getDatas());
        adapter.setDatas(newMessages);
        adapter.notifyDataSetChanged();
        if (typedMessages.size() > 0) {
          messageListView.setSelection(typedMessages.size() - 1);
        }
 else {
          toast(R.string.chat_activity_loadMessagesFinish);
        }
      }
    }
.execute();
  }
}

Fixed version (ground truth):
@Override public void done(List<AVIMTypedMessage> typedMessages,AVException e){
  refreshableView.finishRefreshing();
  if (filterException(e)) {
    new CacheMessagesTask(ChatActivity.this,typedMessages){
      @Override void onSucceed(      List<AVIMTypedMessage> typedMessages){
        List<AVIMTypedMessage> newMessages=new ArrayList<>(PAGE_SIZE);
        newMessages.addAll(typedMessages);
        newMessages.addAll(adapter.getDatas());
        adapter.setDatas(newMessages);
        adapter.notifyDataSetChanged();
        if (typedMessages.size() > 0) {
          messageListView.setSelection(typedMessages.size() - 1);
        }
 else {
          toast(R.string.chat_activity_loadMessagesFinish);
        }
      }
    }
.execute();
  }
}
Program: 8543
Project: 8543
Buggy source:
@Override protected void onResume(){
  super.onResume();
  if (conversation == null) {
    throw new IllegalStateException("String_Node_Str");
  }
  setCurrentChattingConvid(conversation.getConversationId());
}

Fixed version (ground truth):
@Override protected void onResume(){
  super.onResume();
  if (isConversationEmpty(conversation)) {
    return;
  }
  setCurrentChattingConvid(conversation.getConversationId());
}
Program: 8544
Project: 8544
Buggy source:
@Override void onSucceed(List<AVIMTypedMessage> typedMessages){
  List<AVIMTypedMessage> newMessages=new ArrayList<>();
  newMessages.addAll(typedMessages);
  newMessages.addAll(adapter.getDatas());
  adapter.setDatas(newMessages);
  adapter.notifyDataSetChanged();
  if (typedMessages.size() > 0) {
    messageListView.setSelection(typedMessages.size() - 1);
  }
 else {
    toast(R.string.chat_activity_loadMessagesFinish);
  }
}

Fixed version (ground truth):
@Override void onSucceed(List<AVIMTypedMessage> typedMessages){
  List<AVIMTypedMessage> newMessages=new ArrayList<>(PAGE_SIZE);
  newMessages.addAll(typedMessages);
  newMessages.addAll(adapter.getDatas());
  adapter.setDatas(newMessages);
  adapter.notifyDataSetChanged();
  if (typedMessages.size() > 0) {
    messageListView.setSelection(typedMessages.size() - 1);
  }
 else {
    toast(R.string.chat_activity_loadMessagesFinish);
  }
}
Program: 8545
Project: 8545
Buggy source:
public void initRecordBtn(){
  recordBtn.setSavePath(com.avoscloud.leanchatlib.utils.PathUtils.getRecordTmpPath());
  recordBtn.setRecordEventListener(new RecordButton.RecordEventListener(){
    @Override public void onFinishedRecord(    final String audioPath,    int secs){
      messageAgent.sendAudio(audioPath);
    }
    @Override public void onStartRecord(){
    }
  }
);
}

Fixed version (ground truth):
public void initRecordBtn(){
  recordBtn.setSavePath(PathUtils.getRecordTmpPath());
  recordBtn.setRecordEventListener(new RecordButton.RecordEventListener(){
    @Override public void onFinishedRecord(    final String audioPath,    int secs){
      messageAgent.sendAudio(audioPath);
    }
    @Override public void onStartRecord(){
    }
  }
);
}
Program: 8546
Project: 8546
Buggy source:
@Override public void onError(AVIMTypedMessage message,Exception e){
  Utils.log();
  addMessageAndScroll(message);
}

Fixed version (ground truth):
@Override public void onError(AVIMTypedMessage message,Exception e){
  LogUtils.i();
  addMessageAndScroll(message);
}
Program: 8547
Project: 8547
Buggy source:
protected void onAddLocationButtonClicked(View v){
}

Fixed version (ground truth):
/** 
 * 当发送地理位置按钮被点击时
 * @param v
 */
protected void onAddLocationButtonClicked(View v){
}
Program: 8548
Project: 8548
Buggy source:
public void onEvent(MessageEvent messageEvent){
  final AVIMTypedMessage message=messageEvent.getMessage();
  if (message.getConversationId().equals(conversation.getConversationId())) {
    if (messageEvent.getType() == MessageEvent.Type.Come) {
      new CacheMessagesTask(this,Arrays.asList(message)){
        @Override void onSucceed(        List<AVIMTypedMessage> messages){
          addMessageAndScroll(message);
        }
      }
.execute();
    }
 else     if (messageEvent.getType() == MessageEvent.Type.Receipt) {
      Utils.log("String_Node_Str");
      AVIMTypedMessage originMessage=findMessage(message.getMessageId());
      if (originMessage != null) {
        originMessage.setMessageStatus(message.getMessageStatus());
        originMessage.setReceiptTimestamp(message.getReceiptTimestamp());
        adapter.notifyDataSetChanged();
      }
    }
  }
}

Fixed version (ground truth):
public void onEvent(MessageEvent messageEvent){
  final AVIMTypedMessage message=messageEvent.getMessage();
  if (message.getConversationId().equals(conversation.getConversationId())) {
    if (messageEvent.getType() == MessageEvent.Type.Come) {
      new CacheMessagesTask(this,Arrays.asList(message)){
        @Override void onSucceed(        List<AVIMTypedMessage> messages){
          addMessageAndScroll(message);
        }
      }
.execute();
    }
 else     if (messageEvent.getType() == MessageEvent.Type.Receipt) {
      AVIMTypedMessage originMessage=findMessage(message.getMessageId());
      if (originMessage != null) {
        originMessage.setMessageStatus(message.getMessageStatus());
        originMessage.setReceiptTimestamp(message.getReceiptTimestamp());
        adapter.notifyDataSetChanged();
      }
    }
  }
}
Program: 8549
Project: 8549
Buggy source:
private void bindAdapterToListView(ConversationType conversationType){
  adapter=new ChatMessageAdapter(this,conversationType);
  adapter.setClickListener(new ChatMessageAdapter.ClickListener(){
    @Override public void onFailButtonClick(    AVIMTypedMessage msg){
      messageAgent.resendMessage(msg,new MessageAgent.SendCallback(){
        @Override public void onError(        AVIMTypedMessage message,        Exception e){
          Utils.log();
          loadMessagesWhenInit(adapter.getCount());
        }
        @Override public void onSuccess(        AVIMTypedMessage message){
          Utils.log();
          loadMessagesWhenInit(adapter.getCount());
        }
      }
);
    }
    @Override public void onLocationViewClick(    AVIMLocationMessage locMsg){
      onLocationMessageViewClicked(locMsg);
    }
    @Override public void onImageViewClick(    AVIMImageMessage imageMsg){
      ImageBrowserActivity.go(ChatActivity.this,MessageHelper.getFilePath(imageMsg),imageMsg.getFileUrl());
    }
  }
);
  messageListView.setAdapter(adapter);
}

Fixed version (ground truth):
private void bindAdapterToListView(ConversationType conversationType){
  adapter=new ChatMessageAdapter(this,conversationType);
  adapter.setClickListener(new ChatMessageAdapter.ClickListener(){
    @Override public void onFailButtonClick(    AVIMTypedMessage msg){
      messageAgent.resendMessage(msg,new MessageAgent.SendCallback(){
        @Override public void onError(        AVIMTypedMessage message,        Exception e){
          LogUtils.i();
          loadMessagesWhenInit(adapter.getCount());
        }
        @Override public void onSuccess(        AVIMTypedMessage message){
          LogUtils.i();
          loadMessagesWhenInit(adapter.getCount());
        }
      }
);
    }
    @Override public void onLocationViewClick(    AVIMLocationMessage locMsg){
      onLocationMessageViewClicked(locMsg);
    }
    @Override public void onImageViewClick(    AVIMImageMessage imageMsg){
      ImageBrowserActivity.go(ChatActivity.this,MessageHelper.getFilePath(imageMsg),imageMsg.getFileUrl());
    }
  }
);
  messageListView.setAdapter(adapter);
}
Program: 8550
Project: 8550
Buggy source:
@Override public void onSuccess(AVIMTypedMessage message){
  Utils.log();
  addMessageAndScroll(message);
}

Fixed version (ground truth):
@Override public void onSuccess(AVIMTypedMessage message){
  addMessageAndScroll(message);
}
Program: 8551
Project: 8551
Buggy source:
@Override public int getItemViewType(int position){
  AVIMTypedMessage msg=datas.get(position);
  boolean comeMsg=isComeMsg(msg);
  MsgViewType viewType;
  AVIMReservedMessageType msgType=AVIMReservedMessageType.getAVIMReservedMessageType(msg.getMessageType());
switch (msgType) {
case TextMessageType:
    viewType=comeMsg ? MsgViewType.ComeText : MsgViewType.ToText;
  break;
case ImageMessageType:
viewType=comeMsg ? MsgViewType.ComeImage : MsgViewType.ToImage;
break;
case AudioMessageType:
viewType=comeMsg ? MsgViewType.ComeAudio : MsgViewType.ToAudio;
break;
case LocationMessageType:
viewType=comeMsg ? MsgViewType.ComeLocation : MsgViewType.ToLocation;
break;
default :
throw new IllegalStateException();
}
return viewType.getValue();
}

Fixed version (ground truth):
@Override public int getItemViewType(int position){
  AVIMTypedMessage msg=datas.get(position);
  boolean comeMsg=isComeMsg(msg);
  MsgViewType viewType;
  AVIMReservedMessageType msgType=AVIMReservedMessageType.getAVIMReservedMessageType(msg.getMessageType());
switch (msgType) {
case TextMessageType:
    viewType=comeMsg ? MsgViewType.ComeText : MsgViewType.ToText;
  break;
case ImageMessageType:
viewType=comeMsg ? MsgViewType.ComeImage : MsgViewType.ToImage;
break;
case AudioMessageType:
viewType=comeMsg ? MsgViewType.ComeAudio : MsgViewType.ToAudio;
break;
case LocationMessageType:
viewType=comeMsg ? MsgViewType.ComeLocation : MsgViewType.ToLocation;
break;
default :
viewType=comeMsg ? MsgViewType.ComeText : MsgViewType.ToText;
break;
}
return viewType.getValue();
}
Program: 8552
Project: 8552
Buggy source:
private void initPlayBtn(AVIMTypedMessage msg,PlayButton playBtn){
  playBtn.setLeftSide(isComeMsg(msg));
  AudioHelper audioHelper=AudioHelper.getInstance();
  playBtn.setAudioHelper(audioHelper);
  playBtn.setPath(MessageHelper.getFilePath(msg));
}

Fixed version (ground truth):
private void initPlayBtn(AVIMTypedMessage msg,PlayButton playBtn){
  playBtn.setLeftSide(isComeMsg(msg));
  playBtn.setPath(MessageHelper.getFilePath(msg));
}
Program: 8553
Project: 8553
Buggy source:
public View createViewByType(AVIMReservedMessageType type,boolean comeMsg){
  View baseView;
  if (comeMsg) {
    baseView=View.inflate(context,R.layout.chat_item_base_left,null);
  }
 else {
    baseView=View.inflate(context,R.layout.chat_item_base_right,null);
  }
  LinearLayout contentView=(LinearLayout)baseView.findViewById(R.id.contentLayout);
  int contentId;
switch (type) {
case TextMessageType:
    contentId=R.layout.chat_item_text;
  break;
case AudioMessageType:
contentId=R.layout.chat_item_audio;
break;
case ImageMessageType:
contentId=R.layout.chat_item_image;
break;
case LocationMessageType:
contentId=R.layout.chat_item_location;
break;
default :
throw new IllegalStateException();
}
contentView.removeAllViews();
View content=View.inflate(context,contentId,null);
if (type == AVIMReservedMessageType.AudioMessageType) {
PlayButton btn=(PlayButton)content;
btn.setLeftSide(comeMsg);
}
 else if (type == AVIMReservedMessageType.TextMessageType) {
TextView textView=(TextView)content;
if (comeMsg) {
textView.setTextColor(Color.BLACK);
}
 else {
textView.setTextColor(Color.WHITE);
}
}
contentView.addView(content);
return baseView;
}

Fixed version (ground truth):
public View createViewByType(AVIMReservedMessageType type,boolean comeMsg){
  View baseView;
  if (comeMsg) {
    baseView=View.inflate(context,R.layout.chat_item_base_left,null);
  }
 else {
    baseView=View.inflate(context,R.layout.chat_item_base_right,null);
  }
  LinearLayout contentView=(LinearLayout)baseView.findViewById(R.id.contentLayout);
  int contentId;
switch (type) {
case TextMessageType:
    contentId=R.layout.chat_item_text;
  break;
case AudioMessageType:
contentId=R.layout.chat_item_audio;
break;
case ImageMessageType:
contentId=R.layout.chat_item_image;
break;
case LocationMessageType:
contentId=R.layout.chat_item_location;
break;
default :
contentId=R.layout.chat_item_text;
break;
}
contentView.removeAllViews();
View content=View.inflate(context,contentId,null);
if (type == AVIMReservedMessageType.AudioMessageType) {
PlayButton btn=(PlayButton)content;
btn.setLeftSide(comeMsg);
}
 else if (type == AVIMReservedMessageType.TextMessageType) {
TextView textView=(TextView)content;
if (comeMsg) {
textView.setTextColor(Color.BLACK);
}
 else {
textView.setTextColor(Color.WHITE);
}
}
contentView.addView(content);
return baseView;
}
Program: 8555
Project: 8555
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case LOCATION_REQUEST:
      final double latitude=data.getDoubleExtra(LocationActivity.LATITUDE,0);
    final double longitude=data.getDoubleExtra(LocationActivity.LONGITUDE,0);
  final String address=data.getStringExtra(LocationActivity.ADDRESS);
if (!TextUtils.isEmpty(address)) {
  messageAgent.sendLocation(latitude,longitude,address);
}
 else {
  toast(R.string.chat_cannotGetYourAddressInfo);
}
hideBottomLayout();
break;
}
}
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent intent){
  super.onActivityResult(requestCode,resultCode,intent);
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case LOCATION_REQUEST:
      final double latitude=intent.getDoubleExtra(LocationActivity.LATITUDE,0);
    final double longitude=intent.getDoubleExtra(LocationActivity.LONGITUDE,0);
  final String address=intent.getStringExtra(LocationActivity.ADDRESS);
if (!TextUtils.isEmpty(address)) {
  messageAgent.sendLocation(latitude,longitude,address);
}
 else {
  toast(R.string.chat_cannotGetYourAddressInfo);
}
hideBottomLayout();
break;
}
}
}
Program: 8556
Project: 8556
Buggy source:
@TargetApi(Build.VERSION_CODES.KITKAT) @Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
  super.onActivityResult(requestCode,resultCode,data);
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case GALLERY_REQUEST:
case GALLERY_KITKAT_REQUEST:
      if (data == null) {
        toast("String_Node_Str");
        return;
      }
    Uri uri;
  if (requestCode == GALLERY_REQUEST) {
    uri=data.getData();
  }
 else {
    uri=data.getData();
    final int takeFlags=data.getFlags() & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
    getContentResolver().takePersistableUriPermission(uri,takeFlags);
  }
String localSelectPath=ProviderPathUtils.getPath(this,uri);
messageAgent.sendImage(localSelectPath);
hideBottomLayout();
break;
case TAKE_CAMERA_REQUEST:
messageAgent.sendImage(localCameraPath);
hideBottomLayout();
break;
}
}
}

Fixed version (ground truth):
@TargetApi(Build.VERSION_CODES.KITKAT) @Override protected void onActivityResult(int requestCode,int resultCode,Intent intent){
  super.onActivityResult(requestCode,resultCode,intent);
  if (resultCode == RESULT_OK) {
switch (requestCode) {
case GALLERY_REQUEST:
case GALLERY_KITKAT_REQUEST:
      if (intent == null) {
        toast("String_Node_Str");
        return;
      }
    Uri uri;
  if (requestCode == GALLERY_REQUEST) {
    uri=intent.getData();
  }
 else {
    uri=intent.getData();
    final int takeFlags=intent.getFlags() & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
    getContentResolver().takePersistableUriPermission(uri,takeFlags);
  }
String localSelectPath=ProviderPathUtils.getPath(this,uri);
messageAgent.sendImage(localSelectPath);
hideBottomLayout();
break;
case TAKE_CAMERA_REQUEST:
messageAgent.sendImage(localCameraPath);
hideBottomLayout();
break;
}
}
}
Program: 8557
Project: 8557
Buggy source:
public void selectImageFromCamera(){
  Intent openCameraIntent=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
  Uri imageUri=Uri.fromFile(new File(localCameraPath));
  openCameraIntent.putExtra(MediaStore.EXTRA_OUTPUT,imageUri);
  startActivityForResult(openCameraIntent,TAKE_CAMERA_REQUEST);
}

Fixed version (ground truth):
public void selectImageFromCamera(){
  Intent takePictureIntent=new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
  Uri imageUri=Uri.fromFile(new File(localCameraPath));
  takePictureIntent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,imageUri);
  if (takePictureIntent.resolveActivity(getPackageManager()) != null) {
    startActivityForResult(takePictureIntent,TAKE_CAMERA_REQUEST);
  }
}
Program: 8558
Project: 8558
Buggy source:
public static String checkAndMkdirs(String dir){
  File file=new File(dir);
  if (!file.exists()) {
    file.mkdirs();
  }
  return dir;
}

Fixed version (ground truth):
private static File checkAndMkdirs(File file){
  if (!file.exists()) {
    file.mkdirs();
  }
  return file;
}
Program: 8559
Project: 8559
Buggy source:
public static String getCacheDir(){
  return ChatManager.getContext().getCacheDir().getAbsolutePath() + "String_Node_Str";
}

Fixed version (ground truth):
private static File getCacheDir(){
  File sdcard=Environment.getExternalStorageDirectory();
  File leanchatDir=new File(sdcard,"String_Node_Str");
  return leanchatDir;
}
Program: 8560
Project: 8560
Buggy source:
public static String getChatFileDir(){
  String dir=getCacheDir() + "String_Node_Str";
  return checkAndMkdirs(dir);
}

Fixed version (ground truth):
private static File getChatFileDir(){
  File filesDir=new File(getCacheDir(),"String_Node_Str");
  return checkAndMkdirs(filesDir);
}
Program: 8561
Project: 8561
Buggy source:
public static String getRecordTmpPath(){
  return getChatFileDir() + "String_Node_Str";
}

Fixed version (ground truth):
public static String getRecordTmpPath(){
  return new File(getChatFileDir(),"String_Node_Str").getAbsolutePath();
}
Program: 8562
Project: 8562
Buggy source:
public static String getChatFilePath(String id){
  String dir=getChatFileDir();
  String path=dir + id;
  return path;
}

Fixed version (ground truth):
public static String getChatFilePath(String id){
  return new File(getChatFileDir(),id).getAbsolutePath();
}
Program: 8563
Project: 8563
Buggy source:
public synchronized static IM getInstance(){
  if (im == null) {
    im=new IM();
  }
  return im;
}

Fixed version (ground truth):
public static synchronized IM getInstance(){
  if (im == null) {
    im=new IM();
  }
  return im;
}
Program: 8564
Project: 8564
Buggy source:
@Override protected void onPost(Exception e){
  boolean chatting=ChatActivity.instance != null && ChatActivity.instance.isVisible() && CacheService.isCurConvid(message.getConversationId());
  if (!chatting && AVUser.getCurrentUser() != null) {
    PreferenceMap preferenceMap=PreferenceMap.getCurUserPrefDao(App.ctx);
    if (preferenceMap.isNotifyWhenNews()) {
      notifyMsg(App.ctx,conversation,message);
    }
  }
}

Fixed version (ground truth):
@Override protected void onPost(Exception exception){
  boolean chatting=ChatActivity.instance != null && ChatActivity.instance.isVisible() && CacheService.isCurConvid(message.getConversationId());
  if (!chatting && AVUser.getCurrentUser() != null) {
    PreferenceMap preferenceMap=PreferenceMap.getCurUserPrefDao(App.ctx);
    if (preferenceMap.isNotifyWhenNews()) {
      notifyMsg(App.ctx,conversation,message);
    }
  }
}
Program: 8565
Project: 8565
Buggy source:
@Override public void onMessage(final AVIMTypedMessage message,final AVIMConversation conversation,AVIMClient client){
  im.onMessage(message,conversation);
}

Fixed version (ground truth):
@Override public void onMessage(AVIMTypedMessage message,AVIMConversation conversation,AVIMClient client){
  im.onMessage(message,conversation);
}
Program: 8566
Project: 8566
Buggy source:
public static ProgressDialog showHorizontalDialog(Activity activity){
  ProgressDialog dialog=new ProgressDialog(activity);
  dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  dialog.setCancelable(true);
  dialog.show();
  return dialog;
}

Fixed version (ground truth):
public static ProgressDialog showHorizontalDialog(Activity activity){
  ProgressDialog dialog=new ProgressDialog(activity);
  dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  dialog.setCancelable(true);
  if (activity.isFinishing() == false) {
    dialog.show();
  }
  return dialog;
}
Program: 8567
Project: 8567
Buggy source:
public static ProgressDialog showHorizontalDialog(Activity activity){
  activity=modifyDialogContext(activity);
  ProgressDialog dialog=new ProgressDialog(activity);
  dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  dialog.setCancelable(true);
  dialog.show();
  return dialog;
}

Fixed version (ground truth):
public static ProgressDialog showHorizontalDialog(Activity activity){
  ProgressDialog dialog=new ProgressDialog(activity);
  dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
  dialog.setCancelable(true);
  dialog.show();
  return dialog;
}
Program: 8568
Project: 8568
Buggy source:
public static AlertDialog.Builder getBaseDialogBuilder(Activity ctx){
  ctx=modifyDialogContext(ctx);
  return new AlertDialog.Builder(ctx).setTitle(R.string.tips).setIcon(R.drawable.icon_info_2);
}

Fixed version (ground truth):
public static AlertDialog.Builder getBaseDialogBuilder(Activity ctx){
  return new AlertDialog.Builder(ctx).setTitle(R.string.tips).setIcon(R.drawable.icon_info_2);
}
Program: 8569
Project: 8569
Buggy source:
public static ProgressDialog showSpinnerDialog(Activity activity){
  activity=modifyDialogContext(activity);
  ProgressDialog dialog=new ProgressDialog(activity);
  dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  dialog.setCancelable(true);
  dialog.setMessage(App.ctx.getString(R.string.hardLoading));
  dialog.show();
  return dialog;
}

Fixed version (ground truth):
public static ProgressDialog showSpinnerDialog(Activity activity){
  ProgressDialog dialog=new ProgressDialog(activity);
  dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
  dialog.setCancelable(true);
  dialog.setMessage(App.ctx.getString(R.string.hardLoading));
  dialog.show();
  return dialog;
}
Program: 8570
Project: 8570
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.message_fragment,null);
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.message_fragment,container,false);
}
Program: 8571
Project: 8571
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.discover_fragment,null);
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.discover_fragment,container,false);
}
Program: 8572
Project: 8572
Buggy source:
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.my_space_fragment,null);
}

Fixed version (ground truth):
@Override public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState){
  return inflater.inflate(R.layout.my_space_fragment,container,false);
}
Program: 8573
Project: 8573
Buggy source:
/** 
 * Call this, if you want to override gear method of article handling, in this case, you can provide articles locally and let HelpStack choose from it. It is light weight call. Call this after calling setGear.
 * @param articleResId
 */
public void overrideGearArticlesWithLocalArticlePath(int articleResId){
}

Fixed version (ground truth):
/** 
 * Call this, if you want to override gear method of article handling, in this case, you can provide articles locally and let HelpStack choose from it. It is light weight call. Call this after calling setGear.
 * @param articleResId Article Resource ID
 */
public void overrideGearArticlesWithLocalArticlePath(int articleResId){
}
Program: 8574
Project: 8574
Buggy source:
/** 
 * Shows a credit @ bottom of the page.
 * @param showCredits
 */
public void setShowCredits(boolean showCredits){
  this.showCredits=showCredits;
}

Fixed version (ground truth):
/** 
 * Shows a credit @ bottom of the page.
 * @param showCredits Show Credits or not
 */
public void setShowCredits(boolean showCredits){
  this.showCredits=showCredits;
}
Program: 8575
Project: 8575
Buggy source:
/** 
 * Starts a Help activity. It shows all FAQ and also let user report new issue if not found in FAQ.
 * @param activity
 */
public void showHelp(Activity activity){
  activity.startActivity(new Intent("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Starts a Help activity. It shows all FAQ and also let user report new issue if not found in FAQ.
 * @param activity Activity
 */
public void showHelp(Activity activity){
  activity.startActivity(new Intent("String_Node_Str"));
}
Program: 8576
Project: 8576
Buggy source:
/** 
 * @param context
 * @return singleton instance of this class.
 */
public static HSHelpStack getInstance(Context context){
  if (singletonInstance == null) {
synchronized (HSHelpStack.class) {
      if (singletonInstance == null) {
        Log.d(TAG,"String_Node_Str");
        singletonInstance=new HSHelpStack(context.getApplicationContext());
      }
    }
  }
  return singletonInstance;
}

Fixed version (ground truth):
/** 
 * @param context Context
 * @return singleton instance of this class.
 */
public static HSHelpStack getInstance(Context context){
  if (singletonInstance == null) {
synchronized (HSHelpStack.class) {
      if (singletonInstance == null) {
        Log.d(TAG,"String_Node_Str");
        singletonInstance=new HSHelpStack(context.getApplicationContext());
      }
    }
  }
  return singletonInstance;
}
Program: 8577
Project: 8577
Buggy source:
/** 
 * Sets which gear to use in HelpStack. It has to be set before calling any show* functions.
 * @param gear
 */
public void setGear(HSGear gear){
  this.gear=gear;
}

Fixed version (ground truth):
/** 
 * Sets which gear to use in HelpStack. It has to be set before calling any show* functions.
 * @param gear Gear
 */
public void setGear(HSGear gear){
  this.gear=gear;
}
Program: 8578
Project: 8578
Buggy source:
/** 
 * @return if credit can be shown.
 * @default Yes
 */
public boolean getShowCredits(){
  return this.showCredits;
}

Fixed version (ground truth):
/** 
 * @return if credit can be shown.
 */
public boolean getShowCredits(){
  return this.showCredits;
}
Program: 8579
Project: 8579
Buggy source:
/** 
 * @param cancelTag
 * @param firstName
 * @param lastname
 * @param emailAddress
 * @param queue
 * @param success
 * @param errorListener
 */
public void registerNewUser(String cancelTag,String firstName,String lastname,String emailAddress,RequestQueue queue,OnFetchedSuccessListener success,ErrorListener errorListener){
  success.onSuccess(HSUser.createNewUserWithDetails(firstName,lastname,emailAddress));
}

Fixed version (ground truth):
/** 
 * @param cancelTag Cancel Tag
 * @param firstName First Name
 * @param lastname Last Name
 * @param emailAddress Email Address
 * @param queue Queue
 * @param success Success Listener
 * @param errorListener Error Listener
 */
public void registerNewUser(String cancelTag,String firstName,String lastname,String emailAddress,RequestQueue queue,OnFetchedSuccessListener success,ErrorListener errorListener){
  success.onSuccess(HSUser.createNewUserWithDetails(firstName,lastname,emailAddress));
}
Program: 8580
Project: 8580
Buggy source:
/** 
 * @param cancelTag
 * @param ticket
 * @param user
 * @param queue
 * @param success
 * @param errorListener
 */
public void fetchAllUpdateOnTicket(String cancelTag,HSTicket ticket,HSUser user,RequestQueue queue,OnFetchedArraySuccessListener success,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @param cancelTag Cancel Tag
 * @param ticket Ticket
 * @param user User
 * @param queue Queue
 * @param success Success Listener
 * @param errorListener Error Listener
 */
public void fetchAllUpdateOnTicket(String cancelTag,HSTicket ticket,HSUser user,RequestQueue queue,OnFetchedArraySuccessListener success,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}
Program: 8581
Project: 8581
Buggy source:
/** 
 * @param cancelTag
 * @param section
 * @param queue
 * @param success
 * @param errorListener
 */
public void fetchKBArticle(String cancelTag,HSKBItem section,RequestQueue queue,OnFetchedArraySuccessListener success,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @param cancelTag Cancel Tag
 * @param section Section
 * @param queue Queue
 * @param success Success listener
 * @param errorListener Error listener
 */
public void fetchKBArticle(String cancelTag,HSKBItem section,RequestQueue queue,OnFetchedArraySuccessListener success,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}
Program: 8582
Project: 8582
Buggy source:
/** 
 * Sets maximum number of attachment gears can handle.
 * @default 1
 * @param numberOfAttachmentGearCanHandle
 */
public void setNumberOfAttachmentGearCanHandle(int numberOfAttachmentGearCanHandle){
  this.numberOfAttachmentGearCanHandle=numberOfAttachmentGearCanHandle;
}

Fixed version (ground truth):
/** 
 * Sets maximum number of attachment gears can handle. Default:  1
 * @param numberOfAttachmentGearCanHandle Number of Attachments that the Gear can handle
 */
public void setNumberOfAttachmentGearCanHandle(int numberOfAttachmentGearCanHandle){
  this.numberOfAttachmentGearCanHandle=numberOfAttachmentGearCanHandle;
}
Program: 8583
Project: 8583
Buggy source:
/** 
 * HSUploadAttachment.getAttachment() can contain mime/Type and filename
 * @param user
 * @param subject
 * @param body
 * @param successListener
 * @param errorListener
 */
public void createNewTicket(String cancelTag,HSUser user,String subject,String body,HSUploadAttachment[] attachments,RequestQueue queue,OnNewTicketFetchedSuccessListener successListener,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * HSUploadAttachment.getAttachment() can contain mime/Type and filename
 * @param user User
 * @param subject Subject
 * @param body Body
 * @param successListener Success Listener
 * @param errorListener Error Listener
 */
public void createNewTicket(String cancelTag,HSUser user,String subject,String body,HSUploadAttachment[] attachments,RequestQueue queue,OnNewTicketFetchedSuccessListener successListener,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}
Program: 8584
Project: 8584
Buggy source:
/** 
 * if true, gear don't have to return back HSTicketUpdate object, after a reply is been added.
 * @default : false, means it is necessary for the gear to return HSTicketUpdate object, after a reply is been added.
 * @param canIgnore
 */
public void ignoreTicketUpdateInformationAfterAddingReply(boolean canIgnore){
  this.ignoreTicketUpdateInformationAfterAddingReply=canIgnore;
}

Fixed version (ground truth):
/** 
 * if true, gear don't have to return back HSTicketUpdate object, after a reply is been added. Default: false, means it is necessary for the gear to return HSTicketUpdate object, after a reply is been added.
 * @param canIgnore Can Ignore
 */
public void ignoreTicketUpdateInformationAfterAddingReply(boolean canIgnore){
  this.ignoreTicketUpdateInformationAfterAddingReply=canIgnore;
}
Program: 8585
Project: 8585
Buggy source:
/** 
 * Set this parameter, if gear is not implementing handling of Issues. Doing this, default email client will be open with given support Email Address. Then there is no need to implement issues fetching related methods.
 * @default  it is considered that gear is gonna implement ticket fetching.
 * @param companySupportEmailAddress
 */
public void setNotImplementingTicketsFetching(String companySupportEmailAddress){
  implementsTicketFetching=false;
  this.companySupportEmailAddress=companySupportEmailAddress;
}

Fixed version (ground truth):
/** 
 * Set this parameter, if gear is not implementing handling of Issues. Doing this, default email client will be open with given support Email Address. Then there is no need to implement issues fetching related methods. Default:   it is considered that gear is gonna implement ticket fetching.
 * @param companySupportEmailAddress Company Support Email Address
 */
public void setNotImplementingTicketsFetching(String companySupportEmailAddress){
  implementsTicketFetching=false;
  this.companySupportEmailAddress=companySupportEmailAddress;
}
Program: 8586
Project: 8586
Buggy source:
/** 
 * @param message
 * @param ticket
 * @param user
 * @param queue
 * @param success
 * @param errorListener
 */
public void addReplyOnATicket(String cancelTag,String message,HSUploadAttachment[] attachments,HSTicket ticket,HSUser user,RequestQueue queue,OnFetchedSuccessListener success,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @param message Message
 * @param ticket Ticket
 * @param user User
 * @param queue Queue
 * @param success Success Listener
 * @param errorListener Error Listener
 */
public void addReplyOnATicket(String cancelTag,String message,HSUploadAttachment[] attachments,HSTicket ticket,HSUser user,RequestQueue queue,OnFetchedSuccessListener success,ErrorListener errorListener){
  errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
}
Program: 8587
Project: 8587
Buggy source:
/** 
 * Returns if gear have implemented Ticket Fetching. Modify this parameter using   {@link #setNotImplementingTicketsFetching(java.lang.String) setNotImplementingTicketsFetching}
 * @default true
 * @return
 */
public boolean haveImplementedTicketFetching(){
  return implementsTicketFetching;
}

Fixed version (ground truth):
/** 
 * Returns if gear have implemented Ticket Fetching. Modify this parameter using   {@link #setNotImplementingTicketsFetching(java.lang.String) setNotImplementingTicketsFetching}Default:  true
 */
public boolean haveImplementedTicketFetching(){
  return implementsTicketFetching;
}
Program: 8588
Project: 8588
Buggy source:
/** 
 * Set this parameter, if gear is not implementing handling of FAQ. Doing this, FAQ will be fetched from article path. Then there is no need to implement issues fetching related methods.
 * @default  it is considered that gear is gonna implement email fetching.
 * @param articleResid
 */
public void setNotImplementingKBFetching(int articleResid){
  implementsKBFetching=false;
  this.articleResid=articleResid;
}

Fixed version (ground truth):
/** 
 * Set this parameter, if gear is not implementing handling of FAQ. Doing this, FAQ will be fetched from article path. Then there is no need to implement issues fetching related methods. Default:   it is considered that gear is gonna implement email fetching.
 * @param articleResid Article Resource ID
 */
public void setNotImplementingKBFetching(int articleResid){
  implementsKBFetching=false;
  this.articleResid=articleResid;
}
Program: 8589
Project: 8589
Buggy source:
/** 
 * If this parameter is set, message written by user in chat screen and new issue screen will be returned in HTML format.
 * @default false
 * @param htmlEnabled
 */
public void uploadMessageAsHtmlString(boolean htmlEnabled){
  this.supportHtmlMessage=htmlEnabled;
}

Fixed version (ground truth):
/** 
 * If this parameter is set, message written by user in chat screen and new issue screen will be returned in HTML format. Default:  false
 * @param htmlEnabled HTML Enabled
 */
public void uploadMessageAsHtmlString(boolean htmlEnabled){
  this.supportHtmlMessage=htmlEnabled;
}
Program: 8590
Project: 8590
Buggy source:
/** 
 * @return maximum number of attachment gear can handle.
 * @default is 1
 */
public int getNumberOfAttachmentGearCanHandle(){
  return numberOfAttachmentGearCanHandle;
}

Fixed version (ground truth):
/** 
 * @return maximum number of attachment gear can handle.Default:  is 1
 */
public int getNumberOfAttachmentGearCanHandle(){
  return numberOfAttachmentGearCanHandle;
}
Program: 8591
Project: 8591
Buggy source:
/** 
 * Returns if gear have implemented KB Fetching. Modify this parameter using   {@link #setNotImplementingKBFetching(int) setNotImplementingKBFetching}
 * @default true
 * @return
 */
public boolean haveImplementedKBFetching(){
  return implementsKBFetching;
}

Fixed version (ground truth):
/** 
 * Returns if gear have implemented KB Fetching. Modify this parameter using   {@link #setNotImplementingKBFetching(int) setNotImplementingKBFetching}Default:  true
 */
public boolean haveImplementedKBFetching(){
  return implementsKBFetching;
}
Program: 8592
Project: 8592
Buggy source:
/** 
 * returns if gear can upload message as html string.
 * @default false
 * @return
 */
public boolean canUplaodMessageAsHtmlString(){
  return supportHtmlMessage;
}

Fixed version (ground truth):
/** 
 * returns if gear can upload message as html string. Default:  false
 */
public boolean canUplaodMessageAsHtmlString(){
  return supportHtmlMessage;
}
Program: 8593
Project: 8593
Buggy source:
@Override public void fetchAllUpdateOnTicket(String cancelTag,HSTicket ticket,HSUser user,RequestQueue queue,OnFetchedArraySuccessListener success,ErrorListener errorListener){
  TicketFormRequest request=new TicketFormRequest(getApiUrl() + "String_Node_Str" + ticket.getTicketId(),new HappyfoxArrayBaseListener<JSONObject>(success,errorListener){
    @Override public void onResponse(    JSONObject response){
      try {
        JSONArray updateArray=response.getJSONArray("String_Node_Str");
        ArrayList<HSTicketUpdate> ticketUpdates=new ArrayList<HSTicketUpdate>();
        int updateLen=updateArray.length();
        for (int i=0; i < updateLen; i++) {
          JSONObject updateObject=updateArray.getJSONObject(i);
          if (!updateObject.isNull("String_Node_Str")) {
            ticketUpdates.add(parseTicketUpdateFromJson(updateObject));
          }
        }
        HSTicketUpdate[] array=new HSTicketUpdate[0];
        array=ticketUpdates.toArray(array);
        this.successCallback.onSuccess(array);
      }
 catch (      JSONException e) {
        e.printStackTrace();
        this.errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
      }
    }
  }
,errorListener);
  request.addCredential(api_key,auth_code);
  request.setTag(cancelTag);
  queue.add(request);
  queue.start();
}

Fixed version (ground truth):
@Override public void fetchAllUpdateOnTicket(String cancelTag,HSTicket ticket,HSUser user,RequestQueue queue,OnFetchedArraySuccessListener success,ErrorListener errorListener){
  TicketFormRequest request=new TicketFormRequest(getApiUrl() + "String_Node_Str" + ticket.getTicketId(),new HappyfoxArrayBaseListener<JSONObject>(success,errorListener){
    @Override public void onResponse(    JSONObject response){
      try {
        JSONArray updateArray=response.getJSONArray("String_Node_Str");
        ArrayList<HSTicketUpdate> ticketUpdates=new ArrayList<HSTicketUpdate>();
        int updateLen=updateArray.length();
        for (int i=0; i < updateLen; i++) {
          JSONObject updateObject=updateArray.getJSONObject(i);
          if (!updateObject.isNull("String_Node_Str")) {
            HSTicketUpdate update=parseTicketUpdateFromJson(updateObject);
            if (update != null) {
              ticketUpdates.add(update);
            }
          }
        }
        HSTicketUpdate[] array=new HSTicketUpdate[0];
        array=ticketUpdates.toArray(array);
        this.successCallback.onSuccess(array);
      }
 catch (      JSONException e) {
        e.printStackTrace();
        this.errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
      }
    }
  }
,errorListener);
  request.addCredential(api_key,auth_code);
  request.setTag(cancelTag);
  queue.add(request);
  queue.start();
}
Program: 8595
Project: 8595
Buggy source:
@Override public void onResponse(JSONObject response){
  try {
    JSONArray updateArray=response.getJSONArray("String_Node_Str");
    ArrayList<HSTicketUpdate> ticketUpdates=new ArrayList<HSTicketUpdate>();
    int updateLen=updateArray.length();
    for (int i=0; i < updateLen; i++) {
      JSONObject updateObject=updateArray.getJSONObject(i);
      if (!updateObject.isNull("String_Node_Str")) {
        ticketUpdates.add(parseTicketUpdateFromJson(updateObject));
      }
    }
    HSTicketUpdate[] array=new HSTicketUpdate[0];
    array=ticketUpdates.toArray(array);
    this.successCallback.onSuccess(array);
  }
 catch (  JSONException e) {
    e.printStackTrace();
    this.errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
  }
}

Fixed version (ground truth):
@Override public void onResponse(JSONObject response){
  try {
    JSONArray updateArray=response.getJSONArray("String_Node_Str");
    ArrayList<HSTicketUpdate> ticketUpdates=new ArrayList<HSTicketUpdate>();
    int updateLen=updateArray.length();
    for (int i=0; i < updateLen; i++) {
      JSONObject updateObject=updateArray.getJSONObject(i);
      if (!updateObject.isNull("String_Node_Str")) {
        HSTicketUpdate update=parseTicketUpdateFromJson(updateObject);
        if (update != null) {
          ticketUpdates.add(update);
        }
      }
    }
    HSTicketUpdate[] array=new HSTicketUpdate[0];
    array=ticketUpdates.toArray(array);
    this.successCallback.onSuccess(array);
  }
 catch (  JSONException e) {
    e.printStackTrace();
    this.errorListener.onErrorResponse(new VolleyError("String_Node_Str"));
  }
}
Program: 8598
Project: 8598
Buggy source:
private JSONObject searchForUser(int userId,JSONArray usersArray) throws JSONException {
  JSONObject usersObject=null;
  int usersArrayLength=usersArray.length();
  for (int i=0; i < usersArrayLength; i++) {
    usersObject=usersArray.getJSONObject(i);
    if (usersObject.getInt("String_Node_Str") == userId) {
      return usersObject;
    }
  }
  return usersObject;
}

Fixed version (ground truth):
private JSONObject searchForUser(int userId,JSONArray usersArray) throws JSONException {
  JSONObject usersObject=null;
  int usersArrayLength=usersArray.length();
  for (int i=0; i < usersArrayLength; i++) {
    usersObject=usersArray.getJSONObject(i);
    if (usersObject.getInt("String_Node_Str") == userId) {
      return usersObject;
    }
  }
  return null;
}
Program: 8599
Project: 8599
Buggy source:
@Override public void onCreate(){
  super.onCreate();
  helpStack=HSHelpStack.getInstance(this);
  HSDeskGear deskGear=new HSDeskGear("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  helpStack.setGear(deskGear);
}

Fixed version (ground truth):
@Override public void onCreate(){
  super.onCreate();
  helpStack=HSHelpStack.getInstance(this);
  HSZendeskGear zenDeskGear=new HSZendeskGear("String_Node_Str","String_Node_Str","String_Node_Str");
  helpStack.setGear(zenDeskGear);
}
Program: 8600
Project: 8600
Buggy source:
public void loadImage(){
  closeAsync();
  localAsync=new LocalAsync();
  localAsync.execute(image_url);
}

Fixed version (ground truth):
public void loadImage(){
  if (image_url.startsWith("String_Node_Str")) {
    closeAsync();
    localAsync=new LocalAsync();
    localAsync.execute(image_url);
    getActivity().invalidateOptionsMenu();
  }
 else   if (image_url.startsWith("String_Node_Str")) {
    Bitmap selectedBitmap;
    try {
      selectedBitmap=NewIssueFragment.downscaleAndReadBitmap(getActivity(),Uri.parse(image_url));
      imageView.setImageBitmap(selectedBitmap);
      showLoading(false);
    }
 catch (    FileNotFoundException e) {
      Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
      getActivity().finish();
    }
  }
 else {
    Toast.makeText(getActivity(),"String_Node_Str",Toast.LENGTH_LONG).show();
    getActivity().finish();
  }
}