nus-yam/ex-repair huggingface dataset:
Program: 2472
Project: 2472
Buggy source:
@Override public Instantiation<T> visitChildren(ModelVisitor nv) throws ScribbleException {
  T arg=visitChildWithClassCheck(this,this.arg,nv);
  return reconstruct(arg);
}

Fixed version (ground truth):
@Override public Instantiation<T> visitChildren(ModelVisitor nv) throws ScribbleException {
  @SuppressWarnings("String_Node_Str") T arg=(T)this.visitChild(this.arg,nv);
  return reconstruct(arg);
}
Program: 2473
Project: 2473
Buggy source:
AmbiguousNameNode AmbiguousNameNode(String identifier);

Fixed version (ground truth):
AmbigNameNode AmbiguousNameNode(String identifier);
Program: 2474
Project: 2474
Buggy source:
@Override public AmbiguousNameNode AmbiguousNameNode(String identifier){
  AmbiguousNameNode ann=new AmbiguousNameNode(identifier);
  ann=(AmbiguousNameNode)ann.del(new AmbiguousNameDelegate());
  return ann;
}

Fixed version (ground truth):
@Override public AmbigNameNode AmbiguousNameNode(String identifier){
  AmbigNameNode ann=new AmbigNameNode(identifier);
  ann=(AmbigNameNode)ann.del(new AmbigNameDel());
  return ann;
}
Program: 2475
Project: 2475
Buggy source:
protected final static <T extends ModelNode>T visitChildWithClassCheck(ModelNode parent,T child,ModelVisitor nv) throws ScribbleException {
  ModelNode visited=((ModelNodeBase)parent).visitChild(child,nv);
  if (visited.getClass() != child.getClass()) {
    throw new RuntimeException("String_Node_Str" + child.getClass() + "String_Node_Str"+ visited.getClass());
  }
  @SuppressWarnings("String_Node_Str") T t=(T)visited;
  return t;
}

Fixed version (ground truth):
protected final static <T extends ModelNode>T visitChildWithClassCheck(ModelNode parent,T child,ModelVisitor nv) throws ScribbleException {
  ModelNode visited=((ModelNodeBase)parent).visitChild(child,nv);
  if (visited.getClass() != child.getClass()) {
    throw new RuntimeException(nv.getClass() + "String_Node_Str" + child.getClass()+ "String_Node_Str"+ visited.getClass());
  }
  @SuppressWarnings("String_Node_Str") T t=(T)visited;
  return t;
}
Program: 2476
Project: 2476
Buggy source:
@Override public Name<K> toName(){
  if (this.kind.equals(SigKind.KIND)) {
    return Kind.castName(kind,new MessageSigName(this.identifier));
  }
 else   if (this.kind.equals(DataTypeKind.KIND)) {
    return Kind.castName(kind,new DataType(this.identifier));
  }
 else {
    throw new RuntimeException("String_Node_Str" + this.kind);
  }
}

Fixed version (ground truth):
@Override public Name<K> toName(){
  if (this.kind.equals(SigKind.KIND)) {
    return Kind.castName(this.kind,new MessageSigName(this.identifier));
  }
 else   if (this.kind.equals(DataTypeKind.KIND)) {
    return Kind.castName(this.kind,new DataType(this.identifier));
  }
 else {
    throw new RuntimeException("String_Node_Str" + this.kind);
  }
}
Program: 2477
Project: 2477
Buggy source:
@Override public Argument<? extends Kind> toArgument(){
  throw new RuntimeException("String_Node_Str" + this);
}

Fixed version (ground truth):
@Override public Argument<? extends Kind> toArgument(){
  if (this.kind.equals(DataTypeKind.KIND)) {
    throw new RuntimeException("String_Node_Str" + this);
  }
 else   if (this.kind.equals(SigKind.KIND)) {
    return toMessage();
  }
  throw new RuntimeException("String_Node_Str" + this);
}
Program: 2478
Project: 2478
Buggy source:
private void pushNameMaps(ProtocolName fullname,List<Role> roleargs,List<Argument<? extends Kind>> argargs){
  ProtocolDecl<? extends ProtocolKind> pd=getJobContext().getModule(fullname.getPrefix()).getProtocolDecl(fullname.getSimpleName());
  List<Role> roleparams=pd.header.roledecls.getRoles();
  List<Name<Kind>> argparams=pd.header.paramdecls.getParameters();
  Map<Role,RoleNode> rolemap=rolemaps.peek();
  Map<Argument<? extends Kind>,ArgumentNode> argmap=argmaps.peek();
  Iterator<Role> roleargiter=roleargs.iterator();
  Iterator<Argument<? extends Kind>> argargiter=argargs.iterator();
  Map<Role,RoleNode> newrolemap=roleparams.stream().collect(Collectors.toMap((r) -> r,(r) -> this.rolemaps.get(0).get(roleargiter.next())));
  Map<Argument<? extends Kind>,ArgumentNode> newargmap=argparams.stream().collect(Collectors.toMap((a) -> (Argument<? extends Kind>)a,(a) -> this.argmaps.get(0).get(argargiter.next())));
  this.rolemaps.push(newrolemap);
  this.argmaps.push(newargmap);
}

Fixed version (ground truth):
private void pushNameMaps(ProtocolName fullname,Do doo,List<Role> roleargs,List<Argument<? extends Kind>> argargs){
  ProtocolDecl<? extends ProtocolKind> pd=getJobContext().getModule(fullname.getPrefix()).getProtocolDecl(fullname.getSimpleName());
  List<Role> roleparams=pd.header.roledecls.getRoles();
  List<Name<Kind>> argparams=pd.header.paramdecls.getParameters();
  Map<Role,RoleNode> rolemap=rolemaps.peek();
  Map<Argument<? extends Kind>,ArgumentNode> argmap=argmaps.peek();
  Iterator<Role> roleargiter=roleargs.iterator();
  Iterator<Argument<? extends Kind>> argargiter=argargs.iterator();
  Map<Role,RoleNode> newrolemap=roleparams.stream().collect(Collectors.toMap((r) -> r,(r) -> this.rolemaps.get(0).get(roleargiter.next())));
  Map<Argument<? extends Kind>,ArgumentNode> newargmap=new HashMap<>();
  Iterator<ArgumentNode> foo=doo.arginstans.getArgumentNodes().iterator();
  for (  Name<Kind> p : argparams) {
    Argument<? extends Kind> tmp=argargiter.next();
    ArgumentNode a;
    if (this.argmaps.get(0).containsKey(tmp)) {
      a=this.argmaps.get(0).get(tmp);
      foo.next();
    }
 else {
      a=foo.next();
    }
    newargmap.put((Argument<? extends Kind>)p,a);
  }
  this.rolemaps.push(newrolemap);
  this.argmaps.push(newargmap);
}
Program: 2479
Project: 2479
Buggy source:
private void enterSubprotocol(Do doo){
  ModuleContext mcontext=getModuleContext();
  ProtocolName fullname=mcontext.getFullProtocolDeclName(doo.proto.toName());
  List<Role> roleargs=doo.roleinstans.getRoles();
  List<Argument<? extends Kind>> argargs=doo.arginstans.getArguments(getScope());
  pushSubprotocolSignature(fullname,roleargs,argargs);
  pushNameMaps(fullname,roleargs,argargs);
}

