nus-yam/ex-repair huggingface dataset:
Program: 56315
Project: 56315
Buggy source:
@BeforeMethod public void setup(){
  config=mock(JPAConfig.class);
  entityManager=mock(EntityManager.class);
  emf=mock(EntityManagerFactory.class);
  when(config.getEntityManagerFactory()).thenReturn(emf);
  when(emf.createEntityManager()).thenReturn(entityManager);
  context=new JPAContext(config,false);
}

Fixed version (ground truth):
@BeforeMethod public void setup(){
  config=mock(JPAConfig.class);
  entityManager=mock(EntityManager.class);
  emf=mock(EntityManagerFactory.class);
  emp=new EntityManagerProviderImpl(emf);
  when(config.getEntityManagerProvider()).thenReturn(emp);
  when(emf.createEntityManager()).thenReturn(entityManager);
  context=new JPAContext(config,false);
}
Program: 56316
Project: 56316
Buggy source:
@Test public void shouldClose(){
  jpa.addPersistenceUnit("String_Node_Str");
  jpa.addPersistenceUnit("String_Node_Str");
  jpa.close();
  assertNull(jpa.getConfig("String_Node_Str"));
  assertNull(jpa.getConfig("String_Node_Str"));
  verify(emf,times(2)).close();
}

Fixed version (ground truth):
@Test public void shouldClose(){
  when(emf.isOpen()).thenReturn(true);
  jpa.addPersistenceUnit("String_Node_Str");
  jpa.addPersistenceUnit("String_Node_Str");
  jpa.close();
  assertNull(jpa.getConfig("String_Node_Str"));
  assertNull(jpa.getConfig("String_Node_Str"));
  verify(emf,times(2)).close();
}
Program: 56317
Project: 56317
Buggy source:
private void assertDefaultConfig(JPAConfig config,boolean isDefault){
  assertNotNull(config);
  if (isDefault) {
    assertEquals(config,jpa.getDefaultConfig());
  }
 else {
    assertNotEquals(config,jpa.getDefaultConfig());
  }
  assertEquals(config.getEntityManagerFactory(),emf);
}

Fixed version (ground truth):
private void assertDefaultConfig(JPAConfig config,boolean isDefault){
  assertNotNull(config);
  if (isDefault) {
    assertEquals(config,jpa.getDefaultConfig());
  }
 else {
    assertNotEquals(config,jpa.getDefaultConfig());
  }
  assertEquals(config.getEntityManagerProvider().getEntityManagerFactory(),emf);
}
Program: 56318
Project: 56318
Buggy source:
@BeforeMethod public void setup() throws Exception {
  jpa=spy(JPA.instance);
  emf=mock(EntityManagerFactory.class);
  doReturn(emf).when(jpa).createEntityManagerFactory("String_Node_Str",Collections.<String,String>emptyMap());
  doReturn(emf).when(jpa).createEntityManagerFactory("String_Node_Str",Collections.<String,String>emptyMap());
}

Fixed version (ground truth):
@BeforeMethod public void setup() throws Exception {
  jpa=spy(JPA.instance);
  emf=mock(EntityManagerFactory.class);
  emp=new EntityManagerProviderImpl(emf);
  doReturn(emf).when(jpa).createEntityManagerFactory("String_Node_Str",Collections.<String,String>emptyMap());
  doReturn(emf).when(jpa).createEntityManagerFactory("String_Node_Str",Collections.<String,String>emptyMap());
}
Program: 56319
Project: 56319
Buggy source:
public boolean isTxnOpen(){
  return entityManager != null && entityManager.getTransaction() != null && entityManager.getTransaction().isActive();
}

Fixed version (ground truth):
public boolean isTxnOpen(){
  return entityManager != null && entityManager.isOpen() && entityManager.getTransaction() != null && entityManager.getTransaction().isActive();
}
Program: 56320
Project: 56320
Buggy source:
public void close(){
  try {
    if (entityManager.isOpen()) {
      entityManager.close();
    }
  }
  finally {
    config.clearContext();
  }
}

Fixed version (ground truth):
public void close(){
  try {
    if (entityManager != null && entityManager.isOpen()) {
      entityManager.close();
    }
  }
  finally {
    config.clearContext();
  }
}
Program: 56321
Project: 56321
Buggy source:
private EntityTransaction mockTransaction(JPAContext context,boolean active){
  EntityManager entityManager=context.getEntityManager();
  EntityTransaction txn=mock(EntityTransaction.class);
  when(entityManager.getTransaction()).thenReturn(txn);
  when(txn.isActive()).thenReturn(active);
  return txn;
}

Fixed version (ground truth):
private EntityTransaction mockTransaction(JPAContext context,boolean active){
  EntityManager entityManager=context.getEntityManager();
  EntityTransaction txn=mock(EntityTransaction.class);
  when(entityManager.isOpen()).thenReturn(true);
  when(entityManager.getTransaction()).thenReturn(txn);
  when(txn.isActive()).thenReturn(active);
  return txn;
}
Program: 56322
Project: 56322
Buggy source:
public <T extends Model>void constructQuery(CriteriaBuilder builder,CriteriaQuery<?> query,Root<T> root){
  if (conditions != null || !conditions.isEmpty()) {
    List<Predicate> predicates=new ArrayList<Predicate>();
    for (    Condition condition : conditions) {
      predicates.add(condition.constructQuery(builder,root));
    }
    query.where(predicates.toArray(new Predicate[0]));
  }
}

