nus-yam/ex-repair huggingface dataset:
Program: 93318
Project: 93318
Buggy source:
@Override public String toString(){
  return Objects.toStringHelper("String_Node_Str").addValue(file).addValue(type).addValue(attributes).toString();
}

Fixed version (ground truth):
@Override public String toString(){
  return Objects.toStringHelper("String_Node_Str").addValue(file).addValue(type).addValue(hints).toString();
}
Program: 93319
Project: 93319
Buggy source:
public DependencyInfo(File file,DependencyType type,Map<String,String> attributes){
  this.file=file;
  this.type=type;
  this.attributes=Checks.ensureIsNotNull(attributes);
}

Fixed version (ground truth):
public DependencyInfo(File file,DependencyType type,Map<String,String> hint){
  this.file=ensureIsNotNull(file);
  checkArgument(file.isAbsolute());
  this.type=type;
  this.hints=ensureIsNotNull(hint);
}
Program: 93320
Project: 93320
Buggy source:
@Override protected Optional<ProjectCoordinate> extractProjectCoordinateInternal(DependencyInfo dependencyInfo){
  Optional<String> optionalExecutionEnvironment=dependencyInfo.getAttribute(DependencyInfo.EXECUTION_ENVIRONMENT);
  if (optionalExecutionEnvironment.isPresent()) {
    ProjectCoordinate projectCoordinate=lookUpTable.get(optionalExecutionEnvironment.get());
    if (projectCoordinate != null) {
      return fromNullable(projectCoordinate);
    }
  }
  return absent();
}

Fixed version (ground truth):
@Override protected Optional<ProjectCoordinate> extractProjectCoordinateInternal(DependencyInfo dependencyInfo){
  String optionalExecutionEnvironment=dependencyInfo.getHint(DependencyInfo.EXECUTION_ENVIRONMENT).orNull();
  if (optionalExecutionEnvironment != null) {
    ProjectCoordinate projectCoordinate=lookUpTable.get(optionalExecutionEnvironment);
    if (projectCoordinate != null) {
      return fromNullable(projectCoordinate);
    }
  }
  return absent();
}
Program: 93321
Project: 93321
Buggy source:
@Test public void returnAbsentWhenNoMappingExist() throws IOException {
  ManualMappingStrategy sut=new ManualMappingStrategy(createPersistenceFile());
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(EXAMPLE_DEPENDENCY_INFO);
  assertFalse(projectCoordinate.isPresent());
  sut.close();
}

Fixed version (ground truth):
@Test public void returnAbsentWhenNoMappingExist() throws IOException {
  ManualMappingStrategy sut=new ManualMappingStrategy(persistenceFile);
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(exampleDependencyInfo);
  assertFalse(projectCoordinate.isPresent());
  sut.close();
}
Program: 93322
Project: 93322
Buggy source:
@Test public void returnManualMappingsCorrectForMoreMappings() throws IOException {
  ManualMappingStrategy sut=new ManualMappingStrategy(createPersistenceFile());
  sut.setManualMapping(EXAMPLE_DEPENDENCY_INFO,EXPECTED_PROJECT_COORDINATE);
  sut.setManualMapping(ANOTHER_EXAMPLE_DEPENDENCY_INFO,ANOTHER_EXPECTED_PROJECT_COORDINATE);
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(EXAMPLE_DEPENDENCY_INFO);
  assertEquals(EXPECTED_PROJECT_COORDINATE,projectCoordinate.get());
  Optional<ProjectCoordinate> anotherProjectCoordinate=sut.searchForProjectCoordinate(ANOTHER_EXAMPLE_DEPENDENCY_INFO);
  assertEquals(ANOTHER_EXPECTED_PROJECT_COORDINATE,anotherProjectCoordinate.get());
  sut.close();
}

Fixed version (ground truth):
@Test public void returnManualMappingsCorrectForMoreMappings() throws IOException {
  ManualMappingStrategy sut=new ManualMappingStrategy(persistenceFile);
  sut.setManualMapping(exampleDependencyInfo,EXPECTED_PROJECT_COORDINATE);
  sut.setManualMapping(anotherExampleDependencyInfo,ANOTHER_EXPECTED_PROJECT_COORDINATE);
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(exampleDependencyInfo);
  assertEquals(EXPECTED_PROJECT_COORDINATE,projectCoordinate.get());
  Optional<ProjectCoordinate> anotherProjectCoordinate=sut.searchForProjectCoordinate(anotherExampleDependencyInfo);
  assertEquals(ANOTHER_EXPECTED_PROJECT_COORDINATE,anotherProjectCoordinate.get());
  sut.close();
}
Program: 93323
Project: 93323
Buggy source:
@Test public void returnManualMappingCorrect() throws IOException {
  ManualMappingStrategy sut=new ManualMappingStrategy(createPersistenceFile());
  sut.setManualMapping(EXAMPLE_DEPENDENCY_INFO,EXPECTED_PROJECT_COORDINATE);
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(EXAMPLE_DEPENDENCY_INFO);
  assertEquals(EXPECTED_PROJECT_COORDINATE,projectCoordinate.get());
  sut.close();
}

Fixed version (ground truth):
@Test public void returnManualMappingCorrect() throws IOException {
  ManualMappingStrategy sut=new ManualMappingStrategy(persistenceFile);
  sut.setManualMapping(exampleDependencyInfo,EXPECTED_PROJECT_COORDINATE);
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(exampleDependencyInfo);
  assertEquals(EXPECTED_PROJECT_COORDINATE,projectCoordinate.get());
  sut.close();
}
Program: 93324
Project: 93324
Buggy source:
@Test public void storageOfManualMappingsWorksCorrect() throws IOException {
  File persistenceFile=createPersistenceFile();
  ManualMappingStrategy sut=new ManualMappingStrategy(persistenceFile);
  sut.open();
  sut.setManualMapping(EXAMPLE_DEPENDENCY_INFO,EXPECTED_PROJECT_COORDINATE);
  sut.setManualMapping(ANOTHER_EXAMPLE_DEPENDENCY_INFO,ANOTHER_EXPECTED_PROJECT_COORDINATE);
  sut.close();
  sut=new ManualMappingStrategy(persistenceFile);
  sut.open();
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(EXAMPLE_DEPENDENCY_INFO);
  assertEquals(EXPECTED_PROJECT_COORDINATE,projectCoordinate.get());
  Optional<ProjectCoordinate> anotherProjectCoordinate=sut.searchForProjectCoordinate(ANOTHER_EXAMPLE_DEPENDENCY_INFO);
  assertEquals(ANOTHER_EXPECTED_PROJECT_COORDINATE,anotherProjectCoordinate.get());
  sut.close();
}

