try {
boolean wasAdded = ports.add(Integer.parseInt(val));
if (!wasAdded) //TODO unit test
throw new TransactionFailure(Strings.get("PortUtils.duplicate_port", val, server.getName()));
}
catch(TransactionFailure tf) {
// don't re-wrap the same Exception type!
throw tf;
}
catch (Exception e) { //TODO unit test
throw new TransactionFailure(Strings.get("PortUtils.non_int_port", val, server.getName()));
}
}
}
checkForLegalPorts(ports, server.getName());
}