Program: 13038
Project: 13038
Buggy source:
/** 
 * Gets the artifact content from the s-ramp repository and stores it in the   {@link InputData}object for use by Maven.
 * @param gavInfo
 * @param inputData
 * @throws TransferFailedException
 * @throws ResourceDoesNotExistException
 * @throws AuthorizationException
 */
private void doGetArtifact(MavenGavInfo gavInfo,InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException {
  ClassLoader oldCtxCL=Thread.currentThread().getContextClassLoader();
  Thread.currentThread().setContextClassLoader(SrampWagon.class.getClassLoader());
  try {
    String endpoint=getSrampEndpoint();
    SrampAtomApiClient client=new SrampAtomApiClient(endpoint);
    BaseArtifactType artifact=findExistingArtifact(client,gavInfo);
    if (artifact == null)     throw new ResourceDoesNotExistException("String_Node_Str" + gavInfo.getName() + "String_Node_Str");
    this.archive.addEntry(gavInfo.getFullName(),artifact,null);
    ArtifactType type=ArtifactType.valueOf(artifact);
    InputStream artifactContent=client.getArtifactContent(type,artifact.getUuid());
    inputData.setInputStream(artifactContent);
  }
 catch (  ResourceDoesNotExistException e) {
    throw e;
  }
catch (  SrampClientException e) {
    if (e.getCause() instanceof HttpHostConnectException)     this.logger.debug("String_Node_Str" + e.getMessage());
 else     this.logger.error(e.getMessage(),e);
  }
catch (  Throwable t) {
    this.logger.error(t.getMessage(),t);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldCtxCL);
  }
}

Fixed version (ground truth):
/** 
 * Gets the artifact content from the s-ramp repository and stores it in the   {@link InputData}object for use by Maven.
 * @param gavInfo
 * @param inputData
 * @throws TransferFailedException
 * @throws ResourceDoesNotExistException
 * @throws AuthorizationException
 */
private void doGetArtifact(MavenGavInfo gavInfo,InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException {
  ClassLoader oldCtxCL=Thread.currentThread().getContextClassLoader();
  Thread.currentThread().setContextClassLoader(SrampWagon.class.getClassLoader());
  try {
    String endpoint=getSrampEndpoint();
    SrampAtomApiClient client=new SrampAtomApiClient(endpoint);
    BaseArtifactType artifact=findExistingArtifact(client,gavInfo);
    if (artifact == null)     throw new ResourceDoesNotExistException("String_Node_Str" + gavInfo.getName() + "String_Node_Str");
    this.archive.addEntry(gavInfo.getFullName(),artifact,null);
    ArtifactType type=ArtifactType.valueOf(artifact);
    InputStream artifactContent=client.getArtifactContent(type,artifact.getUuid());
    inputData.setInputStream(artifactContent);
  }
 catch (  ResourceDoesNotExistException e) {
    throw e;
  }
catch (  SrampClientException e) {
    if (e.getCause() instanceof HttpHostConnectException) {
      this.logger.debug("String_Node_Str" + e.getMessage());
    }
 else {
      this.logger.error(e.getMessage(),e);
    }
    throw new ResourceDoesNotExistException("String_Node_Str" + gavInfo.getName());
  }
catch (  Throwable t) {
    this.logger.error(t.getMessage(),t);
  }
 finally {
    Thread.currentThread().setContextClassLoader(oldCtxCL);
  }
}