Fixed version (ground truth):
private void enterSubprotocol(Do doo){
  ModuleContext mcontext=getModuleContext();
  ProtocolName fullname=mcontext.getFullProtocolDeclName(doo.proto.toName());
  List<Role> roleargs=doo.roleinstans.getRoles();
  List<Argument<? extends Kind>> argargs=doo.arginstans.getArguments(getScope());
  pushSubprotocolSignature(fullname,roleargs,argargs);
  pushNameMaps(fullname,doo,roleargs,argargs);
}
Program: 2481
Project: 2481
Buggy source:
public static ArgumentInstantiationList parseArgumentInstantiationList(ScribbleParser parser,CommonTree ct){
  List<ArgumentInstantiation> as=new LinkedList<>();
  for (  CommonTree a : getArgumentChildren(ct)) {
    as.add((ArgumentInstantiation)parser.parse(a));
  }
  return ModelFactoryImpl.FACTORY.ArgumentInstantiationList(as);
}

Fixed version (ground truth):
public static ArgumentInstantiationList parseArgumentInstantiationList(ScribbleParser parser,CommonTree ct){
  List<ArgumentInstantiation> as=new LinkedList<>();
  for (  CommonTree a : getArgumentChildren(ct)) {
    AntlrNodeType type=Util.getAntlrNodeType(a);
    if (type == AntlrNodeType.MESSAGESIGNATURE) {
      ArgumentNode arg=(ArgumentNode)parser.parse(a);
      as.add(ModelFactoryImpl.FACTORY.ArgumentInstantiation(arg));
    }
 else {
      as.add(ModelFactoryImpl.FACTORY.ArgumentInstantiation(AntlrAmbiguousName.toAmbiguousNameNode(a)));
    }
  }
  return ModelFactoryImpl.FACTORY.ArgumentInstantiationList(as);
}
Program: 2482
Project: 2482
Buggy source:
public static AmbiguousNameNode toAmbiguousNameNode(CommonTree ct){
  return ModelFactoryImpl.FACTORY.AmbiguousNameNode(getName(ct));
}

Fixed version (ground truth):
public static AmbigNameNode toAmbiguousNameNode(CommonTree ct){
  return ModelFactoryImpl.FACTORY.AmbiguousNameNode(getName(ct));
}
Program: 2483
Project: 2483
Buggy source:
@Override public GDo leaveWFChoiceCheck(ModelNode parent,ModelNode child,WellFormedChoiceChecker checker,ModelNode visited) throws ScribbleException {
  checker.pushEnv(checker.popEnv().leaveWFChoiceCheck(checker));
  return popAndSetVisitorEnv(parent,child,checker,(GDo)visited);
}

Fixed version (ground truth):
@Override public GDo leaveWFChoiceCheck(ModelNode parent,ModelNode child,WellFormedChoiceChecker checker,ModelNode visited) throws ScribbleException {
  WellFormedChoiceEnv env=checker.popEnv();
{
    env=env.leaveWFChoiceCheck(checker);
  }
  setEnv(env);
  checker.pushEnv(checker.popEnv().mergeContext(env));
  return (GDo)visited;
}
Program: 2484
Project: 2484
Buggy source:
private void pushSubprotocolSignature(ProtocolName fullname,List<Role> roleargs,List<Argument<? extends Kind>> argargs){
  Map<Role,RoleNode> rolemap=rolemaps.peek();
  Map<Argument<? extends Kind>,ArgumentNode> argmap=argmaps.peek();
  List<Role> roles=new LinkedList<>(roleargs);
  List<Argument<? extends Kind>> args=new LinkedList<>(argargs);
  SubprotocolSignature ssubsig=new SubprotocolSignature(fullname,getScope(),roles,args);
  this.stack.add(ssubsig);
}

Fixed version (ground truth):
private void pushSubprotocolSignature(ProtocolName fullname,List<Role> roleargs,List<Argument<? extends Kind>> argargs){
  Map<Role,RoleNode> rolemap=rolemaps.peek();
  Map<Argument<? extends Kind>,ArgumentNode> argmap=argmaps.peek();
  List<Role> roles=new LinkedList<>(roleargs);
  List<Argument<? extends Kind>> args=new LinkedList<>(argargs);
  SubprotocolSignature ssubsig=new SubprotocolSignature(fullname,roles,args);
  this.stack.add(ssubsig);
}
Program: 2485
Project: 2485
Buggy source:
public WellFormedChoiceEnv leaveWFChoiceCheck(WellFormedChoiceChecker checker) throws ScribbleException {
  WellFormedChoiceEnv copy=copy();
  SubprotocolSignature subsig=checker.peekStack();
  if (copy.recording.contains(subsig)) {
    copy.recording.remove(subsig);
  }
  if (checker.isCycle()) {
    List<SubprotocolSignature> stack=checker.getStack();
    stack=stack.subList(0,stack.size() - 1);
    Scope scope=stack.get(stack.size() - 1).scope;
    int entry=checker.getCycleEntryIndex();
    Scope prev=(entry == 0) ? Scope.ROOT_SCOPE : stack.get(entry).scope;
    for (int i=checker.getCycleEntryIndex(); i < stack.size(); i++) {
      SubprotocolSignature ssubsig=stack.get(i);
      if (!prev.equals(ssubsig.scope)) {
        scope=new Scope(scope,ssubsig.scope.getSimpleName());
        prev=ssubsig.scope;
      }
      copy.addSubprotocolEnabled(scope,ssubsig);
    }
  }
  return copy;
}