Fixed version (ground truth):
public <T extends Model>void constructQuery(CriteriaBuilder builder,CriteriaQuery<?> query,Root<T> root){
  if (conditions != null || !conditions.isEmpty()) {
    List<Predicate> predicates=new ArrayList<Predicate>();
    for (    Condition condition : conditions) {
      predicates.add(condition.constructQuery(builder,root));
    }
    query.where(predicates.toArray(new Predicate[0]));
  }
  if (sortFields != null && !sortFields.isEmpty()) {
    List<Order> orders=new ArrayList<Order>();
    for (    SortField sortField : sortFields) {
      orders.add(sortField.getOrder(builder,root));
    }
    query.orderBy(orders);
  }
}
Program: 56323
Project: 56323
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private static void loadMap(Map map,Map attributes,Class<?> elementType) throws Exception {
  for (  Entry entry : (Set<Entry>)attributes.entrySet()) {
    Object value=map.get(entry.getKey());
    if (value == null) {
      value=elementType.newInstance();
    }
    load(value,(Map)entry.getValue());
    map.put(entry.getKey(),value);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private static void loadMap(Map map,Map attributes,Class<?> elementType) throws Exception {
  for (  Entry entry : (Set<Entry>)attributes.entrySet()) {
    if (PropertyUtil.isSimpleValueType(elementType)) {
      map.put(entry.getKey(),ConvertUtil.convert(entry.getValue(),elementType));
    }
 else {
      Object value=map.get(entry.getKey());
      if (value == null) {
        value=elementType.newInstance();
      }
      load(value,(Map)entry.getValue());
      map.put(entry.getKey(),value);
    }
  }
}
Program: 56324
Project: 56324
Buggy source:
@Test public void shouldSetParametersForInQuery(){
  Object value=Arrays.asList("String_Node_Str");
  Condition condition=new Condition("String_Node_Str",Operator.in,value);
  condition.setParameters(query,value);
  verify(query).setParameter("String_Node_Str",value);
}

Fixed version (ground truth):
@Test public void shouldSetParametersForInQuery(){
  Object value=Arrays.asList("String_Node_Str");
  Condition condition=new Condition("String_Node_Str",Operator.in,value);
  condition.setPath(path);
  condition.setParameters(query,value);
  verify(query).setParameter("String_Node_Str",value);
}
Program: 56325
Project: 56325
Buggy source:
@Test public void shouldSetParametersForBetweenQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.between,new Object[]{"String_Node_Str","String_Node_Str"});
  condition.setParameters(query,new String[]{"String_Node_Str","String_Node_Str"});
  verify(query).setParameter("String_Node_Str","String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForBetweenQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.between,new Object[]{"String_Node_Str","String_Node_Str"});
  condition.setPath(path);
  condition.setParameters(query,new String[]{"String_Node_Str","String_Node_Str"});
  verify(query).setParameter("String_Node_Str","String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56326
Project: 56326
Buggy source:
@Test public void shouldSetParametersForLeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.le,"String_Node_Str");
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForLeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.le,"String_Node_Str");
  condition.setPath(path);
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56327
Project: 56327
Buggy source:
@Test public void shouldSetParametersForLtQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.lt,"String_Node_Str");
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForLtQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.lt,"String_Node_Str");
  condition.setPath(path);
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56328
Project: 56328
Buggy source:
@Test public void shouldSetParametersForLikeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.like,"String_Node_Str");
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForLikeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.like,"String_Node_Str");
  condition.setPath(path);
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56329
Project: 56329
Buggy source:
@Test public void shouldSetParametersForEqQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.eq,"String_Node_Str");
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForEqQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.eq,"String_Node_Str");
  condition.setPath(path);
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56330
Project: 56330
Buggy source:
@Test public void shouldSetParametersForGeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.ge,"String_Node_Str");
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForGeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.ge,"String_Node_Str");
  condition.setPath(path);
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56331
Project: 56331
Buggy source:
@Test public void shouldSetParametersForNeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.ne,"String_Node_Str");
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForNeQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.ne,"String_Node_Str");
  condition.setPath(path);
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56332
Project: 56332
Buggy source:
@Test public void shouldSetParametersForGtQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.gt,"String_Node_Str");
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParametersForGtQuery(){
  Condition condition=new Condition("String_Node_Str",Operator.gt,"String_Node_Str");
  condition.setPath(path);
  condition.setParameters(query,"String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56333
Project: 56333
Buggy source:
@Test public void shouldSetParameters(){
  Filter filter=new Filter();
  filter.addCondition("String_Node_Str",Operator.eq,"String_Node_Str");
  filter.addCondition("String_Node_Str",Operator.eq,"String_Node_Str");
  Query query=mock(Query.class);
  Parameter param=mock(Parameter.class);
  when(param.getParameterType()).thenReturn(String.class);
  when(query.getParameter(anyString())).thenReturn(param);
  filter.setParameters(query);
  verify(query).setParameter("String_Node_Str","String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@Test public void shouldSetParameters(){
  Filter filter=new Filter();
  filter.addCondition("String_Node_Str",Operator.eq,"String_Node_Str");
  filter.addCondition("String_Node_Str",Operator.eq,"String_Node_Str");
  Path path=mock(Path.class);
  when(path.getJavaType()).thenReturn(String.class);
  filter.getConditions().get(0).setPath(path);
  filter.getConditions().get(1).setPath(path);
  Query query=mock(Query.class);
  Parameter param=mock(Parameter.class);
  when(param.getParameterType()).thenReturn(String.class);
  when(query.getParameter(anyString())).thenReturn(param);
  filter.setParameters(query);
  verify(query).setParameter("String_Node_Str","String_Node_Str");
  verify(query).setParameter("String_Node_Str","String_Node_Str");
}
Program: 56334
Project: 56334
Buggy source:
@Override public byte[] transform(ClassLoader loader,String className,Class<?> classBeingRedefined,ProtectionDomain protectionDomain,byte[] classfileBuffer) throws IllegalClassFormatException {
  try {
    logger.trace("String_Node_Str" + className);
    if (loader == null) {
      loader=Thread.currentThread().getContextClassLoader();
    }
    return enhancer.enhance(loader,className);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + className,e);
    throw new IllegalClassFormatException(e.getMessage());
  }
}

Fixed version (ground truth):
@Override public byte[] transform(ClassLoader loader,String className,Class<?> classBeingRedefined,ProtectionDomain protectionDomain,byte[] classfileBuffer) throws IllegalClassFormatException {
  if (skipClass(className)) {
    return null;
  }
  try {
    logger.trace("String_Node_Str" + className);
    if (loader == null) {
      loader=Thread.currentThread().getContextClassLoader();
    }
    return enhancer.enhance(loader,className);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str" + className,e);
    throw new IllegalClassFormatException(e.getMessage());
  }
}
Program: 56335
Project: 56335
Buggy source:
@Test public void shouldTransform() throws IllegalClassFormatException {
  ClassLoader loader=mock(ClassLoader.class);
  DomainClassFileTransformer transformer=new DomainClassFileTransformer(enhancer);
  transformer.transform(loader,String.class.getName(),null,null,null);
  verify(enhancer).enhance(loader,String.class.getName());
}

Fixed version (ground truth):
@Test public void shouldTransform() throws IllegalClassFormatException {
  ClassLoader loader=mock(ClassLoader.class);
  DomainClassFileTransformer transformer=new DomainClassFileTransformer(enhancer);
  transformer.transform(loader,DomainClassEnhancer.class.getName(),null,null,null);
  verify(enhancer).enhance(loader,DomainClassEnhancer.class.getName());
}
Program: 56336
Project: 56336
Buggy source:
public T one(Object... paramValues){
  Filter filter=createFilter(paramValues);
  TypedQuery<T> query=createCollectionQuery(filter);
  filter.setParameters(query);
  return query.getSingleResult();
}

Fixed version (ground truth):
public T one(Object... paramValues){
  Filter filter=createFilter(paramValues);
  return createCollectionQuery(filter).getSingleResult();
}
Program: 56337
Project: 56337
Buggy source:
private TypedQuery<T> createCollectionQuery(Filter filter){
  filter.addCondition("String_Node_Str",parent.getId());
  TypedQuery<T> query=createQuery(parent.getClass(),name,elementType,filter);
  filter.setParameters(query);
  return query;
}

Fixed version (ground truth):
private TypedQuery<T> createCollectionQuery(Filter filter){
  filter.addCondition("String_Node_Str",parent.getId());
  TypedQuery<T> query=createQuery(parent.getClass(),name,elementType,filter);
  return query;
}
Program: 56338
Project: 56338
Buggy source:
protected static <T extends Model>long count(final Class<T> clazz,Filter filter){
  CriteriaBuilder builder=getEntityManager().getCriteriaBuilder();
  CriteriaQuery<Long> cQuery=builder.createQuery(Long.class);
  Root<T> root=cQuery.from(clazz);
  cQuery.select(builder.count(root));
  filter.constructQuery(builder,cQuery,root);
  TypedQuery<Long> query=getEntityManager().createQuery(cQuery);
  filter.setParameters(query);
  return query.getSingleResult();
}

Fixed version (ground truth):
protected static <T extends Model>long count(final Class<T> clazz,Filter filter){
  CriteriaBuilder builder=getEntityManager().getCriteriaBuilder();
  CriteriaQuery<Long> cQuery=builder.createQuery(Long.class);
  Root<T> root=cQuery.from(clazz);
  cQuery.select(builder.count(root));
  filter.constructQuery(builder,cQuery,root);
  TypedQuery<Long> query=createQuery(cQuery,filter);
  return query.getSingleResult();
}
Program: 56339
Project: 56339
Buggy source:
private JPA(){
}

Fixed version (ground truth):
private JPA(){
  List<PersistenceProvider> providers=PersistenceProviderResolverHolder.getPersistenceProviderResolver().getPersistenceProviders();
  if (providers != null) {
    String providerClass=providers.get(0).getClass().getCanonicalName();
    if (providerClass.equals(HIBERNATE_PERSISTENCE)) {
      cacheableHint="String_Node_Str";
    }
 else     if (providerClass.equals(ECLIPSE_PERSISTENCE)) {
      cacheableHint="String_Node_Str";
    }
 else     if (providerClass.equals(OPENJPA_PERSISTENCE)) {
      cacheableHint="String_Node_Str";
    }
  }
}
Program: 56340
Project: 56340
Buggy source:
public void close(){
  entityManager.close();
}

Fixed version (ground truth):
public void close(){
  if (entityManager.isOpen()) {
    entityManager.close();
  }
}
Program: 56341
Project: 56341
Buggy source:
@Test public void shouldClose(){
  EntityManager entityManager=context.getEntityManager();
  context.close();
  verify(entityManager).close();
}

Fixed version (ground truth):
@Test public void shouldClose(){
  EntityManager entityManager=context.getEntityManager();
  when(entityManager.isOpen()).thenReturn(true);
  context.close();
  verify(entityManager).close();
}
Program: 56342
Project: 56342
Buggy source:
private String getUrl(Repository repository,Settings settings){
  final String jenkinsUrl=settings.getString(JENKINS_BASE).replaceFirst("String_Node_Str","String_Node_Str");
  final String stashBaseUrl=settings.getString(STASH_BASE);
  String repoUrl=navBuilder.repo(repository).clone("String_Node_Str").buildAbsoluteWithoutUsername();
  if (!Strings.isNullOrEmpty(stashBaseUrl)) {
    repoUrl=repoUrl.replace(applicationProperties.getBaseUrl(),stashBaseUrl.replaceFirst("String_Node_Str","String_Node_Str"));
  }
  return String.format(URL,jenkinsUrl,urlEncode(repoUrl));
}

Fixed version (ground truth):
private String getUrl(Repository repository,Settings settings){
  final String jenkinsUrl=settings.getString(JENKINS_BASE).replaceFirst("String_Node_Str","String_Node_Str");
  final String stashBaseUrl=settings.getString(STASH_BASE);
  String repoUrl=navBuilder.repo(repository).clone("String_Node_Str").buildAbsoluteWithoutUsername();
  if (!Strings.isNullOrEmpty(stashBaseUrl)) {
    repoUrl=repoUrl.replace(applicationProperties.getBaseUrl(),stashBaseUrl.replaceFirst("String_Node_Str","String_Node_Str"));
    if (stashBaseUrl.indexOf("String_Node_Str") == 0) {
      repoUrl=repoUrl.replace("String_Node_Str","String_Node_Str");
    }
  }
  return String.format(URL,jenkinsUrl,urlEncode(repoUrl));
}
Program: 56344
Project: 56344
Buggy source:
private Component getComponent(String name,AbstractProject firstJob,AbstractProject lastJob,boolean showAggregatedPipeline) throws PipelineException {
  Pipeline pipeline=Pipeline.extractPipeline(name,firstJob,lastJob);
  List<Pipeline> pipelines=new ArrayList<Pipeline>();
  if (showAggregatedPipeline) {
    pipelines.add(pipeline.createPipelineAggregated(getOwnerItemGroup(),showAggregatedChanges));
  }
  if (isFullScreenView()) {
    pipelines.addAll(pipeline.createPipelineLatest(noOfPipelines,getOwnerItemGroup(),false));
  }
 else {
    pipelines.addAll(pipeline.createPipelineLatest(noOfPipelines,getOwnerItemGroup(),pagingEnabled));
  }
  return new Component(name,firstJob.getName(),firstJob.getUrl(),firstJob.isParameterized(),pipelines,noOfPipelines,pagingEnabled);
}

Fixed version (ground truth):
private Component getComponent(String name,AbstractProject firstJob,AbstractProject lastJob,boolean showAggregatedPipeline,int componentNumber) throws PipelineException {
  Pipeline pipeline=Pipeline.extractPipeline(name,firstJob,lastJob);
  Component component=new Component(name,firstJob.getName(),firstJob.getUrl(),firstJob.isParameterized(),noOfPipelines,pagingEnabled,componentNumber);
  List<Pipeline> pipelines=new ArrayList<Pipeline>();
  if (showAggregatedPipeline) {
    pipelines.add(pipeline.createPipelineAggregated(getOwnerItemGroup(),showAggregatedChanges));
  }
  if (isFullScreenView()) {
    pipelines.addAll(pipeline.createPipelineLatest(noOfPipelines,getOwnerItemGroup(),false,component));
  }
 else {
    pipelines.addAll(pipeline.createPipelineLatest(noOfPipelines,getOwnerItemGroup(),pagingEnabled,component));
  }
  component.setPipelines(pipelines);
  return component;
}
Program: 56345
Project: 56345
Buggy source:
private boolean isFullScreenView(){
  StaplerRequest req=Stapler.getCurrentRequest();
  return req != null && req.getParameter("String_Node_Str") != null && Boolean.parseBoolean(req.getParameter("String_Node_Str"));
}

Fixed version (ground truth):
public boolean isFullScreenView(){
  StaplerRequest req=Stapler.getCurrentRequest();
  return req == null ? false : req.getParameter("String_Node_Str") == null ? false : Boolean.parseBoolean(req.getParameter("String_Node_Str"));
}
Program: 56346
Project: 56346
Buggy source:
private int getCurrentPage(){
  StaplerRequest req=Stapler.getCurrentRequest();
  if (req == null) {
    return 1;
  }
  int page=req.getParameter("String_Node_Str") == null ? 1 : Integer.parseInt(req.getParameter("String_Node_Str").toString());
  page=Math.max(page,1);
  int component=req.getParameter("String_Node_Str") == null ? 1 : Integer.parseInt(req.getParameter("String_Node_Str").toString());
  if (component != componentNumber) {
    page=1;
  }
  return page;
}

Fixed version (ground truth):
public int getCurrentPage(){
  StaplerRequest req=Stapler.getCurrentRequest();
  int page=req == null ? 1 : req.getParameter("String_Node_Str") == null ? 1 : Integer.parseInt(req.getParameter("String_Node_Str").toString());
  page=Math.max(page,1);
  int component=req == null ? 1 : req.getParameter("String_Node_Str") == null ? 1 : Integer.parseInt(req.getParameter("String_Node_Str").toString());
  if (component != componentNumber) {
    page=1;
  }
  return page;
}
Program: 56347
Project: 56347
Buggy source:
private PipelinePagination getPagination(){
  if (pagingEnabled) {
    return new PipelinePagination(this.getCurrentPage(),pipelines.size(),noOfPipelines,"String_Node_Str" + (this.isFullScreenView() ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ componentNumber+ "String_Node_Str");
  }
  return null;
}

Fixed version (ground truth):
public PipelinePagination getPagination(){
  if (pagingEnabled) {
    return new PipelinePagination(this.getCurrentPage(),totalNoOfPipelines,noOfPipelines,"String_Node_Str" + (this.isFullScreenView() == true ? "String_Node_Str" : "String_Node_Str") + "String_Node_Str"+ componentNumber+ "String_Node_Str");
  }
  return null;
}
Program: 56348
Project: 56348
Buggy source:
@Exported public List<Pipeline> getPipelines(){
  if (pagingEnabled && !isFullScreenView()) {
    int startIndex=((this.getCurrentPage() - 1) * noOfPipelines);
    int retrieveSize=Math.min(pipelines.size() - ((this.getCurrentPage() - 1) * noOfPipelines),noOfPipelines);
    return pipelines.subList(startIndex,startIndex + retrieveSize);
  }
  return pipelines;
}

Fixed version (ground truth):
@Exported public List<Pipeline> getPipelines(){
  return pipelines;
}
Program: 56349
Project: 56349
Buggy source:
public Component(String name,String firstJob,String firstJobUrl,boolean firstJobParameterized,List<Pipeline> pipelines,int noOfPipelines,boolean pagingEnabled){
  super(name);
  this.pipelines=ImmutableList.copyOf(pipelines);
  this.firstJob=firstJob;
  this.firstJobUrl=firstJobUrl;
  this.firstJobParameterized=firstJobParameterized;
  this.noOfPipelines=noOfPipelines;
  this.pagingEnabled=pagingEnabled;
}

Fixed version (ground truth):
public Component(String name,String firstJob,String firstJobUrl,boolean firstJobParameterized,int noOfPipelines,boolean pagingEnabled,int componentNumber){
  super(name);
  this.firstJob=firstJob;
  this.firstJobUrl=firstJobUrl;
  this.firstJobParameterized=firstJobParameterized;
  this.noOfPipelines=noOfPipelines;
  this.pagingEnabled=pagingEnabled;
  this.componentNumber=componentNumber;
}
Program: 56351
Project: 56351
Buggy source:
@Test public void testComponent(){
  Component componentA=new Component("String_Node_Str","String_Node_Str","String_Node_Str",false,new ArrayList<Pipeline>(),3,pagingEnabledTrue);
  componentA.setComponentNumber(1);
  assertNotNull(componentA.getPagingData());
  assertNotNull(componentA.getPipelines());
}

Fixed version (ground truth):
@Test public void testComponent(){
  Component componentA=new Component("String_Node_Str","String_Node_Str","String_Node_Str",false,3,pagingEnabledTrue,1);
  componentA.setPipelines(new ArrayList<Pipeline>());
  assertNotNull(componentA.getPagingData());
  assertNotNull(componentA.getPipelines());
}
Program: 56352
Project: 56352
Buggy source:
@Test public void testComponentNumber(){
  Component componentB=new Component("String_Node_Str","String_Node_Str","String_Node_Str",false,new ArrayList<Pipeline>(),3,pagingEnabledTrue);
  componentB.setComponentNumber(2);
  Component componentA=new Component("String_Node_Str","String_Node_Str","String_Node_Str",false,new ArrayList<Pipeline>(),3,pagingEnabledTrue);
  componentA.setComponentNumber(1);
  List<Component> list=new ArrayList<Component>();
  list.add(componentA);
  list.add(componentB);
  assertEquals(1,list.get(0).getComponentNumber());
  assertEquals(2,list.get(1).getComponentNumber());
}

Fixed version (ground truth):
@Test public void testComponentNumber(){
  Component componentB=new Component("String_Node_Str","String_Node_Str","String_Node_Str",false,3,pagingEnabledTrue,2);
  Component componentA=new Component("String_Node_Str","String_Node_Str","String_Node_Str",false,3,pagingEnabledTrue,1);
  List<Component> list=new ArrayList<Component>();
  list.add(componentA);
  list.add(componentB);
  assertEquals(1,list.get(0).getComponentNumber());
  assertEquals(2,list.get(1).getComponentNumber());
}
Program: 56353
Project: 56353
Buggy source:
static void setVersion(AbstractBuild build,String version){
  PipelineVersionAction action=build.getAction(PipelineVersionAction.class);
  if (action == null) {
    build.addAction(new PipelineVersionAction(version));
  }
 else {
    build.replaceAction(action);
  }
  build.replaceAction(getVersionParameterAction(version));
}

Fixed version (ground truth):
static void setVersion(AbstractBuild build,String version){
  PipelineVersionAction action=build.getAction(PipelineVersionAction.class);
  if (action == null) {
    build.addAction(new PipelineVersionAction(version));
  }
 else {
    build.replaceAction(action);
  }
  build.replaceAction(getVersionParameterAction(build,version));
}
Program: 56354
Project: 56354
Buggy source:
private static ParametersAction getVersionParameterAction(String version){
  ParameterValue value=new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version);
  return new ParametersAction(value);
}

Fixed version (ground truth):
private static ParametersAction getVersionParameterAction(AbstractBuild build,String version){
  ParameterValue value=new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version);
  ParametersAction action=build.getAction(ParametersAction.class);
  if (action != null) {
    List<ParameterValue> parameters=new ArrayList<ParameterValue>(action.getParameters());
    parameters.add(value);
    return new ParametersAction(parameters);
  }
  return new ParametersAction(value);
}
Program: 56355
Project: 56355
Buggy source:
public static void setVersion(AbstractBuild build,String version){
  ParametersAction action=new ParametersAction(new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version));
  build.addAction(action);
}

