nus-yam/ex-repair huggingface dataset:
Program: 90931
Project: 90931
Buggy source:
public Object getExternalContext(){
  return this.externalContext;
}

Fixed version (ground truth):
/** 
 * Return the external context.
 * @return The external context.
 */
public Object getExternalContext(){
  return this.externalContext;
}
Program: 90932
Project: 90932
Buggy source:
public Configuration getConfiguration(){
  return config;
}

Fixed version (ground truth):
/** 
 * Return the current Configuration. The Configuration will be replaced when a reconfigure occurs.
 * @return The Configuration.
 */
public Configuration getConfiguration(){
  return config;
}
Program: 90933
Project: 90933
Buggy source:
public void addFilter(Filter filter){
  config.addFilter(filter);
}

Fixed version (ground truth):
/** 
 * Add a Filter to the Configuration. Filters that are added through the API will be lost when a reconfigure occurs.
 * @param filter The Filter to add.
 */
public void addFilter(Filter filter){
  config.addFilter(filter);
}
Program: 90934
Project: 90934
Buggy source:
public void setExternalContext(Object context){
  this.externalContext=context;
}

Fixed version (ground truth):
/** 
 * Set the external context.
 * @param context The external context.
 */
public void setExternalContext(Object context){
  this.externalContext=context;
}
Program: 90935
Project: 90935
Buggy source:
public static long getStartTime(){
  return JVM_START_TIME;
}

Fixed version (ground truth):
/** 
 * The time the LoggerContext class was loaded as a long.
 * @return The time the LoggerContext was loaded.
 */
public static long getStartTime(){
  return JVM_START_TIME;
}
Program: 90936
Project: 90936
Buggy source:
/** 
 * Set the Configuration to be used.
 */
