nus-yam/ex-repair huggingface dataset:
Program: 93831
Project: 93831
Buggy source:
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(this.left);
  dest.writeInt(this.right);
  dest.writeInt(this.top);
  dest.writeInt(this.bottom);
  dest.writeInt(this.width);
  dest.writeInt(this.heigth);
}

Fixed version (ground truth):
@Override public void writeToParcel(Parcel dest,int flags){
  dest.writeInt(this.left);
  dest.writeInt(this.right);
  dest.writeInt(this.top);
  dest.writeInt(this.bottom);
  dest.writeInt(this.width);
  dest.writeInt(this.height);
}
Program: 93832
Project: 93832
Buggy source:
@Override public IExtractedFileSet extractFileSet(Distribution distribution) throws IOException {
  try {
    final File dir=this.eDir.asFile();
    final FileSet filesSet=downloadConfig.getPackageResolver().getFileSet(distribution);
    if (dir.exists() && dir.isDirectory() && filesSet.entries().stream().allMatch(entry -> exists(get(dir.getPath(),"String_Node_Str","String_Node_Str")))) {
      final Builder extracted=builder(dir).baseDirIsGenerated(false);
      iterateFiles(dir,TRUE,TRUE).forEachRemaining(file -> {
        FileType type=Library;
        if (filesSet.entries().stream().anyMatch(entry -> entry.matchingPattern().matcher(file.getPath()).matches())) {
          type=Executable;
        }
        extracted.file(type,file);
      }
);
      return extracted.build();
    }
 else {
      return super.extractFileSet(distribution);
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    return new EmptyFileSet();
  }
}

Fixed version (ground truth):
@Override public IExtractedFileSet extractFileSet(Distribution distribution) throws IOException {
  try {
    final File dir=this.eDir.asFile();
    final FileSet filesSet=downloadConfig.getPackageResolver().getFileSet(distribution);
    final Path path=get(dir.getPath(),"String_Node_Str" + "String_Node_Str" + distribution.getVersion().asInDownloadPath(),"String_Node_Str");
    if (filesSet.entries().stream().allMatch(entry -> exists(path))) {
      final Builder extracted=builder(dir).baseDirIsGenerated(false);
      iterateFiles(dir,TRUE,TRUE).forEachRemaining(file -> {
        FileType type=Library;
        if (filesSet.entries().stream().anyMatch(entry -> entry.matchingPattern().matcher(file.getPath()).matches())) {
          type=Executable;
        }
        extracted.file(type,file);
      }
);
      return extracted.build();
    }
 else {
      return super.extractFileSet(distribution);
    }
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    return new EmptyFileSet();
  }
}
Program: 93833
Project: 93833
Buggy source:
@Override public IExtractedFileSet extractFileSet(Distribution distribution) throws IOException {
  IPackageResolver packageResolver=downloadConfig.getPackageResolver();
  File artifact=getArtifact(downloadConfig,distribution);
  final ArchiveType archiveType=packageResolver.getArchiveType(distribution);
  IExtractor extractor=Extractors.getExtractor(archiveType);
  try {
    final FileSet fileSet=packageResolver.getFileSet(distribution);
    return extractor.extract(downloadConfig,artifact,new PostgresFilesToExtract(tempDirFactory,executableNaming,fileSet));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    return new EmptyFileSet();
  }
}

Fixed version (ground truth):
@Override public IExtractedFileSet extractFileSet(Distribution distribution) throws IOException {
  IPackageResolver packageResolver=downloadConfig.getPackageResolver();
  File artifact=getArtifact(downloadConfig,distribution);
  final ArchiveType archiveType=packageResolver.getArchiveType(distribution);
  IExtractor extractor=Extractors.getExtractor(archiveType);
  try {
    final FileSet fileSet=packageResolver.getFileSet(distribution);
    return extractor.extract(downloadConfig,artifact,new PostgresFilesToExtract(tempDirFactory,executableNaming,fileSet,distribution));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e);
    return new EmptyFileSet();
  }
}
Program: 93835
Project: 93835
Buggy source:
public PostgresFilesToExtract(IDirectory dirFactory,ITempNaming executableNaming,FileSet fileSet){
  super(dirFactory,executableNaming,fileSet);
  this.fileSet=fileSet;
  this.extractDir=dirFactory;
}

Fixed version (ground truth):
public PostgresFilesToExtract(IDirectory dirFactory,ITempNaming executableNaming,FileSet fileSet,Distribution distribution){
  super(dirFactory,executableNaming,fileSet);
  this.fileSet=fileSet;
  if (dirFactory.asFile() != null) {
    final File file=new File(dirFactory.asFile(),"String_Node_Str" + distribution.getVersion().asInDownloadPath());
    if (!file.exists()) {
      file.mkdir();
    }
    this.extractBasePath=file.getPath();
  }
 else {
    this.extractBasePath=null;
  }
}
Program: 93836
Project: 93836
Buggy source:
@Override protected void onBeforeProcess(IRuntimeConfig runtimeConfig) throws IOException {
  super.onBeforeProcess(runtimeConfig);
  PostgresConfig config=getConfig();
  runCmd(config,runtimeConfig,InitDb,"String_Node_Str",1000);
}

Fixed version (ground truth):
@Override protected void onBeforeProcess(IRuntimeConfig runtimeConfig) throws IOException {
  super.onBeforeProcess(runtimeConfig);
  PostgresConfig config=getConfig();
  final File dbDir=config.storage().dbDir();
  if (dbDir.exists() && dbDir.listFiles() != null && dbDir.listFiles().length > 0) {
    return;
  }
  runCmd(config,runtimeConfig,InitDb,"String_Node_Str",1000);
}
Program: 93837
Project: 93837
Buggy source:
protected void deleteTempFiles(){
  final Storage storage=getConfig().storage();
  if ((storage.dbDir() != null) && (storage.isTmpDir()) && (!forceDelete(storage.dbDir()))) {
    LOGGER.warn("String_Node_Str",storage.dbDir());
  }
}

