nus-yam/ex-repair huggingface dataset:
Program: 187346
Project: 187346
Buggy source:
/** 
 * Returns true if the step in the walkthrough has already been shown.
 * @param step The step in the walkthrough
 * @return
 */
public static boolean hasShown(Step step,Activity activity){
  Log.v("String_Node_Str",QuickPrefsActivity.ENABLE_WALKTHROUGH_SETTING_KEY);
  if (PreferenceManager.getDefaultSharedPreferences(activity.getApplicationContext()).getBoolean(QuickPrefsActivity.ENABLE_WALKTHROUGH_SETTING_KEY,false)) {
    DBAccessor dba=new DBAccessor(activity);
    WalkthroughStep ws=dba.getWalkthrough();
    return ws.get(step);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Returns true if the step in the walkthrough has already been shown.
 * @param step The step in the walkthrough
 * @return
 */
public static boolean hasShown(Step step,Activity activity){
  if (PreferenceManager.getDefaultSharedPreferences(activity.getBaseContext()).getBoolean(QuickPrefsActivity.ENABLE_WALKTHROUGH_SETTING_KEY,true)) {
    DBAccessor dba=new DBAccessor(activity);
    WalkthroughStep ws=dba.getWalkthrough();
    return ws.get(step);
  }
  return true;
}
Program: 187347
Project: 187347
Buggy source:
/** 
 * Enables the whole walkthrough by initializing every step as not having been viewed, this should be executed the first time the application is started.
 */
public static void enableWalkthrough(Activity activity){
  WalkthroughStep ws=new WalkthroughStep(true);
  DBAccessor dba=new DBAccessor(activity);
  dba.updateWalkthrough(ws);
}

Fixed version (ground truth):
/** 
 * Enables the whole walkthrough by initializing every step as not having been viewed, this should be executed the first time the application is started.
 */
public static void enableWalkthrough(Activity activity){
  WalkthroughStep ws=new WalkthroughStep(false);
  DBAccessor dba=new DBAccessor(activity);
  dba.updateWalkthrough(ws);
}
Program: 187348
Project: 187348
Buggy source:
/** 
 * Disables the whole walkthrough by initializing every step as not having been viewed, this should be executed the first time the application is started.
 */
public static void disableWalkthrough(Activity activity){
  WalkthroughStep ws=new WalkthroughStep(false);
  DBAccessor dba=new DBAccessor(activity);
  dba.updateWalkthrough(ws);
}

Fixed version (ground truth):
/** 
 * Disables the whole walkthrough by initializing every step as not having been viewed, this should be executed the first time the application is started.
 */
public static void disableWalkthrough(Activity activity){
  WalkthroughStep ws=new WalkthroughStep(true);
  DBAccessor dba=new DBAccessor(activity);
  dba.updateWalkthrough(ws);
}
Program: 187349
Project: 187349
Buggy source:
/** 
 * Enables a step in the walkthrough in the application settings preferences, this should only be called upon completion of the walkthrough.
 */
public static void enableWalkthroughStep(Step step,Activity activity){
  DBAccessor dba=new DBAccessor(activity);
  WalkthroughStep ws=new WalkthroughStep(null);
  ws.set(step,true);
  dba.updateWalkthrough(ws);
}

Fixed version (ground truth):
/** 
 * Enables a step in the walkthrough in the application settings preferences, this should only be called upon completion of the walkthrough.
 */
public static void enableWalkthroughStep(Step step,Activity activity){
  DBAccessor dba=new DBAccessor(activity);
  WalkthroughStep ws=new WalkthroughStep(null);
  ws.set(step,false);
  dba.updateWalkthrough(ws);
}
Program: 187350
Project: 187350
Buggy source:
/** 
 * Disables a step in the walkthrough in the application settings preferences, this should only be called upon completion of the walkthrough.
 */
private static void disableWalkthroughStep(Step step,Activity activity){
  DBAccessor dba=new DBAccessor(activity);
  WalkthroughStep ws=new WalkthroughStep(null);
  ws.set(step,false);
  dba.updateWalkthrough(ws);
}

Fixed version (ground truth):
/** 
 * Disables a step in the walkthrough in the application settings preferences, this should only be called upon completion of the walkthrough.
 */
private static void disableWalkthroughStep(Step step,Activity activity){
  DBAccessor dba=new DBAccessor(activity);
  WalkthroughStep ws=new WalkthroughStep(null);
  ws.set(step,true);
  dba.updateWalkthrough(ws);
}
Program: 187352
Project: 187352
Buggy source:
/** 
 * The basic constructor, initializes the encrypt/decrypt hash maps.
 */
public Encryption(){
  this.encryptMap=new HashMap<Long,ECEngine>();
  this.decryptMap=new HashMap<Long,ECEngine>();
}

Fixed version (ground truth):
/** 
 * The basic constructor, initializes the encrypt/decrypt hash maps.
 */
public Encryption(User user){
  this.encryptMap=new HashMap<Long,ECEngine>();
  this.decryptMap=new HashMap<Long,ECEngine>();
  this.user=user;
}
Program: 187353
Project: 187353
Buggy source:
/** 
 * Wrapper method to sign a key exchange with the user's public key. This is used to ensure that the user's information is in memory (and if not it is retrieved) and catches and handles possible errors involving illegal database states. Signs the current user's public key using the apriori information shared between the current user and the number provided. After signing the public key the CRC32 checksum is calculated and appended to the signed public key. ------------------------------------- | public key | signature | checksum | -------------------------------------
 * @param number The contact's Number.
 * @param dba The database interface.
 * @param user The user's information.
 * @return The current user's signed public key based on shared informationthe user has with the number given.
 */
public static String sign(Number number,DBAccessor dba,User user){
  try {
    user=getUser(dba,user);
    return signWithUser(number,user);
  }
 catch (  InvalidDatabaseStateException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Wrapper method to sign a key exchange with the user's public key. This is used to ensure that the user's information is in memory (and if not it is retrieved) and catches and handles possible errors involving illegal database states. Signs the current user's public key using the apriori information shared between the current user and the number provided. After signing the public key the CRC32 checksum is calculated and appended to the signed public key. ------------------------------------- | public key | signature | checksum | -------------------------------------
 * @param number The contact's Number.
 * @param dba The database interface.
 * @param user The user's information.
 * @return The current user's signed public key based on shared informationthe user has with the number given.
 */
public static String sign(Number number,DBAccessor dba,User user){
  try {
    user=SMSUtility.getUser(dba,user);
    return signWithUser(number,user);
  }
 catch (  InvalidDatabaseStateException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 187356
Project: 187356
Buggy source:
/** 
 * Open the database to be used
 */
public void open(){
  try {
    db=contactDatabase.getWritableDatabase();
    count+=1;
  }
 catch (  SQLiteException e) {
    e.printStackTrace();
    BugSenseHandler.sendExceptionMessage("String_Node_Str","String_Node_Str",e);
  }
 finally {
    if (db != null && db.isOpen()) {
      db.close();
    }
  }
}

Fixed version (ground truth):
/** 
 * Open the database to be used
 */
public void open(){
  try {
    db=contactDatabase.getWritableDatabase();
    count+=1;
  }
 catch (  SQLiteException e) {
    e.printStackTrace();
    BugSenseHandler.sendExceptionMessage("String_Node_Str","String_Node_Str",e);
  }
}
Program: 187358
Project: 187358
Buggy source:
/** 
 * Encrypts the message provided using the public key belonging to the number and adds a 32 byte verification signature (HMAC) to the message.
 * @param number The number that the message is to be encrypted for
 * @param message The plaintext message to encrypt
 * @return The ciphertext of the encrypted message
 * @throws InvalidCipherTextException If an error occurs attempting to encrypt the message.
 */
public String encrypt(Number number,String message) throws InvalidCipherTextException {
  byte[] encMessage;
  if (!encryptMap.containsKey(number.getId())) {
    initECEngine(number,true);
  }
  encMessage=encryptMap.get(number.getId()).processBlock(message.getBytes());
  number.setNonceEncrypt(number.getNonceEncrypt() + 1);
  return new String(encMessage);
}

Fixed version (ground truth):
/** 
 * Encrypts the message provided using the public key belonging to the number and adds a 32 byte verification signature (HMAC) to the message.
 * @param number The number that the message is to be encrypted for
 * @param message The plaintext message to encrypt
 * @return The ciphertext of the encrypted message
 * @throws InvalidCipherTextException If an error occurs attempting to encrypt the message.
 */
public String encrypt(Number number,String message) throws InvalidCipherTextException {
  byte[] encMessage;
  Log.v("String_Node_Str",message);
  if (!encryptMap.containsKey(number.getId())) {
    initECEngine(number,true);
  }
  encMessage=encryptMap.get(number.getId()).processBlock(message.getBytes());
  number.setNonceEncrypt(number.getNonceEncrypt() + 1);
  Log.v("String_Node_Str",Base64.encodeToString(encMessage,Base64.DEFAULT));
  return Base64.encodeToString(encMessage,Base64.DEFAULT);
}
Program: 187359
Project: 187359
Buggy source:
/** 
 * Decrypts the message provided using the public key belonging to the number and adds a 32 byte verification signature (HMAC) to the message.
 * @param number The number that the message is to be decrypted for
 * @param message The ciphertext message to decrypt
 * @return The plaintext of the decrypted message
 * @throws InvalidCipherTextException If an error occurs attempting to encrypt the message.
 */
public String decrypt(Number number,String message) throws InvalidCipherTextException {
  byte[] decMessage;
  if (!decryptMap.containsKey(number.getId())) {
    initECEngine(number,false);
  }
  decMessage=decryptMap.get(number.getId()).processBlock(message.getBytes());
  number.setNonceDecrypt(number.getNonceDecrypt() + 1);
  return new String(decMessage);
}

Fixed version (ground truth):
/** 
 * Decrypts the message provided using the public key belonging to the number and adds a 32 byte verification signature (HMAC) to the message.
 * @param number The number that the message is to be decrypted for
 * @param message The ciphertext message to decrypt
 * @return The plaintext of the decrypted message
 * @throws InvalidCipherTextException If an error occurs attempting to encrypt the message.
 */
public String decrypt(Number number,String message) throws InvalidCipherTextException {
  byte[] decMessage;
  Log.v("String_Node_Str",message);
  if (!decryptMap.containsKey(number.getId())) {
    initECEngine(number,false);
  }
  decMessage=decryptMap.get(number.getId()).processBlock(Base64.decode(message,Base64.DEFAULT));
  number.setNonceDecrypt(number.getNonceDecrypt() + 1);
  Log.v("String_Node_Str",new String(decMessage));
  return new String(decMessage);
}
Program: 187360
Project: 187360
Buggy source:
/** 
 * Gets the signature from the BASE64 encoded key exchange, which contains the key and signature, and returns the signature encoded as BASE64, for  proper storage and transmission in textual form.
 * @param signedPubKey The signed public key the user received from the number
 * @return The public key received, encoded as BASE64 for storage
 */
public static String encodedSignature(String signedPubKey){
  SHA256Digest digest=new SHA256Digest();
  byte[] signature=new byte[digest.getDigestSize()];
  System.arraycopy(signedPubKey,digest.getDigestSize(),signature,0,signedPubKey.length());
  return Base64.encodeToString(signature,Base64.DEFAULT);
}

Fixed version (ground truth):
/** 
 * Gets the signature from the BASE64 encoded key exchange, which contains the key and signature, and returns the signature encoded as BASE64, for  proper storage and transmission in textual form.
 * @param signedPubKey The signed public key the user received from the number
 * @return The public key received, encoded as BASE64 for storage
 */
public static String encodedSignature(String signedPubKey){
  byte[] decodedSignedPubKey=Base64.decode(signedPubKey,Base64.DEFAULT);
  SHA256Digest digest=new SHA256Digest();
  byte[] signature=new byte[digest.getDigestSize()];
  System.arraycopy(decodedSignedPubKey,decodedSignedPubKey.length - digest.getDigestSize(),signature,0,decodedSignedPubKey.length);
  return Base64.encodeToString(signature,Base64.DEFAULT);
}
Program: 187361
Project: 187361
Buggy source:
/** 
 * Signs the current user's public key using the apriori information shared between the current user and the number provided. 
 * @param number The number that the key will be exchanged with
 * @return The current user's signed public key based on shared informationthe user has with the number given.
 */
public static String sign(Number number){
  ECKeyParam param=new ECKeyParam();
  ECPublicKeyParameters pubKey=ECGKeyUtil.decodeBase64PubKey(param,SMSUtility.user.getPublicKey());
  APrioriInfo sharedInfo=new APrioriInfo(number.getSharedInfo1(),number.getSharedInfo2());
  byte[] encodedPubKey=ECGKeyUtil.encodePubKey(param,pubKey);
  byte[] encodedSignPubKey=ECGKeyExchange.signPubKey(new SHA256Digest(),encodedPubKey,sharedInfo,number.isInitiator());
  return Base64.encodeToString(encodedSignPubKey,Base64.DEFAULT);
}

Fixed version (ground truth):
/** 
 * Signs the current user's public key using the apriori information shared between the current user and the number provided. 
 * @param number The number that the key will be exchanged with
 * @return The current user's signed public key based on shared informationthe user has with the number given.
 */
public static String sign(Number number){
  ECKeyParam param=new ECKeyParam();
  ECPublicKeyParameters pubKey=ECGKeyUtil.decodeBase64PubKey(param,SMSUtility.user.getPublicKey());
  APrioriInfo sharedInfo=new APrioriInfo(number.getSharedInfo1(),number.getSharedInfo2());
  byte[] encodedPubKey=ECGKeyUtil.encodePubKey(param,pubKey);
  byte[] encodedSignedPubKey=ECGKeyExchange.signPubKey(new SHA256Digest(),encodedPubKey,sharedInfo,number.isInitiator());
  return Base64.encodeToString(encodedSignedPubKey,Base64.DEFAULT);
}
Program: 187362
Project: 187362
Buggy source:
/** 
 * Gets the signature from the BASE64 encoded key exchange, which contains the key and signature, and returns the signature encoded as BASE64, for  proper storage and transmission in textual form.
 * @param signedPubKey The signed public key the user received from the number
 * @return The public key received, encoded as BASE64 for storage
 */
public static String encodedSignature(String signedPubKey){
  SHA256Digest digest=new SHA256Digest();
  byte[] signature=new byte[digest.getDigestSize()];
  System.arraycopy(signedPubKey,digest.getDigestSize(),signature,0,signedPubKey.length());
  return Base64.encodeToString(signature,Base64.DEFAULT);
}

Fixed version (ground truth):
/** 
 * Gets the signature from the BASE64 encoded key exchange, which contains the key and signature, and returns the signature encoded as BASE64, for  proper storage and transmission in textual form.
 * @param signedPubKey The signed public key the user received from the number
 * @return The public key received, encoded as BASE64 for storage
 */
public static String encodedSignature(String signedPubKey){
  byte[] decodedSignedPubKey=Base64.decode(signedPubKey,Base64.DEFAULT);
  SHA256Digest digest=new SHA256Digest();
  byte[] signature=new byte[digest.getDigestSize()];
  System.arraycopy(decodedSignedPubKey,decodedSignedPubKey.length() - digest.getDigestSize(),signature,0,decodedSignedPubKey.length());
  return Base64.encodeToString(signature,Base64.DEFAULT);
}
Program: 187363
Project: 187363
Buggy source:
/** 
 * Signs the current user's public key using the apriori information shared between the current user and the number provided. 
 * @param number The number that the key will be exchanged with
 * @return The current user's signed public key based on shared informationthe user has with the number given.
 */
public static String sign(Number number){
  ECKeyParam param=new ECKeyParam();
  ECPublicKeyParameters pubKey=ECGKeyUtil.decodeBase64PubKey(param,SMSUtility.user.getPublicKey());
  APrioriInfo sharedInfo=new APrioriInfo(number.getSharedInfo1(),number.getSharedInfo2());
  byte[] encodedPubKey=ECGKeyUtil.encodePubKey(param,pubKey);
  byte[] encodedSignPubKey=ECGKeyExchange.signPubKey(new SHA256Digest(),encodedPubKey,sharedInfo,number.isInitiator());
  return Base64.encodeToString(encodedSignPubKey,Base64.DEFAULT);
}

Fixed version (ground truth):
/** 
 * Signs the current user's public key using the apriori information shared between the current user and the number provided. 
 * @param number The number that the key will be exchanged with
 * @return The current user's signed public key based on shared informationthe user has with the number given.
 */
public static String sign(Number number){
  ECKeyParam param=new ECKeyParam();
  ECPublicKeyParameters pubKey=ECGKeyUtil.decodeBase64PubKey(param,SMSUtility.user.getPublicKey());
  APrioriInfo sharedInfo=new APrioriInfo(number.getSharedInfo1(),number.getSharedInfo2());
  byte[] encodedPubKey=ECGKeyUtil.encodePubKey(param,pubKey);
  byte[] encodedSignedPubKey=ECGKeyExchange.signPubKey(new SHA256Digest(),encodedPubKey,sharedInfo,number.isInitiator());
  return Base64.encodeToString(encodedSignedPubKey,Base64.DEFAULT);
}
Program: 187365
Project: 187365
Buggy source:
/** 
 * Generates the next nonce which can be accessed using the getNonce() method.
 */
public void nextNonce(){
  csprng.nextBytes(nonce);
}

Fixed version (ground truth):
/** 
 * Generates the next nonce and returns it
 * @return The nonce
 */
public byte[] nextNonce(){
  nonce=new byte[nonce.length];
  csprng.nextBytes(nonce);
  return nonce;
}
Program: 187366
Project: 187366
Buggy source:
static public boolean verifyPubKey(Digest digest,byte[] signedPubKey,APrioriInfo sharedInfo,boolean isInitiator) throws DataLengthException {
  if (sharedInfo.getS1().length == 0 || sharedInfo.getS2().length == 0) {
    throw new DataLengthException("String_Node_Str");
  }
  byte[] S;
  byte[] digestInput;
  byte[] origSignature=new byte[digest.getDigestSize()];
  byte[] calcSignature=new byte[digest.getDigestSize()];
  System.arraycopy(signedPubKey,signedPubKey.length - digest.getDigestSize(),origSignature,0,digest.getDigestSize());
  if (isInitiator) {
    S=sharedInfo.getS1();
  }
 else {
    S=sharedInfo.getS2();
  }
  digestInput=new byte[signedPubKey.length - digest.getDigestSize() + S.length];
  System.arraycopy(signedPubKey,0,digestInput,0,signedPubKey.length - digest.getDigestSize());
  System.arraycopy(S,0,digestInput,signedPubKey.length - digest.getDigestSize(),S.length);
  digest.update(digestInput,0,digestInput.length);
  digest.doFinal(calcSignature,0);
  digest.reset();
  return signatureEquals(calcSignature,origSignature);
}

Fixed version (ground truth):
static public boolean verifyPubKey(Digest digest,byte[] signedPubKey,APrioriInfo sharedInfo,boolean isInitiator) throws DataLengthException {
  if (sharedInfo.getS1().length == 0 || sharedInfo.getS2().length == 0) {
    throw new DataLengthException("String_Node_Str");
  }
  byte[] S;
  byte[] digestInput;
  byte[] origSignature=new byte[digest.getDigestSize()];
  byte[] calcSignature=new byte[digest.getDigestSize()];
  System.arraycopy(signedPubKey,signedPubKey.length - digest.getDigestSize(),origSignature,0,digest.getDigestSize());
  if (isInitiator) {
    S=sharedInfo.getS2();
  }
 else {
    S=sharedInfo.getS1();
  }
  digestInput=new byte[signedPubKey.length - digest.getDigestSize() + S.length];
  System.arraycopy(signedPubKey,0,digestInput,0,signedPubKey.length - digest.getDigestSize());
  System.arraycopy(S,0,digestInput,signedPubKey.length - digest.getDigestSize(),S.length);
  digest.update(digestInput,0,digestInput.length);
  digest.doFinal(calcSignature,0);
  digest.reset();
  return signatureEquals(calcSignature,origSignature);
}
Program: 187367
Project: 187367
Buggy source:
public boolean isChildSelectable(final int groupPosition,final int childPosition){
  return true;
}

Fixed version (ground truth):
public boolean isChildSelectable(int groupPosition,int childPosition){
  return true;
}
Program: 187369
Project: 187369
Buggy source:
public boolean onItemLongClick(AdapterView<?> parent,View view,int position,long id){
  AddContact.addContact=false;
  AddContact.editTc=ManageContactsActivity.this.tc.get(position);
  ManageContactsActivity.this.startActivity(new Intent(ManageContactsActivity.this,AddContact.class));
  return true;
}

Fixed version (ground truth):
public boolean onItemLongClick(AdapterView<?> parent,View view,int position,long id){
  Toast.makeText(getBaseContext(),"String_Node_Str" + String.valueOf(position),Toast.LENGTH_SHORT).show();
  Toast.makeText(getBaseContext(),"String_Node_Str" + String.valueOf(id),Toast.LENGTH_SHORT).show();
  return true;
}
Program: 187370
Project: 187370
Buggy source:
/** 
 * Reinitialises the list to ensure contacts that are trusted are selected.
 */
private void initList(){
  for (int i=0; i < tc.size(); i++) {
    if (trusted[i]) {
      listView.setItemChecked(i,true);
    }
 else {
      listView.setItemChecked(i,false);
    }
  }
}

Fixed version (ground truth):
/** 
 * Reinitializes the list to ensure contacts that are trusted are selected.
 */
private void initList(){
  for (int i=0; i < tc.size(); i++) {
    if (trusted[i]) {
      listView.setItemChecked(i,true);
    }
 else {
      listView.setItemChecked(i,false);
    }
  }
}
Program: 187371
Project: 187371
Buggy source:
/** 
 * Used to toggle the contact from being in or out of the  trusted state.
 * @param position : int, the position on the list of contacts.
 * @param add : boolean, if true the contact will be added.If false the contact will be removed.
 */
public void change(int position,boolean add){
  if (add) {
    tc.get(position).setPublicKey();
  }
 else {
    tc.get(position).clearPublicKey();
  }
  MessageService.dba.updateKey(tc.get(position),tc.get(position).getANumber());
}

Fixed version (ground truth):
/** 
 * Used to toggle the contact from being in or out of the  trusted state.
 * @param position : int, the position on the list of contacts.
 * @param add : boolean, if true the contact will be added.If false the contact will be removed.
 */
public void change(int position,boolean add){
  if (add) {
  }
 else {
  }
  MessageService.dba.updateKey(tc.get(position),tc.get(position).getANumber());
}
Program: 187375
Project: 187375
Buggy source:
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.exchange:
    TrustedContact tc=MessageService.dba.getRow(SMSUtility.format(Prephase3Activity.selectedNumber));
  if (tc != null) {
    if (MessageService.dba.isTrustedContact(SMSUtility.format(Prephase3Activity.selectedNumber))) {
      tc.clearPublicKey();
      MessageService.dba.updateKey(tc,Prephase3Activity.selectedNumber);
    }
 else {
      tc.setPublicKey();
      MessageService.dba.updateKey(tc,Prephase3Activity.selectedNumber);
    }
  }
return true;
case R.id.delete:
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.exchange:
    TrustedContact tc=MessageService.dba.getRow(SMSUtility.format(Prephase3Activity.selectedNumber));
  if (tc != null) {
    if (MessageService.dba.isTrustedContact(SMSUtility.format(Prephase3Activity.selectedNumber))) {
      tc.getNumber(Prephase3Activity.selectedNumber).clearPublicKey();
      MessageService.dba.updateKey(tc,Prephase3Activity.selectedNumber);
    }
 else {
      tc.getNumber(Prephase3Activity.selectedNumber).setPublicKey();
      MessageService.dba.updateKey(tc,Prephase3Activity.selectedNumber);
    }
  }
return true;
case R.id.delete:
return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 187377
Project: 187377
Buggy source:
/** 
 * Adding a message to the queue to be sent when there is service to send the message.  Once the message has been sent it will be removed from the queue.
 * @param number : String the number for the contact that the message will be sent to
 * @param message : String the message that will be sent to the contact with the given number.**Please note the message is not changed, it will be stored and sent as is.  
 */
public void addMessageToQueue(String number,String message){
  ContentValues cv=new ContentValues();
  cv.put(KEY_NUMBER,number);
  cv.put(KEY_MESSAGE,message);
  open();
  db.insert(SQLitehelper.QUEUE_TABLE_NAME,null,cv);
  close();
}

Fixed version (ground truth):
/** 
 * Adding a message to the queue to be sent when there is service to send the message.  Once the message has been sent it will be removed from the queue.
 * @param number : String the number for the contact that the message will be sent to
 * @param message : String the message that will be sent to the contact with the given number.**Please note the message is not changed, it will be stored and sent as is.  
 */
public void addMessageToQueue(String number,String message){
  long numberReference=getNumberId(number);
  ContentValues cv=new ContentValues();
  cv.put(KEY_NUMBER_REFERENCE,numberReference);
  cv.put(KEY_MESSAGE,message);
  open();
  db.insert(SQLitehelper.QUEUE_TABLE_NAME,null,cv);
  close();
}
Program: 187378
Project: 187378
Buggy source:
public String[] getFirstInQueue(){
  open();
  Cursor cur=db.query(SQLitehelper.QUEUE_TABLE_NAME,new String[]{KEY_ID,KEY_NUMBER,KEY_MESSAGE},KEY_ID + "String_Node_Str" + KEY_ID+ "String_Node_Str"+ SQLitehelper.QUEUE_TABLE_NAME+ "String_Node_Str",null,null,null,null);
  if (cur.moveToFirst()) {
    long id=cur.getLong(cur.getColumnIndex(KEY_ID));
    String[] queue=new String[2];
    queue[0]=cur.getString(cur.getColumnIndex(KEY_NUMBER));
    queue[1]=cur.getString(cur.getColumnIndex(KEY_MESSAGE));
    close(cur);
    deleteQueueEntry(id);
    return queue;
  }
  close(cur);
  return null;
}

Fixed version (ground truth):
public String[] getFirstInQueue(){
  open();
  Cursor cur=db.query(SQLitehelper.QUEUE_TABLE_NAME,new String[]{KEY_ID,KEY_NUMBER_REFERENCE,KEY_MESSAGE},KEY_ID + "String_Node_Str" + KEY_ID+ "String_Node_Str"+ SQLitehelper.QUEUE_TABLE_NAME+ "String_Node_Str",null,null,null,null);
  if (cur.moveToFirst()) {
    long id=cur.getLong(cur.getColumnIndex(KEY_ID));
    String[] entry=new String[]{getNumber(cur.getLong(cur.getColumnIndex(KEY_NUMBER_REFERENCE))),cur.getString(cur.getColumnIndex(KEY_MESSAGE))};
    close(cur);
    return entry;
  }
  close(cur);
  return null;
}
Program: 187379
Project: 187379
Buggy source:
/** 
 * Sends the given message to the phone with the given number
 * @param number : String, the number of the phone that the message is sent to
 * @param message : String, the message, encrypted that will be sent to the contact
 */
public static void sendSMS(Context c,String number,String message){
  PendingIntent pi=PendingIntent.getActivity(c,0,new Intent(c,Object.class),0);
  sms.sendTextMessage(number,null,message,pi,null);
}

Fixed version (ground truth):
/** 
 * Sends the given message to the phone with the given number
 * @param number : String, the number of the phone that the message is sent to
 * @param message : String, the message, encrypted that will be sent to the contact
 */
public static void sendSMS(Context c,String number,String message,long id){
  String SENT="String_Node_Str";
  Intent intent=new Intent(SENT);
  intent.putExtra(NUMBER,number);
  intent.putExtra(MESSAGE,message);
  intent.putExtra(ID,id);
  PendingIntent sentPI=PendingIntent.getBroadcast(c,0,intent,PendingIntent.FLAG_CANCEL_CURRENT);
  c.registerReceiver(MS,new IntentFilter(SENT));
  SmsManager sms=SmsManager.getDefault();
  sms.sendTextMessage(number,null,message,sentPI,null);
}
Program: 187380
Project: 187380
Buggy source:
@Override public void handleMessage(Message msg){
  update();
  dialog.dismiss();
}

Fixed version (ground truth):
@Override public void handleMessage(Message msg){
  update();
  dialog.dismiss();
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
}
Program: 187381
Project: 187381
Buggy source:
public void run(){
  contact=MessageService.dba.getAllRowsLimited();
  if (contact != null) {
    names=new String[contact.size()];
    for (int i=0; i < contact.size(); i++) {
      names[i]=contact.get(i).getName();
    }
    arrayAp=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,names);
  }
 else {
    names=new String[1];
    names[0]="String_Node_Str";
    arrayAp=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,names);
  }
  trusted=MessageService.dba.isTrustedContact(contact);
  handler.sendEmptyMessage(0);
}

Fixed version (ground truth):
public void run(){
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
  contact=MessageService.dba.getAllRowsLimited();
  if (contact != null) {
    names=new String[contact.size()];
    for (int i=0; i < contact.size(); i++) {
      names[i]=contact.get(i).getName();
    }
    arrayAp=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice,names);
    trusted=MessageService.dba.isTrustedContact(contact);
  }
 else {
    names=new String[1];
    names[0]="String_Node_Str";
    arrayAp=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,names);
  }
  handler.sendEmptyMessage(0);
}
Program: 187382
Project: 187382
Buggy source:
/** 
 * Creates a database that is read and write
 * @param c	: Context, where the database is available
 */
public DBAccessor(Context c){
  contactDatabase=new SQLitehelper(c);
  db=contactDatabase.getWritableDatabase();
  Toast.makeText(c,"String_Node_Str",Toast.LENGTH_LONG).show();
  if (bookIsDefault(0) && sharedInfoIsDefault(0)) {
    Toast.makeText(c,"String_Node_Str",Toast.LENGTH_LONG).show();
    addBookPath(0,DEFAULT_BOOK_PATH,DEFAULT_BOOK_INVERSE_PATH);
    addSharedInfo(0,DEFAULT_S1,DEFAULT_S2);
  }
}

Fixed version (ground truth):
/** 
 * Creates a database that is read and write
 * @param c	: Context, where the database is available
 */
public DBAccessor(Context c){
  contactDatabase=new SQLitehelper(c);
  db=contactDatabase.getWritableDatabase();
  if (bookIsDefault(0) && sharedInfoIsDefault(0)) {
    addBookPath(0,DEFAULT_BOOK_PATH,DEFAULT_BOOK_INVERSE_PATH);
    addSharedInfo(0,DEFAULT_S1,DEFAULT_S2);
  }
}
Program: 187383
Project: 187383
Buggy source:
/** 
 * TODO comment
 * @param number
 * @param lastMessage
 */
public Message(String message,boolean currentTime,boolean sent){
  this.setMessage(message);
  if (currentTime) {
    this.setDate();
  }
 else {
    this.setDate(0);
  }
  this.setSent(sent);
}

Fixed version (ground truth):
/** 
 * A class for storing messages retrieved or to be stored in the database. 
 * @param message The body of the message
 * @param currentTime Whether the date is set to the current time or not. If true date is set to current time, otherwise date is set to 0
 * @param sent Whether the message was sent or receivedIf sent = true then the message was sent otherwise the message was received
 */
public Message(String message,boolean currentTime,boolean sent){
  this.setMessage(message);
  if (currentTime) {
    this.setDate();
  }
 else {
    this.setDate(0);
  }
  this.setSent(sent);
}
Program: 187384
Project: 187384
Buggy source:
/** 
 * TODO comment
 * @param sent
 */
public void setSent(boolean sent){
  this.sent=sent;
}

Fixed version (ground truth):
/** 
 * Set whether the message is sent or received
 * @param sent Whether the message is now sent or received.
 */
private void setSent(boolean sent){
  this.sent=sent;
}
Program: 187385
Project: 187385
Buggy source:
/** 
 * TODO comment
 * @return the lastMessage
 */
public String getMessage(){
  return message;
}

Fixed version (ground truth):
/** 
 * Get the message's body
 * @return The message's body
 */
public String getMessage(){
  return message;
}
Program: 187386
Project: 187386
Buggy source:
/** 
 * TODO comment set the date to the current time
 */
public void setDate(){
  Calendar calendar=Calendar.getInstance();
  this.date=calendar.getTimeInMillis();
}

Fixed version (ground truth):
/** 
 * Set the date the message was sent or received to the current time.
 */
private void setDate(){
  Calendar calendar=Calendar.getInstance();
  this.date=calendar.getTimeInMillis();
}
Program: 187387
Project: 187387
Buggy source:
/** 
 * TODO comment
 * @param currentTime
 * @return
 */
public static String millisToDate(long currentTime){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(currentTime);
  String date=calendar.get(Calendar.YEAR) + "String_Node_Str" + (calendar.getTime().getMonth() + 1)+ "String_Node_Str"+ calendar.getTime().getDate();
  if (clockStyle && calendar.getTime().getHours() > 12) {
    date+="String_Node_Str" + (calendar.getTime().getHours() - 12);
  }
 else {
    date+="String_Node_Str" + calendar.getTime().getHours();
  }
  String minutes="String_Node_Str" + calendar.getTime().getMinutes();
  if (minutes.length() < 2) {
    minutes="String_Node_Str" + minutes;
  }
  date+="String_Node_Str" + minutes;
  if (calendar.get(Calendar.AM_PM) == 1) {
    date+="String_Node_Str";
  }
 else {
    date+="String_Node_Str";
  }
  return date;
}

Fixed version (ground truth):
/** 
 * Convert the current time in milliseconds to the current time formated as: YYYY/MM/DD HH:MM AM/PM
 * @param currentTime The current time in milliseconds
 * @return The current time formated.
 */
public static String millisToDate(long currentTime){
  Calendar calendar=Calendar.getInstance();
  calendar.setTimeInMillis(currentTime);
  String date=calendar.get(Calendar.YEAR) + "String_Node_Str" + (calendar.getTime().getMonth() + 1)+ "String_Node_Str"+ calendar.getTime().getDate();
  if (clockStyle && calendar.getTime().getHours() > 12) {
    date+="String_Node_Str" + (calendar.getTime().getHours() - 12);
  }
 else {
    date+="String_Node_Str" + calendar.getTime().getHours();
  }
  String minutes="String_Node_Str" + calendar.getTime().getMinutes();
  if (minutes.length() < 2) {
    minutes="String_Node_Str" + minutes;
  }
  date+="String_Node_Str" + minutes;
  if (calendar.get(Calendar.AM_PM) == 1) {
    date+="String_Node_Str";
  }
 else {
    date+="String_Node_Str";
  }
  return date;
}
Program: 187388
Project: 187388
Buggy source:
/** 
 * TODO comment
 * @return the date
 */
public long getDate(){
  return date;
}

Fixed version (ground truth):
/** 
 * Get the date the message was sent or received
 * @return The date
 */
public long getDate(){
  return date;
}
Program: 187389
Project: 187389
Buggy source:
/** 
 * TODO comment
 * @return
 */
public boolean isSent(){
  return sent;
}

Fixed version (ground truth):
/** 
 * Check whether the message was sent or received
 * @return If the message was sent it will return true,otherwise false.
 */
public boolean isSent(){
  return sent;
}
Program: 187390
Project: 187390
Buggy source:
/** 
 * TODO comment
 * @return
 */
public int getSent(){
  if (sent) {
    return 2;
  }
 else {
    return 1;
  }
}

Fixed version (ground truth):
/** 
 * Get the send flag in terms of the native android messaging application this is more used to save messages back to the native application
 * @return The flag of whether the message was sent orreceived. If the message was sent the return will be 2, otherwise the return will be 1.
 */
public int getSent(){
  if (sent) {
    return 2;
  }
 else {
    return 1;
  }
}
Program: 187391
Project: 187391
Buggy source:
/** 
 * TODO comment
 * @param lastMessage the lastMessage to set
 */
public void setMessage(String message){
  this.message=message;
}

Fixed version (ground truth):
/** 
 * Set the message's body
 * @param message The new message body
 */
public void setMessage(String message){
  this.message=message;
}
Program: 187392
Project: 187392
Buggy source:
public void addUnreadMessageCount(){
  this.unreadMessageCount++;
}

Fixed version (ground truth):
/** 
 * Increment the number of messages unread
 */
public void addUnreadMessageCount(){
  this.unreadMessageCount++;
}
Program: 187393
Project: 187393
Buggy source:
public Message getMessage(int index){
  return this.messages.get(index);
}

Fixed version (ground truth):
/** 
 * Get the message given the index
 * @param index The index of the message desired
 * @return The message at the given index
 */
public Message getMessage(int index){
  return this.messages.get(index);
}
Program: 187394
Project: 187394
Buggy source:
/** 
 * @param type the type to set
 */
public void setType(int type){
  this.type=type;
}

Fixed version (ground truth):
/** 
 * Set the type of number
 * @param type The new type
 */
public void setType(int type){
  this.type=type;
}
Program: 187395
Project: 187395
Buggy source:
public ArrayList<Message> getMessages(){
  return this.messages;
}

Fixed version (ground truth):
/** 
 * Get the list of messages for the number
 * @return The list of messages
 */
public ArrayList<Message> getMessages(){
  return this.messages;
}
Program: 187396
Project: 187396
Buggy source:
/** 
 * @param number the number to set
 */
public void setNumber(String number){
  this.number=number;
}

Fixed version (ground truth):
/** 
 * Set the number
 * @param number The new number
 */
public void setNumber(String number){
  this.number=number;
}
Program: 187397
Project: 187397
Buggy source:
public void addMessage(Message newMessage){
  this.messages.add(newMessage);
}

Fixed version (ground truth):
/** 
 * Add a message to the list of messages for the number
 * @param newMessage The new message to add the list of messages
 */
public void addMessage(Message newMessage){
  this.messages.add(newMessage);
}
Program: 187398
Project: 187398
Buggy source:
/** 
 * @return the number
 */
public String getNumber(){
  return number;
}

Fixed version (ground truth):
/** 
 * Get the number
 * @return The number
 */
public String getNumber(){
  return number;
}
Program: 187399
Project: 187399
Buggy source:
/** 
 * Date not set
 * @param number
 */
public Number(String number){
  this.setNumber(number);
  this.setType(DBAccessor.OTHER_INDEX);
  this.messages=new ArrayList<Message>();
}

Fixed version (ground truth):
/** 
 * A class used to store information from the numbers table
 * @param number A number for the contact
 */
public Number(String number){
  this.setNumber(number);
  this.setType(DBAccessor.OTHER_INDEX);
  this.messages=new ArrayList<Message>();
}
Program: 187400
Project: 187400
Buggy source:
/** 
 * @return the type
 */
public int getType(){
  if (type > DBAccessor.LENGTH) {
    return DBAccessor.OTHER_INDEX;
  }
  return type;
}

Fixed version (ground truth):
/** 
 * Get the type of number
 * @return The type of number (the index for it)
 */
public int getType(){
  if (type > DBAccessor.LENGTH) {
    return DBAccessor.OTHER_INDEX;
  }
  return type;
}
Program: 187401
Project: 187401
Buggy source:
public int getUnreadMessageCount(){
  return unreadMessageCount;
}

Fixed version (ground truth):
/** 
 * Get the number of messages currently unread
 * @return The current count of unread messages
 */
public int getUnreadMessageCount(){
  return unreadMessageCount;
}
Program: 187402
Project: 187402
Buggy source:
public void resetUnreadMessageCount(){
  this.unreadMessageCount=0;
}

Fixed version (ground truth):
/** 
 * Reset the number of messages unread to 0
 */
public void resetUnreadMessageCount(){
  this.unreadMessageCount=0;
}
Program: 187403
Project: 187403
Buggy source:
public void setUnreadMessageCount(int unreadMessageCount){
  this.unreadMessageCount=unreadMessageCount;
}

Fixed version (ground truth):
/** 
 * Set the number of unread messages
 * @param unreadMessageCount The new number of messages unread
 */
public void setUnreadMessageCount(int unreadMessageCount){
  this.unreadMessageCount=unreadMessageCount;
}
Program: 187404
Project: 187404
Buggy source:
/** 
 * Add a message to the database, only a limited number of messages are stored in the database.
 * @param reference : long, the id of the number that the message came from or was sent to.
 * @param message : Message, a message object containing all the information for the message.
 */
private void addMessageRow(long reference,Message message){
  ContentValues cv=new ContentValues();
  cv.put(KEY_REFERENCE,reference);
  cv.put(KEY_MESSAGE,message.getMessage());
  cv.put(KEY_DATE,message.getDate());
  cv.put(KEY_SENT,message.getSent());
  open();
  Cursor cur=db.query(SQLitehelper.MESSAGES_TABLE_NAME,new String[]{"String_Node_Str" + KEY_MESSAGE + "String_Node_Str"},KEY_REFERENCE + "String_Node_Str" + reference,null,null,null,null);
  if (cur.moveToFirst() && cur.getInt(0) >= LIMIT) {
    db.update(SQLitehelper.MESSAGES_TABLE_NAME,cv,KEY_DATE + "String_Node_Str" + "String_Node_Str"+ KEY_DATE+ "String_Node_Str"+ SQLitehelper.MESSAGES_TABLE_NAME+ "String_Node_Str",null);
  }
 else {
    db.insert(SQLitehelper.MESSAGES_TABLE_NAME,null,cv);
  }
  close(cur);
}

Fixed version (ground truth):
/** 
 * Add a message to the database, only a limited number of messages are stored in the database.
 * @param reference : long, the id of the number that the message came from or was sent to.
 * @param message : Message, a message object containing all the information for the message.
 */
private void addMessageRow(long reference,Message message){
  ContentValues cv=new ContentValues();
  cv.put(KEY_REFERENCE,reference);
  cv.put(KEY_MESSAGE,message.getMessage());
  cv.put(KEY_DATE,message.getDate());
  cv.put(KEY_SENT,message.getSent());
  open();
  Cursor cur=db.query(SQLitehelper.MESSAGES_TABLE_NAME,new String[]{"String_Node_Str" + KEY_MESSAGE + "String_Node_Str"},KEY_REFERENCE + "String_Node_Str" + reference,null,null,null,null);
  if (cur.moveToFirst() && cur.getInt(0) >= LIMIT) {
    db.update(SQLitehelper.MESSAGES_TABLE_NAME,cv,KEY_ID + "String_Node_Str" + "String_Node_Str"+ SQLitehelper.MESSAGES_TABLE_NAME+ "String_Node_Str"+ KEY_DATE+ "String_Node_Str"+ "String_Node_Str"+ KEY_DATE+ "String_Node_Str"+ SQLitehelper.MESSAGES_TABLE_NAME+ "String_Node_Str",null);
  }
 else {
    db.insert(SQLitehelper.MESSAGES_TABLE_NAME,null,cv);
  }
  close(cur);
}
Program: 187406
Project: 187406
Buggy source:
public void onClick(DialogInterface dialog,int id){
}

Fixed version (ground truth):
public void onClick(View v){
  String text=messageBox.getText().toString();
  if (Prephase3Activity.selectedNumber.length() > 0 && text.length() > 0) {
    messages.setCount(0);
    messageBox.setText("String_Node_Str");
    try {
      if (MessageService.dba.isTrustedContact(Prephase3Activity.selectedNumber) && Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
        String encrypted=Encryption.aes_encrypt(MessageService.dba.getRow(SMSUtility.format(Prephase3Activity.selectedNumber)).getPublicKey(),text);
        SMSUtility.sendSMS(getBaseContext(),Prephase3Activity.selectedNumber,encrypted);
        if (Prephase3Activity.sharedPrefs.getBoolean("String_Node_Str",true)) {
          Prephase3Activity.sendToSelf(getBaseContext(),Prephase3Activity.selectedNumber,encrypted,Prephase3Activity.SENT);
          MessageService.dba.addNewMessage(new Message(encrypted,true,true),Prephase3Activity.selectedNumber,true);
        }
        Prephase3Activity.sendToSelf(getBaseContext(),Prephase3Activity.selectedNumber,text,Prephase3Activity.SENT);
        MessageService.dba.addNewMessage(new Message(text,true,true),Prephase3Activity.selectedNumber,true);
        Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
 else {
        SMSUtility.sendSMS(getBaseContext(),Prephase3Activity.selectedNumber,text);
        Prephase3Activity.sendToSelf(getBaseContext(),Prephase3Activity.selectedNumber,text,Prephase3Activity.SENT);
        MessageService.dba.addNewMessage(new Message(text,true,true),Prephase3Activity.selectedNumber,true);
        Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_SHORT).show();
      }
      updateList(getBaseContext());
    }
 catch (    Exception e) {
      Toast.makeText(getBaseContext(),"String_Node_Str",Toast.LENGTH_LONG).show();
      e.printStackTrace();
    }
  }
 else {
  }
}
Program: 187407
Project: 187407
Buggy source:
/** 
 * Sends the given message to the phone with the given number
 * @param number : String, the number of the phone that the message is sent to
 * @param message : String, the message, encrypted that will be sent to the contact
 */
public static void sendSMS(Context c,String number,String message){
  PendingIntent pi=PendingIntent.getActivity(c,0,new Intent(c,Object.class),0);
  SmsManager sms=SmsManager.getDefault();
  sms.sendTextMessage(number,null,message,pi,null);
}

Fixed version (ground truth):
/** 
 * Sends the given message to the phone with the given number
 * @param number : String, the number of the phone that the message is sent to
 * @param message : String, the message, encrypted that will be sent to the contact
 */
public static void sendSMS(Context c,String number,String message){
  PendingIntent pi=PendingIntent.getActivity(c,0,new Intent(c,Object.class),0);
  sms.sendTextMessage(number,null,message,pi,null);
}
Program: 187409
Project: 187409
Buggy source:
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.exchange:
    TrustedContact tc=MessageService.dba.getRow(ContactRetriever.format(Prephase3Activity.selectedNumber));
  if (tc != null) {
    if (MessageService.dba.isTrustedContact(ContactRetriever.format(Prephase3Activity.selectedNumber))) {
      tc.clearPublicKey();
      MessageService.dba.updateRow(tc,Prephase3Activity.selectedNumber);
    }
 else {
      tc.setPublicKey();
      MessageService.dba.updateRow(tc,Prephase3Activity.selectedNumber);
    }
  }
return true;
case R.id.delete:
return true;
default :
return super.onOptionsItemSelected(item);
}
}