public synchronized Configuration setConfiguration(Configuration config){
  if (config == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Configuration prev=this.config;
  config.addListener(this);
  config.start();
  this.config=config;
  updateLoggers();
  if (prev != null) {
    prev.removeListener(this);
    prev.stop();
  }
  return prev;
}

Fixed version (ground truth):
/** 
 * Set the Configuration to be used.
 * @param config The new Configuration.
 * @return The previous Configuration.
 */
public synchronized Configuration setConfiguration(Configuration config){
  if (config == null) {
    throw new NullPointerException("String_Node_Str");
  }
  Configuration prev=this.config;
  config.addListener(this);
  config.start();
  this.config=config;
  updateLoggers();
  if (prev != null) {
    prev.removeListener(this);
    prev.stop();
  }
  return prev;
}
Program: 90937
Project: 90937
Buggy source:
public synchronized void shutdown(){
  updateLoggers(new NullConfiguration());
  config.stop();
  externalContext=null;
}

Fixed version (ground truth):
/** 
 * Shutdown the logging system.
 */
public synchronized void shutdown(){
  updateLoggers(new NullConfiguration());
  config.stop();
  externalContext=null;
}
Program: 90938
Project: 90938
Buggy source:
public LoggingException(Exception ex){
  super(ex);
}

Fixed version (ground truth):
/** 
 * Constructs a Logging Exception with a chained Exception and no message.
 * @param ex The chained Exception.
 */
public LoggingException(Exception ex){
  super(ex);
}
Program: 90939
Project: 90939
Buggy source:
public static <T extends AbstractManager>T getManager(String name,ManagerFactory<T,Object> factory,Object data){
  lock.lock();
  try {
    T manager=(T)map.get(name);
    if (manager == null) {
      manager=factory.createManager(name,data);
      if (manager == null) {
        throw new IllegalStateException("String_Node_Str");
      }
      map.put(name,manager);
    }
    manager.count++;
    return manager;
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Retrieves a Manager if it has been previously created or creates a new Manager.
 * @param name The name of the Manager to retrieve.
 * @param factory The Factory to use to create the Manager.
 * @param data An Object that should be passed to the factory when creating the Manager.
 * @param < T > The Type of the Manager to be created.
 * @return A Manager with the specified name and type.
 */
public static <T extends AbstractManager>T getManager(String name,ManagerFactory<T,Object> factory,Object data){
  lock.lock();
  try {
    T manager=(T)map.get(name);
    if (manager == null) {
      manager=factory.createManager(name,data);
      if (manager == null) {
        throw new IllegalStateException("String_Node_Str");
      }
      map.put(name,manager);
    }
    manager.count++;
    return manager;
  }
  finally {
    lock.unlock();
  }
}
Program: 90940
Project: 90940
Buggy source:
public String getName(){
  return name;
}

Fixed version (ground truth):
/** 
 * Return the name of the Manager.
 * @return The name of the Manager.
 */
public String getName(){
  return name;
}
Program: 90941
Project: 90941
Buggy source:
public void release(){
  lock.lock();
  try {
    --count;
    if (count <= 0) {
      map.remove(name);
      releaseSub();
    }
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Called to signify that this Manager is no longer required by an Appender.
 */
public void release(){
  lock.lock();
  try {
    --count;
    if (count <= 0) {
      map.remove(name);
      releaseSub();
    }
  }
  finally {
    lock.unlock();
  }
}
Program: 90942
Project: 90942
Buggy source:
public abstract void releaseSub();

Fixed version (ground truth):
/** 
 * May be overriden by Managers to perform processing while the Manager is being released and the lock is held.
 */
protected void releaseSub(){
}
Program: 90943
Project: 90943
Buggy source:
public static boolean hasManager(String name){
  lock.lock();
  try {
    return map.containsKey(name);
  }
  finally {
    lock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Determines if a Manager with the specified name exists.
 * @param name The name of the Manager.
 * @return True if the Manager exists, false otherwise.
 */
public static boolean hasManager(String name){
  lock.lock();
  try {
    return map.containsKey(name);
  }
  finally {
    lock.unlock();
  }
}
Program: 90944
Project: 90944
Buggy source:
/** 
 * This method performs a deep toString of the given Object. Primitive arrays are converted using their respective Arrays.toString methods while special handling is implemented for "container types", i.e. Object[], Map and Collection because those could contain themselves. <p/> It should be noted that neither AbstractMap.toString() nor AbstractCollection.toString() implement such a behavior. They only check if the container is directly contained in itself, but not if a contained container contains the original one. Because of that, Arrays.toString(Object[]) isn't safe either. Confusing? Just read the last paragraph again and check the respective toString() implementation. <p/> This means, in effect, that logging would produce a usable output even if an ordinary System.out.println(o) would produce a relatively hard-to-debug StackOverflowError.
 * @param o The object.
 * @return The String representation.
 */
public static String deepToString(Object o){
  if (o == null) {
    return null;
  }
  if (o instanceof String) {
    return (String)o;
  }
  StringBuilder str=new StringBuilder();
  Set dejaVu=new HashSet();
  recursiveDeepToString(o,str,dejaVu);
  return str.toString();
}

Fixed version (ground truth):
/** 
 * This method performs a deep toString of the given Object. Primitive arrays are converted using their respective Arrays.toString methods while special handling is implemented for "container types", i.e. Object[], Map and Collection because those could contain themselves. <p/> It should be noted that neither AbstractMap.toString() nor AbstractCollection.toString() implement such a behavior. They only check if the container is directly contained in itself, but not if a contained container contains the original one. Because of that, Arrays.toString(Object[]) isn't safe either. Confusing? Just read the last paragraph again and check the respective toString() implementation. <p/> This means, in effect, that logging would produce a usable output even if an ordinary System.out.println(o) would produce a relatively hard-to-debug StackOverflowError.
 * @param o The object.
 * @return The String representation.
 */
public static String deepToString(Object o){
  if (o == null) {
    return null;
  }
  if (o instanceof String) {
    return (String)o;
  }
  StringBuilder str=new StringBuilder();
  Set<String> dejaVu=new HashSet<String>();
  recursiveDeepToString(o,str,dejaVu);
  return str.toString();
}
Program: 90946
Project: 90946
Buggy source:
public int hashCode(){
  int result=messagePattern != null ? messagePattern.hashCode() : 0;
  result=31 * result + (stringArgs != null ? Arrays.hashCode(stringArgs) : 0);
  return result;
}

Fixed version (ground truth):
public int hashCode(){
  int result=messagePattern != null ? messagePattern.hashCode() : 0;
  result=HASHVAL * result + (stringArgs != null ? Arrays.hashCode(stringArgs) : 0);
  return result;
}
Program: 90947
Project: 90947
Buggy source:
/** 
 * @doubt Not quite sure what is going on with the loop, but looks like it mightdrop only the deepest call from the fully qualified class, not all of them. (RG) The loop finds the FQCN and on the next iteration returns the StackTraceElement of the caller of FQCN. Don't know what you mean by "not all of them" as it only returns a single element. Say that FQCN is "MySpecializedLogger" and the stack trace returned from getStackTrace is: Log4jLogEvent.getSource MySpecializedLogger.log MySpecializedLogger.info ClientClass.doSomething ClientClass.main When walking the stack, next will be set to true  at MySpecializedLogger.log and MySpecializerLogger.info will be returned (at least from code inspection).
 */
public StackTraceElement getSource(){
  if (fqcnOfLogger == null) {
    return null;
  }
  if (location == null) {
    StackTraceElement[] stackTrace=Thread.currentThread().getStackTrace();
    boolean next=false;
    for (    StackTraceElement element : stackTrace) {
      if (next) {
        location=element;
        break;
      }
      String className=element.getClassName();
      if (fqcnOfLogger.equals(className)) {
        next=true;
      }
 else       if (NOT_AVAIL.equals(className)) {
        break;
      }
    }
  }
  return location;
}

Fixed version (ground truth):
/** 
 * Return the StackTraceElement for the caller. This will be the entry that occurs right before the first occurrence of FQCN as a class name.
 */
public StackTraceElement getSource(){
  if (fqcnOfLogger == null) {
    return null;
  }
  if (location == null) {
    StackTraceElement[] stackTrace=Thread.currentThread().getStackTrace();
    boolean next=false;
    for (    StackTraceElement element : stackTrace) {
      String className=element.getClassName();
      if (next) {
        if (fqcnOfLogger.equals(className)) {
          continue;
        }
        location=element;
        break;
      }
      if (fqcnOfLogger.equals(className)) {
        next=true;
      }
 else       if (NOT_AVAIL.equals(className)) {
        break;
      }
    }
  }
  return location;
}
Program: 90948
Project: 90948
Buggy source:
public synchronized void setLevel(Level level){
  config.level=level;
  config.intLevel=level.intLevel();
}

Fixed version (ground truth):
public synchronized void setLevel(Level level){
  if (level != null) {
    config=new PrivateConfig(config,level);
  }
}
Program: 90949
Project: 90949
Buggy source:
/** 
 * This method isn't synchronized to serialized updates to config. Rather, by doing this it is guaranteed that all threads will see the update without having to declare the variable volatile.
 * @param config The new Configuration.
 * @doubt lost me on the comment, this.config is declared volatile. (RG) Me too.
 */
void updateConfiguration(Configuration config){
  this.config=new PrivateConfig(config,this);
}

Fixed version (ground truth):
/** 
 * There are two ways that could be used to guarantee all threads are aware of changes to config. 1. synchronize this method. Accessors don't need to be synchronized as Java wil treat all variables within a synchronized block as volatile. 2. Declare the variable volatile. Option 2 is used here as the performance cost is very low and it does a better job at documenting how it is used.
 * @param config The new Configuration.
 */
void updateConfiguration(Configuration config){
  this.config=new PrivateConfig(config,this);
}
Program: 90950
Project: 90950
Buggy source:
public ClearPinDialog(final Context context,boolean hidden,boolean randomizePin){
  super(context,hidden,true,randomizePin);
  final MbwManager mbwManager=MbwManager.getInstance(context);
  Button btnForgotPin=(Button)findViewById(R.id.btn_forgot_pin);
  if (mbwManager.getPin().isResettable()) {
    Optional<Integer> resetPinRemainingBlocksCount=mbwManager.getResetPinRemainingBlocksCount();
    if (resetPinRemainingBlocksCount.or(1) == 0) {
      btnForgotPin.setText("String_Node_Str");
      btnForgotPin.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          mbwManager.savePin(Pin.CLEAR_PIN);
          if (onPinValid != null)           onPinValid.pinEntered(ClearPinDialog.this,Pin.CLEAR_PIN);
        }
      }
);
    }
 else     if (resetPinRemainingBlocksCount.isPresent()) {
      btnForgotPin.setText(String.format(context.getString(R.string.pin_forgotten_reset_wait_button_text),Utils.formatBlockcountAsApproxDuration(this.getContext(),resetPinRemainingBlocksCount.get())));
      btnForgotPin.setEnabled(false);
    }
 else {
      btnForgotPin.setOnClickListener(startResetListener(context,mbwManager));
    }
  }
 else {
    btnForgotPin.setVisibility(View.GONE);
  }
}

Fixed version (ground truth):
public ClearPinDialog(final Context context,boolean hidden){
  super(context,hidden,true);
  final MbwManager mbwManager=MbwManager.getInstance(context);
  Button btnForgotPin=(Button)findViewById(R.id.btn_forgot_pin);
  if (mbwManager.getPin().isResettable()) {
    Optional<Integer> resetPinRemainingBlocksCount=mbwManager.getResetPinRemainingBlocksCount();
    if (resetPinRemainingBlocksCount.or(1) == 0) {
      btnForgotPin.setText("String_Node_Str");
      btnForgotPin.setOnClickListener(new View.OnClickListener(){
        @Override public void onClick(        View v){
          mbwManager.savePin(Pin.CLEAR_PIN);
          if (onPinValid != null)           onPinValid.pinEntered(ClearPinDialog.this,Pin.CLEAR_PIN);
        }
      }
);
    }
 else     if (resetPinRemainingBlocksCount.isPresent()) {
      btnForgotPin.setText(String.format(context.getString(R.string.pin_forgotten_reset_wait_button_text),Utils.formatBlockcountAsApproxDuration(this.getContext(),resetPinRemainingBlocksCount.get())));
      btnForgotPin.setEnabled(false);
    }
 else {
      btnForgotPin.setOnClickListener(startResetListener(context,mbwManager));
    }
  }
 else {
    btnForgotPin.setVisibility(View.GONE);
  }
}
Program: 90951
Project: 90951
Buggy source:
public LedgerPinDialog(Context context,boolean hidden,boolean randomizePin){
  super(context,hidden,true,randomizePin);
}

Fixed version (ground truth):
public LedgerPinDialog(Context context,boolean hidden){
  super(context,hidden,true);
}
Program: 90952
Project: 90952
Buggy source:
public void showSetPinDialog(final Activity activity,final Optional<Runnable> afterDialogClosed){
  if (this.getMetadataStorage().getMasterSeedBackupState() != MetadataStorage.BackupState.VERIFIED) {
    Utils.showSimpleMessageDialog(activity,R.string.pin_backup_first,afterDialogClosed.get());
    return;
  }
  final NewPinDialog _dialog=new NewPinDialog(activity,false,randomizePin);
  _dialog.setOnPinValid(new PinDialog.OnPinEntered(){
    private String newPin=null;
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      if (newPin == null) {
        newPin=pin.getPin();
        dialog.setTitle(R.string.pin_confirm_pin);
      }
 else       if (newPin.equals(pin.getPin())) {
        MbwManager.this.savePin(pin);
        Toast.makeText(activity,R.string.pin_set,Toast.LENGTH_LONG).show();
        dialog.dismiss();
        if (afterDialogClosed.isPresent()) {
          afterDialogClosed.get().run();
        }
      }
 else {
        Toast.makeText(activity,R.string.pin_codes_dont_match,Toast.LENGTH_LONG).show();
        MbwManager.this.vibrate();
        dialog.dismiss();
        if (afterDialogClosed.isPresent()) {
          afterDialogClosed.get().run();
        }
      }
    }
  }
);
  this.runPinProtectedFunction(activity,new Runnable(){
    @Override public void run(){
      _dialog.show();
    }
  }
);
}

Fixed version (ground truth):
public void showSetPinDialog(final Activity activity,final Optional<Runnable> afterDialogClosed){
  if (this.getMetadataStorage().getMasterSeedBackupState() != MetadataStorage.BackupState.VERIFIED) {
    Utils.showSimpleMessageDialog(activity,R.string.pin_backup_first,afterDialogClosed.get());
    return;
  }
  final NewPinDialog _dialog=new NewPinDialog(activity,false);
  _dialog.setOnPinValid(new PinDialog.OnPinEntered(){
    private String newPin=null;
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      if (newPin == null) {
        newPin=pin.getPin();
        dialog.setTitle(R.string.pin_confirm_pin);
      }
 else       if (newPin.equals(pin.getPin())) {
        MbwManager.this.savePin(pin);
        Toast.makeText(activity,R.string.pin_set,Toast.LENGTH_LONG).show();
        dialog.dismiss();
        if (afterDialogClosed.isPresent()) {
          afterDialogClosed.get().run();
        }
      }
 else {
        Toast.makeText(activity,R.string.pin_codes_dont_match,Toast.LENGTH_LONG).show();
        MbwManager.this.vibrate();
        dialog.dismiss();
        if (afterDialogClosed.isPresent()) {
          afterDialogClosed.get().run();
        }
      }
    }
  }
);
  this.runPinProtectedFunction(activity,new Runnable(){
    @Override public void run(){
      _dialog.show();
    }
  }
);
}
Program: 90954
Project: 90954
Buggy source:
private PinDialog runPinProtectedFunctionInternal(Activity activity,Runnable fun,boolean cancelable){
  if (isPinProtected() && !lastPinAgeOkay.get()) {
    PinDialog d=new PinDialog(activity,true,cancelable,randomizePin);
    runPinProtectedFunction(activity,d,fun);
    return d;
  }
 else {
    fun.run();
    return null;
  }
}

Fixed version (ground truth):
private PinDialog runPinProtectedFunctionInternal(Activity activity,Runnable fun,boolean cancelable){
  if (isPinProtected() && !lastPinAgeOkay.get()) {
    PinDialog d=new PinDialog(activity,true,cancelable);
    runPinProtectedFunction(activity,d,fun);
    return d;
  }
 else {
    fun.run();
    return null;
  }
}
Program: 90955
Project: 90955
Buggy source:
public void showClearPinDialog(final Activity activity,final Optional<Runnable> afterDialogClosed){
  this.runPinProtectedFunction(activity,new ClearPinDialog(activity,true,randomizePin),new Runnable(){
    @Override public void run(){
      MbwManager.this.savePin(Pin.CLEAR_PIN);
      Toast.makeText(_applicationContext,R.string.pin_cleared,Toast.LENGTH_LONG).show();
      if (afterDialogClosed.isPresent()) {
        afterDialogClosed.get().run();
      }
    }
  }
);
}

Fixed version (ground truth):
public void showClearPinDialog(final Activity activity,final Optional<Runnable> afterDialogClosed){
  this.runPinProtectedFunction(activity,new ClearPinDialog(activity,true),new Runnable(){
    @Override public void run(){
      MbwManager.this.savePin(Pin.CLEAR_PIN);
      Toast.makeText(_applicationContext,R.string.pin_cleared,Toast.LENGTH_LONG).show();
      if (afterDialogClosed.isPresent()) {
        afterDialogClosed.get().run();
      }
    }
  }
);
}
Program: 90956
Project: 90956
Buggy source:
public NewPinDialog(final Context context,boolean hidden,boolean randomizePin){
  super(context,hidden,true,randomizePin);
  this.setTitle(R.string.pin_enter_new_pin);
  MbwManager mbwManager=MbwManager.getInstance(context);
  cbResettablePin=(CheckBox)findViewById(R.id.cb_resettable_pin);
  cbResettablePin.setChecked(mbwManager.getPin().isSet());
  cbResettablePin.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton compoundButton,    boolean b){
      updateResetInfo(context);
    }
  }
);
  updateResetInfo(context);
}