Fixed version (ground truth):
protected void deleteTempFiles(){
  final Storage storage=getConfig().storage();
  if (storage.dbDir() == null) {
    return;
  }
  if (!storage.isTmpDir()) {
    return;
  }
  if (!forceDelete(storage.dbDir())) {
    LOGGER.warn("String_Node_Str",storage.dbDir());
  }
}
Program: 93838
Project: 93838
Buggy source:
@Override protected final void onAfterProcessStart(ProcessControl process,IRuntimeConfig runtimeConfig) throws IOException {
  final Path pidFilePath=Paths.get(getConfig().storage().dbDir().getAbsolutePath(),"String_Node_Str");
  final File pidFile=new File(pidFilePath.toAbsolutePath().toString());
  int timeout=TIMEOUT;
  while (!pidFile.exists() && ((timeout=timeout - 100) > 0)) {
    try {
      sleep(100);
    }
 catch (    InterruptedException ie) {
    }
  }
  int pid=-1;
  try {
    pid=Integer.valueOf(readLines(pidFilePath.toFile()).get(0));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e.getMessage(),e);
  }
  if (pid != -1) {
    setProcessId(pid);
  }
 else {
    setProcessId(getPidFromFile(pidFile()));
  }
  int trial=0;
  do {
    String output=runCmd(getConfig(),runtimeConfig,CreateDb,"String_Node_Str",new HashSet<>(singleton("String_Node_Str")),3000,getConfig().storage().dbName());
    try {
      if (isEmpty(output) || !output.contains("String_Node_Str")) {
        this.processReady=true;
        break;
      }
      LOGGER.warn("String_Node_Str",trial,MAX_CREATEDB_TRIALS);
      sleep(100);
    }
 catch (    InterruptedException ie) {
    }
  }
 while (trial++ < MAX_CREATEDB_TRIALS);
}

Fixed version (ground truth):
@Override protected final void onAfterProcessStart(ProcessControl process,IRuntimeConfig runtimeConfig) throws IOException {
  final Storage storage=getConfig().storage();
  final Path pidFilePath=Paths.get(storage.dbDir().getAbsolutePath(),"String_Node_Str");
  final File pidFile=new File(pidFilePath.toAbsolutePath().toString());
  int timeout=TIMEOUT;
  while (!pidFile.exists() && ((timeout=timeout - 100) > 0)) {
    try {
      sleep(100);
    }
 catch (    InterruptedException ie) {
    }
  }
  int pid=-1;
  try {
    pid=Integer.valueOf(readLines(pidFilePath.toFile()).get(0));
  }
 catch (  Exception e) {
    LOGGER.error("String_Node_Str",e.getMessage(),e);
  }
  if (pid != -1) {
    setProcessId(pid);
  }
 else {
    setProcessId(getPidFromFile(pidFile()));
  }
  int trial=0;
  do {
    String output=runCmd(getConfig(),runtimeConfig,CreateDb,"String_Node_Str",new HashSet<>(singleton("String_Node_Str")),3000,storage.dbName());
    try {
      if (isEmpty(output) || !output.contains("String_Node_Str")) {
        this.processReady=true;
        break;
      }
      LOGGER.warn("String_Node_Str",trial,MAX_CREATEDB_TRIALS);
      sleep(100);
    }
 catch (    InterruptedException ie) {
    }
  }
 while (trial++ < MAX_CREATEDB_TRIALS);
}
Program: 93839
Project: 93839
Buggy source:
private void startFakeTouchTask(){
  mTimer=new Timer();
  mSendFakeTouchTask=new TimerTask(){
    @Override public void run(){
      Instrumentation instrumentation=new Instrumentation();
      instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACKSLASH);
    }
  }
;
  mTimer.schedule(mSendFakeTouchTask,1000,1000);
}

Fixed version (ground truth):
private void startFakeTouchTask(){
  mTimer=new Timer();
  mSendFakeTouchTask=new TimerTask(){
    @Override public void run(){
      try {
        Instrumentation instrumentation=new Instrumentation();
        instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACKSLASH);
      }
 catch (      SecurityException e) {
      }
    }
  }
;
  mTimer.schedule(mSendFakeTouchTask,1000,1000);
}
Program: 93840
Project: 93840
Buggy source:
@Override public void run(){
  Instrumentation instrumentation=new Instrumentation();
  instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACKSLASH);
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Instrumentation instrumentation=new Instrumentation();
    instrumentation.sendKeyDownUpSync(KeyEvent.KEYCODE_BACKSLASH);
  }
 catch (  SecurityException e) {
  }
}
Program: 93841
Project: 93841
Buggy source:
/** 
 * Sets the window function type.
 * @param windowType window function type. One of the {@link #WINDOW_RECTANGULAR = 0},   {@link #WINDOW_HANN},   {@link #WINDOW_HAMMING},    {@link #WINDOW_BLACKMAN},   {@link #WINDOW_FLAT_TOP} with optional {@link WINDOW_OPT_APPLY_FOR_WAVEFORM} flag.
 * @return {@link #SUCCESS} in case of success,{@link #ERROR_INVALID_OPERATION} or {@link #ERROR_DEAD_OBJECT} incase of failure.
 * @throws IllegalStateException
 */
int setWindowFunction(int windowType) throws IllegalStateException ;

Fixed version (ground truth):
/** 
 * Sets the window function type.
 * @param windowType window function type. One of the {@link #WINDOW_RECTANGULAR = 0},   {@link #WINDOW_HANN},   {@link #WINDOW_HAMMING},    {@link #WINDOW_BLACKMAN},   {@link #WINDOW_FLAT_TOP} with optional {@link #WINDOW_OPT_APPLY_FOR_WAVEFORM} flag.
 * @return {@link #SUCCESS} in case of success,{@link #ERROR_INVALID_OPERATION} or {@link #ERROR_DEAD_OBJECT} incase of failure.
 * @throws IllegalStateException
 */
int setWindowFunction(int windowType) throws IllegalStateException ;
Program: 93842
Project: 93842
Buggy source:
/** 
 * Retrieves the latest peak and RMS measurement. Sets the peak and RMS fields of the supplied   {@link Visualizer.MeasurementPeakRms} to thelatest measured values.
 * @param measurement a non-null {@link Visualizer.MeasurementPeakRms}instance to store the measurement values.
 * @return {@link #SUCCESS} in case of success, {@link #ERROR_BAD_VALUE},  {@link #ERROR_NO_MEMORY},   {@link #ERROR_INVALID_OPERATION} or{@link #ERROR_DEAD_OBJECT} in case of failure.
 */
int getMeasurementPeakRms(MeasurementPeakRms measurement);

Fixed version (ground truth):
/** 
 * Retrieves the latest peak and RMS measurement. Sets the peak and RMS fields of the supplied   {@link MeasurementPeakRms} to thelatest measured values.
 * @param measurement a non-null {@link MeasurementPeakRms}instance to store the measurement values.
 * @return {@link #SUCCESS} in case of success, {@link #ERROR_BAD_VALUE},  {@link #ERROR_NO_MEMORY},   {@link #ERROR_INVALID_OPERATION} or{@link #ERROR_DEAD_OBJECT} in case of failure.
 */
