Removes WritesToFile from PalmDocText, converts try/catch/finally to try-with-resource block