Program: 48397
Project: 48397
Buggy source:
@Override protected Extension generateNgcExtension(){
  try {
    String pluginUrl=NgcConstants.NGC_PLUGIN_URL_PREFIX + getVmIpAddress() + NgcConstants.NGC_PLUGIN_URL_SUFFIX;
    Extension extension=new ExtensionImpl();
    extension.setKey(NgcConstants.NGC_KEY);
    extension.setVersion(NgcConstants.NGC_VERSION);
    extension.setCompany(NgcConstants.NGC_COMPANY);
    Description description=new DescriptionImpl();
    description.setLabel(NgcConstants.NGC_LABEL);
    description.setSummary(NgcConstants.NGC_SUMMARY);
    extension.setDescription(description);
    ClientInfo clientInfo=new ClientInfoImpl();
    clientInfo.setCompany(NgcConstants.NGC_COMPANY);
    clientInfo.setDescription(description);
    clientInfo.setType(NgcConstants.NGC_CLIENT_TYPE);
    clientInfo.setUrl(pluginUrl);
    clientInfo.setVersion(NgcConstants.NGC_VERSION);
    ClientInfo[] clientList={clientInfo};
    extension.setClient(clientList);
    ServerInfo serverInfo=new ServerInfoImpl();
    String[] adminEmailList={NgcConstants.NGC_ADMIN_EMAIL};
    serverInfo.setAdminEmail(adminEmailList);
    serverInfo.setCompany(NgcConstants.NGC_COMPANY);
    serverInfo.setDescription(description);
    String thumbPrint=Configuration.getString("String_Node_Str",null);
    serverInfo.setServerThumbprint(thumbPrint);
    serverInfo.setType(NgcConstants.NGC_SERVER_TYPE);
    serverInfo.setUrl(pluginUrl);
    ServerInfo serverInfoMgmt=null;
    String mgmtMoref=Configuration.getString(Constants.BDE_SERVER_VM_MOBID);
    if (mgmtMoref.length() > 0) {
      serverInfoMgmt=new ServerInfoImpl();
      serverInfoMgmt.setAdminEmail(adminEmailList);
      serverInfoMgmt.setCompany(NgcConstants.NGC_COMPANY);
      serverInfoMgmt.setDescription(description);
      serverInfoMgmt.setType(mgmtMoref);
      serverInfoMgmt.setUrl(pluginUrl);
    }
    if (serverInfoMgmt == null) {
      ServerInfo[] serverList={serverInfo};
      extension.setServer(serverList);
    }
 else {
      ServerInfo[] serverList={serverInfo,serverInfoMgmt};
      extension.setServer(serverList);
    }
    GregorianCalendar calendar=(GregorianCalendar)Calendar.getInstance();
    extension.setLastHeartbeatTime(calendar);
    return extension;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override protected Extension generateNgcExtension(){
  try {
    String pluginUrl=NgcConstants.NGC_PLUGIN_URL_PREFIX + getVmIpAddress() + NgcConstants.NGC_PLUGIN_URL_SUFFIX;
    Extension extension=new ExtensionImpl();
    extension.setKey(NgcConstants.NGC_KEY);
    extension.setVersion(NgcConstants.NGC_VERSION);
    extension.setCompany(NgcConstants.NGC_COMPANY);
    Description description=new DescriptionImpl();
    description.setLabel(NgcConstants.NGC_LABEL);
    description.setSummary(NgcConstants.NGC_SUMMARY);
    extension.setDescription(description);
    ClientInfo clientInfo=new ClientInfoImpl();
    clientInfo.setCompany(NgcConstants.NGC_COMPANY);
    clientInfo.setDescription(description);
    clientInfo.setType(NgcConstants.NGC_CLIENT_TYPE);
    clientInfo.setUrl(pluginUrl);
    clientInfo.setVersion(NgcConstants.NGC_VERSION);
    ClientInfo[] clientList={clientInfo};
    extension.setClient(clientList);
    ServerInfo serverInfo=new ServerInfoImpl();
    String[] adminEmailList={NgcConstants.NGC_ADMIN_EMAIL};
    serverInfo.setAdminEmail(adminEmailList);
    serverInfo.setCompany(NgcConstants.NGC_COMPANY);
    serverInfo.setDescription(description);
    String thumbPrint=getCertThumbPrint();
    serverInfo.setServerThumbprint(thumbPrint);
    serverInfo.setType(NgcConstants.NGC_SERVER_TYPE);
    serverInfo.setUrl(pluginUrl);
    ServerInfo serverInfoMgmt=null;
    String mgmtMoref=Configuration.getString(Constants.BDE_SERVER_VM_MOBID);
    if (mgmtMoref.length() > 0) {
      serverInfoMgmt=new ServerInfoImpl();
      serverInfoMgmt.setAdminEmail(adminEmailList);
      serverInfoMgmt.setCompany(NgcConstants.NGC_COMPANY);
      serverInfoMgmt.setDescription(description);
      serverInfoMgmt.setType(mgmtMoref);
      serverInfoMgmt.setUrl(pluginUrl);
    }
    if (serverInfoMgmt == null) {
      ServerInfo[] serverList={serverInfo};
      extension.setServer(serverList);
    }
 else {
      ServerInfo[] serverList={serverInfo,serverInfoMgmt};
      extension.setServer(serverList);
    }
    GregorianCalendar calendar=(GregorianCalendar)Calendar.getInstance();
    extension.setLastHeartbeatTime(calendar);
    return extension;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
}