waelrash1 / or-tools

Automatically exported from code.google.com/p/or-tools
0 stars 1 forks source link

Java Application stop if creating two constraints with the same name. #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

int solvertype = MPSolver.getSolverEnum("CBC_MIXED_INTEGER_PROGRAMMING");
MPSolver solver = new MPSolver("My_solver_name", this.solvertype);
solver.makeConstraint("my_const_name");
try {
solver.makeConstraint("my_const_name");
} catch(Throwable e) {
System.out.println(e);
}

What is the expected output? What do you see instead?
I'm expecting the second called to makeConstraint() with the same name to 
return either null or generate an exception. Currently it print the following 
line to the console and exit the application:
 > [17:10:33] src/base/map-util.h:126: Check failed: collection->insert(value_type(key, data)).secondduplicate key: test2

What version of the product are you using? On what operating system?
2200

I'm getting the same behavior while creating two variables with the same name.

Original issue reported on code.google.com by ikus...@gmail.com on 26 Apr 2013 at 9:34