Fixed version (ground truth):
public static void setVersion(AbstractBuild build,String version){
  ParameterValue value=new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version);
  ParametersAction action=build.getAction(ParametersAction.class);
  if (action == null) {
    action=new ParametersAction(value);
    build.addAction(action);
  }
 else {
    List<ParameterValue> parameters=new ArrayList<ParameterValue>(action.getParameters());
    parameters.add(value);
    action=new ParametersAction(parameters);
    build.replaceAction(action);
  }
}
Program: 56356
Project: 56356
Buggy source:
@Test public void testTriggerNewParameterizedPipeline() throws Exception {
  FreeStyleProject start=jenkins.createFreeStyleProject("String_Node_Str");
  start.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("String_Node_Str","String_Node_Str")));
  jenkins.createFreeStyleProject("String_Node_Str");
  start.getPublishersList().add(new BuildTrigger("String_Node_Str",true));
  jenkins.getInstance().rebuildDependencyGraph();
  DeliveryPipelineView view=new DeliveryPipelineView("String_Node_Str");
  List<DeliveryPipelineView.ComponentSpec> specs=new ArrayList<DeliveryPipelineView.ComponentSpec>();
  specs.add(new DeliveryPipelineView.ComponentSpec("String_Node_Str","String_Node_Str"));
  view.setComponentSpecs(specs);
  view.setAllowPipelineStart(true);
  jenkins.getInstance().addView(view);
  DeliveryPipelinePage page=new DeliveryPipelinePage(webDriver,jenkins.getURL().toExternalForm(),"String_Node_Str");
  page.open();
  page.triggerNewParameterizedPipelineBuild("String_Node_Str");
  jenkins.waitUntilNoActivity();
  assertNotNull(start.getLastBuild());
}

