Description of problem:
I've observed that some phases in planner runs well despite of wrongly set scoreDefinitionType in configuration. For instnace construction heuristics creates TSP problem from OptaplannerExamples although there is different score option in configuration than SimpleLong, which is used by TSP.
Expected results: I would expect some exeption explaining that there are different score types. Or If planner is so clever it is able to determine score type from domain itsel, it would be good if there was no option in config such as "scoreDefinitionType".
But some phases (for example BRANCH_AND_BOUND) can't deal with this wrong config option anyway, which is be expected. But if it is expected here, it should be expected everywhere.
Interesting case. BruteForce doesn't need the ScoreDefinition, so it's the Solution<FooScore> and ScoreCalculator<FooScore>'s score type that is used (and they must match). Nevertheless, this should fail fast of course, so I am fixing it.
Note: If a Drools score calculator is used, the wrong scoreDefinition does fail fast due to clashing with the score holder in the DRL.
Fixed on master:
Not backported to 6.2.x because blocker tag is missing (and I don't think it's needed)
Verified. (as we discussed earlier that fixing this consistency breaks backward compatibility)