Java backend: efficient implementation of MatcherException for control-flow
added TODO comment