diff --git a/services/src/main/groovy/jd/gui/view/component/ClassFilePage.groovy b/services/src/main/groovy/jd/gui/view/component/ClassFilePage.groovy index 949853cf..977c2307 100644 --- a/services/src/main/groovy/jd/gui/view/component/ClassFilePage.groovy +++ b/services/src/main/groovy/jd/gui/view/component/ClassFilePage.groovy @@ -156,9 +156,9 @@ class ClassFilePage } void save(API api, OutputStream os) { - OutputStreamWriter w = new OutputStreamWriter(os, "UTF-8"); - w.write(textArea.text); - w.close(); + os.withWriter('UTF-8') { + it.write(textArea.text) + } } // --- IndexesChangeListener --- // diff --git a/services/src/main/java/jd/gui/service/sourcesaver/ClassFileSourceSaverProvider.java b/services/src/main/java/jd/gui/service/sourcesaver/ClassFileSourceSaverProvider.java index 47170921..64b9fc4c 100644 --- a/services/src/main/java/jd/gui/service/sourcesaver/ClassFileSourceSaverProvider.java +++ b/services/src/main/java/jd/gui/service/sourcesaver/ClassFileSourceSaverProvider.java @@ -75,7 +75,7 @@ public void save(API api, Controller controller, Listener listener, Path path, C // Init printer baos.reset(); - PrintStream ps = new PrintStream(baos,true,"UTF-8"); + PrintStream ps = new PrintStream(baos, true, "UTF-8"); printer.setPrintStream(ps); printer.setPreferences(preferences);