Fixed version (ground truth):
public NewPinDialog(final Context context,boolean hidden){
  super(context,hidden,true);
  this.setTitle(R.string.pin_enter_new_pin);
  MbwManager mbwManager=MbwManager.getInstance(context);
  cbResettablePin=(CheckBox)findViewById(R.id.cb_resettable_pin);
  cbResettablePin.setChecked(mbwManager.getPin().isSet());
  cbResettablePin.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
    @Override public void onCheckedChanged(    CompoundButton compoundButton,    boolean b){
      updateResetInfo(context);
    }
  }
);
  updateResetInfo(context);
}
Program: 90957
Project: 90957
Buggy source:
public PinDialog(Context context,boolean hidden,boolean cancelable,boolean randomizePin){
  super(context);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE);
  this.hidden=hidden;
  setCancelable(cancelable);
  setCanceledOnTouchOutside(false);
  loadLayout();
  initPinPad();
  enteredPin="String_Node_Str";
  clearDigits();
  updatePinDisplay();
  this.randomizePin=randomizePin;
  this.setTitle(R.string.pin_enter_pin);
}

Fixed version (ground truth):
public PinDialog(Context context,boolean hidden,boolean cancelable){
  super(context);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE,WindowManager.LayoutParams.FLAG_SECURE);
  pinPadIsRandomized=MbwManager.getInstance(context).isPinPadRandomized();
  this.hidden=hidden;
  setCancelable(cancelable);
  setCanceledOnTouchOutside(false);
  loadLayout();
  initPinPad();
  enteredPin="String_Node_Str";
  clearDigits();
  updatePinDisplay();
  this.setTitle(R.string.pin_enter_pin);
}
Program: 90959
Project: 90959
Buggy source:
public TrezorPinDialog(Context context,boolean hidden,boolean randomizePin){
  super(context,hidden,true,randomizePin);
}

