nus-yam/ex-repair huggingface dataset:
Program: 26279
Project: 26279
Buggy source:
public ApiRequest getDirectory(Response.Listener<Directory> successListener,Response.ErrorListener errorListener){
  GsonRequest<Void,Directory> dirReq=new GsonRequest<Void,Directory>(Request.Method.POST,DIRECTORY_URL,Directory.class,successListener,errorListener,GsonRequest.getGson(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES));
  return new ApiRequest(dirReq);
}

Fixed version (ground truth):
public ApiRequest getDirectory(Response.Listener<Directory> successListener,Response.ErrorListener errorListener){
  GsonRequest<Void,Directory> dirReq=new GsonRequest<Void,Directory>(Request.Method.GET,DIRECTORY_URL,Directory.class,successListener,errorListener,GsonRequest.getGson(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES));
  return new ApiRequest(dirReq);
}
Program: 26280
Project: 26280
Buggy source:
private void populatePhoto(ViewHolder mViewHolder,ViewGroup container,Activity.PlusObject.Attachments attachment){
  if (attachment == null)   return;
  createAttachmentView(mViewHolder,container,R.layout.news_item_photo,3);
  mViewHolder.photo.setDimensions(attachment.getImage().getWidth(),attachment.getImage().getHeight(),attachment.getImage().getUrl());
  mViewHolder.photo.setImageDrawable(null);
  App.getInstance().getPicasso().load(attachment.getImage().getUrl()).into(mViewHolder.photo);
}

Fixed version (ground truth):
private void populatePhoto(ViewHolder mViewHolder,ViewGroup container,Activity.PlusObject.Attachments attachment){
  if (attachment == null)   return;
  createAttachmentView(mViewHolder,container,R.layout.news_item_photo,3);
  if (attachment.getImage() != null && attachment.getImage().getUrl() != null && attachment.getImage().getWidth() != null)   mViewHolder.photo.setDimensions(attachment.getImage().getWidth(),attachment.getImage().getHeight(),attachment.getImage().getUrl());
  mViewHolder.photo.setImageDrawable(null);
  App.getInstance().getPicasso().load(attachment.getImage().getUrl()).into(mViewHolder.photo);
}
Program: 26282
Project: 26282
Buggy source:
@Override public void onBackPressed(){
  if (mViewPager.getCurrentItem() > 0)   mViewPager.setCurrentItem(mViewPager.getCurrentItem() - 1,true);
 else   super.onBackPressed();
}

Fixed version (ground truth):
@Override public void onBackPressed(){
  if (mViewPager.getCurrentItem() > 0)   mViewPager.setCurrentItem(mViewPager.getCurrentItem() - 1,true);
 else   super.finish();
}
Program: 26283
Project: 26283
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  SharedPreferences mPreferences=getSharedPreferences("String_Node_Str",MODE_PRIVATE);
  if (mPreferences.getBoolean(Const.SETTINGS_FIRST_START,true)) {
    Intent firstStartIntent=new Intent(StartActivity.this,FirstStartActivity.class);
    startActivity(firstStartIntent);
  }
 else {
    Intent mainIntent=new Intent(StartActivity.this,MainActivity.class);
    startActivity(mainIntent);
  }
  finish();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  SharedPreferences mPreferences=getSharedPreferences("String_Node_Str",MODE_PRIVATE);
  Intent intentForStart=null;
  if (mPreferences.getBoolean(Const.SETTINGS_FIRST_START,true))   intentForStart=new Intent(StartActivity.this,FirstStartActivity.class);
 else   intentForStart=new Intent(StartActivity.this,MainActivity.class);
  startActivity(intentForStart);
  finish();
}
Program: 26284
Project: 26284
Buggy source:
@Override public DateTime deserialize(JsonElement jsonElement,Type type,JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
  DateTimeFormatter fmt=DateTimeFormat.forPattern("String_Node_Str");
  return fmt.parseDateTime(jsonElement.getAsJsonPrimitive().getAsString());
}

Fixed version (ground truth):
@Override public DateTime deserialize(JsonElement jsonElement,Type type,JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
  DateTimeFormatter fmt=DateTimeFormat.forPattern("String_Node_Str").withLocale(Locale.ENGLISH);
  return fmt.parseDateTime(jsonElement.getAsJsonPrimitive().getAsString());
}
Program: 26285
Project: 26285
Buggy source:
@Override public void onResponse(Directory directory){
  App.getInstance().getModelCache().putAsync("String_Node_Str",directory,DateTime.now().plusDays(4));
  addChapters(directory.getGroups());
  mChapterSpinner.setAdapter(mSpinnerAdapter);
  mLoadSwitcher.setDisplayedChild(1);
}

Fixed version (ground truth):
@Override public void onResponse(Directory directory){
  App.getInstance().getModelCache().putAsync("String_Node_Str",directory,DateTime.now().plusDays(4));
  addChapters(directory.getGroups());
  mLoadSwitcher.setDisplayedChild(1);
}
Program: 26287
Project: 26287
Buggy source:
private void addChapters(List<Chapter> chapterList){
  Collections.sort(chapterList,mLocationComparator);
  mSpinnerAdapter.clear();
  mSpinnerAdapter.addAll(chapterList);
}

Fixed version (ground truth):
private void addChapters(List<Chapter> chapterList){
  Collections.sort(chapterList,mLocationComparator);
  mSpinnerAdapter.clear();
  mSpinnerAdapter.addAll(chapterList);
  mChapterSpinner.setAdapter(mSpinnerAdapter);
  if (mSelectedChapter != null) {
    int pos=mSpinnerAdapter.getPosition(mSelectedChapter);
    mChapterSpinner.setSelection(pos);
  }
}
Program: 26288
Project: 26288
Buggy source:
@Override public void onGet(Object item){
  Directory directory=(Directory)item;
  mLoadSwitcher.setDisplayedChild(1);
  addChapters(directory.getGroups());
  mChapterSpinner.setAdapter(mSpinnerAdapter);
}

