Java rewrite engine4

delete all klabels and change all when -> requires
I make it a function to solve the [anywhere] issue. It is the easiest solution.