nus-yam/ex-repair huggingface dataset:
Program: 93227
Project: 93227
Buggy source:
/** 
 * @see #get(String)
 */
@VisibleForTesting protected VmTypeName(final String vmTypeName){
  ensureIsNotNull(vmTypeName);
  ensureIsFalse(vmTypeName.length() == 0,"String_Node_Str");
  if (vmTypeName.length() == 1) {
switch (vmTypeName.charAt(0)) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case 'V':
case 'Z':
      break;
default :
    throwUnreachable("String_Node_Str" + vmTypeName);
}
}
 else {
switch (vmTypeName.charAt(0)) {
case '[':
case 'L':
  break;
default :
throwUnreachable("String_Node_Str" + vmTypeName);
}
}
int off=0;
while (off < vmTypeName.length()) {
final char c=vmTypeName.charAt(off);
if (c == '[' || c == '/' || c == '-' || c == '<' || c == '>' || Character.isJavaIdentifierPart(c)) {
off++;
continue;
}
throwIllegalArgumentException("String_Node_Str",vmTypeName);
break;
}
identifier=vmTypeName;
}

Fixed version (ground truth):
/** 
 * @see #get(String)
 */
@VisibleForTesting protected VmTypeName(final String vmTypeName){
  ensureIsNotNull(vmTypeName);
  ensureIsFalse(vmTypeName.length() == 0,"String_Node_Str");
  if (vmTypeName.length() == 1) {
switch (vmTypeName.charAt(0)) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case 'V':
case 'Z':
      break;
default :
    throwUnreachable("String_Node_Str" + vmTypeName);
}
}
 else {
switch (vmTypeName.charAt(0)) {
case '[':
case 'L':
  break;
default :
throwUnreachable("String_Node_Str" + vmTypeName);
}
}
int off=0;
while (off < vmTypeName.length()) {
final char c=vmTypeName.charAt(off);
if (c == '-' || c == '[' || c == '/' || c == '<' || c == '>' || Character.isJavaIdentifierPart(c)) {
off++;
continue;
}
throwIllegalArgumentException("String_Node_Str",vmTypeName);
break;
}
identifier=vmTypeName;
}
Program: 93228
Project: 93228
Buggy source:
private static String removeGenerics(final String typeName){
  return StringUtils.substringBefore(typeName,"String_Node_Str");
}

Fixed version (ground truth):
private static String removeGenerics(String typeName){
  int oldLength;
  do {
    oldLength=typeName.length();
    Matcher matcher=GENERICS_PATTERN.matcher(typeName);
    typeName=matcher.replaceAll("String_Node_Str");
  }
 while (typeName.length() < oldLength);
  return typeName;
}
Program: 93229
Project: 93229
Buggy source:
public ITypeName toRecType(IType jdtType){
  ensureIsNotNull(jdtType);
  jdtType=JdtUtils.resolveJavaElementProxy(jdtType);
  ITypeName recType=(ITypeName)cache.inverse().get(jdtType);
  if (recType == null) {
    String fullyQualifiedName=jdtType.getFullyQualifiedName();
    fullyQualifiedName=StringUtils.substringBefore(fullyQualifiedName,"String_Node_Str");
    recType=VmTypeName.get('L' + fullyQualifiedName.replace('.','/'));
    registerRecJdtElementPair(recType,jdtType);
  }
  return recType;
}

Fixed version (ground truth):
public ITypeName toRecType(IType jdtType){
  ensureIsNotNull(jdtType);
  jdtType=JdtUtils.resolveJavaElementProxy(jdtType);
  ITypeName recType=(ITypeName)cache.inverse().get(jdtType);
  if (recType == null) {
    String fullyQualifiedName=jdtType.getFullyQualifiedName();
    recType=VmTypeName.get('L' + fullyQualifiedName.replace('.','/'));
    registerRecJdtElementPair(recType,jdtType);
  }
  return recType;
}
Program: 93230
Project: 93230
Buggy source:
/** 
 * @see #get(String)
 */
@VisibleForTesting protected VmTypeName(final String vmTypeName){
  ensureIsNotNull(vmTypeName);
  ensureIsFalse(vmTypeName.length() == 0,"String_Node_Str");
  if (vmTypeName.length() == 1) {
switch (vmTypeName.charAt(0)) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case 'V':
case 'Z':
      break;
default :
    throwUnreachable("String_Node_Str" + vmTypeName);
}
}
 else {
switch (vmTypeName.charAt(0)) {
case '[':
case 'L':
  break;
default :
throwUnreachable("String_Node_Str" + vmTypeName);
}
}
int off=0;
while (off < vmTypeName.length()) {
final char c=vmTypeName.charAt(off);
if (c == '[' || c == '/' || c == '-' || c == '<' || c == '>' || Character.isJavaIdentifierPart(c)) {
off++;
continue;
}
throwIllegalArgumentException("String_Node_Str",vmTypeName);
break;
}
identifier=vmTypeName;
}

Fixed version (ground truth):
/** 
 * @see #get(String)
 */
@VisibleForTesting protected VmTypeName(final String vmTypeName){
  ensureIsNotNull(vmTypeName);
  ensureIsFalse(vmTypeName.length() == 0,"String_Node_Str");
  if (vmTypeName.length() == 1) {
switch (vmTypeName.charAt(0)) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'I':
case 'J':
case 'S':
case 'V':
case 'Z':
      break;
default :
    throwUnreachable("String_Node_Str" + vmTypeName);
}
}
 else {
switch (vmTypeName.charAt(0)) {
case '[':
case 'L':
  break;
default :
throwUnreachable("String_Node_Str" + vmTypeName);
}
}
int off=0;
while (off < vmTypeName.length()) {
final char c=vmTypeName.charAt(off);
if (c == '-' || c == '[' || c == '/' || c == '<' || c == '>' || Character.isJavaIdentifierPart(c)) {
off++;
continue;
}
throwIllegalArgumentException("String_Node_Str",vmTypeName);
break;
}
identifier=vmTypeName;
}
Program: 93231
Project: 93231
Buggy source:
private static String removeGenerics(final String typeName){
  return StringUtils.substringBefore(typeName,"String_Node_Str");
}

Fixed version (ground truth):
private static String removeGenerics(String typeName){
  int oldLength;
  do {
    oldLength=typeName.length();
    Matcher matcher=GENERICS_PATTERN.matcher(typeName);
    typeName=matcher.replaceAll("String_Node_Str");
  }
 while (typeName.length() < oldLength);
  return typeName;
}
Program: 93232
Project: 93232
Buggy source:
public static String mangle(String url){
  return removeEnd(url.replaceAll("String_Node_Str","String_Node_Str"),"String_Node_Str");
}

