nus-yam/ex-repair huggingface dataset:
Program: 185247
Project: 185247
Buggy source:
public ThriftTypeReference getMapValueThriftTypeReference(Type javaType){
  if (isStructType(javaType)) {
    deferredTypesWorkList.get().add(javaType);
    return getThriftTypeReference(javaType,Recursiveness.FORCED);
  }
 else {
    return getThriftTypeReference(javaType,Recursiveness.NOT_ALLOWED);
  }
}

Fixed version (ground truth):
public ThriftTypeReference getMapValueThriftTypeReference(Type javaType){
  if (isStructType(javaType)) {
    return getThriftTypeReference(javaType,Recursiveness.FORCED);
  }
 else {
    return getThriftTypeReference(javaType,Recursiveness.NOT_ALLOWED);
  }
}
Program: 185248
Project: 185248
Buggy source:
private ThriftType buildThriftType(Type javaType){
  ThriftType thriftType=buildThriftTypeInternal(javaType);
  typeCache.putIfAbsent(javaType,thriftType);
  if (stack.get().isEmpty()) {
    Deque<Type> unresolvedJavaTypes=deferredTypesWorkList.get();
    do {
      if (unresolvedJavaTypes.isEmpty()) {
        break;
      }
      Type unresolvedJavaType=unresolvedJavaTypes.pop();
      if (!typeCache.containsKey(unresolvedJavaType)) {
        ThriftType resolvedThriftType=buildThriftTypeInternal(deferredTypesWorkList.get().pop());
        typeCache.putIfAbsent(unresolvedJavaType,resolvedThriftType);
      }
    }
 while (true);
  }
  return thriftType;
}

Fixed version (ground truth):
private ThriftType buildThriftType(Type javaType){
  ThriftType thriftType=buildThriftTypeInternal(javaType);
  typeCache.putIfAbsent(javaType,thriftType);
  if (stack.get().isEmpty()) {
    Deque<Type> unresolvedJavaTypes=deferredTypesWorkList.get();
    do {
      if (unresolvedJavaTypes.isEmpty()) {
        break;
      }
      Type unresolvedJavaType=unresolvedJavaTypes.pop();
      if (!typeCache.containsKey(unresolvedJavaType)) {
        ThriftType resolvedThriftType=buildThriftTypeInternal(unresolvedJavaType);
        typeCache.putIfAbsent(unresolvedJavaType,resolvedThriftType);
      }
    }
 while (true);
  }
  return thriftType;
}
Program: 185249
Project: 185249
Buggy source:
private <T>SuccessAndResult<T> topologicalSort(List<T> list,Predicate<T> isKnown){
  List<T> remaining=list;
  List<T> newList=Lists.newArrayList();
  int prevSize=0;
  while (prevSize != remaining.size()) {
    prevSize=remaining.size();
    List<T> bad=Lists.newArrayList();
    for (    T t : remaining) {
      if (isKnown.apply(t)) {
        newList.add(t);
      }
 else {
        bad.add(t);
      }
    }
    remaining=bad;
  }
  if (prevSize == 0) {
    return new SuccessAndResult(true,newList);
  }
 else {
    return new SuccessAndResult(false,remaining);
  }
}

Fixed version (ground truth):
private <T>SuccessAndResult<T> topologicalSort(List<T> list,Predicate<T> isKnown){
  List<T> remaining=list;
  List<T> newList=Lists.newArrayList();
  int prevSize=0;
  while (prevSize != remaining.size()) {
    prevSize=remaining.size();
    List<T> bad=Lists.newArrayList();
    for (    T t : remaining) {
      if (isKnown.apply(t)) {
        newList.add(t);
      }
 else {
        bad.add(t);
      }
    }
    remaining=bad;
  }
  if (prevSize == 0) {
    return new SuccessAndResult<>(true,newList);
  }
 else {
    return new SuccessAndResult<>(false,remaining);
  }
}
Program: 185250
Project: 185250
Buggy source:
private boolean verifyTypes(){
  SuccessAndResult<ThriftType> output=topologicalSort(thriftTypes,new Predicate<ThriftType>(){
    @Override public boolean apply(    @Nullable ThriftType t){
      ThriftProtocolType proto=t.getProtocolType();
      if (proto == ThriftProtocolType.ENUM) {
        knownTypes.add(t);
        return true;
      }
 else       if (proto == ThriftProtocolType.STRUCT) {
        return verifyStruct(t,true);
      }
 else {
        Preconditions.checkState(false,"String_Node_Str");
        return false;
      }
    }
  }
);
  if (output.success) {
    thriftTypes=output.result;
    return true;
  }
 else {
    for (    ThriftType t : output.result) {
      verifyStruct(t,false);
    }
    return false;
  }
}

Fixed version (ground truth):
private boolean verifyTypes(){
  SuccessAndResult<ThriftType> output=topologicalSort(thriftTypes,new Predicate<ThriftType>(){
    @Override public boolean apply(    @Nullable ThriftType t){
      ThriftProtocolType proto=checkNotNull(t).getProtocolType();
      if (proto == ThriftProtocolType.ENUM) {
        knownTypes.add(t);
        return true;
      }
 else       if (proto == ThriftProtocolType.STRUCT) {
        return verifyStruct(t,true);
      }
 else {
        Preconditions.checkState(false,"String_Node_Str");
        return false;
      }
    }
  }
);
  if (output.success) {
    thriftTypes=output.result;
    return true;
  }
 else {
    for (    ThriftType t : output.result) {
      verifyStruct(t,false);
    }
    return false;
  }
}
Program: 185251
Project: 185251
Buggy source:
private boolean verifyStruct(ThriftType t,boolean quiet){
  ThriftStructMetadata<?> metadata=t.getStructMetadata();
  boolean ok=true;
  for (  ThriftFieldMetadata fieldMetadata : metadata.getFields(FieldType.THRIFT_FIELD)) {
    boolean fieldOk=verifyField(fieldMetadata.getThriftType());
    if (!fieldOk) {
      ok=false;
      if (!quiet) {
        LOG.error("String_Node_Str",thriftTypeRenderer.toString(fieldMetadata.getThriftType()),metadata.getStructName(),fieldMetadata.getName());
      }
    }
  }
  knownTypes.add(t);
  return ok;
}