int getMeasurementPeakRms(MeasurementPeakRms measurement);
Program: 93843
Project: 93843
Buggy source:
private ILoudnessEnhancer createLoudnessEnhancer(){
  if (mLoudnessEnhancer == null) {
    try {
      mLoudnessEnhancer=mFactory.createLoudnessEnhancer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
  }
  return mLoudnessEnhancer;
}

Fixed version (ground truth):
private ILoudnessEnhancer createLoudnessEnhancer(){
  if (mLoudnessEnhancer == null) {
    try {
      mLoudnessEnhancer=mFactory.createLoudnessEnhancer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
catch (    IllegalArgumentException e) {
    }
  }
  return mLoudnessEnhancer;
}
Program: 93844
Project: 93844
Buggy source:
public IVisualizer createVisualizer(){
  if (mVisualizer == null) {
    try {
      mVisualizer=mFactory.createVisualizer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
  }
  return mVisualizer;
}

Fixed version (ground truth):
public IVisualizer createVisualizer(){
  if (mVisualizer == null) {
    try {
      mVisualizer=mFactory.createVisualizer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
catch (    IllegalArgumentException e) {
    }
  }
  return mVisualizer;
}
Program: 93845
Project: 93845
Buggy source:
private IPresetReverb createPresetReverb(){
  if (mPresetReverb == null) {
    try {
      mPresetReverb=mFactory.createPresetReverb();
    }
 catch (    UnsupportedOperationException e) {
    }
  }
  return mPresetReverb;
}

Fixed version (ground truth):
private IPresetReverb createPresetReverb(){
  if (mPresetReverb == null) {
    try {
      mPresetReverb=mFactory.createPresetReverb();
    }
 catch (    UnsupportedOperationException e) {
    }
catch (    IllegalArgumentException e) {
    }
  }
  return mPresetReverb;
}
Program: 93846
Project: 93846
Buggy source:
private IVirtualizer createVirtualizer(){
  if (mVirtualizer == null) {
    try {
      mVirtualizer=mFactory.createVirtualizer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
  }
  return mVirtualizer;
}

Fixed version (ground truth):
private IVirtualizer createVirtualizer(){
  if (mVirtualizer == null) {
    try {
      mVirtualizer=mFactory.createVirtualizer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
catch (    IllegalArgumentException e) {
    }
  }
  return mVirtualizer;
}
Program: 93847
Project: 93847
Buggy source:
private IEqualizer createEqualizer(){
  if (mEqualizer == null) {
    try {
      mEqualizer=mFactory.createEqualizer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
  }
  return mEqualizer;
}

Fixed version (ground truth):
private IEqualizer createEqualizer(){
  if (mEqualizer == null) {
    try {
      mEqualizer=mFactory.createEqualizer(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
catch (    IllegalArgumentException e) {
    }
  }
  return mEqualizer;
}
Program: 93848
Project: 93848
Buggy source:
private IBassBoost createBassBoost(){
  if (mBassBoost == null) {
    try {
      mBassBoost=mFactory.createBassBoost(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
  }
  return mBassBoost;
}

Fixed version (ground truth):
private IBassBoost createBassBoost(){
  if (mBassBoost == null) {
    try {
      mBassBoost=mFactory.createBassBoost(getPlayer(0));
    }
 catch (    UnsupportedOperationException e) {
    }
catch (    IllegalArgumentException e) {
    }
  }
  return mBassBoost;
}
Program: 93849
Project: 93849
Buggy source:
@Override protected void finalize() throws Throwable {
  release();
}

Fixed version (ground truth):
@Override protected void finalize() throws Throwable {
  super.finalize();
  release();
}
Program: 93850
Project: 93850
Buggy source:
static void closeQuietly(Closeable c){
  if (c != null) {
    try {
      c.close();
    }
 catch (    IOException e) {
      Log.w(TAG,"String_Node_Str" + e.getStackTrace());
    }
  }
}

Fixed version (ground truth):
static void closeQuietly(AssetFileDescriptor afd){
  if (afd != null) {
    try {
      afd.close();
    }
 catch (    IOException e) {
      Log.w(TAG,"String_Node_Str" + e.getStackTrace());
    }
  }
}
Program: 93851
Project: 93851
Buggy source:
protected static void closeQuietly(Closeable c){
  CommonTestCaseUtils.closeQuietly(c);
}

Fixed version (ground truth):
protected static void closeQuietly(InputStream is){
  CommonTestCaseUtils.closeQuietly(is);
}
Program: 93852
Project: 93852
Buggy source:
public static void closeQuietly(Closeable c){
  if (c == null)   return;
  try {
    c.close();
  }
 catch (  Exception e) {
  }
}

Fixed version (ground truth):
public static void closeQuietly(FileChannel is){
  if (is == null)   return;
  try {
    is.close();
  }
 catch (  Exception e) {
  }
}
Program: 93853
Project: 93853
Buggy source:
protected Context getContext(){
  return getInstrumentation().getContext();
}

Fixed version (ground truth):
protected Context getContext(){
  return getInstrumentation().getTargetContext();
}
Program: 93854
Project: 93854
Buggy source:
private void setUp(DrawerLayout drawerLayout,ViewGroup containerView){
  mFragmentContainerView=containerView;
  mDrawerLayout=drawerLayout;
  ActionBar actionBar=getActionBar();
  actionBar.setDisplayHomeAsUpEnabled(true);
  actionBar.setHomeButtonEnabled(true);
  mDrawerToggle=new ActionBarDrawerToggle(getActivity(),mDrawerLayout,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().supportInvalidateOptionsMenu();
    }
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().supportInvalidateOptionsMenu();
    }
  }
;
  mDrawerLayout.post(new Runnable(){
    @Override public void run(){
      mDrawerToggle.syncState();
    }
  }
);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
}

Fixed version (ground truth):
private void setUp(DrawerLayout drawerLayout,ViewGroup containerView){
  mFragmentContainerView=containerView;
  mDrawerLayout=drawerLayout;
  mDrawerToggle=new ActionBarDrawerToggle(getActivity(),mDrawerLayout,R.string.navigation_drawer_open,R.string.navigation_drawer_close){
    @Override public void onDrawerClosed(    View drawerView){
      super.onDrawerClosed(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().supportInvalidateOptionsMenu();
    }
    @Override public void onDrawerOpened(    View drawerView){
      super.onDrawerOpened(drawerView);
      if (!isAdded()) {
        return;
      }
      getActivity().supportInvalidateOptionsMenu();
    }
  }
;
  mDrawerLayout.post(new Runnable(){
    @Override public void run(){
      mDrawerToggle.syncState();
    }
  }
);
  mDrawerLayout.setDrawerListener(mDrawerToggle);
}
Program: 93855
Project: 93855
Buggy source:
long crc32(long address,long offset,long len){
  CRC32 crc=new CRC32();
  for (; len-- > 0; len--, offset++)   crc.update(Uns.getByte(address,offset));
  long h=crc.getValue();
  h|=h << 32;
  return h;
}

Fixed version (ground truth):
long crc32(long address,long offset,long len){
  CRC32 crc=new CRC32();
  for (; len-- > 0; offset++)   crc.update(Uns.getByte(address,offset));
  long h=crc.getValue();
  h|=h << 32;
  return h;
}
Program: 93856
Project: 93856
Buggy source:
static boolean compare(long hashEntryAdr,long offset,long otherHashEntryAdr,long otherOffset,long len){
  if (hashEntryAdr == 0L)   return false;
  int p=0;
  for (; p <= len - 8; p+=8, offset+=8, otherOffset+=8)   if (Uns.getLong(hashEntryAdr,offset) != Uns.getLong(otherHashEntryAdr,otherOffset))   return false;
  for (; p <= len - 4; p+=4, offset+=4, otherOffset+=4)   if (Uns.getInt(hashEntryAdr,offset) != Uns.getInt(otherHashEntryAdr,otherOffset))   return false;
  for (; p <= len - 2; p+=2, offset+=2, otherOffset+=2)   if (Uns.getShort(hashEntryAdr,offset) != Uns.getShort(otherHashEntryAdr,otherOffset))   return false;
  for (; p < len; p++, offset++, otherOffset++)   if (Uns.getByte(hashEntryAdr,offset) != Uns.getByte(otherHashEntryAdr,otherOffset))   return false;
  return true;
}

Fixed version (ground truth):
static boolean compare(long hashEntryAdr,long offset,long otherHashEntryAdr,long otherOffset,long len){
}
Program: 93857
Project: 93857
Buggy source:
public boolean commit(){
  if (closed)   return false;
  closed=true;
  if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,false,0L,0L))   return true;
  Uns.free(hashEntryAdr);
  return false;
}

Fixed version (ground truth):
public boolean commit(){
  if (closed)   return false;
  if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,false,0L,0L,0L)) {
    closed=true;
    return true;
  }
  super.close();
  return false;
}
Program: 93858
Project: 93858
Buggy source:
private boolean putInternal(K k,V v,boolean ifAbsent,V old){
  if (k == null || v == null)   throw new NullPointerException();
  long keyLen=keySerializer.serializedSize(k);
  long valueLen=valueSerializer.serializedSize(v);
  long bytes=Util.allocLen(keyLen,valueLen);
  long oldValueAdr=0L;
  long oldValueLen=0L;
  try {
    if (old != null) {
      oldValueLen=valueSerializer.serializedSize(old);
      oldValueAdr=Uns.allocate(oldValueLen,throwOOME);
      if (oldValueAdr == 0L)       throw new RuntimeException("String_Node_Str" + oldValueLen + "String_Node_Str");
      try {
        valueSerializer.serialize(old,new HashEntryValueOutput(oldValueAdr,oldValueLen));
      }
 catch (      RuntimeException|Error e) {
        throw e;
      }
catch (      Throwable e) {
        throw new RuntimeException(e);
      }
    }
    long hashEntryAdr;
    if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
      putFailCount++;
      remove(k);
      return false;
    }
    long hash=serializeForPut(k,v,keyLen,valueLen,hashEntryAdr);
    HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
    if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,ifAbsent,oldValueAdr,oldValueLen))     return true;
    Uns.free(hashEntryAdr);
    return false;
  }
  finally {
    Uns.free(oldValueAdr);
  }
}

Fixed version (ground truth):
private boolean putInternal(K k,V v,boolean ifAbsent,V old){
  if (k == null || v == null)   throw new NullPointerException();
  long keyLen=keySerializer.serializedSize(k);
  long valueLen=valueSerializer.serializedSize(v);
  long bytes=Util.allocLen(keyLen,valueLen);
  long oldValueAdr=0L;
  long oldValueLen=0L;
  try {
    if (old != null) {
      oldValueLen=valueSerializer.serializedSize(old);
      oldValueAdr=Uns.allocate(oldValueLen,throwOOME);
      if (oldValueAdr == 0L)       throw new RuntimeException("String_Node_Str" + oldValueLen + "String_Node_Str");
      try {
        valueSerializer.serialize(old,new HashEntryValueOutput(oldValueAdr,oldValueLen));
      }
 catch (      RuntimeException|Error e) {
        throw e;
      }
catch (      Throwable e) {
        throw new RuntimeException(e);
      }
    }
    long hashEntryAdr;
    if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
      putFailCount++;
      remove(k);
      return false;
    }
    long hash=serializeForPut(k,v,keyLen,valueLen,hashEntryAdr);
    HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
    if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,ifAbsent,oldValueAdr,0L,oldValueLen))     return true;
    Uns.free(hashEntryAdr);
    return false;
  }
  finally {
    Uns.free(oldValueAdr);
  }
}
Program: 93859
Project: 93859
Buggy source:
public DirectValueAccess putIfAbsentDirect(K k,long valueLen){
  if (k == null)   throw new NullPointerException();
  final long keyLen=keySerializer.serializedSize(k);
  final long bytes=Util.allocLen(keyLen,valueLen);
  final long hashEntryAdr;
  if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
    putFailCount++;
    return null;
  }
  final long hash=serializeForPut(k,null,keyLen,valueLen,hashEntryAdr);
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  if (segment(hash).hasEntry(hashEntryAdr,hash,keyLen))   return null;
  return new DirectValueAccessImpl(hashEntryAdr,keyLen,valueLen,false){
    public void close(){
      commit();
    }
    public boolean commit(){
      if (closed)       return false;
      closed=true;
      if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,true,0L,0L))       return true;
      Uns.free(hashEntryAdr);
      return false;
    }
  }
