nus-yam/ex-repair huggingface dataset:
Program: 41418
Project: 41418
Buggy source:
private void calculateLastVisible(long majority,long lastIndexSent){
  if (lastIndexSent == lastCommittedIndex)   return;
  HashMap<Long,Integer> bucket=new HashMap<>();
  for (  long lastAcked : peersLastAckedIndex.values()) {
    Integer p=bucket.get(lastAcked);
    if (p == null)     bucket.put(lastAcked,1);
 else     bucket.put(lastAcked,p + 1);
  }
  long mostAcked=0;
  for (  Map.Entry<Long,Integer> e : bucket.entrySet()) {
    if (e.getValue() >= majority) {
      if (mostAcked != 0) {
        LOG.warn("String_Node_Str",myId,mostAcked,e.getKey());
      }
      mostAcked=e.getKey();
    }
  }
  if (mostAcked == 0)   return;
  if (myFirstIndexAsLeader == 0)   return;
  if (mostAcked < myFirstIndexAsLeader) {
    LOG.warn("String_Node_Str",myId,mostAcked,myFirstIndexAsLeader);
    return;
  }
  if (mostAcked < lastCommittedIndex) {
    LOG.warn("String_Node_Str",myId,mostAcked,lastCommittedIndex);
    return;
  }
  if (mostAcked == lastCommittedIndex) {
    return;
  }
  this.lastCommittedIndex=mostAcked;
  notifyLastCommitted();
  LOG.trace("String_Node_Str",myId,lastCommittedIndex);
}

Fixed version (ground truth):
private void calculateLastVisible(long majority,long lastIndexSent){
  if (lastIndexSent == lastCommittedIndex)   return;
  HashMap<Long,Integer> bucket=new HashMap<>();
  for (  long lastAcked : peersLastAckedIndex.values()) {
    Integer p=bucket.get(lastAcked);
    if (p == null)     bucket.put(lastAcked,1);
 else     bucket.put(lastAcked,p + 1);
  }
  long mostAcked=0;
  for (  Map.Entry<Long,Integer> e : bucket.entrySet()) {
    if (e.getValue() >= majority) {
      if (mostAcked != 0) {
        LOG.warn("String_Node_Str",myId,mostAcked,e.getKey());
      }
      mostAcked=e.getKey();
    }
  }
  if (mostAcked == 0)   return;
  if (myFirstIndexAsLeader == 0)   return;
  if (mostAcked < myFirstIndexAsLeader) {
    LOG.warn("String_Node_Str",myId,mostAcked,myFirstIndexAsLeader);
    return;
  }
  if (mostAcked < lastCommittedIndex) {
    LOG.warn("String_Node_Str",myId,mostAcked,lastCommittedIndex);
    return;
  }
  if (mostAcked == lastCommittedIndex) {
    return;
  }
  setLastCommittedIndex(mostAcked);
  LOG.trace("String_Node_Str",myId,lastCommittedIndex);
}
Program: 41420
Project: 41420
Buggy source:
@Override public void onSuccess(Boolean result){
  AppendEntriesReply m=new AppendEntriesReply(currentTerm,true,0);
  RpcReply reply=new RpcReply(m);
  request.reply(reply);
  lastCommittedIndex=Math.min(appendMessage.getCommitIndex(),log.getLastIndex());
  notifyLastCommitted();
}

Fixed version (ground truth):
@Override public void onSuccess(Boolean result){
  AppendEntriesReply m=new AppendEntriesReply(currentTerm,true,0);
  RpcReply reply=new RpcReply(m);
  request.reply(reply);
  long newCommitIndex=Math.min(appendMessage.getCommitIndex(),log.getLastIndex());
  setLastCommittedIndex(newCommitIndex);
}
Program: 41421
Project: 41421
Buggy source:
private void becomeLeader(){
  LOG.warn("String_Node_Str",myId);
  myState=State.LEADER;
  long myNextLog=log.getLastIndex() + 1;
  peersLastAckedIndex=new HashMap<>(peers.size());
  peersNextIndex=new HashMap<>(peers.size() - 1);
  for (  long peer : peers) {
    if (peer == myId)     continue;
    peersNextIndex.put(peer,myNextLog);
  }
  myFirstIndexAsLeader=0;
  lastCommittedIndex=0;
  startQueueConsumer();
}

Fixed version (ground truth):
private void becomeLeader(){
  LOG.warn("String_Node_Str",myId,currentTerm);
  myState=State.LEADER;
  long myNextLog=log.getLastIndex() + 1;
  peersLastAckedIndex=new HashMap<>(peers.size());
  peersNextIndex=new HashMap<>(peers.size() - 1);
  for (  long peer : peers) {
    if (peer == myId)     continue;
    peersNextIndex.put(peer,myNextLog);
  }
  myFirstIndexAsLeader=0;
  lastCommittedIndex=0;
  startQueueConsumer();
}
Program: 41422
Project: 41422
Buggy source:
@Override public void run(){
  consumeQueue();
}

Fixed version (ground truth):
@Override public void run(){
  try {
    consumeQueue();
  }
 catch (  Throwable t) {
    failReplicatorInstance(t);
  }
}
Program: 41423
Project: 41423
Buggy source:
@FiberOnly private void startQueueConsumer(){
  queueConsumer=fiber.scheduleAtFixedRate(new Runnable(){
    @Override public void run(){
      consumeQueue();
    }
  }
,0,info.groupCommitDelay(),TimeUnit.MILLISECONDS);
}

