nus-yam/ex-repair huggingface dataset:
Program: 25521
Project: 25521
Buggy source:
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  final int paddingLeft=getPaddingLeft();
  final int paddingTop=getPaddingTop();
  final int childCount=getChildCount();
  if (mFirstLayout) {
switch (mSlideState) {
case EXPANDED:
      mSlideOffset=1.0f;
    break;
case ANCHORED:
  mSlideOffset=mAnchorPoint;
break;
case HIDDEN:
int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
mSlideOffset=computeSlideOffset(newTop);
break;
default :
mSlideOffset=0.f;
break;
}
}
for (int i=0; i < childCount; i++) {
final View child=getChildAt(i);
if (child.getVisibility() == GONE) {
continue;
}
final int childHeight=child.getMeasuredHeight();
int childTop=paddingTop;
if (child == mSlideableView) {
childTop=computePanelTopPosition(mSlideOffset);
}
if (!mIsSlidingUp) {
if (child == mMainView && !mOverlayContent) {
childTop=computePanelTopPosition(mSlideOffset) + mSlideableView.getMeasuredHeight();
}
}
final int childBottom=childTop + childHeight;
final int childLeft=paddingLeft;
final int childRight=childLeft + child.getMeasuredWidth();
child.layout(childLeft,childTop,childRight,childBottom);
}
if (mFirstLayout) {
updateObscuredViewVisibility();
}
mFirstLayout=false;
}

Fixed version (ground truth):
@Override protected void onLayout(boolean changed,int l,int t,int r,int b){
  final int paddingLeft=getPaddingLeft();
  final int paddingTop=getPaddingTop();
  final int childCount=getChildCount();
  if (mFirstLayout) {
switch (mSlideState) {
case EXPANDED:
      mSlideOffset=1.0f;
    break;
case ANCHORED:
  mSlideOffset=mAnchorPoint;
break;
case HIDDEN:
int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
mSlideOffset=computeSlideOffset(newTop);
break;
default :
mSlideOffset=0.f;
break;
}
}
for (int i=0; i < childCount; i++) {
final View child=getChildAt(i);
if (child.getVisibility() == GONE && (i == 0 || mFirstLayout)) {
continue;
}
final int childHeight=child.getMeasuredHeight();
int childTop=paddingTop;
if (child == mSlideableView) {
childTop=computePanelTopPosition(mSlideOffset);
}
if (!mIsSlidingUp) {
if (child == mMainView && !mOverlayContent) {
childTop=computePanelTopPosition(mSlideOffset) + mSlideableView.getMeasuredHeight();
}
}
final int childBottom=childTop + childHeight;
final int childLeft=paddingLeft;
final int childRight=childLeft + child.getMeasuredWidth();
child.layout(childLeft,childTop,childRight,childBottom);
}
if (mFirstLayout) {
updateObscuredViewVisibility();
}
mFirstLayout=false;
}
Program: 25522
Project: 25522
Buggy source:
public void showPanel(){
  if (!isPanelHidden())   return;
  smoothSlideTo(0,0);
}

Fixed version (ground truth):
public void showPanel(){
  if (mSlideState != SlideState.HIDDEN)   return;
  mSlideableView.setVisibility(View.VISIBLE);
  requestLayout();
  smoothSlideTo(0,0);
}
Program: 25523
Project: 25523
Buggy source:
@Override public void onViewCaptured(View capturedChild,int activePointerId){
  setAllChildrenVisible();
}