Fixed version (ground truth):
@Test public void testTriggerNewParameterizedPipeline() throws Exception {
  FreeStyleProject start=jenkins.createFreeStyleProject("String_Node_Str");
  start.addProperty(new ParametersDefinitionProperty(new StringParameterDefinition("String_Node_Str","String_Node_Str")));
  jenkins.createFreeStyleProject("String_Node_Str");
  start.getPublishersList().add(new BuildTrigger("String_Node_Str",true));
  jenkins.getInstance().rebuildDependencyGraph();
  DeliveryPipelineView view=new DeliveryPipelineView("String_Node_Str");
  List<DeliveryPipelineView.ComponentSpec> specs=new ArrayList<DeliveryPipelineView.ComponentSpec>();
  specs.add(new DeliveryPipelineView.ComponentSpec("String_Node_Str","String_Node_Str",null));
  view.setComponentSpecs(specs);
  view.setAllowPipelineStart(true);
  jenkins.getInstance().addView(view);
  DeliveryPipelinePage page=new DeliveryPipelinePage(webDriver,jenkins.getURL().toExternalForm(),"String_Node_Str");
  page.open();
  page.triggerNewParameterizedPipelineBuild("String_Node_Str");
  jenkins.waitUntilNoActivity();
  assertNotNull(start.getLastBuild());
}
Program: 56357
Project: 56357
Buggy source:
public static void setVersion(AbstractBuild build,String version){
  ParametersAction action=new ParametersAction(new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version));
  build.addAction(action);
}