Fixed version (ground truth):
private boolean verifyStruct(ThriftType t,boolean quiet){
  ThriftStructMetadata<?> metadata=t.getStructMetadata();
  boolean ok=true;
  for (  ThriftFieldMetadata fieldMetadata : metadata.getFields(FieldType.THRIFT_FIELD)) {
    boolean fieldOk=verifyField(fieldMetadata.getThriftType());
    if (!fieldOk) {
      ok=false;
      if (!quiet) {
        LOG.error("String_Node_Str",thriftTypeRenderer.toString(fieldMetadata.getThriftType()),metadata.getStructName(),fieldMetadata.getName());
      }
    }
  }
  if (ok) {
    knownTypes.add(t);
  }
  return ok;
}
Program: 185252
Project: 185252
Buggy source:
private Class<?> load(String className){
  className=getFullClassName(className);
  try {
    Class<?> cls=getClassLoader().loadClass(className);
    return cls;
  }
 catch (  ClassNotFoundException e) {
    LOG.warn("String_Node_Str",className);
  }
  return null;
}

Fixed version (ground truth):
private Class<?> load(String className){
  className=getFullClassName(className);
  try {
    return getClassLoader().loadClass(className);
  }
 catch (  ClassNotFoundException e) {
    LOG.warn("String_Node_Str",className);
  }
  return null;
}
Program: 185253
Project: 185253
Buggy source:
@Nullable @Override public ClientWrapper apply(@Nullable AsyncLoadTest client){
  return new ClientWrapper(client,config.operationsPerConnection);
}

Fixed version (ground truth):
@Nullable @Override public ClientWrapper apply(@Nullable AsyncLoadTest client){
  return new ClientWrapper(clientManager,client,config.operationsPerConnection);
}
Program: 185254
Project: 185254
Buggy source:
protected void fillRequestPipeline(final ClientWrapper clientWrapper){
  if (clientWrapper.shouldStopSending()) {
    return;
  }
  try {
    while (!shutdownRequested) {
      if (channel.hasError()) {
        throw channel.getError();
      }
      long pendingCount=sendRequest(clientWrapper);
      clientWrapper.recordRequestSent();
      if (clientWrapper.shouldStopSending()) {
        reconnect();
        break;
      }
      if (pendingCount >= pendingOperationsHighWaterMark) {
        break;
      }
    }
  }
 catch (  TException ex) {
    logger.error("String_Node_Str",Throwables.getRootCause(ex).getMessage());
    clientWrapper.close();
  }
}

Fixed version (ground truth):
protected void fillRequestPipeline(final ClientWrapper clientWrapper){
  if (clientWrapper.shouldStopSending()) {
    return;
  }
  try {
    while (!shutdownRequested) {
      if (clientWrapper.hasError()) {
        throw clientWrapper.getError();
      }
      long pendingCount=sendRequest(clientWrapper);
      clientWrapper.recordRequestSent();
      if (clientWrapper.shouldStopSending()) {
        reconnect();
        break;
      }
      if (pendingCount >= pendingOperationsHighWaterMark) {
        break;
      }
    }
  }
 catch (  TException ex) {
    logger.error("String_Node_Str",Throwables.getRootCause(ex).getMessage());
    clientWrapper.close();
  }
}
Program: 185255
Project: 185255
Buggy source:
public ClientWrapper(AsyncLoadTest client,long requestLimit){
  this.client=client;
  this.requestLimit=requestLimit;
  this.clientId=clientCounter.getAndIncrement();
}

Fixed version (ground truth):
public ClientWrapper(ThriftClientManager clientManager,AsyncLoadTest client,long requestLimit){
  this.clientManager=clientManager;
  this.client=client;
  this.requestLimit=requestLimit;
  this.clientId=clientCounter.getAndIncrement();
}
Program: 185256
Project: 185256
Buggy source:
@Override public void onFailure(Throwable t){
  if (t instanceof LoadError) {
    onSuccess(null);
    return;
  }
  clientWrapper.recordResponseReceived();
  if (clientWrapper.isFinishedReceivingResponses()) {
    clientWrapper.close();
  }
  if (t instanceof TException) {
    clientWrapper.close();
    logger.error("String_Node_Str",Throwables.getRootCause(t).getMessage());
  }
  requestsFailed.incrementAndGet();
  if (requestsPending.decrementAndGet() < pendingOperationsLowWaterMark) {
    fillRequestPipeline(clientWrapper);
  }
}

Fixed version (ground truth):
@Override public void onFailure(Throwable t){
  if (t instanceof LoadError) {
    onSuccess(null);
    return;
  }
  clientWrapper.recordResponseReceived();
  if (clientWrapper.isFinishedReceivingResponses()) {
    clientWrapper.close();
  }
  if (t instanceof TException) {
    clientWrapper.close();
    logger.error("String_Node_Str",Throwables.getRootCause(t).getMessage());
  }
  requestsFailed.incrementAndGet();
  if (requestsPending.decrementAndGet() < pendingOperationsLowWaterMark) {
    fillCurrentClientPipeline();
  }
}
Program: 185257
Project: 185257
Buggy source:
protected void fillRequestPipeline(final ClientWrapper clientWrapper){
  try {
    while (!shutdownRequested) {
      if (channel.hasError()) {
        throw channel.getError();
      }
      long pendingCount=sendRequest(clientWrapper);
      clientWrapper.recordRequestReceived();
      if (clientWrapper.shouldStopSending()) {
        reconnect();
        break;
      }
      if (pendingCount >= pendingOperationsHighWaterMark) {
        break;
      }
    }
  }
 catch (  TException ex) {
    logger.error("String_Node_Str",Throwables.getRootCause(ex).getMessage());
    clientWrapper.close();
  }
}