Fixed version (ground truth):
@Override public void onViewCaptured(View capturedChild,int activePointerId){
}
Program: 25524
Project: 25524
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if ((ady > dragSlop && adx > ady) || !isDragViewUnder((int)x,(int)y)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!isEnabled() || !mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if ((ady > dragSlop && adx > ady) || !isDragViewUnder((int)x,(int)y)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}
Program: 25526
Project: 25526
Buggy source:
public void hidePanel(){
  mIsPanelBeingHidden=true;
  int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
  smoothSlideTo(computeSlideOffset(newTop),0);
}

Fixed version (ground truth):
public void hidePanel(){
  if (mSlideState == SlideState.DRAGGING || mSlideState == SlideState.HIDDEN)   return;
  int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
  smoothSlideTo(computeSlideOffset(newTop),0);
}
Program: 25528
Project: 25528
Buggy source:
/** 
 * Partially expand the sliding panel up to a specific offset
 * @param mSlideOffset Value between 0 and 1, where 0 is completely expanded.
 * @return true if the pane was slideable and is now expanded/in the process of expanding
 */
public boolean expandPanel(float mSlideOffset){
  return expandPanel(mSlideableView,0,mSlideOffset);
}

Fixed version (ground truth):
/** 
 * Partially expand the sliding panel up to a specific offset
 * @param mSlideOffset Value between 0 and 1, where 0 is completely expanded.
 * @return true if the pane was slideable and is now expanded/in the process of expanding
 */
public boolean expandPanel(float mSlideOffset){
  if (mSlideState == SlideState.EXPANDED)   return false;
  mSlideableView.setVisibility(View.VISIBLE);
  return expandPanel(mSlideableView,0,mSlideOffset);
}
Program: 25529
Project: 25529
Buggy source:
public boolean isSlidingEnabled(){
  return mIsSlidingEnabled && mSlideableView != null && mSlideableView.getVisibility() == View.VISIBLE;
}

Fixed version (ground truth):
public boolean isSlidingEnabled(){
  return mIsSlidingEnabled && mSlideableView != null;
}
Program: 25530
Project: 25530
Buggy source:
public void showPanel(){
  if (!isSlidingEnabled())   return;
  smoothSlideTo(0,0);
}

Fixed version (ground truth):
public void showPanel(){
  if (!isPanelHidden())   return;
  smoothSlideTo(0,0);
}
Program: 25531
Project: 25531
Buggy source:
public void hidePanel(){
  if (!isSlidingEnabled())   return;
  mIsPanelBeingHidden=true;
  int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
  smoothSlideTo(computeSlideOffset(newTop),0);
}

Fixed version (ground truth):
public void hidePanel(){
  mIsPanelBeingHidden=true;
  int newTop=computePanelTopPosition(0.0f) + (mIsSlidingUp ? +mPanelHeight : -mPanelHeight);
  smoothSlideTo(computeSlideOffset(newTop),0);
}
Program: 25532
Project: 25532
Buggy source:
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isSlidingEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Smoothly animate mDraggingPane to the target X position within its range.
 * @param slideOffset position to animate to
 * @param velocity initial velocity in case of fling, or 0.
 */
boolean smoothSlideTo(float slideOffset,int velocity){
  if (!isSlidingEnabled()) {
    return false;
  }
  int panelTop=computePanelTopPosition(slideOffset);
  if (mDragHelper.smoothSlideViewTo(mSlideableView,mSlideableView.getLeft(),panelTop)) {
    setAllChildrenVisible();
    ViewCompat.postInvalidateOnAnimation(this);
    return true;
  }
  return false;
}
Program: 25533
Project: 25533
Buggy source:
@Override public void onViewCaptured(View capturedChild,int activePointerId){
}

Fixed version (ground truth):
@Override public void onViewCaptured(View capturedChild,int activePointerId){
  setAllChildrenVisible();
}
Program: 25535
Project: 25535
Buggy source:
public void setActionBarTranslation(float y){
  int actionBarHeight=0;
  TypedValue tv=new TypedValue();
  if (getTheme().resolveAttribute(android.R.attr.actionBarSize,tv,true)) {
    actionBarHeight=TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
  }
  ViewGroup content=((ViewGroup)findViewById(android.R.id.content).getParent());
  int children=content.getChildCount();
  for (int i=0; i < children; i++) {
    View child=content.getChildAt(i);
    if (child.getId() != android.R.id.content) {
      if (y <= -actionBarHeight) {
        child.setVisibility(View.GONE);
      }
 else {
        child.setVisibility(View.VISIBLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
          child.setTranslationY(y);
        }
 else {
          AnimatorProxy.wrap(child).setTranslationY(y);
        }
      }
    }
  }
}

Fixed version (ground truth):
public void setActionBarTranslation(float y){
  int actionBarHeight=getActionBarHeight();
  ViewGroup content=((ViewGroup)findViewById(android.R.id.content).getParent());
  int children=content.getChildCount();
  for (int i=0; i < children; i++) {
    View child=content.getChildAt(i);
    if (child.getId() != android.R.id.content) {
      if (y <= -actionBarHeight) {
        child.setVisibility(View.GONE);
      }
 else {
        child.setVisibility(View.VISIBLE);
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
          child.setTranslationY(y);
        }
 else {
          AnimatorProxy.wrap(child).setTranslationY(y);
        }
      }
    }
  }
}
Program: 25536
Project: 25536
Buggy source:
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putBoolean(SAVED_STATE_ACTION_BAR_HIDDEN,!getActionBar().isShowing());
}

