Program: 29114
Project: 29114
Buggy source:
/** 
 * Parses the ra.xml for the admin object javabean properties. The admin object to be parsed is identified by the moduleDir where ra.xml is present and the adminObject interface. Admin object interface will be unique in a given ra.xml. <p/> It throws ConnectorRuntimeException if either or both the parameters are null, if corresponding rar is not deployed, if no adminObjectInterce is found in ra.xml. If rar is deployed and admin Object interface is present but no properties are present for the corresponding adminobjectInterface, null is returned.
 * @param desc                 ConnectorDescriptor pertaining to rar.
 * @param adminObjectInterface AdminObject interface 
 * @param adminObjectClass AdminObject class
 * @return Javabean properties with the propety names and valuesof propeties. The property values will be the values mentioned in ra.xml if present. Otherwise it will be the default values obtained by introspecting the javabean. In both the case if no value is present, empty String is returned as the value.
 * @throws ConnectorRuntimeException if either of the parameters are null.If corresponding rar is not deployed i.e moduleDir is invalid. If no admin object intercface is found in ra.xml
 */
public Properties getJavaBeanProps(ConnectorDescriptor desc,String adminObjectInterface,String adminObjectClass,String rarName) throws ConnectorRuntimeException {
  if (desc == null || adminObjectInterface == null) {
    throw new ConnectorRuntimeException("String_Node_Str");
  }
  Set adminObjectSet=desc.getAdminObjects();
  if (adminObjectSet == null || adminObjectSet.size() == 0) {
    return null;
  }
  AdminObject adminObject=null;
  Iterator iter=adminObjectSet.iterator();
  Properties mergedVals=null;
  boolean adminObjectFound=false;
  while (iter.hasNext()) {
    adminObject=(AdminObject)iter.next();
    if (adminObjectInterface.equals(adminObject.getAdminObjectInterface()) && (adminObjectClass == null || adminObjectClass.equals(adminObject.getAdminObjectClass()))) {
      adminObjectFound=true;
      break;
    }
  }
  if (!adminObjectFound) {
    StringManager localStrings=StringManager.getManager(AdminObjectConfigParserImpl.class);
    String msg=localStrings.getString("String_Node_Str",adminObjectInterface);
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,msg);
    }
    throw new ConnectorRuntimeException(msg);
  }
  mergedVals=getMergedValues(adminObject,mergedVals,rarName);
  return mergedVals;
}

Fixed version (ground truth):
/** 
 * Parses the ra.xml for the admin object javabean properties. The admin object to be parsed is identified by the moduleDir where ra.xml is present and the adminObject interface. Admin object interface will be unique in a given ra.xml. <p/> It throws ConnectorRuntimeException if either or both the parameters are null, if corresponding rar is not deployed, if no adminObjectInterce is found in ra.xml. If rar is deployed and admin Object interface is present but no properties are present for the corresponding adminobjectInterface, null is returned.
 * @param desc                 ConnectorDescriptor pertaining to rar.
 * @param adminObjectInterface AdminObject interface 
 * @param adminObjectClass AdminObject class
 * @return Javabean properties with the propety names and valuesof propeties. The property values will be the values mentioned in ra.xml if present. Otherwise it will be the default values obtained by introspecting the javabean. In both the case if no value is present, empty String is returned as the value.
 * @throws ConnectorRuntimeException if either of the parameters are null.If corresponding rar is not deployed i.e moduleDir is invalid. If no admin object intercface is found in ra.xml
 */
public Properties getJavaBeanProps(ConnectorDescriptor desc,String adminObjectInterface,String adminObjectClass,String rarName) throws ConnectorRuntimeException {
  if (desc == null || adminObjectInterface == null) {
    throw new ConnectorRuntimeException("String_Node_Str");
  }
  Set adminObjectSet=desc.getAdminObjects();
  if (adminObjectSet == null || adminObjectSet.size() == 0) {
    return null;
  }
  AdminObject adminObject=null;
  Iterator iter=adminObjectSet.iterator();
  Properties mergedVals=null;
  boolean adminObjectFound=false;
  while (iter.hasNext()) {
    adminObject=(AdminObject)iter.next();
    if (adminObjectInterface.equals(adminObject.getAdminObjectInterface()) && (adminObjectClass == null || adminObjectClass.equals(adminObject.getAdminObjectClass()))) {
      adminObjectFound=true;
      break;
    }
  }
  if (!adminObjectFound) {
    StringManager localStrings=StringManager.getManager(AdminObjectConfigParserImpl.class);
    String msg=localStrings.getString("String_Node_Str",adminObjectInterface);
    if (_logger.isLoggable(Level.FINE)) {
      _logger.log(Level.FINE,msg);
    }
    throw new ConnectorRuntimeException(msg);
  }
  mergedVals=getMergedValues(adminObject,rarName);
  return mergedVals;
}