;
}

Fixed version (ground truth):
public DirectValueAccess putIfAbsentDirect(K k,long valueLen){
  if (k == null)   throw new NullPointerException();
  final long keyLen=keySerializer.serializedSize(k);
  final long bytes=Util.allocLen(keyLen,valueLen);
  final long hashEntryAdr;
  if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
    putFailCount++;
    return null;
  }
  final long hash=serializeForPut(k,null,keyLen,valueLen,hashEntryAdr);
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  if (segment(hash).hasEntry(hashEntryAdr,hash,keyLen)) {
    Uns.free(hashEntryAdr);
    return null;
  }
  return new DirectValueAccessImpl(hashEntryAdr,keyLen,valueLen,false){
    public void close(){
      commit();
    }
    public boolean commit(){
      if (closed)       return false;
      if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,true,0L,0L,0L)) {
        closed=true;
        return true;
      }
      super.close();
      return false;
    }
  }
;
}
Program: 93860
Project: 93860
Buggy source:
public DirectValueAccess addOrReplaceDirect(K k,DirectValueAccess old,long valueLen){
  if (k == null)   throw new NullPointerException();
  final DirectValueAccessImpl oldImpl=(DirectValueAccessImpl)old;
  if (oldImpl != null && oldImpl.closed)   throw new IllegalStateException("String_Node_Str");
  final long keyLen=keySerializer.serializedSize(k);
  final long bytes=Util.allocLen(keyLen,valueLen);
  final long hashEntryAdr;
  if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
    putFailCount++;
    remove(k);
    return null;
  }
  final long hash=serializeForPut(k,null,keyLen,valueLen,hashEntryAdr);
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  if (!segment(hash).hasEntry(hashEntryAdr,hash,keyLen))   return null;
  return new DirectValueAccessImpl(hashEntryAdr,keyLen,valueLen,false){
    public void close(){
      commit();
    }
    public boolean commit(){
      if (closed)       return false;
      closed=true;
      if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,false,oldImpl != null ? oldImpl.valueAdr() : 0L,oldImpl != null ? oldImpl.valueLen() : 0L))       return true;
      Uns.free(hashEntryAdr);
      return false;
    }
  }