Fixed version (ground truth):
@Override public void onGet(Object item){
  Directory directory=(Directory)item;
  mLoadSwitcher.setDisplayedChild(1);
  addChapters(directory.getGroups());
}
Program: 26289
Project: 26289
Buggy source:
@Override public View getView(int i,View view,ViewGroup viewGroup){
  if (view == null)   view=mInflater.inflate(R.layout.news_item_base,null);
  Item item=(Item)getItemInternal(i);
  final Activity activity=item.getActivity();
  ViewGroup container=(ViewGroup)view.findViewById(R.id.attachmentContainer);
  view.setTag(activity.getId());
  PlusOneButton plusButton=(PlusOneButton)view.findViewById(R.id.plus_one_button);
  plusButton.initialize(mPlusClient,activity.getUrl(),1);
  if (activity.getVerb().equals("String_Node_Str"))   populateShare(activity,view);
 else   populatePost(activity,view);
  if (activity.getObject().getAttachments() != null && activity.getObject().getAttachments().size() > 0) {
    final Activity.PlusObject.Attachments attachment=activity.getObject().getAttachments().get(0);
switch (getItemViewType(i)) {
case 1:
      populateArticle(container,attachment);
    break;
case 2:
  populateVideo(container,attachment);
break;
case 3:
populatePhoto(container,attachment);
break;
case 4:
populateAlbum(container,attachment);
break;
case 5:
populateEvent(container,attachment);
break;
}
}
if (!item.isConsumed()) {
item.setConsumed(true);
Animation animation=AnimationUtils.makeInChildBottomAnimation(mContext);
view.startAnimation(animation);
}
return view;
}

Fixed version (ground truth):
@Override public View getView(int i,View view,ViewGroup viewGroup){
  if (view == null)   view=mInflater.inflate(R.layout.news_item_base,null);
  Item item=(Item)getItemInternal(i);
  final Activity activity=item.getActivity();
  view.setTag(activity.getUrl());
  ViewGroup container=(ViewGroup)view.findViewById(R.id.attachmentContainer);
  PlusOneButton plusButton=(PlusOneButton)view.findViewById(R.id.plus_one_button);
  if (mPlusClient != null) {
    plusButton.setVisibility(View.VISIBLE);
    plusButton.initialize(mPlusClient,activity.getUrl(),1);
  }
 else {
    plusButton.setVisibility(View.GONE);
  }
  if (activity.getVerb().equals("String_Node_Str"))   populateShare(activity,view);
 else   populatePost(activity,view);
  if (activity.getObject().getAttachments() != null && activity.getObject().getAttachments().size() > 0) {
    final Activity.PlusObject.Attachments attachment=activity.getObject().getAttachments().get(0);
switch (getItemViewType(i)) {
case 1:
      populateArticle(container,attachment);
    break;
case 2:
  populateVideo(container,attachment);
break;
case 3:
populatePhoto(container,attachment);
break;
case 4:
populateAlbum(container,attachment);
break;
case 5:
populateEvent(container,attachment);
break;
}
}
if (!item.isConsumed()) {
item.setConsumed(true);
Animation animation=AnimationUtils.makeInChildBottomAnimation(mContext);
view.startAnimation(animation);
}
return view;
}
Program: 26290
Project: 26290
Buggy source:
@Override public void onResume(){
  super.onResume();
  Log.d(LOG_TAG,"String_Node_Str");
}

Fixed version (ground truth):
@Override public void onResume(){
  super.onResume();
  Log.d(LOG_TAG,"String_Node_Str");
  for (int i=0; i <= mList.getChildCount(); i++) {
    mAdapter.updatePlusOne(mList.getChildAt(i));
  }
}
Program: 26291
Project: 26291
Buggy source:
private Bytes zeroOutDirty(long start,long end){
  if (start < 0 || end > limit())   throw new IllegalArgumentException("String_Node_Str" + start + "String_Node_Str"+ end);
  if (start >= end)   return this;
  ChronicleUnsafe unsafe=getChronicleUnsafe();
  while (start < end && (start & 7) != 0) {
    byte b=unsafe.getByte(this.start + start);
    if (b != 0)     unsafe.putByte(this.start + start,(byte)0);
    start++;
  }
  while (start < end - 7) {
    long l=unsafe.getLong(this.start + start);
    if (l != 0)     unsafe.putLong(this.start + start,0L);
    start++;
  }
  while (start < end) {
    byte b=unsafe.getByte(this.start + start);
    if (b != 0)     unsafe.putByte(this.start + start,(byte)0);
    start++;
  }
  return this;
}

Fixed version (ground truth):
private Bytes zeroOutDirty(long start,long end){
  if (start < 0 || end > limit())   throw new IllegalArgumentException("String_Node_Str" + start + "String_Node_Str"+ end);
  if (start >= end)   return this;
  ChronicleUnsafe unsafe=getChronicleUnsafe();
  while (start < end && (start & 7) != 0) {
    byte b=unsafe.getByte(this.start + start);
    if (b != 0)     unsafe.putByte(this.start + start,(byte)0);
    start++;
  }
  while (start < end - 7) {
    long l=unsafe.getLong(this.start + start);
    if (l != 0)     unsafe.putLong(this.start + start,0L);
    start+=8;
  }
  while (start < end) {
    byte b=unsafe.getByte(this.start + start);
    if (b != 0)     unsafe.putByte(this.start + start,(byte)0);
    start++;
  }
  return this;
}
Program: 26292
Project: 26292
Buggy source:
private Bytes zeroOutDirty(long start,long end){
  if (start < 0 || end > limit())   throw new IllegalArgumentException("String_Node_Str" + start + "String_Node_Str"+ end);
  if (start >= end)   return this;
  while (start < end && (start & 7) != 0) {
    byte b=UNSAFE.getByte(startAddr + start);
    if (b != 0)     UNSAFE.putByte(startAddr + start,(byte)0);
    start++;
  }
  while (start < end - 7) {
    long l=UNSAFE.getLong(startAddr + start);
    if (l != 0)     UNSAFE.putLong(startAddr + start,0L);
    start++;
  }
  while (start < end) {
    byte b=UNSAFE.getByte(startAddr + start);
    if (b != 0)     UNSAFE.putByte(startAddr + start,(byte)0);
    start++;
  }
  return this;
}

