}
final ReportDocumentContext activeContext = getActiveContext();
final AbstractReportDefinition report = activeContext.getReportDefinition();
final CompoundDataFactory collection = (CompoundDataFactory) report.getDataFactory();
final int j = collection.indexOfByReference(dataFactory);
if (j == -1)
{
throw new IllegalStateException("Edited data-source does not exist in the report anymore.");
}