Fixed version (ground truth):
@FiberOnly private void startQueueConsumer(){
  queueConsumer=fiber.scheduleAtFixedRate(new Runnable(){
    @Override public void run(){
      try {
        consumeQueue();
      }
 catch (      Throwable t) {
        failReplicatorInstance(t);
      }
    }
  }
,0,info.groupCommitDelay(),TimeUnit.MILLISECONDS);
}
Program: 41425
Project: 41425
Buggy source:
@Override protected void channelRead0(final ChannelHandlerContext ctx,final RaftWireMessage msg) throws Exception {
  fiber.execute(new Runnable(){
    @Override public void run(){
      handleWireInboundMessage(ctx.channel(),msg);
    }
  }
);
}

Fixed version (ground truth):
@Override protected void channelRead0(final ChannelHandlerContext ctx,final RaftWireMessage msg) throws Exception {
  fiber.execute(() -> {
    handleWireInboundMessage(ctx.channel(),msg);
  }
);
}
Program: 41426
Project: 41426
Buggy source:
/** 
 * <p> Use Hazelcast's   {@code ReflectionHelper} to extract a field in an entry, and use this is in the comparison.</P>
 * @param o1 An entry in a map
 * @param o2 Another entry in the map
 * @return Comparison result
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public int compare(Entry<?,?> o1,Entry<?,?> o2){
  try {
    Object o1Field=ReflectionHelper.extractValue(o1.getValue(),this.attributeName);
    Object o2Field=ReflectionHelper.extractValue(o2.getValue(),this.attributeName);
    if (o1Field == null) {
      return this.direction;
    }
    if (o2Field == null) {
      return -1 * this.direction;
    }
    if (o1Field instanceof Comparable && o2Field instanceof Comparable) {
      return this.direction * ((Comparable)o1Field).compareTo((Comparable)o2Field);
    }
  }
 catch (  Exception ignore) {
    return 0;
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * <p> Use Hazelcast's   {@code ReflectionHelper} to extract a field in an entry, and use this is in the comparison.</P>
 * @param o1 An entry in a map
 * @param o2 Another entry in the map
 * @return Comparison result
 */
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) public int compare(Entry<?,?> o1,Entry<?,?> o2){
  try {
    Object o1Field=ReflectionHelper.extractValue(o1.getValue(),this.attributeName);
    Object o2Field=ReflectionHelper.extractValue(o2.getValue(),this.attributeName);
    if (o1Field == o2Field) {
      return 0;
    }
    if (o1Field == null) {
      return this.direction;
    }
    if (o2Field == null) {
      return -1 * this.direction;
    }
    if (o1Field instanceof Comparable && o2Field instanceof Comparable) {
      return this.direction * ((Comparable)o1Field).compareTo(o2Field);
    }
  }
 catch (  Exception ignore) {
    return 0;
  }
  return 0;
}
Program: 41427
Project: 41427
Buggy source:
/** 
 * <P> Execute   {@code countBy*()} queries against a Hazelcast map.</P>
 * @param criteria Predicate to use, not null
 * @param keyspace The map name
 * @return Results from Hazelcast
 */
@Override public long count(final Predicate<?,?> criteria,final String keyspace){
  return this.getAdapter().getMap(keyspace).keySet(criteria).size();
}

Fixed version (ground truth):
/** 
 * <P> Execute   {@code countBy*()} queries against a Hazelcast map.</P>
 * @param criteria Predicate to use, not null
 * @param keyspace The map name
 * @return Results from Hazelcast
 */
@Override public long count(final Predicate<?,?> criteria,final String keyspace){
  final HazelcastKeyValueAdapter adapter=getAdapter();
  Assert.notNull(adapter,"String_Node_Str");
  return adapter.getMap(keyspace).keySet(criteria).size();
}
Program: 41428
Project: 41428
Buggy source:
/** 
 * <P> Construct the final query predicate for Hazelcast to execute, from the base query plus any paging and sorting. </P> <P> Variations here allow the base query predicate to be omitted, sorting to be omitted, and paging to be omitted. </P>
 * @param criteria Search criteria, null means match everything
 * @param sort Possibly null collation
 * @param offset Start point of returned page, -1 if not used
 * @param rows Size of page, -1 if not used
 * @param keyspace The map name
 * @return Results from Hazelcast
 */
@Override public Collection<?> execute(final Predicate<?,?> criteria,final Comparator<Entry<?,?>> sort,final long offset,final int rows,final String keyspace){
  Predicate<?,?> predicateToUse=criteria;
  @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Comparator<Entry> sortToUse=((Comparator<Entry>)(Comparator)sort);
  if (rows > 0) {
    PagingPredicate pp=new PagingPredicate(predicateToUse,sortToUse,rows);
    long x=offset / rows;
    while (x > 0) {
      pp.nextPage();
      x--;
    }
    predicateToUse=pp;
  }
 else {
    if (sortToUse != null) {
      predicateToUse=new PagingPredicate(predicateToUse,sortToUse,Integer.MAX_VALUE);
    }
  }
  if (predicateToUse == null) {
    return this.getAdapter().getMap(keyspace).values();
  }
 else {
    return this.getAdapter().getMap(keyspace).values(predicateToUse);
  }
}

Fixed version (ground truth):
/** 
 * <P> Construct the final query predicate for Hazelcast to execute, from the base query plus any paging and sorting. </P> <P> Variations here allow the base query predicate to be omitted, sorting to be omitted, and paging to be omitted. </P>
 * @param criteria Search criteria, null means match everything
 * @param sort Possibly null collation
 * @param offset Start point of returned page, -1 if not used
 * @param rows Size of page, -1 if not used
 * @param keyspace The map name
 * @return Results from Hazelcast
 */
