nus-yam/ex-repair huggingface dataset:
Program: 87802
Project: 87802
Buggy source:
public void testGetTerminalPosition(){
  File file=null;
  try {
    file=File.createTempFile("String_Node_Str","String_Node_Str",getContext().getCacheDir());
  }
 catch (  IOException e) {
  }
  assertNotNull(file);
  final FusionDictionary dict=new FusionDictionary(new Node(),new FusionDictionary.DictionaryOptions(new HashMap<String,String>(),false,false));
  addUnigrams(sWords.size(),dict,sWords,null);
  timeWritingDictToFile(file,dict,VERSION3_WITH_DYNAMIC_UPDATE);
  final FusionDictionaryBufferInterface buffer=getBuffer(file,USE_BYTE_ARRAY);
  try {
    final String longWord="String_Node_Str";
    assertEquals(FormatSpec.NOT_VALID_WORD,BinaryDictIOUtils.getTerminalPosition(buffer,longWord));
    assertEquals(FormatSpec.NOT_VALID_WORD,BinaryDictIOUtils.getTerminalPosition(buffer,null));
    assertEquals(FormatSpec.NOT_VALID_WORD,BinaryDictIOUtils.getTerminalPosition(buffer,"String_Node_Str"));
  }
 catch (  IOException e) {
  }
catch (  UnsupportedFormatException e) {
  }
  long sum=0;
  for (int i=0; i < sWords.size(); ++i) {
    final long time=runGetTerminalPosition(buffer,sWords.get(i),i,true);
    sum+=time == -1 ? 0 : time;
  }
  Log.d(TAG,"String_Node_Str" + (((double)sum) / sWords.size() / 1000000));
  final Random random=new Random((int)System.currentTimeMillis());
  for (int i=0; i < 1000; ++i) {
    final String word=generateWord(random.nextInt());
    if (sWords.indexOf(word) != -1)     continue;
    runGetTerminalPosition(buffer,word,i,false);
  }
}

Fixed version (ground truth):
public void testGetTerminalPosition(){
  File file=null;
  try {
    file=File.createTempFile("String_Node_Str","String_Node_Str",getContext().getCacheDir());
  }
 catch (  IOException e) {
  }
  assertNotNull(file);
  final FusionDictionary dict=new FusionDictionary(new Node(),new FusionDictionary.DictionaryOptions(new HashMap<String,String>(),false,false));
  addUnigrams(sWords.size(),dict,sWords,null);
  timeWritingDictToFile(file,dict,VERSION3_WITH_DYNAMIC_UPDATE);
  final FusionDictionaryBufferInterface buffer=getBuffer(file,USE_BYTE_ARRAY);
  try {
    final String longWord="String_Node_Str";
    assertEquals(FormatSpec.NOT_VALID_WORD,BinaryDictIOUtils.getTerminalPosition(buffer,longWord));
    assertEquals(FormatSpec.NOT_VALID_WORD,BinaryDictIOUtils.getTerminalPosition(buffer,null));
    assertEquals(FormatSpec.NOT_VALID_WORD,BinaryDictIOUtils.getTerminalPosition(buffer,"String_Node_Str"));
  }
 catch (  IOException e) {
  }
catch (  UnsupportedFormatException e) {
  }
  long sum=0;
  for (int i=0; i < sWords.size(); ++i) {
    final long time=runGetTerminalPosition(buffer,sWords.get(i),i,true);
    sum+=time == -1 ? 0 : time;
  }
  Log.d(TAG,"String_Node_Str" + (((double)sum) / sWords.size() / 1000000));
  final Random random=new Random((int)System.currentTimeMillis());
  for (int i=0; i < 1000; ++i) {
    final String word=generateWord(random);
    if (sWords.indexOf(word) != -1)     continue;
    runGetTerminalPosition(buffer,word,i,false);
  }
}
Program: 87803
Project: 87803
Buggy source:
public BinaryDictIOTests(){
  super();
  final Random random=new Random(123456);
  sWords.clear();
  generateWords(MAX_UNIGRAMS,random);
  for (int i=0; i < sWords.size(); ++i) {
    sChainBigrams.put(i,new ArrayList<Integer>());
    if (i > 0) {
      sChainBigrams.get(i - 1).add(i);
    }
  }
  sStarBigrams.put(0,new ArrayList<Integer>());
  for (int i=1; i < sWords.size(); ++i) {
    sStarBigrams.get(0).add(i);
  }
}

Fixed version (ground truth):
public BinaryDictIOTests(){
  super();
  final long time=System.currentTimeMillis();
  Log.e(TAG,"String_Node_Str" + time);
  final Random random=new Random(time);
  sWords.clear();
  generateWords(MAX_UNIGRAMS,random);
  for (int i=0; i < sWords.size(); ++i) {
    sChainBigrams.put(i,new ArrayList<Integer>());
    if (i > 0) {
      sChainBigrams.get(i - 1).add(i);
    }
  }
  sStarBigrams.put(0,new ArrayList<Integer>());
  for (int i=1; i < sWords.size(); ++i) {
    sStarBigrams.get(0).add(i);
  }
}
Program: 87804
Project: 87804
Buggy source:
/** 
 * Generates a random word.
 */