Fixed version (ground truth):
public static String mangle(String url){
  return url.replaceAll("String_Node_Str","String_Node_Str");
}
Program: 93233
Project: 93233
Buggy source:
public static String mangle(String url){
  return removeEnd(url.replaceAll("String_Node_Str","String_Node_Str"),"String_Node_Str");
}

Fixed version (ground truth):
public static String mangle(String url){
  return url.replaceAll("String_Node_Str","String_Node_Str");
}
Program: 93234
Project: 93234
Buggy source:
private String resolveType(final IType jdtDeclaringType,final String unresolvedType){
  final int arrayCount=Signature.getArrayCount(unresolvedType);
  String resolvedType=JdtUtils.resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(unresolvedType,jdtDeclaringType).or(Signature.SIG_VOID);
  resolvedType=resolvedType + StringUtils.repeat("String_Node_Str",arrayCount);
  return resolvedType;
}

Fixed version (ground truth):
private String resolveType(final IType jdtDeclaringType,final String unresolvedType,final ITypeParameter[] typeParameters) throws JavaModelException {
  final int arrayCount=Signature.getArrayCount(unresolvedType);
  String toResolve=unresolvedType.substring(arrayCount);
  if (typeParameters != null && toResolve.startsWith("String_Node_Str")) {
    String typeName=toResolve.substring(1,toResolve.length() - 1);
    for (    ITypeParameter typeParameter : typeParameters) {
      if (!typeParameter.getElementName().equals(typeName)) {
        continue;
      }
      String[] boundsSignatures=typeParameter.getBoundsSignatures();
      if (boundsSignatures.length > 0) {
        toResolve=boundsSignatures[0];
        break;
      }
    }
  }
  String resolvedType=JdtUtils.resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(toResolve,jdtDeclaringType).or(Signature.SIG_VOID);
  resolvedType=resolvedType + StringUtils.repeat("String_Node_Str",arrayCount);
  return resolvedType;
}
Program: 93235
Project: 93235
Buggy source:
/** 
 * Returns null if we fail to resolve all types used in the method signature, for instance generic return types etc...
 */
public Optional<IMethodName> toRecMethod(@Nullable IMethod jdtMethod){
  if (jdtMethod == null) {
    return absent();
  }
  if (!jdtMethod.exists()) {
    return absent();
  }
  JdtUtils.resolveJavaElementProxy(jdtMethod);
  IMethodName recMethod=(IMethodName)cache.inverse().get(jdtMethod);
  if (recMethod == null) {
    try {
      final IType jdtDeclaringType=jdtMethod.getDeclaringType();
      final String[] unresolvedParameterTypes=jdtMethod.getParameterTypes();
      final String[] resolvedParameterTypes=new String[unresolvedParameterTypes.length];
      for (int i=resolvedParameterTypes.length; i-- > 0; ) {
        resolvedParameterTypes[i]=resolveType(jdtDeclaringType,unresolvedParameterTypes[i]);
      }
      String resolvedReturnType=resolveType(jdtDeclaringType,jdtMethod.getReturnType());
      final String methodSignature=Names.src2vmMethod(jdtMethod.isConstructor() ? "String_Node_Str" : jdtMethod.getElementName(),resolvedParameterTypes,resolvedReturnType);
      final ITypeName recDeclaringType=toRecType(jdtDeclaringType);
      recMethod=VmMethodName.get(recDeclaringType.getIdentifier(),methodSignature);
      registerRecJdtElementPair(recMethod,jdtMethod);
    }
 catch (    final Exception e) {
      LOG.error("String_Node_Str",jdtMethod,e.getMessage(),e);
      return absent();
    }
  }
  return fromNullable(recMethod);
}

Fixed version (ground truth):
/** 
 * Returns null if we fail to resolve all types used in the method signature, for instance generic return types etc...
 */
public Optional<IMethodName> toRecMethod(@Nullable IMethod jdtMethod){
  if (jdtMethod == null) {
    return absent();
  }
  if (!jdtMethod.exists()) {
    return absent();
  }
  JdtUtils.resolveJavaElementProxy(jdtMethod);
  IMethodName recMethod=(IMethodName)cache.inverse().get(jdtMethod);
  if (recMethod == null) {
    try {
      final IType jdtDeclaringType=jdtMethod.getDeclaringType();
      ITypeParameter[] typeParameters=jdtMethod.getTypeParameters();
      final String[] unresolvedParameterTypes=jdtMethod.getParameterTypes();
      final String[] resolvedParameterTypes=new String[unresolvedParameterTypes.length];
      for (int i=resolvedParameterTypes.length; i-- > 0; ) {
        resolvedParameterTypes[i]=resolveType(jdtDeclaringType,unresolvedParameterTypes[i],typeParameters);
      }
      String resolvedReturnType=resolveType(jdtDeclaringType,jdtMethod.getReturnType(),typeParameters);
      final String methodSignature=Names.src2vmMethod(jdtMethod.isConstructor() ? "String_Node_Str" : jdtMethod.getElementName(),resolvedParameterTypes,resolvedReturnType);
      final ITypeName recDeclaringType=toRecType(jdtDeclaringType);
      recMethod=VmMethodName.get(recDeclaringType.getIdentifier(),methodSignature);
      registerRecJdtElementPair(recMethod,jdtMethod);
    }
 catch (    final Exception e) {
      LOG.error("String_Node_Str",jdtMethod,e.getMessage(),e);
      return absent();
    }
  }
  return fromNullable(recMethod);
}
Program: 93236
Project: 93236
Buggy source:
private String resolveType(final IType jdtDeclaringType,final String unresolvedType){
  final int arrayCount=Signature.getArrayCount(unresolvedType);
  String resolvedType=JdtUtils.resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(unresolvedType,jdtDeclaringType).or(Signature.SIG_VOID);
  resolvedType=resolvedType + StringUtils.repeat("String_Node_Str",arrayCount);
  return resolvedType;
}

