}
}
}
if ((beforeIndex > -1) && (afterIndex >= beforeIndex)) {
throw new PhaseException("Can't insert handler because " + beforeName + " is before " +
afterName + " in Phase '" + phaseName + "'");
}
if (phaseFirstSet && beforeIndex == 0) {
throw new PhaseException("Can't insert handler before handler '"
+ beforeName
+ "', which is marked phaseFirst");
}
if (phaseLastSet && afterIndex == (handlers.size() - 1)) {
throw new PhaseException("Can't insert handler after handler '"
+ afterName
+ "', which is marked phaseLast");
}
if (beforeIndex > -1) {