Program: 162554
Project: 162554
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  final boolean edit=getArguments().getBoolean("String_Node_Str",false);
  final String path=getArguments().getString("String_Node_Str");
  final String name=getArguments().getString("String_Node_Str");
  context=getActivity();
  emptyAddress=String.format(getString(R.string.cantbeempty),getString(R.string.ip));
  emptyName=String.format(getString(R.string.cantbeempty),getString(R.string.connectionname));
  invalidDomain=String.format(getString(R.string.invalid),getString(R.string.domain));
  invalidUsername=String.format(getString(R.string.invalid),getString(R.string.username).toLowerCase());
  if (getActivity() instanceof SmbConnectionListener) {
    smbConnectionListener=(SmbConnectionListener)getActivity();
  }
  final SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  final MaterialDialog.Builder ba3=new MaterialDialog.Builder(context);
  ba3.title((R.string.smb_con));
  ba3.autoDismiss(false);
  final View v2=getActivity().getLayoutInflater().inflate(R.layout.smb_dialog,null);
  final TextInputLayout connectionTIL=(TextInputLayout)v2.findViewById(R.id.connectionTIL);
  final TextInputLayout ipTIL=(TextInputLayout)v2.findViewById(R.id.ipTIL);
  final TextInputLayout domainTIL=(TextInputLayout)v2.findViewById(R.id.domainTIL);
  final TextInputLayout usernameTIL=(TextInputLayout)v2.findViewById(R.id.usernameTIL);
  final AppCompatEditText con_name=(AppCompatEditText)v2.findViewById(R.id.connectionET);
  con_name.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (con_name.getText().toString().length() == 0)       connectionTIL.setError(emptyName);
 else       connectionTIL.setError("String_Node_Str");
    }
  }
);
  final AppCompatEditText ip=(AppCompatEditText)v2.findViewById(R.id.ipET);
  ip.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (ip.getText().toString().length() == 0)       ipTIL.setError(emptyAddress);
 else       ipTIL.setError("String_Node_Str");
    }
  }
);
  final AppCompatEditText domain=(AppCompatEditText)v2.findViewById(R.id.domainET);
  domain.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (domain.getText().toString().contains("String_Node_Str"))       domainTIL.setError(invalidDomain);
 else       domainTIL.setError("String_Node_Str");
    }
  }
);
  final AppCompatEditText user=(AppCompatEditText)v2.findViewById(R.id.usernameET);
  user.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (user.getText().toString().contains("String_Node_Str"))       usernameTIL.setError(invalidUsername);
 else       usernameTIL.setError("String_Node_Str");
    }
  }
);
  int color=Color.parseColor(PreferenceUtils.getAccentString(sharedPreferences));
  final AppCompatEditText pass=(AppCompatEditText)v2.findViewById(R.id.passwordET);
  final AppCompatCheckBox ch=(AppCompatCheckBox)v2.findViewById(R.id.checkBox2);
  TextView help=(TextView)v2.findViewById(R.id.wanthelp);
  setTint(con_name,color);
  setTint(user,color);
  setTint(pass,color);
  Futils.setTint(ch,color);
  help.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Futils.showSMBHelpDialog(context,PreferenceUtils.getAccentString(sharedPreferences));
    }
  }
);
  ch.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (ch.isChecked()) {
        user.setEnabled(false);
        pass.setEnabled(false);
      }
 else {
        user.setEnabled(true);
        pass.setEnabled(true);
      }
    }
  }
);
  if (edit) {
    String userp="String_Node_Str", passp="String_Node_Str", ipp="String_Node_Str", domainp="String_Node_Str";
    con_name.setText(name);
    try {
      jcifs.Config.registerSmbURLHandler();
      URL a=new URL(path);
      String userinfo=a.getUserInfo();
      if (userinfo != null) {
        String inf=URLDecoder.decode(userinfo,"String_Node_Str");
        int domainDelim=!inf.contains("String_Node_Str") ? 0 : inf.indexOf(';');
        domainp=inf.substring(0,domainDelim);
        if (domainp != null && domainp.length() > 0)         inf=inf.substring(domainDelim + 1);
        userp=inf.substring(0,inf.indexOf("String_Node_Str"));
        passp=inf.substring(inf.indexOf("String_Node_Str") + 1,inf.length());
        domain.setText(domainp);
        user.setText(userp);
        pass.setText(passp);
      }
 else       ch.setChecked(true);
      ipp=a.getHost();
      ip.setText(ipp);
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
catch (    MalformedURLException e) {
      e.printStackTrace();
    }
  }
 else   if (path != null && path.length() > 0) {
    con_name.setText(name);
    ip.setText(path);
    user.requestFocus();
  }
 else {
    con_name.setText(R.string.smb_con);
    con_name.requestFocus();
  }
  ba3.customView(v2,true);
  ba3.theme(utilsProvider.getAppTheme().getMaterialDialogTheme());
  ba3.neutralText(R.string.cancel);
  ba3.positiveText(R.string.create);
  if (edit)   ba3.negativeText(R.string.delete);
  ba3.positiveColor(color).negativeColor(color).neutralColor(color);
  ba3.onPositive(new MaterialDialog.SingleButtonCallback(){
    @Override public void onClick(    @NonNull MaterialDialog dialog,    @NonNull DialogAction which){
      String s[];
      String ipa=ip.getText().toString();
      String con_nam=con_name.getText().toString();
      String sDomain=domain.getText().toString();
      String username=user.getText().toString();
      TextInputLayout firstInvalidField=null;
      if (con_nam == null || con_nam.length() == 0) {
        connectionTIL.setError(emptyName);
        firstInvalidField=connectionTIL;
      }
      if (ipa == null || ipa.length() == 0) {
        ipTIL.setError(emptyAddress);
        if (firstInvalidField == null)         firstInvalidField=ipTIL;
      }
      if (sDomain.contains("String_Node_Str")) {
        domainTIL.setError(invalidDomain);
        if (firstInvalidField == null)         firstInvalidField=domainTIL;
      }
      if (username.contains("String_Node_Str")) {
        usernameTIL.setError(invalidUsername);
        if (firstInvalidField == null)         firstInvalidField=usernameTIL;
      }
      if (firstInvalidField != null) {
        firstInvalidField.requestFocus();
        return;
      }
      SmbFile smbFile;
      String domaind=domain.getText().toString();
      if (ch.isChecked())       smbFile=connectingWithSmbServer(new String[]{ipa,"String_Node_Str","String_Node_Str",domaind},true);
 else {
        String useru=user.getText().toString();
        String passp=pass.getText().toString();
        smbFile=connectingWithSmbServer(new String[]{ipa,useru,passp,domaind},false);
      }
      if (smbFile == null)       return;
      s=new String[]{con_name.getText().toString(),smbFile.getPath()};
      if (smbConnectionListener != null) {
        smbConnectionListener.addConnection(edit,s[0],s[1],name,path);
      }
      dismiss();
    }
  }
);
  ba3.onNegative(new MaterialDialog.SingleButtonCallback(){
    @Override public void onClick(    @NonNull MaterialDialog dialog,    @NonNull DialogAction which){
      if (smbConnectionListener != null) {
        smbConnectionListener.deleteConnection(name,path);
        dismiss();
      }
    }
  }
);
  ba3.onNeutral(new MaterialDialog.SingleButtonCallback(){
    @Override public void onClick(    @NonNull MaterialDialog dialog,    @NonNull DialogAction which){
      dismiss();
    }
  }
);
  return ba3.build();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  final boolean edit=getArguments().getBoolean("String_Node_Str",false);
  final String path=getArguments().getString("String_Node_Str");
  final String name=getArguments().getString("String_Node_Str");
  context=getActivity();
  emptyAddress=String.format(getString(R.string.cantbeempty),getString(R.string.ip));
  emptyName=String.format(getString(R.string.cantbeempty),getString(R.string.connectionname));
  invalidDomain=String.format(getString(R.string.invalid),getString(R.string.domain));
  invalidUsername=String.format(getString(R.string.invalid),getString(R.string.username).toLowerCase());
  if (getActivity() instanceof SmbConnectionListener) {
    smbConnectionListener=(SmbConnectionListener)getActivity();
  }
  final SharedPreferences sharedPreferences=PreferenceManager.getDefaultSharedPreferences(context);
  final MaterialDialog.Builder ba3=new MaterialDialog.Builder(context);
  ba3.title((R.string.smb_con));
  ba3.autoDismiss(false);
  final View v2=getActivity().getLayoutInflater().inflate(R.layout.smb_dialog,null);
  final TextInputLayout connectionTIL=(TextInputLayout)v2.findViewById(R.id.connectionTIL);
  final TextInputLayout ipTIL=(TextInputLayout)v2.findViewById(R.id.ipTIL);
  final TextInputLayout domainTIL=(TextInputLayout)v2.findViewById(R.id.domainTIL);
  final TextInputLayout usernameTIL=(TextInputLayout)v2.findViewById(R.id.usernameTIL);
  final AppCompatEditText con_name=(AppCompatEditText)v2.findViewById(R.id.connectionET);
  con_name.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (con_name.getText().toString().length() == 0)       connectionTIL.setError(emptyName);
 else       connectionTIL.setError("String_Node_Str");
    }
  }
);
  final AppCompatEditText ip=(AppCompatEditText)v2.findViewById(R.id.ipET);
  ip.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (ip.getText().toString().length() == 0)       ipTIL.setError(emptyAddress);
 else       ipTIL.setError("String_Node_Str");
    }
  }
);
  final AppCompatEditText domain=(AppCompatEditText)v2.findViewById(R.id.domainET);
  domain.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (domain.getText().toString().contains("String_Node_Str"))       domainTIL.setError(invalidDomain);
 else       domainTIL.setError("String_Node_Str");
    }
  }
);
  final AppCompatEditText user=(AppCompatEditText)v2.findViewById(R.id.usernameET);
  user.addTextChangedListener(new TextWatcher(){
    @Override public void beforeTextChanged(    CharSequence s,    int start,    int count,    int after){
    }
    @Override public void onTextChanged(    CharSequence s,    int start,    int before,    int count){
    }
    @Override public void afterTextChanged(    Editable s){
      if (user.getText().toString().contains("String_Node_Str"))       usernameTIL.setError(invalidUsername);
 else       usernameTIL.setError("String_Node_Str");
    }
  }
);
  int color=Color.parseColor(PreferenceUtils.getAccentString(sharedPreferences));
  final AppCompatEditText pass=(AppCompatEditText)v2.findViewById(R.id.passwordET);
  final AppCompatCheckBox ch=(AppCompatCheckBox)v2.findViewById(R.id.checkBox2);
  TextView help=(TextView)v2.findViewById(R.id.wanthelp);
  setTint(con_name,color);
  setTint(user,color);
  setTint(pass,color);
  Futils.setTint(ch,color);
  help.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      Futils.showSMBHelpDialog(context,PreferenceUtils.getAccentString(sharedPreferences));
    }
  }
);
  ch.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View view){
      if (ch.isChecked()) {
        user.setEnabled(false);
        pass.setEnabled(false);
      }
 else {
        user.setEnabled(true);
        pass.setEnabled(true);
      }
    }
  }
);
  if (edit) {
    String userp="String_Node_Str", passp="String_Node_Str", ipp="String_Node_Str", domainp="String_Node_Str";
    con_name.setText(name);
    try {
      jcifs.Config.registerSmbURLHandler();
      URL a=new URL(path);
      String userinfo=a.getUserInfo();
      if (userinfo != null) {
        String inf=URLDecoder.decode(userinfo,"String_Node_Str");
        int domainDelim=!inf.contains("String_Node_Str") ? 0 : inf.indexOf(';');
        domainp=inf.substring(0,domainDelim);
        if (domainp != null && domainp.length() > 0)         inf=inf.substring(domainDelim + 1);
        userp=inf.substring(0,inf.indexOf("String_Node_Str"));
        passp=inf.substring(inf.indexOf("String_Node_Str") + 1,inf.length());
        domain.setText(domainp);
        user.setText(userp);
        pass.setText(passp);
      }
 else       ch.setChecked(true);
      ipp=a.getHost();
      ip.setText(ipp);
    }
 catch (    UnsupportedEncodingException e) {
      e.printStackTrace();
    }
catch (    MalformedURLException e) {
      e.printStackTrace();
    }
  }
 else   if (path != null && path.length() > 0) {
    con_name.setText(name);
    ip.setText(path);
    user.requestFocus();
  }
 else {
    con_name.setText(R.string.smb_con);
    con_name.requestFocus();
  }
  ba3.customView(v2,true);
  ba3.theme(utilsProvider.getAppTheme().getMaterialDialogTheme());
  ba3.neutralText(R.string.cancel);
  ba3.positiveText(R.string.create);
  if (edit)   ba3.negativeText(R.string.delete);
  ba3.positiveColor(color).negativeColor(color).neutralColor(color);
  ba3.onPositive(new MaterialDialog.SingleButtonCallback(){
    @Override public void onClick(    @NonNull MaterialDialog dialog,    @NonNull DialogAction which){
      String s[];
      String ipa=ip.getText().toString();
      String con_nam=con_name.getText().toString();
      String sDomain=domain.getText().toString();
      String username=user.getText().toString();
      TextInputLayout firstInvalidField=null;
      if (con_nam == null || con_nam.length() == 0) {
        connectionTIL.setError(emptyName);
        firstInvalidField=connectionTIL;
      }
      if (ipa == null || ipa.length() == 0) {
        ipTIL.setError(emptyAddress);
        if (firstInvalidField == null)         firstInvalidField=ipTIL;
      }
      if (sDomain.contains("String_Node_Str")) {
        domainTIL.setError(invalidDomain);
        if (firstInvalidField == null)         firstInvalidField=domainTIL;
      }
      if (username.contains("String_Node_Str")) {
        usernameTIL.setError(invalidUsername);
        if (firstInvalidField == null)         firstInvalidField=usernameTIL;
      }
      if (firstInvalidField != null) {
        firstInvalidField.requestFocus();
        return;
      }
      SmbFile smbFile;
      String domaind=domain.getText().toString();
      if (ch.isChecked())       smbFile=connectingWithSmbServer(new String[]{ipa,"String_Node_Str","String_Node_Str",domaind},true);
 else {
        String useraw=user.getText().toString();
        String useru=useraw.replaceAll("String_Node_Str","String_Node_Str");
        String passp=pass.getText().toString();
        smbFile=connectingWithSmbServer(new String[]{ipa,useru,passp,domaind},false);
      }
      if (smbFile == null)       return;
      s=new String[]{con_name.getText().toString(),smbFile.getPath()};
      if (smbConnectionListener != null) {
        smbConnectionListener.addConnection(edit,s[0],s[1],name,path);
      }
      dismiss();
    }
  }
);
  ba3.onNegative(new MaterialDialog.SingleButtonCallback(){
    @Override public void onClick(    @NonNull MaterialDialog dialog,    @NonNull DialogAction which){
      if (smbConnectionListener != null) {
        smbConnectionListener.deleteConnection(name,path);
        dismiss();
      }
    }
  }
);
  ba3.onNeutral(new MaterialDialog.SingleButtonCallback(){
    @Override public void onClick(    @NonNull MaterialDialog dialog,    @NonNull DialogAction which){
      dismiss();
    }
  }
);
  return ba3.build();
}