fix for issue #215. The "next" method must have only one return statement

All the potential generated statements must be mutualy exclusive.

If two return statements are generated in the generated class code, it result in a compilation error "Unreachable code".

TODO: create unit test to validate this behavior