Fixed version (ground truth):
public TrezorPinDialog(Context context,boolean hidden){
  super(context,hidden,true);
}
Program: 90960
Project: 90960
Buggy source:
@Override public boolean onPreferenceChange(final Preference preference,Object o){
  boolean checked=!((CheckBoxPreference)preference).isChecked();
  if (_mbwManager.isPinProtected()) {
    _mbwManager.setRandomizePin(checked);
  }
 else {
    _mbwManager.setRandomizePin(false);
  }
  update();
  return false;
}

Fixed version (ground truth):
@Override public boolean onPreferenceChange(final Preference preference,Object o){
  boolean checked=!((CheckBoxPreference)preference).isChecked();
  if (_mbwManager.isPinProtected()) {
    _mbwManager.setPinPadRandomized(checked);
  }
 else {
    _mbwManager.setPinPadRandomized(false);
  }
  update();
  return false;
}
Program: 90961
Project: 90961
Buggy source:
void update(){
  setPin.setChecked(_mbwManager.isPinProtected());
  setPinRequiredStartup.setChecked(_mbwManager.isPinProtected() && _mbwManager.getPinRequiredOnStartup());
  randomizePin.setChecked(_mbwManager.isPinProtected() && _mbwManager.isRandomizePin());
}

Fixed version (ground truth):
void update(){
  setPin.setChecked(_mbwManager.isPinProtected());
  setPinRequiredStartup.setChecked(_mbwManager.isPinProtected() && _mbwManager.getPinRequiredOnStartup());
  randomizePin.setChecked(_mbwManager.isPinProtected() && _mbwManager.isPinPadRandomized());
}
Program: 90962
Project: 90962
Buggy source:
@Subscribe public void onPinMatrixRequest(ExternalSignatureDeviceManager.OnPinMatrixRequest event){
  TrezorPinDialog pin=new TrezorPinDialog(ExtSigAccountSelectorActivity.this,true,MbwManager.getInstance(this).isRandomizePin());
  pin.setOnPinValid(new PinDialog.OnPinEntered(){
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      ((ExternalSignatureDeviceManager)masterseedScanManager).enterPin(pin.getPin());
      dialog.dismiss();
    }
  }
);
  pin.show();
  updateUi();
}