@Override public Collection<?> execute(final Predicate<?,?> criteria,final Comparator<Entry<?,?>> sort,final long offset,final int rows,final String keyspace){
  final HazelcastKeyValueAdapter adapter=getAdapter();
  Assert.notNull(adapter,"String_Node_Str");
  Predicate<?,?> predicateToUse=criteria;
  @SuppressWarnings({"String_Node_Str","String_Node_Str"}) Comparator<Entry> sortToUse=((Comparator<Entry>)(Comparator)sort);
  if (rows > 0) {
    PagingPredicate pp=new PagingPredicate(predicateToUse,sortToUse,rows);
    long x=offset / rows;
    while (x > 0) {
      pp.nextPage();
      x--;
    }
    predicateToUse=pp;
  }
 else {
    if (sortToUse != null) {
      predicateToUse=new PagingPredicate(predicateToUse,sortToUse,Integer.MAX_VALUE);
    }
  }
  if (predicateToUse == null) {
    return adapter.getMap(keyspace).values();
  }
 else {
    return adapter.getMap(keyspace).values(predicateToUse);
  }
}
Program: 41429
Project: 41429
Buggy source:
/** 
 * @param A query in Spring form
 * @return The same in Hazelcast form
 */
public Predicate<?,?> resolve(KeyValueQuery<?> query){
  if (query == null || query.getCriteria() == null) {
    return null;
  }
  if (query.getCriteria() instanceof PagingPredicate) {
    PagingPredicate pagingPredicate=(PagingPredicate)query.getCriteria();
    query.limit(pagingPredicate.getPageSize());
    return pagingPredicate.getPredicate();
  }
  if (query.getCriteria() instanceof Predicate) {
    return (Predicate<?,?>)query.getCriteria();
  }
  throw new UnsupportedOperationException(query.toString());
}

Fixed version (ground truth):
/** 
 * @param A query in Spring form
 * @return The same in Hazelcast form
 */
public Predicate<?,?> resolve(KeyValueQuery<?> query){
  if (query == null) {
    return null;
  }
  final Object criteria=query.getCriteria();
  if (criteria == null) {
    return null;
  }
  if (criteria instanceof PagingPredicate) {
    PagingPredicate pagingPredicate=(PagingPredicate)criteria;
    query.limit(pagingPredicate.getPageSize());
    return pagingPredicate.getPredicate();
  }
  if (criteria instanceof Predicate) {
    return (Predicate<?,?>)criteria;
  }
  throw new UnsupportedOperationException(query.toString());
}
Program: 41430
Project: 41430
Buggy source:
/** 
 * <P> Create the query from the bind parameters. </P>
 * @param parameters Possibly empty list of query parameters
 * @return A ready-to-use query
 */
protected KeyValueQuery<?> prepareQuery(Object[] parameters){
  PartTree tree=null;
  if (this.queryMethod.getParameters().getNumberOfParameters() > 0) {
    tree=new PartTree(getQueryMethod().getName(),getQueryMethod().getEntityInformation().getJavaType());
    this.isCount=tree.isCountProjection();
    this.isDelete=tree.isDelete();
    this.isDistinct=tree.isDistinct();
  }
 else {
    this.isCount=false;
    this.isDelete=false;
    this.isDistinct=false;
  }
  ParametersParameterAccessor accessor=this.prepareAccessor(parameters,tree);
  KeyValueQuery<?> query=createQuery(accessor);
  if (accessor.getPageable() != null) {
    query.setOffset(accessor.getPageable().getOffset());
    query.setRows(accessor.getPageable().getPageSize());
  }
 else {
    query.setOffset(-1);
    query.setRows(-1);
  }
  if (accessor.getSort() != null) {
    query.setSort(accessor.getSort());
  }
  return query;
}

Fixed version (ground truth):
/** 
 * <P> Create the query from the bind parameters. </P>
 * @param parameters Possibly empty list of query parameters
 * @return A ready-to-use query
 */
protected KeyValueQuery<?> prepareQuery(Object[] parameters){
  PartTree tree=null;
  if (this.queryMethod.getParameters().getNumberOfParameters() > 0) {
    tree=new PartTree(getQueryMethod().getName(),getQueryMethod().getEntityInformation().getJavaType());
    this.isCount=tree.isCountProjection();
    this.isDelete=tree.isDelete();
    this.isDistinct=tree.isDistinct();
  }
 else {
    this.isCount=false;
    this.isDelete=false;
    this.isDistinct=false;
  }
  ParametersParameterAccessor accessor=this.prepareAccessor(parameters,tree);
  KeyValueQuery<?> query=createQuery(accessor);
  if (accessor.getPageable() != Pageable.unpaged()) {
    query.setOffset(accessor.getPageable().getOffset());
    query.setRows(accessor.getPageable().getPageSize());
  }
 else {
    query.setOffset(-1);
    query.setRows(-1);
  }
  if (accessor.getSort() != Sort.unsorted()) {
    query.setSort(accessor.getSort());
  }
  return query;
}
Program: 41431
Project: 41431
Buggy source:
/** 
 * <P> Handle   {@code @Param}. </P> <OL> <LI><B>Without   {@code @Param}</B> <P> Arguments to the call are assumed to follow the same sequence as cited in the method name. </P> <P> Eg. <pre> findBy<U>One</U>And<U>Two</U>(String <U>one</U>, String <U>two</U>); </pre> </P> </LI> <LI><B>With   {@code @Param}</B> <P> Arguments to the call are use the   {@code @Param} to match them against the fields.<P> Eg. <pre> findBy<U>One</U>And<U>Two</U>(@Param("two") String <U>two</U>, @Param("one") String <U>one</U>); </pre> </P> </LI> </OL>
 * @param parameters Possibly empty
 * @param partTree Query tree to traverse
 * @return Paremeters in correct order
 */
