nus-yam/ex-repair huggingface dataset:
Program: 53440
Project: 53440
Buggy source:
/** 
 * Create the mapping from a class to the types it can be cast to.
 */
private void computeCastMap(JReferenceType type){
  if (type == null || alreadyRan.contains(type)) {
    return;
  }
  assert(type == type.getUnderlyingType());
  alreadyRan.add(type);
  if (type instanceof JClassType) {
    computeCastMap(((JClassType)type).getSuperClass());
  }
  if (!typeOracle.isInstantiatedType(type) || typeOracle.isJavaScriptObject(type)) {
    return;
  }
  Set<JReferenceType> castableTypes=new TreeSet<JReferenceType>(HasName.BY_NAME_COMPARATOR);
  for (  JReferenceType castTargetType : castSourceTypesPerCastTargetType.keySet()) {
    if (!canTriviallyCastJsoSemantics(type,castTargetType)) {
      continue;
    }
    Collection<JReferenceType> castSourceTypes=castSourceTypesPerCastTargetType.get(castTargetType);
    for (    JReferenceType castSourceType : castSourceTypes) {
      if (canTriviallyCastJsoSemantics(type,castSourceType) || typeOracle.isJavaScriptObject(castTargetType)) {
        boolean isTrivialCast=castTargetType == program.getTypeJavaLangObject() || castTargetType == program.getJavaScriptObject();
        if (recordTrivialCasts || !isTrivialCast) {
          castableTypes.add(castTargetType);
        }
        break;
      }
    }
  }
  if (castableTypes.isEmpty() && type != program.getTypeJavaLangObject() && type != program.getTypeJavaLangString()) {
    return;
  }
  castableTypesMap.put(type,new JCastMap(SourceOrigin.UNKNOWN,program.getTypeJavaLangObject(),Collections.unmodifiableSet(castableTypes)));
}

Fixed version (ground truth):
/** 
 * Create the mapping from a class to the types it can be cast to.
 */
private void computeCastMap(JReferenceType type){
  if (type == null || alreadyRan.contains(type)) {
    return;
  }
  assert(type == type.getUnderlyingType());
  alreadyRan.add(type);
  if (type instanceof JClassType) {
    computeCastMap(((JClassType)type).getSuperClass());
  }
  if (!typeOracle.isInstantiatedType(type) || type.isJsoType()) {
    return;
  }
  Set<JReferenceType> castableTypes=new TreeSet<JReferenceType>(HasName.BY_NAME_COMPARATOR);
  for (  JReferenceType castTargetType : castSourceTypesPerCastTargetType.keySet()) {
    if (!castSucceedsTriviallyJsoSemantics(type,castTargetType)) {
      continue;
    }
    Collection<JReferenceType> castSourceTypes=castSourceTypesPerCastTargetType.get(castTargetType);
    for (    JReferenceType castSourceType : castSourceTypes) {
      if (castSucceedsTriviallyJsoSemantics(type,castSourceType) || castTargetType.isJsoType()) {
        boolean isTrivialCast=castTargetType == program.getTypeJavaLangObject() || castTargetType == program.getJavaScriptObject();
        if (recordTrivialCasts || !isTrivialCast) {
          castableTypes.add(castTargetType);
        }
        break;
      }
    }
  }
  if (castableTypes.isEmpty() && type != program.getTypeJavaLangObject() && type != program.getTypeJavaLangString()) {
    return;
  }
  castableTypesMap.put(type,new JCastMap(SourceOrigin.UNKNOWN,program.getTypeJavaLangObject(),Collections.unmodifiableSet(castableTypes)));
}
Program: 53441
Project: 53441
Buggy source:
private void instantiateJsoInterface(JReferenceType toType){
  if (instantiatedJsoTypes.add(toType)) {
    if (program.typeOracle.getSingleJsoImpl(toType) != null) {
      instantiateJsoInterface(program.typeOracle.getSingleJsoImpl(toType));
    }
    if (toType instanceof JClassType) {
      JClassType superType=((JClassType)toType).getSuperClass();
      if (superType != null && program.typeOracle.isJavaScriptObject(superType)) {
        instantiateJsoInterface(superType);
      }
    }
    for (    JInterfaceType intf : ((JDeclaredType)toType).getImplements()) {
      if (intf.isJsType() || program.typeOracle.getSingleJsoImpl(intf) != null) {
        instantiateJsoInterface(intf);
      }
    }
  }
}

Fixed version (ground truth):
private void instantiateJsoInterface(JReferenceType toType){
  if (instantiatedJsoTypes.add(toType)) {
    if (program.typeOracle.getSingleJsoImpl(toType) != null) {
      instantiateJsoInterface(program.typeOracle.getSingleJsoImpl(toType));
    }
    if (toType instanceof JClassType) {
      JClassType superType=((JClassType)toType).getSuperClass();
      if (superType != null && superType.isJsoType()) {
        instantiateJsoInterface(superType);
      }
    }
    for (    JInterfaceType intf : ((JDeclaredType)toType).getImplements()) {
      if (intf.isJsType() || program.typeOracle.getSingleJsoImpl(intf) != null) {
        instantiateJsoInterface(intf);
      }
    }
  }
}
Program: 53443
Project: 53443
Buggy source:
private static void addDays(Date date,int days){
  CalendarUtil.addDaysToDate(date,days);
  if (date.getHours() != 0) {
    date.setHours(0);
  }
}

Fixed version (ground truth):
private static void addDays(Date date,int days){
  CalendarUtil.addDaysToDate(date,days);
  CalendarUtil.resetTime(date);
}
Program: 53444
Project: 53444
Buggy source:
/** 
 * Detects if the requested time falls into a non-existent time range due to local time advancing into daylight savings time or is ambiguous due to going out of daylight savings. If so, adjust accordingly.
 */
private void fixDaylightSavings(int requestedHours){
  int hours=jsdate.getHours();
  if ((hours % 24) != (requestedHours % 24)) {
    JsDate copy=JsDate.create(jsdate.getTime());
    copy.setDate(copy.getDate() + 1);
    int timeDiff=jsdate.getTimezoneOffset() - copy.getTimezoneOffset();
    if (timeDiff > 0) {
      int timeDiffHours=timeDiff / 60;
      int timeDiffMinutes=timeDiff % 60;
      int day=jsdate.getDate();
      int badHours=jsdate.getHours();
      if (badHours + timeDiffHours >= 24) {
        day++;
      }
      JsDate newTime=JsDate.create(jsdate.getFullYear(),jsdate.getMonth(),day,requestedHours + timeDiffHours,jsdate.getMinutes() + timeDiffMinutes,jsdate.getSeconds(),jsdate.getMilliseconds());
      jsdate.setTime(newTime.getTime());
    }
    return;
  }
  double originalTimeInMillis=jsdate.getTime();
  jsdate.setTime(originalTimeInMillis + ONE_HOUR_IN_MILLISECONDS);
  if (hours != jsdate.getHours()) {
    jsdate.setTime(originalTimeInMillis);
  }
}

