Program: 28819
Project: 28819
Buggy source:
public ConfigBeanProxy getOwner(ConfigBeanProxy parent,String parentElement,String childElement) throws InvocationTargetException, IllegalAccessException {
  if (childElement.contains("String_Node_Str")) {
    Domain d=serviceLocator.<Domain>getService(Domain.class);
    return serviceLocator.<Config>getService(Config.class,ServerEnvironment.DEFAULT_INSTANCE_NAME);
  }
  if (childElement.contains("String_Node_Str")) {
    Domain d=serviceLocator.<Domain>getService(Domain.class);
    return serviceLocator.<Server>getService(Server.class,ServerEnvironment.DEFAULT_INSTANCE_NAME);
  }
  if (childElement.endsWith("String_Node_Str")) {
    String componentName;
    String elementName;
    elementName=childElement.substring(childElement.lastIndexOf("String_Node_Str") + 1,childElement.indexOf("String_Node_Str"));
    componentName=childElement.substring(childElement.lastIndexOf("String_Node_Str") + 1,childElement.indexOf("String_Node_Str"));
    Class childClass=getClassFor(elementName);
    Class parentClass=getClassFor(parentElement);
    Method m=findSuitableCollectionGetter(parentClass,childClass);
    if (m != null) {
      try {
        Collection col=(Collection)m.invoke(parent);
        componentName=resolveExpression(componentName);
        return getNamedConfigBeanFromCollection(col,componentName,childClass);
      }
 catch (      Exception e) {
        LOG.log(Level.INFO,"String_Node_Str" + childElement + "String_Node_Str"+ componentName,e);
      }
    }
    return null;
  }
 else {
    Class clz=getClassFor(childElement);
    Method m=getMatchingGetterMethod(parent.getClass(),clz);
    if (m != null) {
      return (ConfigBeanProxy)m.invoke(parent);
    }
 else {
      try {
        m=parent.getClass().getMethod("String_Node_Str",java.lang.Class.class);
      }
 catch (      NoSuchMethodException e) {
        LOG.log(Level.INFO,"String_Node_Str",e);
      }
      if (m != null) {
        return (ConfigBeanProxy)m.invoke(parent,clz);
      }
      return null;
    }
  }
}

Fixed version (ground truth):
public ConfigBeanProxy getOwner(ConfigBeanProxy parent,String parentElement,String childElement) throws InvocationTargetException, IllegalAccessException {
  if (childElement.contains("String_Node_Str")) {
    return serviceLocator.<Config>getService(Config.class,ServerEnvironment.DEFAULT_INSTANCE_NAME);
  }
  if (childElement.contains("String_Node_Str")) {
    return serviceLocator.<Server>getService(Server.class,ServerEnvironment.DEFAULT_INSTANCE_NAME);
  }
  if (childElement.endsWith("String_Node_Str")) {
    String componentName;
    String elementName;
    elementName=childElement.substring(childElement.lastIndexOf("String_Node_Str") + 1,childElement.indexOf("String_Node_Str"));
    componentName=childElement.substring(childElement.lastIndexOf("String_Node_Str") + 1,childElement.indexOf("String_Node_Str"));
    Class childClass=getClassFor(elementName);
    Class parentClass=getClassFor(parentElement);
    Method m=findSuitableCollectionGetter(parentClass,childClass);
    if (m != null) {
      try {
        Collection col=(Collection)m.invoke(parent);
        componentName=resolveExpression(componentName);
        return getNamedConfigBeanFromCollection(col,componentName,childClass);
      }
 catch (      Exception e) {
        LOG.log(Level.INFO,"String_Node_Str" + childElement + "String_Node_Str"+ componentName,e);
      }
    }
    return null;
  }
 else {
    Class clz=getClassFor(childElement);
    Method m=getMatchingGetterMethod(parent.getClass(),clz);
    if (m != null) {
      return (ConfigBeanProxy)m.invoke(parent);
    }
 else {
      try {
        m=parent.getClass().getMethod("String_Node_Str",java.lang.Class.class);
      }
 catch (      NoSuchMethodException e) {
        LOG.log(Level.INFO,"String_Node_Str",e);
      }
      if (m != null) {
        return (ConfigBeanProxy)m.invoke(parent,clz);
      }
      return null;
    }
  }
}