Fixed version (ground truth):
@Override protected void onSaveInstanceState(Bundle outState){
  super.onSaveInstanceState(outState);
  outState.putBoolean(SAVED_STATE_ACTION_BAR_HIDDEN,mLayout.isExpanded());
}
Program: 25537
Project: 25537
Buggy source:
@Override public void onPanelSlide(View panel,float slideOffset){
  Log.i(TAG,"String_Node_Str" + slideOffset);
  setActionBarTranslation(layout.getCurrentParalaxOffset());
}

Fixed version (ground truth):
@Override public void onPanelSlide(View panel,float slideOffset){
  Log.i(TAG,"String_Node_Str" + slideOffset);
  setActionBarTranslation(mLayout.getCurrentParalaxOffset());
}
Program: 25538
Project: 25538
Buggy source:
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!mCanSlide || !mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if (ady > dragSlop && adx > ady) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}

Fixed version (ground truth):
@Override public boolean onInterceptTouchEvent(MotionEvent ev){
  final int action=MotionEventCompat.getActionMasked(ev);
  if (!mCanSlide || !mIsSlidingEnabled || (mIsUnableToDrag && action != MotionEvent.ACTION_DOWN)) {
    mDragHelper.cancel();
    return super.onInterceptTouchEvent(ev);
  }
  if (action == MotionEvent.ACTION_CANCEL || action == MotionEvent.ACTION_UP) {
    mDragHelper.cancel();
    return false;
  }
  final float x=ev.getX();
  final float y=ev.getY();
  boolean interceptTap=false;
switch (action) {
case MotionEvent.ACTION_DOWN:
{
      mIsUnableToDrag=false;
      mInitialMotionX=x;
      mInitialMotionY=y;
      if (isDragViewUnder((int)x,(int)y) && !mIsUsingDragViewTouchEvents) {
        interceptTap=true;
      }
      break;
    }
case MotionEvent.ACTION_MOVE:
{
    final float adx=Math.abs(x - mInitialMotionX);
    final float ady=Math.abs(y - mInitialMotionY);
    final int dragSlop=mDragHelper.getTouchSlop();
    if (mIsUsingDragViewTouchEvents) {
      if (adx > mScrollTouchSlop && ady < mScrollTouchSlop) {
        return super.onInterceptTouchEvent(ev);
      }
 else       if (ady > mScrollTouchSlop) {
        interceptTap=isDragViewUnder((int)x,(int)y);
      }
    }
    if ((ady > dragSlop && adx > ady) || !isDragViewUnder((int)x,(int)y)) {
      mDragHelper.cancel();
      mIsUnableToDrag=true;
      return false;
    }
    break;
  }
}
final boolean interceptForDrag=mDragHelper.shouldInterceptTouchEvent(ev);
return interceptForDrag || interceptTap;
}
Program: 25540
Project: 25540
Buggy source:
private static ObjectMethodToOverride objectMethodToOverride(ExecutableElement method){
  String name=method.getSimpleName().toString();
switch (method.getParameters().size()) {
case 0:
    if (name.equals("String_Node_Str")) {
      return ObjectMethodToOverride.TO_STRING;
    }
 else     if (name.equals("String_Node_Str")) {
      return ObjectMethodToOverride.HASH_CODE;
    }
  break;
case 1:
if (name.equals("String_Node_Str") && method.getParameters().get(0).asType().toString().equals("String_Node_Str")) {
  return ObjectMethodToOverride.EQUALS;
}
break;
}
return ObjectMethodToOverride.NONE;
}