Fixed version (ground truth):
@Subscribe public void onPinMatrixRequest(ExternalSignatureDeviceManager.OnPinMatrixRequest event){
  TrezorPinDialog pin=new TrezorPinDialog(ExtSigAccountSelectorActivity.this,true);
  pin.setOnPinValid(new PinDialog.OnPinEntered(){
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      ((ExternalSignatureDeviceManager)masterseedScanManager).enterPin(pin.getPin());
      dialog.dismiss();
    }
  }
);
  pin.show();
  updateUi();
}
Program: 90963
Project: 90963
Buggy source:
@Subscribe() public void onPinRequest(LedgerManager.OnPinRequest event){
  LedgerPinDialog pin=new LedgerPinDialog(this,true,MbwManager.getInstance(this).isRandomizePin());
  pin.setTitle(R.string.ledger_enter_pin);
  pin.setOnPinValid(new PinDialog.OnPinEntered(){
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      ((LedgerManager)masterseedScanManager).enterPin(pin.getPin());
      dialog.dismiss();
    }
  }
);
  pin.show();
}

Fixed version (ground truth):
@Subscribe() public void onPinRequest(LedgerManager.OnPinRequest event){
  LedgerPinDialog pin=new LedgerPinDialog(this,true);
  pin.setTitle(R.string.ledger_enter_pin);
  pin.setOnPinValid(new PinDialog.OnPinEntered(){
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      ((LedgerManager)masterseedScanManager).enterPin(pin.getPin());
      dialog.dismiss();
    }
  }
);
  pin.show();
}
Program: 90964
Project: 90964
Buggy source:
@Subscribe() public void onPinRequest(LedgerManager.OnPinRequest event){
  LedgerPinDialog pin=new LedgerPinDialog(this,true,MbwManager.getInstance(this).isRandomizePin());
  pin.setTitle(R.string.ledger_enter_pin);
  pin.setOnPinValid(new PinDialog.OnPinEntered(){
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      ((LedgerManager)masterseedScanManager).enterPin(pin.getPin());
      dialog.dismiss();
    }
  }
);
  pin.show();
}

Fixed version (ground truth):
@Subscribe() public void onPinRequest(LedgerManager.OnPinRequest event){
  LedgerPinDialog pin=new LedgerPinDialog(this,true);
  pin.setTitle(R.string.ledger_enter_pin);
  pin.setOnPinValid(new PinDialog.OnPinEntered(){
    @Override public void pinEntered(    PinDialog dialog,    Pin pin){
      ((LedgerManager)masterseedScanManager).enterPin(pin.getPin());
      dialog.dismiss();
    }
  }
);
  pin.show();
}
Program: 90965
Project: 90965
Buggy source:
private boolean showPinPad(int title,final PinDialog.OnPinEntered callback){
  LedgerPinDialog pin=new LedgerPinDialog(LedgerSignTransactionActivity.this,true,MbwManager.getInstance(this).isRandomizePin());
  pin.setTitle(title);
  pin.setOnPinValid(callback);
  pin.show();
  return true;
}

Fixed version (ground truth):
private boolean showPinPad(int title,final PinDialog.OnPinEntered callback){
  LedgerPinDialog pin=new LedgerPinDialog(LedgerSignTransactionActivity.this,true);
  pin.setTitle(title);
  pin.setOnPinValid(callback);
  pin.show();
  return true;
}
Program: 90966
Project: 90966
Buggy source:
private void archive(final WalletAccount account){
  CurrencyBasedBalance balance=Preconditions.checkNotNull(account.getCurrencyBasedBalance());
  final WalletAccount linkedAccount=getLinkedAccount(account);
  new AlertDialog.Builder(getActivity()).setTitle(R.string.archiving_account_title).setMessage(createArchiveDialogText(account,linkedAccount)).setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
      account.archiveAccount();
      WalletAccount linkedAccount=Utils.getLinkedAccount(account,_mbwManager.getColuManager().getAccounts().values());
      if (linkedAccount != null) {
        linkedAccount.archiveAccount();
      }
      WalletAccount correspondingBCHAccount=_mbwManager.getWalletManager(false).getAccount(MbwManager.getBitcoinCashAccountId(account));
      if (correspondingBCHAccount != null) {
        correspondingBCHAccount.archiveAccount();
      }
      _mbwManager.setSelectedAccount(_mbwManager.getWalletManager(false).getActiveAccounts().get(0).getId());
      eventBus.post(new AccountChanged(account.getId()));
      updateIncludingMenus();
      _toaster.toast(R.string.archived,false);
    }
  }
).setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
    }
  }
).show();
}

Fixed version (ground truth):
private void archive(final WalletAccount account){
  CurrencyBasedBalance balance=Preconditions.checkNotNull(account.getCurrencyBasedBalance());
  final WalletAccount linkedAccount=getLinkedAccount(account);
  new AlertDialog.Builder(getActivity()).setTitle(R.string.archiving_account_title).setMessage(Html.fromHtml(createArchiveDialogText(account,linkedAccount))).setPositiveButton(R.string.yes,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
      account.archiveAccount();
      WalletAccount linkedAccount=Utils.getLinkedAccount(account,_mbwManager.getColuManager().getAccounts().values());
      if (linkedAccount != null) {
        linkedAccount.archiveAccount();
      }
      WalletAccount correspondingBCHAccount=_mbwManager.getWalletManager(false).getAccount(MbwManager.getBitcoinCashAccountId(account));
      if (correspondingBCHAccount != null) {
        correspondingBCHAccount.archiveAccount();
      }
      _mbwManager.setSelectedAccount(_mbwManager.getWalletManager(false).getActiveAccounts().get(0).getId());
      eventBus.post(new AccountChanged(account.getId()));
      updateIncludingMenus();
      _toaster.toast(R.string.archived,false);
    }
  }
).setNegativeButton(R.string.no,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface arg0,    int arg1){
    }
  }
).show();
}
Program: 90967
Project: 90967
Buggy source:
@Override public void onCreate(){
  int loadedBouncy=Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(),1);
  if (loadedBouncy == -1) {
    Log.e("String_Node_Str","String_Node_Str");
  }
 else {
    Log.d("String_Node_Str","String_Node_Str");
  }
  SettingsPreference.getInstance().init(this);
  INSTANCE=this;
  if (BuildConfig.DEBUG) {
    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
  }
  super.onCreate();
  CommunicationManager.init(this);
  pairSpvModules(CommunicationManager.getInstance());
  cleanModulesIfFirstRun(this,getSharedPreferences(BCHHelper.BCH_PREFS,MODE_PRIVATE));
  moduleMessageReceiver=new MbwMessageReceiver(this);
  MbwManager mbwManager=MbwManager.getInstance(this);
  applyLanguageChange(getBaseContext(),mbwManager.getLanguage());
  IntentFilter connectivityChangeFilter=new IntentFilter("String_Node_Str");
  initNetworkStateHandler(connectivityChangeFilter);
}