Fixed version (ground truth):
public static void setVersion(AbstractBuild build,String version){
  ParameterValue value=new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version);
  ParametersAction action=build.getAction(ParametersAction.class);
  if (action == null) {
    action=new ParametersAction(value);
    build.addAction(action);
  }
 else {
    List<ParameterValue> parameters=new ArrayList<ParameterValue>(action.getParameters());
    parameters.add(value);
    action=new ParametersAction(parameters);
    build.replaceAction(action);
  }
}
Program: 56358
Project: 56358
Buggy source:
public static void setVersion(AbstractBuild build,String version){
  ParametersAction action=new ParametersAction(new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version));
  build.addAction(action);
}

Fixed version (ground truth):
public static void setVersion(AbstractBuild build,String version){
  ParameterValue value=new StringParameterValue(PipelineVersionContributor.VERSION_PARAMETER,version);
  ParametersAction action=build.getAction(ParametersAction.class);
  if (action == null) {
    action=new ParametersAction(value);
    build.addAction(action);
  }
 else {
    List<ParameterValue> parameters=new ArrayList<ParameterValue>(action.getParameters());
    parameters.add(value);
    action=new ParametersAction(parameters);
    build.replaceAction(action);
  }
}
Program: 56359
Project: 56359
Buggy source:
/** 
 * Get all downstream projects for a given project. This will recursively call all downstream projects for a given first project. A project that has a downstream project and will eventually loop back to itself will log a warning, and will NOT add. Adding a project that already exists will produce a stack overflow.
 * @param first The first project
 * @param projects Current map of all sub projects.
 * @return A map of all downstream projects.
 */