Fixed version (ground truth):
private String resolveType(final IType jdtDeclaringType,final String unresolvedType,final ITypeParameter[] typeParameters) throws JavaModelException {
  final int arrayCount=Signature.getArrayCount(unresolvedType);
  String toResolve=unresolvedType.substring(arrayCount);
  if (typeParameters != null && toResolve.startsWith("String_Node_Str")) {
    String typeName=toResolve.substring(1,toResolve.length() - 1);
    for (    ITypeParameter typeParameter : typeParameters) {
      if (!typeParameter.getElementName().equals(typeName)) {
        continue;
      }
      String[] boundsSignatures=typeParameter.getBoundsSignatures();
      if (boundsSignatures.length > 0) {
        toResolve=boundsSignatures[0];
        break;
      }
    }
  }
  String resolvedType=JdtUtils.resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(toResolve,jdtDeclaringType).or(Signature.SIG_VOID);
  resolvedType=resolvedType + StringUtils.repeat("String_Node_Str",arrayCount);
  return resolvedType;
}
Program: 93237
Project: 93237
Buggy source:
/** 
 * Returns null if we fail to resolve all types used in the method signature, for instance generic return types etc...
 */
public Optional<IMethodName> toRecMethod(@Nullable IMethod jdtMethod){
  if (jdtMethod == null) {
    return absent();
  }
  if (!jdtMethod.exists()) {
    return absent();
  }
  JdtUtils.resolveJavaElementProxy(jdtMethod);
  IMethodName recMethod=(IMethodName)cache.inverse().get(jdtMethod);
  if (recMethod == null) {
    try {
      final IType jdtDeclaringType=jdtMethod.getDeclaringType();
      final String[] unresolvedParameterTypes=jdtMethod.getParameterTypes();
      final String[] resolvedParameterTypes=new String[unresolvedParameterTypes.length];
      for (int i=resolvedParameterTypes.length; i-- > 0; ) {
        resolvedParameterTypes[i]=resolveType(jdtDeclaringType,unresolvedParameterTypes[i]);
      }
      String resolvedReturnType=resolveType(jdtDeclaringType,jdtMethod.getReturnType());
      final String methodSignature=Names.src2vmMethod(jdtMethod.isConstructor() ? "String_Node_Str" : jdtMethod.getElementName(),resolvedParameterTypes,resolvedReturnType);
      final ITypeName recDeclaringType=toRecType(jdtDeclaringType);
      recMethod=VmMethodName.get(recDeclaringType.getIdentifier(),methodSignature);
      registerRecJdtElementPair(recMethod,jdtMethod);
    }
 catch (    final Exception e) {
      LOG.error("String_Node_Str",jdtMethod,e.getMessage(),e);
      return absent();
    }
  }
  return fromNullable(recMethod);
}

Fixed version (ground truth):
/** 
 * Returns null if we fail to resolve all types used in the method signature, for instance generic return types etc...
 */
public Optional<IMethodName> toRecMethod(@Nullable IMethod jdtMethod){
  if (jdtMethod == null) {
    return absent();
  }
  if (!jdtMethod.exists()) {
    return absent();
  }
  JdtUtils.resolveJavaElementProxy(jdtMethod);
  IMethodName recMethod=(IMethodName)cache.inverse().get(jdtMethod);
  if (recMethod == null) {
    try {
      final IType jdtDeclaringType=jdtMethod.getDeclaringType();
      ITypeParameter[] typeParameters=jdtMethod.getTypeParameters();
      final String[] unresolvedParameterTypes=jdtMethod.getParameterTypes();
      final String[] resolvedParameterTypes=new String[unresolvedParameterTypes.length];
      for (int i=resolvedParameterTypes.length; i-- > 0; ) {
        resolvedParameterTypes[i]=resolveType(jdtDeclaringType,unresolvedParameterTypes[i],typeParameters);
      }
      String resolvedReturnType=resolveType(jdtDeclaringType,jdtMethod.getReturnType(),typeParameters);
      final String methodSignature=Names.src2vmMethod(jdtMethod.isConstructor() ? "String_Node_Str" : jdtMethod.getElementName(),resolvedParameterTypes,resolvedReturnType);
      final ITypeName recDeclaringType=toRecType(jdtDeclaringType);
      recMethod=VmMethodName.get(recDeclaringType.getIdentifier(),methodSignature);
      registerRecJdtElementPair(recMethod,jdtMethod);
    }
 catch (    final Exception e) {
      LOG.error("String_Node_Str",jdtMethod,e.getMessage(),e);
      return absent();
    }
  }
  return fromNullable(recMethod);
}
Program: 93239
Project: 93239
Buggy source:
/** 
 * @param parent must be an  {@link IType} or something that has an {@link IType} as parent.
 */
public static Optional<String> resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(String typeSignature,final IJavaElement parent){
  ensureIsNotNull(typeSignature);
  ensureIsNotNull(parent);
  typeSignature=Signature.getTypeErasure(typeSignature);
  if (isPrimitiveTypeSignature(typeSignature)) {
    return of(typeSignature);
  }
  try {
    typeSignature=typeSignature.replace('/','.');
    final IType type=findClosestTypeOrThis(parent);
    if (type == null) {
      throwIllegalArgumentException("String_Node_Str",parent);
    }
    final String resolvedTypeSignature=JavaModelUtil.getResolvedTypeName(typeSignature,type);
    if (resolvedTypeSignature == null) {
      return of("String_Node_Str");
    }
    return of(resolvedTypeSignature);
  }
 catch (  final Exception e) {
    log(e);
    return absent();
  }
}

Fixed version (ground truth):
/** 
 * @param parent must be an  {@link IType} or something that has an {@link IType} as parent.
 */
