nus-yam/ex-repair huggingface dataset:
Program: 90978
Project: 90978
Buggy source:
public OutPoint(ByteReader reader) throws InsufficientBytesException {
  this.hash=reader.getSha256Hash();
  this.index=(int)reader.getCompactInt();
}

Fixed version (ground truth):
public OutPoint(ByteReader reader) throws InsufficientBytesException {
  this.txid=reader.getSha256Hash();
  this.index=(int)reader.getCompactInt();
}
Program: 90979
Project: 90979
Buggy source:
@Override public int hashCode(){
  return hash.hashCode() + index;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return txid.hashCode() + index;
}
Program: 90980
Project: 90980
Buggy source:
@Override public boolean equals(Object other){
  if (!(other instanceof OutPoint)) {
    return false;
  }
  return hash.equals(((OutPoint)other).hash) && index == ((OutPoint)other).index;
}

Fixed version (ground truth):
@Override public boolean equals(Object other){
  if (!(other instanceof OutPoint)) {
    return false;
  }
  return txid.equals(((OutPoint)other).txid) && index == ((OutPoint)other).index;
}
Program: 90981
Project: 90981
Buggy source:
@Override public String toString(){
  return String.valueOf(hash) + ':' + index;
}

Fixed version (ground truth):
@Override public String toString(){
  return String.valueOf(txid) + ':' + index;
}
Program: 90982
Project: 90982
Buggy source:
public ByteWriter toByteWriter(ByteWriter writer){
  writer.putSha256Hash(hash);
  writer.putCompactInt(index);
  return writer;
}

Fixed version (ground truth):
public ByteWriter toByteWriter(ByteWriter writer){
  writer.putSha256Hash(txid);
  writer.putCompactInt(index);
  return writer;
}
Program: 90983
Project: 90983
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;
}
Program: 90984
Project: 90984
Buggy source:
@Override public String toString(){
  return String.valueOf(getHash()) + "String_Node_Str" + inputs.length+ "String_Node_Str"+ outputs.length;
}

Fixed version (ground truth):
@Override public String toString(){
  return String.valueOf(getId()) + "String_Node_Str" + inputs.length+ "String_Node_Str"+ outputs.length;
}
Program: 90985
Project: 90985
Buggy source:
public void toByteWriter(ByteWriter writer){
  writer.putSha256Hash(outPoint.hash,true);
  writer.putIntLE(outPoint.index);
  byte[] script=getScript().getScriptBytes();
  writer.putCompactInt(script.length);
  writer.putBytes(script);
  writer.putIntLE(sequence);
}

Fixed version (ground truth):
public void toByteWriter(ByteWriter writer){
  writer.putSha256Hash(outPoint.txid,true);
  writer.putIntLE(outPoint.index);
  byte[] script=getScript().getScriptBytes();
  writer.putCompactInt(script.length);
  writer.putBytes(script);
  writer.putIntLE(sequence);
}
Program: 90986
Project: 90986
Buggy source:
public byte[] getUnmalleableBytes(){
  byte[] scriptBytes=script.getUnmalleableBytes();
  if (scriptBytes == null) {
    return null;
  }
  ByteWriter writer=new ByteWriter(32 + 4 + scriptBytes.length+ 4);
  writer.putSha256Hash(outPoint.hash,true);
  writer.putIntLE(outPoint.index);
  writer.putBytes(scriptBytes);
  writer.putIntLE(sequence);
  return writer.toBytes();
}

Fixed version (ground truth):
public byte[] getUnmalleableBytes(){
  byte[] scriptBytes=script.getUnmalleableBytes();
  if (scriptBytes == null) {
    return null;
  }
  ByteWriter writer=new ByteWriter(32 + 4 + scriptBytes.length+ 4);
  writer.putSha256Hash(outPoint.txid,true);
  writer.putIntLE(outPoint.index);
  writer.putBytes(scriptBytes);
  writer.putIntLE(sequence);
  return writer.toBytes();
}
Program: 90987
Project: 90987
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;
}
Program: 90988
Project: 90988
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + outPoint.hash + ':'+ outPoint.index+ "String_Node_Str"+ script.getScriptBytes().length;
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + outPoint.txid + ':'+ outPoint.index+ "String_Node_Str"+ script.getScriptBytes().length;
}
Program: 90989
Project: 90989
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;
}
Program: 90990
Project: 90990
Buggy source:
/** 
 * takes 32 bytes and stores them as hash. does not actually hash, this is done in HashUtils
 * @param bytes to be stored
 */
public static Sha256Hash of(byte[] bytes){
  return new Sha256Hash(bytes);
}

Fixed version (ground truth):
/** 
 * takes 32 bytes and stores them as hash. does not actually txid, this is done in HashUtils
 * @param bytes to be stored
 */
public static Sha256Hash of(byte[] bytes){
  return new Sha256Hash(bytes);
}
Program: 90991
Project: 90991
Buggy source:
/** 
 * Takes 64 bytes and stores them as hash. does not actually hash, this is done in HashUtils
 * @param bytes to be stored
 */
public static Sha512Hash of(byte[] bytes){
  return new Sha512Hash(bytes);
}

Fixed version (ground truth):
/** 
 * Takes 64 bytes and stores them as hash. does not actually txid, this is done in HashUtils
 * @param bytes to be stored
 */