Fixed version (ground truth):
protected void fillRequestPipeline(final ClientWrapper clientWrapper){
  if (clientWrapper.shouldStopSending()) {
    return;
  }
  try {
    while (!shutdownRequested) {
      if (channel.hasError()) {
        throw channel.getError();
      }
      long pendingCount=sendRequest(clientWrapper);
      clientWrapper.recordRequestReceived();
      if (clientWrapper.shouldStopSending()) {
        reconnect();
        break;
      }
      if (pendingCount >= pendingOperationsHighWaterMark) {
        break;
      }
    }
  }
 catch (  TException ex) {
    logger.error("String_Node_Str",Throwables.getRootCause(ex).getMessage());
    clientWrapper.close();
  }
}
Program: 185258
Project: 185258
Buggy source:
@Override public void onSuccess(@Nullable Object result){
  clientWrapper.recordResponseReceived();
  if (clientWrapper.isFinishedReceivingResponses()) {
    clientWrapper.close();
  }
  requestsProcessed.incrementAndGet();
  if (requestsPending.decrementAndGet() < pendingOperationsLowWaterMark) {
    fillRequestPipeline(clientWrapper);
  }
}

Fixed version (ground truth):
@Override public void onSuccess(@Nullable Object result){
  clientWrapper.recordResponseReceived();
  if (clientWrapper.isFinishedReceivingResponses()) {
    clientWrapper.close();
  }
  requestsProcessed.incrementAndGet();
  if (requestsPending.decrementAndGet() < pendingOperationsLowWaterMark) {
    fillCurrentClientPipeline();
  }
}
Program: 185259
Project: 185259
Buggy source:
@Config("String_Node_Str") public void setReadTimeout(Duration readTimeout){
  this.readTimeout=readTimeout;
}

Fixed version (ground truth):
@Config("String_Node_Str") public ThriftClientConfig setReadTimeout(Duration readTimeout){
  this.readTimeout=readTimeout;
  return this;
}
Program: 185260
Project: 185260
Buggy source:
@Config("String_Node_Str") public void setConnectTimeout(Duration connectTimeout){
  this.connectTimeout=connectTimeout;
}

Fixed version (ground truth):
@Config("String_Node_Str") public ThriftClientConfig setConnectTimeout(Duration connectTimeout){
  this.connectTimeout=connectTimeout;
  return this;
}
Program: 185261
Project: 185261
Buggy source:
public Class<?> getClientType(){
  return clientType;
}

Fixed version (ground truth):
public String getClientType(){
  return clientType;
}
Program: 185262
Project: 185262
Buggy source:
private ThriftClientMetadata(Class<?> clientType,String clientName,ThriftCodecManager codecManager){
  Preconditions.checkNotNull(clientType,"String_Node_Str");
  Preconditions.checkNotNull(clientName,"String_Node_Str");
  Preconditions.checkNotNull(codecManager,"String_Node_Str");
  this.clientType=clientType;
  this.clientName=clientName;
  thriftServiceMetadata=new ThriftServiceMetadata(clientType,codecManager.getCatalog());
  ImmutableMap.Builder<Method,ThriftMethodHandler> methods=ImmutableMap.builder();
  for (  ThriftMethodMetadata methodMetadata : thriftServiceMetadata.getMethods().values()) {
    ThriftMethodHandler methodHandler=new ThriftMethodHandler(methodMetadata,codecManager);
    methods.put(methodMetadata.getMethod(),methodHandler);
  }
  methodHandlers=methods.build();
}

Fixed version (ground truth):
private ThriftClientMetadata(Class<?> clientType,String clientName,ThriftCodecManager codecManager){
  Preconditions.checkNotNull(clientType,"String_Node_Str");
  Preconditions.checkNotNull(clientName,"String_Node_Str");
  Preconditions.checkNotNull(codecManager,"String_Node_Str");
  this.clientName=clientName;
  thriftServiceMetadata=new ThriftServiceMetadata(clientType,codecManager.getCatalog());
  this.clientType=thriftServiceMetadata.getName();
  ImmutableMap.Builder<Method,ThriftMethodHandler> methods=ImmutableMap.builder();
  for (  ThriftMethodMetadata methodMetadata : thriftServiceMetadata.getMethods().values()) {
    ThriftMethodHandler methodHandler=new ThriftMethodHandler(methodMetadata,codecManager);
    methods.put(methodMetadata.getMethod(),methodHandler);
  }
  methodHandlers=methods.build();
}
Program: 185263
Project: 185263
Buggy source:
public <T>void bindThriftClient(Class<T> clientInterface,Class<? extends Annotation> annotationType){
  Preconditions.checkNotNull(clientInterface,"String_Node_Str");
  TypeLiteral<ThriftClient<T>> typeLiteral=toThriftClientTypeLiteral(clientInterface);
  String name=annotationType.getSimpleName();
  ThriftClientProviderProvider<T> provider=new ThriftClientProviderProvider<>(clientInterface,name,Key.get(ThriftClientConfig.class,annotationType));
  binder.bind(Key.get(typeLiteral,annotationType)).toProvider(provider);
  ExportBinder.newExporter(binder).export(Key.get(typeLiteral)).as(format("String_Node_Str",clientInterface.getSimpleName(),name));
  Multibinder.newSetBinder(binder,ThriftClientProviderProvider.class).addBinding().toInstance(provider);
  String prefix=String.format("String_Node_Str",clientInterface.getName(),name);
  bindConfig(binder).annotatedWith(annotationType).prefixedWith(prefix).to(ThriftClientConfig.class);
}