Fixed version (ground truth):
private Bytes zeroOutDirty(long start,long end){
  if (start < 0 || end > limit())   throw new IllegalArgumentException("String_Node_Str" + start + "String_Node_Str"+ end);
  if (start >= end)   return this;
  while (start < end && (start & 7) != 0) {
    byte b=UNSAFE.getByte(startAddr + start);
    if (b != 0)     UNSAFE.putByte(startAddr + start,(byte)0);
    start++;
  }
  while (start < end - 7) {
    long l=UNSAFE.getLong(startAddr + start);
    if (l != 0)     UNSAFE.putLong(startAddr + start,0L);
    start+=8;
  }
  while (start < end) {
    byte b=UNSAFE.getByte(startAddr + start);
    if (b != 0)     UNSAFE.putByte(startAddr + start,(byte)0);
    start++;
  }
  return this;
}
Program: 26293
Project: 26293
Buggy source:
private void methodReadMarshall(StringBuilder readMarshal,Method getter,Method setter,Class type,FieldModel model){
  if (model.type() == Date.class) {
    if (getter != null && setter != null)     readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str").append(bytesType(type)).append("String_Node_Str");
  }
 else   if (Enum.class.isAssignableFrom(model.type())) {
    if (getter != null && setter != null)     readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str" + model.type() + "String_Node_Str");
  }
 else   if (!model.isArray()) {
    if (getter != null && setter != null)     readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str").append(bytesType(type)).append("String_Node_Str");
  }
 else {
    readMarshal.append("String_Node_Str").append(model.indexSize().value()).append("String_Node_Str");
    readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str").append(bytesType(type)).append("String_Node_Str");
    readMarshal.append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void methodReadMarshall(StringBuilder readMarshal,Method getter,Method setter,Class type,FieldModel model){
  if (model.type() == Date.class) {
    if (getter != null && setter != null)     readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str").append(bytesType(type)).append("String_Node_Str");
  }
 else   if (Enum.class.isAssignableFrom(model.type())) {
    if (getter != null && setter != null)     readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str" + model.type().getName() + "String_Node_Str");
  }
 else   if (!model.isArray()) {
    if (getter != null && setter != null)     readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str").append(bytesType(type)).append("String_Node_Str");
  }
 else {
    readMarshal.append("String_Node_Str").append(model.indexSize().value()).append("String_Node_Str");
    readMarshal.append("String_Node_Str").append(setter.getName()).append("String_Node_Str").append(bytesType(type)).append("String_Node_Str");
    readMarshal.append("String_Node_Str");
  }
}
Program: 26294
Project: 26294
Buggy source:
public static long calcLongHashCode(CharSequence s){
  long hash=0;
  for (int i=0, len=s.length(); i < len; i++) {
    hash=57 * hash + s.charAt(i);
  }
  return hash;
}

Fixed version (ground truth):
public static long calcLongHashCode(CharSequence s){
  if (s == null)   return NULL_HASHCODE;
  long hash=0;
  for (int i=0, len=s.length(); i < len; i++) {
    hash=57 * hash + s.charAt(i);
  }
  return hash;
}
Program: 26295
Project: 26295
Buggy source:
@Override public void close(){
}

Fixed version (ground truth):
@Override public void close(){
  try {
    super.close();
  }
 catch (  IOException e) {
    throw new AssertionError(e);
  }
}
Program: 26296
Project: 26296
Buggy source:
public C read(Bytes bytes,@Nullable C c){
  long length=bytes.readStopBit();
  if (length == 0 && c != null)   return c;
  if (length < NULL_LENGTH || length > Integer.MAX_VALUE)   throw new IllegalStateException("String_Node_Str" + length);
  if (length == NULL_LENGTH)   return null;
  if (c == null)   return newCollection();
  return readCollection(bytes,c,(int)length);
}

Fixed version (ground truth):
public C read(Bytes bytes,@Nullable C c){
  long length=bytes.readStopBit();
  if (length == 0 && c != null) {
    c.clear();
    return c;
  }
  if (length < NULL_LENGTH || length > Integer.MAX_VALUE)   throw new IllegalStateException("String_Node_Str" + length);
  if (length == NULL_LENGTH)   return null;
  if (c == null)   c=newCollection();
  return readCollection(bytes,c,(int)length);
}
Program: 26297
Project: 26297
Buggy source:
public boolean tryRWReadLock(long offset,long timeOutNS) throws IllegalStateException {
  return wrapped.tryRWReadLock(offset,timeOutNS);
}

Fixed version (ground truth):
public boolean tryRWReadLock(long offset,long timeOutNS) throws IllegalStateException, InterruptedException {
  return wrapped.tryRWReadLock(offset,timeOutNS);
}
Program: 26298
Project: 26298
Buggy source:
public boolean tryRWWriteLock(long offset,long timeOutNS) throws IllegalStateException {
  return wrapped.tryRWWriteLock(offset,timeOutNS);
}

Fixed version (ground truth):
public boolean tryRWWriteLock(long offset,long timeOutNS) throws IllegalStateException, InterruptedException {
  return wrapped.tryRWWriteLock(offset,timeOutNS);
}
Program: 26299
Project: 26299
Buggy source:
@Override public void write(RandomDataInput bytes,long position,long length){
  if (length > remaining())   throw new IllegalArgumentException("String_Node_Str" + length + "String_Node_Str"+ remaining()+ "String_Node_Str");
  if (bytes instanceof NativeBytes) {
    UNSAFE.copyMemory(((NativeBytes)bytes).startAddr + position,positionAddr,length);
  }
 else {
    super.write(bytes,position,length);
  }
}

Fixed version (ground truth):
@Override public void write(RandomDataInput bytes,long position,long length){
  if (length > remaining())   throw new IllegalArgumentException("String_Node_Str" + length + "String_Node_Str"+ remaining()+ "String_Node_Str");
  if (bytes instanceof NativeBytes) {
    UNSAFE.copyMemory(((NativeBytes)bytes).startAddr + position,positionAddr,length);
    skip(length);
  }
 else {
    super.write(bytes,position,length);
  }
}
Program: 26300
Project: 26300
Buggy source:
@Override public Class<ByteBufferReuse> run(){
  ClassLoader cl=MAGIC_CLASS_LOADER;
  return (Class<ByteBufferReuse>)unsafe.defineClass(reuseImplClassName,impl,0,impl.length,cl,null);
}

Fixed version (ground truth):
@Override public Class run(){
  ClassLoader cl=MAGIC_CLASS_LOADER;
  return unsafe.defineClass(reuseImplClassName,impl,0,impl.length,cl,null);
}
Program: 26302
Project: 26302
Buggy source:
public static int computeNonScalarOffset(DataValueModel dvmodel,Class type){
  int offset=0;
  DataValueModel dvmodel2=dvmodel.nestedModel(type);
  Map.Entry<String,FieldModel>[] entries2=heapSizeOrderedFields(dvmodel2);
  for (  Map.Entry<String,? extends FieldModel> entry2 : entries2) {
    FieldModel model2=entry2.getValue();
    offset+=dvmodel2.isScalar(model2.type()) ? fieldSize(model2) : computeNonScalarOffset(dvmodel2,model2.type());
  }
  return offset;
}

Fixed version (ground truth):
public static int computeNonScalarOffset(DataValueModel dvmodel,Class type){
  int offset=0;
  DataValueModel dvmodel2=dvmodel.nestedModel(type);
  Map.Entry<String,FieldModel>[] entries2=heapSizeOrderedFields(dvmodel2);
  for (  Map.Entry<String,? extends FieldModel> entry2 : entries2) {
    FieldModel model2=entry2.getValue();
    int add=dvmodel2.isScalar(model2.type()) ? fieldSize(model2) : computeNonScalarOffset(dvmodel2,model2.type());
    if (model2.isArray())     add*=model2.indexSize().value();
    offset+=add;
  }
  return offset;
}
Program: 26303
Project: 26303
Buggy source:
private E valueOf(String s){
  E e=map.get(s);
  if (e == null)   try {
    if (constructor != null) {
      map.put(s,e=constructor.newInstance(s));
    }
 else {
      @SuppressWarnings("String_Node_Str") E invoke=(E)valueOf.invoke(null,s);
      map.put(s,e=invoke);
    }
  }
 catch (  Exception t) {
    throw new AssertionError(t.getCause());
  }
  return e;
}

Fixed version (ground truth):
private E valueOf(String s){
  E e=map.get(s);
  if (e == null)   try {
    if (constructor != null) {
      map.put(s,e=constructor.newInstance(s));
    }
 else {
      @SuppressWarnings("String_Node_Str") E invoke=(E)valueOf.invoke(null,s);
      map.put(s,e=invoke);
    }
  }
 catch (  Exception t) {
    throw new AssertionError(t);
  }
  return e;
}
Program: 26304
Project: 26304
Buggy source:
public GenericEnumMarshaller(@NotNull Class<E> classMarshaled,final int capacity){
  Constructor<E> constructor=null;
  Method valueOf=null;
  try {
    valueOf=classMarshaled.getMethod("String_Node_Str",String.class);
  }
 catch (  NoSuchMethodException e) {
    try {
      constructor=classMarshaled.getConstructor(String.class);
    }
 catch (    NoSuchMethodException e1) {
      throw new IllegalArgumentException(classMarshaled + "String_Node_Str");
    }
  }
  this.constructor=constructor;
  this.valueOf=valueOf;
  map=new LinkedHashMap<String,E>(128,0.7f,true){
    @Override protected boolean removeEldestEntry(    Map.Entry<String,E> eldest){
      return size() > capacity;
    }
  }
;
}

Fixed version (ground truth):
public GenericEnumMarshaller(@NotNull Class<E> classMarshaled,final int capacity){
  Constructor<E> constructor=null;
  Method valueOf=null;
  try {
    valueOf=classMarshaled.getMethod("String_Node_Str",String.class);
  }
 catch (  NoSuchMethodException e) {
    try {
      constructor=classMarshaled.getConstructor(String.class);
      constructor.setAccessible(true);
    }
 catch (    NoSuchMethodException e1) {
      throw new IllegalArgumentException(classMarshaled + "String_Node_Str");
    }
  }
  this.constructor=constructor;
  this.valueOf=valueOf;
  map=new LinkedHashMap<String,E>(128,0.7f,true){
    @Override protected boolean removeEldestEntry(    Map.Entry<String,E> eldest){
      return size() > capacity;
    }
  }
;
}
Program: 26305
Project: 26305
Buggy source:
@Nullable private Class load(@NotNull CharSequence name){
  int hash=(int)(Compare.calcLongHashCode(name) & 0x7ffffff) % CACHE_SIZE;
  if (classWeakReference == null)   classWeakReference=new WeakReference[CACHE_SIZE];
  WeakReference<Class> ref=classWeakReference[hash];
  if (ref != null) {
    Class clazz=ref.get();
    if (clazz != null && clazz.getName().equals(name))     return clazz;
  }
  try {
    Class<?> clazz=SC_SHORT_NAME.get(name.toString());
    if (clazz != null)     return clazz;
    clazz=classLoader.loadClass(name.toString());
    classWeakReference[hash]=new WeakReference<Class>(clazz);
    return clazz;
  }
 catch (  ClassNotFoundException e) {
    throw new IllegalArgumentException(e);
  }
}

Fixed version (ground truth):
@Nullable private Class load(@NotNull CharSequence name){
  int hash=(int)(Compare.calcLongHashCode(name) & 0x7ffffff) % CACHE_SIZE;
  if (classWeakReference == null)   classWeakReference=new WeakReference[CACHE_SIZE];
  WeakReference<Class> ref=classWeakReference[hash];
  if (ref != null) {
    Class clazz=ref.get();
    if (clazz != null && StringInterner.isEqual(clazz.getName(),name))     return clazz;
  }
  try {
    String className=name.toString();
    Class<?> clazz=SC_SHORT_NAME.get(className);
    if (clazz != null)     return clazz;
    clazz=classLoader.loadClass(className);
    classWeakReference[hash]=new WeakReference<Class>(clazz);
    return clazz;
  }
 catch (  ClassNotFoundException e) {
    throw new IllegalArgumentException(e);
  }
}
Program: 26306
Project: 26306
Buggy source:
private static boolean isEqual(@Nullable CharSequence s,@NotNull CharSequence cs){
  if (s == null)   return false;
  if (s.length() != cs.length())   return false;
  for (int i=0; i < cs.length(); i++)   if (s.charAt(i) != cs.charAt(i))   return false;
  return true;
}

Fixed version (ground truth):
public static boolean isEqual(@Nullable CharSequence s,@NotNull CharSequence cs){
  if (s == null)   return false;
  if (s.length() != cs.length())   return false;
  for (int i=0; i < cs.length(); i++)   if (s.charAt(i) != cs.charAt(i))   return false;
  return true;
}
Program: 26308
Project: 26308
Buggy source:
public static int computeNonScalarOffset(DataValueModel dvmodel,Class type){
  int offset=0;
  DataValueModel dvmodel2=dvmodel.nestedModel(type);
  Map.Entry<String,FieldModel>[] entries2=heapSizeOrderedFields(dvmodel2);
  for (  Map.Entry<String,? extends FieldModel> entry2 : entries2) {
    FieldModel model2=entry2.getValue();
    int add=dvmodel2.isScalar(model2.type()) ? fieldSize(model2) : computeNonScalarOffset(dvmodel2,model2.type());
    if (model2.isArray())     add*=model2.indexSize().value();
    offset+=add;
  }
  return offset;
}

Fixed version (ground truth):
public static int computeNonScalarOffset(DataValueModel dvmodel,Class type){
  int offset=0;
  DataValueModel dvmodel2=dvmodel.nestedModel(type);
  Map.Entry<String,FieldModel>[] entries2=heapSizeOrderedFields(dvmodel2);
  for (  Map.Entry<String,? extends FieldModel> entry2 : entries2) {
    FieldModel model2=entry2.getValue();
    int add;
    if (dvmodel2.isScalar(model2.type())) {
      add=fieldSize(model2);
    }
 else {
      add=computeNonScalarOffset(dvmodel2,model2.type());
      if (model2.isArray())       add*=model2.indexSize().value();
    }
    offset+=add;
  }
  return offset;
}
Program: 26309
Project: 26309
Buggy source:
public C read(Bytes bytes,@Nullable C c){
  long length=bytes.readStopBit();
  if (length == 0 && c != null)   return c;
  if (length < NULL_LENGTH || length > Integer.MAX_VALUE)   throw new IllegalStateException("String_Node_Str" + length);
  if (length == NULL_LENGTH)   return null;
  return readCollection(bytes,c,(int)length);
}

Fixed version (ground truth):
public C read(Bytes bytes,@Nullable C c){
  long length=bytes.readStopBit();
  if (length == 0 && c != null)   return c;
  if (length < NULL_LENGTH || length > Integer.MAX_VALUE)   throw new IllegalStateException("String_Node_Str" + length);
  if (length == NULL_LENGTH)   return null;
  if (c == null)   return newCollection();
  return readCollection(bytes,c,(int)length);
}
Program: 26310
Project: 26310
Buggy source:
@Override public Class<ByteBufferReuse> run(){
  ClassLoader cl=MAGIC_CLASS_LOADER;
  return unsafe.defineClass(reuseImplClassName,impl,0,impl.length,cl,null);
}

Fixed version (ground truth):
@Override public Class<ByteBufferReuse> run(){
  ClassLoader cl=MAGIC_CLASS_LOADER;
  return (Class<ByteBufferReuse>)unsafe.defineClass(reuseImplClassName,impl,0,impl.length,cl,null);
}
Program: 26312
Project: 26312
Buggy source:
public GenericEnumMarshaller(@NotNull Class<E> classMarshaled,final int capacity){
  Constructor<E> constructor=null;
  Method valueOf=null;
  try {
    valueOf=classMarshaled.getMethod("String_Node_Str",String.class);
  }
 catch (  NoSuchMethodException e) {
    try {
      constructor=classMarshaled.getConstructor(String.class);
      constructor.setAccessible(true);
    }
 catch (    NoSuchMethodException e1) {
      throw new IllegalArgumentException(classMarshaled + "String_Node_Str");
    }
  }
  this.constructor=constructor;
  this.valueOf=valueOf;
  map=new LinkedHashMap<String,E>(128,0.7f,true){
    @Override protected boolean removeEldestEntry(    Map.Entry<String,E> eldest){
      return size() > capacity;
    }
  }
;
}

Fixed version (ground truth):
public GenericEnumMarshaller(@NotNull Class<E> classMarshaled,final int capacity){
  this.classMarshaled=classMarshaled;
  this.capacity=capacity;
  Constructor<E> constructor=null;
  Method valueOf=null;
  try {
    valueOf=classMarshaled.getMethod("String_Node_Str",String.class);
  }
 catch (  NoSuchMethodException e) {
    try {
      constructor=classMarshaled.getConstructor(String.class);
      constructor.setAccessible(true);
    }
 catch (    NoSuchMethodException e1) {
      throw new IllegalArgumentException(classMarshaled + "String_Node_Str");
    }
  }
  this.constructor=constructor;
  this.valueOf=valueOf;
  map=new LinkedHashMap<String,E>(128,0.7f,true){
    @Override protected boolean removeEldestEntry(    Map.Entry<String,E> eldest){
      return size() > capacity;
    }
  }
;
}
Program: 26313
Project: 26313
Buggy source:
@NotNull @Override public InputStream inputStream(){
  if (inputStream == null)   inputStream=new BytesInputStream();
  return inputStream;
}

Fixed version (ground truth):
@NotNull @Override public InputStream inputStream(){
  return new BytesInputStream();
}
Program: 26314
Project: 26314
Buggy source:
@NotNull @Override public String readUTF(){
  try {
    int len=readUnsignedShort();
    readUTF0(acquireUtfReader(),len);
    return utfReader.length() == 0 ? "String_Node_Str" : stringInterner().intern(utfReader);
  }
 catch (  IOException unexpected) {
    throw new AssertionError(unexpected);
  }
}

Fixed version (ground truth):
@NotNull @Override public String readUTF(){
  try {
    int len=readUnsignedShort();
    StringBuilder utfReader=acquireUtfReader();
    readUTF0(utfReader,len);
    return utfReader.length() == 0 ? "String_Node_Str" : stringInterner().intern(utfReader);
  }
 catch (  IOException unexpected) {
    throw new AssertionError(unexpected);
  }
}
Program: 26315
Project: 26315
Buggy source:
@Override public void writeUTFΔ(long offset,int maxSize,@Nullable CharSequence s) throws IllegalStateException {
}

Fixed version (ground truth):
@Override public synchronized void writeUTFΔ(long offset,int maxSize,@Nullable CharSequence s) throws IllegalStateException {
}
Program: 26316
Project: 26316
Buggy source:
@NotNull private StringBuilder acquireUtfReader(){
  if (utfReader == null)   utfReader=new StringBuilder(128);
 else   utfReader.setLength(0);
  return utfReader;
}

Fixed version (ground truth):
@NotNull private StringBuilder acquireUtfReader(){
  StringBuilder utfReader=utfReaderTL.get();
  if (utfReader == null)   utfReaderTL.set(utfReader=new StringBuilder(128));
 else   utfReader.setLength(0);
  return utfReader;
}
Program: 26317
Project: 26317
Buggy source:
@NotNull @Override public OutputStream outputStream(){
  if (outputStream == null)   outputStream=new BytesOutputStream();
  return outputStream;
}

Fixed version (ground truth):
@NotNull @Override public OutputStream outputStream(){
  return new BytesOutputStream();
}
Program: 26318
Project: 26318
Buggy source:
private void unlockFailedInt(long offset,int lowId) throws IllegalMonitorStateException {
  long currentValue=readUnsignedInt(offset);
  long holderId=currentValue & INT_LOCK_MASK;
  if (holderId == lowId) {
    currentValue-=1 << 24;
    writeOrderedInt(offset,(int)currentValue);
  }
 else   if (currentValue == 0) {
    LOGGER.severe("String_Node_Str" + shortThreadId());
  }
 else {
    throw new IllegalMonitorStateException("String_Node_Str" + holderId + "String_Node_Str"+ (currentValue >>> 24)+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void unlockFailedInt(long offset,int lowId) throws IllegalMonitorStateException {
  long currentValue=readInt(offset);
  long holderId=currentValue & INT_LOCK_MASK;
  if (holderId == lowId) {
    currentValue-=1 << 24;
    writeOrderedInt(offset,(int)currentValue);
  }
 else   if (currentValue == 0) {
    LOGGER.severe("String_Node_Str" + shortThreadId());
  }
 else {
    throw new IllegalMonitorStateException("String_Node_Str" + holderId + "String_Node_Str"+ (currentValue >>> 24)+ "String_Node_Str");
  }
}
Program: 26319
Project: 26319
Buggy source:
private boolean tryLockNanos4a(long offset){
  int lowId=shortThreadId();
  int firstValue=((1 << 24) | lowId);
  if (compareAndSwapInt(offset,0,firstValue))   return true;
  long currentValue=readUnsignedInt(offset);
  if ((currentValue & INT_LOCK_MASK) == lowId) {
    if (currentValue >= (255L << 24))     throw new IllegalStateException("String_Node_Str");
    currentValue+=1 << 24;
    writeOrderedInt(offset,(int)currentValue);
  }
  return false;
}

Fixed version (ground truth):
private boolean tryLockNanos4a(long offset){
  int lowId=shortThreadId();
  int firstValue=((1 << 24) | lowId);
  if (compareAndSwapInt(offset,0,firstValue))   return true;
  int currentValue=readInt(offset);
  if ((currentValue & INT_LOCK_MASK) == lowId) {
    if ((currentValue >>> 24) >= 255)     throw new IllegalStateException("String_Node_Str");
    currentValue+=1 << 24;
    writeOrderedInt(offset,(int)currentValue);
    return true;
  }
  return false;
}
Program: 26320
Project: 26320
Buggy source:
public boolean startsWith(RandomDataInput input){
  long inputRemaining=input.remaining();
  if ((limitAddr - positionAddr) < inputRemaining)   return false;
  long pos=position(), inputPos=input.position();
  UNSAFE.getLong(startAddr + pos);
  int i=0;
  for (; i < inputRemaining - 7; i+=8) {
    if (UNSAFE.getInt(startAddr + pos + i) != input.readInt(inputPos + i))     return false;
  }
  for (; i < inputRemaining; i++) {
    if (UNSAFE.getByte(startAddr + pos + i) != input.readByte(inputPos + i))     return false;
  }
  return true;
}

Fixed version (ground truth):
public boolean startsWith(RandomDataInput input){
  long inputRemaining=input.remaining();
  if ((limitAddr - positionAddr) < inputRemaining)   return false;
  long pos=position(), inputPos=input.position();
  UNSAFE.getLong(startAddr + pos);
  int i=0;
  for (; i < inputRemaining - 7; i+=8) {
    if (UNSAFE.getLong(startAddr + pos + i) != input.readLong(inputPos + i))     return false;
  }
  for (; i < inputRemaining; i++) {
    if (UNSAFE.getByte(startAddr + pos + i) != input.readByte(inputPos + i))     return false;
  }
  return true;
}
Program: 26321
Project: 26321
Buggy source:
@Test public void testAppendParse(){
  bytes.append(false).append(' ');
  bytes.append(true).append(' ');
  bytes.append("String_Node_Str").append(' ');
  bytes.append("String_Node_Str").append(' ');
  bytes.append(BuySell.Buy).append(' ');
  bytes.append(1234).append(' ');
  bytes.append(123456L).append(' ');
  bytes.append(1.2345).append(' ');
  bytes.append(1.5555,3).append(' ');
  bytes.position(0);
  assertEquals(false,bytes.parseBoolean(SPACE_STOP));
  assertEquals(true,bytes.parseBoolean(SPACE_STOP));
  assertEquals(null,bytes.parseBoolean(SPACE_STOP));
  assertEquals("String_Node_Str",bytes.parseUTF(SPACE_STOP));
  assertEquals(BuySell.Buy,bytes.parseEnum(BuySell.class,SPACE_STOP));
  assertEquals(1234,bytes.parseLong());
  assertEquals(123456L,bytes.parseLong());
  assertEquals(1.2345,bytes.parseDouble(),0);
  assertEquals(1.556,bytes.parseDouble(),0);
}

Fixed version (ground truth):
@Test public void testAppendParse(){
  bytes.append(false).append(' ');
  bytes.append(true).append(' ');
  bytes.append("String_Node_Str").append(' ');
  bytes.append("String_Node_Str").append(' ');
  bytes.append(BuySell.Buy).append(' ');
  bytes.append(1234).append(' ');
  bytes.append(123456L).append(' ');
  bytes.append(1.2345).append(' ');
  bytes.append(1.5555,3).append(' ');
  bytes.position(0);
  assertEquals(false,bytes.parseBoolean(SPACE_STOP));
  assertEquals(true,bytes.parseBoolean(SPACE_STOP));
  assertEquals(null,bytes.parseBoolean(SPACE_STOP));
  assertEquals("String_Node_Str",bytes.parseUTF(SPACE_STOP));
  assertEquals(BuySell.Buy,bytes.parseEnum(BuySell.class,SPACE_STOP));
  assertEquals(1234,bytes.parseLong());
  assertEquals(123456L,bytes.parseLong());
  assertEquals(1.2345,bytes.parseDouble(),0);
}
Program: 26322
Project: 26322
Buggy source:
@Override public DirectBitSet flip(long fromIndex,long exclusiveToIndex){
  long fromLongIndex=fromIndex >> 6;
  long toIndex=exclusiveToIndex - 1;
  long toLongIndex=toIndex >> 6;
  if (fromIndex < 0 || fromIndex > exclusiveToIndex || toLongIndex >= longLength)   throw new IndexOutOfBoundsException();
  if (fromLongIndex != toLongIndex) {
    long firstFullLongIndex=fromLongIndex;
    if ((fromIndex & 0x3F) != 0) {
      long fromByteIndex=fromLongIndex << 3;
      long mask=(~0L) << fromIndex;
      long l=bytes.readLong(fromByteIndex);
      long l2=l ^ mask;
      bytes.writeLong(fromByteIndex,l2);
      firstFullLongIndex++;
    }
    if ((exclusiveToIndex & 0x3F) == 0) {
      for (long i=firstFullLongIndex; i <= toLongIndex; i++) {
        long l=bytes.readLong(i << 3);
        long l2=~l;
        bytes.writeLong(i << 3,l2);
        break;
      }
    }
 else {
      for (long i=firstFullLongIndex; i < toLongIndex; i++) {
        long l=bytes.readLong(i << 3);
        long l2=~l;
        bytes.writeLong(i << 3,l2);
        break;
      }
      long toByteIndex=toLongIndex << 3;
      long mask=(~0L) >>> ~toIndex;
      long l=bytes.readLong(toByteIndex);
      long l2=l ^ mask;
      bytes.writeLong(toByteIndex,l2);
      return this;
    }
  }
 else {
    long byteIndex=fromLongIndex << 3;
    long mask=((~0L) << fromIndex) & ((~0L) >>> ~toIndex);
    long l=bytes.readLong(byteIndex);
    long l2=l ^ mask;
    bytes.writeLong(byteIndex,l2);
    return this;
  }
  return this;
}

Fixed version (ground truth):
@Override public DirectBitSet flip(long fromIndex,long exclusiveToIndex){
  long fromLongIndex=fromIndex >> 6;
  long toIndex=exclusiveToIndex - 1;
  long toLongIndex=toIndex >> 6;
  if (fromIndex < 0 || fromIndex > exclusiveToIndex || toLongIndex >= longLength)   throw new IndexOutOfBoundsException();
  if (fromLongIndex != toLongIndex) {
    long firstFullLongIndex=fromLongIndex;
    if ((fromIndex & 0x3F) != 0) {
      long fromByteIndex=fromLongIndex << 3;
      long mask=(~0L) << fromIndex;
      long l=bytes.readLong(fromByteIndex);
      long l2=l ^ mask;
      bytes.writeLong(fromByteIndex,l2);
      firstFullLongIndex++;
    }
    if ((exclusiveToIndex & 0x3F) == 0) {
      for (long i=firstFullLongIndex; i <= toLongIndex; i++) {
        long l=bytes.readLong(i << 3);
        long l2=~l;
        bytes.writeLong(i << 3,l2);
      }
    }
 else {
      for (long i=firstFullLongIndex; i < toLongIndex; i++) {
        long l=bytes.readLong(i << 3);
        long l2=~l;
        bytes.writeLong(i << 3,l2);
      }
      long toByteIndex=toLongIndex << 3;
      long mask=(~0L) >>> ~toIndex;
      long l=bytes.readLong(toByteIndex);
      long l2=l ^ mask;
      bytes.writeLong(toByteIndex,l2);
      return this;
    }
  }
 else {
    long byteIndex=fromLongIndex << 3;
    long mask=((~0L) << fromIndex) & ((~0L) >>> ~toIndex);
    long l=bytes.readLong(byteIndex);
    long l2=l ^ mask;
    bytes.writeLong(byteIndex,l2);
    return this;
  }
  return this;
}
Program: 26323
Project: 26323
Buggy source:
@Override public long previousClearLong(long fromLongIndex){
  if (fromLongIndex < 0) {
    if (fromLongIndex == NOT_FOUND)     return NOT_FOUND;
    throw new IndexOutOfBoundsException();
  }
  if (fromLongIndex >= longLength)   fromLongIndex=longLength - 1;
  if (bytes.readVolatileLong(fromLongIndex << 3) != ~0)   return fromLongIndex;
  for (long i=fromLongIndex - 1; i >= 0; i--) {
    if (bytes.readLong(i << 3) != ~0)     return i;
  }
  return NOT_FOUND;
}

Fixed version (ground truth):
@Override public long previousClearLong(long fromLongIndex){
  if (fromLongIndex < 0) {
    if (fromLongIndex == NOT_FOUND)     return NOT_FOUND;
    throw new IndexOutOfBoundsException();
  }
  if (fromLongIndex >= longLength)   fromLongIndex=longLength - 1;
  if (bytes.readVolatileLong(fromLongIndex << 3) != ~0L)   return fromLongIndex;
  for (long i=fromLongIndex - 1; i >= 0; i--) {
    if (bytes.readLong(i << 3) != ~0L)     return i;
  }
  return NOT_FOUND;
}
Program: 26324
Project: 26324
Buggy source:
@Override public long nextClearLong(long fromLongIndex){
  if (fromLongIndex < 0)   throw new IndexOutOfBoundsException();
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  if (bytes.readVolatileLong(fromLongIndex << 3) != ~0)   return fromLongIndex;
  for (long i=fromLongIndex + 1; i < longLength; i++) {
    if (bytes.readLong(i << 3) != ~0)     return i;
  }
  return NOT_FOUND;
}

Fixed version (ground truth):
@Override public long nextClearLong(long fromLongIndex){
  if (fromLongIndex < 0)   throw new IndexOutOfBoundsException();
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  if (bytes.readVolatileLong(fromLongIndex << 3) != ~0L)   return fromLongIndex;
  for (long i=fromLongIndex + 1; i < longLength; i++) {
    if (bytes.readLong(i << 3) != ~0L)     return i;
  }
  return NOT_FOUND;
}
Program: 26325
Project: 26325
Buggy source:
@Override public DirectBitSet flip(long fromIndex,long toIndex){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public DirectBitSet flip(long fromIndex,long exclusiveToIndex){
  long fromLongIndex=fromIndex >> 6;
  long toIndex=exclusiveToIndex - 1;
  long toLongIndex=toIndex >> 6;
  if (fromIndex < 0 || fromIndex > exclusiveToIndex || toLongIndex >= longLength)   throw new IndexOutOfBoundsException();
  if (fromLongIndex != toLongIndex) {
    long firstFullLongIndex=fromLongIndex;
    if ((fromIndex & 0x3F) != 0) {
      long fromByteIndex=fromLongIndex << 3;
      long mask=(~0L) << fromIndex;
      while (true) {
        long l=bytes.readVolatileLong(fromByteIndex);
        long l2=l ^ mask;
        if (bytes.compareAndSwapLong(fromByteIndex,l,l2))         break;
      }
      firstFullLongIndex++;
    }
    if ((exclusiveToIndex & 0x3F) == 0) {
      for (long i=firstFullLongIndex; i <= toLongIndex; i++) {
        while (true) {
          long l=bytes.readVolatileLong(i << 3);
          long l2=~l;
          if (bytes.compareAndSwapLong(i << 3,l,l2))           break;
        }
      }
    }
 else {
      for (long i=firstFullLongIndex; i < toLongIndex; i++) {
        while (true) {
          long l=bytes.readVolatileLong(i << 3);
          long l2=~l;
          if (bytes.compareAndSwapLong(i << 3,l,l2))           break;
        }
      }
      long toByteIndex=toLongIndex << 3;
      long mask=(~0L) >>> ~toIndex;
      while (true) {
        long l=bytes.readVolatileLong(toByteIndex);
        long l2=l ^ mask;
        if (bytes.compareAndSwapLong(toByteIndex,l,l2))         return this;
      }
    }
  }
 else {
    long byteIndex=fromLongIndex << 3;
    long mask=((~0L) << fromIndex) & ((~0L) >>> ~toIndex);
    while (true) {
      long l=bytes.readVolatileLong(byteIndex);
      long l2=l ^ mask;
      if (bytes.compareAndSwapLong(byteIndex,l,l2))       return this;
    }
  }
  return this;
}
Program: 26326
Project: 26326
Buggy source:
@Override public DirectBitSet andNot(long longIndex,long value){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public DirectBitSet andNot(long longIndex,long value){
  while (true) {
    long l=bytes.readVolatileLong(longIndex << 3);
    long l2=l & ~value;
    if (bytes.compareAndSwapLong(longIndex << 3,l,l2))     return this;
  }
}
Program: 26327
Project: 26327
Buggy source:
@Override public long nextClearBit(long fromIndex){
  long fromLongIndex=fromIndex >> 6;
  int bitIndex=(int)(fromIndex & 0x3f);
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  long l=~(bytes.readVolatileLong(fromLongIndex << 3) >>> bitIndex);
  if (l != 0) {
    return Long.numberOfTrailingZeros(l) + bitIndex;
  }
  for (long i=fromLongIndex + 1; i < longLength; i++) {
    l=~bytes.readLong(i << 3);
    if (l != 0)     return (i << 6) + Long.numberOfTrailingZeros(l);
  }
  return NOT_FOUND;
}

Fixed version (ground truth):
@Override public long nextClearBit(long fromIndex){
  throw new UnsupportedOperationException();
}
Program: 26328
Project: 26328
Buggy source:
@Override public DirectBitSet or(long index,long value){
  while (true) {
    long l=bytes.readVolatileLong(index << 3);
    long l2=l | value;
    if (l == l2 || bytes.compareAndSwapLong(index << 3,l,l2))     return this;
  }
}

Fixed version (ground truth):
@Override public DirectBitSet or(long longIndex,long value){
  while (true) {
    long l=bytes.readVolatileLong(longIndex << 3);
    long l2=l | value;
    if (l == l2 || bytes.compareAndSwapLong(longIndex << 3,l,l2))     return this;
  }
}
Program: 26329
Project: 26329
Buggy source:
@Override public long previousSetBit(long fromIndex){
  long fromLongIndex=fromIndex >> 6;
  int bitIndex=(int)(fromIndex & 0x3f);
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  long l=bytes.readVolatileLong(fromLongIndex << 3) << -bitIndex;
  if (l != 0)   return fromLongIndex << 6 + Long.numberOfLeadingZeros(l) + bitIndex;
  for (long i=fromLongIndex - 1; i >= 0; i--) {
    l=bytes.readLong(i << 3);
    if (l != 0)     return fromLongIndex << 6 + Long.numberOfLeadingZeros(l);
  }
  return NOT_FOUND;
}

Fixed version (ground truth):
@Override public long previousSetBit(long fromIndex){
  if (fromIndex < 0) {
    if (fromIndex == NOT_FOUND)     return NOT_FOUND;
    throw new IndexOutOfBoundsException();
  }
  long fromLongIndex=fromIndex >> 6;
  if (fromLongIndex >= longLength) {
    fromLongIndex=longLength - 1;
    fromIndex=size() - 1;
  }
  long l=bytes.readVolatileLong(fromLongIndex << 3) << ~fromIndex;
  if (l != 0)   return fromIndex - Long.numberOfLeadingZeros(l);
  for (long i=fromLongIndex - 1; i >= 0; i--) {
    l=bytes.readLong(i << 3);
    if (l != 0)     return fromLongIndex << 6 + Long.numberOfLeadingZeros(l);
  }
  return NOT_FOUND;
}
Program: 26330
Project: 26330
Buggy source:
@Override public long length(){
  return longLength << 6;
}

Fixed version (ground truth):
@Override public long length(){
  throw new UnsupportedOperationException();
}
Program: 26331
Project: 26331
Buggy source:
@Override public long previousSetLong(long fromLongIndex){
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  long l=bytes.readVolatileLong(fromLongIndex << 3);
  if (l != 0)   return fromLongIndex;
  for (long i=fromLongIndex - 1; i >= 0; i--) {
    l=bytes.readLong(i << 3);
    if (l != 0)     return i;
  }
  return NOT_FOUND;
}

Fixed version (ground truth):
@Override public long previousSetLong(long fromLongIndex){
  if (fromLongIndex < 0) {
    if (fromLongIndex == NOT_FOUND)     return NOT_FOUND;
    throw new IndexOutOfBoundsException();
  }
  if (fromLongIndex >= longLength)   fromLongIndex=longLength - 1;
  if (bytes.readVolatileLong(fromLongIndex << 3) != 0)   return fromLongIndex;
  for (long i=fromLongIndex - 1; i >= 0; i--) {
    if (bytes.readLong(i << 3) != 0)     return i;
  }
  return NOT_FOUND;
}
Program: 26332
Project: 26332
Buggy source:
@Override public long nextSetBit(long fromIndex){
  long fromLongIndex=fromIndex >> 6;
  int bitIndex=(int)(fromIndex & 0x3f);
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  long l=bytes.readVolatileLong(fromLongIndex << 3) >>> bitIndex;
  if (l != 0) {
    return Long.numberOfTrailingZeros(l) + bitIndex;
  }
  for (long i=fromLongIndex + 1; i < longLength; i++) {
    l=bytes.readLong(i << 3);
    if (l != 0)     return (i << 6) + Long.numberOfTrailingZeros(l);
  }
  return NOT_FOUND;
}

Fixed version (ground truth):
@Override public long nextSetBit(long fromIndex){
  if (fromIndex < 0)   throw new IndexOutOfBoundsException();
  long fromLongIndex=fromIndex >> 6;
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  long l=bytes.readVolatileLong(fromLongIndex << 3) >>> fromIndex;
  if (l != 0) {
    return fromIndex + Long.numberOfTrailingZeros(l);
  }
  for (long i=fromLongIndex + 1; i < longLength; i++) {
    l=bytes.readLong(i << 3);
    if (l != 0)     return (i << 6) + Long.numberOfTrailingZeros(l);
  }
  return NOT_FOUND;
}
Program: 26333
Project: 26333
Buggy source:
@Override public long nextSetLong(long fromLongIndex){
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  long l=bytes.readVolatileLong(fromLongIndex << 3);
  if (l != 0)   return fromLongIndex;
  for (long i=fromLongIndex + 1; i < longLength; i++) {
    l=bytes.readLong(i << 3);
    if (l != 0)     return i;
  }
  return NOT_FOUND;
}

Fixed version (ground truth):
@Override public long nextSetLong(long fromLongIndex){
  if (fromLongIndex < 0)   throw new IndexOutOfBoundsException();
  if (fromLongIndex >= longLength)   return NOT_FOUND;
  if (bytes.readVolatileLong(fromLongIndex << 3) != 0)   return fromLongIndex;
  for (long i=fromLongIndex + 1; i < longLength; i++) {
    if (bytes.readLong(i << 3) != 0)     return i;
  }
  return NOT_FOUND;
}
Program: 26334
Project: 26334
Buggy source:
@Override public long getLong(long index64){
  if (index64 < 0 || index64 >= bytes.capacity())   throw new IllegalArgumentException();
  return bytes.readVolatileLong(index64 << 3);
}

Fixed version (ground truth):
@Override public long getLong(long longIndex){
  if (longIndex < 0 || longIndex >= longLength)   throw new IndexOutOfBoundsException();
  return bytes.readVolatileLong(longIndex << 3);
}
Program: 26335
Project: 26335
Buggy source:
public ATSDirectBitSet(Bytes bytes){
  this.bytes=bytes;
  longLength=bytes.length() >> 8;
}

Fixed version (ground truth):
public ATSDirectBitSet(Bytes bytes){
  this.bytes=bytes;
  longLength=bytes.capacity() >> 3;
}