private ParametersParameterAccessor prepareAccessor(final Object[] originalParameters,final PartTree partTree){
  if (!this.isRearrangeKnown) {
    this.prepareRearrange(partTree,this.queryMethod.getParameters().getBindableParameters());
    this.isRearrangeKnown=true;
  }
  Object[] parameters=originalParameters;
  if (parameters != null && this.isRearrangeRequired) {
    parameters=new Object[originalParameters.length];
    for (int i=0; i < parameters.length; i++) {
      int index=rearrangeIndex[i];
      parameters[i]=originalParameters[index];
    }
  }
  return new ParametersParameterAccessor(this.queryMethod.getParameters(),parameters);
}

Fixed version (ground truth):
/** 
 * <P> Handle   {@code @Param}. </P> <OL> <LI><B>Without   {@code @Param}</B> <P> Arguments to the call are assumed to follow the same sequence as cited in the method name. </P> <P> Eg. <pre> findBy<U>One</U>And<U>Two</U>(String <U>one</U>, String <U>two</U>); </pre> </P> </LI> <LI><B>With   {@code @Param}</B> <P> Arguments to the call are use the   {@code @Param} to match them against the fields.<P> Eg. <pre> findBy<U>One</U>And<U>Two</U>(@Param("two") String <U>two</U>, @Param("one") String <U>one</U>); </pre> </P> </LI> </OL>
 * @param originalParameters Possibly empty
 * @param partTree Query tree to traverse
 * @return Parameters in correct order
 */
private ParametersParameterAccessor prepareAccessor(final Object[] originalParameters,final PartTree partTree){
  if (!this.isRearrangeKnown) {
    this.prepareRearrange(partTree,this.queryMethod.getParameters().getBindableParameters());
    this.isRearrangeKnown=true;
  }
  Object[] parameters=originalParameters;
  Assert.notNull(parameters,"String_Node_Str");
  if (this.isRearrangeRequired) {
    parameters=new Object[originalParameters.length];
    for (int i=0; i < parameters.length; i++) {
      int index=rearrangeIndex[i];
      parameters[i]=originalParameters[index];
    }
  }
  return new ParametersParameterAccessor(this.queryMethod.getParameters(),parameters);
}
Program: 41432
Project: 41432
Buggy source:
/** 
 * Creates a new   {@link HazelcastQueryCreator} for the given {@link PartTree} and {@link ParameterAccessor}. The latter is used to hand actual parameter values into the callback methods as well as to apply dynamic sorting via a  {@link Sort} parameter.
 * @param tree must not be {@literal null}.
 * @param parameters can be {@literal null}.
 */
public HazelcastQueryCreator(PartTree tree,ParameterAccessor parameters){
  super(tree,parameters);
  if (tree.isLimiting() && tree.getMaxResults() > 0) {
    this.limit=tree.getMaxResults();
  }
 else {
    this.limit=0;
  }
}

Fixed version (ground truth):
/** 
 * Creates a new   {@link HazelcastQueryCreator} for the given {@link PartTree} and {@link ParameterAccessor}. The latter is used to hand actual parameter values into the callback methods as well as to apply dynamic sorting via a  {@link Sort} parameter.
 * @param tree must not be {@literal null}.
 * @param parameters can be {@literal null}.
 */
public HazelcastQueryCreator(PartTree tree,ParameterAccessor parameters){
  super(tree,parameters);
  final Integer maxResults=tree.getMaxResults();
  if (tree.isLimiting() && maxResults != null && maxResults > 0) {
    this.limit=maxResults;
  }
 else {
    this.limit=0;
  }
}
Program: 41433
Project: 41433
Buggy source:
/** 
 * <P> Sort on a sequence of fields, possibly none. </P>
 * @param query If not null, will contain one of more {@link Sort.Order} objects.
 * @return A sequence of comparators or {@code null}
 */
public Comparator<Entry<?,?>> resolve(KeyValueQuery<?> query){
  if (query == null || query.getSort() == null) {
    return null;
  }
  CompoundComparator<Entry<?,?>> compoundComparator=new CompoundComparator<>();
  for (  Order order : query.getSort()) {
    if (order.getProperty().indexOf('.') > -1) {
      throw new UnsupportedOperationException("String_Node_Str" + order);
    }
    if (order.isIgnoreCase()) {
      throw new UnsupportedOperationException("String_Node_Str" + order);
    }
    if (NullHandling.NATIVE != order.getNullHandling()) {
      throw new UnsupportedOperationException("String_Node_Str" + order);
    }
    HazelcastPropertyComparator hazelcastPropertyComparator=new HazelcastPropertyComparator(order.getProperty(),order.isAscending());
    compoundComparator.addComparator(hazelcastPropertyComparator);
  }
  return compoundComparator;
}

Fixed version (ground truth):
/** 
 * <P> Sort on a sequence of fields, possibly none. </P>
 * @param query If not null, will contain one of more {@link Sort.Order} objects.
 * @return A sequence of comparators or {@code null}
 */