Fixed version (ground truth):
public WellFormedChoiceEnv leaveWFChoiceCheck(WellFormedChoiceChecker checker) throws ScribbleException {
  WellFormedChoiceEnv copy=copy();
  SubprotocolSignature subsig=checker.peekStack();
  if (copy.recording.contains(subsig)) {
    copy.recording.remove(subsig);
  }
  if (checker.isCycle()) {
    List<SubprotocolSignature> stack=checker.getStack();
    stack=stack.subList(0,stack.size() - 1);
    int entry=checker.getCycleEntryIndex();
    for (int i=checker.getCycleEntryIndex(); i < stack.size(); i++) {
      SubprotocolSignature ssubsig=stack.get(i);
      copy.addSubprotocolEnabled(ssubsig);
    }
  }
  return copy;
}
Program: 2486
Project: 2486
Buggy source:
private void addSubprotocolEnabled(Scope scope,SubprotocolSignature subsig){
  MessageMap enabled=this.subsigs.get(subsig);
  for (  Role dest : enabled.getLeftKeys()) {
    for (    Role src : enabled.getRightKeys(dest)) {
      List<MessageId> sms=new LinkedList<>();
      for (      MessageId sm : enabled.getMessages(dest,src)) {
        sms.add(sm);
      }
      addMessages(this.initial,src,dest,sms);
    }
  }
}

Fixed version (ground truth):
private void addSubprotocolEnabled(SubprotocolSignature subsig){
  MessageMap enabled=this.subsigs.get(subsig);
  for (  Role dest : enabled.getLeftKeys()) {
    for (    Role src : enabled.getRightKeys(dest)) {
      List<MessageId> sms=new LinkedList<>();
      for (      MessageId sm : enabled.getMessages(dest,src)) {
        sms.add(sm);
      }
      addMessages(this.initial,src,dest,sms);
    }
  }
}
Program: 2487
Project: 2487
Buggy source:
public ScopedSubprotocolSignature(Scope scope,ProtocolName fmn,List<Role> roles,List<Argument<? extends Kind>> args){
  super(fmn,null,roles,args);
  this.sig=null;
  this.scope=scope;
}

Fixed version (ground truth):
public ScopedSubprotocolSignature(Scope scope,ProtocolName fmn,List<Role> roles,List<Argument<? extends Kind>> args){
  super(fmn,roles,args);
  this.sig=null;
  this.scope=scope;
}
Program: 2488
Project: 2488
Buggy source:
@Override public int hashCode(){
  int hash=1093;
  hash=31 * hash + this.fmn.hashCode();
  hash=31 * hash + this.scope.hashCode();
  hash=31 * hash + this.roles.hashCode();
  hash=31 * hash + this.args.hashCode();
  return hash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hash=1093;
  hash=31 * hash + this.fmn.hashCode();
  hash=31 * hash + this.roles.hashCode();
  hash=31 * hash + this.args.hashCode();
  return hash;
}
Program: 2489
Project: 2489
Buggy source:
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (!(o instanceof SubprotocolSignature)) {
    return false;
  }
  SubprotocolSignature subsig=(SubprotocolSignature)o;
  return this.fmn.equals(subsig.fmn) && this.scope.equals(subsig.scope) && this.roles.equals(subsig.roles)&& this.args.equals(subsig.args);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (!(o instanceof SubprotocolSignature)) {
    return false;
  }
  SubprotocolSignature subsig=(SubprotocolSignature)o;
  return this.fmn.equals(subsig.fmn) && this.roles.equals(subsig.roles) && this.args.equals(subsig.args);
}
Program: 2490
Project: 2490
Buggy source:
@Override public String toString(){
  return this.scope + "String_Node_Str" + this.fmn+ "String_Node_Str"+ this.args+ "String_Node_Str"+ this.roles+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return this.fmn + "String_Node_Str" + this.args+ "String_Node_Str"+ this.roles+ "String_Node_Str";
}
Program: 2491
Project: 2491
Buggy source:
public SubprotocolSignature(ProtocolName fmn,Scope scope,List<Role> roles,List<Argument<? extends Kind>> args){
  this.fmn=fmn;
  this.scope=scope;
  this.roles=new LinkedList<>(roles);
  this.args=new LinkedList<>(args);
}

Fixed version (ground truth):
public SubprotocolSignature(ProtocolName fmn,List<Role> roles,List<Argument<? extends Kind>> args){
  this.fmn=fmn;
  this.roles=new LinkedList<>(roles);
  this.args=new LinkedList<>(args);
}
Program: 2492
Project: 2492
Buggy source:
protected LocalCatches(CommonTree ct,RoleNode src,List<MessageNode> msgs,List<RoleNode> dests,GlobalInterruptContext gicontext,Env env){
  super(ct,src,msgs,dests,gicontext,env);
}

Fixed version (ground truth):
protected LocalCatches(RoleNode src,List<MessageNode> msgs){
  super(src,msgs);
}
Program: 2493
Project: 2493
Buggy source:
protected LocalInterrupt(CommonTree ct,RoleNode src,List<MessageNode> msgs,List<RoleNode> dests,GlobalInterruptContext gicontext,Env env){
  super(ct,src,msgs,gicontext,env);
  this.dests=new LinkedList<>(dests);
}

Fixed version (ground truth):
protected LocalInterrupt(RoleNode src,List<MessageNode> msgs){
  super(src,msgs);
}
Program: 2494
Project: 2494
Buggy source:
protected LocalInterruptible(CommonTree ct,ScopeNode scope,LocalProtocolBlock block,List<LocalInterrupt> interrs,CompoundInteractionNodeContext icontext,Env env){
  super(ct,scope,block,interrs,icontext,env);
}

Fixed version (ground truth):
protected LocalInterruptible(ScopeNode scope,LocalProtocolBlock block,List<LocalInterrupt> interrs){
  super(scope,block,interrs);
}
Program: 2495
Project: 2495
Buggy source:
protected LocalThrows(CommonTree ct,RoleNode src,List<MessageNode> msgs,List<RoleNode> dests,GlobalInterruptContext gicontext,Env env){
  super(ct,src,msgs,dests,gicontext,env);
}

Fixed version (ground truth):
protected LocalThrows(RoleNode src,List<MessageNode> msgs){
  super(src,msgs);
}
Program: 2496
Project: 2496
Buggy source:
@Override public PayloadTypeOrParameter toPayloadTypeOrParameter(){
  if (this.kind != Kind.TYPE) {
    throw new RuntimeException("String_Node_Str" + this);
  }
  return toName();
}