;
}

Fixed version (ground truth):
public DirectValueAccess addOrReplaceDirect(K k,DirectValueAccess old,long valueLen){
  if (k == null)   throw new NullPointerException();
  final DirectValueAccessImpl oldImpl=(DirectValueAccessImpl)old;
  if (oldImpl != null && oldImpl.closed)   throw new IllegalStateException("String_Node_Str");
  final long keyLen=keySerializer.serializedSize(k);
  final long bytes=Util.allocLen(keyLen,valueLen);
  final long hashEntryAdr;
  if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
    putFailCount++;
    remove(k);
    return null;
  }
  final long hash=serializeForPut(k,null,keyLen,valueLen,hashEntryAdr);
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  if (!segment(hash).hasEntry(hashEntryAdr,hash,keyLen)) {
    Uns.free(hashEntryAdr);
    return null;
  }
  return new DirectValueAccessImpl(hashEntryAdr,keyLen,valueLen,false){
    public void close(){
      commit();
    }
    public boolean commit(){
      if (closed)       return false;
      if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,false,oldImpl != null ? oldImpl.hashEntryAdr() : 0L,oldImpl != null ? oldImpl.valueOffset() : 0L,oldImpl != null ? oldImpl.valueLen() : 0L)) {
        closed=true;
        return true;
      }
      super.close();
      return false;
    }
  }
;
}
Program: 93861
Project: 93861
Buggy source:
public boolean deserializeEntry(ReadableByteChannel channel) throws IOException {
  byte[] hashKeyValueLen=new byte[3 * 8];
  ByteBuffer bb=ByteBuffer.wrap(hashKeyValueLen);
  if (!Util.readFully(channel,bb))   return false;
  long hash=Uns.getLongFromByteArray(hashKeyValueLen,0);
  long valueLen=Uns.getLongFromByteArray(hashKeyValueLen,8);
  long keyLen=Uns.getLongFromByteArray(hashKeyValueLen,16);
  long kvLen=Util.roundUpTo8(keyLen) + valueLen;
  long totalLen=kvLen + Util.ENTRY_OFF_DATA;
  long hashEntryAdr;
  if ((maxEntrySize > 0L && totalLen > maxEntrySize) || (hashEntryAdr=Uns.allocate(totalLen,throwOOME)) == 0L) {
    if (channel instanceof SeekableByteChannel) {
      SeekableByteChannel sc=(SeekableByteChannel)channel;
      sc.position(sc.position() + kvLen);
    }
 else {
      ByteBuffer tmp=ByteBuffer.allocate(8192);
      while (kvLen > 0L) {
        tmp.clear();
        if (kvLen < tmp.capacity())         tmp.limit((int)kvLen);
        if (!Util.readFully(channel,tmp))         return false;
        kvLen-=tmp.limit();
      }
    }
    return false;
  }
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  if (!Util.readFully(channel,Uns.directBufferFor(hashEntryAdr,Util.ENTRY_OFF_DATA,kvLen,false)) || !segment(hash).putEntry(hashEntryAdr,hash,keyLen,totalLen,false,0L,0L)) {
    Uns.free(hashEntryAdr);
    return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean deserializeEntry(ReadableByteChannel channel) throws IOException {
  byte[] hashKeyValueLen=new byte[3 * 8];
  ByteBuffer bb=ByteBuffer.wrap(hashKeyValueLen);
  if (!Util.readFully(channel,bb))   return false;
  long hash=Uns.getLongFromByteArray(hashKeyValueLen,0);
  long valueLen=Uns.getLongFromByteArray(hashKeyValueLen,8);
  long keyLen=Uns.getLongFromByteArray(hashKeyValueLen,16);
  long kvLen=Util.roundUpTo8(keyLen) + valueLen;
  long totalLen=kvLen + Util.ENTRY_OFF_DATA;
  long hashEntryAdr;
  if ((maxEntrySize > 0L && totalLen > maxEntrySize) || (hashEntryAdr=Uns.allocate(totalLen,throwOOME)) == 0L) {
    if (channel instanceof SeekableByteChannel) {
      SeekableByteChannel sc=(SeekableByteChannel)channel;
      sc.position(sc.position() + kvLen);
    }
 else {
      ByteBuffer tmp=ByteBuffer.allocate(8192);
      while (kvLen > 0L) {
        tmp.clear();
        if (kvLen < tmp.capacity())         tmp.limit((int)kvLen);
        if (!Util.readFully(channel,tmp))         return false;
        kvLen-=tmp.limit();
      }
    }
    return false;
  }
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  if (!Util.readFully(channel,Uns.directBufferFor(hashEntryAdr,Util.ENTRY_OFF_DATA,kvLen,false)) || !segment(hash).putEntry(hashEntryAdr,hash,keyLen,totalLen,false,0L,0L,0L)) {
    Uns.free(hashEntryAdr);
    return false;
  }
  return true;
}
Program: 93863
Project: 93863
Buggy source:
public DirectValueAccess putDirect(K k,long valueLen){
  if (k == null)   throw new NullPointerException();
  final long keyLen=keySerializer.serializedSize(k);
  final long bytes=Util.allocLen(keyLen,valueLen);
  final long hashEntryAdr;
  if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
    putFailCount++;
    remove(k);
    return null;
  }
  final long hash=serializeForPut(k,null,keyLen,valueLen,hashEntryAdr);
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  return new DirectValueAccessImpl(hashEntryAdr,keyLen,valueLen,false){
    public void close(){
      commit();
    }
    public boolean commit(){
      if (closed)       return false;
      closed=true;
      if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,false,0L,0L))       return true;
      Uns.free(hashEntryAdr);
      return false;
    }
  }