public Comparator<Entry<?,?>> resolve(KeyValueQuery<?> query){
  if (query == null || query.getSort() == Sort.unsorted()) {
    return null;
  }
  CompoundComparator<Entry<?,?>> compoundComparator=new CompoundComparator<>();
  for (  Order order : query.getSort()) {
    if (order.getProperty().indexOf('.') > -1) {
      throw new UnsupportedOperationException("String_Node_Str" + order);
    }
    if (order.isIgnoreCase()) {
      throw new UnsupportedOperationException("String_Node_Str" + order);
    }
    if (NullHandling.NATIVE != order.getNullHandling()) {
      throw new UnsupportedOperationException("String_Node_Str" + order);
    }
    HazelcastPropertyComparator hazelcastPropertyComparator=new HazelcastPropertyComparator(order.getProperty(),order.isAscending());
    compoundComparator.addComparator(hazelcastPropertyComparator);
  }
  return compoundComparator;
}
Program: 41434
Project: 41434
Buggy source:
@Test public void deleteShouldRemoveObjectCorrectly(){
  operations.insert("String_Node_Str",FOO_ONE);
  operations.delete("String_Node_Str",Foo.class);
  assertThat(operations.findById("String_Node_Str",Foo.class),nullValue());
}

Fixed version (ground truth):
@Test public void deleteShouldRemoveObjectCorrectly(){
  operations.insert("String_Node_Str",FOO_ONE);
  operations.delete("String_Node_Str",Foo.class);
  assertFalse(operations.findById("String_Node_Str",Foo.class).isPresent());
}
Program: 41435
Project: 41435
Buggy source:
@Test public void updateShouldReplaceExistingObject(){
  operations.insert("String_Node_Str",FOO_ONE);
  operations.update("String_Node_Str",FOO_TWO);
  assertThat(operations.findById("String_Node_Str",Foo.class),is(FOO_TWO));
}

Fixed version (ground truth):
@Test public void updateShouldReplaceExistingObject(){
  operations.insert("String_Node_Str",FOO_ONE);
  operations.update("String_Node_Str",FOO_TWO);
  assertThat(operations.findById("String_Node_Str",Foo.class),is(Optional.of(FOO_TWO)));
}
Program: 41436
Project: 41436
Buggy source:
@Test public void createShouldRespectExistingId(){
  ClassWithStringId source=new ClassWithStringId();
  source.id="String_Node_Str";
  operations.insert(source);
  assertThat(operations.findById("String_Node_Str",ClassWithStringId.class),is(source));
}

Fixed version (ground truth):
@Test public void createShouldRespectExistingId(){
  ClassWithStringId source=new ClassWithStringId();
  source.id="String_Node_Str";
  operations.insert(source);
  assertThat(operations.findById("String_Node_Str",ClassWithStringId.class),is(Optional.of(source)));
}
Program: 41437
Project: 41437
Buggy source:
@Test public void updateShouldRespectTypeInformation(){
  operations.insert("String_Node_Str",FOO_ONE);
  operations.update("String_Node_Str",BAR_ONE);
  assertThat(operations.findById("String_Node_Str",Foo.class),is(FOO_ONE));
}

Fixed version (ground truth):
@Test public void updateShouldRespectTypeInformation(){
  operations.insert("String_Node_Str",FOO_ONE);
  operations.update("String_Node_Str",BAR_ONE);
  assertThat(operations.findById("String_Node_Str",Foo.class),is(Optional.of(FOO_ONE)));
}
Program: 41438
Project: 41438
Buggy source:
@Test public void findByIdShouldReturnObjectWithMatchingIdAndType(){
  operations.insert("String_Node_Str",FOO_ONE);
  assertThat(operations.findById("String_Node_Str",Foo.class),is(FOO_ONE));
}

Fixed version (ground truth):
@Test public void findByIdShouldReturnObjectWithMatchingIdAndType(){
  operations.insert("String_Node_Str",FOO_ONE);
  assertThat(operations.findById("String_Node_Str",Foo.class),is(Optional.of(FOO_ONE)));
}
Program: 41443
Project: 41443
Buggy source:
public String findInstanceIDVar(final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str";
  final List<String> varNames=getMainVariableNames();
  for (  final String varName : varNames) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}

Fixed version (ground truth):
public String findInstanceIDVar(final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + ModelUtils.makeValidNCName(templateId)+ "String_Node_Str";
  final List<String> varNames=getMainVariableNames();
  for (  final String varName : varNames) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}
Program: 41444
Project: 41444
Buggy source:
public String findInstanceURLVar(final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str";
  for (  final String varName : getMainVariableNames()) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}

Fixed version (ground truth):
public String findInstanceURLVar(final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + ModelUtils.makeValidNCName(templateId)+ "String_Node_Str";
  for (  final String varName : getMainVariableNames()) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}
Program: 41445
Project: 41445
Buggy source:
public boolean addInstanceIDVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceIDVarKeyword + "String_Node_Str"+ templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}

Fixed version (ground truth):
public boolean addInstanceIDVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceIDVarKeyword + "String_Node_Str"+ ModelUtils.makeValidNCName(templateId)+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}
Program: 41446
Project: 41446
Buggy source:
private String findInstanceIdVarName(final List<String> varNames,final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + InstanceURLVarKeyword + "String_Node_Str"+ templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str";
  for (  final String varName : varNames) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}

Fixed version (ground truth):
private String findInstanceIdVarName(final List<String> varNames,final String templateId,final boolean isNode){
  final String instanceURLVarName=(isNode ? "String_Node_Str" : "String_Node_Str") + InstanceURLVarKeyword + "String_Node_Str"+ ModelUtils.makeValidNCName(templateId)+ "String_Node_Str";
  for (  final String varName : varNames) {
    if (varName.contains(instanceURLVarName)) {
      return varName;
    }
  }
  return null;
}
Program: 41447
Project: 41447
Buggy source:
/** 
 * Adds a NodeInstanceID Variable to the given TemplatePlan
 * @param templatePlan a TemplatePlan
 * @return true iff adding a NodeInstanceID Var was successful
 */