Fixed version (ground truth):
@Test public void storageOfManualMappingsWorksCorrect() throws IOException {
  ManualMappingStrategy sut=new ManualMappingStrategy(persistenceFile);
  sut.setManualMapping(exampleDependencyInfo,EXPECTED_PROJECT_COORDINATE);
  sut.setManualMapping(anotherExampleDependencyInfo,ANOTHER_EXPECTED_PROJECT_COORDINATE);
  sut.close();
  sut=new ManualMappingStrategy(persistenceFile);
  sut.open();
  Optional<ProjectCoordinate> projectCoordinate=sut.searchForProjectCoordinate(exampleDependencyInfo);
  assertEquals(EXPECTED_PROJECT_COORDINATE,projectCoordinate.get());
  Optional<ProjectCoordinate> anotherProjectCoordinate=sut.searchForProjectCoordinate(anotherExampleDependencyInfo);
  assertEquals(ANOTHER_EXPECTED_PROJECT_COORDINATE,anotherProjectCoordinate.get());
  sut.close();
}
Program: 93325
Project: 93325
Buggy source:
@Test public void testInvalidDependencyType(){
  FingerprintStrategy sut=new FingerprintStrategy(null);
  sut.searchForProjectCoordinate(new DependencyInfo(null,DependencyType.PROJECT));
}

Fixed version (ground truth):
@Test public void testInvalidDependencyType(){
  FingerprintStrategy sut=new FingerprintStrategy(null);
  sut.searchForProjectCoordinate(new DependencyInfo(exampleFile,DependencyType.PROJECT));
}
Program: 93326
Project: 93326
Buggy source:
@Test public void testMissingInformation() throws IOException {
  File jar=folder.newFile("String_Node_Str");
  SimpleIndexSearcher mockedIndexer=mock(SimpleIndexSearcher.class);
  when(mockedIndexer.searchByFingerprint(Fingerprints.sha1(jar))).thenReturn(fromNullable("String_Node_Str"));
  FingerprintStrategy sut=new FingerprintStrategy(mockedIndexer);
  Optional<ProjectCoordinate> optionalProjectCoordinate=sut.searchForProjectCoordinate(new DependencyInfo(jar,DependencyType.JAR));
  Assert.assertFalse(optionalProjectCoordinate.isPresent());
}

Fixed version (ground truth):
@Test public void testMissingInformation() throws IOException {
  SimpleIndexSearcher mockedIndexer=mock(SimpleIndexSearcher.class);
  when(mockedIndexer.searchByFingerprint(Fingerprints.sha1(exampleFile))).thenReturn(fromNullable("String_Node_Str"));
  FingerprintStrategy sut=new FingerprintStrategy(mockedIndexer);
  Optional<ProjectCoordinate> optionalProjectCoordinate=sut.searchForProjectCoordinate(new DependencyInfo(exampleFile,DependencyType.JAR));
  Assert.assertFalse(optionalProjectCoordinate.isPresent());
}
Program: 93327
Project: 93327
Buggy source:
@Test public void testValidJAR() throws IOException {
  File jar=folder.newFile("String_Node_Str");
  SimpleIndexSearcher mockedIndexer=mock(SimpleIndexSearcher.class);
  when(mockedIndexer.searchByFingerprint(Fingerprints.sha1(jar))).thenReturn(Optional.fromNullable("String_Node_Str"));
  FingerprintStrategy sut=new FingerprintStrategy(mockedIndexer);
  Optional<ProjectCoordinate> optionalProjectCoordinate=sut.searchForProjectCoordinate(new DependencyInfo(jar,DependencyType.JAR));
  Assert.assertEquals(EXPECTED_PROJECT_COORDINATE,optionalProjectCoordinate.get());
}