Fixed version (ground truth):
private static ObjectMethodToOverride objectMethodToOverride(ExecutableElement method){
  String name=method.getSimpleName().toString();
switch (method.getParameters().size()) {
case 0:
    if (name.equals("String_Node_Str")) {
      return ObjectMethodToOverride.TO_STRING;
    }
 else     if (name.equals("String_Node_Str")) {
      return ObjectMethodToOverride.HASH_CODE;
    }
  break;
case 1:
if (name.equals("String_Node_Str") && method.getParameters().get(0).asType().toString().equals("String_Node_Str")) {
  return ObjectMethodToOverride.EQUALS;
}
break;
default :
}
return ObjectMethodToOverride.NONE;
}
Program: 25541
Project: 25541
Buggy source:
private String writeExtensions(TypeElement type,ExtensionContext context,ImmutableList<AutoValueExtension> applicableExtensions){
  int writtenSoFar=0;
  for (  AutoValueExtension extension : applicableExtensions) {
    String parentFqName=generatedSubclassName(type,writtenSoFar + 1);
    String parentSimpleName=TypeSimplifier.simpleNameOf(parentFqName);
    String classFqName=generatedSubclassName(type,writtenSoFar);
    String classSimpleName=TypeSimplifier.simpleNameOf(classFqName);
    boolean isFinal=(writtenSoFar == 0);
    String source=extension.generateClass(context,classSimpleName,parentSimpleName,isFinal);
    if (source != null) {
      source=Reformatter.fixup(source);
      writeSourceFile(classFqName,source,type);
      writtenSoFar++;
    }
  }
  return generatedSubclassName(type,writtenSoFar);
}