public boolean addInstanceURLVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceURLVarKeyword + "String_Node_Str"+ templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}

Fixed version (ground truth):
/** 
 * Adds a NodeInstanceID Variable to the given TemplatePlan
 * @param templatePlan a TemplatePlan
 * @return true iff adding a NodeInstanceID Var was successful
 */
public boolean addInstanceURLVarToTemplatePlan(final BPELScopeActivity templatePlan){
  final String xsdPrefix="String_Node_Str" + System.currentTimeMillis();
  final String xsdNamespace="String_Node_Str";
  this.bpelProcessHandler.addNamespaceToBPELDoc(xsdPrefix,xsdNamespace,templatePlan.getBuildPlan());
  String templateId="String_Node_Str";
  String prefix="String_Node_Str";
  if (templatePlan.getNodeTemplate() != null) {
    templateId=templatePlan.getNodeTemplate().getId();
    prefix="String_Node_Str";
  }
 else {
    templateId=templatePlan.getRelationshipTemplate().getId();
    prefix="String_Node_Str";
  }
  final String instanceIdVarName=prefix + InstanceURLVarKeyword + "String_Node_Str"+ ModelUtils.makeValidNCName(templateId)+ "String_Node_Str"+ System.currentTimeMillis();
  return this.bpelProcessHandler.addVariable(instanceIdVarName,VariableType.TYPE,new QName(xsdNamespace,"String_Node_Str",xsdPrefix),templatePlan.getBuildPlan());
}
Program: 41450
Project: 41450
Buggy source:
public String createInstanceIDVar(final BPELPlanContext context,final String templateId){
  final String instanceURLVarName=(context.getRelationshipTemplate() == null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ context.getIdForNames();
  final QName stringTypeDeclId=context.importQName(new QName("String_Node_Str","String_Node_Str","String_Node_Str"));
  if (!context.addGlobalVariable(instanceURLVarName,BPELPlan.VariableType.TYPE,stringTypeDeclId)) {
    return null;
  }
  return instanceURLVarName;
}

Fixed version (ground truth):
public String createInstanceIDVar(final BPELPlanContext context,final String templateId){
  final String instanceURLVarName=(context.getRelationshipTemplate() == null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + ModelUtils.makeValidNCName(templateId)+ "String_Node_Str"+ context.getIdForNames();
  final QName stringTypeDeclId=context.importQName(new QName("String_Node_Str","String_Node_Str","String_Node_Str"));
  if (!context.addGlobalVariable(instanceURLVarName,BPELPlan.VariableType.TYPE,stringTypeDeclId)) {
    return null;
  }
  return instanceURLVarName;
}
Program: 41451
Project: 41451
Buggy source:
public String createInstanceURLVar(final BPELPlanContext context,final String templateId){
  final String instanceURLVarName=(context.getRelationshipTemplate() == null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + templateId.replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ context.getIdForNames();
  final QName stringTypeDeclId=context.importQName(new QName("String_Node_Str","String_Node_Str","String_Node_Str"));
  if (!context.addGlobalVariable(instanceURLVarName,BPELPlan.VariableType.TYPE,stringTypeDeclId)) {
    return null;
  }
  return instanceURLVarName;
}

Fixed version (ground truth):
public String createInstanceURLVar(final BPELPlanContext context,final String templateId){
  final String instanceURLVarName=(context.getRelationshipTemplate() == null ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str" + ModelUtils.makeValidNCName(templateId)+ "String_Node_Str"+ context.getIdForNames();
  final QName stringTypeDeclId=context.importQName(new QName("String_Node_Str","String_Node_Str","String_Node_Str"));
  if (!context.addGlobalVariable(instanceURLVarName,BPELPlan.VariableType.TYPE,stringTypeDeclId)) {
    return null;
  }
  return instanceURLVarName;
}
Program: 41452
Project: 41452
Buggy source:
private String createStateVar(final BPELPlanContext context,final String templateId){
  final String stateVarName=templateId.replace("String_Node_Str","String_Node_Str") + "String_Node_Str" + context.getIdForNames();
  final QName stringTypeDeclId=context.importQName(new QName("String_Node_Str","String_Node_Str","String_Node_Str"));
  if (!context.addGlobalVariable(stateVarName,BPELPlan.VariableType.TYPE,stringTypeDeclId)) {
    return null;
  }
  return stateVarName;
}

Fixed version (ground truth):
private String createStateVar(final BPELPlanContext context,final String templateId){
  final String stateVarName=ModelUtils.makeValidNCName(templateId) + "String_Node_Str" + context.getIdForNames();
  final QName stringTypeDeclId=context.importQName(new QName("String_Node_Str","String_Node_Str","String_Node_Str"));
  if (!context.addGlobalVariable(stateVarName,BPELPlan.VariableType.TYPE,stringTypeDeclId)) {
    return null;
  }
  return stateVarName;
}
Program: 41454
Project: 41454
Buggy source:
public static SelfServiceOptionWrapper generateSelfServiceOption(final BPELPlan buildPlan) throws IOException {
  final String id=String.valueOf(System.currentTimeMillis());
  final ApplicationOption option=new ApplicationOption();
  final File tmpDir=new File(System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str") + Long.toString(System.currentTimeMillis()));
  tmpDir.mkdir();
  final File planInputMessageFile=new File(tmpDir,"String_Node_Str" + id + "String_Node_Str");
  option.setName("String_Node_Str");
  option.setId(id);
  option.setIconUrl("String_Node_Str");
  option.setDescription("String_Node_Str");
  option.setPlanServiceName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart());
  option.setPlanInputMessageUrl("String_Node_Str" + id + "String_Node_Str");
  Util.writePlanInputMessageInstance(buildPlan,planInputMessageFile);
  return new SelfServiceOptionWrapper(option,planInputMessageFile);
}

Fixed version (ground truth):
public static SelfServiceOptionWrapper generateSelfServiceOption(final BPELPlan buildPlan) throws IOException {
  final String id=String.valueOf(System.currentTimeMillis());
  final ApplicationOption option=new ApplicationOption();
  final File tmpDir=new File(System.getProperty("String_Node_Str") + System.getProperty("String_Node_Str") + Long.toString(System.currentTimeMillis()));
  tmpDir.mkdir();
  final File planInputMessageFile=new File(tmpDir,"String_Node_Str" + id + "String_Node_Str");
  option.setName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart());
  option.setId(id);
  option.setIconUrl("String_Node_Str");
  option.setDescription("String_Node_Str");
  option.setPlanServiceName(Util.getBuildPlanServiceName(buildPlan.getDeploymentDeskriptor()).getLocalPart());
  option.setPlanInputMessageUrl("String_Node_Str" + id + "String_Node_Str");
  Util.writePlanInputMessageInstance(buildPlan,planInputMessageFile);
  return new SelfServiceOptionWrapper(option,planInputMessageFile);
}
Program: 41455
Project: 41455
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getDeploymentTests(@PathParam("String_Node_Str") final String csar,@PathParam("String_Node_Str") final String servicetemplate,@PathParam("String_Node_Str") final Integer id){
  final CSARContent csarContent=this.csarService.findById(csar);
  if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(),servicetemplate)) {
    logger.info("String_Node_Str" + servicetemplate + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + servicetemplate + "String_Node_Str");
  }
  final ServiceTemplateInstance sti=new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null);
  if (sti == null) {
    logger.info("String_Node_Str" + id + "String_Node_Str"+ servicetemplate+ "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str"+ servicetemplate+ "String_Node_Str");
  }
  final List<ResourceDecorator> items=sti.getDeploymentTests().stream().map(v -> {
    final ResourceDecorator decorator=new ResourceDecorator();
    decorator.setObject(v);
    decorator.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePathBuilder().path(String.valueOf(v.getId())).build())).rel("String_Node_Str").build());
    return decorator;
  }
).collect(Collectors.toList());
  final ResourceDecorator response=new ResourceDecorator();
  response.setObject(items);
  response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("String_Node_Str").build());
  return Response.ok(response).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getDeploymentTests(@PathParam("String_Node_Str") final Integer id){
  final CSARContent csarContent=this.csarService.findById(this.csarId);
  if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(),this.serviceTemplateId)) {
    logger.info("String_Node_Str" + this.serviceTemplateId + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + this.serviceTemplateId + "String_Node_Str");
  }
  final ServiceTemplateInstance sti=new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null);
  if (sti == null) {
    logger.info("String_Node_Str" + id + "String_Node_Str"+ this.serviceTemplateId+ "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str"+ this.serviceTemplateId+ "String_Node_Str");
  }
  final List<ResourceDecorator> items=sti.getDeploymentTests().stream().map(v -> {
    final ResourceDecorator decorator=new ResourceDecorator();
    decorator.setObject(v);
    decorator.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePathBuilder().path(String.valueOf(v.getId())).build())).rel("String_Node_Str").build());
    return decorator;
  }
).collect(Collectors.toList());
  final ResourceDecorator response=new ResourceDecorator();
  response.setObject(items);
  response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("String_Node_Str").build());
  return Response.ok(response).build();
}
Program: 41456
Project: 41456
Buggy source:
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getDeploymentTest(@PathParam("String_Node_Str") final String csar,@PathParam("String_Node_Str") final String servicetemplate,@PathParam("String_Node_Str") final Integer id,@PathParam("String_Node_Str") final Integer deploymenttest){
  final CSARContent csarContent=this.csarService.findById(csar);
  if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(),servicetemplate)) {
    logger.info("String_Node_Str" + servicetemplate + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + servicetemplate + "String_Node_Str");
  }
  final ServiceTemplateInstance sti=new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null);
  if (sti == null) {
    logger.info("String_Node_Str" + id + "String_Node_Str"+ servicetemplate+ "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str"+ servicetemplate+ "String_Node_Str");
  }
  final DeploymentTest object=new DeploymentTestRepository().find(Long.valueOf(deploymenttest)).orElse(null);
  if (object == null) {
    throw new NotFoundException();
  }
  final ResourceDecorator response=new ResourceDecorator();
  response.setObject(object);
  response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("String_Node_Str").build());
  return Response.ok(response).build();
}