;
}

Fixed version (ground truth):
public DirectValueAccess putDirect(K k,long valueLen){
  if (k == null)   throw new NullPointerException();
  final long keyLen=keySerializer.serializedSize(k);
  final long bytes=Util.allocLen(keyLen,valueLen);
  final long hashEntryAdr;
  if ((maxEntrySize > 0L && bytes > maxEntrySize) || (hashEntryAdr=Uns.allocate(bytes,throwOOME)) == 0L) {
    putFailCount++;
    remove(k);
    return null;
  }
  final long hash=serializeForPut(k,null,keyLen,valueLen,hashEntryAdr);
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr,Util.SENTINEL_NOT_PRESENT);
  return new DirectValueAccessImpl(hashEntryAdr,keyLen,valueLen,false){
    public void close(){
      commit();
    }
    public boolean commit(){
      if (closed)       return false;
      if (segment(hash).putEntry(hashEntryAdr,hash,keyLen,bytes,false,0L,0L,0L)) {
        closed=true;
        return true;
      }
      super.close();
      return false;
    }
  }
;
}
Program: 93865
Project: 93865
Buggy source:
static void clearUnsDebugForTest(){
  if (__DEBUG_OFF_HEAP_MEMORY_ACCESS) {
    try {
      if (!ohDebug.isEmpty()) {
        for (        Map.Entry<Long,AllocInfo> addrSize : ohDebug.entrySet()) {
          System.err.printf("String_Node_Str",addrSize.getKey(),addrSize.getValue().size);
          addrSize.getValue().trace.printStackTrace();
        }
        throw new RuntimeException("String_Node_Str");
      }
    }
  finally {
      ohDebug.clear();
      ohFreeDebug.clear();
    }
  }
}

Fixed version (ground truth):
static void clearUnsDebugForTest(){
  if (__DEBUG_OFF_HEAP_MEMORY_ACCESS) {
    try {
      if (!ohDebug.isEmpty()) {
        for (        Map.Entry<Long,AllocInfo> addrSize : ohDebug.entrySet()) {
          System.err.printf("String_Node_Str",addrSize.getKey(),addrSize.getValue().size,getInt(addrSize.getKey(),Util.ENTRY_OFF_REFCOUNT));
          addrSize.getValue().trace.printStackTrace();
        }
        throw new RuntimeException("String_Node_Str");
      }
    }
  finally {
      ohDebug.clear();
      ohFreeDebug.clear();
    }
  }
}
Program: 93867
Project: 93867
Buggy source:
synchronized long[] hotN(int n){
  long[] r=new long[n];
  int i=0;
  for (long hashEntryAdr=lruHead; hashEntryAdr != 0L; hashEntryAdr=getLruNext(hashEntryAdr)) {
    r[i++]=hashEntryAdr;
    HashEntries.reference(hashEntryAdr);
  }
  return r;
}

Fixed version (ground truth):
synchronized long[] hotN(int n){
  long[] r=new long[n];
  int i=0;
  for (long hashEntryAdr=lruHead; hashEntryAdr != 0L && i < n; hashEntryAdr=getLruNext(hashEntryAdr)) {
    r[i++]=hashEntryAdr;
    HashEntries.reference(hashEntryAdr);
  }
  return r;
}
Program: 93868
Project: 93868
Buggy source:
private void dereference(long hashEntryAdr){
  if (HashEntries.dereference(hashEntryAdr))   free(hashEntryAdr);
}

Fixed version (ground truth):
private void dereference(long hashEntryAdr){
  if (HashEntries.dereference(hashEntryAdr)) {
    if (hashEntryAdr == 0L)     throw new NullPointerException();
    long bytes=HashEntries.getAllocLen(hashEntryAdr);
    if (bytes == 0L)     throw new IllegalStateException();
    long hash=HashEntries.getHash(hashEntryAdr);
    Uns.free(hashEntryAdr);
    segment(hash).freed(bytes);
  }
}
Program: 93869
Project: 93869
Buggy source:
private PutResult put(K k,V v,boolean ifAbsent){
  KeyBuffer key=keySource(k);
  long keyLen=key.size();
  long valueLen=valueSerializer.serializedSize(v);
  long hash=key.hash();
  long bytes=allocLen(keyLen,valueLen);
  long hashEntryAdr;
  if (bytes > maxEntrySize || (hashEntryAdr=Uns.allocate(bytes)) == 0L) {
    if (statisticsEnabled)     putFailCount++;
    removeInternal(key);
    return PutResult.FAIL;
  }
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr);
  HashEntries.toOffHeap(key,hashEntryAdr,ENTRY_OFF_DATA);
  try {
    valueSerializer.serialize(v,new HashEntryValueOutput(hashEntryAdr,key.size(),valueLen));
  }
 catch (  Error e) {
    Uns.free(hashEntryAdr);
    throw e;
  }
catch (  Throwable e) {
    Uns.free(hashEntryAdr);
    throw new IOError(e);
  }
  return segment(hash).putEntry(key,hashEntryAdr,bytes,ifAbsent) ? PutResult.OK : PutResult.KEY_PRESENT;
}