public static Optional<String> resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(String typeSignature,final IJavaElement parent){
  ensureIsNotNull(typeSignature);
  ensureIsNotNull(parent);
  typeSignature=Signature.getTypeErasure(typeSignature);
  if (isPrimitiveTypeSignature(typeSignature)) {
    return of(Names.vm2srcTypeName(typeSignature));
  }
  try {
    typeSignature=typeSignature.replace('/','.');
    final IType type=findClosestTypeOrThis(parent);
    if (type == null) {
      throwIllegalArgumentException("String_Node_Str",parent);
    }
    final String resolvedTypeSignature=JavaModelUtil.getResolvedTypeName(typeSignature,type);
    if (resolvedTypeSignature == null) {
      return of("String_Node_Str");
    }
    return of(resolvedTypeSignature);
  }
 catch (  final Exception e) {
    log(e);
    return absent();
  }
}
Program: 93240
Project: 93240
Buggy source:
private Optional<IType> resolveType(final ITypeName recType){
  ensureIsNotNull(recType);
  if (recType.isArrayType()) {
    LOG.error("String_Node_Str");
    return absent();
  }
  if (recType.isNestedType()) {
    final ITypeName declaringType=recType.getDeclaringType();
    final String simpleName=StringUtils.substringAfterLast(recType.getIdentifier(),"String_Node_Str");
    final IType parent=resolveType(declaringType).orNull();
    if (parent != null) {
      try {
        for (        final IType nested : parent.getTypes()) {
          final String key=nested.getKey();
          if (key.equals(recType.getIdentifier() + ';')) {
            return fromNullable(nested);
          }
        }
        for (        final IMethod m : parent.getMethods()) {
          for (          final IJavaElement children : m.getChildren()) {
            if (children instanceof IType) {
              final IType nested=(IType)children;
              if (nested.getKey().endsWith(simpleName + ';')) {
                return of(nested);
              }
              final String key=nested.getKey();
              if (key.equals(recType.getIdentifier() + ';')) {
                return fromNullable(nested);
              }
            }
          }
        }
      }
 catch (      final Exception x) {
        return absent();
      }
    }
    return absent();
  }
  final IType[] res=new IType[1];
  final IJavaSearchScope scope=SearchEngine.createWorkspaceScope();
  final SearchEngine search=new SearchEngine();
  final String srcTypeName=Names.vm2srcTypeName(recType.getIdentifier());
  final SearchPattern pattern=SearchPattern.createPattern(srcTypeName,IJavaSearchConstants.TYPE,IJavaSearchConstants.DECLARATIONS,SearchPattern.R_FULL_MATCH);
  try {
    search.search(pattern,SearchUtils.getDefaultSearchParticipants(),scope,new SearchRequestor(){
      @Override public void acceptSearchMatch(      final SearchMatch match) throws CoreException {
        IType element=(IType)match.getElement();
        if (toRecType(element).equals(recType)) {
          res[0]=element;
        }
      }
    }
,null);
  }
 catch (  final CoreException e) {
    throwUnhandledException(e);
  }
  return fromNullable(res[0]);
}

Fixed version (ground truth):
private String resolveType(final IType jdtDeclaringType,final String unresolvedType){
  final int arrayCount=Signature.getArrayCount(unresolvedType);
  String resolvedType=JdtUtils.resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(unresolvedType,jdtDeclaringType).or(Signature.SIG_VOID);
  resolvedType=resolvedType + StringUtils.repeat("String_Node_Str",arrayCount);
  return resolvedType;
}
Program: 93243
Project: 93243
Buggy source:
/** 
 * @param parent must be an  {@link IType} or something that has an {@link IType} as parent.
 */
public static Optional<String> resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(String typeSignature,final IJavaElement parent){
  ensureIsNotNull(typeSignature);
  ensureIsNotNull(parent);
  typeSignature=Signature.getTypeErasure(typeSignature);
  if (isPrimitiveTypeSignature(typeSignature)) {
    return of(typeSignature);
  }
  try {
    typeSignature=typeSignature.replace('/','.');
    final IType type=findClosestTypeOrThis(parent);
    if (type == null) {
      throwIllegalArgumentException("String_Node_Str",parent);
    }
    final String resolvedTypeSignature=JavaModelUtil.getResolvedTypeName(typeSignature,type);
    if (resolvedTypeSignature == null) {
      return of("String_Node_Str");
    }
    return of(resolvedTypeSignature);
  }
 catch (  final Exception e) {
    log(e);
    return absent();
  }
}

Fixed version (ground truth):
/** 
 * @param parent must be an  {@link IType} or something that has an {@link IType} as parent.
 */
public static Optional<String> resolveUnqualifiedTypeNamesAndStripOffGenericsAndArrayDimension(String typeSignature,final IJavaElement parent){
  ensureIsNotNull(typeSignature);
  ensureIsNotNull(parent);
  typeSignature=Signature.getTypeErasure(typeSignature);
  if (isPrimitiveTypeSignature(typeSignature)) {
    return of(Names.vm2srcTypeName(typeSignature));
  }
  try {
    typeSignature=typeSignature.replace('/','.');
    final IType type=findClosestTypeOrThis(parent);
    if (type == null) {
      throwIllegalArgumentException("String_Node_Str",parent);
    }
    final String resolvedTypeSignature=JavaModelUtil.getResolvedTypeName(typeSignature,type);
    if (resolvedTypeSignature == null) {
      return of("String_Node_Str");
    }
    return of(resolvedTypeSignature);
  }
 catch (  final Exception e) {
    log(e);
    return absent();
  }
}
Program: 93244
Project: 93244
Buggy source:
public DiscoverCompletionProposal(SharedImages images,int invocationOffset){
  Image image=images.getImage(Images.OBJ_LIGHTBULB);
  StyledString text=new StyledString(PROPOSAL_LABEL,DECORATIONS_STYLER);
  setStyledDisplayString(text);
  setImage(image);
  setRelevance(RELEVANCE);
  setSortString(text.getString());
  setCursorPosition(invocationOffset);
}

Fixed version (ground truth):
public DiscoverCompletionProposal(SharedImages images,int invocationOffset){
  Image image=images.getImage(Images.OBJ_LIGHTBULB);
  StyledString text=new StyledString(PROPOSAL_LABEL,DECORATIONS_STYLER);
  setStyledDisplayString(text);
  setImage(image);
  setRelevance(RELEVANCE);
  setSortString(text.getString());
  setCursorPosition(invocationOffset);
  setReplacementString("String_Node_Str");
}
Program: 93245
Project: 93245
Buggy source:
public EnableCompletionProposal(SharedImages images,int offset){
  Image image=images.getImage(Images.OBJ_LIGHTBULB);
  StyledString text=new StyledString("String_Node_Str",DECORATIONS_STYLER);
  setStyledDisplayString(text);
  setImage(image);
  setRelevance(RELEVANCE);
  setCursorPosition(offset);
}