Fixed version (ground truth):
@GET @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response getDeploymentTest(@PathParam("String_Node_Str") final Integer id,@PathParam("String_Node_Str") final Integer deploymenttest){
  final CSARContent csarContent=this.csarService.findById(this.csarId);
  if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(),this.serviceTemplateId)) {
    logger.info("String_Node_Str" + this.serviceTemplateId + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + this.serviceTemplateId + "String_Node_Str");
  }
  final ServiceTemplateInstance sti=new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null);
  if (sti == null) {
    logger.info("String_Node_Str" + id + "String_Node_Str"+ this.serviceTemplateId+ "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str"+ this.serviceTemplateId+ "String_Node_Str");
  }
  final DeploymentTest object=new DeploymentTestRepository().find(Long.valueOf(deploymenttest)).orElse(null);
  if (object == null) {
    throw new NotFoundException();
  }
  final ResourceDecorator response=new ResourceDecorator();
  response.setObject(object);
  response.add(Link.fromUri(UriUtil.encode(this.uriInfo.getAbsolutePath())).rel("String_Node_Str").build());
  return Response.ok(response).build();
}
Program: 41457
Project: 41457
Buggy source:
@POST @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response createDeploymentTest(@PathParam("String_Node_Str") final String csar,@PathParam("String_Node_Str") final String servicetemplate,@PathParam("String_Node_Str") final Integer id){
  final CSARContent csarContent=this.csarService.findById(csar);
  if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(),servicetemplate)) {
    logger.info("String_Node_Str" + servicetemplate + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + servicetemplate + "String_Node_Str");
  }
  final ServiceTemplateInstance sti=new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null);
  if (sti == null) {
    logger.info("String_Node_Str" + id + "String_Node_Str"+ servicetemplate+ "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str"+ servicetemplate+ "String_Node_Str");
  }
  final DeploymentTest result=this.deploymentTestService.run(csarContent.getCSARID(),sti);
  final URI location=this.uriInfo.getAbsolutePathBuilder().path(String.valueOf(result.getId())).build();
  return Response.created(UriUtil.encode(location)).build();
}

