private TIntHashSet[] recoverRecoveryHandlers(SimpleXARecoveryHandler[] handlers) throws SimpleXAResourceException { TIntHashSet[] phaseSets = new TIntHashSet[handlers.length]; boolean allEmpty = true; for (int i = 0; i < handlers.length; i++) { phaseSets[i] = new TIntHashSet(handlers[i].recover()); if (!allEmpty && phaseSets[i].isEmpty()) { throw new SimpleXAResourceException("Unable to find common phase in pre-existing database"); } else if (!phaseSets[i].isEmpty()) { allEmpty = false; } } return !allEmpty ? phaseSets : null; }