nus-yam/ex-repair huggingface dataset:
Program: 147536
Project: 147536
Buggy source:
private List<Object> deserializeJSONArray(Object object,JsonArray arr){
  List<Object> elems=new ArrayList<>();
  Iterator<JsonElement> elemIter=arr.iterator();
  while (elemIter.hasNext()) {
    JsonElement elem=elemIter.next();
    elems.add(deserializeJSON(object,(JsonObject)elem));
  }
  return elems;
}

Fixed version (ground truth):
private List<Object> deserializeJSONArray(String key,JsonArray arr) throws IllegalArgumentException, SecurityException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
  List<Object> elems=new ArrayList<>();
  Iterator<JsonElement> elemIter=arr.iterator();
  while (elemIter.hasNext()) {
    JsonElement elem=elemIter.next();
    elems.add(deserializeJSON(newInstance(objectClass.get(key)),(JsonObject)elem));
  }
  return elems;
}
Program: 147538
Project: 147538
Buggy source:
/** 
 * @return the store_route
 */
public Boolean isStore_route(){
  return store_route;
}

Fixed version (ground truth):
/** 
 * @return the store_route
 */
public Boolean isStore_route(){
  return getStore_route();
}
Program: 147539
Project: 147539
Buggy source:
/** 
 * @return the rt
 */
public Boolean isRt(){
  return rt;
}

Fixed version (ground truth):
/** 
 * @return the rt
 */
public Boolean isRt(){
  return getRt();
}
Program: 147540
Project: 147540
Buggy source:
/** 
 * @return the has_trailer
 */
public Boolean isHas_trailer(){
  return has_trailer;
}

Fixed version (ground truth):
/** 
 * @return the has_trailer
 */
public Boolean isHas_trailer(){
  return getHas_trailer();
}
Program: 147541
Project: 147541
Buggy source:
/** 
 * @return the lock_last
 */
public Boolean isLock_last(){
  return lock_last;
}

Fixed version (ground truth):
/** 
 * @return the lock_last
 */
public Boolean isLock_last(){
  return getLock_last();
}
Program: 147542
Project: 147542
Buggy source:
/** 
 * @return the disable_optimization
 */
public Boolean isDisable_optimization(){
  return disable_optimization;
}

Fixed version (ground truth):
/** 
 * @return the disable_optimization
 */
public Boolean isDisable_optimization(){
  return getDisable_optimization();
}
Program: 147543
Project: 147543
Buggy source:
public static void updateForeignKeyRelatedInfo(String oldValue,String newValue,Object[] allForeignKeyAndInfos){
  if (allForeignKeyAndInfos == null || allForeignKeyAndInfos.length == 0) {
    return;
  }
  for (  Object obj : allForeignKeyAndInfos) {
    Element e=(Element)obj;
    String nodeValue=e.getChildNodes().item(0).getNodeValue();
    String source=e.getAttribute("String_Node_Str");
    if (source.equals("String_Node_Str")) {
      StringBuilder build=new StringBuilder();
      String[] splits=nodeValue.split(FKFilterParser.endSeparator);
      for (      String str : splits) {
        if (!str.trim().isEmpty() && str.startsWith(oldValue)) {
          str=str.replaceFirst(oldValue,newValue);
        }
        build.append(str).append(FKFilterParser.endSeparator);
      }
      e.getChildNodes().item(0).setNodeValue(build.toString());
    }
 else {
      boolean changed=false;
      if (nodeValue.contains("String_Node_Str")) {
        changed=nodeValue.startsWith(oldValue + "String_Node_Str");
      }
 else {
        changed=nodeValue.startsWith(oldValue);
      }
      if (changed) {
        nodeValue=nodeValue.replaceFirst(oldValue,newValue);
        e.getChildNodes().item(0).setNodeValue(nodeValue);
      }
    }
  }
}

Fixed version (ground truth):
public static void updateForeignKeyRelatedInfo(String oldValue,String newValue,Object[] allForeignKeyAndInfos){
  if (allForeignKeyAndInfos == null || allForeignKeyAndInfos.length == 0) {
    return;
  }
  for (  Object obj : allForeignKeyAndInfos) {
    Element e=(Element)obj;
    String nodeValue=e.getChildNodes().item(0).getNodeValue();
    String source=e.getAttribute("String_Node_Str");
    if (source.equals("String_Node_Str")) {
      StringBuilder build=new StringBuilder();
      String[] splits=nodeValue.split(FKFilterParser.endSeparator);
      for (      String str : splits) {
        if (!str.trim().isEmpty() && str.startsWith(oldValue)) {
          str=str.replaceFirst(oldValue,newValue);
        }
        build.append(str).append(FKFilterParser.endSeparator);
      }
      e.getChildNodes().item(0).setNodeValue(build.toString());
    }
 else {
      if (nodeValue.equals(oldValue)) {
        e.getChildNodes().item(0).setNodeValue(newValue);
      }
    }
  }
}
Program: 147544
Project: 147544
Buggy source:
private static String getComponentName(Object component){
  if (component instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)component;
    return Messages.Util_34 + decl.getName() + Messages.Util_35;
  }
 else   if (component instanceof XSDParticle) {
    XSDParticle particle=(XSDParticle)component;
    XSDTerm term=particle.getTerm();
    if (term instanceof XSDElementDeclaration) {
      return Messages.Util_36 + ((XSDElementDeclaration)term).getName() + Messages.Util_37;
    }
  }
 else   if (component instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)component;
    return Messages.Util_36 + type.getName() + Messages.Util_37;
  }
 else   if (component instanceof XSDSimpleTypeDefinition) {
    return Messages.Util_38 + ((XSDSimpleTypeDefinition)component).getName() + Messages.Util_39;
  }
 else   if (component instanceof XSDIdentityConstraintDefinition) {
    XSDIdentityConstraintDefinition identify=(XSDIdentityConstraintDefinition)component;
    return Messages.Util_40 + identify.getName() + Messages.Util_41;
  }
 else   if (component instanceof XSDXPathDefinition) {
    XSDXPathDefinition path=(XSDXPathDefinition)component;
    return Messages.Util_42 + path.getValue() + Messages.Util_43;
  }
  return null;
}

