Index: /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 7314)
+++ /trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java	(revision 7315)
@@ -10,8 +10,7 @@
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -292,5 +291,5 @@
 
                 for (File urlFile: urlFiles) {
-                    try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(urlFile), StandardCharsets.UTF_8))) {
+                    try (BufferedReader reader = Files.newBufferedReader(urlFile.toPath(), StandardCharsets.UTF_8)) {
                         String line;
                         while ((line = reader.readLine()) != null) {
Index: /trunk/src/org/openstreetmap/josm/data/AutosaveTask.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 7314)
+++ /trunk/src/org/openstreetmap/josm/data/AutosaveTask.java	(revision 7315)
@@ -7,10 +7,9 @@
 import java.io.File;
 import java.io.FileFilter;
-import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.PrintStream;
 import java.lang.management.ManagementFactory;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Date;
@@ -303,5 +302,5 @@
                 File pidFile = getPidFile(file);
                 if (pidFile.exists()) {
-                    try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(pidFile), StandardCharsets.UTF_8))) {
+                    try (BufferedReader reader = Files.newBufferedReader(pidFile.toPath(), StandardCharsets.UTF_8)) {
                         String jvmId = reader.readLine();
                         if (jvmId != null) {
Index: /trunk/src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 7314)
+++ /trunk/src/org/openstreetmap/josm/data/Preferences.java	(revision 7315)
@@ -8,9 +8,7 @@
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
@@ -20,4 +18,5 @@
 import java.lang.reflect.Field;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -57,4 +56,5 @@
 import org.openstreetmap.josm.tools.I18n;
 import org.openstreetmap.josm.tools.Utils;
+import org.xml.sax.SAXException;
 
 /**
@@ -790,11 +790,17 @@
     }
 
-    public void load() throws Exception {
+    /**
+     * Loads preferences from settings file.
+     * @throws IOException if any I/O error occurs while reading the file
+     * @throws SAXException if the settings file does not contain valid XML
+     * @throws XMLStreamException if an XML error occurs while parsing the file (after validation)
+     */
+    public void load() throws IOException, SAXException, XMLStreamException {
         settingsMap.clear();
         File pref = getPreferenceFile();
-        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(pref), StandardCharsets.UTF_8))) {
+        try (BufferedReader in = Files.newBufferedReader(pref.toPath(), StandardCharsets.UTF_8)) {
             validateXML(in);
         }
-        try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(pref), StandardCharsets.UTF_8))) {
+        try (BufferedReader in = Files.newBufferedReader(pref.toPath(), StandardCharsets.UTF_8)) {
             fromXML(in);
         }
@@ -803,5 +809,9 @@
     }
 
-    public void init(boolean reset){
+    /**
+     * Initializes preferences.
+     * @param reset if {@code true}, current settings file is replaced by the default one
+     */
+    public void init(boolean reset) {
         // get the preferences.
         File prefDir = getPreferencesDirFile();
@@ -1388,5 +1398,5 @@
     protected XMLStreamReader parser;
 
-    public void validateXML(Reader in) throws Exception {
+    public void validateXML(Reader in) throws IOException, SAXException {
         SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
         try (InputStream xsdStream = new CachedFile("resource://data/preferences.xsd").getInputStream()) {
Index: /trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 7314)
+++ /trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java	(revision 7315)
@@ -4,14 +4,14 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.InputStreamReader;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -170,10 +170,8 @@
         ignoredErrors.clear();
         if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) {
-            File file = new File(getValidatorDir() + "ignorederrors");
-            if (file.exists()) {
-                try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) {
-                    for (String line = in.readLine(); line != null; line = in.readLine()) {
-                        ignoredErrors.add(line);
-                    }
+            Path path = Paths.get(getValidatorDir() + "ignorederrors");
+            if (Files.exists(path)) {
+                try {
+                    ignoredErrors.addAll(Files.readAllLines(path, StandardCharsets.UTF_8));
                 } catch (final FileNotFoundException e) {
                     Main.debug(Main.getErrorMessage(e));
Index: /trunk/src/org/openstreetmap/josm/io/GeoJSONExporter.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/GeoJSONExporter.java	(revision 7314)
+++ /trunk/src/org/openstreetmap/josm/io/GeoJSONExporter.java	(revision 7315)
@@ -4,11 +4,9 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.io.BufferedWriter;
 import java.io.File;
-import java.io.FileOutputStream;
 import java.io.IOException;
-import java.io.OutputStreamWriter;
 import java.io.Writer;
 import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
 
 import org.openstreetmap.josm.actions.ExtensionFileFilter;
@@ -32,5 +30,5 @@
         if (layer instanceof OsmDataLayer) {
             String json = new GeoJSONWriter((OsmDataLayer) layer).write();
-            try (Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8))) {
+            try (Writer out = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) {
                 out.write(json);
             }
Index: /trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 7314)
+++ /trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java	(revision 7315)
@@ -10,5 +10,4 @@
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -17,4 +16,5 @@
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
+import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.security.KeyStore;
@@ -278,7 +278,7 @@
             String result = null;
             if (path != null) {
-                File file = new File(path);
-                if (file.exists()) {
-                    try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8))) {
+                Path p = Paths.get(path);
+                if (Files.exists(p)) {
+                    try (BufferedReader reader = Files.newBufferedReader(p, StandardCharsets.UTF_8)) {
                         String id = null;
                         String release = null;