Fixed version (ground truth):
@Override public void onCreate(){
  int loadedBouncy=Security.insertProviderAt(new org.spongycastle.jce.provider.BouncyCastleProvider(),1);
  if (loadedBouncy == -1) {
    Log.e("String_Node_Str","String_Node_Str");
  }
 else {
    Log.d("String_Node_Str","String_Node_Str");
  }
  SettingsPreference.getInstance().init(this);
  INSTANCE=this;
  if (BuildConfig.DEBUG) {
    StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectAll().penaltyLog().build());
  }
  super.onCreate();
  CommunicationManager.init(this);
  pairSpvModules(CommunicationManager.getInstance());
  cleanModulesIfFirstRun(this,getSharedPreferences(BCHHelper.BCH_PREFS,MODE_PRIVATE));
  moduleMessageReceiver=new MbwMessageReceiver(this);
  mbwManager=MbwManager.getInstance(this);
  applyLanguageChange(getBaseContext(),mbwManager.getLanguage());
  IntentFilter connectivityChangeFilter=new IntentFilter("String_Node_Str");
  initNetworkStateHandler(connectivityChangeFilter);
  registerActivityLifecycleCallbacks(new ApplicationLifecycleHandler());
}
Program: 90968
Project: 90968
Buggy source:
/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle savedInstanceState){
  this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.export_as_qr_code_activity);
  Utils.preventScreenshots(this);
  _mbwManager=MbwManager.getInstance(getApplication());
  accountData=(ExportableAccount.Data)getIntent().getSerializableExtra(ACCOUNT);
  if (accountData == null || (!accountData.publicData.isPresent() && !accountData.privateData.isPresent())) {
    finish();
    return;
  }
  swSelectData=(Switch)findViewById(R.id.swSelectData);
  if (accountData.privateData.isPresent()) {
    swSelectData.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
      @Override public void onCheckedChanged(      CompoundButton compoundButton,      boolean b){
        updateData();
      }
    }
);
  }
 else {
    swSelectData.setVisibility(View.GONE);
  }
  findViewById(R.id.llPrivKeyWarning).setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View view){
      hasWarningAccepted=true;
      updateData();
      return true;
    }
  }
);
  updateData();
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle savedInstanceState){
  this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.export_as_qr_code_activity);
  Utils.preventScreenshots(this);
  _mbwManager=MbwManager.getInstance(getApplication());
  accountData=(ExportableAccount.Data)getIntent().getSerializableExtra(ACCOUNT);
  if (accountData == null || (!accountData.publicData.isPresent() && !accountData.privateData.isPresent())) {
    finish();
    return;
  }
  swSelectData=(SwitchCompat)findViewById(R.id.swSelectData);
  TextView privateText=(TextView)findViewById(R.id.prv_key);
  TextView formatBlock1=(TextView)findViewById(R.id.block_1);
  TextView formatBlock2=(TextView)findViewById(R.id.block_2);
  if (accountData.privateData.isPresent()) {
    swSelectData.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
      @Override public void onCheckedChanged(      CompoundButton compoundButton,      boolean b){
        updateData();
      }
    }
);
  }
 else {
    swSelectData.setVisibility(View.GONE);
    privateText.setVisibility(View.GONE);
    formatBlock1.setVisibility(View.GONE);
    formatBlock2.setVisibility(View.GONE);
  }
  findViewById(R.id.llPrivKeyWarning).setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View view){
      hasWarningAccepted=true;
      updateData();
      return true;
    }
  }
);
  updateData();
}
Program: 90969
Project: 90969
Buggy source:
/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle savedInstanceState){
  this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.export_as_qr_code_activity);
  Utils.preventScreenshots(this);
  _mbwManager=MbwManager.getInstance(getApplication());
  accountData=(ExportableAccount.Data)getIntent().getSerializableExtra(ACCOUNT);
  if (accountData == null || (!accountData.publicData.isPresent() && !accountData.privateData.isPresent())) {
    finish();
    return;
  }
  swSelectData=(SwitchCompat)findViewById(R.id.swSelectData);
  TextView privateText=(TextView)findViewById(R.id.prv_key);
  TextView formatBlock1=(TextView)findViewById(R.id.block_1);
  TextView formatBlock2=(TextView)findViewById(R.id.block_2);
  if (accountData.privateData.isPresent()) {
    swSelectData.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
      @Override public void onCheckedChanged(      CompoundButton compoundButton,      boolean b){
        updateData();
      }
    }
);
  }
 else {
    swSelectData.setVisibility(View.GONE);
    privateText.setVisibility(View.GONE);
    formatBlock1.setVisibility(View.GONE);
    formatBlock2.setVisibility(View.GONE);
  }
  findViewById(R.id.llPrivKeyWarning).setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View view){
      hasWarningAccepted=true;
      updateData();
      return true;
    }
  }
);
  updateData();
}

Fixed version (ground truth):
/** 
 * Called when the activity is first created.
 */
