code: private void dealWithReferences() throws BuildException {
          if (isReference()) {
              final Object o = refId.getReferencedObject(getProject());
              if (!(o instanceof ResourceCollection)) {
                  throw new BuildException("refId '" + refId.getRefId()
                          + "' does not refer to a resource collection.");
              }
              getPath().add((ResourceCollection) o);
          }
      }
docs: If this is a reference, this method will add the referenced resource
  collection to the collection of paths.
  
  @throws BuildException if the reference is not to a resource collection