}
writer.optimize();
threadManager.reportStatistics();
} catch (Exception e) {
if (report != null) {
<BUG>report.println(report.key("search.indexing_failed"), I_CmsReport.C_FORMAT_WARNING);
}
LOG.error(Messages.get().key(Messages.LOG_REBUILD_INDEX_FAILED_1, index.getName()), e);
} finally {</BUG>
if (writer != null) {

}
if (report != null) {
report.print(
Messages.get().container(Messages.RPT_SEARCH_INDEXING_BEGIN_0),
I_CmsReport.C_FORMAT_HEADLINE);
report.print(indexName, I_CmsReport.C_FORMAT_HEADLINE);
report.println(org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_DOTS_0), I_CmsReport.C_FORMAT_HEADLINE);
}
index = getIndex(indexName);
writer = index.getIndexWriter();
sourceNames = index.getSourceNames();
for (int i = 0, n = sourceNames.size(); i < n; i++) {
