Add more warnings source to 1.6) and fix warnings
[nikiroo-utils.git] / src / be / nikiroo / fanfix / supported / BasicSupport.java
index fbdb47a9efe14795d53d6834be8c067239d29c9e..d56e52d3aea48afa64b28792fba5a8e2fa42090e 100644 (file)
@@ -25,7 +25,7 @@ import be.nikiroo.fanfix.data.MetaData;
 import be.nikiroo.fanfix.data.Paragraph;
 import be.nikiroo.fanfix.data.Paragraph.ParagraphType;
 import be.nikiroo.fanfix.data.Story;
-import be.nikiroo.utils.IOUtils;
+import be.nikiroo.utils.ImageUtils;
 import be.nikiroo.utils.Progress;
 import be.nikiroo.utils.StringUtils;
 
@@ -374,7 +374,7 @@ public abstract class BasicSupport {
 
                        pg.setProgress(50);
 
-                       if (meta != null && meta.getCover() == null) {
+                       if (meta.getCover() == null) {
                                meta.setCover(getDefaultCover(meta.getSubject()));
                        }
 
@@ -576,6 +576,7 @@ public abstract class BasicSupport {
         * @throws IOException
         *             on I/O error
         */
+       @SuppressWarnings("unused")
        protected void preprocess(URL source, InputStream in) throws IOException {
        }
 
@@ -755,9 +756,9 @@ public abstract class BasicSupport {
 
                if (image != null) {
                        return new Paragraph(image);
-               } else {
-                       return processPara(line);
                }
+
+               return processPara(line);
        }
 
        /**
@@ -840,9 +841,9 @@ public abstract class BasicSupport {
        static String[] getImageExt(boolean emptyAllowed) {
                if (emptyAllowed) {
                        return new String[] { "", ".png", ".jpg", ".jpeg", ".gif", ".bmp" };
-               } else {
-                       return new String[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" };
                }
+
+               return new String[] { ".png", ".jpg", ".jpeg", ".gif", ".bmp" };
        }
 
        /**
@@ -863,7 +864,7 @@ public abstract class BasicSupport {
                        InputStream in = null;
                        try {
                                in = Instance.getCache().open(url, getSupport(url), true);
-                               return IOUtils.toImage(in);
+                               return ImageUtils.fromStream(in);
                        } catch (IOException e) {
                        } finally {
                                if (in != null) {
@@ -1161,9 +1162,9 @@ public abstract class BasicSupport {
                                        if (prev == car) {
                                                builder.append(closeDoubleQuote);
                                                continue;
-                                       } else {
-                                               builder.append(closeQuote);
                                        }
+
+                                       builder.append(closeQuote);
                                }
                        }