Fixed version (ground truth):
/** 
 * Detects if the requested time falls into a non-existent time range due to local time advancing into daylight savings time or is ambiguous due to going out of daylight savings. If so, adjust accordingly.
 */
private void fixDaylightSavings(int requestedHours){
  requestedHours%=24;
  if (jsdate.getHours() != requestedHours) {
    JsDate copy=JsDate.create(jsdate.getTime());
    copy.setDate(copy.getDate() + 1);
    int timeDiff=jsdate.getTimezoneOffset() - copy.getTimezoneOffset();
    if (timeDiff > 0) {
      int timeDiffHours=timeDiff / 60;
      int timeDiffMinutes=timeDiff % 60;
      int day=jsdate.getDate();
      int badHours=jsdate.getHours();
      if (badHours + timeDiffHours >= 24) {
        day++;
      }
      JsDate newTime=JsDate.create(jsdate.getFullYear(),jsdate.getMonth(),day,requestedHours + timeDiffHours,jsdate.getMinutes() + timeDiffMinutes,jsdate.getSeconds(),jsdate.getMilliseconds());
      jsdate.setTime(newTime.getTime());
    }
  }
  double originalTimeInMillis=jsdate.getTime();
  jsdate.setTime(originalTimeInMillis + ONE_HOUR_IN_MILLISECONDS);
  if (jsdate.getHours() != requestedHours) {
    jsdate.setTime(originalTimeInMillis);
  }
}
Program: 53445
Project: 53445
Buggy source:
@Override public Map<AbstractResource,ResourceResolution> findApplicableResources(TreeLogger logger,PathPrefixSet pathPrefixSet){
  try {
    return ResourceAccumulatorManager.get(this,pathPrefixSet).getResources();
  }
 catch (  IOException e) {
    logger.log(TreeLogger.WARN,"String_Node_Str" + dir + "String_Node_Str",e);
    return Maps.newLinkedHashMap();
  }
}

Fixed version (ground truth):
@Override public Map<AbstractResource,ResourceResolution> findApplicableResources(TreeLogger logger,PathPrefixSet pathPrefixSet){
  try {
    return ResourceAccumulatorManager.get(this,pathPrefixSet).getResources();
  }
 catch (  IOException e) {
    System.err.println("String_Node_Str" + dir + "String_Node_Str");
    e.printStackTrace();
    return Maps.newLinkedHashMap();
  }
}
Program: 53446
Project: 53446
Buggy source:
private void onNewDirectory(Path directory) throws IOException {
  String relativePath=getRelativePath(directory);
  if (!relativePath.isEmpty() && !getPathPrefixSet().includesDirectory(relativePath)) {
    return;
  }
  if (WATCH_FILE_CHANGES) {
    directory.register(watchService,ENTRY_CREATE,ENTRY_DELETE);
  }
  try (DirectoryStream<Path> stream=Files.newDirectoryStream(directory)){
    for (    Path child : stream) {
      childPathsByParentPath.put(directory,child);
      onNewPath(child);
    }
  }
 }

Fixed version (ground truth):
private void onNewDirectory(Path directory) throws IOException {
  String relativePath=getRelativePath(directory);
  if (!relativePath.isEmpty() && !getPathPrefixSet().includesDirectory(relativePath)) {
    return;
  }
  if (watchService != null) {
    directory.register(watchService,ENTRY_CREATE,ENTRY_DELETE);
  }
  try (DirectoryStream<Path> stream=Files.newDirectoryStream(directory)){
    for (    Path child : stream) {
      childPathsByParentPath.put(directory,child);
      onNewPath(child);
    }
  }
 }
Program: 53447
Project: 53447
Buggy source:
/** 
 * Full refresh clears existing resources and watchers and does a clean refresh.
 */
private void fullRefresh() throws IOException {
  resolutionsByResource=Maps.newIdentityHashMap();
  childPathsByParentPath=ArrayListMultimap.create();
  stopWatchService();
  if (WATCH_FILE_CHANGES) {
    watchService=FileSystems.getDefault().newWatchService();
  }
  onNewDirectory(rootDirectory);
}

Fixed version (ground truth):
/** 
 * Full refresh clears existing resources and watchers and does a clean refresh.
 */
private void fullRefresh() throws IOException {
  resolutionsByResource=Maps.newIdentityHashMap();
  childPathsByParentPath=ArrayListMultimap.create();
  maybeInitializeWatchService();
  onNewDirectory(rootDirectory);
}
Program: 53449
Project: 53449
Buggy source:
@Override protected void setUp() throws Exception {
  super.setUp();
  FooResourceGenerator.runCount=0;
  BarReferencesFooGenerator.runCount=0;
  CauseStringRebindGenerator.runCount=0;
  CauseShortRebindGenerator.runCount=0;
}

Fixed version (ground truth):
@Override protected void setUp() throws Exception {
  super.setUp();
  FooResourceGenerator.runCount=0;
  BarReferencesFooGenerator.runCount=0;
  CauseStringRebindGenerator.runCount=0;
  CauseShortRebindGenerator.runCount=0;
  System.gc();
}
Program: 53451
Project: 53451
Buggy source:
public String getQualifiedExportName(){
  if (enclosingType == null) {
    return jsNamespace == null || jsNamespace.isEmpty() ? getName() : jsNamespace + "String_Node_Str" + getLeafName();
  }
 else {
    return enclosingType.getQualifiedExportName() + "String_Node_Str" + getLeafName();
  }
}

Fixed version (ground truth):
public String getQualifiedExportName(){
  if (enclosingType == null && jsNamespace == null) {
    return getName();
  }
  String namespace=jsNamespace == null ? enclosingType.getQualifiedExportName() : jsNamespace;
  return namespace.isEmpty() ? getSimpleName() : namespace + "String_Node_Str" + getSimpleName();
}
Program: 53452
Project: 53452
Buggy source:
private Object readResolve(){
  JConstructor result=new JConstructor(SourceOrigin.UNKNOWN,enclosingType);
  result.signature=signature;
  return result;
}