public static Map<String,AbstractProject<?,?>> getAllDownstreamProjects(AbstractProject first,Map<String,AbstractProject<?,?>> projects){
  if (first == null) {
    return projects;
  }
  if (projects.containsValue(first)) {
    LOG.warning("String_Node_Str" + first.getFullDisplayName() + "String_Node_Str");
    return projects;
  }
  projects.put(first.getName(),first);
  for (  AbstractProject p : getDownstreamProjects(first)) {
    projects.putAll(getAllDownstreamProjects(p,projects));
  }
  return projects;
}

Fixed version (ground truth):
/** 
 * Get all downstream projects for a given project. This will recursively call all downstream projects for a given first project. A project that has a downstream project and will eventually loop back to itself will log a warning, and will NOT add. Adding a project that already exists will produce a stack overflow.
 * @param first The first project
 * @param projects Current map of all sub projects.
 * @return A map of all downstream projects.
 */
public static Map<String,AbstractProject<?,?>> getAllDownstreamProjects(AbstractProject first,Map<String,AbstractProject<?,?>> projects){
  if (first == null) {
    return projects;
  }
  if (projects.containsValue(first)) {
    LOG.warning("String_Node_Str" + first.getFullDisplayName() + "String_Node_Str");
    return projects;
  }
  projects.put(first.getFullName(),first);
  for (  AbstractProject p : getDownstreamProjects(first)) {
    projects.putAll(getAllDownstreamProjects(p,projects));
  }
  return projects;
}
Program: 56360
Project: 56360
Buggy source:
public static Map<String,AbstractProject> getProjects(String regExp){
  try {
    Pattern pattern=Pattern.compile(regExp);
    Map<String,AbstractProject> result=new HashMap<String,AbstractProject>();
    for (    AbstractProject<?,?> project : Jenkins.getInstance().getAllItems(AbstractProject.class)) {
      Matcher matcher=pattern.matcher(project.getName());
      if (matcher.find()) {
        if (matcher.groupCount() >= 1) {
          String name=matcher.group(1);
          result.put(name,project);
        }
 else {
          LOG.log(Level.WARNING,"String_Node_Str");
        }
      }
    }
    return result;
  }
 catch (  PatternSyntaxException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
    return Collections.emptyMap();
  }
}