Fixed version (ground truth):
public <T>void bindThriftClient(Class<T> clientInterface,Class<? extends Annotation> annotationType){
  Preconditions.checkNotNull(clientInterface,"String_Node_Str");
  TypeLiteral<ThriftClient<T>> typeLiteral=toThriftClientTypeLiteral(clientInterface);
  String name=annotationType.getSimpleName();
  Named thriftClientConfigKey=Names.named(UUID.randomUUID().toString());
  ThriftClientProviderProvider<T> provider=new ThriftClientProviderProvider<>(clientInterface,name,Key.get(ThriftClientConfig.class,thriftClientConfigKey));
  binder.bind(Key.get(typeLiteral,annotationType)).toProvider(provider).in(Scopes.SINGLETON);
  String typeName=getServiceName(clientInterface);
  ExportBinder.newExporter(binder).export(Key.get(typeLiteral)).as(format("String_Node_Str",typeName,name));
  Multibinder.newSetBinder(binder,ThriftClientProviderProvider.class).addBinding().toInstance(provider);
  String prefix=String.format("String_Node_Str",typeName,name);
  bindConfig(binder).annotatedWith(thriftClientConfigKey).prefixedWith(prefix).to(ThriftClientConfig.class);
}
Program: 185264
Project: 185264
Buggy source:
@Provides @Singleton public Map<ObjectName,ThriftMethodHandler> getMethodProcessors(Set<ThriftClientProviderProvider> clientProviders){
  try {
    ImmutableMap.Builder<ObjectName,ThriftMethodHandler> builder=ImmutableMap.builder();
    for (    ThriftClientProviderProvider<?> clientProvider : clientProviders) {
      ThriftClientMetadata clientMetadata=clientProvider.getClientMetadata();
      for (      ThriftMethodHandler methodHandler : clientMetadata.getMethodHandlers().values()) {
        Class<?> clientType=clientMetadata.getClientType();
        String name=format("String_Node_Str",clientType.getSimpleName(),clientMetadata.getClientName(),methodHandler.getName());
        builder.put(ObjectName.getInstance(name),methodHandler);
      }
    }
    return builder.build();
  }
 catch (  MalformedObjectNameException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Provides @Singleton public Map<ObjectName,ThriftMethodHandler> getMethodProcessors(Set<ThriftClientProviderProvider> clientProviders){
  try {
    ImmutableMap.Builder<ObjectName,ThriftMethodHandler> builder=ImmutableMap.builder();
    for (    ThriftClientProviderProvider<?> clientProvider : clientProviders) {
      ThriftClientMetadata clientMetadata=clientProvider.getClientMetadata();
      for (      ThriftMethodHandler methodHandler : clientMetadata.getMethodHandlers().values()) {
        String name=format("String_Node_Str",clientMetadata.getClientType(),clientMetadata.getClientName(),methodHandler.getName());
        builder.put(ObjectName.getInstance(name),methodHandler);
      }
    }
    return builder.build();
  }
 catch (  MalformedObjectNameException e) {
    throw Throwables.propagate(e);
  }
}
Program: 185265
Project: 185265
Buggy source:
@Override public ObjectName name(ThriftMethodProcessor methodProcessor){
  try {
    Class<?> serviceClass=methodProcessor.getServiceClass();
    String name=format("String_Node_Str",serviceClass.getSimpleName(),methodProcessor.getName());
    return new ObjectName(name);
  }
 catch (  MalformedObjectNameException e) {
    throw Throwables.propagate(e);
  }
}

Fixed version (ground truth):
@Override public ObjectName name(ThriftMethodProcessor methodProcessor){
  try {
    Class<?> serviceClass=methodProcessor.getServiceClass();
    String name=format("String_Node_Str",getServiceName(serviceClass),methodProcessor.getName());
    return new ObjectName(name);
  }
 catch (  MalformedObjectNameException e) {
    throw Throwables.propagate(e);
  }
}
Program: 185266
Project: 185266
Buggy source:
@Override public void configure(Binder binder){
  newSetBinder(binder,ThriftServiceExport.class).permitDuplicates();
  binder.bind(ThriftServiceProcessor.class).toProvider(ThriftServiceProcessorProvider.class).in(Scopes.SINGLETON);
  binder.bind(TProcessor.class).to(Key.get(ThriftServiceProcessor.class)).in(Scopes.SINGLETON);
  bindConfig(binder).to(ThriftServerConfig.class);
  binder.bind(ThriftServer.class).in(Scopes.SINGLETON);
  ExportBinder.newExporter(binder).exportMap(ThriftMethodProcessor.class).withGeneratedName(new ObjectNameFunction<ThriftMethodProcessor>(){
    @Override public ObjectName name(    ThriftMethodProcessor methodProcessor){
      try {
        Class<?> serviceClass=methodProcessor.getServiceClass();
        String name=format("String_Node_Str",serviceClass.getSimpleName(),methodProcessor.getName());
        return new ObjectName(name);
      }
 catch (      MalformedObjectNameException e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override public void configure(Binder binder){
  newSetBinder(binder,ThriftServiceExport.class).permitDuplicates();
  binder.bind(ThriftServiceProcessor.class).toProvider(ThriftServiceProcessorProvider.class).in(Scopes.SINGLETON);
  binder.bind(TProcessor.class).to(Key.get(ThriftServiceProcessor.class)).in(Scopes.SINGLETON);
  bindConfig(binder).to(ThriftServerConfig.class);
  binder.bind(ThriftServer.class).in(Scopes.SINGLETON);
  ExportBinder.newExporter(binder).exportMap(ThriftMethodProcessor.class).withGeneratedName(new ObjectNameFunction<ThriftMethodProcessor>(){
    @Override public ObjectName name(    ThriftMethodProcessor methodProcessor){
      try {
        Class<?> serviceClass=methodProcessor.getServiceClass();
        String name=format("String_Node_Str",getServiceName(serviceClass),methodProcessor.getName());
        return new ObjectName(name);
      }
 catch (      MalformedObjectNameException e) {
        throw Throwables.propagate(e);
      }
    }
  }
);
}
Program: 185267
Project: 185267
Buggy source:
private void writeArguments(TProtocol out,int sequenceId,Object[] args) throws Exception {
  long start=System.nanoTime();
  out.writeMessageBegin(new TMessage(name,CALL,sequenceId));
  TProtocolWriter writer=new TProtocolWriter(out);
  writer.writeStructBegin(name + "String_Node_Str");
  for (int i=0; i < args.length; i++) {
    Object value=args[i];
    ParameterHandler parameter=parameterCodecs.get(i);
    writer.writeField(parameter.getName(),parameter.getId(),parameter.getCodec(),value);
  }
  writer.writeStructEnd();
  out.writeMessageEnd();
  out.getTransport().flush();
  stats.addWriteTime(nanosSince(start));
}

Fixed version (ground truth):
private void writeArguments(TProtocol out,int sequenceId,Object[] args) throws Exception {
  long start=System.nanoTime();
  out.writeMessageBegin(new TMessage(name,oneway ? ONEWAY : CALL,sequenceId));
  TProtocolWriter writer=new TProtocolWriter(out);
  writer.writeStructBegin(name + "String_Node_Str");
  for (int i=0; i < args.length; i++) {
    Object value=args[i];
    ParameterHandler parameter=parameterCodecs.get(i);
    writer.writeField(parameter.getName(),parameter.getId(),parameter.getCodec(),value);
  }
  writer.writeStructEnd();
  out.writeMessageEnd();
  out.getTransport().flush();
  stats.addWriteTime(nanosSince(start));
}
Program: 185268
Project: 185268
Buggy source:
public void process(TProtocol in,TProtocol out,int sequenceId) throws Exception {
  long start=System.nanoTime();
  Object[] args=readArguments(in);
  Object result;
  try {
    result=invokeMethod(args);
    writeResponse(out,sequenceId,TMessageType.REPLY,"String_Node_Str",(short)0,successCodec,result);
    stats.addSuccessTime(nanosSince(start));
  }
 catch (  Exception e) {
    if (!oneway) {
      ExceptionProcessor exceptionCodec=exceptionCodecs.get(e.getClass());
      if (exceptionCodec != null) {
        writeResponse(out,sequenceId,TMessageType.REPLY,"String_Node_Str",exceptionCodec.getId(),exceptionCodec.getCodec(),e);
        stats.addErrorTime(nanosSince(start));
      }
 else {
        TApplicationException applicationException=new TApplicationException(INTERNAL_ERROR,"String_Node_Str" + method.getName());
        applicationException.initCause(e);
        out.writeMessageBegin(new TMessage(name,TMessageType.EXCEPTION,sequenceId));
        applicationException.write(out);
        out.writeMessageEnd();
        out.getTransport().flush();
        stats.addErrorTime(nanosSince(start));
      }
    }
  }
}

Fixed version (ground truth):
public void process(TProtocol in,TProtocol out,int sequenceId) throws Exception {
  long start=System.nanoTime();
  Object[] args=readArguments(in);
  Object result;
  try {
    result=invokeMethod(args);
    if (!oneway) {
      writeResponse(out,sequenceId,TMessageType.REPLY,"String_Node_Str",(short)0,successCodec,result);
    }
    stats.addSuccessTime(nanosSince(start));
  }
 catch (  Exception e) {
    if (!oneway) {
      ExceptionProcessor exceptionCodec=exceptionCodecs.get(e.getClass());
      if (exceptionCodec != null) {
        writeResponse(out,sequenceId,TMessageType.REPLY,"String_Node_Str",exceptionCodec.getId(),exceptionCodec.getCodec(),e);
        stats.addErrorTime(nanosSince(start));
      }
 else {
        TApplicationException applicationException=new TApplicationException(INTERNAL_ERROR,"String_Node_Str" + method.getName());
        applicationException.initCause(e);
        out.writeMessageBegin(new TMessage(name,TMessageType.EXCEPTION,sequenceId));
        applicationException.write(out);
        out.writeMessageEnd();
        out.getTransport().flush();
        stats.addErrorTime(nanosSince(start));
      }
    }
 else {
      stats.addErrorTime(nanosSince(start));
    }
  }
}
Program: 185269
Project: 185269
Buggy source:
static <T extends FieldMetadata>Function<T,Short> getThriftFieldId(){
  return new Function<T,Short>(){
    @Override public Short apply(    @Nullable T input){
      if (input == null) {
        return null;
      }
      return input.getId();
    }
  }
;
}

Fixed version (ground truth):
static <T extends FieldMetadata>Function<T,Optional<Short>> getThriftFieldId(){
  return new Function<T,Optional<Short>>(){
    @Override public Optional<Short> apply(    @Nullable T input){
      if (input == null) {
        return Optional.absent();
      }
      Short value=input.getId();
      return Optional.fromNullable(value);
    }
  }
;
}
Program: 185272
Project: 185272
Buggy source:
/** 
 * Creates a new   {@link JaxRsLinkBuilder} instance to link to the {@link Path} mapping tied to the given class bindingthe given parameters to the URI template.
 * @param service the class to discover the annotation on, must not be {@literal null}.
 * @param parameters additional parameters to bind to the URI template declared in the annotation, must not be{@literal null}.
 * @return
 */
public static JaxRsLinkBuilder linkTo(Class<?> service,Object... parameters){
  JaxRsLinkBuilder builder=new JaxRsLinkBuilder(ServletUriComponentsBuilder.fromCurrentServletMapping());
  UriTemplate template=new UriTemplate(DISCOVERER.getMapping(service));
  return builder.slash(template.expand(parameters));
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link JaxRsLinkBuilder} instance to link to the {@link Path} mapping tied to the given class bindingthe given parameters to the URI template.
 * @param service the class to discover the annotation on, must not be {@literal null}.
 * @param parameters additional parameters to bind to the URI template declared in the annotation, must not be{@literal null}.
 * @return
 */
public static JaxRsLinkBuilder linkTo(Class<?> service,Object... parameters){
  JaxRsLinkBuilder builder=new JaxRsLinkBuilder(ServletUriComponentsBuilder.fromCurrentServletMapping());
  UriComponents uriComponents=UriComponentsBuilder.fromUriString(DISCOVERER.getMapping(service)).build();
  UriComponents expandedComponents=uriComponents.expand(parameters);
  return builder.slash(expandedComponents);
}
Program: 185273
Project: 185273
Buggy source:
/** 
 * @see #62
 */
@Test public void jackson2Marshalling() throws Exception {
  assertThat(jackson2Mapper.writeValueAsString(errors),is(json2Reference));
}

Fixed version (ground truth):
/** 
 * @see #62
 */
@Test public void jackson2Marshalling() throws Exception {
  assertThat(jackson2Mapper.writeValueAsString(errors),equalToIgnoringWhiteSpace(json2Reference));
}
Program: 185274
Project: 185274
Buggy source:
@Test public void appendsFragmentCorrectly(){
  SampleLinkBuilder builder=new SampleLinkBuilder(UriComponentsBuilder.newInstance());
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void appendsFragmentCorrectly(){
  SampleLinkBuilder builder=new SampleLinkBuilder(UriComponentsBuilder.newInstance());
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
  builder=builder.slash("String_Node_Str");
  assertThat(builder.toString(),endsWith("String_Node_Str"));
}
Program: 185275
Project: 185275
Buggy source:
@Before public void setUp() throws Exception {
  jackson1Mapper=new ObjectMapper();
  jackson1Mapper.registerModule(new Jackson1HalModule());
  jackson1Mapper.configure(Feature.INDENT_OUTPUT,true);
  jackson2Mapper=new com.fasterxml.jackson.databind.ObjectMapper();
  jackson2Mapper.registerModule(new Jackson2HalModule());
  jackson2Mapper.configure(SerializationFeature.INDENT_OUTPUT,true);
  JAXBContext context=JAXBContext.newInstance(VndErrors.class);
  marshaller=context.createMarshaller();
  VndError error=new VndError("String_Node_Str","String_Node_Str",new Link("String_Node_Str","String_Node_Str"),new Link("String_Node_Str","String_Node_Str"));
  errors=new VndErrors(error,error,error);
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  jackson1Mapper=new ObjectMapper();
  jackson1Mapper.registerModule(new Jackson1HalModule());
  jackson1Mapper.configure(Feature.INDENT_OUTPUT,true);
  jackson2Mapper=new com.fasterxml.jackson.databind.ObjectMapper();
  jackson2Mapper.registerModule(new Jackson2HalModule());
  jackson2Mapper.configure(SerializationFeature.INDENT_OUTPUT,true);
  JAXBContext context=JAXBContext.newInstance(VndErrors.class);
  marshaller=context.createMarshaller();
  unmarshaller=context.createUnmarshaller();
  VndError error=new VndError("String_Node_Str","String_Node_Str",new Link("String_Node_Str","String_Node_Str"),new Link("String_Node_Str","String_Node_Str"));
  errors=new VndErrors(error,error,error);
}
Program: 185277
Project: 185277
Buggy source:
private ConstantExpression getConstantExpression(Expression exp,ClassNode attrType){
  if (exp instanceof ConstantExpression) {
    return (ConstantExpression)exp;
  }
  String base="String_Node_Str" + exp.getText() + "String_Node_Str"+ attrType.getName();
  if (exp instanceof PropertyExpression) {
    addError(base + "String_Node_Str",exp);
  }
 else   if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
    addError(base + "String_Node_Str",exp);
  }
 else {
    addError(base,exp);
  }
  return ConstantExpression.EMPTY_EXPRESSION;
}

Fixed version (ground truth):
private ConstantExpression getConstantExpression(Expression exp,ClassNode attrType){
  if (exp instanceof ConstantExpression) {
    return (ConstantExpression)exp;
  }
  String base="String_Node_Str" + exp.getText() + "String_Node_Str"+ attrType.getName();
  if (exp instanceof PropertyExpression) {
    addError(base + "String_Node_Str",exp);
  }
 else   if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
    addError(base + "String_Node_Str",exp);
  }
 else {
    addError(base,exp);
  }
  ConstantExpression ret=new ConstantExpression(null);
  ret.setSourcePosition(exp);
  return ret;
}
Program: 185278
Project: 185278
Buggy source:
private ConstantExpression getConstantExpression(Expression exp,ClassNode attrType){
  if (exp instanceof ConstantExpression) {
    return (ConstantExpression)exp;
  }
  String base="String_Node_Str" + exp.getText() + "String_Node_Str"+ attrType.getName();
  if (exp instanceof PropertyExpression) {
    addError(base + "String_Node_Str",exp);
  }
 else   if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
    addError(base + "String_Node_Str",exp);
  }
 else {
    addError(base,exp);
  }
  return ConstantExpression.EMPTY_EXPRESSION;
}

Fixed version (ground truth):
private ConstantExpression getConstantExpression(Expression exp,ClassNode attrType){
  if (exp instanceof ConstantExpression) {
    return (ConstantExpression)exp;
  }
  String base="String_Node_Str" + exp.getText() + "String_Node_Str"+ attrType.getName();
  if (exp instanceof PropertyExpression) {
    addError(base + "String_Node_Str",exp);
  }
 else   if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
    addError(base + "String_Node_Str",exp);
  }
 else {
    addError(base,exp);
  }
  ConstantExpression ret=new ConstantExpression(null);
  ret.setSourcePosition(exp);
  return ret;
}
Program: 185279
Project: 185279
Buggy source:
private ConstantExpression getConstantExpression(Expression exp,ClassNode attrType){
  if (exp instanceof ConstantExpression) {
    return (ConstantExpression)exp;
  }
  String base="String_Node_Str" + exp.getText() + "String_Node_Str"+ attrType.getName();
  if (exp instanceof PropertyExpression) {
    addError(base + "String_Node_Str",exp);
  }
 else   if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
    addError(base + "String_Node_Str",exp);
  }
 else {
    addError(base,exp);
  }
  return ConstantExpression.EMPTY_EXPRESSION;
}

Fixed version (ground truth):
private ConstantExpression getConstantExpression(Expression exp,ClassNode attrType){
  if (exp instanceof ConstantExpression) {
    return (ConstantExpression)exp;
  }
  String base="String_Node_Str" + exp.getText() + "String_Node_Str"+ attrType.getName();
  if (exp instanceof PropertyExpression) {
    addError(base + "String_Node_Str",exp);
  }
 else   if (exp instanceof VariableExpression && ((VariableExpression)exp).getAccessedVariable() instanceof FieldNode) {
    addError(base + "String_Node_Str",exp);
  }
 else {
    addError(base,exp);
  }
  ConstantExpression ret=new ConstantExpression(null);
  ret.setSourcePosition(exp);
  return ret;
}
Program: 185280
Project: 185280
Buggy source:
public void reset(){
  compilationUnit=null;
}

Fixed version (ground truth):
public void reset(){
  compilationUnit=null;
  resolver=null;
}
Program: 185281
Project: 185281
Buggy source:
private void assertAccessRestriction(String source,String... types){
  IPath foo=env.addGroovyClass(src,"String_Node_Str",source);
  fullBuild();
  source=env.readTextFile(foo);
  List<String> problems=new ArrayList<>();
  for (  String type : types) {
    int offset=-1;
    while ((offset=source.indexOf(type.trim(),offset + 1)) != -1) {
      problems.add(String.format(problemFormat,type.trim(),offset,offset + type.length()));
    }
  }
  expectingProblemsFor(foo,problems);
}

Fixed version (ground truth):
private void assertAccessRestriction(String source,String... types){
  IPath foo=env.addGroovyClass(src,"String_Node_Str",source);
  fullBuild();
  source=env.readTextFile(foo);
  List<String> problems=new ArrayList<>();
  for (  String type : types) {
    int offset=-1;
    while ((offset=source.indexOf(type.trim(),offset + 1)) != -1) {
      problems.add(String.format(problemFormat,last(type.split("String_Node_Str")).trim(),offset,offset + type.length()));
    }
  }
  expectingProblemsFor(foo,problems);
}
Program: 185282
Project: 185282
Buggy source:
@Test public void testSearchForTypesClass7() throws Exception {
  createUnit("String_Node_Str","String_Node_Str","String_Node_Str");
  doTestForTwoInClass("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSearchForTypesClass7() throws Exception {
  createUnit("String_Node_Str","String_Node_Str","String_Node_Str");
  doTestForTwoInClass("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
}
Program: 185283
Project: 185283
Buggy source:
@Test public void testConstructorWithDefaultArgsInCompileStatic() throws Exception {
  String firstContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  String secondContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  List<SearchMatch> matches=getAllMatches(firstContents,secondContents,"String_Node_Str","String_Node_Str",true);
  int lastMatch=0;
  for (  SearchMatch searchMatch : matches) {
    int start=secondContents.indexOf("String_Node_Str",lastMatch);
    assertEquals("String_Node_Str" + searchMatch,start,searchMatch.getOffset());
    assertEquals("String_Node_Str" + searchMatch,"String_Node_Str".length(),searchMatch.getLength());
    lastMatch=start + 1;
  }
  assertEquals("String_Node_Str" + matches,3,matches.size());
}

Fixed version (ground truth):
@Test public void testConstructorWithDefaultArgsInCompileStatic() throws Exception {
  String firstContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str";
  String secondContents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  List<SearchMatch> matches=getAllMatches(firstContents,secondContents,"String_Node_Str","String_Node_Str",true);
  int lastMatch=0;
  for (  SearchMatch searchMatch : matches) {
    int start=secondContents.indexOf("String_Node_Str",lastMatch);
    assertEquals("String_Node_Str" + searchMatch,start,searchMatch.getOffset());
    assertEquals("String_Node_Str" + searchMatch,"String_Node_Str".length(),searchMatch.getLength());
    lastMatch=start + 1;
  }
  assertEquals("String_Node_Str" + matches,2,matches.size());
}
Program: 185285
Project: 185285
Buggy source:
@Override protected ImportBinding[] getDefaultImports(){
  if (defaultGroovyImports != null)   return defaultGroovyImports;
  List<ImportBinding> importBindings=new ArrayList<>();
  Collections.addAll(importBindings,super.getDefaultImports());
  importBindings.add(new ImportBinding(javaIo,true,environment.createPackage(javaIo),null));
  importBindings.add(new ImportBinding(javaNet,true,environment.createPackage(javaNet),null));
  importBindings.add(new ImportBinding(javaUtil,true,environment.createPackage(javaUtil),null));
  importBindings.add(new ImportBinding(groovyLang,true,environment.createPackage(groovyLang),null));
  importBindings.add(new ImportBinding(groovyUtil,true,environment.createPackage(groovyUtil),null));
  importBindings.add(new ImportBinding(javaMathBigDecimal,false,createTypeRef(javaMathBigDecimal),null));
  importBindings.add(new ImportBinding(javaMathBigInteger,false,createTypeRef(javaMathBigInteger),null));
  return defaultGroovyImports=importBindings.toArray(new ImportBinding[importBindings.size()]);
}

Fixed version (ground truth):
@Override protected ImportBinding[] getDefaultImports(){
  if (defaultGroovyImports == null) {
    List<ImportBinding> importBindings=new ArrayList<>(8);
    Collections.addAll(importBindings,super.getDefaultImports());
    importBindings.add(new ImportBinding(javaIo,true,environment.getPackage(javaIo,module()),null));
    importBindings.add(new ImportBinding(javaNet,true,environment.getPackage(javaNet,module()),null));
    importBindings.add(new ImportBinding(javaUtil,true,environment.getPackage(javaUtil,module()),null));
    importBindings.add(new ImportBinding(groovyLang,true,environment.getPackage(groovyLang,module()),null));
    importBindings.add(new ImportBinding(groovyUtil,true,environment.getPackage(groovyUtil,module()),null));
    importBindings.add(new ImportBinding(javaMathBigDecimal,false,environment.getType(javaMathBigDecimal),null));
    importBindings.add(new ImportBinding(javaMathBigInteger,false,environment.getType(javaMathBigInteger),null));
    defaultGroovyImports=importBindings.toArray(new ImportBinding[importBindings.size()]);
  }
  return defaultGroovyImports;
}
Program: 185286
Project: 185286
Buggy source:
private boolean isTrait(ReferenceBinding referenceBinding){
  if (referenceBinding == null) {
    return false;
  }
  if (toBeInitialized) {
    initialize();
  }
  AnnotationBinding[] annotations=referenceBinding.getAnnotations();
  if (annotations != null) {
    for (    AnnotationBinding annotation : annotations) {
      ReferenceBinding annotationType=annotation.getAnnotationType();
      String annotationName=CharOperation.toString(annotationType.compoundName);
      if ("String_Node_Str".equals(annotationName)) {
        return true;
      }
      if (lookForTraitAlias && "String_Node_Str".equals(annotationName)) {
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean isTrait(ReferenceBinding referenceBinding){
  if (referenceBinding != null) {
    if (toBeInitialized) {
      initialize();
    }
    AnnotationBinding[] annotations=referenceBinding.getAnnotations();
    if (annotations != null) {
      for (      AnnotationBinding annotation : annotations) {
        if (annotation != null) {
          ReferenceBinding annotationType=annotation.getAnnotationType();
          String annotationName=CharOperation.toString(annotationType.compoundName);
          if ("String_Node_Str".equals(annotationName)) {
            return true;
          }
          if (lookForTraitAlias && "String_Node_Str".equals(annotationName)) {
            return true;
          }
        }
      }
    }
  }
  return false;
}
Program: 185289
Project: 185289
Buggy source:
@Test public void testSpread12(){
  String contents="String_Node_Str" + "String_Node_Str";
  int start=contents.lastIndexOf("String_Node_Str");
  assertType(contents,start,start + "String_Node_Str".length(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSpread12(){
  String contents="String_Node_Str" + "String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185290
Project: 185290
Buggy source:
@Test public void testSpread13(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  int start=contents.lastIndexOf("String_Node_Str");
  assertType(contents,start,start + "String_Node_Str".length(),"String_Node_Str");
  start=contents.lastIndexOf("String_Node_Str");
  assertType(contents,start,start + "String_Node_Str".length(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSpread13(){
  String contents="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185291
Project: 185291
Buggy source:
@Test public void testSpread10(){
  String contents="String_Node_Str";
  int start=contents.lastIndexOf("String_Node_Str");
  assertType(contents,start,start + "String_Node_Str".length(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSpread10(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185292
Project: 185292
Buggy source:
@Test public void testSpread11(){
  String contents="String_Node_Str" + "String_Node_Str";
  int start=contents.lastIndexOf("String_Node_Str");
  assertType(contents,start,start + "String_Node_Str".length(),"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testSpread11(){
  String contents="String_Node_Str" + "String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185293
Project: 185293
Buggy source:
@Test public void testClassReference2(){
  String contents="String_Node_Str";
  int textStart=contents.indexOf("String_Node_Str");
  int textEnd=textStart + "String_Node_Str".length();
  assertType(contents,textStart,textEnd,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testClassReference2(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
  assertDeclType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185294
Project: 185294
Buggy source:
@Test public void testClassReference1(){
  String contents="String_Node_Str";
  int textStart=contents.indexOf("String_Node_Str");
  int textEnd=textStart + "String_Node_Str".length();
  assertDeclaringType(contents,textStart,textEnd,"String_Node_Str",false,true);
}

Fixed version (ground truth):
@Test public void testClassReference1(){
  String contents="String_Node_Str";
  int start=contents.indexOf("String_Node_Str"), until=start + 9;
  assertDeclaringType(contents,start,until,"String_Node_Str",false,true);
}
Program: 185295
Project: 185295
Buggy source:
@Test public void testClassReference4(){
  String contents="String_Node_Str";
  int textStart=contents.indexOf("String_Node_Str");
  int textEnd=textStart + "String_Node_Str".length();
  assertType(contents,textStart,textEnd,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testClassReference4(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
  assertDeclType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185296
Project: 185296
Buggy source:
@Test public void testClassReference3(){
  String contents="String_Node_Str";
  int textStart=contents.indexOf("String_Node_Str");
  int textEnd=textStart + "String_Node_Str".length();
  assertType(contents,textStart,textEnd,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testClassReference3(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
  assertDeclType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185297
Project: 185297
Buggy source:
@Test public void testPattern1(){
  String contents="String_Node_Str";
  int start=contents.lastIndexOf("String_Node_Str");
  int end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testPattern1(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185298
Project: 185298
Buggy source:
@Test public void testPattern2(){
  String contents="String_Node_Str";
  int start=contents.lastIndexOf("String_Node_Str");
  int end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testPattern2(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185299
Project: 185299
Buggy source:
@Test public void testBoolean4(){
  String contents="String_Node_Str";
  int start=contents.indexOf("String_Node_Str");
  int end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBoolean4(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185300
Project: 185300
Buggy source:
@Test public void testBoolean5(){
  String contents="String_Node_Str";
  int start=contents.indexOf("String_Node_Str");
  int end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBoolean5(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}
Program: 185301
Project: 185301
Buggy source:
@Test public void testBoolean2(){
  String contents="String_Node_Str";
  int start=contents.indexOf("String_Node_Str");
  int end=start + "String_Node_Str".length();
  assertType(contents,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void testBoolean2(){
  String contents="String_Node_Str";
  assertExprType(contents,"String_Node_Str","String_Node_Str");
}