Fixed version (ground truth):
private PutResult put(K k,V v,boolean ifAbsent){
  KeyBuffer key=keySource(k);
  long keyLen=key.size();
  long valueLen=valueSerializer.serializedSize(v);
  long hash=key.hash();
  long bytes=allocLen(keyLen,valueLen);
  long hashEntryAdr;
  if (bytes > maxEntrySize || (hashEntryAdr=Uns.allocate(bytes)) == 0L) {
    putFailCount++;
    removeInternal(key);
    return PutResult.FAIL;
  }
  HashEntries.init(hash,keyLen,valueLen,hashEntryAdr);
  HashEntries.toOffHeap(key,hashEntryAdr,ENTRY_OFF_DATA);
  try {
    valueSerializer.serialize(v,new HashEntryValueOutput(hashEntryAdr,key.size(),valueLen));
  }
 catch (  Error e) {
    Uns.free(hashEntryAdr);
    throw e;
  }
catch (  Throwable e) {
    Uns.free(hashEntryAdr);
    throw new IOError(e);
  }
  return segment(hash).putEntry(key,hashEntryAdr,bytes,ifAbsent) ? PutResult.OK : PutResult.KEY_PRESENT;
}
Program: 93871
Project: 93871
Buggy source:
public void put(K k,V v){
  assertNotClosed();
  if (valueSerializer == null)   throw new NullPointerException("String_Node_Str");
  BytesSource.ByteArraySource ks=keySource(k);
  int hash=ks.hashCode();
  long valueLen=valueSerializer.serializedSize(v);
  long newHashEntryAdr=hashEntryAccess.createNewEntryChain(hash,ks,null,valueLen);
  if (newHashEntryAdr == 0L)   return;
  try {
    hashEntryAccess.valueToHashEntry(newHashEntryAdr,valueSerializer,v,ks.size(),valueLen);
  }
 catch (  IOException e) {
    freeBlocks.freeChain(newHashEntryAdr);
    throw new IOError(e);
  }
  putInternal(hash,ks,null,newHashEntryAdr);
}

Fixed version (ground truth):
public void put(K k,V v){
  assertNotClosed();
  if (valueSerializer == null)   throw new NullPointerException("String_Node_Str");
  BytesSource.ByteArraySource ks=keySource(k);
  int hash=ks.hashCode();
  long valueLen=valueSerializer.serializedSize(v);
  long newHashEntryAdr=hashEntryAccess.createNewEntryChain(hash,ks,null,valueLen);
  if (newHashEntryAdr == 0L) {
    remove(ks.hashCode(),ks);
    return;
  }
  try {
    hashEntryAccess.valueToHashEntry(newHashEntryAdr,valueSerializer,v,ks.size(),valueLen);
  }
 catch (  IOException e) {
    freeBlocks.freeChain(newHashEntryAdr);
    throw new IOError(e);
  }
  putInternal(hash,ks,null,newHashEntryAdr);
}
Program: 93873
Project: 93873
Buggy source:
/** 
 * Constructs a new <tt>SuperCsvException</tt>.
 * @param msg the exception message
 * @param context the CSV context
 * @param t the nested exception
 */
public SuperCsvException(final String msg,final CsvContext context,final Throwable t){
  super(msg,t);
  this.csvContext=context;
}

Fixed version (ground truth):
/** 
 * Constructs a new <tt>SuperCsvException</tt>.
 * @param msg the exception message
 * @param context the CSV context
 * @param t the nested exception
 */
