This shouldn't have been removed. printwriter will return null if the code has already been generated, so it has to return what was previously generated.

Say there's 6 permutation for example, the first time it will get generated as expected (that's why it's working in dev mode, since there's always only one permutation) then the second time, printwriter will return null.