Fixed version (ground truth):
public static String getComponentName(Object component){
  if (component instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)component;
    return Messages.Util_34 + decl.getName() + Messages.Util_35;
  }
 else   if (component instanceof XSDParticle) {
    XSDParticle particle=(XSDParticle)component;
    XSDTerm term=particle.getTerm();
    if (term instanceof XSDElementDeclaration) {
      return Messages.Util_36 + ((XSDElementDeclaration)term).getName() + Messages.Util_37;
    }
  }
 else   if (component instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)component;
    return Messages.Util_36 + type.getName() + Messages.Util_37;
  }
 else   if (component instanceof XSDSimpleTypeDefinition) {
    return Messages.Util_38 + ((XSDSimpleTypeDefinition)component).getName() + Messages.Util_39;
  }
 else   if (component instanceof XSDIdentityConstraintDefinition) {
    XSDIdentityConstraintDefinition identify=(XSDIdentityConstraintDefinition)component;
    return Messages.Util_40 + identify.getName() + Messages.Util_41;
  }
 else   if (component instanceof XSDXPathDefinition) {
    XSDXPathDefinition path=(XSDXPathDefinition)component;
    return Messages.Util_42 + path.getValue() + Messages.Util_43;
  }
  return null;
}
Program: 147545
Project: 147545
Buggy source:
public void setInfos(T[] objs){
  infos.clear();
  for (  T eachInputedObj : objs) {
    if (eachInputedObj == null) {
      continue;
    }
    infos.add(eachInputedObj);
  }
  tvInfos.setInput(infos);
  tvInfos.refresh();
}

Fixed version (ground truth):
public void setInfos(T[] objs){
  infos.clear();
  for (  T eachInputedObj : objs) {
    if (eachInputedObj == null) {
      continue;
    }
    infos.add(eachInputedObj);
  }
  tvInfos.refresh();
}
Program: 147546
Project: 147546
Buggy source:
/** 
 * random length, random content
 */
private String buildArbitraryString(String candidateChars,int resultMaxLen){
  StringBuilder builder=new StringBuilder();
  if (candidateChars != null) {
    int wholeLen=candidateChars.length();
    if (resultMaxLen < 1) {
      resultMaxLen=10;
    }
    char[] charArray=candidateChars.toCharArray();
    int randomIntValue=new Double(Math.floor(Math.random() * 100)).intValue();
    int size=randomIntValue % resultMaxLen;
    for (int i=0; i < size; i++) {
      int index=new Double(Math.floor(Math.random() * wholeLen)).intValue();
      builder.append(charArray[index]);
    }
  }
  return builder.toString();
}

Fixed version (ground truth):
/** 
 * random length, random content
 */