@Override public void onCreate(Bundle savedInstanceState){
  this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
  super.onCreate(savedInstanceState);
  setContentView(R.layout.export_as_qr_code_activity);
  Utils.preventScreenshots(this);
  _mbwManager=MbwManager.getInstance(getApplication());
  accountData=(ExportableAccount.Data)getIntent().getSerializableExtra(ACCOUNT);
  if (accountData == null || (!accountData.publicData.isPresent() && !accountData.privateData.isPresent())) {
    finish();
    return;
  }
  swSelectData=(SwitchCompat)findViewById(R.id.swSelectData);
  TextView privateText=(TextView)findViewById(R.id.prv_key);
  TextView publicText=(TextView)findViewById(R.id.pub_key);
  if (accountData.privateData.isPresent()) {
    swSelectData.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener(){
      @Override public void onCheckedChanged(      CompoundButton compoundButton,      boolean b){
        updateData();
      }
    }
);
  }
 else {
    swSelectData.setVisibility(View.GONE);
    privateText.setVisibility(View.GONE);
    publicText.setVisibility(View.GONE);
  }
  findViewById(R.id.llPrivKeyWarning).setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View view){
      hasWarningAccepted=true;
      updateData();
      return true;
    }
  }
);
  updateData();
}
Program: 90970
Project: 90970
Buggy source:
public static Resources getResourcesByLocale(Resources res,String localeName){
  Configuration conf=new Configuration(res.getConfiguration());
  conf.locale=new Locale(localeName);
  return new Resources(res.getAssets(),res.getDisplayMetrics(),conf);
}

Fixed version (ground truth):
public static Resources getResourcesByLocale(Context context,String localeName){
  Configuration conf=context.getResources().getConfiguration();
  conf=new Configuration(conf);
  conf.setLocale(new Locale(localeName));
  Context localizedContext=context.createConfigurationContext(conf);
  return localizedContext.getResources();
}
Program: 90971
Project: 90971
Buggy source:
private String getLanguageSettingTitle(){
  String displayed=getResources().getString(R.string.pref_language);
  String english=Utils.getResourcesByLocale(getResources(),"String_Node_Str").getString(R.string.pref_language);
  return english.equals(displayed) ? displayed : displayed + "String_Node_Str" + english;
}

Fixed version (ground truth):
private String getLanguageSettingTitle(){
  String displayed=getResources().getString(R.string.pref_language);
  String english=Utils.getResourcesByLocale(getActivity(),"String_Node_Str").getString(R.string.pref_language);
  return english.equals(displayed) ? displayed : displayed + "String_Node_Str" + english;
}
Program: 90972
Project: 90972
Buggy source:
@Override public void putTransactions(List<TransactionEx> transactions){
  StringBuilder updateQuery=new StringBuilder("String_Node_Str" + txTableName + "String_Node_Str");
  updateQuery.append(Strings.repeat("String_Node_Str",transactions.size() - 1));
  updateQuery.append("String_Node_Str");
  SQLiteStatement updateStatement=_database.compileStatement(updateQuery.toString());
  for (int x=0; x < transactions.size(); x++) {
    updateStatement.bindBlob(x + 1,transactions.get(x).txid.getBytes());
    updateStatement.bindBlob(x + 2,transactions.get(x).hash.getBytes());
    updateStatement.bindLong(x + 3,transactions.get(x).height == -1 ? Integer.MAX_VALUE : transactions.get(x).height);
    updateStatement.bindLong(x + 4,transactions.get(x).time);
    updateStatement.bindBlob(x + 5,transactions.get(x).binary);
  }
  updateStatement.executeInsert();
  for (  TransactionEx transaction : transactions) {
    putReferencedOutputs(transaction.binary);
  }
}

Fixed version (ground truth):
@Override public void putTransactions(List<TransactionEx> transactions){
  _database.beginTransaction();
  String updateQuery="String_Node_Str" + txTableName + "String_Node_Str"+ Strings.repeat("String_Node_Str",transactions.size() - 1)+ "String_Node_Str";
  SQLiteStatement updateStatement=_database.compileStatement(updateQuery);
  try {
    for (int x=0; x < transactions.size(); x++) {
      int index=x * 5;
      updateStatement.bindBlob(index + 1,transactions.get(x).txid.getBytes());
      updateStatement.bindBlob(index + 2,transactions.get(x).hash.getBytes());
      updateStatement.bindLong(index + 3,transactions.get(x).height == -1 ? Integer.MAX_VALUE : transactions.get(x).height);
      updateStatement.bindLong(index + 4,transactions.get(x).time);
      updateStatement.bindBlob(index + 5,transactions.get(x).binary);
    }
    updateStatement.executeInsert();
    for (    TransactionEx transaction : transactions) {
      putReferencedOutputs(transaction.binary);
    }
    _database.setTransactionSuccessful();
  }
  finally {
    _database.endTransaction();
  }
}
Program: 90973
Project: 90973
Buggy source:
@Override public void putTransactions(List<TransactionEx> transactions){
  String updateQuery="String_Node_Str" + txTableName + "String_Node_Str"+ Strings.repeat("String_Node_Str",transactions.size() - 1)+ "String_Node_Str";
  SQLiteStatement updateStatement=_database.compileStatement(updateQuery);
  for (int x=0; x < transactions.size(); x++) {
    int index=x * 5;
    updateStatement.bindBlob(index + 1,transactions.get(x).txid.getBytes());
    updateStatement.bindBlob(index + 2,transactions.get(x).hash.getBytes());
    updateStatement.bindLong(index + 3,transactions.get(x).height == -1 ? Integer.MAX_VALUE : transactions.get(x).height);
    updateStatement.bindLong(index + 4,transactions.get(x).time);
    updateStatement.bindBlob(index + 5,transactions.get(x).binary);
  }
  updateStatement.executeInsert();
  for (  TransactionEx transaction : transactions) {
    putReferencedOutputs(transaction.binary);
  }
}

