thisSubsystem = this.getSubsystem();
thisSubsystem = this.getFunction().getSubsystem();
  public int compareTo(Object o)  {    Assignment other = (Assignment)o;    int comparisonResult;        PrivilegedSubject thisGrantee = this.getGrantee();    PrivilegedSubject otherGrantee = other.getGrantee();    comparisonResult = thisGrantee.compareTo(otherGrantee);        if (comparisonResult != 0)    {      return comparisonResult;    }        Subsystem thisSubsystem = null;    Subsystem otherSubsystem = null;    try    {      thisSubsystem = this.getSubsystem();    }    catch (ObjectNotFoundException onfe)    {      // thisSubsystem retains its initial NULL value.    }        try    {      otherSubsystem = other.getSubsystem();    }    catch (ObjectNotFoundException onfe)    {      // otherSubsystem retains its initial NULL value.    }        if (thisSubsystem == otherSubsystem)    {      comparisonResult = 0;    }    else if (thisSubsystem != null)    {      comparisonResult = thisSubsystem.compareTo(otherSubsystem);    }    else    {      comparisonResult = -1;    }        if (comparisonResult != 0)    {      return comparisonResult;    }        Category thisCategory = this.getFunction().getCategory();    Category otherCategory = other.getFunction().getCategory();    comparisonResult = thisCategory.compareTo(otherCategory);        if (comparisonResult != 0)    {      return comparisonResult;    }        Function thisFunction = this.getFunction();    Function otherFunction = other.getFunction();    comparisonResult = thisFunction.compareTo(otherFunction);        if (comparisonResult != 0)    {      return comparisonResult;    }        TreeNode thisScope = this.getScope();    TreeNode otherScope = other.getScope();    comparisonResult = thisScope.compareTo(otherScope);        if (comparisonResult != 0)    {      return comparisonResult;    }        // This last clause is here to distinguish two Assignments which are     // otherwise identical twins:        Integer thisId = this.getId();    Integer otherId = other.getId();    comparisonResult = thisId.compareTo(otherId);        return comparisonResult;  }