Fixed version (ground truth):
@POST @Path("String_Node_Str") @Produces(MediaType.APPLICATION_JSON) public Response createDeploymentTest(@PathParam("String_Node_Str") final Integer id){
  final CSARContent csarContent=this.csarService.findById(this.csarId);
  if (!this.csarService.hasServiceTemplate(csarContent.getCSARID(),this.serviceTemplateId)) {
    logger.info("String_Node_Str" + this.serviceTemplateId + "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + this.serviceTemplateId + "String_Node_Str");
  }
  final ServiceTemplateInstance sti=new ServiceTemplateInstanceRepository().find(Long.valueOf(id)).orElse(null);
  if (sti == null) {
    logger.info("String_Node_Str" + id + "String_Node_Str"+ this.serviceTemplateId+ "String_Node_Str");
    throw new NotFoundException("String_Node_Str" + id + "String_Node_Str"+ this.serviceTemplateId+ "String_Node_Str");
  }
  final DeploymentTest result=this.deploymentTestService.run(csarContent.getCSARID(),sti);
  final URI location=this.uriInfo.getAbsolutePathBuilder().path(String.valueOf(result.getId())).build();
  return Response.created(UriUtil.encode(location)).build();
}
Program: 41459
Project: 41459
Buggy source:
private boolean isRunning(final BPELPlanContext context,final AbstractNodeTemplate nodeTemplate){
  final Variable state=context.getPropertyVariable(nodeTemplate,"String_Node_Str");
  if (BPELPlanContext.getVariableContent(state,context).equals("String_Node_Str")) {
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean isRunning(final BPELPlanContext context,final AbstractNodeTemplate nodeTemplate){
  final Variable state=context.getPropertyVariable(nodeTemplate,"String_Node_Str");
  if (state != null) {
    if (BPELPlanContext.getVariableContent(state,context).equals("String_Node_Str")) {
      return true;
    }
  }
  return false;
}
Program: 41460
Project: 41460
Buggy source:
/** 
 * Constructor
 * @param nodeTemplate a JAXB TNodeTemplate
 * @param definitions a DefinitionsImpl
 */
public NodeTemplateImpl(final TNodeTemplate nodeTemplate,final DefinitionsImpl definitions){
  this.nodeTemplate=nodeTemplate;
  this.definitions=definitions;
  this.ingoingRelations=new ArrayList<>();
  this.outgoingRelations=new ArrayList<>();
  this.requirements=new ArrayList<>();
  this.capabilities=new ArrayList<>();
  this.das=new ArrayList<>();
  this.policies=new ArrayList<>();
  if (this.nodeTemplate.getProperties() != null) {
    this.properties=new PropertiesImpl(this.nodeTemplate.getProperties().getAny());
  }
  setUpCapabilities();
  setUpRequirements();
  setUpDeploymentArtifacts();
  setUpPolicies();
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param nodeTemplate a JAXB TNodeTemplate
 * @param definitions a DefinitionsImpl
 */
public NodeTemplateImpl(final TNodeTemplate nodeTemplate,final DefinitionsImpl definitions){
  this.nodeTemplate=nodeTemplate;
  this.definitions=definitions;
  this.ingoingRelations=new ArrayList<>();
  this.outgoingRelations=new ArrayList<>();
  this.requirements=new ArrayList<>();
  this.capabilities=new ArrayList<>();
  this.das=new ArrayList<>();
  this.policies=new ArrayList<>();
  if (this.nodeTemplate.getProperties() != null && this.nodeTemplate.getProperties().getAny() != null) {
    this.properties=new PropertiesImpl(this.nodeTemplate.getProperties().getAny());
  }
  setUpCapabilities();
  setUpRequirements();
  setUpDeploymentArtifacts();
  setUpPolicies();
}
Program: 41461
Project: 41461
Buggy source:
/** 
 * Constructor
 * @param properties an Object of class ElementNSImpl
 */
public PropertiesImpl(final Object properties){
  this.props=properties;
  if (properties.getClass().getName().equals("String_Node_Str")) {
    this.isDOM=true;
  }
}

Fixed version (ground truth):
/** 
 * Constructor
 * @param properties an Object of class ElementNSImpl
 */
public PropertiesImpl(final Object properties){
  if (properties == null) {
    throw new RuntimeException("String_Node_Str");
  }
  this.props=properties;
  if (properties.getClass().getName().equals("String_Node_Str")) {
    this.isDOM=true;
  }
}