Fixed version (ground truth):
public EnableCompletionProposal(SharedImages images,int offset){
  Image image=images.getImage(Images.OBJ_LIGHTBULB);
  StyledString text=new StyledString("String_Node_Str",DECORATIONS_STYLER);
  setStyledDisplayString(text);
  setImage(image);
  setRelevance(RELEVANCE);
  setCursorPosition(offset);
  setReplacementString("String_Node_Str");
}
Program: 93247
Project: 93247
Buggy source:
@Singleton @Provides public List<IProjectCoordinateAdvisor> provideAdvisors(IModelIndex index,ManualProjectCoordinateAdvisor manualMappingStrategy){
  List<IProjectCoordinateAdvisor> availableAdvisors=Lists.newArrayList();
  availableAdvisors.add(manualMappingStrategy);
  availableAdvisors.add(new MavenPomPropertiesAdvisor());
  availableAdvisors.add(new JREExecutionEnvironmentAdvisor());
  availableAdvisors.add(new JREReleaseFileAdvisor());
  availableAdvisors.add(new JREDirectoryNameAdvisor());
  availableAdvisors.add(new MavenPomXmlAdvisor());
  availableAdvisors.add(new ModelIndexBundleSymbolicNameAdvisor(index));
  availableAdvisors.add(new ModelIndexFingerprintAdvisor(index));
  availableAdvisors.add(new OsgiManifestAdvisor());
  availableAdvisors.add(new MavenCentralFingerprintSearchAdvisor());
  return ImmutableList.copyOf(availableAdvisors);
}

Fixed version (ground truth):
@Singleton @Provides @Named(AVAILABLE_ADVISORS) public List<String> provideAdvisors(){
  List<String> availableAdvisors=Lists.newArrayList();
  ManualProjectCoordinateAdvisor.class.getName();
  availableAdvisors.add(ManualProjectCoordinateAdvisor.class.getName());
  availableAdvisors.add(MavenPomPropertiesAdvisor.class.getName());
  availableAdvisors.add(JREExecutionEnvironmentAdvisor.class.getName());
  availableAdvisors.add(JREReleaseFileAdvisor.class.getName());
  availableAdvisors.add(JREDirectoryNameAdvisor.class.getName());
  availableAdvisors.add(MavenPomXmlAdvisor.class.getName());
  availableAdvisors.add(ModelIndexBundleSymbolicNameAdvisor.class.getName());
  availableAdvisors.add(ModelIndexFingerprintAdvisor.class.getName());
  availableAdvisors.add(OsgiManifestAdvisor.class.getName());
  availableAdvisors.add(MavenCentralFingerprintSearchAdvisor.class.getName());
  return ImmutableList.copyOf(availableAdvisors);
}
Program: 93248
Project: 93248
Buggy source:
@Singleton @Provides public ProjectCoordinateAdvisorService provideMappingProvider(List<IProjectCoordinateAdvisor> availableAdvisors,ModelsRcpPreferences prefs){
  ProjectCoordinateAdvisorService mappingProvider=new ProjectCoordinateAdvisorService();
  mappingProvider.setAdvisors(Advisors.createAdvisorList(availableAdvisors,prefs.advisors));
  return mappingProvider;
}

Fixed version (ground truth):
@Singleton @Provides public ProjectCoordinateAdvisorService provideMappingProvider(ModelsRcpPreferences prefs,IModelIndex index,ManualProjectCoordinateAdvisor manualMappingStrategy) throws Exception {
  List<IProjectCoordinateAdvisor> availableAdvisors=Lists.newArrayList();
  ProjectCoordinateAdvisorService mappingProvider=new ProjectCoordinateAdvisorService();
  for (  String advisorName : prefs.advisors.split("String_Node_Str")) {
    availableAdvisors.add(createAdvisor(advisorName,manualMappingStrategy,index));
  }
  mappingProvider.setAdvisors(Advisors.createAdvisorList(availableAdvisors,prefs.advisors));
  return mappingProvider;
}
Program: 93249
Project: 93249
Buggy source:
@Inject public PreferenceInitializer(List<IProjectCoordinateAdvisor> availableAdvisors){
  this.availableAdvisors=availableAdvisors;
}

Fixed version (ground truth):
@Inject public PreferenceInitializer(@Named(AVAILABLE_ADVISORS) List<String> availableAdvisors){
  this.availableAdvisors=availableAdvisors;
}
Program: 93250
Project: 93250
Buggy source:
@Override public void initializeDefaultPreferences(){
  IEclipsePreferences s=DefaultScope.INSTANCE.getNode(BUNDLE_ID);
  s.put(P_REPOSITORY_URL_LIST_ACTIV,SERVER_URL);
  s.put(P_REPOSITORY_URL_LIST,SERVER_URL);
  s.put(P_ADVISOR_LIST_SORTED,Advisors.createPreferenceString(availableAdvisors,Collections.<IProjectCoordinateAdvisor>emptySet()));
  s.putBoolean(P_REPOSITORY_ENABLE_AUTO_DOWNLOAD,true);
}

Fixed version (ground truth):
@Override public void initializeDefaultPreferences(){
  IEclipsePreferences s=DefaultScope.INSTANCE.getNode(BUNDLE_ID);
  s.put(P_REPOSITORY_URL_LIST_ACTIV,SERVER_URL);
  s.put(P_REPOSITORY_URL_LIST,SERVER_URL);
  s.put(P_ADVISOR_LIST_SORTED,getSemicolonSeparatedList(availableAdvisors));
  s.putBoolean(P_REPOSITORY_ENABLE_AUTO_DOWNLOAD,true);
}
Program: 93251
Project: 93251
Buggy source:
@Singleton @Provides public List<IProjectCoordinateAdvisor> provideAdvisors(IModelIndex index,ManualProjectCoordinateAdvisor manualMappingStrategy){
  List<IProjectCoordinateAdvisor> availableAdvisors=Lists.newArrayList();
  availableAdvisors.add(manualMappingStrategy);
  availableAdvisors.add(new MavenPomPropertiesAdvisor());
  availableAdvisors.add(new JREExecutionEnvironmentAdvisor());
  availableAdvisors.add(new JREReleaseFileAdvisor());
  availableAdvisors.add(new JREDirectoryNameAdvisor());
  availableAdvisors.add(new MavenPomXmlAdvisor());
  availableAdvisors.add(new ModelIndexBundleSymbolicNameAdvisor(index));
  availableAdvisors.add(new ModelIndexFingerprintAdvisor(index));
  availableAdvisors.add(new OsgiManifestAdvisor());
  availableAdvisors.add(new MavenCentralFingerprintSearchAdvisor());
  return ImmutableList.copyOf(availableAdvisors);
}

