Index: /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 2831)
+++ /trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java	(revision 2832)
@@ -1,4 +1,7 @@
 package org.openstreetmap.josm.gui.mappaint;
 
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
@@ -12,4 +15,5 @@
 import org.openstreetmap.josm.tools.ImageProvider;
 import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.XMLReaderFactory;
@@ -31,12 +35,14 @@
         {
             String[] a;
-            if(fileset.indexOf("=") >= 0)
+            if(fileset.indexOf("=") >= 0) {
                 a = fileset.split("=", 2);
-            else
+            } else {
                 a = new String[] {"", fileset};
+            }
 
             /* non-prefixed path is generic path, always take it */
-            if(a[0].length() == 0 || styleName.equals(a[0]))
+            if(a[0].length() == 0 || styleName.equals(a[0])) {
                 dirs.add(a[1]);
+            }
         }
         ImageIcon i = ImageProvider.getIfAvailable(dirs, "mappaint."+styleName, null, name);
@@ -61,6 +67,5 @@
 
         Collection<String> files = Main.pref.getCollection("mappaint.style.sources", Collections.<String>emptySet());
-        if(Main.pref.getBoolean("mappaint.style.enable-defaults", true))
-        {
+        if (Main.pref.getBoolean("mappaint.style.enable-defaults", true)) {
             LinkedList<String> f = new LinkedList<String>();
             f.add("resource://data/elemstyles.xml");
@@ -69,23 +74,23 @@
         }
 
-        for(String fileset : files)
-        {
+        for (String file : files) {
             String[] a = null;
-            try
-            {
-                if(fileset.indexOf("=") >= 0)
-                    a = fileset.split("=", 2);
-                else
-                    a = new String[] {null, fileset};
+            try {
+                if (file.indexOf("=") >= 0) {
+                    a = file.split("=", 2);
+                } else {
+                    a = new String[] { null, file };
+                }
                 XMLReader xmlReader = XMLReaderFactory.createXMLReader();
                 ElemStyleHandler handler = new ElemStyleHandler(a[0]);
                 xmlReader.setContentHandler(handler);
                 xmlReader.setErrorHandler(handler);
-                xmlReader.parse(new InputSource(new MirroredInputStream(a[1])));
-            }
-            catch (Exception e)
-            {
-                System.out.println("Mappaint-Style \"" + a[0] + "\" file \"" + a[1] + "\"");
-                System.out.println("Mappaint-Style problems: " + e);
+                MirroredInputStream in = new MirroredInputStream(a[1]);
+                xmlReader.parse(new InputSource(in));
+            } catch(IOException e) {
+                System.err.println(tr("Warning: failed to load Mappaint-Styles from ''{0}''. Exception was: {1}", a[1], e.toString()));
+                e.printStackTrace();
+            } catch(SAXException e) {
+                System.err.println(tr("Warning: failed to parse Mappaint-Styles from ''{0}''. Exception was: {1}", a[1], e.toString()));
                 e.printStackTrace();
             }
@@ -93,4 +98,3 @@
         iconDirs = null;
     }
-
 }
Index: /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 2831)
+++ /trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java	(revision 2832)
@@ -1,4 +1,6 @@
 // License: GPL. Copyright 2007 by Immanuel Scholz and others
 package org.openstreetmap.josm.io;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
 
 import java.io.BufferedInputStream;
@@ -41,6 +43,7 @@
             if (url.getProtocol().equals("file")) {
                 file = new File(name.substring("file:/".length()));
-                if (!file.exists())
+                if (!file.exists()) {
                     file = new File(name.substring("file://".length()));
+                }
             } else {
                 file = checkLocal(url, destDir, maxTime);
@@ -49,5 +52,7 @@
             if(name.startsWith("resource://")) {
                 fs = getClass().getResourceAsStream(
-                name.substring("resource:/".length()));
+                        name.substring("resource:/".length()));
+                if (fs == null)
+                    throw new IOException(tr("Failed to open input stream for resource ''{0}''", name));
                 return;
             }
@@ -61,10 +66,10 @@
     public File getFile()
     {
-       return file;
+        return file;
     }
 
     static public void cleanup(String name)
     {
-      cleanup(name, null);
+        cleanup(name, null);
     }
     static public void cleanup(String name, String destDir)
@@ -80,6 +85,7 @@
                     String[] lp = localPath.split(";");
                     File lfile = new File(lp[1]);
-                    if(lfile.exists())
+                    if(lfile.exists()) {
                         lfile.delete();
+                    }
                 }
                 Main.pref.put("mirror." + url, null);
@@ -94,18 +100,20 @@
             String[] lp = localPath.split(";");
             file = new File(lp[1]);
-            if (maxTime <= 0)
+            if (maxTime <= 0) {
                 maxTime = Main.pref.getInteger("mirror.maxtime", 7*24*60*60);
+            }
             if (System.currentTimeMillis() - Long.parseLong(lp[0]) < maxTime*1000) {
-                if(file.exists()) {
+                if(file.exists())
                     return file;
-                }
             }
         }
-        if(destDir == null)
+        if(destDir == null) {
             destDir = Main.pref.getPreferencesDir();
+        }
 
         File destDirFile = new File(destDir);
-        if (!destDirFile.exists())
+        if (!destDirFile.exists()) {
             destDirFile.mkdirs();
+        }
 
         String a = url.toString().replaceAll("[^A-Za-z0-9_.-]", "_");
@@ -121,6 +129,7 @@
             byte[] buffer = new byte[4096];
             int length;
-            while ((length = bis.read(buffer)) > -1)
+            while ((length = bis.read(buffer)) > -1) {
                 bos.write(buffer, 0, length);
+            }
         } catch(IOException ioe) {
             if (file != null)
@@ -149,14 +158,20 @@
         return file;
     }
+    @Override
     public int available() throws IOException
     { return fs.available(); }
+    @Override
     public void close() throws IOException
     { fs.close(); }
+    @Override
     public int read() throws IOException
     { return fs.read(); }
+    @Override
     public int read(byte[] b) throws IOException
     { return fs.read(b); }
+    @Override
     public int read(byte[] b, int off, int len) throws IOException
     { return fs.read(b,off, len); }
+    @Override
     public long skip(long n) throws IOException
     { return fs.skip(n); }