private String buildArbitraryString(String candidateChars,int resultMaxLen){
  StringBuilder builder=new StringBuilder();
  if (candidateChars != null) {
    int wholeLen=candidateChars.length();
    if (resultMaxLen < 1) {
      resultMaxLen=10;
    }
    char[] charArray=candidateChars.toCharArray();
    int randomIntValue=new Double(Math.floor(Math.random() * 100)).intValue();
    int size=randomIntValue % resultMaxLen + 1;
    for (int i=0; i < size; i++) {
      int index=new Double(Math.floor(Math.random() * wholeLen)).intValue();
      builder.append(charArray[index]);
    }
  }
  return builder.toString();
}
Program: 147547
Project: 147547
Buggy source:
private ReferenceFileItem findReferenceFileItem(Item item,IFile file){
  EList referenceResources=item.getReferenceResources();
  if (referenceResources != null) {
    for (    Object refObj : referenceResources) {
      ReferenceFileItem fileItem=(ReferenceFileItem)refObj;
      String name=fileItem.getName() + "String_Node_Str" + fileItem.getExtension();
      if (name != null && name.equals(file.getName())) {
        return fileItem;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
private ReferenceFileItem findReferenceFileItem(Item item,IFile file){
  EList referenceResources=item.getReferenceResources();
  if (referenceResources != null) {
    for (    Object refObj : referenceResources) {
      ReferenceFileItem fileItem=(ReferenceFileItem)refObj;
      String name=null;
      if (fileItem.getName() != null) {
        name=fileItem.getName() + "String_Node_Str" + fileItem.getExtension();
      }
 else {
        URI uri=fileItem.getContent().eResource().getURI();
        name=uri.lastSegment();
      }
      if (name != null && name.equals(file.getName())) {
        return fileItem;
      }
    }
  }
  return null;
}
Program: 147549
Project: 147549
Buggy source:
private static String getTopElement(XSDElementDeclaration parent,XSDElementDeclaration son,XSDComplexTypeDefinition type){
  List<XSDComplexTypeDefinition> hierarchyComplexTypes=getAllSuperComplexTypes(type);
  for (  XSDComplexTypeDefinition complexType : hierarchyComplexTypes) {
    if (complexType.getContent() instanceof XSDParticle) {
      XSDParticle particle=(XSDParticle)complexType.getContent();
      if (particle.getTerm() instanceof XSDModelGroup) {
        XSDModelGroup group=(XSDModelGroup)particle.getTerm();
        EList<XSDParticle> elist=group.getContents();
        for (        XSDParticle pt : elist) {
          if (pt.getContent() instanceof XSDElementDeclaration) {
            XSDElementDeclaration ele=(XSDElementDeclaration)pt.getContent();
            if (ele == son) {
              return ele.getName();
            }
          }
        }
      }
    }
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
private static String getTopElement(XSDElementDeclaration parent,XSDElementDeclaration son){
  XSDTypeDefinition type=parent.getTypeDefinition();
  if (!(type instanceof XSDComplexTypeDefinition)) {
    return null;
  }
  List<XSDComplexTypeDefinition> hierarchyComplexTypes=getAllSuperComplexTypes((XSDComplexTypeDefinition)type);
  for (  XSDComplexTypeDefinition complexType : hierarchyComplexTypes) {
    if (complexType.getContent() instanceof XSDParticle) {
      XSDParticle particle=(XSDParticle)complexType.getContent();
      if (particle.getTerm() instanceof XSDModelGroup) {
        XSDModelGroup group=(XSDModelGroup)particle.getTerm();
        EList<XSDParticle> elist=group.getContents();
        for (        XSDParticle pt : elist) {
          if (pt.getContent() instanceof XSDElementDeclaration) {
            XSDElementDeclaration ele=(XSDElementDeclaration)pt.getContent();
            if (ele == son) {
              return ele.getName();
            }
          }
        }
      }
    }
  }
  return "String_Node_Str";
}
Program: 147550
Project: 147550
Buggy source:
public static void getForeignKeyofParcle(Set<String> list,XSDAnnotation annotation){
  if (annotation != null) {
    List<Element> annotList=annotation.getApplicationInformation();
    for (int k=0; k < annotList.size(); k++) {
      if ("String_Node_Str".equals(annotList.get(k).getLocalName())) {
        Node source=annotList.get(k).getAttributes().getNamedItem("String_Node_Str");
        if (source == null) {
          continue;
        }
        String appinfoSource=annotList.get(k).getAttributes().getNamedItem("String_Node_Str").getNodeValue();
        if ("String_Node_Str".equals(appinfoSource)) {
          String path=annotList.get(k).getFirstChild().getNodeValue();
          list.add(getConceptFromPath(path));
        }
      }
    }
  }
}

Fixed version (ground truth):
public static void getForeignKeyofParcle(Set<String> list,XSDAnnotation annotation){
  if (annotation != null) {
    List<Element> annotList=annotation.getApplicationInformation();
    for (int k=0; k < annotList.size(); k++) {
      if ("String_Node_Str".equals(annotList.get(k).getLocalName())) {
        Node source=annotList.get(k).getAttributes().getNamedItem("String_Node_Str");
        if (source == null) {
          continue;
        }
        String appinfoSource=source.getNodeValue();
        if ("String_Node_Str".equals(appinfoSource)) {
          String path=annotList.get(k).getFirstChild().getNodeValue();
          list.add(getConceptFromPath(path));
        }
      }
    }
  }
}
Program: 147551
Project: 147551
Buggy source:
/** 
 * set the list with foreign concept name of in the element
 * @author ymli
 * @param list
 * @param element
 */
public static void getforeignKeyOfElement(Set<String> list,XSDElementDeclaration element){
  if (element.getAnnotation() != null) {
    getForeignKeyofParcle(list,element.getAnnotation());
  }
  if (element.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeContent fromcomplexType=((XSDComplexTypeDefinition)element.getTypeDefinition()).getContent();
    if (fromcomplexType instanceof XSDParticle) {
      XSDParticle particle=(XSDParticle)fromcomplexType;
      if (particle.getTerm() instanceof XSDModelGroup) {
        XSDModelGroup modelGroup=((XSDModelGroup)particle.getTerm());
        EList<XSDParticle> fromlist=modelGroup.getContents();
        for (        XSDParticle el : fromlist.toArray(new XSDParticle[fromlist.size()])) {
          XSDTerm term=el.getTerm();
          if (term instanceof XSDElementDeclaration) {
            if (isReferrenced(element,(XSDElementDeclaration)term)) {
              continue;
            }
            XSDAnnotation annotation=((XSDElementDeclaration)term).getAnnotation();
            if (annotation != null) {
              getForeignKeyofParcle(list,annotation);
            }
            getforeignKeyOfElement(list,(XSDElementDeclaration)term);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * set the list with foreign concept name of in the element
 * @author ymli
 * @param list
 * @param element
 */
public static void getforeignKeyOfElement(Set<String> list,XSDElementDeclaration element){
  if (element != null) {
    if (element.getAnnotation() != null) {
      getForeignKeyofParcle(list,element.getAnnotation());
    }
    if (element.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
      XSDComplexTypeContent fromcomplexType=((XSDComplexTypeDefinition)element.getTypeDefinition()).getContent();
      if (fromcomplexType instanceof XSDParticle) {
        XSDParticle particle=(XSDParticle)fromcomplexType;
        if (particle.getTerm() instanceof XSDModelGroup) {
          XSDModelGroup modelGroup=((XSDModelGroup)particle.getTerm());
          EList<XSDParticle> fromlist=modelGroup.getContents();
          for (          XSDParticle el : fromlist.toArray(new XSDParticle[fromlist.size()])) {
            XSDTerm term=el.getTerm();
            if (term instanceof XSDElementDeclaration) {
              if (isReferrenced(element,(XSDElementDeclaration)term)) {
                continue;
              }
              getforeignKeyOfElement(list,(XSDElementDeclaration)term);
            }
          }
        }
      }
    }
  }
}
Program: 147552
Project: 147552
Buggy source:
private static ArrayList<XSDElementDeclaration> findOutAllSonElements(XSDElementDeclaration decl,Set<XSDConcreteComponent> complexTypes){
  ArrayList<XSDElementDeclaration> holder=new ArrayList<XSDElementDeclaration>();
  if (decl.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)decl.getTypeDefinition();
    if (complexTypes.contains(type)) {
      return holder;
    }
    if (type.getContent() instanceof XSDParticle) {
      XSDParticle particle=(XSDParticle)type.getContent();
      if (particle.getTerm() instanceof XSDModelGroup) {
        XSDModelGroup group=(XSDModelGroup)particle.getTerm();
        EList<XSDParticle> elist=group.getContents();
        boolean addComplexType=false;
        for (        XSDParticle pt : elist) {
          if (pt.getContent() instanceof XSDElementDeclaration) {
            XSDElementDeclaration elem=(XSDElementDeclaration)pt.getContent();
            if (!addComplexType) {
              complexTypes.add(type);
              addComplexType=true;
            }
            if (StringUtils.equals(elem.getName(),decl.getName())) {
              if (ObjectUtils.equals(elem.getType(),decl.getType())) {
                if (StringUtils.equals(elem.getTargetNamespace(),decl.getTargetNamespace())) {
                  continue;
                }
              }
            }
            holder.add(elem);
          }
        }
      }
    }
  }
  return holder;
}

Fixed version (ground truth):
private static List<XSDElementDeclaration> findOutAllSonElements(XSDElementDeclaration decl,Set<XSDConcreteComponent> complexTypes){
  List<XSDElementDeclaration> holder=new ArrayList<XSDElementDeclaration>();
  if (decl.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)decl.getTypeDefinition();
    if (complexTypes.contains(type)) {
      return holder;
    }
    if (type.getContent() instanceof XSDParticle) {
      XSDParticle particle=(XSDParticle)type.getContent();
      if (particle.getTerm() instanceof XSDModelGroup) {
        XSDModelGroup group=(XSDModelGroup)particle.getTerm();
        EList<XSDParticle> elist=group.getContents();
        boolean addComplexType=false;
        for (        XSDParticle pt : elist) {
          if (pt.getContent() instanceof XSDElementDeclaration) {
            XSDElementDeclaration elem=(XSDElementDeclaration)pt.getContent();
            if (!addComplexType) {
              complexTypes.add(type);
              addComplexType=true;
            }
            if (StringUtils.equals(elem.getName(),decl.getName())) {
              if (ObjectUtils.equals(elem.getType(),decl.getType())) {
                if (StringUtils.equals(elem.getTargetNamespace(),decl.getTargetNamespace())) {
                  continue;
                }
              }
            }
            holder.add(elem);
          }
        }
      }
    }
  }
  return holder;
}
Program: 147553
Project: 147553
Buggy source:
public static Object[] filterOutDuplicatedElems(XSDNamedComponent[] checkedElements){
  List<XSDNamedComponent> list=new ArrayList<XSDNamedComponent>();
  for (  XSDNamedComponent el : checkedElements) {
    boolean exist=false;
    for (    XSDNamedComponent xsdEl : list) {
      if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() != null && el.getTargetNamespace() != null && xsdEl.getTargetNamespace().equals(el.getTargetNamespace())) {
        exist=true;
        break;
      }
 else       if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() == null && el.getTargetNamespace() == null) {
        exist=true;
        break;
      }
    }
    if (!exist && (el.getTargetNamespace() != null && !el.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) || el.getTargetNamespace() == null) {
      list.add(el);
    }
  }
  return list.toArray(new Object[]{});
}

Fixed version (ground truth):
public static Object[] filterOutDuplicatedElems(XSDNamedComponent[] checkedElements){
  List<XSDNamedComponent> list=new ArrayList<XSDNamedComponent>();
  for (  XSDNamedComponent el : checkedElements) {
    boolean exist=false;
    for (    XSDNamedComponent xsdEl : list) {
      if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() != null && el.getTargetNamespace() != null && xsdEl.getTargetNamespace().equals(el.getTargetNamespace())) {
        exist=true;
        break;
      }
 else       if (xsdEl.getName().equals(el.getName()) && xsdEl.getTargetNamespace() == null && el.getTargetNamespace() == null) {
        exist=true;
        break;
      }
    }
    if (!exist && ((el.getTargetNamespace() != null && !el.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) || el.getTargetNamespace() == null)) {
      list.add(el);
    }
  }
  return list.toArray(new Object[]{});
}
Program: 147554
Project: 147554
Buggy source:
public static boolean checkConcept(XSDElementDeclaration decl){
  boolean isConcept=false;
  EList l=decl.getIdentityConstraintDefinitions();
  for (Iterator iter=l.iterator(); iter.hasNext(); ) {
    XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)iter.next();
    if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) {
      isConcept=true;
      break;
    }
  }
  return isConcept;
}

Fixed version (ground truth):
public static boolean checkConcept(XSDElementDeclaration decl){
  boolean isConcept=false;
  EList<XSDIdentityConstraintDefinition> list=decl.getIdentityConstraintDefinitions();
  for (Iterator<XSDIdentityConstraintDefinition> iter=list.iterator(); iter.hasNext(); ) {
    XSDIdentityConstraintDefinition icd=iter.next();
    if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL)) {
      isConcept=true;
      break;
    }
  }
  return isConcept;
}
Program: 147555
Project: 147555
Buggy source:
private static String getComponentName(Object component){
  if (component instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)component;
    return Messages.Util_34 + decl.getName() + Messages.Util_35;
  }
 else   if (component instanceof XSDParticle) {
    XSDParticle particle=(XSDParticle)component;
    XSDTerm term=particle.getTerm();
    if (term instanceof XSDElementDeclaration) {
      return Messages.Util_36 + ((XSDElementDeclaration)term).getName() + Messages.Util_37;
    }
  }
 else   if (component instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)component;
    return type.getName();
  }
 else   if (component instanceof XSDSimpleTypeDefinition) {
    return Messages.Util_38 + ((XSDSimpleTypeDefinition)component).getName() + Messages.Util_39;
  }
 else   if (component instanceof XSDIdentityConstraintDefinition) {
    XSDIdentityConstraintDefinition identify=(XSDIdentityConstraintDefinition)component;
    XSDConcreteComponent c=identify.getContainer();
    return Messages.Util_40 + identify.getName() + Messages.Util_41;
  }
 else   if (component instanceof XSDXPathDefinition) {
    XSDXPathDefinition path=(XSDXPathDefinition)component;
    return Messages.Util_42 + path.getValue() + Messages.Util_43;
  }
  return null;
}

Fixed version (ground truth):
private static String getComponentName(Object component){
  if (component instanceof XSDElementDeclaration) {
    XSDElementDeclaration decl=(XSDElementDeclaration)component;
    return Messages.Util_34 + decl.getName() + Messages.Util_35;
  }
 else   if (component instanceof XSDParticle) {
    XSDParticle particle=(XSDParticle)component;
    XSDTerm term=particle.getTerm();
    if (term instanceof XSDElementDeclaration) {
      return Messages.Util_36 + ((XSDElementDeclaration)term).getName() + Messages.Util_37;
    }
  }
 else   if (component instanceof XSDComplexTypeDefinition) {
    XSDComplexTypeDefinition type=(XSDComplexTypeDefinition)component;
    return Messages.Util_36 + type.getName() + Messages.Util_37;
  }
 else   if (component instanceof XSDSimpleTypeDefinition) {
    return Messages.Util_38 + ((XSDSimpleTypeDefinition)component).getName() + Messages.Util_39;
  }
 else   if (component instanceof XSDIdentityConstraintDefinition) {
    XSDIdentityConstraintDefinition identify=(XSDIdentityConstraintDefinition)component;
    return Messages.Util_40 + identify.getName() + Messages.Util_41;
  }
 else   if (component instanceof XSDXPathDefinition) {
    XSDXPathDefinition path=(XSDXPathDefinition)component;
    return Messages.Util_42 + path.getValue() + Messages.Util_43;
  }
  return null;
}
Program: 147557
Project: 147557
Buggy source:
public static List<XSDComplexTypeDefinition> getComplexTypes(XSDSchema xsd){
  EList<XSDTypeDefinition> contents=xsd.getTypeDefinitions();
  List<XSDComplexTypeDefinition> complexs=new ArrayList<XSDComplexTypeDefinition>();
  for (  XSDTypeDefinition type : contents) {
    if (type instanceof XSDComplexTypeDefinition) {
      boolean exist=false;
      for (      XSDComplexTypeDefinition xsdEl : complexs) {
        if (xsdEl.getName().equals(type.getName()) && xsdEl.getTargetNamespace() != null && type.getTargetNamespace() != null && xsdEl.getTargetNamespace().equals(type.getTargetNamespace())) {
          exist=true;
          break;
        }
 else         if (xsdEl.getTargetNamespace() == null && type.getTargetNamespace() == null && xsdEl.getName().equals(type.getName())) {
          exist=true;
          break;
        }
      }
      if (!exist && (type.getTargetNamespace() != null && !type.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) || type.getTargetNamespace() == null) {
        complexs.add((XSDComplexTypeDefinition)type);
      }
    }
  }
  return complexs;
}

Fixed version (ground truth):
public static List<XSDComplexTypeDefinition> getComplexTypes(XSDSchema xsd){
  EList<XSDTypeDefinition> contents=xsd.getTypeDefinitions();
  List<XSDComplexTypeDefinition> complexs=new ArrayList<XSDComplexTypeDefinition>();
  for (  XSDTypeDefinition type : contents) {
    if (type instanceof XSDComplexTypeDefinition) {
      boolean exist=false;
      for (      XSDComplexTypeDefinition xsdEl : complexs) {
        if (xsdEl.getName().equals(type.getName()) && xsdEl.getTargetNamespace() != null && type.getTargetNamespace() != null && xsdEl.getTargetNamespace().equals(type.getTargetNamespace())) {
          exist=true;
          break;
        }
 else         if (xsdEl.getTargetNamespace() == null && type.getTargetNamespace() == null && xsdEl.getName().equals(type.getName())) {
          exist=true;
          break;
        }
      }
      if (!exist && ((type.getTargetNamespace() != null && !type.getTargetNamespace().equals(XSDConstants.SCHEMA_FOR_SCHEMA_URI_2001)) || type.getTargetNamespace() == null)) {
        complexs.add((XSDComplexTypeDefinition)type);
      }
    }
  }
  return complexs;
}
Program: 147558
Project: 147558
Buggy source:
public static String[] getTextNodes(Node contextNode,String xPath,Node namespaceNode) throws XtentisException {
  String[] results=null;
  ;
  if (xPath.startsWith("String_Node_Str") && xPath.endsWith("String_Node_Str")) {
    return new String[]{xPath.substring(1,xPath.length() - 1)};
  }
  if (!xPath.matches("String_Node_Str")) {
    if (!xPath.endsWith("String_Node_Str")) {
      xPath+="String_Node_Str";
    }
  }
  try {
    XObject xo=XPathAPI.eval(contextNode,xPath,namespaceNode);
    if (xo.getType() == XObject.CLASS_NODESET) {
      NodeList l=xo.nodelist();
      int len=l.getLength();
      results=new String[len];
      for (int i=0; i < len; i++) {
        Node n=l.item(i);
        results[i]=n.getNodeValue();
      }
    }
 else {
      results=new String[]{xo.toString()};
    }
  }
 catch (  Exception e) {
    String err=Messages.Util_18 + xPath + Messages.Util_19+ e.getClass().getName()+ Messages.Util_20+ e.getLocalizedMessage();
    throw new XtentisException(err);
  }
  return results;
}

Fixed version (ground truth):
public static String[] getTextNodes(Node contextNode,String xPath,Node namespaceNode) throws XtentisException {
  String[] results=null;
  if (xPath.startsWith("String_Node_Str") && xPath.endsWith("String_Node_Str")) {
    return new String[]{xPath.substring(1,xPath.length() - 1)};
  }
  if (!xPath.matches("String_Node_Str")) {
    if (!xPath.endsWith("String_Node_Str")) {
      xPath+="String_Node_Str";
    }
  }
  try {
    XObject xo=XPathAPI.eval(contextNode,xPath,namespaceNode);
    if (xo.getType() == XObject.CLASS_NODESET) {
      NodeList l=xo.nodelist();
      int len=l.getLength();
      results=new String[len];
      for (int i=0; i < len; i++) {
        Node n=l.item(i);
        results[i]=n.getNodeValue();
      }
    }
 else {
      results=new String[]{xo.toString()};
    }
  }
 catch (  Exception e) {
    String err=Messages.Util_18 + xPath + Messages.Util_19+ e.getClass().getName()+ Messages.Util_20+ e.getLocalizedMessage();
    throw new XtentisException(err);
  }
  return results;
}
Program: 147559
Project: 147559
Buggy source:
/** 
 * the all the typeDefinition in the schema
 * @author ymli
 * @param schema
 * @return
 */
public static HashMap<String,XSDTypeDefinition> getTypeDefinition(XSDSchema schema){
  HashMap<String,XSDTypeDefinition> map=new HashMap<String,XSDTypeDefinition>();
  for (  XSDSchemaContent content : schema.getContents()) {
    if (content instanceof XSDTypeDefinition) {
      map.put(((XSDTypeDefinition)content).getName(),(XSDTypeDefinition)content);
    }
  }
  return map;
}

Fixed version (ground truth):
/** 
 * the all the typeDefinition in the schema
 * @author ymli
 * @param schema
 * @return
 */
public static Map<String,XSDTypeDefinition> getTypeDefinition(XSDSchema schema){
  HashMap<String,XSDTypeDefinition> map=new HashMap<String,XSDTypeDefinition>();
  for (  XSDSchemaContent content : schema.getContents()) {
    if (content instanceof XSDTypeDefinition) {
      map.put(((XSDTypeDefinition)content).getName(),(XSDTypeDefinition)content);
    }
  }
  return map;
}
Program: 147560
Project: 147560
Buggy source:
public static List<Object> getTopParent(Object son){
  if (!((son instanceof XSDElementDeclaration) || (son instanceof XSDParticle))) {
    return null;
  }
  XSDElementDeclaration elem=null;
  elem=(XSDElementDeclaration)son;
  if (elem.getSchema() == null) {
    return null;
  }
  EList<XSDSchemaContent> parentList=elem.getSchema().getContents();
  List<Object> list=new ArrayList<Object>();
  for (  XSDSchemaContent top : parentList) {
    list.clear();
    if (!(top instanceof XSDElementDeclaration)) {
      continue;
    }
    if (top instanceof XSDElementDeclaration) {
      XSDElementDeclaration decl=(XSDElementDeclaration)top;
      if (decl.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
        String primaryKey=getTopElement(decl,elem,(XSDComplexTypeDefinition)decl.getTypeDefinition());
        if (!"String_Node_Str".equalsIgnoreCase(primaryKey)) {
          EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
          for (          XSDIdentityConstraintDefinition idty : idtylist) {
            EList<XSDXPathDefinition> fields=idty.getFields();
            for (            XSDXPathDefinition path : fields) {
              if ((path.getValue()).equals(primaryKey)) {
                list.add(idty);
                list.add(path);
                return list;
              }
            }
          }
        }
      }
    }
  }
  return null;
}

Fixed version (ground truth):
public static List<Object> getTopParent(Object son){
  if (!((son instanceof XSDElementDeclaration))) {
    return null;
  }
  XSDElementDeclaration elem=null;
  elem=(XSDElementDeclaration)son;
  if (elem.getSchema() == null) {
    return null;
  }
  EList<XSDSchemaContent> parentList=elem.getSchema().getContents();
  List<Object> list=new ArrayList<Object>();
  for (  XSDSchemaContent top : parentList) {
    list.clear();
    if (!(top instanceof XSDElementDeclaration)) {
      continue;
    }
    XSDElementDeclaration decl=(XSDElementDeclaration)top;
    if (decl.getTypeDefinition() instanceof XSDComplexTypeDefinition) {
      String primaryKey=getTopElement(decl,elem);
      if (!"String_Node_Str".equalsIgnoreCase(primaryKey)) {
        EList<XSDIdentityConstraintDefinition> idtylist=decl.getIdentityConstraintDefinitions();
        for (        XSDIdentityConstraintDefinition idty : idtylist) {
          EList<XSDXPathDefinition> fields=idty.getFields();
          for (          XSDXPathDefinition path : fields) {
            if ((path.getValue()).equals(primaryKey)) {
              list.add(idty);
              list.add(path);
              return list;
            }
          }
        }
      }
    }
  }
  return null;
}
Program: 147561
Project: 147561
Buggy source:
private static XSDElementDeclaration findOutSpecialSonElement(XSDElementDeclaration parent,XSDElementDeclaration son,Set<XSDConcreteComponent> complexTypes){
  ArrayList<XSDElementDeclaration> particleElemList=findOutAllSonElements(parent,complexTypes);
  XSDElementDeclaration specialParent=null;
  for (  XSDElementDeclaration e : particleElemList) {
    if (e == son) {
      specialParent=parent;
    }
  }
  if (specialParent == null) {
    for (    XSDElementDeclaration e : particleElemList) {
      specialParent=findOutSpecialSonElement(e,son,complexTypes);
      if (specialParent != null) {
        break;
      }
    }
  }
  return specialParent;
}

Fixed version (ground truth):
private static XSDElementDeclaration findOutSpecialSonElement(XSDElementDeclaration parent,XSDElementDeclaration son,Set<XSDConcreteComponent> complexTypes){
  List<XSDElementDeclaration> particleElemList=findOutAllSonElements(parent,complexTypes);
  XSDElementDeclaration specialParent=null;
  for (  XSDElementDeclaration e : particleElemList) {
    if (e == son) {
      specialParent=parent;
      break;
    }
  }
  if (specialParent == null) {
    for (    XSDElementDeclaration e : particleElemList) {
      specialParent=findOutSpecialSonElement(e,son,complexTypes);
      if (specialParent != null) {
        break;
      }
    }
  }
  return specialParent;
}
Program: 147563
Project: 147563
Buggy source:
public static String getContextPath(String urlPath){
  String contextPath="String_Node_Str";
  String path=urlPath;
  int index=path.indexOf("String_Node_Str");
  if (index != -1 && index != 0) {
    contextPath=path.substring(0,index);
  }
  return contextPath;
}

Fixed version (ground truth):
public static String getContextPath(String urlPath){
  String contextPath="String_Node_Str";
  if (urlPath != null) {
    String path=urlPath;
    int index=path.indexOf("String_Node_Str");
    if (index != -1 && index != 0) {
      contextPath=path.substring(0,index);
    }
  }
  return contextPath;
}
Program: 147565
Project: 147565
Buggy source:
public static XSDElementDeclaration findReference(String refName,XSDSchema schema){
  EList<XSDElementDeclaration> eDecls=schema.getElementDeclarations();
  if (refName.indexOf("String_Node_Str") != -1) {
    refName=refName.substring(0,refName.indexOf("String_Node_Str"));
  }
  for (  XSDElementDeclaration d : eDecls) {
    if (d.getQName().equals(refName)) {
      return d;
    }
  }
  return null;
}

Fixed version (ground truth):
public static XSDElementDeclaration findReference(String refName,XSDSchema schema){
  if (refName != null && schema != null) {
    EList<XSDElementDeclaration> eDecls=schema.getElementDeclarations();
    if (refName.indexOf("String_Node_Str") != -1) {
      refName=refName.substring(0,refName.indexOf("String_Node_Str"));
    }
    for (    XSDElementDeclaration d : eDecls) {
      if (d.getQName().equals(refName)) {
        return d;
      }
    }
  }
  return null;
}
Program: 147566
Project: 147566
Buggy source:
public boolean isShownInResultDialog(IRepositoryViewObject viewObj){
  return true;
}

Fixed version (ground truth):
@Override public boolean isShownInResultDialog(IRepositoryViewObject viewObj){
  return true;
}
Program: 147567
Project: 147567
Buggy source:
public void assertPropertyIsInited(Item item){
}

Fixed version (ground truth):
@Override public void assertPropertyIsInited(Item item){
}
Program: 147568
Project: 147568
Buggy source:
public boolean doDeployWSObject(TMDMService service,Object wsObj){
  return false;
}

Fixed version (ground truth):
@Override public boolean doDeployWSObject(TMDMService service,Object wsObj){
  return false;
}
Program: 147569
Project: 147569
Buggy source:
public List<IRepositoryViewObject> getAssociatedObjects(IRepositoryViewObject obj){
  return null;
}

Fixed version (ground truth):
@Override public List<IRepositoryViewObject> getAssociatedObjects(IRepositoryViewObject obj){
  return null;
}
Program: 147570
Project: 147570
Buggy source:
public Object convert(Item item,MDMServerObject serverObj){
  Object wsObj=Bean2EObjUtil.getInstance().convertFromEObj2Bean(serverObj);
  return wsObj;
}

Fixed version (ground truth):
@Override public Object convert(Item item,MDMServerObject serverObj){
  Object wsObj=Bean2EObjUtil.getInstance().convertFromEObj2Bean(serverObj);
  return wsObj;
}
Program: 147571
Project: 147571
Buggy source:
protected TMDMService getService(MDMServerDef serverDef) throws XtentisException {
  return RepositoryWebServiceAdapter.getMDMService(serverDef);
}

Fixed version (ground truth):
protected TMDMService getService(MDMServerDef serverDef) throws XtentisException {
  boolean workInUI=UIUtil.isWorkInUI();
  return RepositoryWebServiceAdapter.getMDMService(serverDef,workInUI);
}
Program: 147572
Project: 147572
Buggy source:
public boolean remove(AbstractDeployCommand cmd) throws XtentisException {
  TMDMService service=getService(cmd.getServerDef());
  return doRemove(service,cmd);
}

Fixed version (ground truth):
@Override public boolean remove(AbstractDeployCommand cmd) throws XtentisException {
  TMDMService service=getService(cmd.getServerDef());
  return doRemove(service,cmd);
}
Program: 147573
Project: 147573
Buggy source:
public boolean deploy(AbstractDeployCommand cmd) throws XtentisException {
  IRepositoryViewObject viewObj=cmd.getViewObject();
  Item item=viewObj.getProperty().getItem();
  MDMServerObject serverObject=((MDMServerObjectItem)item).getMDMServerObject();
  Object wsObj=convert(item,serverObject);
  TMDMService service=getService(cmd.getServerDef());
  return doDeployWSObject(service,wsObj);
}

Fixed version (ground truth):
@Override public boolean deploy(AbstractDeployCommand cmd) throws XtentisException {
  IRepositoryViewObject viewObj=cmd.getViewObject();
  Item item=viewObj.getProperty().getItem();
  MDMServerObject serverObject=((MDMServerObjectItem)item).getMDMServerObject();
  Object wsObj=convert(item,serverObject);
  TMDMService service=getService(cmd.getServerDef());
  return doDeployWSObject(service,wsObj);
}
Program: 147574
Project: 147574
Buggy source:
@Override protected void doRun(){
  new Thread(new Runnable(){
    @Override public void run(){
      UIJob openJob=new OpenJob();
      if (exAdapter != null) {
        exAdapter.beforeRun(openJob);
      }
      openJob.schedule();
    }
  }
).start();
}

Fixed version (ground truth):
@Override protected void doRun(){
  new Thread(new Runnable(){
    @Override public void run(){
      UIJob openJob=new OpenJob();
      if (exAdapter != null) {
        if (toOpenDatamodel()) {
          exAdapter.beforeRun(openJob);
        }
      }
      openJob.schedule();
    }
    private boolean toOpenDatamodel(){
      boolean toOpenDatamodel=false;
      List<Object> selectedObject=getSelectedObject();
      if (!selectedObject.isEmpty()) {
        Object object=selectedObject.get(0);
        if (object instanceof IRepositoryViewObject) {
          IRepositoryViewObject viewObj=(IRepositoryViewObject)object;
          toOpenDatamodel=viewObj.getRepositoryObjectType() == IServerObjectRepositoryType.TYPE_DATAMODEL;
        }
      }
      return toOpenDatamodel;
    }
  }
).start();
}
Program: 147575
Project: 147575
Buggy source:
private CommandManager(){
  exAdapter=ExAdapterManager.getAdapter(this,ICommandManagerExAdapter.class);
}

Fixed version (ground truth):
public CommandManager(){
  exAdapter=ExAdapterManager.getAdapter(this,ICommandManagerExAdapter.class);
}
Program: 147576
Project: 147576
Buggy source:
private void updateEditorInputVersionInfo(IRepositoryViewEditorInput editorInput,IRepositoryViewObject viewObject){
  String version=viewObject.getVersion();
  try {
    if (!factory.isLocalConnectionProvider()) {
      IMDMSVNProviderService service=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
      if (service != null) {
        if (service.isProjectInSvnMode()) {
          String revisionNumStr=service.getCurrentSVNRevision(viewObject);
          if (revisionNumStr != null) {
            revisionNumStr="String_Node_Str" + revisionNumStr;
            version+=revisionNumStr;
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  editorInput.setVersion(version);
}

Fixed version (ground truth):
private void updateEditorInputVersionInfo(IRepositoryViewEditorInput editorInput,IRepositoryViewObject viewObject){
  String version=viewObject.getVersion();
  try {
    if (!factory.isLocalConnectionProvider()) {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IMDMSVNProviderService.class)) {
        IMDMSVNProviderService service=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
        if (service != null && service.isProjectInSvnMode()) {
          String revisionNumStr=service.getCurrentSVNRevision(viewObject);
          if (revisionNumStr != null) {
            revisionNumStr="String_Node_Str" + revisionNumStr;
            version+=revisionNumStr;
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  editorInput.setVersion(version);
}
Program: 147577
Project: 147577
Buggy source:
private IMDMSVNProviderService getSvnProviderService(){
  if (svnProviderService == null) {
    try {
      svnProviderService=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return svnProviderService;
}

Fixed version (ground truth):
private IMDMSVNProviderService getSvnProviderService(){
  if (svnProviderService == null) {
    try {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IMDMSVNProviderService.class)) {
        svnProviderService=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return svnProviderService;
}
Program: 147578
Project: 147578
Buggy source:
private IGITProviderService getGitProviderService(){
  if (gitProviderService == null) {
    try {
      gitProviderService=(IGITProviderService)GlobalServiceRegister.getDefault().getService(IGITProviderService.class);
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return gitProviderService;
}

Fixed version (ground truth):
private IGITProviderService getGitProviderService(){
  if (gitProviderService == null) {
    try {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IGITProviderService.class)) {
        gitProviderService=(IGITProviderService)GlobalServiceRegister.getDefault().getService(IGITProviderService.class);
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return gitProviderService;
}
Program: 147579
Project: 147579
Buggy source:
private void updateEditorInputVersionInfo(IRepositoryViewEditorInput editorInput,IRepositoryViewObject viewObject){
  String version=viewObject.getVersion();
  try {
    if (!factory.isLocalConnectionProvider()) {
      IMDMSVNProviderService service=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
      if (service != null) {
        if (service.isProjectInSvnMode()) {
          String revisionNumStr=service.getCurrentSVNRevision(viewObject);
          if (revisionNumStr != null) {
            revisionNumStr="String_Node_Str" + revisionNumStr;
            version+=revisionNumStr;
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  editorInput.setVersion(version);
}

Fixed version (ground truth):
private void updateEditorInputVersionInfo(IRepositoryViewEditorInput editorInput,IRepositoryViewObject viewObject){
  String version=viewObject.getVersion();
  try {
    if (!factory.isLocalConnectionProvider()) {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IMDMSVNProviderService.class)) {
        IMDMSVNProviderService service=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
        if (service != null && service.isProjectInSvnMode()) {
          String revisionNumStr=service.getCurrentSVNRevision(viewObject);
          if (revisionNumStr != null) {
            revisionNumStr="String_Node_Str" + revisionNumStr;
            version+=revisionNumStr;
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    log.error(e.getMessage(),e);
  }
  editorInput.setVersion(version);
}
Program: 147580
Project: 147580
Buggy source:
private IMDMSVNProviderService getSvnProviderService(){
  if (svnProviderService == null) {
    try {
      svnProviderService=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return svnProviderService;
}

Fixed version (ground truth):
private IMDMSVNProviderService getSvnProviderService(){
  if (svnProviderService == null) {
    try {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IMDMSVNProviderService.class)) {
        svnProviderService=(IMDMSVNProviderService)GlobalServiceRegister.getDefault().getService(IMDMSVNProviderService.class);
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return svnProviderService;
}
Program: 147581
Project: 147581
Buggy source:
private IGITProviderService getGitProviderService(){
  if (gitProviderService == null) {
    try {
      gitProviderService=(IGITProviderService)GlobalServiceRegister.getDefault().getService(IGITProviderService.class);
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return gitProviderService;
}

Fixed version (ground truth):
private IGITProviderService getGitProviderService(){
  if (gitProviderService == null) {
    try {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IGITProviderService.class)) {
        gitProviderService=(IGITProviderService)GlobalServiceRegister.getDefault().getService(IGITProviderService.class);
      }
    }
 catch (    Exception e) {
      log.error(e.getMessage(),e);
    }
  }
  return gitProviderService;
}