Fixed version (ground truth):
@Singleton @Provides @Named(AVAILABLE_ADVISORS) public List<String> provideAdvisors(){
  List<String> availableAdvisors=Lists.newArrayList();
  ManualProjectCoordinateAdvisor.class.getName();
  availableAdvisors.add(ManualProjectCoordinateAdvisor.class.getName());
  availableAdvisors.add(MavenPomPropertiesAdvisor.class.getName());
  availableAdvisors.add(JREExecutionEnvironmentAdvisor.class.getName());
  availableAdvisors.add(JREReleaseFileAdvisor.class.getName());
  availableAdvisors.add(JREDirectoryNameAdvisor.class.getName());
  availableAdvisors.add(MavenPomXmlAdvisor.class.getName());
  availableAdvisors.add(ModelIndexBundleSymbolicNameAdvisor.class.getName());
  availableAdvisors.add(ModelIndexFingerprintAdvisor.class.getName());
  availableAdvisors.add(OsgiManifestAdvisor.class.getName());
  availableAdvisors.add(MavenCentralFingerprintSearchAdvisor.class.getName());
  return ImmutableList.copyOf(availableAdvisors);
}
Program: 93252
Project: 93252
Buggy source:
@Singleton @Provides public ProjectCoordinateAdvisorService provideMappingProvider(List<IProjectCoordinateAdvisor> availableAdvisors,ModelsRcpPreferences prefs){
  ProjectCoordinateAdvisorService mappingProvider=new ProjectCoordinateAdvisorService();
  mappingProvider.setAdvisors(Advisors.createAdvisorList(availableAdvisors,prefs.advisors));
  return mappingProvider;
}

Fixed version (ground truth):
@Singleton @Provides public ProjectCoordinateAdvisorService provideMappingProvider(ModelsRcpPreferences prefs,IModelIndex index,ManualProjectCoordinateAdvisor manualMappingStrategy) throws Exception {
  List<IProjectCoordinateAdvisor> availableAdvisors=Lists.newArrayList();
  ProjectCoordinateAdvisorService mappingProvider=new ProjectCoordinateAdvisorService();
  for (  String advisorName : prefs.advisors.split("String_Node_Str")) {
    availableAdvisors.add(createAdvisor(advisorName,manualMappingStrategy,index));
  }
  mappingProvider.setAdvisors(Advisors.createAdvisorList(availableAdvisors,prefs.advisors));
  return mappingProvider;
}
Program: 93253
Project: 93253
Buggy source:
@Inject public PreferenceInitializer(List<IProjectCoordinateAdvisor> availableAdvisors){
  this.availableAdvisors=availableAdvisors;
}

Fixed version (ground truth):
@Inject public PreferenceInitializer(@Named(AVAILABLE_ADVISORS) List<String> availableAdvisors){
  this.availableAdvisors=availableAdvisors;
}
Program: 93254
Project: 93254
Buggy source:
@Override public void initializeDefaultPreferences(){
  IEclipsePreferences s=DefaultScope.INSTANCE.getNode(BUNDLE_ID);
  s.put(P_REPOSITORY_URL_LIST_ACTIV,SERVER_URL);
  s.put(P_REPOSITORY_URL_LIST,SERVER_URL);
  s.put(P_ADVISOR_LIST_SORTED,Advisors.createPreferenceString(availableAdvisors,Collections.<IProjectCoordinateAdvisor>emptySet()));
  s.putBoolean(P_REPOSITORY_ENABLE_AUTO_DOWNLOAD,true);
}

Fixed version (ground truth):
@Override public void initializeDefaultPreferences(){
  IEclipsePreferences s=DefaultScope.INSTANCE.getNode(BUNDLE_ID);
  s.put(P_REPOSITORY_URL_LIST_ACTIV,SERVER_URL);
  s.put(P_REPOSITORY_URL_LIST,SERVER_URL);
  s.put(P_ADVISOR_LIST_SORTED,getSemicolonSeparatedList(availableAdvisors));
  s.putBoolean(P_REPOSITORY_ENABLE_AUTO_DOWNLOAD,true);
}
Program: 93255
Project: 93255
Buggy source:
private void addContextMenu(){
  final MenuManager menuManager=new MenuManager();
  Menu contextMenu=menuManager.createContextMenu(tree);
  menuManager.setRemoveAllWhenShown(true);
  tree.setMenu(contextMenu);
  menuManager.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
      Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
      for (      KnownCoordinate value : selectedValues) {
        Collection<ModelCoordinate> mcs=value.mcs;
        selectedModelCoordinates.addAll(mcs);
      }
      if (!selectedValues.isEmpty()) {
        TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
        menuManager.add(action);
      }
    }
  }
);
}

Fixed version (ground truth):
private void addContextMenu(){
  final MenuManager menuManager=new MenuManager();
  Menu contextMenu=menuManager.createContextMenu(tree);
  menuManager.setRemoveAllWhenShown(true);
  tree.setMenu(contextMenu);
  menuManager.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      if (!isValidType(treeViewer.getSelection(),KnownCoordinate.class)) {
        return;
      }
      Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
      Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
      for (      KnownCoordinate value : selectedValues) {
        Collection<ModelCoordinate> mcs=value.mcs;
        selectedModelCoordinates.addAll(mcs);
      }
      if (!selectedValues.isEmpty()) {
        TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
        menuManager.add(action);
      }
    }
    private boolean isValidType(    ISelection selection,    Class<KnownCoordinate> expectedType){
      return Selections.safeFirstElement(treeViewer.getSelection(),KnownCoordinate.class).isPresent();
    }
  }
);
}
Program: 93256
Project: 93256
Buggy source:
@Override public void menuAboutToShow(IMenuManager manager){
  Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
  Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
  for (  KnownCoordinate value : selectedValues) {
    Collection<ModelCoordinate> mcs=value.mcs;
    selectedModelCoordinates.addAll(mcs);
  }
  if (!selectedValues.isEmpty()) {
    TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
    menuManager.add(action);
  }
}

Fixed version (ground truth):
@Override public void menuAboutToShow(IMenuManager manager){
  if (!isValidType(treeViewer.getSelection(),KnownCoordinate.class)) {
    return;
  }
  Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
  Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
  for (  KnownCoordinate value : selectedValues) {
    Collection<ModelCoordinate> mcs=value.mcs;
    selectedModelCoordinates.addAll(mcs);
  }
  if (!selectedValues.isEmpty()) {
    TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
    menuManager.add(action);
  }
}
Program: 93257
Project: 93257
Buggy source:
/** 
 * This implementation caches the previous results
 */