Fixed version (ground truth):
public static Map<String,AbstractProject> getProjects(String regExp){
  try {
    Pattern pattern=Pattern.compile(regExp);
    Map<String,AbstractProject> result=new HashMap<String,AbstractProject>();
    for (    AbstractProject<?,?> project : Jenkins.getInstance().getAllItems(AbstractProject.class)) {
      Matcher matcher=pattern.matcher(project.getFullName());
      if (matcher.find()) {
        if (matcher.groupCount() >= 1) {
          String name=matcher.group(1);
          result.put(name,project);
        }
 else {
          LOG.log(Level.WARNING,"String_Node_Str");
        }
      }
    }
    return result;
  }
 catch (  PatternSyntaxException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
    return Collections.emptyMap();
  }
}
Program: 56361
Project: 56361
Buggy source:
@Override public void triggerManual(AbstractProject<?,?> project,AbstractProject<?,?> upstream,String buildId,ItemGroup<? extends TopLevelItem> itemGroup) throws TriggerException {
  MyView view=new MyView(itemGroup);
  if (upstream != null && upstream.getBuild(buildId) != null) {
    try {
      view.triggerManualBuild(Integer.parseInt(buildId),project.getName(),upstream.getName());
    }
 catch (    Exception e) {
      throw new TriggerException("String_Node_Str",e);
    }
  }
 else {
    throw new TriggerException("String_Node_Str" + buildId + "String_Node_Str"+ upstream);
  }
}