Fixed version (ground truth):
private Object readResolve(){
  JConstructor result=new JConstructor(SourceOrigin.UNKNOWN,enclosingType,AccessModifier.PUBLIC);
  result.signature=signature;
  return result;
}
Program: 53453
Project: 53453
Buggy source:
public JConstructor(SourceInfo info,JClassType enclosingType){
  super(info,enclosingType.getShortName(),enclosingType,JPrimitiveType.VOID,false,false,true,AccessModifier.PUBLIC);
}

Fixed version (ground truth):
public JConstructor(SourceInfo info,JClassType enclosingType,AccessModifier access){
  super(info,enclosingType.getShortName(),enclosingType,JPrimitiveType.VOID,false,false,true,access);
}
Program: 53454
Project: 53454
Buggy source:
JMethod createConstructor(SourceInfo info,MethodBinding b){
  JDeclaredType enclosingType=(JDeclaredType)get(b.declaringClass);
  JMethod method=new JConstructor(info,(JClassType)enclosingType);
  enclosingType.addMethod(method);
  int argPosition=0;
  ReferenceBinding declaringClass=b.declaringClass;
  if (declaringClass.isNestedType() && !declaringClass.isStatic()) {
    if (declaringClass.syntheticEnclosingInstanceTypes() != null) {
      for (      ReferenceBinding argType : declaringClass.syntheticEnclosingInstanceTypes()) {
        createParameter(info,argType,method,argPosition++);
      }
    }
  }
  argPosition=mapParameters(info,method,b,argPosition);
  if (declaringClass.isNestedType() && !declaringClass.isStatic()) {
    if (declaringClass.syntheticOuterLocalVariables() != null) {
      for (      SyntheticArgumentBinding arg : declaringClass.syntheticOuterLocalVariables()) {
        createParameter(info,arg.type,method,argPosition++);
      }
    }
  }
  mapExceptions(method,b);
  if (b.isSynthetic()) {
    method.setSynthetic();
  }
  return method;
}