@Override public Optional<ModelCoordinate> suggest(final ProjectCoordinate pc,final String modelType){
  Pair<ProjectCoordinate,String> key=Pair.newPair(pc,modelType);
  try {
    return cache.get(key,new Callable<Optional<ModelCoordinate>>(){
      @Override public Optional<ModelCoordinate> call(){
        for (        Entry<String,Pair<File,IModelIndex>> entry : delegates.entrySet()) {
          IModelIndex index=entry.getValue().getSecond();
          Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
          if (suggest.isPresent()) {
            ModelCoordinate mc=suggest.get();
            mc.setHint(ModelCoordinate.HINT_REPOSITORY_URL,entry.getKey());
            return of(mc);
          }
        }
        return absent();
      }
    }
);
  }
 catch (  ExecutionException e) {
    log.error("String_Node_Str",e);
    return absent();
  }
}

Fixed version (ground truth):
/** 
 * This implementation caches the previous results
 */
@Override public Optional<ModelCoordinate> suggest(final ProjectCoordinate pc,final String modelType){
  Pair<ProjectCoordinate,String> key=Pair.newPair(pc,modelType);
  try {
    return cache.get(key,new Callable<Optional<ModelCoordinate>>(){
      @Override public Optional<ModelCoordinate> call(){
        for (        String remote : prefs.remotes) {
          Pair<File,IModelIndex> pair=delegates.get(remote);
          if (pair == null) {
            return absent();
          }
          IModelIndex index=pair.getSecond();
          Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
          if (suggest.isPresent()) {
            ModelCoordinate mc=suggest.get();
            mc.setHint(ModelCoordinate.HINT_REPOSITORY_URL,remote);
            return of(mc);
          }
        }
        return absent();
      }
    }
);
  }
 catch (  ExecutionException e) {
    log.error("String_Node_Str",e);
    return absent();
  }
}
Program: 93258
Project: 93258
Buggy source:
@Override public Optional<ModelCoordinate> call(){
  for (  Entry<String,Pair<File,IModelIndex>> entry : delegates.entrySet()) {
    IModelIndex index=entry.getValue().getSecond();
    Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
    if (suggest.isPresent()) {
      ModelCoordinate mc=suggest.get();
      mc.setHint(ModelCoordinate.HINT_REPOSITORY_URL,entry.getKey());
      return of(mc);
    }
  }
  return absent();
}

Fixed version (ground truth):
@Override public Optional<ModelCoordinate> call(){
  for (  String remote : prefs.remotes) {
    Pair<File,IModelIndex> pair=delegates.get(remote);
    if (pair == null) {
      return absent();
    }
    IModelIndex index=pair.getSecond();
    Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
    if (suggest.isPresent()) {
      ModelCoordinate mc=suggest.get();
      mc.setHint(ModelCoordinate.HINT_REPOSITORY_URL,remote);
      return of(mc);
    }
  }
  return absent();
}
Program: 93259
Project: 93259
Buggy source:
private void doOpen(String remoteUrl,boolean scheduleIndexUpdate) throws IOException {
  File indexLocation=new File(basedir,Urls.mangle(remoteUrl));
  IModelIndex modelIndex=new ModelIndex(indexLocation);
  delegates.put(remoteUrl,Pair.newPair(indexLocation,modelIndex));
  if (!indexAlreadyDownloaded(indexLocation) || scheduleIndexUpdate) {
    triggerIndexDownload(remoteUrl);
    return;
  }
  modelIndex.open();
  bus.post(new ModelIndexOpenedEvent());
}

Fixed version (ground truth):
private void doOpen(String remoteUrl,boolean scheduleIndexUpdate) throws IOException {
  File indexLocation=new File(basedir,Urls.mangle(remoteUrl));
  IModelIndex modelIndex=createModelIndex(indexLocation);
  delegates.put(remoteUrl,Pair.newPair(indexLocation,modelIndex));
  if (!indexAlreadyDownloaded(indexLocation) || scheduleIndexUpdate) {
    triggerIndexDownload(remoteUrl);
    return;
  }
  modelIndex.open();
  bus.post(new ModelIndexOpenedEvent());
}
Program: 93260
Project: 93260
Buggy source:
private ModelCoordinate createIndexCoordinateWithRemoteUrlHint(String remoteUrl){
  ModelCoordinate mc=new ModelCoordinate(INDEX.getGroupId(),INDEX.getArtifactId(),INDEX.getClassifier(),INDEX.getExtension(),INDEX.getVersion());
  return addRepositoryUrlHint(mc,remoteUrl);
}

Fixed version (ground truth):
private ModelCoordinate createIndexCoordinateWithRemoteUrlHint(String remoteUrl){
  ModelCoordinate mc=new ModelCoordinate(INDEX.getGroupId(),INDEX.getArtifactId(),INDEX.getClassifier(),INDEX.getExtension(),INDEX.getVersion());
  return createCopyWithRepositoryUrlHint(mc,remoteUrl);
}
Program: 93261
Project: 93261
Buggy source:
private ModelCoordinate addRepositoryUrlHint(ModelCoordinate modelCoordinate,String url){
  modelCoordinate.setHint(ModelCoordinate.HINT_REPOSITORY_URL,url);
  return modelCoordinate;
}

Fixed version (ground truth):
public Set<ModelCoordinate> addRepositoryUrlHint(Set<ModelCoordinate> modelCoordinates,String url){
  for (  ModelCoordinate modelCoordinate : modelCoordinates) {
    createCopyWithRepositoryUrlHint(modelCoordinate,url);
  }
  return modelCoordinates;
}
Program: 93262
Project: 93262
Buggy source:
/** 
 * This implementation caches the previous results
 */
@Override public Optional<ModelCoordinate> suggest(final ProjectCoordinate pc,final String modelType){
  Pair<ProjectCoordinate,String> key=Pair.newPair(pc,modelType);
  try {
    return cache.get(key,new Callable<Optional<ModelCoordinate>>(){
      @Override public Optional<ModelCoordinate> call(){
        for (        String remote : prefs.remotes) {
          Pair<File,IModelIndex> pair=delegates.get(remote);
          if (pair == null) {
            return absent();
          }
          IModelIndex index=pair.getSecond();
          Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
          if (suggest.isPresent()) {
            ModelCoordinate mc=suggest.get();
            mc.setHint(ModelCoordinate.HINT_REPOSITORY_URL,remote);
            return of(mc);
          }
        }
        return absent();
      }
    }
);
  }
 catch (  ExecutionException e) {
    log.error("String_Node_Str",e);
    return absent();
  }
}

Fixed version (ground truth):
/** 
 * This implementation caches the previous results
 */