Fixed version (ground truth):
@Override public void triggerManual(AbstractProject<?,?> project,AbstractProject<?,?> upstream,String buildId,ItemGroup<? extends TopLevelItem> itemGroup) throws TriggerException {
  MyView view=new MyView(itemGroup);
  if (upstream != null && upstream.getBuild(buildId) != null) {
    try {
      view.triggerManualBuild(Integer.parseInt(buildId),project.getRelativeNameFrom(itemGroup),upstream.getRelativeNameFrom(itemGroup));
    }
 catch (    Exception e) {
      throw new TriggerException("String_Node_Str",e);
    }
  }
 else {
    throw new TriggerException("String_Node_Str" + buildId + "String_Node_Str"+ upstream);
  }
}
Program: 56362
Project: 56362
Buggy source:
public static AbstractBuild getUpstreamBuild(AbstractBuild build){
  List<CauseAction> actions=build.getActions(CauseAction.class);
  for (  CauseAction action : actions) {
    List<Cause> causes=action.getCauses();
    for (    Cause cause : causes) {
      if (cause instanceof Cause.UpstreamCause) {
        Cause.UpstreamCause upstreamCause=(Cause.UpstreamCause)cause;
        AbstractProject upstreamProject=(AbstractProject)Jenkins.getInstance().getItemMap().get(upstreamCause.getUpstreamProject());
        if (upstreamProject == null) {
          return null;
        }
        return upstreamProject.getBuildByNumber(upstreamCause.getUpstreamBuild());
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static AbstractBuild getUpstreamBuild(AbstractBuild build){
  List<CauseAction> actions=build.getActions(CauseAction.class);
  for (  CauseAction action : actions) {
    List<Cause> causes=action.getCauses();
    for (    Cause cause : causes) {
      if (cause instanceof Cause.UpstreamCause) {
        Cause.UpstreamCause upstreamCause=(Cause.UpstreamCause)cause;
        AbstractProject upstreamProject=ProjectUtil.getProject(upstreamCause.getUpstreamProject());
        if (upstreamProject == null) {
          return null;
        }
        return upstreamProject.getBuildByNumber(upstreamCause.getUpstreamBuild());
      }
    }
  }
  return null;
}
Program: 56363
Project: 56363
Buggy source:
public static AbstractProject<?,?> getProject(String name,ItemGroup context){
  return Jenkins.getInstance().getItem(name,context,AbstractProject.class);
}

Fixed version (ground truth):
public static AbstractProject getProject(String name){
  Map<String,TopLevelItem> items=Jenkins.getInstance().getItemMap();
  if (items.containsKey(name)) {
    return (AbstractProject)items.get(name);
  }
 else {
    List<ItemGroup> groups=Util.createSubList(items.values(),ItemGroup.class);
    for (int i=0; i < groups.size(); i++) {
      ItemGroup group=groups.get(i);
      AbstractProject project=find(group,name);
      if (project != null) {
        return project;
      }
    }
  }
  return null;
}
Program: 56364
Project: 56364
Buggy source:
@Override protected void submit(StaplerRequest req) throws IOException, ServletException, Descriptor.FormException {
  req.bindJSON(this,req.getSubmittedForm());
}

Fixed version (ground truth):
@Override protected void submit(StaplerRequest req) throws IOException, ServletException, Descriptor.FormException {
  req.bindJSON(this,req.getSubmittedForm());
  componentSpecs=req.bindJSONToList(ComponentSpec.class,req.getSubmittedForm().get("String_Node_Str"));
  regexpFirstJobs=req.bindJSONToList(RegExpSpec.class,req.getSubmittedForm().get("String_Node_Str"));
}
Program: 56365
Project: 56365
Buggy source:
@Override public int compare(Component o1,Component o2){
  return Long.valueOf(getLastActivity(o1)).compareTo(Long.valueOf(getLastActivity(o2)));
}

Fixed version (ground truth):
@Override public int compare(Component o1,Component o2){
  return Long.valueOf(getLastActivity(o2)).compareTo(getLastActivity(o1));
}
Program: 56366
Project: 56366
Buggy source:
/** 
 * Returns the build for a projects that has been triggered by the supplied upstream project.
 */
private static AbstractBuild match(RunList runList,AbstractBuild firstBuild){
  if (firstBuild != null) {
    for (    Object aRunList : runList) {
      AbstractBuild currentBuild=(AbstractBuild)aRunList;
      if (firstBuild.equals(getFirstUpstreamBuild(currentBuild))) {
        return currentBuild;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Returns the build for a projects that has been triggered by the supplied upstream project.
 */
private static AbstractBuild match(RunList<? extends AbstractBuild> runList,AbstractBuild firstBuild){
  if (firstBuild != null) {
    for (    AbstractBuild currentBuild : runList) {
      if (firstBuild.equals(getFirstUpstreamBuild(currentBuild,firstBuild.getProject()))) {
        return currentBuild;
      }
    }
  }
  return null;
}
Program: 56367
Project: 56367
Buggy source:
private static AbstractBuild getFirstUpstreamBuild(AbstractProject<?,?> project,AbstractProject<?,?> first){
  RunList<? extends AbstractBuild> builds=project.getBuilds();
  for (  AbstractBuild build : builds) {
    AbstractBuild upstream=getFirstUpstreamBuild(build);
    if (upstream != null && upstream.getProject().equals(first)) {
      return upstream;
    }
  }
  return null;
}

Fixed version (ground truth):
private static AbstractBuild getFirstUpstreamBuild(AbstractProject<?,?> project,AbstractProject<?,?> first){
  RunList<? extends AbstractBuild> builds=project.getBuilds();
  for (  AbstractBuild build : builds) {
    AbstractBuild upstream=getFirstUpstreamBuild(build,first);
    if (upstream != null && upstream.getProject().equals(first)) {
      return upstream;
    }
  }
  return null;
}
Program: 56368
Project: 56368
Buggy source:
/** 
 * Populates and return pipelines for the supplied pipeline prototype with the current status.
 * @param pipeline      the pipeline prototype
 * @param noOfPipelines number of pipeline instances
 */
public static List<Pipeline> createPipelineLatest(Pipeline pipeline,int noOfPipelines){
  Task firstTask=pipeline.getStages().get(0).getTasks().get(0);
  AbstractProject firstProject=getProject(firstTask);
  List<Pipeline> result=new ArrayList<Pipeline>();
  Iterator it=firstProject.getBuilds().iterator();
  for (int i=0; i < noOfPipelines && it.hasNext(); i++) {
    AbstractBuild firstBuild=(AbstractBuild)it.next();
    List<Change> changes=getChanges(firstBuild);
    String timestamp=PipelineUtils.formatTimestamp(firstBuild.getTimeInMillis());
    List<Stage> stages=new ArrayList<Stage>();
    for (    Stage stage : pipeline.getStages()) {
      List<Task> tasks=new ArrayList<Task>();
      for (      Task task : stage.getTasks()) {
        AbstractProject taskProject=getProject(task);
        AbstractBuild currentBuild=match(taskProject.getBuilds(),firstBuild);
        tasks.add(getTask(task,currentBuild));
      }
      stages.add(new Stage(stage.getName(),tasks));
    }
    result.add(new Pipeline(pipeline.getName(),firstBuild.getDisplayName(),changes,timestamp,getTriggeredBy(firstBuild),stages,false));
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Populates and return pipelines for the supplied pipeline prototype with the current status.
 * @param pipeline      the pipeline prototype
 * @param noOfPipelines number of pipeline instances
 */
public static List<Pipeline> createPipelineLatest(Pipeline pipeline,int noOfPipelines){
  Task firstTask=pipeline.getStages().get(0).getTasks().get(0);
  AbstractProject firstProject=getProject(firstTask);
  List<Pipeline> result=new ArrayList<Pipeline>();
  Iterator it=firstProject.getBuilds().iterator();
  for (int i=0; i < noOfPipelines && it.hasNext(); i++) {
    AbstractBuild firstBuild=(AbstractBuild)it.next();
    List<Change> changes=getChanges(firstBuild);
    String timestamp=PipelineUtils.formatTimestamp(firstBuild.getTimeInMillis());
    List<Stage> stages=new ArrayList<Stage>();
    for (    Stage stage : pipeline.getStages()) {
      List<Task> tasks=new ArrayList<Task>();
      for (      Task task : stage.getTasks()) {
        AbstractProject<?,?> taskProject=getProject(task);
        AbstractBuild currentBuild=match(taskProject.getBuilds(),firstBuild);
        tasks.add(getTask(task,currentBuild));
      }
      stages.add(new Stage(stage.getName(),tasks));
    }
    result.add(new Pipeline(pipeline.getName(),firstBuild.getDisplayName(),changes,timestamp,getTriggeredBy(firstBuild),stages,false));
  }
  return result;
}
Program: 56369
Project: 56369
Buggy source:
private static List<Change> getChanges(AbstractBuild<?,?> build){
  RepositoryBrowser repositoryBrowser=build.getProject().getScm().getBrowser();
  List<Change> result=new ArrayList<Change>();
  for (  ChangeLogSet.Entry entry : build.getChangeSet()) {
    UserInfo user=getUser(entry.getAuthor());
    String changeLink=null;
    if (repositoryBrowser != null) {
      try {
        URL link=repositoryBrowser.getChangeSetLink(entry);
        if (link != null) {
          changeLink=link.toExternalForm();
        }
      }
 catch (      IOException e) {
      }
    }
    result.add(new Change(user,entry.getMsg(),entry.getCommitId(),changeLink));
  }
  return result;
}

Fixed version (ground truth):
protected static List<Change> getChanges(AbstractBuild<?,?> build){
  RepositoryBrowser repositoryBrowser=build.getProject().getScm().getBrowser();
  List<Change> result=new ArrayList<Change>();
  for (  ChangeLogSet.Entry entry : build.getChangeSet()) {
    UserInfo user=getUser(entry.getAuthor());
    String changeLink=null;
    if (repositoryBrowser != null) {
      try {
        URL link=repositoryBrowser.getChangeSetLink(entry);
        if (link != null) {
          changeLink=link.toExternalForm();
        }
      }
 catch (      IOException e) {
      }
    }
    result.add(new Change(user,entry.getMsg(),entry.getCommitId(),changeLink));
  }
  return result;
}