private String generateWord(final int value){
  final int lengthOfChars=CHARACTERS.length;
  StringBuilder builder=new StringBuilder("String_Node_Str");
  long lvalue=Math.abs((long)value);
  while (lvalue > 0) {
    builder.append(CHARACTERS[(int)(lvalue % lengthOfChars)]);
    lvalue/=lengthOfChars;
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * Generates a random word.
 */
private String generateWord(final Random random){
  StringBuilder builder=new StringBuilder("String_Node_Str");
  int count=random.nextInt() % 30;
  while (count > 0) {
    final long r=Math.abs(random.nextInt());
    if (r < 0)     continue;
    builder.appendCodePoint((int)(20 + r % (0x10FFFF - 20)));
    --count;
  }
  return builder.toString();
}
Program: 87805
Project: 87805
Buggy source:
private void generateWords(final int number,final Random random){
  final Set<String> wordSet=CollectionUtils.newHashSet();
  while (wordSet.size() < number) {
    wordSet.add(generateWord(random.nextInt()));
  }
  sWords.addAll(wordSet);
}

Fixed version (ground truth):
private void generateWords(final int number,final Random random){
  final Set<String> wordSet=CollectionUtils.newHashSet();
  while (wordSet.size() < number) {
    wordSet.add(generateWord(random));
  }
  sWords.addAll(wordSet);
}
Program: 87806
Project: 87806
Buggy source:
private static DictionaryInfo createDictionaryInfoFromFileAddress(final AssetFileAddress fileAddress){
  final FileHeader header=BinaryDictIOUtils.getDictionaryFileHeaderOrNull(new File(fileAddress.mFilename),fileAddress.mOffset,fileAddress.mLength);
  final Locale locale=LocaleUtils.constructLocaleFromString(header.getLocaleString());
  final String version=header.getVersion();
  return new DictionaryInfo(locale,fileAddress,Integer.parseInt(version));
}

Fixed version (ground truth):
private static DictionaryInfo createDictionaryInfoFromFileAddress(final AssetFileAddress fileAddress){
  final FileHeader header=BinaryDictIOUtils.getDictionaryFileHeaderOrNull(new File(fileAddress.mFilename),fileAddress.mOffset,fileAddress.mLength);
  final String id=header.getId();
  final Locale locale=LocaleUtils.constructLocaleFromString(header.getLocaleString());
  final String version=header.getVersion();
  return new DictionaryInfo(id,locale,fileAddress,Integer.parseInt(version));
}
Program: 87807
Project: 87807
Buggy source:
public DictionaryInfo(final Locale locale,final AssetFileAddress fileAddress,final int version){
  mLocale=locale;
  mFileAddress=fileAddress;
  mVersion=version;
  mId=DEFAULT_MAIN_DICT + ID_CATEGORY_SEPARATOR + mLocale;
}

Fixed version (ground truth):
public DictionaryInfo(final String id,final Locale locale,final AssetFileAddress fileAddress,final int version){
  mId=id;
  mLocale=locale;
  mFileAddress=fileAddress;
  mVersion=version;
}
Program: 87808
Project: 87808
Buggy source:
private static DictionaryInfo createDictionaryInfoFromFileAddress(final AssetFileAddress fileAddress){
  final FileHeader header=BinaryDictIOUtils.getDictionaryFileHeaderOrNull(new File(fileAddress.mFilename),fileAddress.mOffset,fileAddress.mLength);
  final Locale locale=LocaleUtils.constructLocaleFromString(header.getLocaleString());
  final String version=header.getVersion();
  return new DictionaryInfo(locale,fileAddress,Integer.parseInt(version));
}

Fixed version (ground truth):
private static DictionaryInfo createDictionaryInfoFromFileAddress(final AssetFileAddress fileAddress){
  final FileHeader header=BinaryDictIOUtils.getDictionaryFileHeaderOrNull(new File(fileAddress.mFilename),fileAddress.mOffset,fileAddress.mLength);
  final String id=header.getId();
  final Locale locale=LocaleUtils.constructLocaleFromString(header.getLocaleString());
  final String version=header.getVersion();
  return new DictionaryInfo(id,locale,fileAddress,Integer.parseInt(version));
}
Program: 87809
Project: 87809
Buggy source:
public DictionaryInfo(final Locale locale,final AssetFileAddress fileAddress,final int version){
  mLocale=locale;
  mFileAddress=fileAddress;
  mVersion=version;
  mId=DEFAULT_MAIN_DICT + ID_CATEGORY_SEPARATOR + mLocale;
}

Fixed version (ground truth):
public DictionaryInfo(final String id,final Locale locale,final AssetFileAddress fileAddress,final int version){
  mId=id;
  mLocale=locale;
  mFileAddress=fileAddress;
  mVersion=version;
}
Program: 87810
Project: 87810
Buggy source:
private void updateDebugMode(){
  if (mDebugMode == null) {
    return;
  }
  boolean isDebugMode=mDebugMode.isChecked();
  String version="String_Node_Str";
  try {
    final Context context=getActivity();
    final String packageName=context.getPackageName();
    PackageInfo info=context.getPackageManager().getPackageInfo(packageName,0);
    version="String_Node_Str" + info.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str");
  }
  if (!isDebugMode) {
    mDebugMode.setTitle(version);
    mDebugMode.setSummary("String_Node_Str");
  }
 else {
    mDebugMode.setTitle(getResources().getString(R.string.prefs_debug_mode));
    mDebugMode.setSummary(version);
  }
}

Fixed version (ground truth):
private void updateDebugMode(){
  if (mDebugMode == null) {
    return;
  }
  boolean isDebugMode=mDebugMode.isChecked();
  String version="String_Node_Str";
  try {
    final Context context=getActivity();
    if (context == null) {
      return;
    }
    final String packageName=context.getPackageName();
    PackageInfo info=context.getPackageManager().getPackageInfo(packageName,0);
    version="String_Node_Str" + info.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str");
  }
  if (!isDebugMode) {
    mDebugMode.setTitle(version);
    mDebugMode.setSummary("String_Node_Str");
  }
 else {
    mDebugMode.setTitle(getResources().getString(R.string.prefs_debug_mode));
    mDebugMode.setSummary(version);
  }
}
Program: 87811
Project: 87811
Buggy source:
public synchronized void publish(final LogUnit logUnit,final boolean isIncludingPrivateData){
  try {
    mExecutor.submit(new Callable<Object>(){
      @Override public Object call() throws Exception {
        logUnit.publishTo(ResearchLog.this,isIncludingPrivateData);
        scheduleFlush();
        return null;
      }
    }
);
  }
 catch (  RejectedExecutionException e) {
  }
}

Fixed version (ground truth):
public synchronized void publish(final LogUnit logUnit,final boolean isIncludingPrivateData){
  try {
    mExecutor.submit(new Callable<Object>(){
      @Override public Object call() throws Exception {
        logUnit.publishTo(ResearchLog.this,isIncludingPrivateData);
        scheduleFlush();
        return null;
      }
    }
);
  }
 catch (  RejectedExecutionException e) {
    if (DEBUG) {
      Log.d(TAG,"String_Node_Str");
    }
  }
}
Program: 87812
Project: 87812
Buggy source:
public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo,final SharedPreferences prefs){
  final ResearchLogger researchLogger=getInstance();
  if (editorInfo != null) {
    final boolean isPassword=InputTypeUtils.isPasswordInputType(editorInfo.inputType) || InputTypeUtils.isVisiblePasswordInputType(editorInfo.inputType);
    getInstance().setIsPasswordView(isPassword);
    researchLogger.start();
    final Context context=researchLogger.mLatinIME;
    try {
      final PackageInfo packageInfo;
      packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);
      final Integer versionCode=packageInfo.versionCode;
      final String versionName=packageInfo.versionName;
      researchLogger.enqueueEvent(LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL,researchLogger.mUUIDString,editorInfo.packageName,Integer.toHexString(editorInfo.inputType),Integer.toHexString(editorInfo.imeOptions),editorInfo.fieldId,Build.DISPLAY,Build.MODEL,prefs,versionCode,versionName,OUTPUT_FORMAT_VERSION,LOG_EVERYTHING,ProductionFlag.IS_EXPERIMENTAL_DEBUG);
    }
 catch (    NameNotFoundException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo,final SharedPreferences prefs){
  final ResearchLogger researchLogger=getInstance();
  if (editorInfo != null) {
    final boolean isPassword=InputTypeUtils.isPasswordInputType(editorInfo.inputType) || InputTypeUtils.isVisiblePasswordInputType(editorInfo.inputType);
    getInstance().setIsPasswordView(isPassword);
    researchLogger.start();
    final Context context=researchLogger.mLatinIME;
    try {
      final PackageInfo packageInfo;
      packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);
      final Integer versionCode=packageInfo.versionCode;
      final String versionName=packageInfo.versionName;
      researchLogger.enqueueEvent(LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL,researchLogger.mUUIDString,editorInfo.packageName,Integer.toHexString(editorInfo.inputType),Integer.toHexString(editorInfo.imeOptions),editorInfo.fieldId,Build.DISPLAY,Build.MODEL,prefs,versionCode,versionName,OUTPUT_FORMAT_VERSION,IS_LOGGING_EVERYTHING,ProductionFlag.IS_EXPERIMENTAL_DEBUG);
    }
 catch (    NameNotFoundException e) {
      e.printStackTrace();
    }
  }
}
Program: 87813
Project: 87813
Buggy source:
void stop(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  commitCurrentLogUnit();
  if (mMainLogBuffer != null) {
    publishLogBuffer(mMainLogBuffer,mMainResearchLog,LOG_EVERYTHING);
    mMainResearchLog.close(null);
    mMainLogBuffer=null;
  }
  if (mFeedbackLogBuffer != null) {
    mFeedbackLog.close(null);
    mFeedbackLogBuffer=null;
  }
}

Fixed version (ground truth):
void stop(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  commitCurrentLogUnit();
  if (mMainLogBuffer != null) {
    publishLogBuffer(mMainLogBuffer,mMainResearchLog,IS_LOGGING_EVERYTHING);
    mMainResearchLog.close(null);
    mMainLogBuffer=null;
  }
  if (mFeedbackLogBuffer != null) {
    mFeedbackLog.close(null);
    mFeedbackLogBuffer=null;
  }
}
Program: 87814
Project: 87814
Buggy source:
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      if ((mMainLogBuffer.isSafeToLog() || LOG_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}

Fixed version (ground truth):
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      if ((mMainLogBuffer.isSafeToLog() || IS_LOGGING_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}
Program: 87815
Project: 87815
Buggy source:
public static void latinIME_revertCommit(final String committedWord,final String originallyTypedWord,final boolean isBatchMode){
  final ResearchLogger researchLogger=getInstance();
  final LogUnit logUnit=researchLogger.mMainLogBuffer.peekLastLogUnit();
  if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
    if (logUnit != null) {
      logUnit.setWord(originallyTypedWord);
    }
    final Dictionary dictionary=researchLogger.getDictionary();
    researchLogger.mStatistics.recordWordEntered(dictionary != null && dictionary.isValidWord(originallyTypedWord));
  }
  researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit,LOGSTATEMENT_LATINIME_REVERTCOMMIT,committedWord,originallyTypedWord);
  researchLogger.mStatistics.recordRevertCommit();
  researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord,Long.MAX_VALUE,isBatchMode);
}

