ItEr30S17ValidacionEProbasFuncionais: Replacing precondition by warning.
bug #48.
This commit is contained in:
parent
6c26e184d6
commit
4ba63d5c68
1 changed files with 6 additions and 0 deletions
|
|
@ -28,16 +28,21 @@ import java.util.List;
|
|||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
public class LoadPeriod {
|
||||
|
||||
private static final Log LOG = LogFactory.getLog(LoadPeriod.class);
|
||||
|
||||
private final LocalDate start;
|
||||
|
||||
private final LocalDate end;
|
||||
|
||||
private final LoadLevel loadLevel;
|
||||
|
||||
|
||||
public LoadPeriod(LocalDate start, LocalDate end, LoadLevel loadLevel) {
|
||||
Validate.notNull(start);
|
||||
Validate.notNull(end);
|
||||
|
|
@ -76,6 +81,7 @@ public class LoadPeriod {
|
|||
@Override
|
||||
public int compare(LoadPeriod o1, LoadPeriod o2) {
|
||||
if (o1.overlaps(o2)) {
|
||||
LOG.warn(o1 + " overlaps with " + o2);
|
||||
throw new IllegalArgumentException(o1 + " overlaps with "
|
||||
+ o2);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue