Skip to content

Commit

Permalink
Check and abort if number of task combinations exceeds 10!
Browse files Browse the repository at this point in the history
  • Loading branch information
vvergu committed Mar 6, 2014
1 parent 6ec4677 commit a52ab11
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -193,8 +193,12 @@ private static IStrategoTerm insertResultLists(ITermFactory factory, ITaskEngine
*/
public static Collection<StrategoHashMap> cartesianProduct(Multimap<IStrategoTerm, IStrategoTerm> results) {
Collection<StrategoHashMap> result = new ArrayList<StrategoHashMap>();
if(results.size() > 0)
if(results.size() > 10) {
throw new RuntimeException("Instruction with more than 10 results not computable");
}
if(results.size() > 0) {
result.add(new StrategoHashMap());
}

for(Entry<IStrategoTerm, Collection<IStrategoTerm>> entry : results.asMap().entrySet()) {
Collection<StrategoHashMap> newResults = new ArrayList<StrategoHashMap>();
Expand Down

0 comments on commit a52ab11

Please sign in to comment.