Fixed version (ground truth):
public static void latinIME_revertCommit(final String committedWord,final String originallyTypedWord,final boolean isBatchMode){
  final ResearchLogger researchLogger=getInstance();
  final LogUnit logUnit=researchLogger.mMainLogBuffer.peekLastLogUnit();
  if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
    if (logUnit != null) {
      logUnit.setWord(originallyTypedWord);
    }
  }
  researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit,LOGSTATEMENT_LATINIME_REVERTCOMMIT,committedWord,originallyTypedWord);
  researchLogger.mStatistics.recordRevertCommit();
  researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord,Long.MAX_VALUE,isBatchMode);
}
Program: 87816
Project: 87816
Buggy source:
public synchronized void publish(final LogUnit logUnit,final boolean isIncludingPrivateData){
  try {
    mExecutor.submit(new Callable<Object>(){
      @Override public Object call() throws Exception {
        logUnit.publishTo(ResearchLog.this,isIncludingPrivateData);
        scheduleFlush();
        return null;
      }
    }
);
  }
 catch (  RejectedExecutionException e) {
  }
}

Fixed version (ground truth):
public synchronized void publish(final LogUnit logUnit,final boolean isIncludingPrivateData){
  try {
    mExecutor.submit(new Callable<Object>(){
      @Override public Object call() throws Exception {
        logUnit.publishTo(ResearchLog.this,isIncludingPrivateData);
        scheduleFlush();
        return null;
      }
    }
);
  }
 catch (  RejectedExecutionException e) {
    if (DEBUG) {
      Log.d(TAG,"String_Node_Str");
    }
  }
}
Program: 87817
Project: 87817
Buggy source:
public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo,final SharedPreferences prefs){
  final ResearchLogger researchLogger=getInstance();
  if (editorInfo != null) {
    final boolean isPassword=InputTypeUtils.isPasswordInputType(editorInfo.inputType) || InputTypeUtils.isVisiblePasswordInputType(editorInfo.inputType);
    getInstance().setIsPasswordView(isPassword);
    researchLogger.start();
    final Context context=researchLogger.mLatinIME;
    try {
      final PackageInfo packageInfo;
      packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);
      final Integer versionCode=packageInfo.versionCode;
      final String versionName=packageInfo.versionName;
      researchLogger.enqueueEvent(LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL,researchLogger.mUUIDString,editorInfo.packageName,Integer.toHexString(editorInfo.inputType),Integer.toHexString(editorInfo.imeOptions),editorInfo.fieldId,Build.DISPLAY,Build.MODEL,prefs,versionCode,versionName,OUTPUT_FORMAT_VERSION,LOG_EVERYTHING,ProductionFlag.IS_EXPERIMENTAL_DEBUG);
    }
 catch (    NameNotFoundException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo,final SharedPreferences prefs){
  final ResearchLogger researchLogger=getInstance();
  if (editorInfo != null) {
    final boolean isPassword=InputTypeUtils.isPasswordInputType(editorInfo.inputType) || InputTypeUtils.isVisiblePasswordInputType(editorInfo.inputType);
    getInstance().setIsPasswordView(isPassword);
    researchLogger.start();
    final Context context=researchLogger.mLatinIME;
    try {
      final PackageInfo packageInfo;
      packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);
      final Integer versionCode=packageInfo.versionCode;
      final String versionName=packageInfo.versionName;
      researchLogger.enqueueEvent(LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL,researchLogger.mUUIDString,editorInfo.packageName,Integer.toHexString(editorInfo.inputType),Integer.toHexString(editorInfo.imeOptions),editorInfo.fieldId,Build.DISPLAY,Build.MODEL,prefs,versionCode,versionName,OUTPUT_FORMAT_VERSION,IS_LOGGING_EVERYTHING,ProductionFlag.IS_EXPERIMENTAL_DEBUG);
    }
 catch (    NameNotFoundException e) {
      e.printStackTrace();
    }
  }
}
Program: 87818
Project: 87818
Buggy source:
void stop(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  commitCurrentLogUnit();
  if (mMainLogBuffer != null) {
    publishLogBuffer(mMainLogBuffer,mMainResearchLog,LOG_EVERYTHING);
    mMainResearchLog.close(null);
    mMainLogBuffer=null;
  }
  if (mFeedbackLogBuffer != null) {
    mFeedbackLog.close(null);
    mFeedbackLogBuffer=null;
  }
}

Fixed version (ground truth):
void stop(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  commitCurrentLogUnit();
  if (mMainLogBuffer != null) {
    publishLogBuffer(mMainLogBuffer,mMainResearchLog,IS_LOGGING_EVERYTHING);
    mMainResearchLog.close(null);
    mMainLogBuffer=null;
  }
  if (mFeedbackLogBuffer != null) {
    mFeedbackLog.close(null);
    mFeedbackLogBuffer=null;
  }
}
Program: 87819
Project: 87819
Buggy source:
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      if ((mMainLogBuffer.isSafeToLog() || LOG_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}

Fixed version (ground truth):
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      if ((mMainLogBuffer.isSafeToLog() || IS_LOGGING_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}
Program: 87820
Project: 87820
Buggy source:
public static void latinIME_revertCommit(final String committedWord,final String originallyTypedWord,final boolean isBatchMode){
  final ResearchLogger researchLogger=getInstance();
  final LogUnit logUnit=researchLogger.mMainLogBuffer.peekLastLogUnit();
  if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
    if (logUnit != null) {
      logUnit.setWord(originallyTypedWord);
    }
    final Dictionary dictionary=researchLogger.getDictionary();
    researchLogger.mStatistics.recordWordEntered(dictionary != null && dictionary.isValidWord(originallyTypedWord));
  }
  researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit,LOGSTATEMENT_LATINIME_REVERTCOMMIT,committedWord,originallyTypedWord);
  researchLogger.mStatistics.recordRevertCommit();
  researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord,Long.MAX_VALUE,isBatchMode);
}

Fixed version (ground truth):
public static void latinIME_revertCommit(final String committedWord,final String originallyTypedWord,final boolean isBatchMode){
  final ResearchLogger researchLogger=getInstance();
  final LogUnit logUnit=researchLogger.mMainLogBuffer.peekLastLogUnit();
  if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
    if (logUnit != null) {
      logUnit.setWord(originallyTypedWord);
    }
  }
  researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit,LOGSTATEMENT_LATINIME_REVERTCOMMIT,committedWord,originallyTypedWord);
  researchLogger.mStatistics.recordRevertCommit();
  researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord,Long.MAX_VALUE,isBatchMode);
}
Program: 87821
Project: 87821
Buggy source:
private void updateDebugMode(){
  if (mDebugMode == null) {
    return;
  }
  boolean isDebugMode=mDebugMode.isChecked();
  String version="String_Node_Str";
  try {
    final Context context=getActivity();
    final String packageName=context.getPackageName();
    PackageInfo info=context.getPackageManager().getPackageInfo(packageName,0);
    version="String_Node_Str" + info.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str");
  }
  if (!isDebugMode) {
    mDebugMode.setTitle(version);
    mDebugMode.setSummary("String_Node_Str");
  }
 else {
    mDebugMode.setTitle(getResources().getString(R.string.prefs_debug_mode));
    mDebugMode.setSummary(version);
  }
}

Fixed version (ground truth):
private void updateDebugMode(){
  if (mDebugMode == null) {
    return;
  }
  boolean isDebugMode=mDebugMode.isChecked();
  String version="String_Node_Str";
  try {
    final Context context=getActivity();
    if (context == null) {
      return;
    }
    final String packageName=context.getPackageName();
    PackageInfo info=context.getPackageManager().getPackageInfo(packageName,0);
    version="String_Node_Str" + info.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str");
  }
  if (!isDebugMode) {
    mDebugMode.setTitle(version);
    mDebugMode.setSummary("String_Node_Str");
  }
 else {
    mDebugMode.setTitle(getResources().getString(R.string.prefs_debug_mode));
    mDebugMode.setSummary(version);
  }
}
Program: 87822
Project: 87822
Buggy source:
private void updateDebugMode(){
  if (mDebugMode == null) {
    return;
  }
  boolean isDebugMode=mDebugMode.isChecked();
  String version="String_Node_Str";
  try {
    final Context context=getActivity();
    final String packageName=context.getPackageName();
    PackageInfo info=context.getPackageManager().getPackageInfo(packageName,0);
    version="String_Node_Str" + info.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str");
  }
  if (!isDebugMode) {
    mDebugMode.setTitle(version);
    mDebugMode.setSummary("String_Node_Str");
  }
 else {
    mDebugMode.setTitle(getResources().getString(R.string.prefs_debug_mode));
    mDebugMode.setSummary(version);
  }
}

Fixed version (ground truth):
private void updateDebugMode(){
  if (mDebugMode == null) {
    return;
  }
  boolean isDebugMode=mDebugMode.isChecked();
  String version="String_Node_Str";
  try {
    final Context context=getActivity();
    if (context == null) {
      return;
    }
    final String packageName=context.getPackageName();
    PackageInfo info=context.getPackageManager().getPackageInfo(packageName,0);
    version="String_Node_Str" + info.versionName;
  }
 catch (  NameNotFoundException e) {
    Log.e(TAG,"String_Node_Str");
  }
  if (!isDebugMode) {
    mDebugMode.setTitle(version);
    mDebugMode.setSummary("String_Node_Str");
  }
 else {
    mDebugMode.setTitle(getResources().getString(R.string.prefs_debug_mode));
    mDebugMode.setSummary(version);
  }
}
Program: 87823
Project: 87823
Buggy source:
public synchronized void publish(final LogUnit logUnit,final boolean isIncludingPrivateData){
  try {
    mExecutor.submit(new Callable<Object>(){
      @Override public Object call() throws Exception {
        logUnit.publishTo(ResearchLog.this,isIncludingPrivateData);
        scheduleFlush();
        return null;
      }
    }
);
  }
 catch (  RejectedExecutionException e) {
  }
}

Fixed version (ground truth):
public synchronized void publish(final LogUnit logUnit,final boolean isIncludingPrivateData){
  try {
    mExecutor.submit(new Callable<Object>(){
      @Override public Object call() throws Exception {
        logUnit.publishTo(ResearchLog.this,isIncludingPrivateData);
        scheduleFlush();
        return null;
      }
    }
);
  }
 catch (  RejectedExecutionException e) {
    if (DEBUG) {
      Log.d(TAG,"String_Node_Str");
    }
  }
}
Program: 87824
Project: 87824
Buggy source:
public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo,final SharedPreferences prefs){
  final ResearchLogger researchLogger=getInstance();
  if (editorInfo != null) {
    final boolean isPassword=InputTypeUtils.isPasswordInputType(editorInfo.inputType) || InputTypeUtils.isVisiblePasswordInputType(editorInfo.inputType);
    getInstance().setIsPasswordView(isPassword);
    researchLogger.start();
    final Context context=researchLogger.mLatinIME;
    try {
      final PackageInfo packageInfo;
      packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);
      final Integer versionCode=packageInfo.versionCode;
      final String versionName=packageInfo.versionName;
      researchLogger.enqueueEvent(LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL,researchLogger.mUUIDString,editorInfo.packageName,Integer.toHexString(editorInfo.inputType),Integer.toHexString(editorInfo.imeOptions),editorInfo.fieldId,Build.DISPLAY,Build.MODEL,prefs,versionCode,versionName,OUTPUT_FORMAT_VERSION,LOG_EVERYTHING,ProductionFlag.IS_EXPERIMENTAL_DEBUG);
    }
 catch (    NameNotFoundException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public static void latinIME_onStartInputViewInternal(final EditorInfo editorInfo,final SharedPreferences prefs){
  final ResearchLogger researchLogger=getInstance();
  if (editorInfo != null) {
    final boolean isPassword=InputTypeUtils.isPasswordInputType(editorInfo.inputType) || InputTypeUtils.isVisiblePasswordInputType(editorInfo.inputType);
    getInstance().setIsPasswordView(isPassword);
    researchLogger.start();
    final Context context=researchLogger.mLatinIME;
    try {
      final PackageInfo packageInfo;
      packageInfo=context.getPackageManager().getPackageInfo(context.getPackageName(),0);
      final Integer versionCode=packageInfo.versionCode;
      final String versionName=packageInfo.versionName;
      researchLogger.enqueueEvent(LOGSTATEMENT_LATIN_IME_ON_START_INPUT_VIEW_INTERNAL,researchLogger.mUUIDString,editorInfo.packageName,Integer.toHexString(editorInfo.inputType),Integer.toHexString(editorInfo.imeOptions),editorInfo.fieldId,Build.DISPLAY,Build.MODEL,prefs,versionCode,versionName,OUTPUT_FORMAT_VERSION,IS_LOGGING_EVERYTHING,ProductionFlag.IS_EXPERIMENTAL_DEBUG);
    }
 catch (    NameNotFoundException e) {
      e.printStackTrace();
    }
  }
}
Program: 87825
Project: 87825
Buggy source:
void stop(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  commitCurrentLogUnit();
  if (mMainLogBuffer != null) {
    publishLogBuffer(mMainLogBuffer,mMainResearchLog,LOG_EVERYTHING);
    mMainResearchLog.close(null);
    mMainLogBuffer=null;
  }
  if (mFeedbackLogBuffer != null) {
    mFeedbackLog.close(null);
    mFeedbackLogBuffer=null;
  }
}

Fixed version (ground truth):
void stop(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str");
  }
  commitCurrentLogUnit();
  if (mMainLogBuffer != null) {
    publishLogBuffer(mMainLogBuffer,mMainResearchLog,IS_LOGGING_EVERYTHING);
    mMainResearchLog.close(null);
    mMainLogBuffer=null;
  }
  if (mFeedbackLogBuffer != null) {
    mFeedbackLog.close(null);
    mFeedbackLogBuffer=null;
  }
}
Program: 87826
Project: 87826
Buggy source:
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      if ((mMainLogBuffer.isSafeToLog() || LOG_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}

Fixed version (ground truth):
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      if ((mMainLogBuffer.isSafeToLog() || IS_LOGGING_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}
Program: 87827
Project: 87827
Buggy source:
public static void latinIME_revertCommit(final String committedWord,final String originallyTypedWord,final boolean isBatchMode){
  final ResearchLogger researchLogger=getInstance();
  final LogUnit logUnit=researchLogger.mMainLogBuffer.peekLastLogUnit();
  if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
    if (logUnit != null) {
      logUnit.setWord(originallyTypedWord);
    }
    final Dictionary dictionary=researchLogger.getDictionary();
    researchLogger.mStatistics.recordWordEntered(dictionary != null && dictionary.isValidWord(originallyTypedWord));
  }
  researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit,LOGSTATEMENT_LATINIME_REVERTCOMMIT,committedWord,originallyTypedWord);
  researchLogger.mStatistics.recordRevertCommit();
  researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord,Long.MAX_VALUE,isBatchMode);
}