public SuperCsvException(final String msg,final CsvContext context,final Throwable t){
  super(msg,t);
  if (context != null) {
    this.csvContext=context.clone();
  }
}
Program: 93875
Project: 93875
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Object execute(final Object value,final CSVContext context) throws SuperCSVException {
  if (value == null) {
    throw new NullInputException("String_Node_Str",context,this);
  }
  return value.toString().replaceAll(searchText,replaceText);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Object execute(final Object value,final CSVContext context) throws SuperCSVException {
  if (value == null) {
    throw new NullInputException("String_Node_Str",context,this);
  }
  String result=value.toString().replaceAll(searchText,replaceText);
  return next.execute(result,context);
}
Program: 93876
Project: 93876
Buggy source:
@Override public String toString(){
  return getMessage() + "String_Node_Str" + csvContext.toString()+ "String_Node_Str"+ offendingProcessor;
}

Fixed version (ground truth):
@Override public String toString(){
  return String.format("String_Node_Str",getMessage(),csvContext,offendingProcessor);
}
Program: 93877
Project: 93877
Buggy source:
/** 
 * @param destinationObject the object on which to call the method
 * @param methodPrefix "get" (not used with "set" anymore due to overloading lookup
 * @param variableName specifies method to search for
 * @param requiredNumberOfArgs the number of arguments the method to search for has to have
 * @return
 */
private Method inspectClass(final Object destinationObject,final String methodPrefix,final String variableName,final int requiredNumberOfArgs){
  final String methodName=methodPrefix + variableName.substring(0,1).toUpperCase() + variableName.substring(1);
  for (  final Method meth : destinationObject.getClass().getMethods()) {
    if (meth.getName().equals(methodName) && meth.getParameterTypes().length == requiredNumberOfArgs) {
      return meth;
    }
  }
  throw new SuperCSVReflectionException(String.format("String_Node_Str",methodName,destinationObject.getClass().getName()));
}

Fixed version (ground truth):
/** 
 * @param destinationObject the object on which to call the method
 * @param methodPrefix "get" (not used with "set" anymore due to overloading lookup
 * @param variableName specifies method to search for
 * @param requiredNumberOfArgs the number of arguments the method to search for has to have
 * @return
 */
private Method inspectClass(final Object destinationObject,final String methodPrefix,final String variableName,final int requiredNumberOfArgs){
  final String methodName=methodPrefix + variableName.substring(0,1).toUpperCase() + variableName.substring(1);
  for (  final Method meth : destinationObject.getClass().getMethods()) {
    if (meth.getName().equals(methodName) && meth.getParameterTypes().length == requiredNumberOfArgs) {
      System.out.println("String_Node_Str" + meth.toString());
      return meth;
    }
  }
  throw new SuperCSVReflectionException(String.format("String_Node_Str",methodName,destinationObject.getClass().getName()));
}
Program: 93878
Project: 93878
Buggy source:
public <T>Method getSetMethod(final Object destinationObject,final String variableName,final Class<?> variableType){
  Method method=setMethodsCache.get(destinationObject.getClass(),variableType,variableName);
  if (method == null) {
    if (variableType == null) {
      method=inspectClass(destinationObject,"String_Node_Str",variableName,1);
    }
 else {
      method=inspectClassForSetMethods(destinationObject,variableType,variableName);
    }
    setMethodsCache.set(destinationObject.getClass(),variableType,variableName,method);
  }
  return method;
}

Fixed version (ground truth):
public <T>Method getSetMethod(final Object destinationObject,final String variableName,final Class<?> variableType){
  Method method=setMethodsCache.get(destinationObject.getClass(),variableType,variableName);
  if (method == null) {
    if (variableType == null) {
      method=findSetMethodWithNonPrimitiveParameter(destinationObject,variableName);
    }
 else {
      method=inspectClassForSetMethods(destinationObject,variableType,variableName);
    }
    setMethodsCache.set(destinationObject.getClass(),variableType,variableName,method);
  }
  return method;
}
Program: 93879
Project: 93879
Buggy source:
/** 
 * @param source
 * @param nameMapping
 * @return A filled object
 * @throws IllegalAccessException
 * @throws InvocationTargetException
 */
protected void fillListFromObject(final Object source,final String[] nameMapping) throws IllegalAccessException, InvocationTargetException {
  result.clear();
  for (  final String methodName : nameMapping) {
    result.add(cache.getGetMethod(source,methodName).invoke(source));
  }
}

Fixed version (ground truth):
/** 
 * populate <tt>result</tt> based on the source
 * @param source
 * @param nameMapping
 * @throws IllegalAccessException
 * @throws InvocationTargetException
 */
protected void fillListFromObject(final Object source,final String[] nameMapping) throws IllegalAccessException, InvocationTargetException {
  result.clear();
  for (  final String methodName : nameMapping) {
    result.add(cache.getGetMethod(source,methodName).invoke(source));
  }
}
Program: 93880
Project: 93880
Buggy source:
/** 
 * Set the manufacturer data
 * @deprecated Please don't use anymore. Use {@link #addManufacturerData(short,byte[])} instead.
 */
@Deprecated public final BleScanInfo setManufacturerData(byte[] data){
  m_manufacturerData=data;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the manufacturer data
 * @deprecated Please don't use anymore. Use {@link #addManufacturerData(short,byte[])} instead.
 */
@Deprecated public final BleScanInfo setManufacturerData(byte[] data){
  m_manufacturerData=data;
  if (m_tempManData == null)   m_tempManData=new ManufacturerData();
  m_tempManData.m_data=data;
  return this;
}
Program: 93881
Project: 93881
Buggy source:
/** 
 * Build a byte[] scan record from the data stored in this instance.
 */
public final byte[] buildPacket(){
  Map<BleUuid,byte[]> map=new HashMap<>(m_serviceUuids.size() + m_serviceData.size());
  if (m_serviceUuids.size() > 0) {
    for (    BleUuid u : m_serviceUuids) {
      map.put(u,null);
    }
  }
  if (m_serviceData.size() > 0) {
    for (    UUID u : m_serviceData.keySet()) {
      map.put(new BleUuid(u,BleUuid.UuidSize.SHORT),m_serviceData.get(u));
    }
  }
  if (m_manufactuerId != null) {
    ManufacturerData data=new ManufacturerData();
    data.m_id=m_manufactuerId;
    if (m_manufacturerData != null) {
      data.m_data=m_manufacturerData;
    }
    m_manufacturerDataList.add(data);
  }
  byte flags=m_advFlags.value != null ? m_advFlags.value.byteValue() : 0;
  byte tx=m_txPower.value != null ? m_txPower.value.byteValue() : 0;
  return Utils_ScanRecord.newScanRecord(flags,map,m_completeUuidList,m_localName,m_shortName,tx,m_manufacturerDataList);
}

Fixed version (ground truth):
/** 
 * Build a byte[] scan record from the data stored in this instance.
 */
public final byte[] buildPacket(){
  Map<BleUuid,byte[]> map=new HashMap<>(m_serviceUuids.size() + m_serviceData.size());
  if (m_serviceUuids.size() > 0) {
    for (    BleUuid u : m_serviceUuids) {
      map.put(u,null);
    }
  }
  if (m_serviceData.size() > 0) {
    for (    UUID u : m_serviceData.keySet()) {
      map.put(new BleUuid(u,BleUuid.UuidSize.SHORT),m_serviceData.get(u));
    }
  }
  if (m_tempManData != null) {
    m_manufacturerDataList.add(m_tempManData);
  }
  byte flags=m_advFlags.value != null ? m_advFlags.value.byteValue() : 0;
  byte tx=m_txPower.value != null ? m_txPower.value.byteValue() : 0;
  return Utils_ScanRecord.newScanRecord(flags,map,m_completeUuidList,m_localName,m_shortName,tx,m_manufacturerDataList);
}
Program: 93882
Project: 93882
Buggy source:
/** 
 * Set the manufacturer Id
 * @deprecated Please don't use anymore. Use {@link #addManufacturerData(short,byte[])} instead.
 */
@Deprecated public final BleScanInfo setManufacturerId(short id){
  m_manufactuerId=id;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the manufacturer Id
 * @deprecated Please don't use anymore. Use {@link #addManufacturerData(short,byte[])} instead.
 */
@Deprecated public final BleScanInfo setManufacturerId(short id){
  m_manufactuerId=id;
  if (m_tempManData == null)   m_tempManData=new ManufacturerData();
  m_tempManData.m_id=id;
  return this;
}
Program: 93883
Project: 93883
Buggy source:
@Override public void onScanFailed(int errorCode){
  m_manager.getLogger().e(Utils_String.concatStrings("String_Node_Str",String.valueOf(errorCode)));
  if (errorCode != SCAN_FAILED_ALREADY_STARTED) {
    fail();
  }
 else {
    tryClassicDiscovery(PA_StateTracker.E_Intent.UNINTENTIONAL,false);
    m_mode=Mode_CLASSIC;
  }
}

Fixed version (ground truth):
@Override public void onScanFailed(int errorCode){
  if (errorCode == SCAN_FAILED_ALREADY_STARTED) {
    m_manager.ASSERT(false,"String_Node_Str");
  }
 else {
    m_manager.getLogger().e(Utils_String.concatStrings("String_Node_Str",String.valueOf(errorCode)));
    if (m_manager.m_config.revertToClassicDiscoveryIfNeeded) {
      m_manager.getLogger().i("String_Node_Str");
      tryClassicDiscovery(PA_StateTracker.E_Intent.UNINTENTIONAL,false);
      m_mode=Mode_CLASSIC;
    }
 else     fail();
  }
}