Fixed version (ground truth):
public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.exchange:
    return true;
case R.id.delete:
  return true;
default :
return super.onOptionsItemSelected(item);
}
}
Program: 187412
Project: 187412
Buggy source:
@Override public int onStartCommand(Intent intent,int flags,int startId){
  Notification notifyDetails=new Notification(R.drawable.ic_launcher,contentTitle + "String_Node_Str" + contentText,System.currentTimeMillis());
  Intent notifyIntent=new Intent(this,Prephase3Activity.class);
  PendingIntent in=PendingIntent.getActivity(this,0,notifyIntent,android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
  notifyDetails.setLatestEventInfo(this,contentTitle,contentText,in);
  mNotificationManager.notify(SIMPLE_NOTFICATION_ID,notifyDetails);
  stopSelf();
  return Service.START_NOT_STICKY;
}

Fixed version (ground truth):
@Override public int onStartCommand(Intent intent,int flags,int startId){
  if (contentTitle != null && contentText != null) {
    int index=-1;
    for (int i=0; i < MessageView.newMessages.size(); i++) {
      if (MessageView.newMessages.get(i).equalsIgnoreCase(contentTitle.toString())) {
        index=i;
      }
    }
    if (index == -1) {
      index=MessageView.newMessages.size();
      MessageView.newMessages.add(contentTitle.toString());
    }
    Notification notifyDetails=new Notification(R.drawable.ic_launcher,contentTitle + "String_Node_Str" + contentText,System.currentTimeMillis());
    Intent notifyIntent=new Intent(this,Prephase3Activity.class);
    PendingIntent in=PendingIntent.getActivity(this,0,notifyIntent,android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
    notifyDetails.setLatestEventInfo(this,contentTitle,contentText,in);
    mNotificationManager.notify(index,notifyDetails);
  }
  stopSelf();
  return Service.START_NOT_STICKY;
}
Program: 187414
Project: 187414
Buggy source:
/** 
 * Date not set
 * @param number
 * @param lastMessage
 */
public Number(String number,String lastMessage){
  this.setNumber(number);
  this.setLastMessage(lastMessage);
  this.setType(DBAccessor.OTHER_INDEX);
  this.setDate(0);
}

Fixed version (ground truth):
/** 
 * Date set
 * @param number
 * @param lastMessage
 */
public Number(String number,String lastMessage){
  this.setNumber(number);
  this.setLastMessage(lastMessage);
  this.setType(DBAccessor.OTHER_INDEX);
  this.setDate();
}
Program: 187417
Project: 187417
Buggy source:
@Override public void onCreate(){
  Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
  dba=new DBAccessor(this);
}

Fixed version (ground truth):
@Override public void onCreate(){
  dba=new DBAccessor(this);
}