1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

refine error msg

This commit is contained in:
oblonski 2015-10-23 17:12:03 +02:00
parent 16069c9400
commit 67b4d57657
2 changed files with 55 additions and 28 deletions

View file

@ -221,7 +221,7 @@ public class VehicleRoutingProblem {
*/
public Builder addJob(AbstractJob job) {
if (tentativeJobs.containsKey(job.getId()))
throw new IllegalStateException("jobList already contains a job with id " + job.getId() + ". make sure you use unique ids for your jobs (i.e. service and shipments)");
throw new IllegalStateException("vehicle routing problem already contains a service or shipment with id " + job.getId() + ". make sure you use unique ids for all services and shipments");
if (!(job instanceof Service || job instanceof Shipment))
throw new IllegalStateException("job must be either a service or a shipment");
job.setIndex(jobIndexCounter);