nus-yam/ex-repair huggingface dataset:
Program: 12979
Project: 12979
Buggy source:
/** 
 * Sets the extended type.
 * @param extendedType
 */
public void setExtendedType(String extendedType){
  if (!isValid(extendedType)) {
    throw new RuntimeException(Messages.i18n.format("String_Node_Str",extendedType));
  }
  this.extendedType=extendedType;
}

Fixed version (ground truth):
/** 
 * Sets the extended type.
 * @param extendedType
 */
public void setExtendedType(String extendedType){
  if (extendedType != null && !isValid(extendedType)) {
    throw new RuntimeException(Messages.i18n.format("String_Node_Str",extendedType));
  }
  this.extendedType=extendedType;
}
Program: 12980
Project: 12980
Buggy source:
/** 
 * @see org.overlord.sramp.common.repository.PersistenceManager#persistOntology(org.overlord.sramp.common.ontology.SrampOntology)
 */
@Override public SrampOntology persistOntology(SrampOntology ontology) throws SrampException {
  Session session=null;
  if (ontology.getUuid() == null) {
    ontology.setUuid(UUID.randomUUID().toString());
  }
  String ontologyPath=MapToJCRPath.getOntologyPath(ontology.getUuid());
  try {
    session=JCRRepositoryFactory.getSession();
    if (session.nodeExists(ontologyPath)) {
      throw new OntologyAlreadyExistsException(ontology.getUuid());
    }
 else {
      JCRUtils tools=new JCRUtils();
      Node ontologiesNode=tools.findOrCreateNode(session,"String_Node_Str","String_Node_Str");
      Node ontologyNode=ontologiesNode.addNode(ontology.getUuid(),"String_Node_Str");
      o2jcr.write(ontology,ontologyNode);
      session.save();
      log.debug(Messages.i18n.format("String_Node_Str",ontology.getUuid()));
      return ontology;
    }
  }
 catch (  SrampException se) {
    throw se;
  }
catch (  Throwable t) {
    throw new SrampServerException(t);
  }
 finally {
    JCRRepositoryFactory.logoutQuietly(session);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.repository.PersistenceManager#persistOntology(org.overlord.sramp.common.ontology.SrampOntology)
 */
@Override public SrampOntology persistOntology(SrampOntology ontology) throws SrampException {
  Session session=null;
  if (ontology.getUuid() == null) {
    ontology.setUuid(UUID.randomUUID().toString());
  }
  String ontologyPath=MapToJCRPath.getOntologyPath(ontology.getUuid());
  List<SrampOntology> ontologies=getOntologies();
  for (  SrampOntology existingOntology : ontologies) {
    if (existingOntology.getBase().equals(ontology.getBase())) {
      throw new OntologyAlreadyExistsException();
    }
  }
  try {
    session=JCRRepositoryFactory.getSession();
    if (session.nodeExists(ontologyPath)) {
      throw new OntologyAlreadyExistsException(ontology.getUuid());
    }
 else {
      JCRUtils tools=new JCRUtils();
      Node ontologiesNode=tools.findOrCreateNode(session,"String_Node_Str","String_Node_Str");
      Node ontologyNode=ontologiesNode.addNode(ontology.getUuid(),"String_Node_Str");
      o2jcr.write(ontology,ontologyNode);
      session.save();
      log.debug(Messages.i18n.format("String_Node_Str",ontology.getUuid()));
      return ontology;
    }
  }
 catch (  SrampException se) {
    throw se;
  }
catch (  Throwable t) {
    throw new SrampServerException(t);
  }
 finally {
    JCRRepositoryFactory.logoutQuietly(session);
  }
}
Program: 12981
Project: 12981
Buggy source:
/** 
 * Called when the user clicks one of the ontologies in the list.
 * @param ontology
 * @param widget
 */
protected void onOntologyClicked(OntologySummaryBean ontology,Widget widget){
  if (widget == selectedOntologyWidget) {
    editor.setValue(null);
    widget.getElement().getParentElement().removeClassName("String_Node_Str");
    selectedOntologyWidget=null;
    return;
  }
  if (selectedOntologyWidget != null) {
    if (editor.isDirty()) {
      Window.alert("String_Node_Str");
      return;
    }
    selectedOntologyWidget.getElement().getParentElement().removeClassName("String_Node_Str");
    selectedOntologyWidget=null;
  }
  widget.getElement().getParentElement().addClassName("String_Node_Str");
  selectedOntologyWidget=widget;
  editor.clear();
  ontologyService.get(ontology.getUuid(),true,new IRpcServiceInvocationHandler<OntologyBean>(){
    @Override public void onReturn(    OntologyBean data){
      editor.setValue(data);
    }
    @Override public void onError(    Throwable error){
      notificationService.sendErrorNotification(i18n.format("String_Node_Str"),error);
      editor.clear();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Called when the user clicks one of the ontologies in the list.
 * @param ontology
 * @param widget
 */
protected void onOntologyClicked(OntologySummaryBean ontology,Widget widget){
  if (widget == selectedOntologyWidget) {
    editor.setValue(null);
    widget.getElement().getParentElement().removeClassName("String_Node_Str");
    selectedOntologyWidget=null;
    return;
  }
  if (selectedOntologyWidget != null) {
    if (editor.isDirty()) {
      Window.alert(i18n.format("String_Node_Str"));
      return;
    }
    selectedOntologyWidget.getElement().getParentElement().removeClassName("String_Node_Str");
    selectedOntologyWidget=null;
  }
  widget.getElement().getParentElement().addClassName("String_Node_Str");
  selectedOntologyWidget=widget;
  editor.clear();
  ontologyService.get(ontology.getUuid(),true,new IRpcServiceInvocationHandler<OntologyBean>(){
    @Override public void onReturn(    OntologyBean data){
      editor.setValue(data);
    }
    @Override public void onError(    Throwable error){
      notificationService.sendErrorNotification(i18n.format("String_Node_Str"),error);
      editor.clear();
    }
  }
);
}
Program: 12985
Project: 12985
Buggy source:
private void processNamespaces(final Element xmiElement){
  final NamedNodeMap attributes=xmiElement.getAttributes();
  for (int i=0, numAttrs=attributes.getLength(); i < numAttrs; ++i) {
    final Node attr=attributes.item(i);
    if (TeiidModel.XmiId.XML_NAMESPACE.equals(attr.getPrefix())) {
      this.namespaceContext.addMapping(attr.getLocalName(),attr.getNodeValue());
      LOGGER.debug("String_Node_Str",attr.getLocalName(),attr.getNodeValue());
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds namespace mappings to the current namespace context based on prefix mappings defined on the given element.
 * @param xmiElement
 * @param xmlDeriverContext
 */
private void processNamespaces(final Element xmiElement,final XmlDeriverContext xmlDeriverContext){
  final NamedNodeMap attributes=xmiElement.getAttributes();
  for (int i=0, numAttrs=attributes.getLength(); i < numAttrs; ++i) {
    final Node attr=attributes.item(i);
    if (TeiidModel.XmiId.XML_NAMESPACE.equals(attr.getPrefix())) {
      xmlDeriverContext.addNamespaceMapping(attr.getLocalName(),attr.getNodeValue());
      LOGGER.debug("String_Node_Str",attr.getLocalName(),attr.getNodeValue());
    }
  }
}
Program: 12986
Project: 12986
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(final Collection<BaseArtifactType> derivedArtifacts,final BaseArtifactType artifact,final Element rootElement,final XPath xpath) throws IOException {
  LOGGER.debug("String_Node_Str",rootElement.getLocalName(),artifact.getName());
  if (!(artifact instanceof ExtendedDocument) || !TeiidArtifactType.MODEL.extendedType().equals(((ExtendedDocument)artifact).getExtendedType())) {
    throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
  }
  final ExtendedDocument modelArtifact=(ExtendedDocument)artifact;
  try {
    if (!TeiidModel.XmiId.ROOT_ELEMENT.equals(rootElement.getLocalName())) {
      throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
    }
    processNamespaces(rootElement);
    processModelAnnotation(derivedArtifacts,modelArtifact,rootElement,xpath);
  }
 catch (  final Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  LOGGER.debug("String_Node_Str",xmlDeriverContext.getRootElement().getLocalName(),artifact.getName());
  if (!(artifact instanceof ExtendedDocument) || !TeiidArtifactType.MODEL.extendedType().equals(((ExtendedDocument)artifact).getExtendedType())) {
    throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
  }
  final ExtendedDocument modelArtifact=(ExtendedDocument)artifact;
  try {
    if (!TeiidModel.XmiId.ROOT_ELEMENT.equals(xmlDeriverContext.getRootElement().getLocalName())) {
      throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
    }
    processNamespaces(xmlDeriverContext.getRootElement(),xmlDeriverContext);
    processModelAnnotation(derivedArtifacts,modelArtifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  final Exception e) {
    throw new IOException(e);
  }
}
Program: 12987
Project: 12987
Buggy source:
/** 
 * {@inheritDoc}
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(final Collection<BaseArtifactType> derivedArtifacts,final BaseArtifactType artifact,final Element rootElement,final XPath xpath) throws IOException {
  LOGGER.debug("String_Node_Str",rootElement.getLocalName(),artifact.getName());
  this.sources.clear();
  this.translators.clear();
  if (!(artifact instanceof ExtendedDocument) || !VdbManifest.ARTIFACT_TYPE.extendedType().equals(((ExtendedDocument)artifact).getExtendedType())) {
    throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
  }
  final ExtendedDocument vdbArtifact=(ExtendedDocument)artifact;
  try {
    if (!VdbManifest.ManifestId.VDB_ELEMENT.equals(rootElement.getLocalName())) {
      throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
    }
    processVdb(derivedArtifacts,vdbArtifact,rootElement,xpath);
  }
 catch (  final Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  Element rootElement=xmlDeriverContext.getRootElement();
  LOGGER.debug("String_Node_Str",rootElement.getLocalName(),artifact.getName());
  this.sources.clear();
  this.translators.clear();
  if (!(artifact instanceof ExtendedDocument) || !VdbManifest.ARTIFACT_TYPE.extendedType().equals(((ExtendedDocument)artifact).getExtendedType())) {
    throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
  }
  final ExtendedDocument vdbArtifact=(ExtendedDocument)artifact;
  try {
    if (!VdbManifest.ManifestId.VDB_ELEMENT.equals(rootElement.getLocalName())) {
      throw new IllegalArgumentException(Messages.I18N.format("String_Node_Str",artifact.getName()));
    }
    processVdb(derivedArtifacts,vdbArtifact,rootElement,xmlDeriverContext.getXpath());
  }
 catch (  final Exception e) {
    throw new IOException(e);
  }
}
Program: 12988
Project: 12988
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.s_ramp.xmlns._2010.s_ramp.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    processDescriptor(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    processDescriptor(derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 12989
Project: 12989
Buggy source:
/** 
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object,boolean)
 */
@Override public void setValue(Map<String,String> value,boolean fireEvents){
  this.value=new HashMap<String,String>(value);
  clear();
  if (value == null || value.isEmpty()) {
  }
 else {
    Set<String> keys=new TreeSet<String>(value.keySet());
    for (    final String propName : keys) {
      String propValue=value.get(propName);
      InlineLabel propLabel=new InlineLabel(propName + "String_Node_Str");
      propLabel.setStyleName("String_Node_Str");
      CustomPropertyEditableInlineLabel propValueWidget=propValueLabelFactory.get();
      propValueWidget.addValueChangeHandler(new ValueChangeHandler<String>(){
        @Override public void onValueChange(        ValueChangeEvent<String> event){
          Map<String,String> newValue=new HashMap<String,String>(CustomPropertiesPanel.this.value);
          String val=event.getValue();
          if (val == null) {
            newValue.remove(propName);
          }
 else {
            newValue.put(propName,val);
          }
          setValue(newValue,true);
        }
      }
);
      propValueWidget.setValue(propValue);
      propValueWidget.setStyleName("String_Node_Str");
      InlineLabel clearFix=new InlineLabel();
      clearFix.setStyleName("String_Node_Str");
      add(propLabel);
      add(propValueWidget);
      add(clearFix);
    }
  }
  if (fireEvents) {
    ValueChangeEvent.fire(this,this.value);
  }
}

Fixed version (ground truth):
/** 
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object,boolean)
 */
@Override public void setValue(Map<String,String> value,boolean fireEvents){
  this.value=new HashMap<String,String>(value);
  clear();
  if (value == null || value.isEmpty()) {
  }
 else {
    Set<String> keys=new TreeSet<String>(value.keySet());
    for (    final String propName : keys) {
      String propValue=value.get(propName);
      Label propLabel=new Label(propName + "String_Node_Str");
      propLabel.setStyleName("String_Node_Str");
      CustomPropertyEditableInlineLabel propValueWidget=propValueLabelFactory.get();
      propValueWidget.addValueChangeHandler(new ValueChangeHandler<String>(){
        @Override public void onValueChange(        ValueChangeEvent<String> event){
          Map<String,String> newValue=new HashMap<String,String>(CustomPropertiesPanel.this.value);
          String val=event.getValue();
          if (val == null) {
            newValue.remove(propName);
          }
 else {
            newValue.put(propName,val);
          }
          setValue(newValue,true);
        }
      }
);
      propValueWidget.setValue(propValue);
      propValueWidget.setStyleName("String_Node_Str");
      Label clearFix=new Label();
      clearFix.setStyleName("String_Node_Str");
      add(propLabel);
      add(propValueWidget);
      add(clearFix);
    }
  }
  if (fireEvents) {
    ValueChangeEvent.fire(this,this.value);
  }
}
Program: 12990
Project: 12990
Buggy source:
/** 
 * Derives content for the given artifact.
 * @param derivedArtifacts
 * @param artifact
 * @param rootElement
 * @param xpath
 * @throws IOException
 */
protected abstract void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException ;

Fixed version (ground truth):
/** 
 * Derives content for the given artifact.
 * @param derivedArtifacts
 * @param artifact
 * @param xmlDeriverContext
 * @throws IOException
 */
protected abstract void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException ;
Program: 12991
Project: 12991
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
}
Program: 12992
Project: 12992
Buggy source:
/** 
 * @see org.overlord.sramp.common.repository.derived.XsdDeriver#derive(org.overlord.sramp.common.repository.derived.IndexedArtifactCollection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  String targetNS=rootElement.getAttribute("String_Node_Str");
  ((WsdlDocument)artifact).setTargetNamespace(targetNS);
  try {
    processDefinitions((IndexedArtifactCollection)derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.XsdDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  String targetNS=xmlDeriverContext.getRootElement().getAttribute("String_Node_Str");
  ((WsdlDocument)artifact).setTargetNamespace(targetNS);
  try {
    processDefinitions((IndexedArtifactCollection)derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 12993
Project: 12993
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    processSchema(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    processSchema(derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 12994
Project: 12994
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.s_ramp.xmlns._2010.s_ramp.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    processDescriptor(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    processDescriptor(derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 12995
Project: 12995
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.s_ramp.xmlns._2010.s_ramp.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    String targetNS=rootElement.getAttribute("String_Node_Str");
    SrampModelUtils.setCustomProperty(artifact,"String_Node_Str",targetNS);
    if ("String_Node_Str".equals(artifact.getName()) && rootElement.hasAttribute("String_Node_Str")) {
      String name=rootElement.getAttribute("String_Node_Str");
      artifact.setName(name);
    }
    processComponents(derivedArtifacts,artifact,rootElement,xpath);
    processServices(derivedArtifacts,artifact,rootElement,xpath);
    processTransformers(derivedArtifacts,artifact,rootElement,xpath);
    processValidators(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  XPathExpressionException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    Element rootElement=xmlDeriverContext.getRootElement();
    XPath xpath=xmlDeriverContext.getXpath();
    String targetNS=rootElement.getAttribute("String_Node_Str");
    SrampModelUtils.setCustomProperty(artifact,"String_Node_Str",targetNS);
    if ("String_Node_Str".equals(artifact.getName()) && rootElement.hasAttribute("String_Node_Str")) {
      String name=rootElement.getAttribute("String_Node_Str");
      artifact.setName(name);
    }
    processComponents(derivedArtifacts,artifact,rootElement,xpath);
    processServices(derivedArtifacts,artifact,rootElement,xpath);
    processTransformers(derivedArtifacts,artifact,rootElement,xpath);
    processValidators(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  XPathExpressionException e) {
    throw new IOException(e);
  }
}
Program: 12996
Project: 12996
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    processRoot(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    processRoot(derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 12997
Project: 12997
Buggy source:
/** 
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object,boolean)
 */
@Override public void setValue(Map<String,String> value,boolean fireEvents){
  this.value=new HashMap<String,String>(value);
  clear();
  if (value == null || value.isEmpty()) {
  }
 else {
    Set<String> keys=new TreeSet<String>(value.keySet());
    for (    final String propName : keys) {
      String propValue=value.get(propName);
      InlineLabel propLabel=new InlineLabel(propName + "String_Node_Str");
      propLabel.setStyleName("String_Node_Str");
      CustomPropertyEditableInlineLabel propValueWidget=propValueLabelFactory.get();
      propValueWidget.addValueChangeHandler(new ValueChangeHandler<String>(){
        @Override public void onValueChange(        ValueChangeEvent<String> event){
          Map<String,String> newValue=new HashMap<String,String>(CustomPropertiesPanel.this.value);
          String val=event.getValue();
          if (val == null) {
            newValue.remove(propName);
          }
 else {
            newValue.put(propName,val);
          }
          setValue(newValue,true);
        }
      }
);
      propValueWidget.setValue(propValue);
      propValueWidget.setStyleName("String_Node_Str");
      InlineLabel clearFix=new InlineLabel();
      clearFix.setStyleName("String_Node_Str");
      add(propLabel);
      add(propValueWidget);
      add(clearFix);
    }
  }
  if (fireEvents) {
    ValueChangeEvent.fire(this,this.value);
  }
}

Fixed version (ground truth):
/** 
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object,boolean)
 */
@Override public void setValue(Map<String,String> value,boolean fireEvents){
  this.value=new HashMap<String,String>(value);
  clear();
  if (value == null || value.isEmpty()) {
  }
 else {
    Set<String> keys=new TreeSet<String>(value.keySet());
    for (    final String propName : keys) {
      String propValue=value.get(propName);
      Label propLabel=new Label(propName + "String_Node_Str");
      propLabel.setStyleName("String_Node_Str");
      CustomPropertyEditableInlineLabel propValueWidget=propValueLabelFactory.get();
      propValueWidget.addValueChangeHandler(new ValueChangeHandler<String>(){
        @Override public void onValueChange(        ValueChangeEvent<String> event){
          Map<String,String> newValue=new HashMap<String,String>(CustomPropertiesPanel.this.value);
          String val=event.getValue();
          if (val == null) {
            newValue.remove(propName);
          }
 else {
            newValue.put(propName,val);
          }
          setValue(newValue,true);
        }
      }
);
      propValueWidget.setValue(propValue);
      propValueWidget.setStyleName("String_Node_Str");
      Label clearFix=new Label();
      clearFix.setStyleName("String_Node_Str");
      add(propLabel);
      add(propValueWidget);
      add(clearFix);
    }
  }
  if (fireEvents) {
    ValueChangeEvent.fire(this,this.value);
  }
}
Program: 12998
Project: 12998
Buggy source:
/** 
 * @see org.overlord.sramp.integration.switchyard.model.SwitchYardArtifactVisitor#visitService(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType)
 */
@Override public void visitService(ExtendedArtifactType artifact){
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.integration.switchyard.model.SwitchYardArtifactVisitor#visitService(org.oasis_open.docs.s_ramp.ns.s_ramp_v1.ExtendedArtifactType)
 */
@Override public void visitService(ExtendedArtifactType artifact){
  Relationship relationship=SrampModelUtils.getGenericRelationship(artifact,SwitchYardModel.REL_IMPLEMENTS);
  if (relationship != null && relationship.getOtherAttributes().containsKey(SwitchYardXmlDeriver.UNRESOLVED_REF)) {
    String ref=relationship.getOtherAttributes().remove(SwitchYardXmlDeriver.UNRESOLVED_REF);
    if (ref.startsWith("String_Node_Str")) {
      String refInterfaceName=ref.substring(5);
      BaseArtifactType artifactRef=findJavaInterfaceArtifact(refInterfaceName);
      if (artifactRef != null) {
        Target target=new Target();
        target.setValue(artifactRef.getUuid());
        relationship.getRelationshipTarget().add(target);
      }
    }
 else     if (ref.startsWith("String_Node_Str")) {
      String refWsdl=ref.substring(5);
      BaseArtifactType artifactRef=findWsdlArtifact(refWsdl);
      if (artifactRef != null) {
        Target target=new Target();
        target.setValue(artifactRef.getUuid());
        relationship.getRelationshipTarget().add(target);
      }
    }
  }
}
Program: 12999
Project: 12999
Buggy source:
/** 
 * Create derived services found in the switchyard.xml.
 * @param derivedArtifacts
 * @param sourceArtifact
 * @param rootElement
 * @param xpath
 * @throws XPathExpressionException
 */
private void processServices(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType sourceArtifact,Element rootElement,XPath xpath) throws XPathExpressionException {
  NodeList nodes=(NodeList)this.query(xpath,rootElement,"String_Node_Str",XPathConstants.NODESET);
  for (int idx=0; idx < nodes.getLength(); idx++) {
    Element node=(Element)nodes.item(idx);
    String name=node.getAttribute("String_Node_Str");
    ExtendedArtifactType serviceArtifact=SwitchYardModel.newServiceArtifact(name);
    derivedArtifacts.add(serviceArtifact);
    if (node.hasAttribute("String_Node_Str")) {
      String promote=node.getAttribute("String_Node_Str");
      BaseArtifactType component=findComponentByName(derivedArtifacts,promote);
      if (component != null) {
        SrampModelUtils.addGenericRelationship(serviceArtifact,SwitchYardModel.REL_PROMOTES,component.getUuid());
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Create derived services found in the switchyard.xml.
 * @param derivedArtifacts
 * @param sourceArtifact
 * @param rootElement
 * @param xpath
 * @throws XPathExpressionException
 */
private void processServices(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType sourceArtifact,Element rootElement,XPath xpath) throws XPathExpressionException {
  NodeList nodes=(NodeList)this.query(xpath,rootElement,"String_Node_Str",XPathConstants.NODESET);
  for (int idx=0; idx < nodes.getLength(); idx++) {
    Element node=(Element)nodes.item(idx);
    String name=node.getAttribute("String_Node_Str");
    ExtendedArtifactType serviceArtifact=SwitchYardModel.newServiceArtifact(name);
    derivedArtifacts.add(serviceArtifact);
    if (node.hasAttribute("String_Node_Str")) {
      String promote=node.getAttribute("String_Node_Str");
      BaseArtifactType component=findComponentByName(derivedArtifacts,promote);
      if (component != null) {
        SrampModelUtils.addGenericRelationship(serviceArtifact,SwitchYardModel.REL_PROMOTES,component.getUuid());
      }
    }
    Element iface=(Element)this.query(xpath,node,"String_Node_Str",XPathConstants.NODE);
    if (iface != null) {
      if (iface.hasAttribute("String_Node_Str")) {
        String ifaceName=iface.getAttribute("String_Node_Str");
        Relationship relationship=SrampModelUtils.addGenericRelationship(serviceArtifact,SwitchYardModel.REL_IMPLEMENTS,null);
        relationship.getOtherAttributes().put(UNRESOLVED_REF,"String_Node_Str" + ifaceName);
      }
    }
    iface=(Element)this.query(xpath,node,"String_Node_Str",XPathConstants.NODE);
    if (iface != null) {
      if (iface.hasAttribute("String_Node_Str")) {
        String wsdlInfo=iface.getAttribute("String_Node_Str");
        Relationship relationship=SrampModelUtils.addGenericRelationship(serviceArtifact,SwitchYardModel.REL_IMPLEMENTS,null);
        relationship.getOtherAttributes().put(UNRESOLVED_REF,"String_Node_Str" + wsdlInfo);
      }
    }
  }
}
Program: 13001
Project: 13001
Buggy source:
/** 
 * Visits a switchyard artifact.
 * @param artifact
 * @param visitor
 */
public static final void visitArtifact(ExtendedArtifactType artifact,SwitchYardArtifactVisitor visitor){
  if (SwitchYardModel.SwitchYardService.equals(artifact.getExtendedType())) {
    visitor.visitService(artifact);
  }
 else   if (SwitchYardModel.SwitchYardComponent.equals(artifact.getExtendedType())) {
    visitor.visitComponent(artifact);
  }
 else   if (SwitchYardModel.SwitchYardTransformer.equals(artifact.getExtendedType())) {
    visitor.visitTransformer(artifact);
  }
 else   if (SwitchYardModel.SwitchYardValidator.equals(artifact.getExtendedType())) {
    visitor.visitValidator(artifact);
  }
 else {
    throw new RuntimeException(Messages.i18n.format("String_Node_Str",artifact.getExtendedType()));
  }
}

Fixed version (ground truth):
/** 
 * Visits a switchyard artifact.
 * @param artifact
 * @param visitor
 */
public static final void visitArtifact(ExtendedArtifactType artifact,SwitchYardArtifactVisitor visitor){
  if (SwitchYardModel.SwitchYardService.equals(artifact.getExtendedType())) {
    visitor.visitService(artifact);
  }
 else   if (SwitchYardModel.SwitchYardComponent.equals(artifact.getExtendedType())) {
    visitor.visitComponent(artifact);
  }
 else   if (SwitchYardModel.SwitchYardComponentService.equals(artifact.getExtendedType())) {
    visitor.visitComponentService(artifact);
  }
 else   if (SwitchYardModel.SwitchYardTransformer.equals(artifact.getExtendedType())) {
    visitor.visitTransformer(artifact);
  }
 else   if (SwitchYardModel.SwitchYardValidator.equals(artifact.getExtendedType())) {
    visitor.visitValidator(artifact);
  }
 else {
    throw new RuntimeException(Messages.i18n.format("String_Node_Str",artifact.getExtendedType()));
  }
}
Program: 13003
Project: 13003
Buggy source:
/** 
 * Derives content for the given artifact.
 * @param derivedArtifacts
 * @param artifact
 * @param rootElement
 * @param xpath
 * @throws IOException
 */
protected abstract void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException ;

Fixed version (ground truth):
/** 
 * Derives content for the given artifact.
 * @param derivedArtifacts
 * @param artifact
 * @param xmlDeriverContext
 * @throws IOException
 */
protected abstract void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException ;
Program: 13004
Project: 13004
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
}
Program: 13005
Project: 13005
Buggy source:
/** 
 * @see org.overlord.sramp.common.repository.derived.XsdDeriver#derive(org.overlord.sramp.common.repository.derived.IndexedArtifactCollection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  String targetNS=rootElement.getAttribute("String_Node_Str");
  ((WsdlDocument)artifact).setTargetNamespace(targetNS);
  try {
    processDefinitions((IndexedArtifactCollection)derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.XsdDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  String targetNS=xmlDeriverContext.getRootElement().getAttribute("String_Node_Str");
  ((WsdlDocument)artifact).setTargetNamespace(targetNS);
  try {
    processDefinitions((IndexedArtifactCollection)derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 13006
Project: 13006
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    processSchema(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    processSchema(derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 13007
Project: 13007
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.s_ramp.xmlns._2010.s_ramp.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    String targetNS=rootElement.getAttribute("String_Node_Str");
    SrampModelUtils.setCustomProperty(artifact,"String_Node_Str",targetNS);
    if ("String_Node_Str".equals(artifact.getName()) && rootElement.hasAttribute("String_Node_Str")) {
      String name=rootElement.getAttribute("String_Node_Str");
      artifact.setName(name);
    }
    processComponents(derivedArtifacts,artifact,rootElement,xpath);
    processServices(derivedArtifacts,artifact,rootElement,xpath);
    processTransformers(derivedArtifacts,artifact,rootElement,xpath);
    processValidators(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  XPathExpressionException e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    Element rootElement=xmlDeriverContext.getRootElement();
    XPath xpath=xmlDeriverContext.getXpath();
    String targetNS=rootElement.getAttribute("String_Node_Str");
    SrampModelUtils.setCustomProperty(artifact,"String_Node_Str",targetNS);
    if ("String_Node_Str".equals(artifact.getName()) && rootElement.hasAttribute("String_Node_Str")) {
      String name=rootElement.getAttribute("String_Node_Str");
      artifact.setName(name);
    }
    processComponents(derivedArtifacts,artifact,rootElement,xpath);
    processServices(derivedArtifacts,artifact,rootElement,xpath);
    processTransformers(derivedArtifacts,artifact,rootElement,xpath);
    processValidators(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  XPathExpressionException e) {
    throw new IOException(e);
  }
}
Program: 13008
Project: 13008
Buggy source:
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.w3c.dom.Element,javax.xml.xpath.XPath)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,Element rootElement,XPath xpath) throws IOException {
  try {
    processRoot(derivedArtifacts,artifact,rootElement,xpath);
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}

Fixed version (ground truth):
/** 
 * @see org.overlord.sramp.common.derived.AbstractXmlDeriver#derive(java.util.Collection,org.oasis_open.docs.s_ramp.ns.s_ramp_v1.BaseArtifactType,org.overlord.sramp.common.derived.AbstractXmlDeriver.XmlDeriverContext)
 */
@Override protected void derive(Collection<BaseArtifactType> derivedArtifacts,BaseArtifactType artifact,XmlDeriverContext xmlDeriverContext) throws IOException {
  try {
    processRoot(derivedArtifacts,artifact,xmlDeriverContext.getRootElement(),xmlDeriverContext.getXpath());
  }
 catch (  Exception e) {
    throw new IOException(e);
  }
}
Program: 13009
Project: 13009
Buggy source:
/** 
 * @see org.apache.maven.wagon.StreamWagon#fillInputData(org.apache.maven.wagon.InputData)
 */
@Override public void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException {
  Resource resource=inputData.getResource();
  if (resource.getName().contains("String_Node_Str"))   throw new ResourceDoesNotExistException(Messages.i18n.format("String_Node_Str",resource));
  logger.debug(Messages.i18n.format("String_Node_Str",resource));
  MavenGavInfo gavInfo=MavenGavInfo.fromResource(resource);
  if (gavInfo.isHash()) {
    doGetHash(gavInfo,inputData);
  }
 else {
    doGetArtifact(gavInfo,inputData);
  }
}

Fixed version (ground truth):
/** 
 * @see org.apache.maven.wagon.StreamWagon#fillInputData(org.apache.maven.wagon.InputData)
 */
@Override public void fillInputData(InputData inputData) throws TransferFailedException, ResourceDoesNotExistException, AuthorizationException {
  Resource resource=inputData.getResource();
  MavenGavInfo gavInfo=MavenGavInfo.fromResource(resource);
  if (gavInfo.isMavenMetaData() && gavInfo.getVersion() == null) {
    doGenerateArtifactDirMavenMetaData(gavInfo,inputData);
    return;
  }
  if (gavInfo.isMavenMetaData() && gavInfo.getVersion() != null) {
    doGenerateSnapshotMavenMetaData(gavInfo,inputData);
    return;
  }
  logger.debug(Messages.i18n.format("String_Node_Str",resource));
  if (gavInfo.isHash()) {
    doGetHash(gavInfo,inputData);
  }
 else {
    doGetArtifact(gavInfo,inputData);
  }
}
Program: 13010
Project: 13010
Buggy source:
/** 
 * Finds an existing artifact in the s-ramp repository that matches the GAV information.
 * @param client
 * @param gavInfo
 * @return an s-ramp artifact (if found) or null (if not found)
 * @throws SrampClientException
 * @throws SrampAtomException
 * @throws JAXBException
 */
private BaseArtifactType findExistingArtifactByGAV(SrampAtomApiClient client,MavenGavInfo gavInfo) throws SrampAtomException, SrampClientException, JAXBException {
  String query=null;
  if (gavInfo.getClassifier() == null) {
    query=String.format("String_Node_Str",gavInfo.getGroupId(),gavInfo.getArtifactId(),gavInfo.getVersion(),gavInfo.getType());
  }
 else {
    query=String.format("String_Node_Str",gavInfo.getGroupId(),gavInfo.getArtifactId(),gavInfo.getVersion(),gavInfo.getClassifier(),gavInfo.getType());
  }
  QueryResultSet rset=client.query(query);
  if (rset.size() > 0) {
    for (    ArtifactSummary summary : rset) {
      String uuid=summary.getUuid();
      ArtifactType artifactType=summary.getType();
      BaseArtifactType arty=client.getArtifactMetaData(artifactType,uuid);
      if (gavInfo.getClassifier() == null) {
        String artyClassifier=SrampModelUtils.getCustomProperty(arty,"String_Node_Str");
        if (artyClassifier == null) {
          return arty;
        }
      }
 else {
        return arty;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Finds an existing artifact in the s-ramp repository that matches the GAV information.
 * @param client
 * @param gavInfo
 * @return an s-ramp artifact (if found) or null (if not found)
 * @throws SrampClientException
 * @throws SrampAtomException
 * @throws JAXBException
 */
private BaseArtifactType findExistingArtifactByGAV(SrampAtomApiClient client,MavenGavInfo gavInfo) throws SrampAtomException, SrampClientException, JAXBException {
  SrampClientQuery clientQuery=null;
  if (gavInfo.getClassifier() == null) {
    clientQuery=client.buildQuery("String_Node_Str").parameter(gavInfo.getGroupId()).parameter(gavInfo.getArtifactId()).parameter(gavInfo.getVersion()).parameter(gavInfo.getType());
  }
 else {
    clientQuery=client.buildQuery("String_Node_Str").parameter(gavInfo.getGroupId()).parameter(gavInfo.getArtifactId()).parameter(gavInfo.getVersion()).parameter(gavInfo.getClassifier()).parameter(gavInfo.getType());
  }
  QueryResultSet rset=clientQuery.count(100).query();
  if (rset.size() > 0) {
    for (    ArtifactSummary summary : rset) {
      String uuid=summary.getUuid();
      ArtifactType artifactType=summary.getType();
      BaseArtifactType arty=client.getArtifactMetaData(artifactType,uuid);
      if (gavInfo.getClassifier() == null) {
        String artyClassifier=SrampModelUtils.getCustomProperty(arty,"String_Node_Str");
        if (artyClassifier == null) {
          return arty;
        }
      }
 else {
        return arty;
      }
    }
  }
  return null;
}