Fixed version (ground truth):
@Override public PayloadTypeOrParameter toPayloadTypeOrParameter(){
{
    throw new RuntimeException("String_Node_Str" + this);
  }
}
Program: 2497
Project: 2497
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object pop(){
  Object child=_components.peek();
  if (child instanceof Token) {
    Token token=(Token)child;
    _properties.put(ModelObject.START_LINE,token.getLine());
    _properties.put(ModelObject.START_COLUMN,token.getCharPositionInLine());
    if (!_properties.containsKey(ModelObject.END_LINE)) {
      _properties.put(ModelObject.END_LINE,token.getLine());
      _properties.put(ModelObject.END_COLUMN,token.getCharPositionInLine() + token.getText().length());
    }
  }
 else   if (child instanceof ModelObject) {
    ModelObject chobj=(ModelObject)child;
    _properties.put(ModelObject.START_LINE,chobj.getProperties().get(ModelObject.START_LINE));
    _properties.put(ModelObject.START_COLUMN,chobj.getProperties().get(ModelObject.START_COLUMN));
    if (!chobj.getProperties().containsKey(ModelObject.END_LINE)) {
      _properties.put(ModelObject.END_LINE,chobj.getProperties().get(ModelObject.END_LINE));
      _properties.put(ModelObject.END_COLUMN,chobj.getProperties().get(ModelObject.END_COLUMN));
    }
  }
  return (_components.pop());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object pop(){
  Object child=_components.peek();
  if (child instanceof Token) {
    Token token=(Token)child;
    _properties.put(ModelObject.START_LINE,token.getLine());
    _properties.put(ModelObject.START_COLUMN,token.getCharPositionInLine());
    if (!_properties.containsKey(ModelObject.END_LINE)) {
      _properties.put(ModelObject.END_LINE,token.getLine());
      _properties.put(ModelObject.END_COLUMN,token.getCharPositionInLine() + token.getText().length());
    }
  }
 else   if (child instanceof ModelObject) {
    ModelObject chobj=(ModelObject)child;
    _properties.put(ModelObject.START_LINE,chobj.getProperties().get(ModelObject.START_LINE));
    _properties.put(ModelObject.START_COLUMN,chobj.getProperties().get(ModelObject.START_COLUMN));
    if (chobj.getProperties().containsKey(ModelObject.END_LINE)) {
      _properties.put(ModelObject.END_LINE,chobj.getProperties().get(ModelObject.END_LINE));
      _properties.put(ModelObject.END_COLUMN,chobj.getProperties().get(ModelObject.END_COLUMN));
    }
  }
  return (_components.pop());
}
Program: 2498
Project: 2498
Buggy source:
/** 
 * {@inheritDoc}
 */
public void validate(ModuleContext context,ModelObject mobj,ScribbleLogger logger){
  GMessageTransfer elem=(GMessageTransfer)mobj;
  if (elem.getMessage() != null) {
    ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getMessage());
    if (rule != null) {
      rule.validate(context,elem.getMessage(),logger);
    }
  }
  ProtocolDecl pd=elem.getParent(ProtocolDecl.class);
  if (pd != null) {
    if (elem.getFromRole() != null) {
      if (pd.getRoleDeclaration(elem.getFromRole().getName()) == null) {
        logger.error(MessageFormat.format(ValidationMessages.getMessage("String_Node_Str"),elem.getFromRole().getName()),elem.getFromRole());
      }
    }
    java.util.List<String> toRoles=new java.util.ArrayList<String>();
    for (    Role r : elem.getToRoles()) {
      if (toRoles.contains(r.getName())) {
        logger.error(MessageFormat.format(ValidationMessages.getMessage("String_Node_Str"),r.getName()),elem);
      }
 else {
        toRoles.add(r.getName());
      }
      if (pd.getRoleDeclaration(r.getName()) == null) {
        logger.error(MessageFormat.format(ValidationMessages.getMessage("String_Node_Str"),r.getName()),r);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void validate(ModuleContext context,ModelObject mobj,ScribbleLogger logger){
  GMessageTransfer elem=(GMessageTransfer)mobj;
  if (elem.getMessage() != null) {
    ValidationRule rule=ValidationRuleFactory.getValidationRule(elem.getMessage());
    if (rule != null) {
      rule.validate(context,elem.getMessage(),logger);
    }
  }
  ProtocolDecl pd=elem.getParent(ProtocolDecl.class);
  if (pd != null) {
    if (elem.getFromRole() != null) {
      if (pd.getRoleDeclaration(elem.getFromRole().getName()) == null) {
        logger.error(MessageFormat.format(ValidationMessages.getMessage("String_Node_Str"),elem.getFromRole().getName()),elem);
      }
    }
    java.util.List<String> toRoles=new java.util.ArrayList<String>();
    for (    Role r : elem.getToRoles()) {
      if (toRoles.contains(r.getName())) {
        logger.error(MessageFormat.format(ValidationMessages.getMessage("String_Node_Str"),r.getName()),elem);
      }
 else {
        toRoles.add(r.getName());
      }
      if (pd.getRoleDeclaration(r.getName()) == null) {
        logger.error(MessageFormat.format(ValidationMessages.getMessage("String_Node_Str"),r.getName()),elem);
      }
    }
  }
}
Program: 2500
Project: 2500
Buggy source:
/** 
 * This method projects the supplied model object based on the specified role.
 * @param context The context
 * @param model The model object
 * @param role The role
 * @param l The model listener
 * @return The projected model object
 */
public Object project(ProtocolProjectorContext context,ModelObject model,Role role,Journal l){
  Object ret=null;
  Parallel parallel=new Parallel();
  Parallel source=(Parallel)model;
  parallel.derivedFrom(source);
  for (int i=0; i < source.getPaths().size(); i++) {
    Block block=(Block)context.project(source.getPaths().get(i),role,l);
    if (block != null) {
      parallel.getPaths().add(block);
    }
  }
  if (parallel.getPaths().size() > 0) {
    ret=parallel;
    if (parallel.getPaths().size() == 1) {
      ret=parallel.getPaths().get(0);
    }
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method projects the supplied model object based on the specified role.
 * @param context The context
 * @param model The model object
 * @param role The role
 * @param l The model listener
 * @return The projected model object
 */
public Object project(ProtocolProjectorContext context,ModelObject model,Role role,Journal l){
  Object ret=null;
  Parallel parallel=new Parallel();
  Parallel source=(Parallel)model;
  parallel.derivedFrom(source);
  for (int i=0; i < source.getPaths().size(); i++) {
    Block block=(Block)context.project(source.getPaths().get(i),role,l);
    if (block != null) {
      parallel.getPaths().add(block);
    }
  }
  if (parallel.getPaths().size() > 0) {
    ret=parallel;
    if (parallel.getPaths().size() == 1) {
      ret=parallel.getPaths().get(0).getContents();
    }
  }
  return (ret);
}
Program: 2501
Project: 2501
Buggy source:
/** 
 * This method returns the protocol description exported from the visited ProtocolModel.
 * @return The protocol description
 */
public org.scribble.protocol.monitor.model.Description getDescription(){
  Description ret=new Description();
  for (  org.scribble.protocol.monitor.model.Choice choice : _choicePaths.keySet()) {
    java.util.List<Path> pathBuilders=_choicePaths.get(choice);
    for (    Path pathBuilder : pathBuilders) {
      choice.getPath().add(pathBuilder);
    }
  }
  for (  org.scribble.protocol.monitor.model.Parallel parallel : _parallelPaths.keySet()) {
    java.util.List<Path> pathBuilders=_parallelPaths.get(parallel);
    for (    Path pathBuilder : pathBuilders) {
      parallel.getPath().add(pathBuilder);
    }
  }
  for (  Node b : _nodes) {
    ret.getNode().add(b);
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method returns the protocol description exported from the visited ProtocolModel.
 * @return The protocol description
 */
public org.scribble.protocol.monitor.model.Description getDescription(){
  Description ret=new Description();
  for (  org.scribble.protocol.monitor.model.Choice choice : _choicePaths.keySet()) {
    java.util.List<Path> pathBuilders=_choicePaths.get(choice);
    for (    Path pathBuilder : pathBuilders) {
      choice.getPath().add(pathBuilder);
    }
  }
  _choicePaths.clear();
  for (  org.scribble.protocol.monitor.model.Parallel parallel : _parallelPaths.keySet()) {
    java.util.List<Path> pathBuilders=_parallelPaths.get(parallel);
    for (    Path pathBuilder : pathBuilders) {
      parallel.getPath().add(pathBuilder);
    }
  }
  _parallelPaths.clear();
  for (  Node b : _nodes) {
    ret.getNode().add(b);
  }
  return (ret);
}
Program: 2502
Project: 2502
Buggy source:
@Override public void accept(Run elem){
  Protocol protocol=RunUtil.getInnerProtocol(elem.getEnclosingProtocol(),elem.getProtocolReference());
  if (protocol != null) {
    protocol.visit(this);
  }
}

Fixed version (ground truth):
@Override public void accept(Run elem){
  Protocol protocol=RunUtil.getInnerProtocol(elem.getEnclosingProtocol(),elem.getProtocolReference());
  if (protocol != null) {
    protocol.getBlock().visit(this);
  }
}
Program: 2504
Project: 2504
Buggy source:
/** 
 * This method sets the projector.
 * @param pp The projector
 */
public void setProtocolProjector(ProtocolProjector pp){
  _projectCommand.setProtocolProjector(pp);
}

Fixed version (ground truth):
/** 
 * This method sets the projector.
 * @param pp The projector
 */
public void setProtocolProjector(ProtocolProjector pp){
  _projectCommand.setProtocolProjector(pp);
  _validateCommand.setProtocolProjector(pp);
}
Program: 2505
Project: 2505
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean execute(String[] args){
  boolean ret=false;
  if (args.length == 1) {
    _journal.info("String_Node_Str" + args[0],null);
    java.io.File f=new java.io.File(args[0]);
    if (!f.exists()) {
      _journal.error("String_Node_Str" + args[0] + "String_Node_Str",null);
    }
 else {
      try {
        Content content=new FileContent(f);
        ProtocolTools context=new DefaultProtocolTools(_protocolParserManager,new DefaultResourceLocator(f.getParentFile()));
        org.scribble.protocol.model.ProtocolModel model=_protocolParserManager.parse(context,content,_journal);
        if (model != null) {
          _journal.info("String_Node_Str" + args[0],null);
          _validationManager.validate(context,model,_journal);
          ret=true;
        }
 else {
          _journal.error("String_Node_Str",null);
        }
      }
 catch (      Exception e) {
        _journal.error("String_Node_Str" + args[0] + "String_Node_Str",null);
      }
    }
  }
 else {
    System.err.println("String_Node_Str");
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean execute(String[] args){
  boolean ret=false;
  if (args.length == 1) {
    _journal.info("String_Node_Str" + args[0],null);
    java.io.File f=new java.io.File(args[0]);
    if (!f.exists()) {
      _journal.error("String_Node_Str" + args[0] + "String_Node_Str",null);
    }
 else {
      try {
        Content content=new FileContent(f);
        DefaultProtocolTools context=new DefaultProtocolTools(_protocolParserManager,new DefaultResourceLocator(f.getParentFile()));
        context.setProtocolValidationManager(_validationManager);
        context.setProtocolProjector(_protocolProjector);
        org.scribble.protocol.model.ProtocolModel model=_protocolParserManager.parse(context,content,_journal);
        if (model != null) {
          _journal.info("String_Node_Str" + args[0],null);
          _validationManager.validate(context,model,_journal);
          ret=true;
        }
 else {
          _journal.error("String_Node_Str",null);
        }
      }
 catch (      Exception e) {
        _journal.error("String_Node_Str" + args[0] + "String_Node_Str",null);
      }
    }
  }
 else {
    System.err.println("String_Node_Str");
  }
  return (ret);
}
Program: 2506
Project: 2506
Buggy source:
@Override public void conforms(ProtocolModel model,ProtocolModel ref,ConformanceHandler handler){
  model=ProtocolNormalizer.normalize(model);
  ref=ProtocolNormalizer.normalize(ref);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void conforms(ProtocolModel model,ProtocolModel ref,ConformanceHandler handler){
  model=ProtocolNormalizer.normalize(model);
  ref=ProtocolNormalizer.normalize(ref);
}
Program: 2507
Project: 2507
Buggy source:
@Override public boolean conforms(Interaction model,Interaction ref,ConformanceHandler handler){
  boolean ret=false;
  if (model.getMessageSignature().equals(ref.getMessageSignature())) {
    if ((model.getFromRole() == null || ref.getFromRole() == null || model.getFromRole().equals(ref.getFromRole()) && (model.getToRoles().size() == 0 || ref.getToRoles().size() == 0 || !Collections.disjoint(model.getToRoles(),ref.getToRoles())))) {
      ret=true;
    }
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean conforms(Interaction model,Interaction ref,ConformanceHandler handler){
  boolean ret=false;
  if (model.getMessageSignature().equals(ref.getMessageSignature())) {
    if ((model.getFromRole() == null || ref.getFromRole() == null || model.getFromRole().equals(ref.getFromRole()) && (model.getToRoles().size() == 0 || ref.getToRoles().size() == 0 || !Collections.disjoint(model.getToRoles(),ref.getToRoles())))) {
      ret=true;
    }
  }
  return (ret);
}
Program: 2508
Project: 2508
Buggy source:
public String toString(){
  return (this == VALID ? "String_Node_Str" : (this == NOT_HANDLED ? "String_Node_Str" : (this == INVALID ? "String_Node_Str" : "String_Node_Str" + isValid() + "String_Node_Str"+ getReason()+ "String_Node_Str"+ getProperties()+ "String_Node_Str")));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public String toString(){
  return (this == VALID ? "String_Node_Str" : (this == NOT_HANDLED ? "String_Node_Str" : (this == INVALID ? "String_Node_Str" : "String_Node_Str" + isValid() + "String_Node_Str"+ getReason()+ "String_Node_Str"+ getProperties()+ "String_Node_Str")));
}
Program: 2509
Project: 2509
Buggy source:
/** 
 * This is the copy constructor.
 */
public Inline(Inline copy){
  super(copy);
  _reference=new ProtocolReference(copy._reference);
  for (  Parameter p : copy._parameters) {
    _parameters.add(new Parameter(p));
  }
}

Fixed version (ground truth):
/** 
 * This is the copy constructor.
 * @param copy The instance to copy
 */
public Inline(Inline copy){
  super(copy);
  _reference=new ProtocolReference(copy._reference);
  for (  Parameter p : copy._parameters) {
    _parameters.add(new Parameter(p));
  }
}
Program: 2511
Project: 2511
Buggy source:
@Parameterized.Parameters public static List<Object[]> testcases(){
  Object[][] array=new Object[][]{{"String_Node_Str","String_Node_Str"}};
  List<Object[]> result=new LinkedList<Object[]>();
  for (  Object[] sub : array) {
    result.add(new Object[]{"String_Node_Str" + sub[0],"String_Node_Str" + sub[1],(sub.length == 3 ? sub[2] : null)});
  }
  return result;
}

Fixed version (ground truth):
@Parameterized.Parameters public static List<Object[]> testcases(){
  Object[][] array=new Object[][]{{"String_Node_Str","String_Node_Str"},{"String_Node_Str","String_Node_Str"}};
  List<Object[]> result=new LinkedList<Object[]>();
  for (  Object[] sub : array) {
    result.add(new Object[]{"String_Node_Str" + sub[0],"String_Node_Str" + sub[1],(sub.length == 3 ? sub[2] : null)});
  }
  return result;
}
Program: 2512
Project: 2512
Buggy source:
/** 
 * This method returns the top level protocol.
 * @return The top level protocol
 */
public Protocol getTopLevelProtocol(){
  Protocol ret=this;
  if (getParent() instanceof Protocol) {
    ret=((Protocol)getParent()).getTopLevelProtocol();
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method returns the top level protocol.
 * @return The top level protocol
 */
public Protocol getTopLevelProtocol(){
  Protocol ret=this;
  if (getParent() instanceof Block && getParent().getParent() instanceof Protocol) {
    ret=((Protocol)getParent().getParent()).getTopLevelProtocol();
  }
  return (ret);
}
Program: 2515
Project: 2515
Buggy source:
/** 
 * This method projects the supplied model object based on the specified role.
 * @param model The model object
 * @param role The role
 * @param l The model listener
 * @return The projected model object
 */
public ModelObject project(ProjectorContext context,ModelObject model,Role role,Journal l){
  Block ret=createBlock();
  Block source=(Block)model;
  ret.derivedFrom(source);
  context.pushState();
  for (int i=0; i < source.getContents().size(); i++) {
    Activity act=(Activity)context.project(source.getContents().get(i),role,l);
    if (act != null) {
      if (act instanceof Block) {
        ret.getContents().addAll(((Block)act).getContents());
      }
 else {
        ret.getContents().add(act);
      }
    }
  }
  context.popState();
  if (isFilterOutEmptyContent() && ret.getContents().size() == 0) {
    ret=null;
  }
  return (ret);
}

Fixed version (ground truth):
/** 
 * This method projects the supplied model object based on the specified role.
 * @param model The model object
 * @param role The role
 * @param l The model listener
 * @return The projected model object
 */
public ModelObject project(ProjectorContext context,ModelObject model,Role role,Journal l){
  Block ret=createBlock();
  Block source=(Block)model;
  ret.derivedFrom(source);
  context.pushState();
  for (int i=0; i < source.getContents().size(); i++) {
    Activity act=(Activity)context.project(source.getContents().get(i),role,l);
    if (act != null) {
      if (act instanceof Block) {
        ret.getContents().addAll(((Block)act).getContents());
      }
 else {
        ret.getContents().add(act);
      }
    }
  }
  context.popState();
  if (isFilterOutEmptyContent()) {
    int behaviourCount=0;
    for (    Activity act : ret.getContents()) {
      if (ActivityUtil.isBehaviour(act)) {
        behaviourCount++;
      }
    }
    if (behaviourCount == 0) {
      ret=null;
    }
  }
  return (ret);
}
Program: 2521
Project: 2521
Buggy source:
@Before public void setup() throws IOException {
  this.ksession=this.createKSession();
  KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
  File logFile=File.createTempFile("String_Node_Str","String_Node_Str");
  System.out.println("String_Node_Str" + logFile.getAbsolutePath() + "String_Node_Str");
  fileLogger=KnowledgeRuntimeLoggerFactory.newFileLogger(ksession,logFile.getAbsolutePath());
  humanTaskHandler=new SyncDeadlineEnabledWSHumanTaskHandler(localTaskService,ksession);
  humanTaskHandler.setLocal(true);
  humanTaskHandler.connect();
  this.ksession.getWorkItemManager().registerWorkItemHandler("String_Node_Str",humanTaskHandler);
  ((DefaultEscalatedDeadlineHandler)this.getEscalatedDeadlineHandler()).setManager(this.ksession.getWorkItemManager());
  wiser=new Wiser(1125);
  wiser.setHostname("String_Node_Str");
  wiser.start();
}

Fixed version (ground truth):
@Before public void setup() throws IOException {
  this.ksession=this.createKSession();
  KnowledgeRuntimeLoggerFactory.newConsoleLogger(ksession);
  File logFile=File.createTempFile("String_Node_Str","String_Node_Str");
  System.out.println("String_Node_Str" + logFile.getAbsolutePath() + "String_Node_Str");
  fileLogger=KnowledgeRuntimeLoggerFactory.newFileLogger(ksession,logFile.getAbsolutePath());
  humanTaskHandler=new SyncDeadlineEnabledWSHumanTaskHandler(localTaskService,ksession);
  humanTaskHandler.setLocal(true);
  humanTaskHandler.connect();
  this.ksession.getWorkItemManager().registerWorkItemHandler("String_Node_Str",humanTaskHandler);
  ((DefaultEscalatedDeadlineHandler)this.getEscalatedDeadlineHandler()).setManager(this.ksession.getWorkItemManager());
  wiser=new Wiser();
  wiser.setHostname("String_Node_Str");
  wiser.setPort(1125);
  wiser.start();
}
Program: 2522
Project: 2522
Buggy source:
/** 
 * Compare the two dynamic composites at the given index
 * @param first
 * @param second
 * @param index
 * @return
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public int compare(DynamicComposite first,DynamicComposite second,int index){
  Comparable c1Value=(Comparable)serializer.get(first,index);
  Comparable c2Value=(Comparable)serializer.get(second,index);
  if (c1Value == null && c2Value == null) {
    return 0;
  }
  if (c1Value == null) {
    return 1;
  }
  if (c2Value == null) {
    return -1;
  }
  return c1Value.compareTo(c2Value);
}

Fixed version (ground truth):
/** 
 * Compare the two dynamic composites at the given index
 * @param first
 * @param second
 * @param index
 * @return
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public int compare(DynamicComposite first,DynamicComposite second,int index){
  Comparable c1Value=(Comparable)getSerializationStrategy().get(first,index);
  Comparable c2Value=(Comparable)getSerializationStrategy().get(second,index);
  if (c1Value == null && c2Value == null) {
    return 0;
  }
  if (c1Value == null) {
    return 1;
  }
  if (c2Value == null) {
    return -1;
  }
  return c1Value.compareTo(c2Value);
}
Program: 2523
Project: 2523
Buggy source:
/** 
 * Create the write composite.
 * @param manager The state manager
 * @param composite The composite to write to
 * @param instance The field instance
 */
public void addFieldWrite(DynamicComposite composite,Object instance){
  Object current=null;
  if (instance != null) {
    current=ProxyUtils.getAdded(instance);
  }
  serializer.addToComponent(composite,current);
}

Fixed version (ground truth):
/** 
 * Create the write composite.
 * @param manager The state manager
 * @param composite The composite to write to
 * @param instance The field instance
 */
public void addFieldWrite(DynamicComposite composite,Object instance){
  Object current=null;
  if (instance != null) {
    current=ProxyUtils.getAdded(instance);
  }
  getSerializationStrategy().addToComponent(composite,current);
}
Program: 2524
Project: 2524
Buggy source:
/** 
 * Create the write composite.
 * @param composite The composite to write to
 * @param instance The field instance
 */
public boolean addFieldDelete(DynamicComposite composite,Object instance){
  Object original=ProxyUtils.getRemoved(instance);
  if (original != null) {
    serializer.addToComponent(composite,original);
    return true;
  }
  original=ProxyUtils.getChanged(instance);
  if (original != null) {
    serializer.addToComponent(composite,original);
    return true;
  }
  Object current=ProxyUtils.getAdded(instance);
  serializer.addToComponent(composite,current);
  return false;
}

Fixed version (ground truth):
/** 
 * Create the write composite.
 * @param composite The composite to write to
 * @param instance The field instance
 */
public boolean addFieldDelete(DynamicComposite composite,Object instance){
  Object original=ProxyUtils.getRemoved(instance);
  if (original != null) {
    getSerializationStrategy().addToComponent(composite,original);
    return true;
  }
  original=ProxyUtils.getChanged(instance);
  if (original != null) {
    getSerializationStrategy().addToComponent(composite,original);
    return true;
  }
  Object current=ProxyUtils.getAdded(instance);
  getSerializationStrategy().addToComponent(composite,current);
  return false;
}
Program: 2525
Project: 2525
Buggy source:
/** 
 * Prints information about this field
 */
@Override public String toString(){
  return String.format("String_Node_Str",new Object[]{targetField.getName(),targetField.getIndex(),serializer.getClass().getName()});
}

Fixed version (ground truth):
/** 
 * Prints information about this field
 */
@Override public String toString(){
  return String.format("String_Node_Str",new Object[]{targetField.getName(),targetField.getIndex(),getSerializationStrategy().getClass().getName()});
}
Program: 2526
Project: 2526
Buggy source:
/** 
 * @param order The order object
 * @param fmd The field meta data
 * @param index The 0 based position in the index
 */
public AbstractOrderField(Order order,FieldMetaData fmd){
  super(fmd,order.getName());
  this.order=order;
  invert=this.order.isAscending() ? 1 : -1;
  if (!Comparable.class.isAssignableFrom(targetField.getDeclaredType())) {
    throw new MetaDataException(String.format("String_Node_Str",fmd.getName(),fmd.getDeclaringMetaData().getDescribedType(),Comparable.class));
  }
  orderSerializer=IndexSerializationStrategyFactory.getFieldSerializationStrategy(fmd,order.isAscending());
}

Fixed version (ground truth):
/** 
 * @param order The order object
 * @param fmd The field meta data
 * @param index The 0 based position in the index
 */
public AbstractOrderField(Order order,FieldMetaData fmd){
  super(fmd,order.getName());
  this.order=order;
  invert=this.order.isAscending() ? 1 : -1;
  if (!Comparable.class.isAssignableFrom(targetField.getDeclaredType())) {
    throw new MetaDataException(String.format("String_Node_Str",fmd.getName(),fmd.getDeclaringMetaData().getDescribedType(),Comparable.class));
  }
  orderSerializer=IndexSerializationStrategyFactory.getFieldSerializationStrategy(targetField,order.isAscending());
}
Program: 2527
Project: 2527
Buggy source:
public QueryIndexField(FieldMetaData fmd){
  super(fmd,fmd.getName());
}

Fixed version (ground truth):
public QueryIndexField(FieldMetaData fmd){
  super(fmd,fmd.getName());
  this.serializer=IndexSerializationStrategyFactory.getFieldSerializationStrategy(targetField,true);
}
Program: 2528
Project: 2528
Buggy source:
/** 
 * Scan the given index query and add the results to the provided set. The set comparator of the dynamic columns are compared via a tree comparator
 * @param query
 */
public ScanBuffer scanIndex(IndexQuery query,Keyspace keyspace){
  DynamicComposite startScan=newComposite();
  DynamicComposite endScan=newComposite();
  int length=fields.length;
  int last=length - 1;
  FieldExpression exp=null;
  for (int i=0; i < last; i++) {
    exp=query.getExpression(this.fields[i].getMetaData());
    this.fields[i].addToComposite(startScan,i,exp.getStart(),ComponentEquality.EQUAL);
    this.fields[i].addToComposite(endScan,i,exp.getEnd(),ComponentEquality.EQUAL);
  }
  exp=query.getExpression(this.fields[last].getMetaData());
  this.fields[last].addToComposite(startScan,last,exp.getStart(),exp.getStartEquality());
  this.fields[last].addToComposite(endScan,last,exp.getEnd(),exp.getEndEquality());
  return new ScanBuffer(keyspace,startScan,endScan,indexName);
}

Fixed version (ground truth):
/** 
 * Scan the given index query and add the results to the provided set. The set comparator of the dynamic columns are compared via a tree comparator
 * @param query
 */
public ScanBuffer scanIndex(IndexQuery query,Keyspace keyspace){
  DynamicComposite startScan=newComposite();
  DynamicComposite endScan=newComposite();
  int length=fields.length;
  int last=length - 1;
  FieldExpression exp=null;
  for (int i=0; i < last; i++) {
    exp=query.getExpression(this.fields[i].getMetaData());
    this.fields[i].addToComposite(startScan,i,exp.getStart(),ComponentEquality.EQUAL);
    this.fields[i].addToComposite(endScan,i,exp.getEnd(),ComponentEquality.EQUAL);
  }
  exp=query.getExpression(this.fields[last].getMetaData());
  this.fields[last].addToComposite(startScan,last,exp.getStart(),query.getStartEquality());
  this.fields[last].addToComposite(endScan,last,exp.getEnd(),query.getEndEquality());
  return new ScanBuffer(keyspace,startScan,endScan,indexName);
}
Program: 2529
Project: 2529
Buggy source:
/** 
 * Scan the given index query and add the results to the provided set. The set comparator of the dynamic columns are compared via a tree comparator
 * @param query
 * @return 
 */
public ScanBuffer scanIndex(IndexQuery query,Keyspace keyspace){
  DynamicComposite startScan=newComposite();
  DynamicComposite endScan=newComposite();
  startScan.addComponent(discriminatorValue,stringSerializer);
  endScan.addComponent(discriminatorValue,stringSerializer);
  int length=fields.length;
  int last=length - 1;
  int componentIndex=1;
  FieldExpression exp=null;
  for (int i=0; i < last; i++, componentIndex++) {
    exp=query.getExpression(this.fields[i].getMetaData());
    this.fields[i].addToComposite(startScan,componentIndex,exp.getStart(),ComponentEquality.EQUAL);
    this.fields[i].addToComposite(endScan,componentIndex,exp.getEnd(),ComponentEquality.EQUAL);
  }
  exp=query.getExpression(this.fields[last].getMetaData());
  this.fields[last].addToComposite(startScan,componentIndex,exp.getStart(),exp.getStartEquality());
  this.fields[last].addToComposite(endScan,componentIndex,exp.getEnd(),exp.getEndEquality());
  return new ScanBuffer(keyspace,startScan,endScan,indexName);
}

Fixed version (ground truth):
/** 
 * Scan the given index query and add the results to the provided set. The set comparator of the dynamic columns are compared via a tree comparator
 * @param query
 * @return 
 */
public ScanBuffer scanIndex(IndexQuery query,Keyspace keyspace){
  DynamicComposite startScan=newComposite();
  DynamicComposite endScan=newComposite();
  startScan.addComponent(discriminatorValue,stringSerializer);
  endScan.addComponent(discriminatorValue,stringSerializer);
  int length=fields.length;
  int last=length - 1;
  int componentIndex=1;
  FieldExpression exp=null;
  for (int i=0; i < last; i++, componentIndex++) {
    exp=query.getExpression(this.fields[i].getMetaData());
    this.fields[i].addToComposite(startScan,componentIndex,exp.getStart(),ComponentEquality.EQUAL);
    this.fields[i].addToComposite(endScan,componentIndex,exp.getEnd(),ComponentEquality.EQUAL);
  }
  exp=query.getExpression(this.fields[last].getMetaData());
  this.fields[last].addToComposite(startScan,componentIndex,exp.getStart(),query.getStartEquality());
  this.fields[last].addToComposite(endScan,componentIndex,exp.getEnd(),query.getEndEquality());
  return new ScanBuffer(keyspace,startScan,endScan,indexName);
}
Program: 2530
Project: 2530
Buggy source:
/** 
 * @return the endEquality
 */
public ComponentEquality getEndEquality(){
  return endEquality;
}

Fixed version (ground truth):
/** 
 * @return the endEquality
 */
public Operand getEndEquality(){
  return endEquality;
}
Program: 2531
Project: 2531
Buggy source:
/** 
 * @param start the start to set
 * @param inclusive True if this is contains an equality operand I.E =, <=, >=
 */
public void setStart(Object start,ComponentEquality equality){
  if (this.startSet) {
    throw new UnsupportedException(String.format("String_Node_Str",field));
  }
  this.start=start;
  this.startEquality=equality;
  this.startSet=true;
}

Fixed version (ground truth):
/** 
 * @param start the start to set
 * @param inclusive True if this is contains an equality operand I.E =, <=, >=
 */
public void setStart(Object start,Operand equality){
  if (this.startSet) {
    throw new UnsupportedException(String.format("String_Node_Str",field));
  }
  this.start=start;
  this.startEquality=equality;
  this.startSet=true;
}
Program: 2532
Project: 2532
Buggy source:
/** 
 * @param end the end to set
 * @param inclusive True if this is contains an equality operand I.E =, <=, >=
 */
public void setEnd(Object end,ComponentEquality equality){
  if (this.endSet) {
    throw new UnsupportedException(String.format("String_Node_Str",field));
  }
  this.end=end;
  this.endEquality=equality;
  this.endSet=true;
}

Fixed version (ground truth):
/** 
 * @param end the end to set
 * @param inclusive True if this is contains an equality operand I.E =, <=, >=
 */
public void setEnd(Object end,Operand equality){
  if (this.endSet) {
    throw new UnsupportedException(String.format("String_Node_Str",field));
  }
  this.end=end;
  this.endEquality=equality;
  this.endSet=true;
}
Program: 2533
Project: 2533
Buggy source:
/** 
 * @return the startEquality
 */
public ComponentEquality getStartEquality(){
  return startEquality;
}

Fixed version (ground truth):
/** 
 * @return the startEquality
 */
public Operand getStartEquality(){
  return startEquality;
}
Program: 2534
Project: 2534
Buggy source:
public FieldExpression(FieldMetaData field){
  this.field=field;
  startEquality=ComponentEquality.EQUAL;
  endEquality=ComponentEquality.EQUAL;
}

Fixed version (ground truth):
public FieldExpression(FieldMetaData field){
  this.field=field;
  startEquality=Operand.Equal;
  endEquality=Operand.Equal;
}