if (reducedSet.isEmpty()) {
return;
}
final Class<?>[] newtypes = new Class<?>[reducedSet.size()];
reducedSet.toArray(newtypes);
transactionHelper.runSuspendingTx(new Operation() {
@Override
public void execute() {
// we need to preserve the state of this flag manually because addClasses will cause reconfiguration and the flag is lost
boolean isStatisticsEnabled = searchFactory.getStatistics().isStatisticsEnabled();
searchFactory.addClasses(newtypes);