switch to non-deprecated JavaWriter methods