nus-yam/ex-repair huggingface dataset:
Program: 20628
Project: 20628
Buggy source:
@Override public void dispatchDraw(Canvas canvas){
  super.dispatchDraw(canvas);
  if (gesturePath != null) {
    canvas.drawPath(gesturePath,paint);
  }
  if (gesturesContainer[0] != -1)   canvas.drawLine(lastPathX,lastPathY,lastX,lastY,paint);
}

Fixed version (ground truth):
@Override public void dispatchDraw(Canvas canvas){
  if (gesturePath != null) {
    canvas.drawPath(gesturePath,paint);
  }
  if (gesturesContainer[0] != -1)   canvas.drawLine(lastPathX,lastPathY,lastX,lastY,paint);
  super.dispatchDraw(canvas);
}
Program: 20629
Project: 20629
Buggy source:
public GestureLockView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  paint=new Paint(Paint.ANTI_ALIAS_FLAG);
}

Fixed version (ground truth):
public GestureLockView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
}
Program: 20630
Project: 20630
Buggy source:
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  super.onSizeChanged(w,h,oldw,oldh);
  width=w;
  height=h;
  centerX=width / 2;
  centerY=height / 2;
  radius=width > height ? height : width;
  radius/=2;
  if (arrow == null) {
    arrowDistance=(int)(radius * arrowDistanceRate);
    arrow=getArrowShape(centerX,centerY);
    if (arrow != null)     arrow.offset(0,-arrowDistance);
  }
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  mWidth=w;
  mHeight=h;
  mCenterX=mWidth / 2;
  mCenterY=mHeight / 2;
}
Program: 20631
Project: 20631
Buggy source:
@Override public void onDraw(Canvas canvas){
  doDraw(mState,canvas);
  if (errorArrow != -1 && arrow != null) {
    paint.setStyle(Paint.Style.FILL);
    paint.setColor(0xFFFF0000);
    canvas.save();
    canvas.rotate(errorArrow,centerX,centerY);
    canvas.drawPath(arrow,paint);
    canvas.restore();
  }
}

Fixed version (ground truth):
@Override public void onDraw(Canvas canvas){
  doDraw(mState,canvas);
  if (errorArrow != -1) {
    canvas.save();
    canvas.rotate(errorArrow,mCenterX,mCenterY);
    doArrowDraw(canvas);
    canvas.restore();
  }
}
Program: 20632
Project: 20632
Buggy source:
public NexusStyleLockView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
}

Fixed version (ground truth):
public NexusStyleLockView(Context context,AttributeSet attrs,int defStyle){
  super(context,attrs,defStyle);
  arrow=new Path();
}
Program: 20633
Project: 20633
Buggy source:
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  super.onSizeChanged(w,h,oldw,oldh);
  mWidth=w;
  mHeight=h;
  mCenterX=w / 2;
  mCenterY=h / 2;
  mRadius=w > h ? h : w;
  mRadius/=2;
}

Fixed version (ground truth):
@Override protected void onSizeChanged(int w,int h,int oldw,int oldh){
  super.onSizeChanged(w,h,oldw,oldh);
  mWidth=w;
  mHeight=h;
  mCenterX=w / 2;
  mCenterY=h / 2;
  mRadius=w > h ? h : w;
  mRadius/=2;
  arrowDistance=(int)(mRadius * arrowDistanceRate);
  int length=(int)(mRadius * arrowRate);
  arrow.reset();
  arrow.moveTo(mCenterX - length,mCenterY + length - arrowDistance);
  arrow.lineTo(mCenterX,mCenterY - arrowDistance);
  arrow.lineTo(mCenterX + length,mCenterY + length - arrowDistance);
  arrow.close();
}
Program: 20634
Project: 20634
Buggy source:
protected void doDraw(LockerState state,Canvas canvas){
switch (state) {
case LOCKER_STATE_NORMAL:
    mPaint.setStyle(Paint.Style.FILL);
  mPaint.setColor(COLOR_NORMAL);
canvas.drawCircle(mCenterX,mCenterY,mRadius * innerRate,mPaint);
break;
case LOCKER_STATE_SELECTED:
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(COLOR_NORMAL);
mPaint.setStrokeWidth(mRadius * outerWidthRate);
canvas.drawCircle(mCenterX,mCenterY,mRadius * outerRate,mPaint);
mPaint.setStrokeWidth(2);
canvas.drawCircle(mCenterX,mCenterY,mRadius * innerRate,mPaint);
break;
case LOCKER_STATE_ERROR:
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(COLOR_ERROR);
mPaint.setStrokeWidth(mRadius * outerWidthRate);
canvas.drawCircle(mCenterX,mCenterY,mRadius * outerRate,mPaint);
mPaint.setStrokeWidth(2);
canvas.drawCircle(mCenterX,mCenterY,mRadius * innerRate,mPaint);
break;
}
}

Fixed version (ground truth):
@Override protected void doDraw(LockerState state,Canvas canvas){
switch (state) {
case LOCKER_STATE_NORMAL:
    mPaint.setStyle(Paint.Style.FILL);
  mPaint.setColor(COLOR_NORMAL);
canvas.drawCircle(mCenterX,mCenterY,mRadius * innerRate,mPaint);
break;
case LOCKER_STATE_SELECTED:
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(COLOR_NORMAL);
mPaint.setStrokeWidth(mRadius * outerWidthRate);
canvas.drawCircle(mCenterX,mCenterY,mRadius * outerRate,mPaint);
mPaint.setStrokeWidth(2);
canvas.drawCircle(mCenterX,mCenterY,mRadius * innerRate,mPaint);
break;
case LOCKER_STATE_ERROR:
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setColor(COLOR_ERROR);
mPaint.setStrokeWidth(mRadius * outerWidthRate);
canvas.drawCircle(mCenterX,mCenterY,mRadius * outerRate,mPaint);
mPaint.setStrokeWidth(2);
canvas.drawCircle(mCenterX,mCenterY,mRadius * innerRate,mPaint);
break;
}
}
Program: 20636
Project: 20636
Buggy source:
@Override public ManagedRepository createManagedInstance(ManagedRepositoryConfiguration cfg){
}