public static Sha512Hash of(byte[] bytes){
  return new Sha512Hash(bytes);
}
Program: 90992
Project: 90992
Buggy source:
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case IMPORT_WORDLIST:
    if (resultCode != RESULT_OK) {
      initMasterSeed();
      return;
    }
  UUID accountid=(UUID)data.getSerializableExtra(AddAccountActivity.RESULT_KEY);
WalletAccount account=_mbwManager.getWalletManager(false).getAccount(accountid);
String defaultName=getString(R.string.account) + "String_Node_Str" + (((Bip44Account)account).getAccountIndex() + 1);
_mbwManager.getMetadataStorage().storeAccountLabel(accountid,defaultName);
delayedFinish.run();
return;
case StringHandlerActivity.IMPORT_ENCRYPTED_BIP38_PRIVATE_KEY_CODE:
String content=data.getStringExtra("String_Node_Str");
if (content != null) {
InMemoryPrivateKey key=InMemoryPrivateKey.fromBase58String(content,_mbwManager.getNetwork()).get();
UUID onTheFlyAccount=MbwManager.getInstance(this).createOnTheFlyAccount(key);
SendInitializationActivity.callMe(this,onTheFlyAccount,true);
finish();
return;
}
case REQUEST_FROM_URI:
if (resultCode == RESULT_OK) {
Bundle extras=Preconditions.checkNotNull(data.getExtras());
for (String key : extras.keySet()) {
if (!key.equals(Constants.TRANSACTION_HASH_INTENT_KEY)) {
data.removeExtra(key);
}
}
setResult(RESULT_OK,data);
}
 else {
setResult(RESULT_CANCELED);
}
break;
default :
setResult(RESULT_CANCELED);
}
finish();
}

Fixed version (ground truth):
@Override protected void onActivityResult(int requestCode,int resultCode,Intent data){
switch (requestCode) {
case IMPORT_WORDLIST:
    if (resultCode != RESULT_OK) {
      initMasterSeed();
      return;
    }
  UUID accountid=(UUID)data.getSerializableExtra(AddAccountActivity.RESULT_KEY);
WalletAccount account=_mbwManager.getWalletManager(false).getAccount(accountid);
String defaultName=getString(R.string.account) + "String_Node_Str" + (((Bip44Account)account).getAccountIndex() + 1);
_mbwManager.getMetadataStorage().storeAccountLabel(accountid,defaultName);
delayedFinish.run();
return;
case StringHandlerActivity.IMPORT_ENCRYPTED_BIP38_PRIVATE_KEY_CODE:
String content=data.getStringExtra("String_Node_Str");
if (content != null) {
InMemoryPrivateKey key=InMemoryPrivateKey.fromBase58String(content,_mbwManager.getNetwork()).get();
UUID onTheFlyAccount=MbwManager.getInstance(this).createOnTheFlyAccount(key);
SendInitializationActivity.callMe(this,onTheFlyAccount,true);
finish();
return;
}
case REQUEST_FROM_URI:
if (resultCode == RESULT_OK) {
Bundle extras=Preconditions.checkNotNull(data.getExtras());
for (String key : extras.keySet()) {
if (!key.equals(Constants.TRANSACTION_ID_INTENT_KEY)) {
data.removeExtra(key);
}
}
setResult(RESULT_OK,data);
}
 else {
setResult(RESULT_CANCELED);
}
break;
default :
setResult(RESULT_CANCELED);
}
finish();
}
Program: 90993
Project: 90993
Buggy source:
private void setResultOkay(){
  if (_transactionLabel != null) {
    _mbwManager.getMetadataStorage().storeTransactionLabel(_transaction.getHash(),_transactionLabel);
  }
  Intent result=new Intent().putExtra(Constants.TRANSACTION_FIAT_VALUE_KEY,_fiatValue).putExtra(Constants.TRANSACTION_HASH_INTENT_KEY,_transaction.getHash().toString());
  setResult(RESULT_OK,result);
}