Fixed version (ground truth):
JMethod createConstructor(SourceInfo info,MethodBinding b){
  JDeclaredType enclosingType=(JDeclaredType)get(b.declaringClass);
  JMethod method=new JConstructor(info,(JClassType)enclosingType,AccessModifier.fromMethodBinding(b));
  enclosingType.addMethod(method);
  int argPosition=0;
  ReferenceBinding declaringClass=b.declaringClass;
  if (declaringClass.isNestedType() && !declaringClass.isStatic()) {
    if (declaringClass.syntheticEnclosingInstanceTypes() != null) {
      for (      ReferenceBinding argType : declaringClass.syntheticEnclosingInstanceTypes()) {
        createParameter(info,argType,method,argPosition++);
      }
    }
  }
  argPosition=mapParameters(info,method,b,argPosition);
  if (declaringClass.isNestedType() && !declaringClass.isStatic()) {
    if (declaringClass.syntheticOuterLocalVariables() != null) {
      for (      SyntheticArgumentBinding arg : declaringClass.syntheticOuterLocalVariables()) {
        createParameter(info,arg.type,method,argPosition++);
      }
    }
  }
  mapExceptions(method,b);
  if (b.isSynthetic()) {
    method.setSynthetic();
  }
  return method;
}
Program: 53455
Project: 53455
Buggy source:
private void assertCompileFails(){
  try {
    optimize("String_Node_Str","String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertTrue(e.getCause() instanceof UnableToCompleteException);
  }
}

Fixed version (ground truth):
private void assertCompileFails(){
  try {
    optimize("String_Node_Str","String_Node_Str");
    fail("String_Node_Str");
  }
 catch (  Exception e) {
    assertTrue(e.getCause() instanceof UnableToCompleteException || e instanceof UnableToCompleteException);
  }
}
Program: 53457
Project: 53457
Buggy source:
public T accept(Lambda<T> foo){
  return foo.run(10,20);
}

Fixed version (ground truth):
void accept(TestLambda_Inner t);
Program: 53458
Project: 53458
Buggy source:
void f(){
  Ctor c=X2::new;
  X2 x=c.makeX(123456);
  assertEquals(123456,x.field);
  c=Y::new;
  x=c.makeX(987654);
  x=new Y(987654);
  assertEquals(987655,x.field);
  c=Z::new;
  x=c.makeX(456789);
  x=new Z(456789);
  assertEquals(456791,x.field);
}

Fixed version (ground truth):
void f();
Program: 53459
Project: 53459
Buggy source:
private boolean isGetter(String name,MethodBinding mb){
  if (name.length() > 3 && name.startsWith("String_Node_Str") && Character.isUpperCase(name.charAt(3)) && mb.returnType == TypeBinding.VOID && mb.parameters.length == 0) {
    return true;
  }
 else   if (name.length() > 3 && name.startsWith("String_Node_Str") && Character.isUpperCase(name.charAt(2)) && mb.returnType == TypeBinding.BOOLEAN && mb.parameters.length == 0) {
    return true;
  }
 else   if (mb.parameters.length == 0 && mb.returnType != TypeBinding.VOID) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private boolean isGetter(String methodName,MethodBinding methodBinding){
  if (methodBinding.parameters.length > 0 || methodBinding.returnType == TypeBinding.VOID) {
    return false;
  }
  if (startsWithCamelCase(methodName,"String_Node_Str")) {
    return false;
  }
  if ((startsWithCamelCase(methodName,"String_Node_Str") || startsWithCamelCase(methodName,"String_Node_Str")) && methodBinding.returnType != TypeBinding.BOOLEAN) {
    return false;
  }
  return true;
}
Program: 53460
Project: 53460
Buggy source:
private void checkJsTypeMethodsForOverloads(Map<String,MethodBinding> methodNamesAndSigs,Map<String,MethodBinding> noExports,ReferenceBinding binding){
  if (isJsType(binding)) {
    for (    MethodBinding mb : binding.methods()) {
      String methodName=String.valueOf(mb.selector);
      if (JdtUtil.getAnnotation(mb,JsInteropUtil.JSNOEXPORT_CLASS) != null) {
        noExports.put(methodName,mb);
        continue;
      }
      if (mb.isConstructor() || mb.isStatic()) {
        continue;
      }
      if (JdtUtil.getAnnotation(mb,JsInteropUtil.JSPROPERTY_CLASS) != null) {
        if (isGetter(methodName,mb) || isSetter(methodName,mb) || isHas(methodName,mb)) {
          continue;
        }
      }
      if (methodNamesAndSigs.containsKey(methodName)) {
        if (!methodNamesAndSigs.get(methodName).areParameterErasuresEqual(mb)) {
          if (noExports.containsKey(methodName) && noExports.get(methodName).areParameterErasuresEqual(mb)) {
            continue;
          }
          errorOn(mb,ERR_JSTYPE_OVERLOADS_NOT_ALLOWED);
        }
      }
 else {
        methodNamesAndSigs.put(methodName,mb);
      }
    }
  }
  for (  ReferenceBinding rb : binding.superInterfaces()) {
    checkJsTypeMethodsForOverloads(methodNamesAndSigs,noExports,rb);
  }
}

Fixed version (ground truth):
private void checkJsTypeMethodsForOverloads(Map<String,MethodBinding> methodNamesAndSigs,Map<String,MethodBinding> noExports,ReferenceBinding binding){
  if (isJsType(binding)) {
    for (    MethodBinding mb : binding.methods()) {
      String methodName=String.valueOf(mb.selector);
      if (JdtUtil.getAnnotation(mb,JsInteropUtil.JSNOEXPORT_CLASS) != null) {
        noExports.put(methodName,mb);
        continue;
      }
      if (mb.isConstructor() || mb.isStatic()) {
        continue;
      }
      if (JdtUtil.getAnnotation(mb,JsInteropUtil.JSPROPERTY_CLASS) != null) {
        if (isGetter(methodName,mb) || isSetter(methodName,mb)) {
          continue;
        }
      }
      if (methodNamesAndSigs.containsKey(methodName)) {
        if (!methodNamesAndSigs.get(methodName).areParameterErasuresEqual(mb)) {
          if (noExports.containsKey(methodName) && noExports.get(methodName).areParameterErasuresEqual(mb)) {
            continue;
          }
          errorOn(mb,ERR_JSTYPE_OVERLOADS_NOT_ALLOWED);
        }
      }
 else {
        methodNamesAndSigs.put(methodName,mb);
      }
    }
  }
  for (  ReferenceBinding rb : binding.superInterfaces()) {
    checkJsTypeMethodsForOverloads(methodNamesAndSigs,noExports,rb);
  }
}
Program: 53461
Project: 53461
Buggy source:
private void checkJsProperty(MethodBinding mb,boolean allowed){
  AnnotationBinding jsProperty=JdtUtil.getAnnotation(mb,JsInteropUtil.JSPROPERTY_CLASS);
  if (jsProperty != null) {
    if (!allowed) {
      errorOn(mb,ERR_JSPROPERTY_ONLY_ON_INTERFACES);
      return;
    }
    String methodName=String.valueOf(mb.selector);
    if (!isGetter(methodName,mb) && !isSetter(methodName,mb) && !isHas(methodName,mb)) {
      errorOn(mb,ERR_JSPROPERTY_ONLY_BEAN_OR_FLUENT_STYLE_NAMING);
    }
  }
}

Fixed version (ground truth):
private void checkJsProperty(MethodBinding mb,boolean allowed){
  AnnotationBinding jsProperty=JdtUtil.getAnnotation(mb,JsInteropUtil.JSPROPERTY_CLASS);
  if (jsProperty != null) {
    if (!allowed) {
      errorOn(mb,ERR_JSPROPERTY_ONLY_ON_INTERFACES);
      return;
    }
    String methodName=String.valueOf(mb.selector);
    if (!isGetter(methodName,mb) && !isSetter(methodName,mb)) {
      errorOn(mb,ERR_JSPROPERTY_ONLY_BEAN_OR_FLUENT_STYLE_NAMING);
    }
  }
}
Program: 53462
Project: 53462
Buggy source:
private boolean isSetter(String name,MethodBinding mb){
  if (mb.returnType == TypeBinding.VOID || mb.returnType == mb.declaringClass) {
    if (name.length() > 3 && name.startsWith("String_Node_Str") && Character.isUpperCase(name.charAt(3)) && mb.parameters.length == 1) {
      return true;
    }
 else     if (mb.parameters.length == 1) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isSetter(String methodName,MethodBinding methodBinding){
  if (methodBinding.parameters.length != 1) {
    return false;
  }
  if (startsWithCamelCase(methodName,"String_Node_Str") || startsWithCamelCase(methodName,"String_Node_Str") || startsWithCamelCase(methodName,"String_Node_Str")) {
    return false;
  }
  if (methodBinding.returnType != TypeBinding.VOID && methodBinding.returnType != methodBinding.declaringClass) {
    return false;
  }
  return true;
}
Program: 53463
Project: 53463
Buggy source:
public void testJsPropertyNoErrors(){
  StringBuilder buggyCode=new StringBuilder();
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  shouldGenerateNoError(buggyCode);
}

Fixed version (ground truth):
public void testJsPropertyNoErrors(){
  StringBuilder buggyCode=new StringBuilder();
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  buggyCode.append("String_Node_Str");
  shouldGenerateNoError(buggyCode);
}
Program: 53464
Project: 53464
Buggy source:
String mangleName(JField x){
  String s=getNameString(x.getEnclosingType()) + '_' + getNameString(x);
  return s;
}

Fixed version (ground truth):
String mangleName(JField x){
  String s=JjsUtils.getNameString(x.getEnclosingType()) + '_' + JjsUtils.getNameString(x);
  return s;
}
Program: 53465
Project: 53465
Buggy source:
String mangleNameForGlobal(JMethod x){
  String s=getNameString(x.getEnclosingType()) + '_' + getNameString(x)+ "String_Node_Str";
  for (int i=0; i < x.getOriginalParamTypes().size(); ++i) {
    JType type=x.getOriginalParamTypes().get(i);
    s+=type.getJavahSignatureName();
  }
  s+=x.getOriginalReturnType().getJavahSignatureName();
  return StringInterner.get().intern(s);
}

Fixed version (ground truth):
String mangleNameForGlobal(JMethod x){
  String s=JjsUtils.getNameString(x.getEnclosingType()) + '_' + JjsUtils.getNameString(x)+ "String_Node_Str";
  for (int i=0; i < x.getOriginalParamTypes().size(); ++i) {
    JType type=x.getOriginalParamTypes().get(i);
    s+=type.getJavahSignatureName();
  }
  s+=x.getOriginalReturnType().getJavahSignatureName();
  return StringInterner.get().intern(s);
}
Program: 53466
Project: 53466
Buggy source:
private String exportProvidedNamespace(JDeclaredType x,List<JsStatement> globalStmts,String lastProvidedNamespace,Pair<String,String> exportNamespacePair){
  if (!exportNamespacePair.getLeft().equals(lastProvidedNamespace)) {
    if (jsInteropMode == OptionJsInteropMode.Mode.JS) {
      JsName provideFunc=indexedFunctions.get("String_Node_Str").getName();
      JsNameRef provideFuncRef=provideFunc.makeRef(x.getSourceInfo());
      JsInvocation provideCall=new JsInvocation(x.getSourceInfo());
      provideCall.setQualifier(provideFuncRef);
      provideCall.getArguments().add(new JsStringLiteral(x.getSourceInfo(),exportNamespacePair.getLeft()));
      JsExprStmt provideStat=createAssignment(globalTemp.makeRef(x.getSourceInfo()),provideCall).makeStmt();
      globalStmts.add(provideStat);
    }
 else     if (jsInteropMode == OptionJsInteropMode.Mode.JS && jsExportClosureStyle) {
      if (x.getEnclosingType() != null) {
        JsNameRef lhs=getExportLhsQualifier(x,x.getQualifiedExportName());
        JsNameRef rhsRef=getExportLhsQualifier(x,x.getQualifiedExportName());
        globalStmts.add(createAssignment(lhs,new JsBinaryOperation(x.getSourceInfo(),JsBinaryOperator.OR,rhsRef,new JsObjectLiteral(x.getSourceInfo()))).makeStmt());
      }
    }
    lastProvidedNamespace=exportNamespacePair.getLeft();
  }
  return lastProvidedNamespace;
}

Fixed version (ground truth):
private String exportProvidedNamespace(JDeclaredType x,List<JsStatement> globalStmts,String lastProvidedNamespace,Pair<String,String> exportNamespacePair){
  if (!exportNamespacePair.getLeft().equals(lastProvidedNamespace)) {
    if (!jsExportClosureStyle) {
      JsName provideFunc=indexedFunctions.get("String_Node_Str").getName();
      JsNameRef provideFuncRef=provideFunc.makeRef(x.getSourceInfo());
      JsInvocation provideCall=new JsInvocation(x.getSourceInfo());
      provideCall.setQualifier(provideFuncRef);
      provideCall.getArguments().add(new JsStringLiteral(x.getSourceInfo(),exportNamespacePair.getLeft()));
      JsExprStmt provideStat=createAssignment(globalTemp.makeRef(x.getSourceInfo()),provideCall).makeStmt();
      globalStmts.add(provideStat);
    }
 else {
      if (x.getEnclosingType() != null) {
        JsNameRef lhs=getExportLhsQualifier(x,x.getQualifiedExportName());
        JsNameRef rhsRef=getExportLhsQualifier(x,x.getQualifiedExportName());
        globalStmts.add(createAssignment(lhs,new JsBinaryOperation(x.getSourceInfo(),JsBinaryOperator.OR,rhsRef,new JsObjectLiteral(x.getSourceInfo()))).makeStmt());
      }
    }
    lastProvidedNamespace=exportNamespacePair.getLeft();
  }
  return lastProvidedNamespace;
}
Program: 53468
Project: 53468
Buggy source:
@Override public JType getType(){
  return field.getType();
}

Fixed version (ground truth):
@Override public JType getType(){
}
Program: 53469
Project: 53469
Buggy source:
public CudInfo(CompilationUnitDeclaration cud){
  separatorPositions=cud.compilationResult().getLineSeparatorPositions();
  scope=cud.scope;
}

Fixed version (ground truth):
public CudInfo(CompilationUnitDeclaration cud){
  separatorPositions=cud.compilationResult().getLineSeparatorPositions();
  scope=cud.scope;
  this.cud=cud;
}
Program: 53470
Project: 53470
Buggy source:
/** 
 * Builds all the GWT AST nodes that correspond to one Java source file.
 * @param cud The compiled form of the Java source from the JDT.
 * @param sourceMapPath the path that should be included in a sourcemap.
 * @param jsniMethods Native methods to add to the AST.
 * @param jsniRefs Map from JSNI references to their JDT definitions.
 * @param compilerContext the compiler context.
 * @return All the types seen in this source file.
 */
public List<JDeclaredType> process(CompilationUnitDeclaration cud,String sourceMapPath,Map<MethodDeclaration,JsniMethod> jsniMethods,Map<String,Binding> jsniRefs,CompilerContext compilerContext){
  if (cud.types == null) {
    return Collections.emptyList();
  }
  this.sourceMapPath=sourceMapPath;
  this.jsniRefs=jsniRefs;
  this.jsniMethods=jsniMethods;
  this.compilerContext=compilerContext;
  newTypes=Lists.newArrayList();
  curCud=new CudInfo(cud);
  for (  TypeDeclaration typeDecl : cud.types) {
    createTypes(typeDecl);
  }
  javaLangObject=(JClassType)typeMap.get(cud.scope.getJavaLangObject());
  javaLangString=(JClassType)typeMap.get(cud.scope.getJavaLangString());
  javaLangClass=(JClassType)typeMap.get(cud.scope.getJavaLangClass());
  javaLangThrowable=(JClassType)typeMap.get(cud.scope.getJavaLangThrowable());
  for (  TypeDeclaration typeDecl : cud.types) {
    resolveTypeRefs(typeDecl);
  }
  for (  TypeDeclaration typeDecl : cud.types) {
    createMembers(typeDecl);
  }
  for (  TypeDeclaration typeDecl : cud.types) {
    typeDecl.traverse(astVisitor,cud.scope);
  }
  List<JDeclaredType> result=newTypes;
  typeMap.clearSource();
  this.jsniRefs=jsniRefs;
  this.jsniMethods=jsniMethods;
  newTypes=null;
  curCud=null;
  javaLangObject=null;
  javaLangString=null;
  javaLangClass=null;
  javaLangThrowable=null;
  return result;
}

Fixed version (ground truth):
public static List<JDeclaredType> process(CompilationUnitDeclaration cud,String sourceMapPath,Map<MethodDeclaration,JsniMethod> jsniMethods,Map<String,Binding> jsniRefs,CompilerContext compilerContext){
  return new GwtAstBuilder(cud,sourceMapPath,jsniMethods,jsniRefs,compilerContext).processImpl();
}
Program: 53471
Project: 53471
Buggy source:
@Override public void setUp(){
  sourceLevel=SourceLevel.JAVA8;
  addAll(LAMBDA_METAFACTORY);
  addAll(JavaResourceBase.createMockJavaResource("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  addAll(JavaResourceBase.createMockJavaResource("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  addAll(JavaResourceBase.createMockJavaResource("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  addAll(JavaResourceBase.createMockJavaResource("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"));
  addAll(JavaResourceBase.createMockJavaResource("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
@Override public void setUp(){
  sourceLevel=SourceLevel.JAVA8;
  addAll(LAMBDA_METAFACTORY);
  addAll(JavaResourceBase.createMockJavaResource("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  addAll(JavaResourceBase.createMockJavaResource("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  addAll(JavaResourceBase.createMockJavaResource("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  addAll(JavaResourceBase.createMockJavaResource("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"));
  addAll(JavaResourceBase.createMockJavaResource("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"));
}
Program: 53472
Project: 53472
Buggy source:
private static String computeName(JMethod method){
  return method.getJsniSignature(true,false);
}

Fixed version (ground truth):
private static String computeName(JMethod method){
  return method.getJsniSignature(true,true);
}
Program: 53474
Project: 53474
Buggy source:
@Override public void endVisit(JParameter x,Context ctx){
  tighten(x);
}

Fixed version (ground truth):
@Override public void endVisit(JParameter x,Context ctx){
  JMethod currentMethod=getCurrentMethod();
  if (program.codeGenTypes.contains(currentMethod.getEnclosingType()) || program.typeOracle.isExportedMethod(currentMethod) || program.typeOracle.isJsTypeMethod(currentMethod)) {
    return;
  }
  tighten(x);
}
Program: 53475
Project: 53475
Buggy source:
@Override public boolean enter(JMethod x,Context ctx){
  return !program.codeGenTypes.contains(x.getEnclosingType()) && !x.isNative() || program.typeOracle.isJsTypeMethod(x) || program.typeOracle.isExportedMethod(x);
}

Fixed version (ground truth):
@Override public boolean enter(JMethod x,Context ctx){
  return !x.isNative();
}
Program: 53476
Project: 53476
Buggy source:
/** 
 * Tighten based on assignment, and for parameters, callArgs as well.
 */
private void tighten(JVariable x){
  if (!(x.getType() instanceof JReferenceType)) {
    return;
  }
  JReferenceType refType=(JReferenceType)x.getType();
  if (program.typeOracle.isJsType(refType)) {
    return;
  }
  if (refType == program.getTypeNull()) {
    return;
  }
  if (!program.typeOracle.isInstantiatedType(refType)) {
    x.setType(program.getTypeNull());
    madeChanges();
    return;
  }
  JReferenceType leafType=getSingleConcreteType(refType);
  if (leafType != null) {
    x.setType(leafType);
    madeChanges();
    return;
  }
  List<JReferenceType> typeList=Lists.newArrayList();
  Collection<JExpression> myAssignments=assignments.get(x);
  if (myAssignments != null) {
    for (    JExpression expr : myAssignments) {
      JType type=expr.getType();
      if (!(type instanceof JReferenceType)) {
        return;
      }
      typeList.add((JReferenceType)type);
    }
  }
  if (x instanceof JParameter) {
    Collection<JParameter> myParams=paramUpRefs.get(x);
    if (myParams != null) {
      for (      JParameter param : myParams) {
        typeList.add((JReferenceType)param.getType());
      }
    }
  }
  JReferenceType resultType=program.strengthenType(refType,typeList);
  if (refType != resultType) {
    x.setType(resultType);
    madeChanges();
  }
}

Fixed version (ground truth):
/** 
 * Tighten based on assignment, and for parameters, callArgs as well.
 */
private void tighten(JVariable x){
  if (!(x.getType() instanceof JReferenceType)) {
    return;
  }
  JReferenceType refType=(JReferenceType)x.getType();
  if (refType == program.getTypeNull()) {
    return;
  }
  if (!program.typeOracle.isInstantiatedType(refType)) {
    x.setType(program.getTypeNull());
    madeChanges();
    return;
  }
  JReferenceType leafType=getSingleConcreteType(refType);
  if (leafType != null) {
    x.setType(leafType);
    madeChanges();
    return;
  }
  List<JReferenceType> typeList=Lists.newArrayList();
  Collection<JExpression> myAssignments=assignments.get(x);
  if (myAssignments != null) {
    for (    JExpression expr : myAssignments) {
      JType type=expr.getType();
      if (!(type instanceof JReferenceType)) {
        return;
      }
      typeList.add((JReferenceType)type);
    }
  }
  if (x instanceof JParameter) {
    Collection<JParameter> myParams=paramUpRefs.get(x);
    if (myParams != null) {
      for (      JParameter param : myParams) {
        typeList.add((JReferenceType)param.getType());
      }
    }
  }
  JReferenceType resultType=program.strengthenType(refType,typeList);
  if (refType != resultType) {
    x.setType(resultType);
    madeChanges();
  }
}
Program: 53477
Project: 53477
Buggy source:
public void testJsExports(){
  ScriptInjector.fromString("String_Node_Str").setWindow(ScriptInjector.TOP_WINDOW).inject();
  assertTrue(MyClassImpl2.calledFromJsHostPageWindow);
  ScriptInjector.fromString("String_Node_Str").inject();
  assertTrue(MyClassImpl2.calledFromJsModuleWindow);
  ScriptInjector.fromString("String_Node_Str").inject();
  assertTrue(MyClassImpl3.calledFromJsModuleWindow);
}

Fixed version (ground truth):
public void testJsExports(){
  ScriptInjector.fromString("String_Node_Str").setWindow(ScriptInjector.TOP_WINDOW).inject();
  assertTrue(MyClassImpl2.calledFromJsHostPageWindow);
  ScriptInjector.fromString("String_Node_Str").inject();
  assertTrue(MyClassImpl2.calledFromJsModuleWindow);
  ScriptInjector.fromString("String_Node_Str").inject();
  assertTrue(MyClassImpl3.calledFromJsModuleWindow);
  ScriptInjector.fromString("String_Node_Str").inject();
  assertTrue(MyClassImpl3.calledFromBar);
}
Program: 53478
Project: 53478
Buggy source:
@Override public boolean supportsDevModeInJunit(LinkerContext context){
  return (getHostedFilename() != "String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean supportsDevModeInJunit(LinkerContext context){
  return !"String_Node_Str".equals(getHostedFilename());
}
Program: 53479
Project: 53479
Buggy source:
@Override public void endVisit(final JsniMethodBody jsniMethodBody,Context ctx){
}

Fixed version (ground truth):
@Override public void endVisit(JsNameRef x,JsContext ctx){
  if (!x.isJsniReference()) {
    return;
  }
  if (jsniClassLiteralsByJsniReference.get(x.getIdent()).isEmpty()) {
    return;
  }
  JsniClassLiteral jsniClassLiteral=jsniClassLiteralsByJsniReference.get(x.getIdent()).iterator().next();
  jsniClassLiteralsByJsniReference.remove(x.getIdent(),jsniClassLiteral);
  if (jsniClassLiteral.getRefType() instanceof JArrayType) {
    JArrayType arrayType=(JArrayType)jsniClassLiteral.getRefType();
    JType leafType=arrayType.getLeafType();
    jsniClassLiteral=new JsniClassLiteral(jsniClassLiteral.getSourceInfo(),leafType);
    SourceInfo info=x.getSourceInfo();
    JsNameRef getArrayClassLiteralMethodNameRef=new JsNameRef(info,getClassLiteralForArrayMethodIdent);
    JsInvocation invocation=new JsInvocation(info,getArrayClassLiteralMethodNameRef,new JsNameRef(info,jsniClassLiteral.getIdent()),new JsNumberLiteral(info,arrayType.getDims()));
    resolveClassLiteral(jsniClassLiteral);
    ctx.replaceMe(invocation);
  }
  newClassRefs.add(jsniClassLiteral);
}
Program: 53480
Project: 53480
Buggy source:
/** 
 * Create a method call whose type is overridden to the specified type, ignoring the return type of the target method. This constructor is used during normalizing transformations to preserve type semantics when calling externally-defined compiler implementation methods. For example, Cast.dynamicCast() returns Object but that method is used to implement the cast operation. Using a stronger type on the call expression allows us to preserve type information during the latter phases of compilation.
 */
public JMethodCall(SourceInfo info,JExpression instance,JMethod method,JType overrideReturnType,JExpression... args){
  super(info);
  assert(method != null);
  assert(instance != null || method.isStatic() || this instanceof JNewInstance);
  this.instance=instance;
  this.method=method;
  this.overrideReturnType=overrideReturnType;
  this.methodHasSideEffects=method.hasSideEffects();
  addArgs(args);
}

Fixed version (ground truth):
/** 
 * Create a method call whose type is overridden to the specified type, ignoring the return type of the target method. This constructor is used during normalizing transformations to preserve type semantics when calling externally-defined compiler implementation methods. For example, Cast.dynamicCast() returns Object but that method is used to implement the cast operation. Using a stronger type on the call expression allows us to preserve type information during the latter phases of compilation.
 */
public JMethodCall(SourceInfo info,JExpression instance,JMethod method,JType overrideReturnType,JExpression... args){
  super(info);
  assert(method != null);
  assert(instance != null || method.isStatic() || this instanceof JNewInstance);
  this.instance=instance;
  this.method=method;
  this.overrideReturnType=overrideReturnType;
  addArgs(args);
}
Program: 53481
Project: 53481
Buggy source:
@Override public boolean hasSideEffects(){
  return isStaticDispatchOnly() || method.isStatic() ? methodHasSideEffects : true;
}

Fixed version (ground truth):
@Override public boolean hasSideEffects(){
  if (markedAsSideAffectFree) {
    return false;
  }
  return isStaticDispatchOnly() || method.isStatic() ? method.hasSideEffects() : true;
}
Program: 53483
Project: 53483
Buggy source:
private void pushLambdaExpressionLocalsIntoMethodScope(LambdaExpression x,SyntheticArgumentBinding[] synthArgs,JMethod lambdaMethod){
  Iterator<JParameter> it=lambdaMethod.getParams().iterator();
  if (synthArgs != null) {
    for (    SyntheticArgumentBinding sa : synthArgs) {
      curMethod.locals.put(sa.actualOuterLocalVariable,it.next());
    }
    for (    Argument a : x.arguments) {
      curMethod.locals.put(a.binding,it.next());
    }
  }
}

Fixed version (ground truth):
private void pushLambdaExpressionLocalsIntoMethodScope(LambdaExpression x,SyntheticArgumentBinding[] synthArgs,JMethod lambdaMethod){
}
Program: 53484
Project: 53484
Buggy source:
public void run(){
  assertEquals(94,new AcceptsLambda<Integer>().accept((a,b) -> Java8Test.this.local + local + a+ b).intValue());
}

Fixed version (ground truth):
@Override public Integer run(int j,int k){
  int t=x;
  int s=local;
  return t + s + a+ b;
}
Program: 53485
Project: 53485
Buggy source:
/** 
 * Creates a dummy output directory without compiling the module. Either this method or   {@link #precompile} should be called first.
 */
synchronized Job.Result initWithoutPrecompile(TreeLogger logger) throws UnableToCompleteException {
  long startTime=System.currentTimeMillis();
  CompileDir compileDir=outboxDir.makeCompileDir(logger);
  TreeLogger compileLogger=makeCompileLogger(compileDir,logger);
  ModuleDef module=loadModule(Sets.<String>newHashSet(),compileLogger);
  logger.log(TreeLogger.INFO,"String_Node_Str" + inputModuleName + "String_Node_Str");
  CompilerOptions loadOptions=new CompilerOptionsImpl(compileDir,inputModuleName,options);
  compilerContext=compilerContextBuilder.options(loadOptions).unitCache(Compiler.getOrCreateUnitCache(logger,loadOptions)).build();
  module.getCompilationState(compileLogger,compilerContext);
  setUpCompileDir(compileDir,module,compileLogger);
  if (launcherDir != null) {
    launcherDir.update(module,compileDir,compileLogger);
  }
  outputModuleName.set(module.getName());
  lastBuild.set(compileDir);
  long elapsedTime=System.currentTimeMillis() - startTime;
  compileLogger.log(TreeLogger.Type.INFO,"String_Node_Str" + elapsedTime + "String_Node_Str");
  return new Result(compileDir,module.getName(),null);
}

Fixed version (ground truth):
/** 
 * Creates a dummy output directory without compiling the module. Either this method or   {@link #precompile} should be called first.
 */
synchronized Job.Result initWithoutPrecompile(TreeLogger logger) throws UnableToCompleteException {
  long startTime=System.currentTimeMillis();
  CompileDir compileDir=outboxDir.makeCompileDir(logger);
  TreeLogger compileLogger=makeCompileLogger(compileDir,logger);
  ModuleDef module;
  try {
    module=loadModule(Sets.<String>newHashSet(),compileLogger);
    logger.log(TreeLogger.INFO,"String_Node_Str" + inputModuleName + "String_Node_Str");
    CompilerOptions loadOptions=new CompilerOptionsImpl(compileDir,inputModuleName,options);
    compilerContext=compilerContextBuilder.options(loadOptions).unitCache(Compiler.getOrCreateUnitCache(logger,loadOptions)).build();
    module.getCompilationState(compileLogger,compilerContext);
    setUpCompileDir(compileDir,module,compileLogger);
    if (launcherDir != null) {
      launcherDir.update(module,compileDir,compileLogger);
    }
    outputModuleName.set(module.getName());
  }
  finally {
    lastBuild.set(compileDir);
  }
  long elapsedTime=System.currentTimeMillis() - startTime;
  compileLogger.log(TreeLogger.Type.INFO,"String_Node_Str" + elapsedTime + "String_Node_Str");
  return new Result(compileDir,module.getName(),null);
}
Program: 53487
Project: 53487
Buggy source:
@Override public void runPass(){
  externalClassNames=new HashSet<String>();
  externalClassPrefixes=new ArrayList<String>();
  visitController.startVisit(this);
}

Fixed version (ground truth):
@Override public void runPass(){
  externalClassNames=new HashSet<String>();
  remainingStyleClassNames=new HashSet<String>();
  externalClassPrefixes=new ArrayList<String>();
  visitController.startVisit(this);
}
Program: 53489
Project: 53489
Buggy source:
/** 
 * When the tree is fully processed, we can now collect the external classes and revert the renaming for these classes. We cannot collect the external classes during the original renaming because some external at-rule could be located inside a conditional block and could be removed when these blocks are evaluated.
 */
private Set<String> revertRenamingOfExternalClasses(CssTree cssTree,RenamingResult renamingResult){
  ExternalClassesCollector externalClassesCollector=new ExternalClassesCollector(cssTree.getMutatingVisitController(),errorManager);
  externalClassesCollector.runPass();
  Map<String,String> styleClassesMapping=renamingResult.mapping;
  Set<String> allStyleClassSet=Sets.newHashSet(styleClassesMapping.keySet());
  allStyleClassSet.addAll(renamingResult.externalClassCandidate);
  Set<String> externalClasses=externalClassesCollector.getExternalClassNames(allStyleClassSet);
  final Map<String,String> revertMap=new HashMap<String,String>(externalClasses.size());
  for (  String external : externalClasses) {
    revertMap.put(styleClassesMapping.get(external),external);
    styleClassesMapping.put(external,external);
  }
  SubstitutionMap revertExternalClasses=new SubstitutionMap(){
    @Override public String get(    String key){
      return revertMap.get(key);
    }
  }
;
  new CssClassRenaming(cssTree.getMutatingVisitController(),revertExternalClasses,null).runPass();
  return externalClasses;
}

Fixed version (ground truth):
/** 
 * When the tree is fully processed, we can now collect the external classes and revert the renaming for these classes. We cannot collect the external classes during the original renaming because some external at-rule could be located inside a conditional block and could be removed when these blocks are evaluated.
 */
private Set<String> revertRenamingOfExternalClasses(CssTree cssTree,RenamingResult renamingResult){
  ExternalClassesCollector externalClassesCollector=new ExternalClassesCollector(cssTree.getMutatingVisitController(),errorManager);
  externalClassesCollector.runPass();
  Map<String,String> styleClassesMapping=renamingResult.mapping;
  Set<String> allStyleClassSet=Sets.newHashSet(styleClassesMapping.keySet());
  allStyleClassSet.addAll(renamingResult.externalClassCandidate);
  Set<String> externalClasses=externalClassesCollector.getExternalClassNames(allStyleClassSet,renamingResult.externalClassCandidate);
  final Map<String,String> revertMap=new HashMap<String,String>(externalClasses.size());
  for (  String external : externalClasses) {
    revertMap.put(styleClassesMapping.get(external),external);
    styleClassesMapping.put(external,external);
  }
  SubstitutionMap revertExternalClasses=new SubstitutionMap(){
    @Override public String get(    String key){
      return revertMap.get(key);
    }
  }
;
  new CssClassRenaming(cssTree.getMutatingVisitController(),revertExternalClasses,null).runPass();
  return externalClasses;
}
Program: 53490
Project: 53490
Buggy source:
@Override public void setMethodNameDisplayMode(com.google.gwt.dev.util.arg.OptionMethodNameDisplayMode.Mode methodNameDisplayMode){
  throw new UnsupportedOperationException();
}

Fixed version (ground truth):
@Override public void setMethodNameDisplayMode(OptionMethodNameDisplayMode.Mode methodNameDisplayMode){
  throw new UnsupportedOperationException();
}
Program: 53491
Project: 53491
Buggy source:
@Override public com.google.gwt.dev.util.arg.OptionMethodNameDisplayMode.Mode getMethodNameDisplayMode(){
  return jjsOptions.getMethodNameDisplayMode();
}

Fixed version (ground truth):
@Override public OptionMethodNameDisplayMode.Mode getMethodNameDisplayMode(){
  return jjsOptions.getMethodNameDisplayMode();
}
Program: 53492
Project: 53492
Buggy source:
@Override public void setMethodNameDisplayMode(com.google.gwt.dev.util.arg.OptionMethodNameDisplayMode.Mode methodNameDisplayMode){
  jjsOptions.setMethodNameDisplayMode(methodNameDisplayMode);
}

Fixed version (ground truth):
@Override public void setMethodNameDisplayMode(OptionMethodNameDisplayMode.Mode methodNameDisplayMode){
  jjsOptions.setMethodNameDisplayMode(methodNameDisplayMode);
}
Program: 53493
Project: 53493
Buggy source:
private boolean shouldEmitDisplayNames(){
  return methodNameMappingMode != com.google.gwt.dev.util.arg.OptionMethodNameDisplayMode.Mode.NONE;
}

Fixed version (ground truth):
private boolean shouldEmitDisplayNames(){
  return methodNameMappingMode != OptionMethodNameDisplayMode.Mode.NONE;
}