Fixed version (ground truth):
@Override public ManagedRepository createManagedInstance(ManagedRepositoryConfiguration cfg){
  MavenManagedRepository repo=new MavenManagedRepository(cfg.getId(),cfg.getName());
  try {
    if (cfg.getLocation().startsWith("String_Node_Str")) {
      repo.setLocation(new URI(cfg.getLocation()));
    }
 else {
      repo.setLocation(new URI("String_Node_Str" + cfg.getLocation()));
    }
  }
 catch (  URISyntaxException e) {
    log.error("String_Node_Str" + cfg.getLocation());
  }
  cfg.getRefreshCronExpression();
  StagingRepositoryFeature feature=repo.getFeature(StagingRepositoryFeature.class).get();
  return null;
}
Program: 20637
Project: 20637
Buggy source:
@Override public RepositorySession createSession(){
  try {
    MetadataRepository metadataRepository=new JcrMetadataRepository(metadataFacetFactories,repository);
    return new RepositorySession(metadataRepository,metadataResolver);
  }
 catch (  RepositoryException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public RepositorySession createSession(){
  try {
    MetadataRepository metadataRepository=new JcrMetadataRepository(metadataFacetFactories,repository);
    return new RepositorySession(metadataRepository,getMetadataResolver());
  }
 catch (  RepositoryException e) {
    throw new RuntimeException(e);
  }
}
Program: 20638
Project: 20638
Buggy source:
@Test public void testHome(){
  getWebDriver().get(baseUrl);
  WebDriverWait wait=new WebDriverWait(getWebDriver(),30);
  wait.until(ExpectedConditions.titleContains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testHome(){
  loadPage(baseUrl,30);
  WebDriverWait wait=new WebDriverWait(getWebDriver(),30);
  wait.until(ExpectedConditions.titleContains("String_Node_Str"));
}
Program: 20639
Project: 20639
Buggy source:
public void goToHomePage(){
  getWebDriver().get(baseUrl);
}

Fixed version (ground truth):
public void goToHomePage(){
  loadPage(baseUrl,30);
}
Program: 20641
Project: 20641
Buggy source:
public void goToLoginPage(){
  logger.info("String_Node_Str");
  getWebDriver().get(baseUrl);
  WebDriverWait wait=new WebDriverWait(getWebDriver(),30);
  wait.until(ExpectedConditions.presenceOfElementLocated(By.id("String_Node_Str")));
  wait.until(ExpectedConditions.or(ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str")),ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str"))));
  if (isElementVisible("String_Node_Str")) {
    logger.info("String_Node_Str");
    clickLinkWithLocator("String_Node_Str",false);
  }
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str")));
  clickLinkWithLocator("String_Node_Str",false);
  if (getWebDriver() instanceof HtmlUnitDriver) {
    ((JavascriptExecutor)getWebDriver()).executeScript("String_Node_Str");
  }
  wait=new WebDriverWait(getWebDriver(),20);
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str")));
  assertLoginModal();
}

Fixed version (ground truth):
public void goToLoginPage(){
  logger.info("String_Node_Str");
  loadPage(baseUrl,30);
  WebDriverWait wait=new WebDriverWait(getWebDriver(),30);
  wait.until(ExpectedConditions.presenceOfElementLocated(By.id("String_Node_Str")));
  wait.until(ExpectedConditions.or(ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str")),ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str"))));
  if (isElementVisible("String_Node_Str")) {
    logger.info("String_Node_Str");
    clickLinkWithLocator("String_Node_Str",false);
  }
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str")));
  clickLinkWithLocator("String_Node_Str",false);
  if (getWebDriver() instanceof HtmlUnitDriver) {
    ((JavascriptExecutor)getWebDriver()).executeScript("String_Node_Str");
  }
  wait=new WebDriverWait(getWebDriver(),20);
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("String_Node_Str")));
  assertLoginModal();
}
Program: 20642
Project: 20642
Buggy source:
@Test public void testReadRolesAndUpdateDescription() throws Exception {
  login(getAdminUsername(),getAdminPassword());
  clickLinkWithLocator("String_Node_Str");
  WebDriverWait wait=new WebDriverWait(getWebDriver(),10);
  wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("String_Node_Str"),"String_Node_Str"));
  Assert.assertTrue(StringUtils.isEmpty(getText("String_Node_Str")));
  clickLinkWithLocator("String_Node_Str");
  wait.until(ExpectedConditions.elementToBeClickable(By.id("String_Node_Str")));
  String desc="String_Node_Str";
  setFieldValue("String_Node_Str",desc);
  clickButtonWithLocator("String_Node_Str");
  wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("String_Node_Str"),"String_Node_Str"));
  clickLinkWithLocator("String_Node_Str");
  wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("String_Node_Str"),desc));
}

Fixed version (ground truth):
@Test public void testReadRolesAndUpdateDescription() throws Exception {
  login(getAdminUsername(),getAdminPassword());
  WebDriverWait wait=new WebDriverWait(getWebDriver(),10);
  WebElement link=wait.until(ExpectedConditions.elementToBeClickable(By.id("String_Node_Str")));
  tryClick(link,ExpectedConditions.textToBePresentInElementLocated(By.id("String_Node_Str"),"String_Node_Str"),"String_Node_Str");
  Assert.assertTrue(StringUtils.isEmpty(getText("String_Node_Str")));
  clickLinkWithLocator("String_Node_Str");
  wait.until(ExpectedConditions.elementToBeClickable(By.id("String_Node_Str")));
  String desc="String_Node_Str";
  setFieldValue("String_Node_Str",desc);
  clickButtonWithLocator("String_Node_Str");
  wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("String_Node_Str"),"String_Node_Str"));
  clickLinkWithLocator("String_Node_Str");
  wait.until(ExpectedConditions.textToBePresentInElementLocated(By.id("String_Node_Str"),desc));
}
Program: 20644
Project: 20644
Buggy source:
/** 
 * <p> Given a checksum file, check to see if the file it represents is valid according to the checksum. </p> <p/> <p> NOTE: Only supports single file checksums of type MD5 or SHA1. </p>
 * @param algorithm the algorithms to check for.
 * @return true if the checksum is valid for the file it represents. or if the checksum file does not exist.
 * @throws IOException if the reading of the checksumFile or the file it refers to fails.
 */
public boolean isValidChecksum(ChecksumAlgorithm algorithm) throws IOException {
  return isValidChecksums(new ChecksumAlgorithm[]{algorithm});
}

Fixed version (ground truth):
/** 
 * <p> Given a checksum file, check to see if the file it represents is valid according to the checksum. </p> <p> NOTE: Only supports single file checksums of type MD5 or SHA1. </p>
 * @param algorithm the algorithms to check for.
 * @return true if the checksum is valid for the file it represents. or if the checksum file does not exist.
 * @throws IOException if the reading of the checksumFile or the file it refers to fails.
 */
public boolean isValidChecksum(ChecksumAlgorithm algorithm) throws IOException {
  return isValidChecksums(new ChecksumAlgorithm[]{algorithm});
}
Program: 20645
Project: 20645
Buggy source:
/** 
 * Get the list of patterns for a specified filetype. <p/> <p/> You will always get a list.  In this order. <ul> <li>The Configured List</li> <li>The Default List</li> <li>A single item list of <code>&quot;**&#47;*&quot;</code></li> </ul>
 * @param id the id to lookup.
 * @return the list of patterns.
 */
public List<String> getFileTypePatterns(String id){
  Configuration config=archivaConfiguration.getConfiguration();
  Predicate selectedFiletype=new FiletypeSelectionPredicate(id);
  RepositoryScanningConfiguration repositoryScanningConfiguration=config.getRepositoryScanning();
  if (repositoryScanningConfiguration != null) {
    FileType filetype=(FileType)CollectionUtils.find(config.getRepositoryScanning().getFileTypes(),selectedFiletype);
    if ((filetype != null) && CollectionUtils.isNotEmpty(filetype.getPatterns())) {
      return filetype.getPatterns();
    }
  }
  List<String> defaultPatterns=defaultTypeMap.get(id);
  if (CollectionUtils.isEmpty(defaultPatterns)) {
    return Collections.singletonList("String_Node_Str");
  }
  return defaultPatterns;
}

Fixed version (ground truth):
/** 
 * Get the list of patterns for a specified filetype. You will always get a list.  In this order. <ul> <li>The Configured List</li> <li>The Default List</li> <li>A single item list of <code>&quot;**&#47;*&quot;</code></li> </ul>
 * @param id the id to lookup.
 * @return the list of patterns.
 */
public List<String> getFileTypePatterns(String id){
  Configuration config=archivaConfiguration.getConfiguration();
  Predicate selectedFiletype=new FiletypeSelectionPredicate(id);
  RepositoryScanningConfiguration repositoryScanningConfiguration=config.getRepositoryScanning();
  if (repositoryScanningConfiguration != null) {
    FileType filetype=(FileType)CollectionUtils.find(config.getRepositoryScanning().getFileTypes(),selectedFiletype);
    if ((filetype != null) && CollectionUtils.isNotEmpty(filetype.getPatterns())) {
      return filetype.getPatterns();
    }
  }
  List<String> defaultPatterns=defaultTypeMap.get(id);
  if (CollectionUtils.isEmpty(defaultPatterns)) {
    return Collections.singletonList("String_Node_Str");
  }
  return defaultPatterns;
}
Program: 20646
Project: 20646
Buggy source:
private void init(String type,URL url) throws XMLException {
  this.documentType=type;
  this.xmlUrl=url;
  SAXReader reader=new SAXReader();
  try (InputStream in=url.openStream()){
    InputStreamReader inReader=new InputStreamReader(in,"String_Node_Str");
    LatinEntityResolutionReader latinReader=new LatinEntityResolutionReader(inReader);
    this.document=reader.read(latinReader);
  }
 catch (  DocumentException e) {
    throw new XMLException("String_Node_Str" + documentType + "String_Node_Str"+ xmlUrl+ "String_Node_Str"+ e.getMessage(),e);
  }
catch (  IOException e) {
    throw new XMLException("String_Node_Str" + url + "String_Node_Str"+ e.getMessage(),e);
  }
  Element root=this.document.getRootElement();
  if (root == null) {
    throw new XMLException("String_Node_Str" + documentType + "String_Node_Str");
  }
  if (!StringUtils.equals(root.getName(),documentType)) {
    throw new XMLException("String_Node_Str" + documentType + "String_Node_Str"+ root.getName()+ "String_Node_Str"+ documentType+ "String_Node_Str");
  }
}

Fixed version (ground truth):
private void init(String type,URL url) throws XMLException {
  this.documentType=type;
  this.xmlUrl=url;
  SAXReader reader=new SAXReader();
  try (InputStream in=url.openStream()){
    InputStreamReader inReader=new InputStreamReader(in,Charset.forName("String_Node_Str"));
    LatinEntityResolutionReader latinReader=new LatinEntityResolutionReader(inReader);
    this.document=reader.read(latinReader);
  }
 catch (  DocumentException e) {
    throw new XMLException("String_Node_Str" + documentType + "String_Node_Str"+ xmlUrl+ "String_Node_Str"+ e.getMessage(),e);
  }
catch (  IOException e) {
    throw new XMLException("String_Node_Str" + url + "String_Node_Str"+ e.getMessage(),e);
  }
  Element root=this.document.getRootElement();
  if (root == null) {
    throw new XMLException("String_Node_Str" + documentType + "String_Node_Str");
  }
  if (!StringUtils.equals(root.getName(),documentType)) {
    throw new XMLException("String_Node_Str" + documentType + "String_Node_Str"+ root.getName()+ "String_Node_Str"+ documentType+ "String_Node_Str");
  }
}
Program: 20653
Project: 20653
Buggy source:
protected <T>T lookup(Class<T> clazz){
  return componentContainer.getComponent(clazz);
}

Fixed version (ground truth):
protected <T>T lookup(Class<T> clazz,String hint){
  return (T)applicationContext.getBean("String_Node_Str" + hint,ArchivaConfiguration.class);
}
Program: 20654
Project: 20654
Buggy source:
/** 
 * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
 */
private void assertConfiguration(Configuration configuration,int managedExpected,int remoteExpected,int proxyConnectorExpected) throws Exception {
  FileTypes filetypes=lookup(FileTypes.class);
  assertEquals("String_Node_Str" + configuration.getManagedRepositories(),managedExpected,configuration.getManagedRepositories().size());
  assertEquals("String_Node_Str" + configuration.getRemoteRepositories(),remoteExpected,configuration.getRemoteRepositories().size());
  assertEquals("String_Node_Str" + configuration.getProxyConnectors(),proxyConnectorExpected,configuration.getProxyConnectors().size());
  RepositoryScanningConfiguration repoScanning=configuration.getRepositoryScanning();
  assertNotNull("String_Node_Str",repoScanning);
  assertEquals("String_Node_Str",4,repoScanning.getFileTypes().size());
  assertEquals("String_Node_Str",9,repoScanning.getKnownContentConsumers().size());
  assertEquals("String_Node_Str",1,repoScanning.getInvalidContentConsumers().size());
  List<String> patterns=filetypes.getFileTypePatterns("String_Node_Str");
  assertNotNull("String_Node_Str",patterns);
  assertEquals("String_Node_Str",13,patterns.size());
  WebappConfiguration webapp=configuration.getWebapp();
  assertNotNull("String_Node_Str",webapp);
  UserInterfaceOptions ui=webapp.getUi();
  assertNotNull("String_Node_Str",ui);
  assertTrue("String_Node_Str",ui.isShowFindArtifacts());
  assertTrue("String_Node_Str",ui.isAppletFindEnabled());
}

Fixed version (ground truth):
/** 
 * Ensures that the provided configuration matches the details present in the archiva-default.xml file.
 */
private void assertConfiguration(Configuration configuration,int managedExpected,int remoteExpected,int proxyConnectorExpected) throws Exception {
  assertEquals("String_Node_Str" + configuration.getManagedRepositories(),managedExpected,configuration.getManagedRepositories().size());
  assertEquals("String_Node_Str" + configuration.getRemoteRepositories(),remoteExpected,configuration.getRemoteRepositories().size());
  assertEquals("String_Node_Str" + configuration.getProxyConnectors(),proxyConnectorExpected,configuration.getProxyConnectors().size());
  RepositoryScanningConfiguration repoScanning=configuration.getRepositoryScanning();
  assertNotNull("String_Node_Str",repoScanning);
  assertEquals("String_Node_Str",4,repoScanning.getFileTypes().size());
  assertEquals("String_Node_Str",9,repoScanning.getKnownContentConsumers().size());
  assertEquals("String_Node_Str",1,repoScanning.getInvalidContentConsumers().size());
  List<String> patterns=filetypes.getFileTypePatterns("String_Node_Str");
  assertNotNull("String_Node_Str",patterns);
  assertEquals("String_Node_Str",13,patterns.size());
  WebappConfiguration webapp=configuration.getWebapp();
  assertNotNull("String_Node_Str",webapp);
  UserInterfaceOptions ui=webapp.getUi();
  assertNotNull("String_Node_Str",ui);
  assertTrue("String_Node_Str",ui.isShowFindArtifacts());
  assertTrue("String_Node_Str",ui.isAppletFindEnabled());
}
Program: 20655
Project: 20655
Buggy source:
/** 
 * @param artifact
 * @return
 */
protected String getArtifactUrl(Artifact artifact) throws ArchivaRestServiceException {
  try {
    if (httpServletRequest == null) {
      return null;
    }
    StringBuilder sb=new StringBuilder(getBaseUrl());
    sb.append("String_Node_Str");
    sb.append('/').append(artifact.getContext());
    sb.append('/').append(StringUtils.replaceChars(artifact.getGroupId(),'.','/'));
    sb.append('/').append(artifact.getArtifactId());
    if (VersionUtil.isSnapshot(artifact.getVersion())) {
      sb.append('/').append(VersionUtil.getBaseVersion(artifact.getVersion()));
    }
 else {
      sb.append('/').append(artifact.getVersion());
    }
    sb.append('/').append(artifact.getArtifactId());
    sb.append('-').append(artifact.getVersion());
    if (StringUtils.isNotBlank(artifact.getClassifier())) {
      sb.append('-').append(artifact.getClassifier());
    }
    if (StringUtils.equals("String_Node_Str",artifact.getPackaging())) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append('.').append(artifact.getPackaging());
    }
    return sb.toString();
  }
 catch (  RepositoryAdminException e) {
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
}

Fixed version (ground truth):
/** 
 * @param artifact
 * @return
 */
protected String getArtifactUrl(Artifact artifact) throws ArchivaRestServiceException {
  try {
    if (httpServletRequest == null) {
      return null;
    }
    StringBuilder sb=new StringBuilder(getBaseUrl());
    sb.append("String_Node_Str");
    sb.append('/').append(artifact.getContext());
    sb.append('/').append(StringUtils.replaceChars(artifact.getGroupId(),'.','/'));
    sb.append('/').append(artifact.getArtifactId());
    if (VersionUtil.isSnapshot(artifact.getVersion())) {
      sb.append('/').append(VersionUtil.getBaseVersion(artifact.getVersion()));
    }
 else {
      sb.append('/').append(artifact.getVersion());
    }
    sb.append('/').append(artifact.getArtifactId());
    sb.append('-').append(artifact.getVersion());
    if (StringUtils.isNotBlank(artifact.getClassifier())) {
      sb.append('-').append(artifact.getClassifier());
    }
    if (StringUtils.equals("String_Node_Str",artifact.getPackaging())) {
      sb.append("String_Node_Str");
    }
 else {
      sb.append('.').append(artifact.getFileExtension());
    }
    return sb.toString();
  }
 catch (  RepositoryAdminException e) {
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
}
Program: 20656
Project: 20656
Buggy source:
public VersionsList getVersionsList(String groupId,String artifactId,String repositoryId) throws ArchivaRestServiceException {
  List<String> selectedRepos=getSelectedRepos(repositoryId);
  try {
    return new VersionsList(new ArrayList<String>(getVersions(selectedRepos,groupId,artifactId)));
  }
 catch (  MetadataResolutionException e) {
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
}

Fixed version (ground truth):
public VersionsList getVersionsList(String groupId,String artifactId,String repositoryId) throws ArchivaRestServiceException {
  List<String> selectedRepos=getSelectedRepos(repositoryId);
  try {
    Collection<String> versions=getVersions(selectedRepos,groupId,artifactId);
    return new VersionsList(new ArrayList<String>(versions));
  }
 catch (  MetadataResolutionException e) {
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
}
Program: 20657
Project: 20657
Buggy source:
private Collection<String> getVersions(List<String> selectedRepos,String groupId,String artifactId) throws MetadataResolutionException {
  RepositorySession repositorySession=repositorySessionFactory.createSession();
  try {
    MetadataResolver metadataResolver=repositorySession.getResolver();
    Set<String> versions=new LinkedHashSet<String>();
    for (    String repoId : selectedRepos) {
      versions.addAll(metadataResolver.resolveProjectVersions(repositorySession,repoId,groupId,artifactId));
    }
    List<String> sortedVersions=new ArrayList<String>(versions);
    Collections.sort(sortedVersions,VersionComparator.getInstance());
    return sortedVersions;
  }
  finally {
    repositorySession.close();
  }
}

Fixed version (ground truth):
private Collection<String> getVersions(List<String> selectedRepos,String groupId,String artifactId) throws MetadataResolutionException {
  RepositorySession repositorySession=repositorySessionFactory.createSession();
  try {
    MetadataResolver metadataResolver=repositorySession.getResolver();
    Set<String> versions=new LinkedHashSet<String>();
    for (    String repoId : selectedRepos) {
      Collection<String> projectVersions=metadataResolver.resolveProjectVersions(repositorySession,repoId,groupId,artifactId);
      versions.addAll(projectVersions);
    }
    List<String> sortedVersions=new ArrayList<String>(versions);
    Collections.sort(sortedVersions,VersionComparator.getInstance());
    return sortedVersions;
  }
  finally {
    repositorySession.close();
  }
}
Program: 20659
Project: 20659
Buggy source:
@Test public void deleteArtifact() throws Exception {
  initSourceTargetRepo();
  BrowseService browseService=getBrowseService(authorizationHeader,false);
  List<Artifact> artifacts=browseService.getArtifactDownloadInfos("String_Node_Str","String_Node_Str","String_Node_Str",SOURCE_REPO_ID);
  Assertions.assertThat(artifacts).isNotNull().isNotEmpty().hasSize(3);
  log.info("String_Node_Str",artifacts.size());
  try {
    File artifactFile=new File("String_Node_Str");
    assertTrue("String_Node_Str" + artifactFile.getPath(),artifactFile.exists());
    Artifact artifact=new Artifact();
    artifact.setGroupId("String_Node_Str");
    artifact.setArtifactId("String_Node_Str");
    artifact.setVersion("String_Node_Str");
    artifact.setPackaging("String_Node_Str");
    artifact.setContext(SOURCE_REPO_ID);
    RepositoriesService repositoriesService=getRepositoriesService(authorizationHeader);
    repositoriesService.deleteArtifact(artifact);
    assertFalse("String_Node_Str" + artifactFile.getPath(),artifactFile.exists());
    artifacts=browseService.getArtifactDownloadInfos("String_Node_Str","String_Node_Str","String_Node_Str",SOURCE_REPO_ID);
    Assertions.assertThat(artifacts).isNotNull().isEmpty();
  }
  finally {
    cleanRepos();
  }
}

Fixed version (ground truth):
@Test public void deleteArtifact() throws Exception {
  initSourceTargetRepo();
  BrowseService browseService=getBrowseService(authorizationHeader,false);
  List<Artifact> artifacts=browseService.getArtifactDownloadInfos("String_Node_Str","String_Node_Str","String_Node_Str",SOURCE_REPO_ID);
  log.info("String_Node_Str",artifacts);
  Assertions.assertThat(artifacts).isNotNull().isNotEmpty().hasSize(2);
  VersionsList versionsList=browseService.getVersionsList("String_Node_Str","String_Node_Str",SOURCE_REPO_ID);
  Assertions.assertThat(versionsList.getVersions()).isNotNull().isNotEmpty().hasSize(2);
  log.info("String_Node_Str",artifacts.size());
  try {
    File artifactFile=new File("String_Node_Str");
    assertTrue("String_Node_Str" + artifactFile.getPath(),artifactFile.exists());
    Artifact artifact=new Artifact();
    artifact.setGroupId("String_Node_Str");
    artifact.setArtifactId("String_Node_Str");
    artifact.setVersion("String_Node_Str");
    artifact.setPackaging("String_Node_Str");
    artifact.setContext(SOURCE_REPO_ID);
    RepositoriesService repositoriesService=getRepositoriesService(authorizationHeader);
    repositoriesService.deleteArtifact(artifact);
    assertFalse("String_Node_Str" + artifactFile.getPath(),artifactFile.exists());
    artifacts=browseService.getArtifactDownloadInfos("String_Node_Str","String_Node_Str","String_Node_Str",SOURCE_REPO_ID);
    Assertions.assertThat(artifacts).isNotNull().isEmpty();
    versionsList=browseService.getVersionsList("String_Node_Str","String_Node_Str",SOURCE_REPO_ID);
    Assertions.assertThat(versionsList.getVersions()).isNotNull().isNotEmpty().hasSize(1);
  }
  finally {
    cleanRepos();
  }
}
Program: 20660
Project: 20660
Buggy source:
public void removeArtifact(String repoId,String namespace,String project,String version,String id){
  File directory=new File(getDirectory(repoId),namespace + "String_Node_Str" + project+ "String_Node_Str"+ version);
  Properties properties=readOrCreateProperties(directory,PROJECT_VERSION_METADATA_KEY);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  String prefix="String_Node_Str" + id + "String_Node_Str";
  for (  Object key : new ArrayList<Object>(properties.keySet())) {
    String property=(String)key;
    if (property.startsWith(prefix)) {
      properties.remove(property);
    }
  }
  try {
    writeProperties(properties,directory,PROJECT_VERSION_METADATA_KEY);
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public void removeArtifact(String repoId,String namespace,String project,String version,String id){
  File directory=new File(getDirectory(repoId),namespace + "String_Node_Str" + project+ "String_Node_Str"+ version);
  Properties properties=readOrCreateProperties(directory,PROJECT_VERSION_METADATA_KEY);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  properties.remove("String_Node_Str" + id);
  String prefix="String_Node_Str" + id + "String_Node_Str";
  for (  Object key : new ArrayList<Object>(properties.keySet())) {
    String property=(String)key;
    if (property.startsWith(prefix)) {
      properties.remove(property);
    }
  }
  try {
    FileUtils.deleteDirectory(directory);
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
  }
}
Program: 20661
Project: 20661
Buggy source:
public List<ArtifactDownloadInfo> getArtifactDownloadInfos(String groupId,String artifactId,String version,String repositoryId) throws ArchivaRestServiceException {
  List<String> selectedRepos=getSelectedRepos(repositoryId);
  List<ArtifactDownloadInfo> artifactDownloadInfos=new ArrayList<ArtifactDownloadInfo>();
  RepositorySession session=repositorySessionFactory.createSession();
  MetadataResolver metadataResolver=session.getResolver();
  try {
    for (    String repoId : selectedRepos) {
      List<ArtifactMetadata> artifacts=new ArrayList<ArtifactMetadata>(metadataResolver.resolveArtifacts(session,repoId,groupId,artifactId,version));
      Collections.sort(artifacts,ArtifactMetadataVersionComparator.INSTANCE);
      for (      ArtifactMetadata artifact : artifacts) {
        ArtifactDownloadInfoBuilder builder=new ArtifactDownloadInfoBuilder().forArtifactMetadata(artifact).withManagedRepositoryContent(repositoryContentFactory.getManagedRepositoryContent(repositoryId));
        artifactDownloadInfos.add(builder.build());
      }
    }
  }
 catch (  RepositoryException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
catch (  MetadataResolutionException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
 finally {
    if (session != null) {
      session.close();
    }
  }
  return artifactDownloadInfos;
}

Fixed version (ground truth):
public List<ArtifactDownloadInfo> getArtifactDownloadInfos(String groupId,String artifactId,String version,String repositoryId) throws ArchivaRestServiceException {
  List<String> selectedRepos=getSelectedRepos(repositoryId);
  List<ArtifactDownloadInfo> artifactDownloadInfos=new ArrayList<ArtifactDownloadInfo>();
  RepositorySession session=repositorySessionFactory.createSession();
  MetadataResolver metadataResolver=session.getResolver();
  try {
    for (    String repoId : selectedRepos) {
      List<ArtifactMetadata> artifacts=new ArrayList<ArtifactMetadata>(metadataResolver.resolveArtifacts(session,repoId,groupId,artifactId,version));
      Collections.sort(artifacts,ArtifactMetadataVersionComparator.INSTANCE);
      for (      ArtifactMetadata artifact : artifacts) {
        ArtifactDownloadInfoBuilder builder=new ArtifactDownloadInfoBuilder().forArtifactMetadata(artifact).withManagedRepositoryContent(repositoryContentFactory.getManagedRepositoryContent(repoId));
        artifactDownloadInfos.add(builder.build());
      }
    }
  }
 catch (  RepositoryException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
catch (  MetadataResolutionException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
 finally {
    if (session != null) {
      session.close();
    }
  }
  return artifactDownloadInfos;
}
Program: 20663
Project: 20663
Buggy source:
public List<ArtifactContentEntry> getArtifactContentEntries(String groupId,String artifactId,String version,String classifier,String type,String path,String repositoryId) throws ArchivaRestServiceException {
  List<String> selectedRepos=getSelectedRepos(repositoryId);
  try {
    for (    String repoId : selectedRepos) {
      ManagedRepositoryContent managedRepositoryContent=repositoryContentFactory.getManagedRepositoryContent(repoId);
      ArchivaArtifact archivaArtifact=new ArchivaArtifact(groupId,artifactId,version,classifier,StringUtils.isEmpty(type) ? "String_Node_Str" : type,repositoryId);
      File file=managedRepositoryContent.toFile(archivaArtifact);
      if (file.exists()) {
        return readFileEntries(file,path);
      }
    }
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
catch (  RepositoryNotFoundException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
catch (  RepositoryException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
  return Collections.emptyList();
}

Fixed version (ground truth):
public List<ArtifactContentEntry> getArtifactContentEntries(String groupId,String artifactId,String version,String classifier,String type,String path,String repositoryId) throws ArchivaRestServiceException {
  List<String> selectedRepos=getSelectedRepos(repositoryId);
  try {
    for (    String repoId : selectedRepos) {
      ManagedRepositoryContent managedRepositoryContent=repositoryContentFactory.getManagedRepositoryContent(repoId);
      ArchivaArtifact archivaArtifact=new ArchivaArtifact(groupId,artifactId,version,classifier,StringUtils.isEmpty(type) ? "String_Node_Str" : type,repoId);
      File file=managedRepositoryContent.toFile(archivaArtifact);
      if (file.exists()) {
        return readFileEntries(file,path);
      }
    }
  }
 catch (  IOException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
catch (  RepositoryNotFoundException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
catch (  RepositoryException e) {
    log.error(e.getMessage(),e);
    throw new ArchivaRestServiceException(e.getMessage(),Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),e);
  }
  return Collections.emptyList();
}
Program: 20664
Project: 20664
Buggy source:
/** 
 * Close the session. Required to be called for all open sessions to ensure resources are properly released. If the session has been marked as dirty, it will be saved. This may save partial changes in the case of a typical <code>try { ... } finally { ... }</code> approach - if this is a problem, ensure you revert changes when an exception occurs.
 */
public void close() throws MetadataRepositoryException {
  try {
    if (dirty) {
      save();
    }
  }
 catch (  MetadataRepositoryException e) {
    throw e;
  }
 finally {
    repository.close();
  }
}

Fixed version (ground truth):
/** 
 * Close the session. Required to be called for all open sessions to ensure resources are properly released. If the session has been marked as dirty, it will be saved. This may save partial changes in the case of a typical <code>try { ... } finally { ... }</code> approach - if this is a problem, ensure you revert changes when an exception occurs.
 */
public void close(){
  try {
    if (dirty) {
      save();
    }
  }
 catch (  MetadataRepositoryException e) {
    throw new RuntimeException(e.getMessage(),e);
  }
 finally {
    repository.close();
  }
}
Program: 20666
Project: 20666
Buggy source:
public void save() throws MetadataRepositoryException {
}

Fixed version (ground truth):
public void save(){
}
Program: 20668
Project: 20668
Buggy source:
public void revert() throws MetadataRepositoryException {
}

Fixed version (ground truth):
public void revert(){
}
Program: 20670
Project: 20670
Buggy source:
public void save() throws MetadataRepositoryException {
}

Fixed version (ground truth):
public void save(){
}
Program: 20672
Project: 20672
Buggy source:
public void revert() throws MetadataRepositoryException {
}

Fixed version (ground truth):
public void revert(){
}
Program: 20674
Project: 20674
Buggy source:
public void save() throws MetadataRepositoryException {
}

Fixed version (ground truth):
public void save(){
}
Program: 20676
Project: 20676
Buggy source:
public void revert() throws MetadataRepositoryException {
}

Fixed version (ground truth):
public void revert(){
}
Program: 20678
Project: 20678
Buggy source:
@Test public void testMerge() throws Exception {
  Configuration c=new Configuration();
  ManagedRepositoryConfiguration testRepo=new ManagedRepositoryConfiguration();
  testRepo.setId(TEST_REPO_ID);
  testRepo.setLocation("String_Node_Str");
  RepositoryScanningConfiguration repoScanConfig=new RepositoryScanningConfiguration();
  List<String> knownContentConsumers=new ArrayList<String>();
  knownContentConsumers.add("String_Node_Str");
  repoScanConfig.setKnownContentConsumers(knownContentConsumers);
  c.setRepositoryScanning(repoScanConfig);
  ManagedRepositoryConfiguration targetRepo=new ManagedRepositoryConfiguration();
  targetRepo.setId("String_Node_Str");
  targetRepo.setLocation("String_Node_Str");
  c.addManagedRepository(testRepo);
  c.addManagedRepository(targetRepo);
  configuration.save(c);
  when(metadataRepository.getArtifacts(TEST_REPO_ID)).thenReturn(getArtifacts());
  repositoryMerger.merge(metadataRepository,TEST_REPO_ID,"String_Node_Str");
  verify(metadataRepository).getArtifacts(TEST_REPO_ID);
}

Fixed version (ground truth):
@Test public void testMerge() throws Exception {
  Configuration c=new Configuration();
  ManagedRepositoryConfiguration testRepo=new ManagedRepositoryConfiguration();
  testRepo.setId(TEST_REPO_ID);
  testRepo.setLocation("String_Node_Str" + File.separatorChar + "String_Node_Str");
  RepositoryScanningConfiguration repoScanConfig=new RepositoryScanningConfiguration();
  List<String> knownContentConsumers=new ArrayList<String>();
  knownContentConsumers.add("String_Node_Str");
  repoScanConfig.setKnownContentConsumers(knownContentConsumers);
  c.setRepositoryScanning(repoScanConfig);
  ManagedRepositoryConfiguration targetRepo=new ManagedRepositoryConfiguration();
  targetRepo.setId("String_Node_Str");
  targetRepo.setLocation("String_Node_Str");
  c.addManagedRepository(testRepo);
  c.addManagedRepository(targetRepo);
  configuration.save(c);
  when(metadataRepository.getArtifacts(TEST_REPO_ID)).thenReturn(getArtifacts());
  repositoryMerger.merge(metadataRepository,TEST_REPO_ID,"String_Node_Str");
  verify(metadataRepository).getArtifacts(TEST_REPO_ID);
}
Program: 20681
Project: 20681
Buggy source:
public Resource createResource(String identifier) throws RbacManagerException {
  return new MemoryResource();
}

Fixed version (ground truth):
public Resource createResource(String identifier) throws RbacManagerException {
  return null;
}
Program: 20683
Project: 20683
Buggy source:
@Test(dependsOnMethods={"String_Node_Str"},alwaysRun=true) public void testAddArtifactNoFilePath(){
  addArtifact(getGroupId(),getArtifactId(),getVersion(),getPackaging(),"String_Node_Str",getRepositoryId(),false);
  assertTextPresent("String_Node_Str");
}

Fixed version (ground truth):
@Test(dependsOnMethods={"String_Node_Str"},alwaysRun=true) public void testAddArtifactNoFilePath(){
  addArtifact(getGroupId(),getArtifactId(),getVersion(),getPackaging(),"String_Node_Str",getRepositoryId(),true);
  assertTextPresent("String_Node_Str");
}
Program: 20684
Project: 20684
Buggy source:
public void assertCreateUserPage(){
  assertPage("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertButtonWithValuePresent("String_Node_Str");
}

Fixed version (ground truth):
public void assertCreateUserPage(){
  assertTextPresent("String_Node_Str","String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str","String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str","String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str","String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertTextPresent("String_Node_Str","String_Node_Str");
  assertElementPresent("String_Node_Str");
  assertElementNotPresent("String_Node_Str");
}
Program: 20685
Project: 20685
Buggy source:
public void assertUserRolesPage(){
  assertPage("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  String userRoles="String_Node_Str";
  String[] arrayRole=userRoles.split("String_Node_Str");
  for (  String userroles : arrayRole) {
    assertTextPresent(userroles);
  }
}

Fixed version (ground truth):
public void assertUserRolesPage(){
  assertTextPresent("String_Node_Str","String_Node_Str");
  assertTextPresent("String_Node_Str","String_Node_Str");
  assertTextPresent("String_Node_Str","String_Node_Str");
  String userRoles="String_Node_Str";
  String[] arrayRole=userRoles.split("String_Node_Str");
  for (  String userroles : arrayRole) {
    assertTextPresent(userroles);
  }
}
Program: 20686
Project: 20686
Buggy source:
public void assertDeleteUserPage(String username){
  assertPage("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertTextPresent("String_Node_Str" + username);
  assertButtonWithValuePresent("String_Node_Str");
}

Fixed version (ground truth):
public void assertDeleteUserPage(String username){
  assertTextPresent("String_Node_Str","String_Node_Str","String_Node_Str");
  assertTextPresent("String_Node_Str");
  assertTextPresent("String_Node_Str" + username,"String_Node_Str" + username);
  assertButtonWithIdPresent("String_Node_Str");
}
Program: 20687
Project: 20687
Buggy source:
private void createUser(String userName,String fullName,String emailAd,String password,String confirmPassword,boolean valid){
  getSelenium().open("String_Node_Str");
  clickButtonWithValue("String_Node_Str");
  assertCreateUserPage();
  setFieldValue("String_Node_Str",userName);
  setFieldValue("String_Node_Str",fullName);
  setFieldValue("String_Node_Str",emailAd);
  setFieldValue("String_Node_Str",password);
  setFieldValue("String_Node_Str",confirmPassword);
  submit();
  assertUserRolesPage();
  clickButtonWithValue("String_Node_Str");
  if (valid) {
    String[] columnValues={userName,fullName,emailAd};
    assertElementPresent(XPathExpressionUtil.getTableRow(columnValues));
  }
 else {
    assertCreateUserPage();
  }
}

Fixed version (ground truth):
private void createUser(String userName,String fullName,String emailAd,String password,String confirmPassword,boolean valid){
  getSelenium().open("String_Node_Str");
  clickButtonWithLocator("String_Node_Str",true);
  assertCreateUserPage();
  setFieldValue("String_Node_Str",userName);
  setFieldValue("String_Node_Str",fullName);
  setFieldValue("String_Node_Str",emailAd);
  setFieldValue("String_Node_Str",password);
  setFieldValue("String_Node_Str",confirmPassword);
  submit();
  assertUserRolesPage();
  clickButtonWithName("String_Node_Str",true);
  if (valid) {
    String[] columnValues={userName,fullName,emailAd};
    assertElementPresent(XPathExpressionUtil.getTableRow(columnValues));
  }
 else {
    assertCreateUserPage();
  }
}
Program: 20688
Project: 20688
Buggy source:
public void assertTextPresent(String text){
  Assert.assertTrue(getSelenium().isTextPresent(text),"String_Node_Str" + text + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * one of text args must be in the page so use en and fr text (olamy use en locale :-) )
 * @param texts
 */
public void assertTextPresent(String... texts){
  boolean present=false;
  StringBuilder sb=new StringBuilder();
  for (  String text : texts) {
    present=present || getSelenium().isTextPresent(text);
    sb.append("String_Node_Str" + text + "String_Node_Str");
  }
  Assert.assertTrue(present,"String_Node_Str" + sb.toString() + "String_Node_Str");
}
Program: 20690
Project: 20690
Buggy source:
@Override @Before public void setUp() throws Exception {
  super.setUp();
  scheduler=new ArchivaTaskSchedulerStub();
  ArchivaConfiguration configuration=applicationContext.getBean(ArchivaConfiguration.class);
  FileTypes filetypes=applicationContext.getBean(FileTypes.class);
  nexusIndexerConsumer=new NexusIndexerConsumer(scheduler,configuration,filetypes,plexusSisuBridge);
  ((Initializable)nexusIndexerConsumer).initialize();
  repositoryConfig=new ManagedRepositoryConfiguration();
  repositoryConfig.setId("String_Node_Str");
  repositoryConfig.setLocation("String_Node_Str");
  repositoryConfig.setLayout("String_Node_Str");
  repositoryConfig.setName("String_Node_Str");
  repositoryConfig.setScanned(true);
  repositoryConfig.setSnapshots(false);
  repositoryConfig.setReleases(true);
}

Fixed version (ground truth):
@Override @Before public void setUp() throws Exception {
  super.setUp();
  scheduler=new ArchivaTaskSchedulerStub();
  ArchivaConfiguration configuration=applicationContext.getBean(ArchivaConfiguration.class);
  FileTypes filetypes=applicationContext.getBean(FileTypes.class);
  nexusIndexerConsumer=new NexusIndexerConsumer(scheduler,configuration,filetypes,plexusSisuBridge,mavenIndexerUtils);
  ((Initializable)nexusIndexerConsumer).initialize();
  repositoryConfig=new ManagedRepositoryConfiguration();
  repositoryConfig.setId("String_Node_Str");
  repositoryConfig.setLocation("String_Node_Str");
  repositoryConfig.setLayout("String_Node_Str");
  repositoryConfig.setName("String_Node_Str");
  repositoryConfig.setScanned(true);
  repositoryConfig.setSnapshots(false);
  repositoryConfig.setReleases(true);
}