Fixed version (ground truth):
private void setResultOkay(){
  if (_transactionLabel != null) {
    _mbwManager.getMetadataStorage().storeTransactionLabel(_transaction.getId(),_transactionLabel);
  }
  Intent result=new Intent().putExtra(Constants.TRANSACTION_FIAT_VALUE_KEY,_fiatValue).putExtra(Constants.TRANSACTION_ID_INTENT_KEY,_transaction.getId().toString());
  setResult(RESULT_OK,result);
}
Program: 90995
Project: 90995
Buggy source:
@Override public List<TransactionEx> getTransactionHistory(int offset,int limit){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(limit),Integer.toString(offset)});
    while (cursor.moveToNext()) {
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public List<TransactionEx> getTransactionHistory(int offset,int limit){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(limit),Integer.toString(offset)});
    while (cursor.moveToNext()) {
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 90996
Project: 90996
Buggy source:
private void putReferencedOutputs(byte[] rawTx){
  try {
    final Transaction transaction=Transaction.fromBytes(rawTx);
    final List<OutPoint> refersOutpoint=new ArrayList<>();
    for (    TransactionInput input : transaction.inputs) {
      refersOutpoint.add(input.outPoint);
    }
    putTxRefersParentTransaction(transaction.getHash(),refersOutpoint);
  }
 catch (  Transaction.TransactionParsingException e) {
    Log.w(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
private void putReferencedOutputs(byte[] rawTx){
  try {
    final Transaction transaction=Transaction.fromBytes(rawTx);
    final List<OutPoint> refersOutpoint=new ArrayList<>();
    for (    TransactionInput input : transaction.inputs) {
      refersOutpoint.add(input.outPoint);
    }
    putTxRefersParentTransaction(transaction.getId(),refersOutpoint);
  }
 catch (  Transaction.TransactionParsingException e) {
    Log.w(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}
Program: 90997
Project: 90997
Buggy source:
@Override public Collection<TransactionEx> getYoungTransactions(int maxConfirmations,int blockChainHeight){
  int maxHeight=blockChainHeight - maxConfirmations + 1;
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(maxHeight)});
    while (cursor.moveToNext()) {
      int height=cursor.getInt(1);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),height,cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public Collection<TransactionEx> getYoungTransactions(int maxConfirmations,int blockChainHeight){
  int maxHeight=blockChainHeight - maxConfirmations + 1;
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(maxHeight)});
    while (cursor.moveToNext()) {
      int height=cursor.getInt(1);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,height,cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 90998
Project: 90998
Buggy source:
@Override public List<TransactionEx> getTransactionsSince(long since){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str"+ "String_Node_Str",new String[]{Long.toString(since / 1000)});
    while (cursor.moveToNext()) {
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public List<TransactionEx> getTransactionsSince(long since){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str"+ "String_Node_Str",new String[]{Long.toString(since / 1000)});
    while (cursor.moveToNext()) {
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 90999
Project: 90999
Buggy source:
@Override public TransactionEx getTransaction(Sha256Hash hash){
  Cursor cursor=null;
  try {
    SQLiteQueryWithBlobs blobQuery=new SQLiteQueryWithBlobs(_db);
    blobQuery.bindBlob(1,hash.getBytes());
    cursor=blobQuery.query(false,txTableName,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},"String_Node_Str",null,null,null,null,null);
    if (cursor.moveToNext()) {
      int height=cursor.getInt(0);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      return new TransactionEx(hash,height,cursor.getInt(1),cursor.getBlob(2));
    }
    return null;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public TransactionEx getTransaction(Sha256Hash txid){
  Cursor cursor=null;
  try {
    SQLiteQueryWithBlobs blobQuery=new SQLiteQueryWithBlobs(_db);
    blobQuery.bindBlob(1,txid.getBytes());
    cursor=blobQuery.query(false,txTableName,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},"String_Node_Str",null,null,null,null,null);
    if (cursor.moveToNext()) {
      int height=cursor.getInt(0);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      return new TransactionEx(txid,txid,height,cursor.getInt(1),cursor.getBlob(2));
    }
    return null;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 91000
Project: 91000
Buggy source:
@Override public Collection<TransactionEx> getUnconfirmedTransactions(){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{});
    while (cursor.moveToNext()) {
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),-1,cursor.getInt(1),cursor.getBlob(2));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public Collection<TransactionEx> getUnconfirmedTransactions(){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{});
    while (cursor.moveToNext()) {
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,-1,cursor.getInt(1),cursor.getBlob(2));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 91003
Project: 91003
Buggy source:
public static byte[] outPointToBytes(OutPoint outPoint){
  byte[] bytes=new byte[34];
  System.arraycopy(outPoint.hash.getBytes(),0,bytes,0,Sha256Hash.HASH_LENGTH);
  bytes[32]=(byte)(outPoint.index & 0xFF);
  bytes[33]=(byte)((outPoint.index >> 8) & 0xFF);
  return bytes;
}

Fixed version (ground truth):
public static byte[] outPointToBytes(OutPoint outPoint){
  byte[] bytes=new byte[34];
  System.arraycopy(outPoint.txid.getBytes(),0,bytes,0,Sha256Hash.HASH_LENGTH);
  bytes[32]=(byte)(outPoint.index & 0xFF);
  bytes[33]=(byte)((outPoint.index >> 8) & 0xFF);
  return bytes;
}
Program: 91004
Project: 91004
Buggy source:
@Override public List<TransactionEx> getTransactionHistory(int offset,int limit){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(limit),Integer.toString(offset)});
    while (cursor.moveToNext()) {
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public List<TransactionEx> getTransactionHistory(int offset,int limit){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(limit),Integer.toString(offset)});
    while (cursor.moveToNext()) {
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 91005
Project: 91005
Buggy source:
private void putReferencedOutputs(byte[] rawTx){
  try {
    final Transaction transaction=Transaction.fromBytes(rawTx);
    final List<OutPoint> refersOutpoint=new ArrayList<>();
    for (    TransactionInput input : transaction.inputs) {
      refersOutpoint.add(input.outPoint);
    }
    putTxRefersParentTransaction(transaction.getHash(),refersOutpoint);
  }
 catch (  Transaction.TransactionParsingException e) {
    Log.w(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
private void putReferencedOutputs(byte[] rawTx){
  try {
    final Transaction transaction=Transaction.fromBytes(rawTx);
    final List<OutPoint> refersOutpoint=new ArrayList<>();
    for (    TransactionInput input : transaction.inputs) {
      refersOutpoint.add(input.outPoint);
    }
    putTxRefersParentTransaction(transaction.getId(),refersOutpoint);
  }
 catch (  Transaction.TransactionParsingException e) {
    Log.w(LOG_TAG,"String_Node_Str" + e.getMessage());
  }
}
Program: 91006
Project: 91006
Buggy source:
@Override public Collection<TransactionEx> getYoungTransactions(int maxConfirmations,int blockChainHeight){
  int maxHeight=blockChainHeight - maxConfirmations + 1;
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(maxHeight)});
    while (cursor.moveToNext()) {
      int height=cursor.getInt(1);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),height,cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public Collection<TransactionEx> getYoungTransactions(int maxConfirmations,int blockChainHeight){
  int maxHeight=blockChainHeight - maxConfirmations + 1;
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{Integer.toString(maxHeight)});
    while (cursor.moveToNext()) {
      int height=cursor.getInt(1);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,height,cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 91007
Project: 91007
Buggy source:
@Override public List<TransactionEx> getTransactionsSince(long since){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str"+ "String_Node_Str",new String[]{Long.toString(since / 1000)});
    while (cursor.moveToNext()) {
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public List<TransactionEx> getTransactionsSince(long since){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str"+ "String_Node_Str",new String[]{Long.toString(since / 1000)});
    while (cursor.moveToNext()) {
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,cursor.getInt(1),cursor.getInt(2),cursor.getBlob(3));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 91008
Project: 91008
Buggy source:
@Override public TransactionEx getTransaction(Sha256Hash hash){
  Cursor cursor=null;
  try {
    SQLiteQueryWithBlobs blobQuery=new SQLiteQueryWithBlobs(_db);
    blobQuery.bindBlob(1,hash.getBytes());
    cursor=blobQuery.query(false,txTableName,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},"String_Node_Str",null,null,null,null,null);
    if (cursor.moveToNext()) {
      int height=cursor.getInt(0);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      return new TransactionEx(hash,height,cursor.getInt(1),cursor.getBlob(2));
    }
    return null;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public TransactionEx getTransaction(Sha256Hash txid){
  Cursor cursor=null;
  try {
    SQLiteQueryWithBlobs blobQuery=new SQLiteQueryWithBlobs(_db);
    blobQuery.bindBlob(1,txid.getBytes());
    cursor=blobQuery.query(false,txTableName,new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"},"String_Node_Str",null,null,null,null,null);
    if (cursor.moveToNext()) {
      int height=cursor.getInt(0);
      if (height == Integer.MAX_VALUE) {
        height=-1;
      }
      return new TransactionEx(txid,txid,height,cursor.getInt(1),cursor.getBlob(2));
    }
    return null;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 91009
Project: 91009
Buggy source:
@Override public Collection<TransactionEx> getUnconfirmedTransactions(){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{});
    while (cursor.moveToNext()) {
      TransactionEx tex=new TransactionEx(new Sha256Hash(cursor.getBlob(0)),-1,cursor.getInt(1),cursor.getBlob(2));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}

Fixed version (ground truth):
@Override public Collection<TransactionEx> getUnconfirmedTransactions(){
  Cursor cursor=null;
  List<TransactionEx> list=new LinkedList<>();
  try {
    cursor=_db.rawQuery("String_Node_Str" + txTableName + "String_Node_Str",new String[]{});
    while (cursor.moveToNext()) {
      Sha256Hash txid=new Sha256Hash(cursor.getBlob(0));
      TransactionEx tex=new TransactionEx(txid,txid,-1,cursor.getInt(1),cursor.getBlob(2));
      list.add(tex);
    }
    return list;
  }
  finally {
    if (cursor != null) {
      cursor.close();
    }
  }
}
Program: 91010
Project: 91010
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setView();
  lvAccounts=(ListView)findViewById(R.id.lvAccounts);
  txtStatus=(TextView)findViewById(R.id.txtStatus);
  accountsAdapter=new AccountsAdapter(this,R.id.lvAccounts,accounts);
  lvAccounts.setAdapter(accountsAdapter);
  lvAccounts.setOnItemClickListener(accountClickListener());
  masterseedScanManager=initMasterseedManager();
  startBackgroundScan();
  updateUi();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setView();
  lvAccounts=findViewById(R.id.lvAccounts);
  txtStatus=findViewById(R.id.txtStatus);
  accountsAdapter=new AccountsAdapter(this,R.id.lvAccounts,accounts);
  lvAccounts.setAdapter(accountsAdapter);
  lvAccounts.setOnItemClickListener(accountClickListener());
  masterseedScanManager=initMasterseedManager();
  startBackgroundScan();
  updateUi();
}
Program: 91011
Project: 91011
Buggy source:
private AccountsAdapter(Context context,int resource,List<HdAccountWrapper> objects){
  super(context,resource,objects);
}

Fixed version (ground truth):
private AccountsAdapter(Context context,int resource,List<HdAccountWrapper> objects){
  super(context,resource,objects);
  inflater=LayoutInflater.from(getContext());
}
Program: 91012
Project: 91012
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View row;
  if (convertView == null) {
    row=inflater.inflate(R.layout.record_row,parent,false);
  }
 else {
    row=convertView;
  }
  HdAccountWrapper account=getItem(position);
  ((TextView)row.findViewById(R.id.tvLabel)).setText(account.name);
  WalletAccount walletAccount=MbwManager.getInstance(getContext()).getWalletManager(true).getAccount(account.id);
  Balance balance=walletAccount.getBalance();
  String balanceString=MbwManager.getInstance(getContext()).getBtcValueString(balance.confirmed + balance.pendingChange);
  if (balance.getSendingBalance() > 0) {
    balanceString+="String_Node_Str" + String.format(getString(R.string.account_balance_sending_amount),MbwManager.getInstance(getContext()).getBtcValueString(balance.getSendingBalance()));
  }
  Drawable drawableForAccount=Utils.getDrawableForAccount(walletAccount,true,getResources());
  ((TextView)row.findViewById(R.id.tvBalance)).setText(balanceString);
  row.findViewById(R.id.tvAddress).setVisibility(View.GONE);
  ((ImageView)row.findViewById(R.id.ivIcon)).setImageDrawable(drawableForAccount);
  row.findViewById(R.id.tvBackupMissingWarning).setVisibility(View.GONE);
  return row;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  View row;
  if (convertView == null) {
    row=inflater.inflate(R.layout.record_row,parent,false);
  }
 else {
    row=convertView;
  }
  HdAccountWrapper account=getItem(position);
  ((TextView)row.findViewById(R.id.tvLabel)).setText(account.name);
  WalletAccount walletAccount=MbwManager.getInstance(getContext()).getWalletManager(true).getAccount(account.id);
  Balance balance=walletAccount.getBalance();
  String balanceString=MbwManager.getInstance(getContext()).getBtcValueString(balance.confirmed + balance.pendingChange);
  if (balance.getSendingBalance() > 0) {
    balanceString+="String_Node_Str" + String.format(getString(R.string.account_balance_sending_amount),MbwManager.getInstance(getContext()).getBtcValueString(balance.getSendingBalance()));
  }
  Drawable drawableForAccount=Utils.getDrawableForAccount(walletAccount,true,getResources());
  ((TextView)row.findViewById(R.id.tvBalance)).setText(balanceString);
  row.findViewById(R.id.tvAddress).setVisibility(View.GONE);
  ((ImageView)row.findViewById(R.id.ivIcon)).setImageDrawable(drawableForAccount);
  row.findViewById(R.id.tvBackupMissingWarning).setVisibility(View.GONE);
  row.findViewById(R.id.tvAccountType).setVisibility(View.GONE);
  return row;
}
Program: 91014
Project: 91014
Buggy source:
private void askForPassphrase(){
  if (usesPassphrase) {
    final EditText pass=new EditText(this);
    AlertDialog.Builder builder=new AlertDialog.Builder(this);
    builder.setTitle(R.string.type_password_title);
    builder.setView(pass).setCancelable(false).setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
        calculateSeed(pass.getText().toString());
      }
    }
).show();
  }
 else {
    calculateSeed("String_Node_Str");
  }
}

Fixed version (ground truth):
private void askForPassphrase(){
  if (usesPassphrase) {
    View view=LayoutInflater.from(this).inflate(R.layout.layout_password,null);
    final EditText pass=view.findViewById(R.id.et_password);
    AlertDialog.Builder builder=new AlertDialog.Builder(this,R.style.MyceliumModern_Dialog);
    builder.setTitle(R.string.type_password_title);
    builder.setView(view).setCancelable(false).setPositiveButton(R.string.ok,new DialogInterface.OnClickListener(){
      public void onClick(      DialogInterface dialog,      int id){
        calculateSeed(pass.getText().toString());
      }
    }
).show();
  }
 else {
    calculateSeed("String_Node_Str");
  }
}
Program: 91017
Project: 91017
Buggy source:
public void onRadioButtonClicked(View view){
  boolean checked=((RadioButton)view).isChecked();
  ColuAssetType assetType;
  String name;
switch (view.getId()) {
case R.id.radio_mycelium_tokens:
    assetType=MT;
  name="String_Node_Str";
break;
case R.id.radio_mass_tokens:
assetType=MASS;
name="String_Node_Str";
break;
case R.id.radio_rmc_tokens:
assetType=RMC;
name="String_Node_Str";
break;
default :
return;
}
if (checked) {
selectedColuAsset=ColuAsset.getByType(assetType);
}
btColuAddAccount.setEnabled(true);
Toast.makeText(this,name + "String_Node_Str",Toast.LENGTH_SHORT).show();
}

Fixed version (ground truth):
@OnClick({R.id.radio_mycelium_tokens,R.id.radio_mass_tokens,R.id.radio_rmc_tokens}) public void onRadioButtonClicked(View view){
  boolean checked=((RadioButton)view).isChecked();
  ColuAssetType assetType;
  String name;
switch (view.getId()) {
case R.id.radio_mycelium_tokens:
    assetType=MT;
  name="String_Node_Str";
break;
case R.id.radio_mass_tokens:
assetType=MASS;
name="String_Node_Str";
break;
case R.id.radio_rmc_tokens:
assetType=RMC;
name="String_Node_Str";
break;
default :
return;
}
if (checked) {
selectedColuAsset=ColuAsset.getByType(assetType);
}
btColuAddAccount.setEnabled(true);
Toast.makeText(this,name + "String_Node_Str",Toast.LENGTH_SHORT).show();
}
Program: 91018
Project: 91018
Buggy source:
public void updateData(){
  itemList.clear();
  AccountManager am=AccountManager.INSTANCE;
  addGroup(R.string.active_hd_accounts_name,GROUP_TITLE_TYPE,am.getBTCBip44Accounts().values());
  addGroup("String_Node_Str",GROUP_TITLE_TYPE,am.getBTCSingleAddressAccounts().values());
  addGroup(R.string.bitcoin_cash_hd,GROUP_TITLE_TYPE,am.getBCHBip44Accounts().values());
  addGroup(R.string.bitcoin_cash_sa,GROUP_TITLE_TYPE,am.getBCHSingleAddressAccounts().values());
  List<WalletAccount> coluAccounts=new ArrayList<>();
  for (  WalletAccount walletAccount : am.getColuAccounts().values()) {
    coluAccounts.add(walletAccount);
    coluAccounts.add(((ColuAccount)walletAccount).getLinkedAccount());
  }
  addGroup(R.string.digital_assets,GROUP_TITLE_TYPE,coluAccounts);
  List<WalletAccount> accounts=am.getActiveAccounts().values().asList();
  List<WalletAccount> other=new ArrayList<>();
  for (  WalletAccount account : accounts) {
switch (account.getType()) {
case BTCSINGLEADDRESS:
case BTCBIP44:
case BCHSINGLEADDRESS:
case BCHBIP44:
case COLU:
      break;
default :
    other.add(account);
  break;
}
}
addGroup(R.string.active_other_accounts_name,GROUP_TITLE_TYPE,other);
itemList.add(new Item(TOTAL_BALANCE_TYPE,"String_Node_Str",am.getActiveAccounts().values().asList()));
addGroup(R.string.archive_name,GROUP_ARCHIVED_TITLE_TYPE,am.getArchivedAccounts().values());
notifyDataSetChanged();
}

Fixed version (ground truth):
public void updateData(){
  itemList.clear();
  AccountManager am=AccountManager.INSTANCE;
  addGroup(R.string.active_hd_accounts_name,GROUP_TITLE_TYPE,am.getBTCBip44Accounts().values());
  addGroup(context.getString(R.string.active_bitcoin_sa_group_name),GROUP_TITLE_TYPE,am.getBTCSingleAddressAccounts().values());
  addGroup(R.string.bitcoin_cash_hd,GROUP_TITLE_TYPE,am.getBCHBip44Accounts().values());
  addGroup(R.string.bitcoin_cash_sa,GROUP_TITLE_TYPE,am.getBCHSingleAddressAccounts().values());
  List<WalletAccount> coluAccounts=new ArrayList<>();
  for (  WalletAccount walletAccount : am.getColuAccounts().values()) {
    coluAccounts.add(walletAccount);
    coluAccounts.add(((ColuAccount)walletAccount).getLinkedAccount());
  }
  addGroup(R.string.digital_assets,GROUP_TITLE_TYPE,coluAccounts);
  List<WalletAccount> accounts=am.getActiveAccounts().values().asList();
  List<WalletAccount> other=new ArrayList<>();
  for (  WalletAccount account : accounts) {
switch (account.getType()) {
case BTCSINGLEADDRESS:
case BTCBIP44:
case BCHSINGLEADDRESS:
case BCHBIP44:
case COLU:
      break;
default :
    other.add(account);
  break;
}
}
addGroup(R.string.active_other_accounts_name,GROUP_TITLE_TYPE,other);
itemList.add(new Item(TOTAL_BALANCE_TYPE,"String_Node_Str",am.getActiveAccounts().values().asList()));
addGroup(R.string.archive_name,GROUP_ARCHIVED_TITLE_TYPE,am.getArchivedAccounts().values());
notifyDataSetChanged();
}
Program: 91021
Project: 91021
Buggy source:
void initExternalSettings(){
  final PreferenceCategory external=(PreferenceCategory)findPreference("String_Node_Str");
  final List<BuySellServiceDescriptor> buySellServices=_mbwManager.getEnvironmentSettings().getBuySellServices();
  for (  final BuySellServiceDescriptor buySellService : buySellServices) {
    if (!buySellService.showEnableInSettings()) {
      continue;
    }
    final CheckBoxPreference cbService=new CheckBoxPreference(this);
    final String enableTitle=getResources().getString(R.string.settings_service_enabled,getResources().getString(buySellService.title));
    cbService.setTitle(enableTitle);
    cbService.setSummary(buySellService.settingDescription);
    cbService.setChecked(buySellService.isEnabled(_mbwManager));
    cbService.setOnPreferenceClickListener(new OnPreferenceClickListener(){
      @Override public boolean onPreferenceClick(      Preference preference){
        CheckBoxPreference p=(CheckBoxPreference)preference;
        buySellService.setEnabled(_mbwManager,p.isChecked());
        return true;
      }
    }
);
    external.addPreference(cbService);
  }
}

Fixed version (ground truth):
void initExternalSettings(){
  final PreferenceCategory external=(PreferenceCategory)findPreference("String_Node_Str");
  final List<BuySellServiceDescriptor> buySellServices=_mbwManager.getEnvironmentSettings().getBuySellServices();
  for (  final BuySellServiceDescriptor buySellService : buySellServices) {
    if (!buySellService.showEnableInSettings()) {
      continue;
    }
    final CheckBoxPreference cbService=new CheckBoxPreference(this);
    final String enableTitle=getResources().getString(R.string.settings_service_enabled,getResources().getString(buySellService.title));
    cbService.setTitle(enableTitle);
    cbService.setSummary(buySellService.settingDescription);
    cbService.setChecked(buySellService.isEnabled(_mbwManager));
    cbService.setWidgetLayoutResource(R.layout.preference_checkbox);
    cbService.setOnPreferenceClickListener(new OnPreferenceClickListener(){
      @Override public boolean onPreferenceClick(      Preference preference){
        CheckBoxPreference p=(CheckBoxPreference)preference;
        buySellService.setEnabled(_mbwManager,p.isChecked());
        return true;
      }
    }
);
    external.addPreference(cbService);
  }
}
Program: 91023
Project: 91023
Buggy source:
private void startExchange(Intent intent){
  final ExchangeRate exchangeRate=_mbwManager.getExchangeRateManager().getExchangeRate("String_Node_Str");
  if (exchangeRate == null || exchangeRate.price == null) {
    new AlertDialog.Builder(getActivity()).setMessage(R.string.exchange_service_unavailable).setPositiveButton(R.string.button_ok,null).create().show();
    _mbwManager.getExchangeRateManager().requestRefresh();
  }
 else {
    startActivity(intent);
  }
}

Fixed version (ground truth):
private void startExchange(Intent intent){
  startActivity(intent);
}
Program: 91026
Project: 91026
Buggy source:
private void initFeeView(){
  feeValueList.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false));
  feeViewAdapter=new FeeViewAdapter(feeFirstItemWidth);
  feeItemsBuilder=new FeeItemsBuilder(_mbwManager);
  feeValueList.setSelectListener(new SelectListener(){
    @Override public void onSelect(    RecyclerView.Adapter adapter,    int position){
      FeeItem item=((FeeViewAdapter)adapter).getItem(position);
      feePerKbValue=item.feePerKb;
      updateRecipient();
      checkHaveSpendAccount();
      updateAmount();
      updateFeeText();
      updateError();
      btSend.setEnabled(_transactionStatus == TransactionStatus.OK);
      ScrollView scrollView=(ScrollView)findViewById(R.id.root);
      if (showSendBtn && scrollView.getMaxScrollAmount() - scrollView.getScaleY() > 0) {
        scrollView.smoothScrollBy(0,scrollView.getMaxScrollAmount());
        showSendBtn=false;
      }
    }
  }
);
  feeValueList.setAdapter(feeViewAdapter);
  feeValueList.setHasFixedSize(true);
}

Fixed version (ground truth):
private void initFeeView(){
  feeValueList.setLayoutManager(new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false));
  feeValueList.setHasFixedSize(true);
  feeViewAdapter=new FeeViewAdapter(feeFirstItemWidth);
  feeItemsBuilder=new FeeItemsBuilder(_mbwManager);
  feeValueList.setAdapter(feeViewAdapter);
  feeValueList.setSelectListener(new SelectListener(){
    @Override public void onSelect(    RecyclerView.Adapter adapter,    int position){
      FeeItem item=((FeeViewAdapter)adapter).getItem(position);
      feePerKbValue=item.feePerKb;
      updateRecipient();
      checkHaveSpendAccount();
      updateAmount();
      updateFeeText();
      updateError();
      btSend.setEnabled(_transactionStatus == TransactionStatus.OK);
      ScrollView scrollView=findViewById(R.id.root);
      if (showSendBtn && scrollView.getMaxScrollAmount() - scrollView.getScaleY() > 0) {
        scrollView.smoothScrollBy(0,scrollView.getMaxScrollAmount());
        showSendBtn=false;
      }
    }
  }
);
}
Program: 91027
Project: 91027
Buggy source:
@Override public void onBindViewHolder(FeeLvlViewAdapter.ViewHolder holder,int position){
  super.onBindViewHolder(holder,position);
  if (getItemViewType(position) == VIEW_TYPE_ITEM) {
    FeeLvlItem item=mDataset.get(position);
    holder.itemTextView.setText(item.minerFee.getMinerFeeName(holder.itemView.getContext()));
    holder.valueTextView.setText(item.duration);
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(FeeLvlViewAdapter.ViewHolder holder,int position){
  super.onBindViewHolder(holder,position);
  if (getItemViewType(position) == VIEW_TYPE_ITEM) {
    FeeLvlItem item=mDataset.get(position);
    holder.itemTextView.setText(item.minerFee.getMinerFeeName(holder.itemView.getContext()));
    holder.valueTextView.setText(item.duration);
  }
 else {
    RecyclerView.LayoutParams layoutParams=(RecyclerView.LayoutParams)holder.itemView.getLayoutParams();
    layoutParams.width=paddingWidth;
    holder.itemView.setLayoutParams(layoutParams);
  }
}
Program: 91028
Project: 91028
Buggy source:
@Override public void onBindViewHolder(ViewHolder holder,int position){
  super.onBindViewHolder(holder,position);
  if (getItemViewType(position) == VIEW_TYPE_ITEM) {
    FeeItem item=mDataset.get(position);
    if (item.btc != null) {
      holder.categoryTextView.setText(CoinUtil.valueString(item.btc.getLongValue(),mBTC,true) + "String_Node_Str" + mBTC.getUnicodeName());
    }
    if (item.currencyValue != null && item.currencyValue.getValue() != null) {
      holder.itemTextView.setText("String_Node_Str" + item.currencyValue.getValue().setScale(2,BigDecimal.ROUND_HALF_DOWN) + "String_Node_Str"+ item.currencyValue.getCurrency());
    }
    holder.valueTextView.setText(String.valueOf(Math.round(item.feePerKb / 1000f)) + "String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void onBindViewHolder(ViewHolder holder,int position){
  super.onBindViewHolder(holder,position);
  if (getItemViewType(position) == VIEW_TYPE_ITEM) {
    FeeItem item=mDataset.get(position);
    if (item.btc != null) {
      holder.categoryTextView.setText(CoinUtil.valueString(item.btc.getLongValue(),mBTC,true) + "String_Node_Str" + mBTC.getUnicodeName());
    }
    if (item.currencyValue != null && item.currencyValue.getValue() != null) {
      holder.itemTextView.setText("String_Node_Str" + item.currencyValue.getValue().setScale(2,BigDecimal.ROUND_HALF_DOWN) + "String_Node_Str"+ item.currencyValue.getCurrency());
    }
    holder.valueTextView.setText(String.valueOf(Math.round(item.feePerKb / 1000f)) + "String_Node_Str");
  }
 else {
    RecyclerView.LayoutParams layoutParams=(RecyclerView.LayoutParams)holder.itemView.getLayoutParams();
    layoutParams.width=paddingWidth;
    holder.itemView.setLayoutParams(layoutParams);
  }
}
Program: 91029
Project: 91029
Buggy source:
private UUID returnSAAccount(InMemoryPrivateKey key,MetadataStorage.BackupState backupState){
  UUID acc;
  try {
    acc=_mbwManager.getWalletManager(false).createSingleAddressAccount(key,AesKeyCipher.defaultKeyCipher());
    _mbwManager.getMetadataStorage().setIgnoreLegacyWarning(acc,true);
    _mbwManager.getMetadataStorage().setOtherAccountBackupState(acc,backupState);
    return acc;
  }
 catch (  KeyCipher.InvalidKeyCipher invalidKeyCipher) {
    throw new RuntimeException(invalidKeyCipher);
  }
}

Fixed version (ground truth):
private UUID returnSAAccount(InMemoryPrivateKey key,MetadataStorage.BackupState backupState){
  UUID acc;
  try {
    acc=_mbwManager.getWalletManager(false).createSingleAddressAccount(key,AesKeyCipher.defaultKeyCipher());
    _mbwManager.getMetadataStorage().setOtherAccountBackupState(acc,backupState);
    return acc;
  }
 catch (  KeyCipher.InvalidKeyCipher invalidKeyCipher) {
    throw new RuntimeException(invalidKeyCipher);
  }
}
Program: 91030
Project: 91030
Buggy source:
@Override public View getView(int position,View convertView,ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View row;
  if (convertView == null) {
    row=inflater.inflate(R.layout.record_row,parent,false);
  }
 else {
    row=convertView;
  }
  HdAccountWrapper account=getItem(position);
  ((TextView)row.findViewById(R.id.tvLabel)).setText(account.name);
  WalletAccount walletAccount=MbwManager.getInstance(getContext()).getWalletManager(true).getAccount(account.id);
  Balance balance=walletAccount.getBalance();
  String balanceString=MbwManager.getInstance(getContext()).getBtcValueString(balance.confirmed + balance.pendingChange);
  if (balance.getSendingBalance() > 0) {
    balanceString+="String_Node_Str" + String.format(getString(R.string.account_balance_sending_amount),MbwManager.getInstance(getContext()).getBtcValueString(balance.getSendingBalance()));
  }
  Drawable drawableForAccount=Utils.getDrawableForAccount(walletAccount,true,getResources());
  ((TextView)row.findViewById(R.id.tvBalance)).setText(balanceString);
  ((TextView)row.findViewById(R.id.tvAddress)).setVisibility(View.GONE);
  ((ImageView)row.findViewById(R.id.ivIcon)).setImageDrawable(drawableForAccount);
  ((TextView)row.findViewById(R.id.tvBackupMissingWarning)).setVisibility(View.GONE);
  return row;
}

Fixed version (ground truth):
@Override public View getView(int position,View convertView,ViewGroup parent){
  LayoutInflater inflater=(LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  View row;
  if (convertView == null) {
    row=inflater.inflate(R.layout.record_row,parent,false);
  }
 else {
    row=convertView;
  }
  HdAccountWrapper account=getItem(position);
  ((TextView)row.findViewById(R.id.tvLabel)).setText(account.name);
  WalletAccount walletAccount=MbwManager.getInstance(getContext()).getWalletManager(true).getAccount(account.id);
  Balance balance=walletAccount.getBalance();
  String balanceString=MbwManager.getInstance(getContext()).getBtcValueString(balance.confirmed + balance.pendingChange);
  if (balance.getSendingBalance() > 0) {
    balanceString+="String_Node_Str" + String.format(getString(R.string.account_balance_sending_amount),MbwManager.getInstance(getContext()).getBtcValueString(balance.getSendingBalance()));
  }
  Drawable drawableForAccount=Utils.getDrawableForAccount(walletAccount,true,getResources());
  ((TextView)row.findViewById(R.id.tvBalance)).setText(balanceString);
  row.findViewById(R.id.tvAddress).setVisibility(View.GONE);
  ((ImageView)row.findViewById(R.id.ivIcon)).setImageDrawable(drawableForAccount);
  row.findViewById(R.id.tvBackupMissingWarning).setVisibility(View.GONE);
  return row;
}