Fixed version (ground truth):
@Test public void testValidJAR() throws IOException {
  SimpleIndexSearcher mockedIndexer=mock(SimpleIndexSearcher.class);
  when(mockedIndexer.searchByFingerprint(Fingerprints.sha1(exampleFile))).thenReturn(Optional.fromNullable("String_Node_Str"));
  FingerprintStrategy sut=new FingerprintStrategy(mockedIndexer);
  Optional<ProjectCoordinate> optionalProjectCoordinate=sut.searchForProjectCoordinate(new DependencyInfo(exampleFile,DependencyType.JAR));
  Assert.assertEquals(EXPECTED_PROJECT_COORDINATE,optionalProjectCoordinate.get());
}
Program: 93328
Project: 93328
Buggy source:
private void appendNumberOfCompletionsByCompletionKind(){
  Bag<ProposalKind> b=TreeBag.newTreeBag();
  for (  final ProposalKind kind : ProposalKind.values()) {
    Collection<CompletionEvent> byKind=Collections2.filter(events,new Predicate<CompletionEvent>(){
      @Override public boolean apply(      CompletionEvent input){
        return kind == input.applied;
      }
    }
);
    if (byKind.size() > 0) {
      b.add(kind,byKind.size());
    }
  }
  styledString.append("String_Node_Str");
  for (  ProposalKind kind : b.topElements(20)) {
    styledString.append("String_Node_Str").append(kind.toString().toLowerCase().replace('_',' ')).append("String_Node_Str").append(b.count(kind) + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void appendNumberOfCompletionsByCompletionKind(){
  Bag<ProposalKind> b=TreeBag.newTreeBag();
  for (  final ProposalKind kind : ProposalKind.values()) {
    Collection<CompletionEvent> byKind=Collections2.filter(okayEvents,new Predicate<CompletionEvent>(){
      @Override public boolean apply(      CompletionEvent input){
        return kind == input.applied;
      }
    }
);
    if (byKind.size() > 0) {
      b.add(kind,byKind.size());
    }
  }
  styledString.append("String_Node_Str");
  for (  ProposalKind kind : b.topElements(20)) {
    styledString.append("String_Node_Str").append(kind.toString().toLowerCase().replace('_',' ')).append("String_Node_Str").append(b.count(kind) + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  }
}
Program: 93329
Project: 93329
Buggy source:
private void appendTimeSpent(){
  ArrayDoubleList spent=new ArrayDoubleList();
  for (  CompletionEvent e : events) {
    long ms=e.sessionEnded - e.sessionStarted;
    if (ms > MAX_TIME_IN_COMPLETION) {
      ms=MAX_TIME_IN_COMPLETION;
    }
    spent.add(ms);
  }
  int total=(int)StatUtils.sum(spent.toArray());
  double mean=StatUtils.mean(spent.toArray());
  styledString.append("String_Node_Str").append(format("String_Node_Str",MILLISECONDS.toMinutes(total),MILLISECONDS.toSeconds(total) - MINUTES.toSeconds(MILLISECONDS.toMinutes(total))),COUNTER_STYLER).append("String_Node_Str");
  styledString.append("String_Node_Str").append(format("String_Node_Str",mean),COUNTER_STYLER).append("String_Node_Str");
}

Fixed version (ground truth):
private void appendTimeSpent(){
  ArrayDoubleList spentApplied=computeTimeSpentInCompletion(appliedEvents);
  long totalApplied=round(sum(spentApplied.toArray()));
  long meanApplied=round(mean(spentApplied.toArray()));
  ArrayDoubleList spentAborted=computeTimeSpentInCompletion(abortedEvents);
  long totalAborted=round(sum(spentAborted.toArray()));
  long meanAborted=round(mean(spentAborted.toArray()));
  styledString.append("String_Node_Str").append("String_Node_Str").append(toTimeString(totalApplied),COUNTER_STYLER).append("String_Node_Str").append(toTimeString(totalAborted),COUNTER_STYLER);
  styledString.append("String_Node_Str").append("String_Node_Str").append(format("String_Node_Str",meanApplied),COUNTER_STYLER).append("String_Node_Str").append(format("String_Node_Str",meanAborted),COUNTER_STYLER).append("String_Node_Str");
}
Program: 93330
Project: 93330
Buggy source:
private void loadEvents(){
  File log=StatisticsSessionProcessor.getCompletionLogLocation();
  Gson gson=StatisticsSessionProcessor.getCompletionLogSerializer();
  events=Lists.newLinkedList();
  try {
    for (    String json : Files.readLines(log,Charsets.UTF_8)) {
      CompletionEvent event=gson.fromJson(json,CompletionEvent.class);
      events.add(event);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void loadEvents(){
  File log=StatisticsSessionProcessor.getCompletionLogLocation();
  Gson gson=StatisticsSessionProcessor.getCompletionLogSerializer();
  LinkedList<CompletionEvent> events=Lists.newLinkedList();
  try {
    for (    String json : Files.readLines(log,Charsets.UTF_8)) {
      CompletionEvent event=gson.fromJson(json,CompletionEvent.class);
      events.add(event);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  buggyEvents=Collections2.filter(events,new BuggyEventsPredicate());
  okayEvents=Collections2.filter(events,not(new BuggyEventsPredicate()));
  appliedEvents=Collections2.filter(okayEvents,new HasAppliedProposalPredicate());
  abortedEvents=Collections2.filter(okayEvents,not(new HasAppliedProposalPredicate()));
}
Program: 93331
Project: 93331
Buggy source:
private void setDescription(){
  String date="String_Node_Str";
  if (events.size() > 0) {
    Date start=new Date(events.get(0).sessionStarted);
    date=format("String_Node_Str",start);
  }
  setDescription("String_Node_Str" + date + "String_Node_Str");
}

Fixed version (ground truth):
private void setDescription(){
  String date="String_Node_Str";
  if (okayEvents.size() > 0) {
    Date start=new Date(Iterables.getFirst(okayEvents,null).sessionStarted);
    date=format("String_Node_Str",start);
  }
  setDescription("String_Node_Str" + date + "String_Node_Str");
}
Program: 93332
Project: 93332
Buggy source:
private void appendNumberOfCompletionsByReceiverType(){
  styledString.append("String_Node_Str").append("String_Node_Str");
  Bag<ITypeName> b=TreeBag.newTreeBag();
  for (  CompletionEvent e : events) {
    if (e.receiverType == null) {
      continue;
    }
    b.add(e.receiverType);
  }
  for (  ITypeName type : b.topElements(20)) {
    styledString.append("String_Node_Str").append(Names.vm2srcQualifiedType(type)).append("String_Node_Str").append(b.count(type) + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  }
}

Fixed version (ground truth):
private void appendNumberOfCompletionsByReceiverType(){
  styledString.append("String_Node_Str").append("String_Node_Str");
  Bag<ITypeName> b=TreeBag.newTreeBag();
  for (  CompletionEvent e : okayEvents) {
    if (e.receiverType == null) {
      continue;
    }
    b.add(e.receiverType);
  }
  for (  ITypeName type : b.topElements(20)) {
    styledString.append("String_Node_Str").append(Names.vm2srcQualifiedType(type)).append("String_Node_Str").append(b.count(type) + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  }
}
Program: 93333
Project: 93333
Buggy source:
private void appendNumberOfKeystrokesSaved(){
  ArrayDoubleList strokes=new ArrayDoubleList();
  for (  CompletionEvent e : events) {
    if (e.applied == null || e.completion == null) {
      continue;
    }
    int prefix=e.prefix == null ? 0 : e.prefix.length();
    int saved=Math.max(0,e.completion.length() - prefix);
    strokes.add(saved);
  }
  double total=StatUtils.sum(strokes.toArray());
  styledString.append("String_Node_Str").append(format("String_Node_Str",total),COUNTER_STYLER).append("String_Node_Str");
  double mean=StatUtils.mean(strokes.toArray());
  styledString.append("String_Node_Str").append(format("String_Node_Str",mean),COUNTER_STYLER);
}

Fixed version (ground truth):
private void appendNumberOfKeystrokesSaved(){
  ArrayDoubleList strokes=new ArrayDoubleList();
  for (  CompletionEvent e : appliedEvents) {
    int prefix=e.prefix == null ? 0 : e.prefix.length();
    int completionLength=e.completion == null ? 0 : e.completion.length();
    int saved=Math.max(0,completionLength - prefix);
    strokes.add(saved);
  }
  double total=sum(strokes.toArray());
  styledString.append("String_Node_Str").append(format("String_Node_Str",total),COUNTER_STYLER).append("String_Node_Str");
  double mean=mean(strokes.toArray());
  styledString.append("String_Node_Str").append(format("String_Node_Str",mean),COUNTER_STYLER);
}
Program: 93334
Project: 93334
Buggy source:
private void appendNumberOfCompletionEvents(){
  int total=0;
  int selected=0;
  for (  CompletionEvent e : events) {
    total+=e.numberOfProposals;
    selected+=e.applied != null ? 1 : 0;
  }
  styledString.append("String_Node_Str").append(format("String_Node_Str",events.size()),COUNTER_STYLER).append("String_Node_Str");
  int aborted=events.size() - selected;
  styledString.append("String_Node_Str").append(total + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  styledString.append("String_Node_Str").append(aborted + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  styledString.append("String_Node_Str").append(selected + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
}

Fixed version (ground truth):
private void appendNumberOfCompletionEvents(){
  int total=0;
  for (  CompletionEvent e : okayEvents) {
    total+=e.numberOfProposals;
  }
  int selected=appliedEvents.size();
  styledString.append("String_Node_Str").append(format("String_Node_Str",okayEvents.size()),COUNTER_STYLER).append("String_Node_Str");
  int aborted=abortedEvents.size();
  styledString.append("String_Node_Str").append(total + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  styledString.append("String_Node_Str").append(aborted + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
  styledString.append("String_Node_Str").append(selected + "String_Node_Str",COUNTER_STYLER).append("String_Node_Str");
}
Program: 93335
Project: 93335
Buggy source:
@Override public void applied(ICompletionProposal proposal){
  event.sessionEnded=System.currentTimeMillis();
  if (proposal instanceof IProcessableProposal) {
    IProcessableProposal p=(IProcessableProposal)proposal;
    CompletionProposal coreProposal=p.getCoreProposal().orNull();
    if (coreProposal != null) {
      event.prefix=p.getPrefix();
      event.applied=toKind(coreProposal.getKind());
      event.completion=new String(coreProposal.getCompletion());
    }
  }
 else   if (proposal instanceof AbstractJavaCompletionProposal) {
    event.applied=ProposalKind.UNKNOWN;
  }
  flushCurrentEvent();
}

Fixed version (ground truth):
@Override public void applied(ICompletionProposal proposal){
  event.sessionEnded=System.currentTimeMillis();
  if (proposal instanceof IProcessableProposal) {
    IProcessableProposal p=(IProcessableProposal)proposal;
    CompletionProposal coreProposal=p.getCoreProposal().orNull();
    if (coreProposal != null) {
      event.prefix=p.getPrefix();
      event.applied=toKind(coreProposal.getKind());
      event.completion=new String(coreProposal.getCompletion());
      if (ProposalKind.UNKNOWN == event.applied && isEmpty(event.completion)) {
        event.error=coreProposal.toString();
      }
    }
  }
 else   if (proposal instanceof AbstractJavaCompletionProposal) {
    event.applied=ProposalKind.UNKNOWN;
  }
  flushCurrentEvent();
}
Program: 93336
Project: 93336
Buggy source:
@Override public void startSession(IRecommendersCompletionContext ctx){
  flushCurrentEvent();
  event=new CompletionEvent();
  event.sessionStarted=event.sessionEnded=System.currentTimeMillis();
  event.completionKind=ctx.getCompletionNode().or(NULL).getClass().getSimpleName();
  IType receiverType=ctx.getReceiverType().orNull();
  if (receiverType != null) {
    event.receiverType=resolver.toRecType(receiverType);
  }
  event.prefix=ctx.getPrefix();
}

Fixed version (ground truth):
@Override public void startSession(IRecommendersCompletionContext ctx){
  flushCurrentEvent();
  event=new CompletionEvent();
  event.sessionStarted=System.currentTimeMillis();
  event.completionKind=ctx.getCompletionNode().or(NULL).getClass().getSimpleName();
  IType receiverType=ctx.getReceiverType().orNull();
  if (receiverType != null) {
    event.receiverType=resolver.toRecType(receiverType);
  }
  event.prefix=ctx.getPrefix();
}
Program: 93337
Project: 93337
Buggy source:
public static boolean haveSameParameterTypes(final List<SingleVariableDeclaration> jdtParams,final ITypeName[] crParams){
  for (int i=crParams.length; i-- > 0; ) {
    Type jdtParam=jdtParams.get(i).getType();
    jdtParam=getBaseType(jdtParam);
    final ITypeName crParam=crParams[i];
    if (jdtParam.isArrayType()) {
      if (!crParam.isArrayType()) {
        return false;
      }
      final ArrayType jdtArrayType=(ArrayType)jdtParam;
      final int jdtDimensions=jdtArrayType.getDimensions();
      final int crDimensions=crParam.getArrayDimensions();
      if (jdtDimensions != crDimensions) {
        return false;
      }
      return !sameSimpleName(getBaseType(jdtArrayType),crParam.getArrayBaseType());
    }
    if (jdtParam.isPrimitiveType()) {
      continue;
    }
    if (jdtParam.isSimpleType() && !sameSimpleName(jdtParam,crParam)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public static boolean haveSameParameterTypes(final List<SingleVariableDeclaration> jdtParams,final ITypeName[] crParams){
  for (int i=crParams.length; i-- > 0; ) {
    Type jdtParam=jdtParams.get(i).getType();
    jdtParam=getBaseType(jdtParam);
    final ITypeName crParam=crParams[i];
    if (jdtParam.isArrayType()) {
      if (!crParam.isArrayType()) {
        return false;
      }
      final ArrayType jdtArrayType=(ArrayType)jdtParam;
      final int jdtDimensions=jdtArrayType.getDimensions();
      final int crDimensions=crParam.getArrayDimensions();
      if (jdtDimensions != crDimensions) {
        return false;
      }
      return !sameSimpleName(getBaseType(jdtArrayType),crParam.getArrayBaseType());
    }
    if (jdtParam.isPrimitiveType()) {
      continue;
    }
    if (!sameSimpleName(jdtParam,crParam)) {
      return false;
    }
  }
  return true;
}
Program: 93338
Project: 93338
Buggy source:
public static boolean haveSameParameterTypes(final List<SingleVariableDeclaration> jdtParams,final ITypeName[] crParams){
  for (int i=crParams.length; i-- > 0; ) {
    Type jdtParam=jdtParams.get(i).getType();
    jdtParam=getBaseType(jdtParam);
    final ITypeName crParam=crParams[i];
    if (jdtParam.isArrayType()) {
      if (!crParam.isArrayType()) {
        return false;
      }
      final ArrayType jdtArrayType=(ArrayType)jdtParam;
      final int jdtDimensions=jdtArrayType.getDimensions();
      final int crDimensions=crParam.getArrayDimensions();
      if (jdtDimensions != crDimensions) {
        return false;
      }
      return !sameSimpleName(getBaseType(jdtArrayType),crParam.getArrayBaseType());
    }
    if (jdtParam.isPrimitiveType()) {
      continue;
    }
    if (jdtParam.isSimpleType() && !sameSimpleName(jdtParam,crParam)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
public static boolean haveSameParameterTypes(final List<SingleVariableDeclaration> jdtParams,final ITypeName[] crParams){
  for (int i=crParams.length; i-- > 0; ) {
    Type jdtParam=jdtParams.get(i).getType();
    jdtParam=getBaseType(jdtParam);
    final ITypeName crParam=crParams[i];
    if (jdtParam.isArrayType()) {
      if (!crParam.isArrayType()) {
        return false;
      }
      final ArrayType jdtArrayType=(ArrayType)jdtParam;
      final int jdtDimensions=jdtArrayType.getDimensions();
      final int crDimensions=crParam.getArrayDimensions();
      if (jdtDimensions != crDimensions) {
        return false;
      }
      return !sameSimpleName(getBaseType(jdtArrayType),crParam.getArrayBaseType());
    }
    if (jdtParam.isPrimitiveType()) {
      continue;
    }
    if (!sameSimpleName(jdtParam,crParam)) {
      return false;
    }
  }
  return true;
}
Program: 93339
Project: 93339
Buggy source:
@Override public Optional<IType> getEnclosingType(){
  final IJavaElement enclosing=getEnclosingElement().orNull();
  if (enclosing instanceof IType) {
    return of((IType)enclosing);
  }
 else {
    return absent();
  }
}

Fixed version (ground truth):
@Override public Optional<IType> getEnclosingType(){
  final IJavaElement enclosing=getEnclosingElement().orNull();
  if (enclosing instanceof IType) {
    return of((IType)enclosing);
  }
 else   if (enclosing instanceof IField) {
    return of(((IField)enclosing).getDeclaringType());
  }
 else {
    return absent();
  }
}
Program: 93340
Project: 93340
Buggy source:
@Override public Optional<IType> getEnclosingType(){
  final IJavaElement enclosing=getEnclosingElement().orNull();
  if (enclosing instanceof IType) {
    return of((IType)enclosing);
  }
 else {
    return absent();
  }
}

Fixed version (ground truth):
@Override public Optional<IType> getEnclosingType(){
  final IJavaElement enclosing=getEnclosingElement().orNull();
  if (enclosing instanceof IType) {
    return of((IType)enclosing);
  }
 else   if (enclosing instanceof IField) {
    return of(((IField)enclosing).getDeclaringType());
  }
 else {
    return absent();
  }
}
Program: 93341
Project: 93341
Buggy source:
public void open(){
  if (store.exists()) {
    mappings=GsonUtil.deserialize(store,new TypeToken<Map<File,ModelArchiveMetadata<K,V>>>(){
    }
.getType());
  }
  if (mappings == null) {
    mappings=Maps.newHashMap();
  }
}

Fixed version (ground truth):
public void open(){
  if (store.exists()) {
    try {
      mappings=deserializeMapping();
    }
 catch (    final Exception e) {
      log.warn("String_Node_Str" + store + "String_Node_Str",e);
    }
  }
  if (mappings == null) {
    mappings=Maps.newHashMap();
  }
}
Program: 93342
Project: 93342
Buggy source:
public static IllegalStateException throwUnhandledException(final Exception cause,final String msg,final Object... args){
  final String formattedMessage=format(msg,args);
  throw new IllegalStateException(formattedMessage,cause);
}

Fixed version (ground truth):
public static RuntimeException throwUnhandledException(final Exception cause,final String msg,final Object... args){
  final String formattedMessage=format(msg,args);
  throw new RuntimeException(formattedMessage,cause);
}
Program: 93343
Project: 93343
Buggy source:
public static void serialize(final Object obj,final File dest){
  ensureIsNotNull(obj,"String_Node_Str");
  ensureIsNotNull(dest,"String_Node_Str");
  Writer fw=null;
  try {
    fw=new BufferedWriter(new FileWriter(dest));
    getInstance().toJson(obj,fw);
  }
 catch (  final IOException x) {
    throwUnhandledException(x);
  }
 finally {
    IOUtils.closeQuietly(fw);
  }
}

Fixed version (ground truth):
public static void serialize(final Object obj,final OutputStream out){
  ensureIsNotNull(obj);
  ensureIsNotNull(out);
  Writer writer=null;
  try {
    writer=new OutputStreamWriter(out,"String_Node_Str");
    getInstance().toJson(obj,writer);
  }
 catch (  final Exception e) {
    throw throwUnhandledException(e);
  }
 finally {
    IOUtils.closeQuietly(writer);
  }
}
Program: 93344
Project: 93344
Buggy source:
public static <T>List<T> deserializeZip(File zip,Class<T> classOfT) throws IOException {
  List<T> res=Lists.newLinkedList();
  ZipInputStream zis=null;
  try {
    InputSupplier<FileInputStream> fis=Files.newInputStreamSupplier(zip);
    zis=new ZipInputStream(fis.getInput());
    ZipEntry entry;
    while ((entry=zis.getNextEntry()) != null) {
      if (!entry.isDirectory()) {
        final InputStreamReader reader=new InputStreamReader(zis);
        final T data=getInstance().fromJson(reader,classOfT);
        res.add(data);
      }
    }
  }
  finally {
    Closeables.closeQuietly(zis);
  }
  return res;
}

Fixed version (ground truth):
public static <T>List<T> deserializeZip(File zip,Class<T> classOfT) throws IOException {
  List<T> res=Lists.newLinkedList();
  ZipInputStream zis=null;
  try {
    InputSupplier<FileInputStream> fis=Files.newInputStreamSupplier(zip);
    zis=new ZipInputStream(fis.getInput());
    ZipEntry entry;
    while ((entry=zis.getNextEntry()) != null) {
      if (!entry.isDirectory()) {
        res.add(GsonUtil.<T>deserialize(zis,classOfT));
      }
    }
  }
  finally {
    Closeables.closeQuietly(zis);
  }
  return res;
}
Program: 93345
Project: 93345
Buggy source:
public static <T>T deserialize(final File jsonFile,final Type classOfT){
  ensureIsNotNull(jsonFile);
  ensureIsNotNull(classOfT);
  InputStream fis;
  try {
    fis=new BufferedInputStream(new FileInputStream(jsonFile));
  }
 catch (  final FileNotFoundException e) {
    throw Throws.throwUnhandledException(e,"String_Node_Str" + jsonFile.getAbsolutePath());
  }
  return deserialize(fis,classOfT);
}

Fixed version (ground truth):
public static <T>T deserialize(final File jsonFile,final Type classOfT){
  ensureIsNotNull(jsonFile);
  ensureIsNotNull(classOfT);
  InputStream in=null;
  try {
    in=new BufferedInputStream(new FileInputStream(jsonFile));
    return deserialize(in,classOfT);
  }
 catch (  final Exception e) {
    throw throwUnhandledException(e);
  }
 finally {
    IOUtils.closeQuietly(in);
  }
}
Program: 93346
Project: 93346
Buggy source:
public void open(){
  if (store.exists()) {
    mappings=GsonUtil.deserialize(store,new TypeToken<Map<File,ModelArchiveMetadata<K,V>>>(){
    }
.getType());
  }
  if (mappings == null) {
    mappings=Maps.newHashMap();
  }
}

Fixed version (ground truth):
public void open(){
  if (store.exists()) {
    try {
      mappings=deserializeMapping();
    }
 catch (    final Exception e) {
      log.warn("String_Node_Str" + store + "String_Node_Str",e);
    }
  }
  if (mappings == null) {
    mappings=Maps.newHashMap();
  }
}
Program: 93347
Project: 93347
Buggy source:
public static IllegalStateException throwUnhandledException(final Exception cause,final String msg,final Object... args){
  final String formattedMessage=format(msg,args);
  throw new IllegalStateException(formattedMessage,cause);
}

Fixed version (ground truth):
public static RuntimeException throwUnhandledException(final Exception cause,final String msg,final Object... args){
  final String formattedMessage=format(msg,args);
  throw new RuntimeException(formattedMessage,cause);
}
Program: 93348
Project: 93348
Buggy source:
public static void serialize(final Object obj,final File dest){
  ensureIsNotNull(obj,"String_Node_Str");
  ensureIsNotNull(dest,"String_Node_Str");
  Writer fw=null;
  try {
    fw=new BufferedWriter(new FileWriter(dest));
    getInstance().toJson(obj,fw);
  }
 catch (  final IOException x) {
    throwUnhandledException(x);
  }
 finally {
    IOUtils.closeQuietly(fw);
  }
}

Fixed version (ground truth):
public static void serialize(final Object obj,final OutputStream out){
  ensureIsNotNull(obj);
  ensureIsNotNull(out);
  Writer writer=null;
  try {
    writer=new OutputStreamWriter(out,"String_Node_Str");
    getInstance().toJson(obj,writer);
  }
 catch (  final Exception e) {
    throw throwUnhandledException(e);
  }
 finally {
    IOUtils.closeQuietly(writer);
  }
}
Program: 93349
Project: 93349
Buggy source:
public static <T>List<T> deserializeZip(File zip,Class<T> classOfT) throws IOException {
  List<T> res=Lists.newLinkedList();
  ZipInputStream zis=null;
  try {
    InputSupplier<FileInputStream> fis=Files.newInputStreamSupplier(zip);
    zis=new ZipInputStream(fis.getInput());
    ZipEntry entry;
    while ((entry=zis.getNextEntry()) != null) {
      if (!entry.isDirectory()) {
        final InputStreamReader reader=new InputStreamReader(zis);
        final T data=getInstance().fromJson(reader,classOfT);
        res.add(data);
      }
    }
  }
  finally {
    Closeables.closeQuietly(zis);
  }
  return res;
}

Fixed version (ground truth):
public static <T>List<T> deserializeZip(File zip,Class<T> classOfT) throws IOException {
  List<T> res=Lists.newLinkedList();
  ZipInputStream zis=null;
  try {
    InputSupplier<FileInputStream> fis=Files.newInputStreamSupplier(zip);
    zis=new ZipInputStream(fis.getInput());
    ZipEntry entry;
    while ((entry=zis.getNextEntry()) != null) {
      if (!entry.isDirectory()) {
        res.add(GsonUtil.<T>deserialize(zis,classOfT));
      }
    }
  }
  finally {
    Closeables.closeQuietly(zis);
  }
  return res;
}
Program: 93350
Project: 93350
Buggy source:
public static <T>T deserialize(final File jsonFile,final Type classOfT){
  ensureIsNotNull(jsonFile);
  ensureIsNotNull(classOfT);
  InputStream fis;
  try {
    fis=new BufferedInputStream(new FileInputStream(jsonFile));
  }
 catch (  final FileNotFoundException e) {
    throw Throws.throwUnhandledException(e,"String_Node_Str" + jsonFile.getAbsolutePath());
  }
  return deserialize(fis,classOfT);
}

Fixed version (ground truth):
public static <T>T deserialize(final File jsonFile,final Type classOfT){
  ensureIsNotNull(jsonFile);
  ensureIsNotNull(classOfT);
  InputStream in=null;
  try {
    in=new BufferedInputStream(new FileInputStream(jsonFile));
    return deserialize(in,classOfT);
  }
 catch (  final Exception e) {
    throw throwUnhandledException(e);
  }
 finally {
    IOUtils.closeQuietly(in);
  }
}
Program: 93351
Project: 93351
Buggy source:
@Override public List<MatchNode> search(String query){
  List<MatchNode> result=new ArrayList<MatchNode>();
  List<PatternRankResult> rankResult=new ArrayList<PatternRankResult>();
  if (query.trim().equals("String_Node_Str"))   return result;
  if (sfMapList != null && sfMapList.size() > 0)   for (  SummaryFileMap map : sfMapList) {
    String summary=map.summary;
    rankQuery(summary.toLowerCase(),query.toLowerCase(),map.filePath,rankResult);
  }
  sortRankResult(rankResult);
  for (int k=0; k < Math.min(15,rankResult.size()); k++) {
    File jsonFile=new File(rankResult.get(k).getFilePath());
    if (jsonFile.exists()) {
      Effect parent=GsonUtil.deserialize(jsonFile,Effect.class);
      parent.setId(System.currentTimeMillis() + String.valueOf(Math.random()).substring(5));
      MatchNode[] children=new MatchNode[parent.getParameters().length];
      if (rankResult.get(k).isInOrder()) {
        this.values.clear();
        parseParameterValues(rankResult.get(k).getPattern(),query);
      }
      for (int i=0; i < children.length; i++) {
        EffectParameter param=parent.getParameters()[i];
        String keyName=param.getName().toLowerCase();
        if (values.get(keyName) != null)         param.setValue(values.get(keyName));
        ArgumentMatchNode childNode=new ArgumentMatchNode(param.getName(),param);
        children[i]=childNode;
      }
      result.add(new EffectMatchNode(parent,rankResult.get(k).getPattern(),children));
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public List<MatchNode> search(String query){
  List<MatchNode> result=new ArrayList<MatchNode>();
  List<PatternRankResult> rankResult=new ArrayList<PatternRankResult>();
  if (query.trim().equals("String_Node_Str"))   return result;
  if (sfMapList != null && sfMapList.size() > 0)   for (  SummaryFileMap map : sfMapList) {
    String summary=map.summary;
    rankQuery(summary.toLowerCase(),query.toLowerCase(),map.filePath,rankResult);
  }
  sortRankResult(rankResult);
  for (int k=0; k < Math.min(15,rankResult.size()); k++) {
    File jsonFile=new File(rankResult.get(k).getFilePath());
    if (jsonFile.exists()) {
      Effect parent=GsonUtil.deserialize(jsonFile,Effect.class);
      parent.setId(System.currentTimeMillis() + String.valueOf(Math.random()).substring(5));
      MatchNode[] children=new MatchNode[parent.getParameters().length];
      this.values.clear();
      if (rankResult.get(k).isInOrder()) {
        parseParameterValues(rankResult.get(k).getPattern(),query);
      }
      for (int i=0; i < children.length; i++) {
        EffectParameter param=parent.getParameters()[i];
        String keyName=param.getName().toLowerCase();
        if (values.get(keyName) != null)         param.setValue(values.get(keyName));
        ArgumentMatchNode childNode=new ArgumentMatchNode(param.getName(),param);
        children[i]=childNode;
      }
      result.add(new EffectMatchNode(parent,rankResult.get(k).getPattern(),children));
    }
  }
  return result;
}
Program: 93352
Project: 93352
Buggy source:
@Override public List<MatchNode> search(String query){
  List<MatchNode> result=new ArrayList<MatchNode>();
  List<PatternRankResult> rankResult=new ArrayList<PatternRankResult>();
  if (query.trim().equals("String_Node_Str"))   return result;
  if (sfMapList != null && sfMapList.size() > 0)   for (  SummaryFileMap map : sfMapList) {
    String summary=map.summary;
    rankQuery(summary.toLowerCase(),query.toLowerCase(),map.filePath,rankResult);
  }
  sortRankResult(rankResult);
  for (int k=0; k < Math.min(15,rankResult.size()); k++) {
    File jsonFile=new File(rankResult.get(k).getFilePath());
    if (jsonFile.exists()) {
      Effect parent=GsonUtil.deserialize(jsonFile,Effect.class);
      parent.setId(System.currentTimeMillis() + String.valueOf(Math.random()).substring(5));
      MatchNode[] children=new MatchNode[parent.getParameters().length];
      if (rankResult.get(k).isInOrder()) {
        this.values.clear();
        parseParameterValues(rankResult.get(k).getPattern(),query);
      }
      for (int i=0; i < children.length; i++) {
        EffectParameter param=parent.getParameters()[i];
        String keyName=param.getName().toLowerCase();
        if (values.get(keyName) != null)         param.setValue(values.get(keyName));
        ArgumentMatchNode childNode=new ArgumentMatchNode(param.getName(),param);
        children[i]=childNode;
      }
      result.add(new EffectMatchNode(parent,rankResult.get(k).getPattern(),children));
    }
  }
  return result;
}

Fixed version (ground truth):
@Override public List<MatchNode> search(String query){
  List<MatchNode> result=new ArrayList<MatchNode>();
  List<PatternRankResult> rankResult=new ArrayList<PatternRankResult>();
  if (query.trim().equals("String_Node_Str"))   return result;
  if (sfMapList != null && sfMapList.size() > 0)   for (  SummaryFileMap map : sfMapList) {
    String summary=map.summary;
    rankQuery(summary.toLowerCase(),query.toLowerCase(),map.filePath,rankResult);
  }
  sortRankResult(rankResult);
  for (int k=0; k < Math.min(15,rankResult.size()); k++) {
    File jsonFile=new File(rankResult.get(k).getFilePath());
    if (jsonFile.exists()) {
      Effect parent=GsonUtil.deserialize(jsonFile,Effect.class);
      parent.setId(System.currentTimeMillis() + String.valueOf(Math.random()).substring(5));
      MatchNode[] children=new MatchNode[parent.getParameters().length];
      this.values.clear();
      if (rankResult.get(k).isInOrder()) {
        parseParameterValues(rankResult.get(k).getPattern(),query);
      }
      for (int i=0; i < children.length; i++) {
        EffectParameter param=parent.getParameters()[i];
        String keyName=param.getName().toLowerCase();
        if (values.get(keyName) != null)         param.setValue(values.get(keyName));
        ArgumentMatchNode childNode=new ArgumentMatchNode(param.getName(),param);
        children[i]=childNode;
      }
      result.add(new EffectMatchNode(parent,rankResult.get(k).getPattern(),children));
    }
  }
  return result;
}
Program: 93353
Project: 93353
Buggy source:
private void initalizeCollector(){
  if (shouldFillArgumentNames()) {
    collector=new FillArgumentNamesCompletionProposalCollector(jdtuiContext);
  }
 else {
    collector=new CompletionProposalCollector(jdtuiContext.getCompilationUnit(),false);
  }
  collector.setIgnored(ANNOTATION_ATTRIBUTE_REF,false);
  collector.setIgnored(ANONYMOUS_CLASS_DECLARATION,false);
  collector.setIgnored(ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION,false);
  collector.setIgnored(FIELD_REF,false);
  collector.setIgnored(FIELD_REF_WITH_CASTED_RECEIVER,false);
  collector.setIgnored(KEYWORD,false);
  collector.setIgnored(LABEL_REF,false);
  collector.setIgnored(LOCAL_VARIABLE_REF,false);
  collector.setIgnored(METHOD_DECLARATION,false);
  collector.setIgnored(METHOD_NAME_REFERENCE,false);
  collector.setIgnored(METHOD_REF,false);
  collector.setIgnored(CONSTRUCTOR_INVOCATION,false);
  collector.setIgnored(METHOD_REF_WITH_CASTED_RECEIVER,false);
  collector.setIgnored(PACKAGE_REF,false);
  collector.setIgnored(POTENTIAL_METHOD_DECLARATION,false);
  collector.setIgnored(VARIABLE_DECLARATION,false);
  collector.setIgnored(TYPE_REF,false);
  collector.setAllowsRequiredProposals(FIELD_REF,TYPE_REF,true);
  collector.setAllowsRequiredProposals(FIELD_REF,TYPE_IMPORT,true);
  collector.setAllowsRequiredProposals(FIELD_REF,FIELD_IMPORT,true);
  collector.setAllowsRequiredProposals(METHOD_REF,TYPE_REF,true);
  collector.setAllowsRequiredProposals(METHOD_REF,TYPE_IMPORT,true);
  collector.setAllowsRequiredProposals(METHOD_REF,METHOD_IMPORT,true);
  collector.setAllowsRequiredProposals(CONSTRUCTOR_INVOCATION,TYPE_REF,true);
  collector.setAllowsRequiredProposals(ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION,TYPE_REF,true);
  collector.setAllowsRequiredProposals(ANONYMOUS_CLASS_DECLARATION,TYPE_REF,true);
  collector.setAllowsRequiredProposals(TYPE_REF,TYPE_REF,true);
  collector.setFavoriteReferences(getFavoriteStaticMembers());
  collector.setRequireExtendedContext(true);
}

Fixed version (ground truth):
private void initalizeCollector(){
  if (shouldFillArgumentNames()) {
    collector=new FillArgumentNamesCompletionProposalCollector(jdtuiContext);
  }
 else {
    collector=new CompletionProposalCollector(jdtuiContext.getCompilationUnit(),false);
  }
  configureInterestedProposalTypes();
  adjustProposalReplacementLength();
}
Program: 93354
Project: 93354
Buggy source:
public int calculateRelevance(){
  String commonPrefix=getCommonPrefix(subwordsMatchingRegion.toLowerCase(),prefix.toLowerCase());
  int score=commonPrefix.length() > 0 ? 200 + commonPrefix.length() : 0;
  int relevance=jdtProposal.getRelevance() + score + bestSubsequenceScore;
  return relevance;
}

Fixed version (ground truth):
public int calculateRelevance(){
  String commonPrefix=getCommonPrefix(subwordsMatchingRegion.toLowerCase(),prefix.toLowerCase());
  int score=0;
  if (commonPrefix.length() == prefix.length()) {
    score+=200;
  }
  int relevance=jdtProposal.getRelevance() + score + bestSubsequenceScore;
  return relevance;
}
Program: 93355
Project: 93355
Buggy source:
public int calculateRelevance(){
  String commonPrefix=getCommonPrefix(subwordsMatchingRegion.toLowerCase(),prefix.toLowerCase());
  int score=commonPrefix.length() > 0 ? 200 + commonPrefix.length() : 0;
  int relevance=jdtProposal.getRelevance() + score + bestSubsequenceScore;
  return relevance;
}

Fixed version (ground truth):
public int calculateRelevance(){
  String commonPrefix=getCommonPrefix(subwordsMatchingRegion.toLowerCase(),prefix.toLowerCase());
  int score=0;
  if (commonPrefix.length() == prefix.length()) {
    score+=200;
  }
  int relevance=jdtProposal.getRelevance() + score + bestSubsequenceScore;
  return relevance;
}
Program: 93356
Project: 93356
Buggy source:
public static List<int[]> findSequences(String completion,String token){
  List<int[]> active=Lists.newLinkedList();
  int[] start=new int[0];
  active.add(start);
  for (int i=0; i < token.length(); i++) {
    List<int[]> next=Lists.newLinkedList();
    outer:     for (    int[] s : active) {
      int startIndex=s.length == 0 ? 0 : s[s.length - 1] + 1;
      boolean wordBoundaryFound=false;
      for (int j=startIndex; j < completion.length(); j++) {
        char c1=completion.charAt(j);
        wordBoundaryFound|=Character.isUpperCase(c1);
        if (isSameIgnoreCase(c1,token.charAt(i))) {
          if (wordBoundaryFound && !Character.isUpperCase(c1))           continue;
          wordBoundaryFound=false;
          int[] copy=Arrays.copyOf(s,s.length + 1);
          copy[i]=j;
          next.add(copy);
        }
      }
    }
    active=next;
    next=Lists.newLinkedList();
  }
  for (Iterator<int[]> it=active.iterator(); it.hasNext(); ) {
    int[] candidate=it.next();
    if (candidate.length < token.length()) {
      it.remove();
      continue;
    }
  }
  return active;
}

Fixed version (ground truth):
public static List<int[]> findSequences(String completion,String token){
  List<int[]> active=Lists.newLinkedList();
  int[] start=new int[0];
  active.add(start);
  for (int i=0; i < token.length(); i++) {
    List<int[]> next=Lists.newLinkedList();
    outer:     for (    int[] s : active) {
      int startIndex=s.length == 0 ? 0 : s[s.length - 1] + 1;
      boolean wordBoundaryFound=false;
      for (int j=startIndex; j < completion.length(); j++) {
        char c1=completion.charAt(j);
        wordBoundaryFound|=Character.isUpperCase(c1);
        if (isSameIgnoreCase(c1,token.charAt(i))) {
          if (wordBoundaryFound && !Character.isUpperCase(c1))           continue;
          int[] copy=Arrays.copyOf(s,s.length + 1);
          copy[i]=j;
          next.add(copy);
        }
      }
    }
    active=next;
    next=Lists.newLinkedList();
  }
  for (Iterator<int[]> it=active.iterator(); it.hasNext(); ) {
    int[] candidate=it.next();
    if (candidate.length < token.length()) {
      it.remove();
      continue;
    }
  }
  return active;
}
Program: 93357
Project: 93357
Buggy source:
/** 
 * Returns the index of the search parameter with the given name.
 * @param name The name of the search parameter.
 * @return The index of the search parameter.
 */
public int getParameterIndex(String name){
  for (int i=0; i < params.size(); i++) {
    if (params.get(i).getName() == name) {
      return i;
    }
  }
  return -1;
}

Fixed version (ground truth):
/** 
 * Returns the index of the search parameter with the given name.
 * @param name The name of the search parameter.
 * @return The index of the search parameter.
 */
public int getParameterIndex(String name){
  for (int i=0; i < params.size(); i++) {
    if (params.get(i).getName().equals(name)) {
      return i;
    }
  }
  return -1;
}
Program: 93358
Project: 93358
Buggy source:
/** 
 * Evaluate one match. The evaluated result of the root match node is applied to the code environment.
 * @param node The match node to evaluate.
 * @return The result of the evaluation.
 */
private Object evaluateMatchNode(MatchNode node){
  if (node instanceof EffectMatchNode) {
    EffectMatchNode effectNode=(EffectMatchNode)node;
    Object[] args=new Object[effectNode.getEffect().numParameters()];
    for (int i=0; i < args.length; i++) {
      args[i]=evaluateMatchNode(effectNode.getChild(i));
    }
    return evaluateEffect(effectNode,args);
  }
 else   return ((ArgumentMatchNode)node).getArgument();
}

Fixed version (ground truth):
/** 
 * Evaluate one match. The evaluated result of the root match node is applied to the code environment.
 * @param node The match node to evaluate.
 * @return The result of the evaluation.
 */
protected Object evaluateMatchNode(MatchNode node){
  if (node instanceof EffectMatchNode) {
    EffectMatchNode effectNode=(EffectMatchNode)node;
    Object[] args=new Object[effectNode.getEffect().numParameters()];
    for (int i=0; i < args.length; i++) {
      String value=(String)evaluateMatchNode(effectNode.getChild(i));
      ;
      if (value.isEmpty()) {
        value=((ArgumentMatchNode)effectNode.getChild(i)).getParameter().getName();
      }
      args[i]=value;
    }
    return evaluateEffect(effectNode,args);
  }
 else   return ((ArgumentMatchNode)node).getArgument();
}
Program: 93360
Project: 93360
Buggy source:
@Override public void acceptSearchMatch(final SearchMatch match) throws CoreException {
  res[0]=(IType)match.getElement();
}

Fixed version (ground truth):
@Override public void acceptSearchMatch(final SearchMatch match) throws CoreException {
  IType element=(IType)match.getElement();
  if (toRecType(element).equals(recType)) {
    res[0]=element;
  }
}