Fixed version (ground truth):
@Override public void putTransactions(List<TransactionEx> transactions){
  _database.beginTransaction();
  String updateQuery="String_Node_Str" + txTableName + "String_Node_Str"+ Strings.repeat("String_Node_Str",transactions.size() - 1)+ "String_Node_Str";
  SQLiteStatement updateStatement=_database.compileStatement(updateQuery);
  try {
    for (int x=0; x < transactions.size(); x++) {
      int index=x * 5;
      updateStatement.bindBlob(index + 1,transactions.get(x).txid.getBytes());
      updateStatement.bindBlob(index + 2,transactions.get(x).hash.getBytes());
      updateStatement.bindLong(index + 3,transactions.get(x).height == -1 ? Integer.MAX_VALUE : transactions.get(x).height);
      updateStatement.bindLong(index + 4,transactions.get(x).time);
      updateStatement.bindBlob(index + 5,transactions.get(x).binary);
    }
    updateStatement.executeInsert();
    for (    TransactionEx transaction : transactions) {
      putReferencedOutputs(transaction.binary);
    }
    _database.setTransactionSuccessful();
  }
  finally {
    _database.endTransaction();
  }
}
Program: 90975
Project: 90975
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
  final int itemId=item.getItemId();
switch (itemId) {
case R.id.miColdStorage:
    InstantWalletActivity.callMe(this);
  return true;
case R.id.miSettings:
{
  Intent intent=new Intent(this,SettingsActivity.class);
  startActivityForResult(intent,REQUEST_SETTING_CHANGED);
  return true;
}
case R.id.miBackup:
Utils.pinProtectedWordlistBackup(this);
return true;
case R.id.miRefresh:
SyncMode syncMode=SyncMode.NORMAL_FORCED;
if (new Random().nextInt(5) == 0) {
syncMode=SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED;
}
 else if (mViewPager.getCurrentItem() == TAB_ID_ACCOUNTS) {
syncMode=SyncMode.NORMAL_ALL_ACCOUNTS_FORCED;
}
_mbwManager.getWalletManager(false).startSynchronization(syncMode);
_mbwManager.getColuManager().startSynchronization();
_mbwManager.getExchangeRateManager().requestOptionalRefresh();
return true;
case R.id.miHelp:
openMyceliumHelp();
break;
case R.id.miAbout:
{
Intent intent=new Intent(this,AboutActivity.class);
startActivity(intent);
break;
}
case R.id.miRescanTransactions:
_mbwManager.getSelectedAccount().dropCachedData();
_mbwManager.getWalletManager(false).startSynchronization(SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED);
_mbwManager.getColuManager().startSynchronization();
break;
case R.id.miVerifyMessage:
startActivity(new Intent(this,MessageVerifyActivity.class));
break;
}
return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
  final int itemId=item.getItemId();
switch (itemId) {
case R.id.miColdStorage:
    InstantWalletActivity.callMe(this);
  return true;
case R.id.miSettings:
{
  Intent intent=new Intent(this,SettingsActivity.class);
  startActivityForResult(intent,REQUEST_SETTING_CHANGED);
  return true;
}
case R.id.miBackup:
Utils.pinProtectedWordlistBackup(this);
return true;
case R.id.miRefresh:
SyncMode syncMode=SyncMode.NORMAL_FORCED;
if (new Random().nextInt(5) == 0) {
syncMode=SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED;
}
 else if (mViewPager.getCurrentItem() == TAB_ID_ACCOUNTS) {
syncMode=SyncMode.NORMAL_ALL_ACCOUNTS_FORCED;
}
_mbwManager.getWalletManager(false).startSynchronization(syncMode);
_mbwManager.getColuManager().startSynchronization();
_mbwManager.getExchangeRateManager().requestOptionalRefresh();
showRefresh();
return true;
case R.id.miHelp:
openMyceliumHelp();
break;
case R.id.miAbout:
{
Intent intent=new Intent(this,AboutActivity.class);
startActivity(intent);
break;
}
case R.id.miRescanTransactions:
_mbwManager.getSelectedAccount().dropCachedData();
_mbwManager.getWalletManager(false).startSynchronization(SyncMode.FULL_SYNC_CURRENT_ACCOUNT_FORCED);
_mbwManager.getColuManager().startSynchronization();
break;
case R.id.miVerifyMessage:
startActivity(new Intent(this,MessageVerifyActivity.class));
break;
}
return super.onOptionsItemSelected(item);
}
Program: 90976
Project: 90976
Buggy source:
public void setRefreshAnimation(){
  if (refreshItem != null) {
    if (_mbwManager.getWalletManager(false).getState() == WalletManager.State.SYNCHRONIZING || _mbwManager.getColuManager().getState() == WalletManager.State.SYNCHRONIZING) {
      if (commonSyncState != WalletManager.State.SYNCHRONIZING) {
        commonSyncState=WalletManager.State.SYNCHRONIZING;
        MenuItem menuItem=refreshItem.setActionView(R.layout.actionbar_indeterminate_progress);
        ImageView ivTorIcon=menuItem.getActionView().findViewById(R.id.ivTorIcon);
        if (_mbwManager.getTorMode() == ServerEndpointType.Types.ONLY_TOR && _mbwManager.getTorManager() != null) {
          ivTorIcon.setVisibility(View.VISIBLE);
          if (_mbwManager.getTorManager().getInitState() == 100) {
            ivTorIcon.setImageResource(R.drawable.tor);
          }
 else {
            ivTorIcon.setImageResource(R.drawable.tor_gray);
          }
        }
 else {
          ivTorIcon.setVisibility(View.GONE);
        }
      }
    }
 else {
      commonSyncState=WalletManager.State.READY;
      refreshItem.setActionView(null);
    }
  }
}

Fixed version (ground truth):
public void setRefreshAnimation(){
  if (refreshItem != null) {
    if (_mbwManager.getWalletManager(false).getState() == WalletManager.State.SYNCHRONIZING || _mbwManager.getColuManager().getState() == WalletManager.State.SYNCHRONIZING) {
      if (commonSyncState != WalletManager.State.SYNCHRONIZING) {
        showRefresh();
      }
    }
 else {
      commonSyncState=WalletManager.State.READY;
      refreshItem.setActionView(null);
    }
  }
}
Program: 90977
Project: 90977
Buggy source:
@Override public int hashCode(){
  return outPoint.hash.hashCode() + outPoint.index;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return outPoint.txid.hashCode() + outPoint.index;
}