log.error("Bug 1304: Null RelationshipBase at child spot # " + i);
log.error("Please report seeing Bug 1304: Null RelationshipBase at child spot # " + i + " out of " + container.getChildCount() + " for Asset " + assetData.getUnitName() + " and agent " + agentName + " in assembly " + assemblyID, new Throwable());
  public ComponentData addComponentData(ComponentData data) {    AgentAssetData assetData = new AgentAssetData((AgentComponentData)data);    //    assetData.setType(((Integer)propAssetType.getValue()).intValue());    assetData.setAssetClass((String)propAssetClass.getValue());    assetData.setUniqueID((String)propUniqueID.getValue());    assetData.setUnitName((String)propUnitName.getValue());    assetData.setUIC((String)propUIC.getValue());    // Add Relationships.    Iterator iter =       ((Collection)getDescendentsOfClass(ContainerBase.class)).iterator();    while(iter.hasNext()) {      ContainerBase container = (ContainerBase)iter.next();      if(container.getShortName().equals("Relationships")) {        for(int i=0; i < container.getChildCount(); i++) {          RelationshipBase rel = (RelationshipBase) container.getChild(i);          RelationshipData rData = new RelationshipData();	  if (rel == null) {	    if (log.isErrorEnabled()) {	      log.error("Bug 1304: Null RelationshipBase at child spot # " + i);	    }	  } else if (rel.getProperty(RelationshipBase.PROP_TYPE) == null) {	    if (log.isErrorEnabled()) {	      log.error("Bug 1304: Null Relationship type for relationship at child spot #" + i);	    }	  }	  // Bug 1304 is an NPE in the next line          rData.setType((String)rel.getProperty(RelationshipBase.PROP_TYPE).getValue());          rData.setRole((String)rel.getProperty(RelationshipBase.PROP_ROLE).getValue());          rData.setItemId((String)rel.getProperty(RelationshipBase.PROP_ITEM).getValue());          rData.setSupported((String)rel.getProperty(RelationshipBase.PROP_SUPPORTED).getValue());          DateFormat df = DateFormat.getInstance();          try {            Date start = df.parse((String)rel.getProperty(RelationshipBase.PROP_STARTTIME).getValue());            Date end = df.parse((String)rel.getProperty(RelationshipBase.PROP_STOPTIME).getValue());            rData.setStartTime(start.getTime());            rData.setEndTime(end.getTime());          } catch(ParseException pe) {            if(log.isErrorEnabled()) {              log.error("Caught Exception parsing Date, using default dates.", pe);            }            rData.setStartTime(TimeSpan.MIN_VALUE);            rData.setEndTime(TimeSpan.MAX_VALUE);          }          assetData.addRelationship(rData);        }      }    }    // Add Property Groups.    iter =       ((Collection)getDescendentsOfClass(ContainerBase.class)).iterator();    while(iter.hasNext()) {      ContainerBase container = (ContainerBase)iter.next();      if(container.getShortName().equals("Property Groups")) {        for(int i=0; i < container.getChildCount(); i++) {          PropGroupBase pg = (PropGroupBase)container.getChild(i);          assetData.addPropertyGroup(pg.getPropGroupData());        }      }    }    data.addAgentAssetData(assetData);    return data;  }