@Override public Optional<ModelCoordinate> suggest(final ProjectCoordinate pc,final String modelType){
  Pair<ProjectCoordinate,String> key=Pair.newPair(pc,modelType);
  try {
    return cache.get(key,new Callable<Optional<ModelCoordinate>>(){
      @Override public Optional<ModelCoordinate> call(){
        for (        String remote : prefs.remotes) {
          Pair<File,IModelIndex> pair=delegates.get(remote);
          if (pair == null) {
            return absent();
          }
          IModelIndex index=pair.getSecond();
          Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
          if (suggest.isPresent()) {
            return of(createCopyWithRepositoryUrlHint(suggest.get(),remote));
          }
        }
        return absent();
      }
    }
);
  }
 catch (  ExecutionException e) {
    log.error("String_Node_Str",e);
    return absent();
  }
}
Program: 93263
Project: 93263
Buggy source:
@Override public Optional<ModelCoordinate> call(){
  for (  String remote : prefs.remotes) {
    Pair<File,IModelIndex> pair=delegates.get(remote);
    if (pair == null) {
      return absent();
    }
    IModelIndex index=pair.getSecond();
    Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
    if (suggest.isPresent()) {
      ModelCoordinate mc=suggest.get();
      mc.setHint(ModelCoordinate.HINT_REPOSITORY_URL,remote);
      return of(mc);
    }
  }
  return absent();
}

Fixed version (ground truth):
@Override public Optional<ModelCoordinate> call(){
  for (  String remote : prefs.remotes) {
    Pair<File,IModelIndex> pair=delegates.get(remote);
    if (pair == null) {
      return absent();
    }
    IModelIndex index=pair.getSecond();
    Optional<ModelCoordinate> suggest=index.suggest(pc,modelType);
    if (suggest.isPresent()) {
      return of(createCopyWithRepositoryUrlHint(suggest.get(),remote));
    }
  }
  return absent();
}
Program: 93264
Project: 93264
Buggy source:
@Subscribe public void onEvent(ModelArchiveDownloadedEvent e) throws IOException {
  if (INDEX.equals(e.model)) {
    File location=repository.getLocation(e.model,false).orNull();
    String remoteUrl=e.model.getHint(HINT_REPOSITORY_URL).orNull();
    if (remoteUrl != null) {
      Pair<File,IModelIndex> delegate=delegates.get(remoteUrl);
      delegate.getSecond().close();
      File file=delegate.getFirst();
      file.mkdir();
      FileUtils.cleanDirectory(file);
      Zips.unzip(location,file);
      doOpen(remoteUrl,false);
    }
  }
}

Fixed version (ground truth):
@Subscribe public void onEvent(ModelArchiveDownloadedEvent e) throws IOException {
  if (isIndex(e.model)) {
    File location=repository.getLocation(e.model,false).orNull();
    String remoteUrl=e.model.getHint(HINT_REPOSITORY_URL).orNull();
    if (remoteUrl != null) {
      Pair<File,IModelIndex> delegate=delegates.get(remoteUrl);
      delegate.getSecond().close();
      File file=delegate.getFirst();
      file.mkdir();
      FileUtils.cleanDirectory(file);
      Zips.unzip(location,file);
      doOpen(remoteUrl,false);
    }
  }
}
Program: 93265
Project: 93265
Buggy source:
@Override public int hashCode(){
  return HashCodeBuilder.reflectionHashCode(this,"String_Node_Str");
}

Fixed version (ground truth):
@Override public int hashCode(){
  return HashCodeBuilder.reflectionHashCode(this);
}
Program: 93266
Project: 93266
Buggy source:
@Override public boolean equals(Object obj){
  return EqualsBuilder.reflectionEquals(this,obj,"String_Node_Str");
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  return EqualsBuilder.reflectionEquals(this,obj);
}
Program: 93267
Project: 93267
Buggy source:
private void addContextMenu(){
  final MenuManager menuManager=new MenuManager();
  Menu contextMenu=menuManager.createContextMenu(tree);
  menuManager.setRemoveAllWhenShown(true);
  tree.setMenu(contextMenu);
  menuManager.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
      Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
      for (      KnownCoordinate value : selectedValues) {
        Collection<ModelCoordinate> mcs=value.mcs;
        selectedModelCoordinates.addAll(mcs);
      }
      if (!selectedValues.isEmpty()) {
        TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
        menuManager.add(action);
      }
    }
  }
);
}

Fixed version (ground truth):
private void addContextMenu(){
  final MenuManager menuManager=new MenuManager();
  Menu contextMenu=menuManager.createContextMenu(tree);
  menuManager.setRemoveAllWhenShown(true);
  tree.setMenu(contextMenu);
  menuManager.addMenuListener(new IMenuListener(){
    @Override public void menuAboutToShow(    IMenuManager manager){
      if (!isValidType(treeViewer.getSelection(),KnownCoordinate.class)) {
        return;
      }
      Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
      Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
      for (      KnownCoordinate value : selectedValues) {
        Collection<ModelCoordinate> mcs=value.mcs;
        selectedModelCoordinates.addAll(mcs);
      }
      if (!selectedValues.isEmpty()) {
        TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
        menuManager.add(action);
      }
    }
    private boolean isValidType(    ISelection selection,    Class<KnownCoordinate> expectedType){
      return Selections.safeFirstElement(treeViewer.getSelection(),KnownCoordinate.class).isPresent();
    }
  }
);
}
Program: 93268
Project: 93268
Buggy source:
@Override public void menuAboutToShow(IMenuManager manager){
  Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
  Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
  for (  KnownCoordinate value : selectedValues) {
    Collection<ModelCoordinate> mcs=value.mcs;
    selectedModelCoordinates.addAll(mcs);
  }
  if (!selectedValues.isEmpty()) {
    TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
    menuManager.add(action);
  }
}

Fixed version (ground truth):
@Override public void menuAboutToShow(IMenuManager manager){
  if (!isValidType(treeViewer.getSelection(),KnownCoordinate.class)) {
    return;
  }
  Set<KnownCoordinate> selectedValues=Selections.toSet(treeViewer.getSelection());
  Set<ModelCoordinate> selectedModelCoordinates=Sets.newHashSet();
  for (  KnownCoordinate value : selectedValues) {
    Collection<ModelCoordinate> mcs=value.mcs;
    selectedModelCoordinates.addAll(mcs);
  }
  if (!selectedValues.isEmpty()) {
    TriggerModelDownloadForModelCoordinatesAction action=new TriggerModelDownloadForModelCoordinatesAction("String_Node_Str",selectedModelCoordinates,repo,bus);
    menuManager.add(action);
  }
}