{
final Throwable throwable = dataSchemaModel.getDataFactoryException();
if (throwable != null)
{
final DataFactory dataFactory = reportRenderContext.getContextRoot().getDataFactory();
final LocationInfo queryLocation;
if (dataFactory instanceof CompoundDataFactory)
{
final CompoundDataFactory cdf = (CompoundDataFactory) dataFactory;
final DataFactory element = cdf.getDataFactoryForQuery(query);
if (element == null)
{
queryLocation = new LocationInfo(dataFactory);
}
else
{
queryLocation = new LocationInfo(element);
}
}
else
{
queryLocation = new LocationInfo(dataFactory);
}
resultHandler.notifyInspectionResult
(new InspectionResult(this, InspectionResult.Severity.ERROR,
Messages.getString("InvalidQueryNameReferenceInspection.QueryDidNotExecute", query, throwable.toString()),
queryLocation));