Fixed version (ground truth):
private int writeExtensions(TypeElement type,ExtensionContext context,ImmutableList<AutoValueExtension> applicableExtensions){
  int writtenSoFar=0;
  for (  AutoValueExtension extension : applicableExtensions) {
    String parentFqName=generatedSubclassName(type,writtenSoFar + 1);
    String parentSimpleName=TypeSimplifier.simpleNameOf(parentFqName);
    String classFqName=generatedSubclassName(type,writtenSoFar);
    String classSimpleName=TypeSimplifier.simpleNameOf(classFqName);
    boolean isFinal=(writtenSoFar == 0);
    String source=extension.generateClass(context,classSimpleName,parentSimpleName,isFinal);
    if (source != null) {
      source=Reformatter.fixup(source);
      writeSourceFile(classFqName,source,type);
      writtenSoFar++;
    }
  }
  return writtenSoFar;
}
Program: 25542
Project: 25542
Buggy source:
private void doTestNoCode(AutoValueExtension... extensions){
  JavaFileObject javaFileObject=JavaFileObjects.forSourceLines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertThat(javaFileObject).withCompilerOptions("String_Node_Str","String_Node_Str").processedWith(new AutoValueProcessor(ImmutableList.copyOf(extensions))).compilesWithoutWarnings().and().generatesFileNamed(StandardLocation.SOURCE_OUTPUT,"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
private void doTestNoCode(AutoValueExtension... extensions){
  JavaFileObject javaFileObject=JavaFileObjects.forSourceLines("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  assertThat(javaFileObject).withCompilerOptions("String_Node_Str","String_Node_Str").processedWith(new AutoValueProcessor(ImmutableList.copyOf(extensions))).compilesWithoutWarnings().and().generatesFileNamed(StandardLocation.SOURCE_OUTPUT,"String_Node_Str","String_Node_Str");
}
Program: 25543
Project: 25543
Buggy source:
/** 
 * Returns the   {@link AnnotationMirror}'s map of   {@link AnnotationValue} indexed by{@link ExecutableElement}, supplying default values from the annotation if the annotation property has not been set.  This is equivalent to  {@link Elements#getElementValuesWithDefaults(AnnotationMirror)} but can be calledstatically without an  {@Elements} instance.
 */
public static Map<ExecutableElement,AnnotationValue> getAnnotationValuesWithDefaults(AnnotationMirror annotation){
  Map<ExecutableElement,AnnotationValue> values=Maps.newLinkedHashMap();
  Map<? extends ExecutableElement,? extends AnnotationValue> declaredValues=annotation.getElementValues();
  for (  ExecutableElement method : ElementFilter.methodsIn(annotation.getAnnotationType().asElement().getEnclosedElements())) {
    if (declaredValues.containsKey(method)) {
      values.put(method,declaredValues.get(method));
    }
 else     if (method.getDefaultValue() != null) {
      values.put(method,method.getDefaultValue());
    }
 else {
      throw new IllegalStateException("String_Node_Str" + MoreElements.asType(method.getEnclosingElement()).getQualifiedName() + '.'+ method.getSimpleName()+ "String_Node_Str");
    }
  }
  return values;
}

Fixed version (ground truth):
/** 
 * Returns the   {@link AnnotationMirror}'s map of   {@link AnnotationValue} indexed by{@link ExecutableElement}, supplying default values from the annotation if the annotation property has not been set.  This is equivalent to  {@link Elements#getElementValuesWithDefaults(AnnotationMirror)} but can be calledstatically without an  {@link Elements} instance.
 */
public static Map<ExecutableElement,AnnotationValue> getAnnotationValuesWithDefaults(AnnotationMirror annotation){
  Map<ExecutableElement,AnnotationValue> values=Maps.newLinkedHashMap();
  Map<? extends ExecutableElement,? extends AnnotationValue> declaredValues=annotation.getElementValues();
  for (  ExecutableElement method : ElementFilter.methodsIn(annotation.getAnnotationType().asElement().getEnclosedElements())) {
    if (declaredValues.containsKey(method)) {
      values.put(method,declaredValues.get(method));
    }
 else     if (method.getDefaultValue() != null) {
      values.put(method,method.getDefaultValue());
    }
 else {
      throw new IllegalStateException("String_Node_Str" + MoreElements.asType(method.getEnclosingElement()).getQualifiedName() + '.'+ method.getSimpleName()+ "String_Node_Str");
    }
  }
  return values;
}
Program: 25544
Project: 25544
Buggy source:
FactoryDescriptor(String name,String extendingType,ImmutableSortedSet<String> implementingTypes,boolean publicType,ImmutableSet<FactoryMethodDescriptor> methodDescriptors,ImmutableSet<ImplementationMethodDescriptor> implementationMethodDescriptors,boolean allowSubclasses){
  this.name=checkNotNull(name);
  this.extendingType=checkNotNull(extendingType);
  this.implementingTypes=checkNotNull(implementingTypes);
  this.publicType=publicType;
  this.methodDescriptors=checkNotNull(methodDescriptors);
  this.implementationMethodDescriptors=checkNotNull(implementationMethodDescriptors);
  this.allowSubclasses=allowSubclasses;
  ImmutableSetMultimap.Builder<Key,String> providerNamesBuilder=ImmutableSetMultimap.builder();
  for (  FactoryMethodDescriptor descriptor : methodDescriptors) {
    for (    Parameter parameter : descriptor.providedParameters()) {
      providerNamesBuilder.put(parameter.key(),parameter.name());
    }
  }
  ImmutableMap.Builder<Key,String> providersBuilder=ImmutableMap.builder();
  for (  Entry<Key,Collection<String>> entry : providerNamesBuilder.build().asMap().entrySet()) {
    Key key=entry.getKey();
switch (entry.getValue().size()) {
case 0:
      throw new AssertionError();
case 1:
    providersBuilder.put(key,Iterables.getOnlyElement(entry.getValue()) + "String_Node_Str");
  break;
default :
providersBuilder.put(key,invalidIdentifierCharacters.replaceFrom(key.toString(),'_') + "String_Node_Str");
break;
}
}
this.providerNames=providersBuilder.build();
}

Fixed version (ground truth):
FactoryDescriptor(String name,String extendingType,ImmutableSortedSet<String> implementingTypes,boolean publicType,ImmutableSet<FactoryMethodDescriptor> methodDescriptors,ImmutableSet<ImplementationMethodDescriptor> implementationMethodDescriptors,boolean allowSubclasses){
  this.name=checkNotNull(name);
  this.extendingType=checkNotNull(extendingType);
  this.implementingTypes=checkNotNull(implementingTypes);
  this.publicType=publicType;
  this.methodDescriptors=checkNotNull(methodDescriptors);
  this.implementationMethodDescriptors=dedupeMethods(methodDescriptors,implementationMethodDescriptors);
  this.allowSubclasses=allowSubclasses;
  ImmutableSetMultimap.Builder<Key,String> providerNamesBuilder=ImmutableSetMultimap.builder();
  for (  FactoryMethodDescriptor descriptor : methodDescriptors) {
    for (    Parameter parameter : descriptor.providedParameters()) {
      providerNamesBuilder.put(parameter.key(),parameter.name());
    }
  }
  ImmutableMap.Builder<Key,String> providersBuilder=ImmutableMap.builder();
  for (  Entry<Key,Collection<String>> entry : providerNamesBuilder.build().asMap().entrySet()) {
    Key key=entry.getKey();
switch (entry.getValue().size()) {
case 0:
      throw new AssertionError();
case 1:
    providersBuilder.put(key,Iterables.getOnlyElement(entry.getValue()) + "String_Node_Str");
  break;
default :
providersBuilder.put(key,invalidIdentifierCharacters.replaceFrom(key.toString(),'_') + "String_Node_Str");
break;
}
}
this.providerNames=providersBuilder.build();
}
Program: 25547
Project: 25547
Buggy source:
@Override public boolean mustBeAtEnd(){
  return true;
}

Fixed version (ground truth):
@Override public boolean mustBeAtEnd(Context context){
  return true;
}
Program: 25548
Project: 25548
Buggy source:
@Override public synchronized void init(ProcessingEnvironment processingEnv){
  super.init(processingEnv);
  if (extensions == null) {
    extensions=ServiceLoader.load(AutoValueExtension.class,getClass().getClassLoader());
  }
  errorReporter=new ErrorReporter(processingEnv);
}

Fixed version (ground truth):
@Override public synchronized void init(ProcessingEnvironment processingEnv){
  super.init(processingEnv);
  errorReporter=new ErrorReporter(processingEnv);
}
Program: 25551
Project: 25551
Buggy source:
@Test public void simpleClassCustomName(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClassCustomName(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25552
Project: 25552
Buggy source:
@Test public void constructorAnnotatedNonFinal(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void constructorAnnotatedNonFinal(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25553
Project: 25553
Buggy source:
@Test public void simpleClassImplementingSimpleInterface(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClassImplementingSimpleInterface(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25554
Project: 25554
Buggy source:
@Test public void providedButNoAutoFactory(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(21).atColumn(38);
}

Fixed version (ground truth):
@Test public void providedButNoAutoFactory(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(21).atColumn(38);
}
Program: 25555
Project: 25555
Buggy source:
@Test public void factoryExtendingAbstractClass(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void factoryExtendingAbstractClass(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25556
Project: 25556
Buggy source:
@Test public void failsWithMixedFinals(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(25).atColumn(3).and().withErrorContaining("String_Node_Str").in(file).onLine(26).atColumn(3);
}

Fixed version (ground truth):
@Test public void failsWithMixedFinals(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(25).atColumn(3).and().withErrorContaining("String_Node_Str").in(file).onLine(26).atColumn(3);
}
Program: 25557
Project: 25557
Buggy source:
@Test public void providedOnMethodParameter(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(21).atColumn(23);
}

Fixed version (ground truth):
@Test public void providedOnMethodParameter(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(21).atColumn(23);
}
Program: 25558
Project: 25558
Buggy source:
@Test public void simpleClassNonFinal(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClassNonFinal(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25559
Project: 25559
Buggy source:
@Test public void simpleClassMixedDeps(){
  assert_().about(javaSources()).that(ImmutableSet.of(JavaFileObjects.forResource("String_Node_Str"),JavaFileObjects.forResource("String_Node_Str"))).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClassMixedDeps(){
  assertAbout(javaSources()).that(ImmutableSet.of(JavaFileObjects.forResource("String_Node_Str"),JavaFileObjects.forResource("String_Node_Str"))).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25560
Project: 25560
Buggy source:
@Test public void factoryExtendingAbstractClass_withConstructorParams(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str" + "String_Node_Str").in(file).onLine(21);
}

Fixed version (ground truth):
@Test public void factoryExtendingAbstractClass_withConstructorParams(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str" + "String_Node_Str").in(file).onLine(21);
}
Program: 25561
Project: 25561
Buggy source:
@Test public void factoryExtendingEnum(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str").in(file).onLine(22);
}

Fixed version (ground truth):
@Test public void factoryExtendingEnum(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str").in(file).onLine(22);
}
Program: 25562
Project: 25562
Buggy source:
@Test public void constructorAnnotated(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void constructorAnnotated(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25563
Project: 25563
Buggy source:
@Test public void factoryExtendingInterface(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str").in(file).onLine(20);
}

Fixed version (ground truth):
@Test public void factoryExtendingInterface(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str").in(file).onLine(20);
}
Program: 25564
Project: 25564
Buggy source:
@Test public void simpleClassProvidedDeps(){
  assert_().about(javaSources()).that(ImmutableSet.of(JavaFileObjects.forResource("String_Node_Str"),JavaFileObjects.forResource("String_Node_Str"),JavaFileObjects.forResource("String_Node_Str"))).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClassProvidedDeps(){
  assertAbout(javaSources()).that(ImmutableSet.of(JavaFileObjects.forResource("String_Node_Str"),JavaFileObjects.forResource("String_Node_Str"),JavaFileObjects.forResource("String_Node_Str"))).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25565
Project: 25565
Buggy source:
@Test public void simpleClassImplementingMarker(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClassImplementingMarker(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25566
Project: 25566
Buggy source:
@Test public void simpleClassPassedDeps(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClassPassedDeps(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25567
Project: 25567
Buggy source:
@Test public void mixedDepsImplementingInterfaces(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void mixedDepsImplementingInterfaces(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25568
Project: 25568
Buggy source:
@Test public void invalidCustomName(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(20);
}

Fixed version (ground truth):
@Test public void invalidCustomName(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(20);
}
Program: 25569
Project: 25569
Buggy source:
@Test public void factoryExtendingFinalClass(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str").in(file).onLine(20);
}

Fixed version (ground truth):
@Test public void factoryExtendingFinalClass(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str" + "String_Node_Str").in(file).onLine(20);
}
Program: 25570
Project: 25570
Buggy source:
@Test public void failsOnGenericClass(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(21).atColumn(14);
}

Fixed version (ground truth):
@Test public void failsOnGenericClass(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).failsToCompile().withErrorContaining("String_Node_Str").in(file).onLine(21).atColumn(14);
}
Program: 25571
Project: 25571
Buggy source:
@Test public void simpleClass(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void simpleClass(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25572
Project: 25572
Buggy source:
@Test public void factoryExtendingAbstractClass_multipleConstructors(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).compilesWithoutError();
}

Fixed version (ground truth):
@Test public void factoryExtendingAbstractClass_multipleConstructors(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).compilesWithoutError();
}
Program: 25573
Project: 25573
Buggy source:
@Test public void publicClass(){
  assert_().about(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void publicClass(){
  assertAbout(javaSource()).that(JavaFileObjects.forResource("String_Node_Str")).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25574
Project: 25574
Buggy source:
@Test public void factoryImplementingGenericInterfaceExtension(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assert_().about(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void factoryImplementingGenericInterfaceExtension(){
  JavaFileObject file=JavaFileObjects.forResource("String_Node_Str");
  assertAbout(javaSource()).that(file).processedWith(new AutoFactoryProcessor()).compilesWithoutError().and().generatesSources(JavaFileObjects.forResource("String_Node_Str"));
}
Program: 25576
Project: 25576
Buggy source:
public static InheritTwice create(int answer){
  return new AutoValue_AutoValueTest_InheritTwice(answer);
}

Fixed version (ground truth):
public static InheritsNestedType create(com.google.common.base.Optional<Object> opt){
  return new AutoValue_AutoValueTest_InheritsNestedType(opt);
}
Program: 25577
Project: 25577
Buggy source:
private void defineVarsForType(TypeElement type,AutoValueTemplateVars vars) throws CompileException {
  List<ExecutableElement> methods=new ArrayList<ExecutableElement>();
  findLocalAndInheritedMethods(type,methods);
  determineObjectMethodsToGenerate(methods,vars);
  dontImplementAnnotationEqualsOrHashCode(type,vars);
  List<ExecutableElement> toImplement=methodsToImplement(methods);
  Set<TypeMirror> types=new HashSet<TypeMirror>();
  types.addAll(returnTypesOf(toImplement));
  TypeMirror javaUtilArrays=getTypeMirror(Arrays.class);
  if (containsArrayType(types)) {
    types.add(javaUtilArrays);
  }
  String pkg=TypeSimplifier.packageNameOf(type);
  TypeSimplifier typeSimplifier=new TypeSimplifier(processingEnv.getTypeUtils(),pkg,types);
  vars.imports=typeSimplifier.typesToImport();
  vars.javaUtilArraysSpelling=typeSimplifier.simplify(javaUtilArrays);
  List<Property> props=new ArrayList<Property>();
  for (  ExecutableElement method : toImplement) {
    String propType=typeSimplifier.simplify(method.getReturnType());
    Property prop=new Property(method,propType,vars);
    props.add(prop);
  }
  eclipseHack().reorderProperties(props);
  vars.props=props;
  vars.serialVersionUID=getSerialVersionUID(type);
  vars.formalTypes=typeSimplifier.formalTypeParametersString(type);
  vars.actualTypes=actualTypeParametersString(type);
  vars.wildcardTypes=wildcardTypeParametersString(type);
}

Fixed version (ground truth):
private void defineVarsForType(TypeElement type,AutoValueTemplateVars vars) throws CompileException {
  List<ExecutableElement> methods=new ArrayList<ExecutableElement>();
  findLocalAndInheritedMethods(type,methods);
  determineObjectMethodsToGenerate(methods,vars);
  dontImplementAnnotationEqualsOrHashCode(type,vars);
  List<ExecutableElement> toImplement=methodsToImplement(methods);
  Set<TypeMirror> types=new HashSet<TypeMirror>();
  types.addAll(returnTypesOf(toImplement));
  TypeMirror javaUtilArrays=getTypeMirror(Arrays.class);
  if (containsArrayType(types)) {
    types.add(javaUtilArrays);
  }
  String pkg=TypeSimplifier.packageNameOf(type);
  TypeSimplifier typeSimplifier=new TypeSimplifier(processingEnv.getTypeUtils(),pkg,types,type.asType());
  vars.imports=typeSimplifier.typesToImport();
  vars.javaUtilArraysSpelling=typeSimplifier.simplify(javaUtilArrays);
  List<Property> props=new ArrayList<Property>();
  for (  ExecutableElement method : toImplement) {
    String propType=typeSimplifier.simplify(method.getReturnType());
    Property prop=new Property(method,propType,vars);
    props.add(prop);
  }
  eclipseHack().reorderProperties(props);
  vars.props=props;
  vars.serialVersionUID=getSerialVersionUID(type);
  vars.formalTypes=typeSimplifier.formalTypeParametersString(type);
  vars.actualTypes=actualTypeParametersString(type);
  vars.wildcardTypes=wildcardTypeParametersString(type);
}
Program: 25578
Project: 25578
Buggy source:
TypeSimplifier(Types typeUtil,String packageName,Set<TypeMirror> types){
  this.typeUtil=typeUtil;
  Set<TypeMirror> referenced=referencedClassTypes(typeUtil,types);
  this.imports=findImports(typeUtil,packageName,referenced);
}

Fixed version (ground truth):
TypeSimplifier(Types typeUtil,String packageName,Set<TypeMirror> types,TypeMirror base){
  this.typeUtil=typeUtil;
  Set<TypeMirror> referenced=referencedClassTypes(typeUtil,types);
  Set<TypeMirror> defined=nonPrivateDeclaredTypes(typeUtil,base);
  this.imports=findImports(typeUtil,packageName,referenced,defined);
}
Program: 25580
Project: 25580
Buggy source:
public void testImportsForDefaultPackage(){
  ImmutableSet.Builder<TypeMirror> typesBuilder=ImmutableSet.builder();
  for (  String className : CLASS_TO_SOURCE.keySet()) {
    typesBuilder.add(typeMirrorOf(className));
  }
  typesBuilder.add(typeUtil.getPrimitiveType(TypeKind.INT),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"));
  List<String> expectedImports=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  TypeSimplifier typeSimplifier=new TypeSimplifier(typeUtil,"String_Node_Str",typesBuilder.build());
  assertEquals(expectedImports,ImmutableList.copyOf(typeSimplifier.typesToImport()));
}

Fixed version (ground truth):
public void testImportsForDefaultPackage(){
  ImmutableSet.Builder<TypeMirror> typesBuilder=ImmutableSet.builder();
  for (  String className : CLASS_TO_SOURCE.keySet()) {
    typesBuilder.add(typeMirrorOf(className));
  }
  typesBuilder.add(typeUtil.getPrimitiveType(TypeKind.INT),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"),typeMirrorOf("String_Node_Str"));
  List<String> expectedImports=ImmutableList.of("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str");
  TypeSimplifier typeSimplifier=new TypeSimplifier(typeUtil,"String_Node_Str",typesBuilder.build(),baseWithoutContainedTypes());
  assertEquals(expectedImports,ImmutableList.copyOf(typeSimplifier.typesToImport()));
}
Program: 25581
Project: 25581
Buggy source:
public void testSimplifyJavaLangThreadState(){
  TypeMirror threadState=typeMirrorOf("String_Node_Str");
  Set<TypeMirror> types=ImmutableSet.of(threadState);
  TypeSimplifier typeSimplifier=new TypeSimplifier(typeUtil,"String_Node_Str",types);
  assertEquals("String_Node_Str",typeSimplifier.simplify(threadState));
}

Fixed version (ground truth):
public void testSimplifyJavaLangThreadState(){
  TypeMirror threadState=typeMirrorOf("String_Node_Str");
  Set<TypeMirror> types=ImmutableSet.of(threadState);
  TypeSimplifier typeSimplifier=new TypeSimplifier(typeUtil,"String_Node_Str",types,baseWithoutContainedTypes());
  assertEquals("String_Node_Str",typeSimplifier.simplify(threadState));
}