Fixed version (ground truth):
public static void latinIME_revertCommit(final String committedWord,final String originallyTypedWord,final boolean isBatchMode){
  final ResearchLogger researchLogger=getInstance();
  final LogUnit logUnit=researchLogger.mMainLogBuffer.peekLastLogUnit();
  if (originallyTypedWord.length() > 0 && hasLetters(originallyTypedWord)) {
    if (logUnit != null) {
      logUnit.setWord(originallyTypedWord);
    }
  }
  researchLogger.enqueueEvent(logUnit != null ? logUnit : researchLogger.mCurrentLogUnit,LOGSTATEMENT_LATINIME_REVERTCOMMIT,committedWord,originallyTypedWord);
  researchLogger.mStatistics.recordRevertCommit();
  researchLogger.commitCurrentLogUnitAsWord(originallyTypedWord,Long.MAX_VALUE,isBatchMode);
}
Program: 87830
Project: 87830
Buggy source:
/** 
 * Publish the contents of this LogUnit to researchLog.
 */
public synchronized void publishTo(final ResearchLog researchLog,final boolean isIncludingPrivateData){
  final int size=mLogStatementList.size();
  for (int i=0; i < size; i++) {
    final LogStatement logStatement=mLogStatementList.get(i);
    if (!isIncludingPrivateData && logStatement.mIsPotentiallyPrivate) {
      continue;
    }
    if (mIsPartOfMegaword && logStatement.mIsPotentiallyRevealing) {
      continue;
    }
    final JsonWriter jsonWriter=researchLog.getValidJsonWriterLocked();
    outputLogStatementToLocked(jsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
  }
}

Fixed version (ground truth):
/** 
 * Publish the contents of this LogUnit to researchLog.
 */
public synchronized void publishTo(final ResearchLog researchLog,final boolean isIncludingPrivateData){
  final StringWriter debugStringWriter;
  final JsonWriter debugJsonWriter;
  if (DEBUG) {
    debugStringWriter=new StringWriter();
    debugJsonWriter=new JsonWriter(debugStringWriter);
    debugJsonWriter.setIndent("String_Node_Str");
    try {
      debugJsonWriter.beginArray();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 else {
    debugStringWriter=null;
    debugJsonWriter=null;
  }
  final int size=mLogStatementList.size();
  for (int i=0; i < size; i++) {
    final LogStatement logStatement=mLogStatementList.get(i);
    if (!isIncludingPrivateData && logStatement.mIsPotentiallyPrivate) {
      continue;
    }
    if (mIsPartOfMegaword && logStatement.mIsPotentiallyRevealing) {
      continue;
    }
    final JsonWriter jsonWriter=researchLog.getValidJsonWriterLocked();
    outputLogStatementToLocked(jsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
    if (DEBUG) {
      outputLogStatementToLocked(debugJsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
    }
  }
  if (DEBUG) {
    try {
      debugJsonWriter.endArray();
      debugJsonWriter.flush();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
    final String bigString=debugStringWriter.getBuffer().toString();
    final String[] lines=bigString.split("String_Node_Str");
    for (    String line : lines) {
      Log.d(TAG,line);
    }
  }
}
Program: 87831
Project: 87831
Buggy source:
/** 
 * Publish the contents of this LogUnit to researchLog.
 */
public synchronized void publishTo(final ResearchLog researchLog,final boolean isIncludingPrivateData){
  final int size=mLogStatementList.size();
  for (int i=0; i < size; i++) {
    final LogStatement logStatement=mLogStatementList.get(i);
    if (!isIncludingPrivateData && logStatement.mIsPotentiallyPrivate) {
      continue;
    }
    if (mIsPartOfMegaword && logStatement.mIsPotentiallyRevealing) {
      continue;
    }
    final JsonWriter jsonWriter=researchLog.getValidJsonWriterLocked();
    outputLogStatementToLocked(jsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
  }
}

Fixed version (ground truth):
/** 
 * Publish the contents of this LogUnit to researchLog.
 */
public synchronized void publishTo(final ResearchLog researchLog,final boolean isIncludingPrivateData){
  final StringWriter debugStringWriter;
  final JsonWriter debugJsonWriter;
  if (DEBUG) {
    debugStringWriter=new StringWriter();
    debugJsonWriter=new JsonWriter(debugStringWriter);
    debugJsonWriter.setIndent("String_Node_Str");
    try {
      debugJsonWriter.beginArray();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 else {
    debugStringWriter=null;
    debugJsonWriter=null;
  }
  final int size=mLogStatementList.size();
  for (int i=0; i < size; i++) {
    final LogStatement logStatement=mLogStatementList.get(i);
    if (!isIncludingPrivateData && logStatement.mIsPotentiallyPrivate) {
      continue;
    }
    if (mIsPartOfMegaword && logStatement.mIsPotentiallyRevealing) {
      continue;
    }
    final JsonWriter jsonWriter=researchLog.getValidJsonWriterLocked();
    outputLogStatementToLocked(jsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
    if (DEBUG) {
      outputLogStatementToLocked(debugJsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
    }
  }
  if (DEBUG) {
    try {
      debugJsonWriter.endArray();
      debugJsonWriter.flush();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
    final String bigString=debugStringWriter.getBuffer().toString();
    final String[] lines=bigString.split("String_Node_Str");
    for (    String line : lines) {
      Log.d(TAG,line);
    }
  }
}
Program: 87832
Project: 87832
Buggy source:
/** 
 * Publish the contents of this LogUnit to researchLog.
 */
public synchronized void publishTo(final ResearchLog researchLog,final boolean isIncludingPrivateData){
  final int size=mLogStatementList.size();
  for (int i=0; i < size; i++) {
    final LogStatement logStatement=mLogStatementList.get(i);
    if (!isIncludingPrivateData && logStatement.mIsPotentiallyPrivate) {
      continue;
    }
    if (mIsPartOfMegaword && logStatement.mIsPotentiallyRevealing) {
      continue;
    }
    final JsonWriter jsonWriter=researchLog.getValidJsonWriterLocked();
    outputLogStatementToLocked(jsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
  }
}

Fixed version (ground truth):
/** 
 * Publish the contents of this LogUnit to researchLog.
 */
public synchronized void publishTo(final ResearchLog researchLog,final boolean isIncludingPrivateData){
  final StringWriter debugStringWriter;
  final JsonWriter debugJsonWriter;
  if (DEBUG) {
    debugStringWriter=new StringWriter();
    debugJsonWriter=new JsonWriter(debugStringWriter);
    debugJsonWriter.setIndent("String_Node_Str");
    try {
      debugJsonWriter.beginArray();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
  }
 else {
    debugStringWriter=null;
    debugJsonWriter=null;
  }
  final int size=mLogStatementList.size();
  for (int i=0; i < size; i++) {
    final LogStatement logStatement=mLogStatementList.get(i);
    if (!isIncludingPrivateData && logStatement.mIsPotentiallyPrivate) {
      continue;
    }
    if (mIsPartOfMegaword && logStatement.mIsPotentiallyRevealing) {
      continue;
    }
    final JsonWriter jsonWriter=researchLog.getValidJsonWriterLocked();
    outputLogStatementToLocked(jsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
    if (DEBUG) {
      outputLogStatementToLocked(debugJsonWriter,mLogStatementList.get(i),mValuesList.get(i),mTimeList.get(i));
    }
  }
  if (DEBUG) {
    try {
      debugJsonWriter.endArray();
      debugJsonWriter.flush();
    }
 catch (    IOException e) {
      Log.e(TAG,"String_Node_Str",e);
    }
    final String bigString=debugStringWriter.getBuffer().toString();
    final String[] lines=bigString.split("String_Node_Str");
    for (    String line : lines) {
      Log.d(TAG,line);
    }
  }
}
Program: 87833
Project: 87833
Buggy source:
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
      if (mMainLogBuffer.isSafeToLog() && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}

Fixed version (ground truth):
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
      if ((mMainLogBuffer.isSafeToLog() || LOG_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}
Program: 87834
Project: 87834
Buggy source:
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
      if (mMainLogBuffer.isSafeToLog() && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}

Fixed version (ground truth):
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
      if ((mMainLogBuffer.isSafeToLog() || LOG_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}
Program: 87835
Project: 87835
Buggy source:
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
      if (mMainLogBuffer.isSafeToLog() && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}

Fixed version (ground truth):
void commitCurrentLogUnit(){
  if (DEBUG) {
    Log.d(TAG,"String_Node_Str" + (mCurrentLogUnit.hasWord() ? "String_Node_Str" + mCurrentLogUnit.getWord() : "String_Node_Str"));
  }
  if (!mCurrentLogUnit.isEmpty()) {
    if (mMainLogBuffer != null) {
      mMainLogBuffer.shiftIn(mCurrentLogUnit);
      if ((mMainLogBuffer.isSafeToLog() || LOG_EVERYTHING) && mMainResearchLog != null) {
        publishLogBuffer(mMainLogBuffer,mMainResearchLog,true);
        mMainLogBuffer.resetWordCounter();
      }
    }
    if (mFeedbackLogBuffer != null) {
      mFeedbackLogBuffer.shiftIn(mCurrentLogUnit);
    }
    mCurrentLogUnit=new LogUnit();
  }
}
Program: 87836
Project: 87836
Buggy source:
@Override public void showMoreKeysPanel(final View parentView,final Controller controller,final int pointX,final int pointY,final KeyboardActionListener listener){
  mController=controller;
  mListener=listener;
  final View container=getContainerView();
  final int x=pointX - getDefaultCoordX() - container.getPaddingLeft();
  final int y=pointY - container.getMeasuredHeight() + container.getPaddingBottom();
  parentView.getLocationInWindow(mCoordinates);
  final int maxX=parentView.getMeasuredWidth() - container.getMeasuredWidth();
  final int panelX=Math.max(0,Math.min(maxX,x + CoordinateUtils.x(mCoordinates)));
  final int panelY=y + CoordinateUtils.y(mCoordinates);
  container.setX(panelX);
  container.setY(panelY);
  mOriginX=x + container.getPaddingLeft();
  mOriginY=y + container.getPaddingTop();
  controller.onShowMoreKeysPanel(this);
}

Fixed version (ground truth):
@Override public void showMoreKeysPanel(final View parentView,final Controller controller,final int pointX,final int pointY,final KeyboardActionListener listener){
  mController=controller;
  mListener=listener;
  final View container=getContainerView();
  final int x=pointX - getDefaultCoordX() - container.getPaddingLeft();
  final int y=pointY - container.getMeasuredHeight() + container.getPaddingBottom();
  parentView.getLocationInWindow(mCoordinates);
  final int maxX=parentView.getMeasuredWidth() - container.getMeasuredWidth();
  final int panelX=Math.max(0,Math.min(maxX,x)) + CoordinateUtils.x(mCoordinates);
  final int panelY=y + CoordinateUtils.y(mCoordinates);
  container.setX(panelX);
  container.setY(panelY);
  mOriginX=x + container.getPaddingLeft();
  mOriginY=y + container.getPaddingTop();
  controller.onShowMoreKeysPanel(this);
}