diff --git a/source/net/filebot/Cache.java b/source/net/filebot/Cache.java index 11a18310..2d5c5b8a 100644 --- a/source/net/filebot/Cache.java +++ b/source/net/filebot/Cache.java @@ -154,7 +154,6 @@ public class Cache { return new TypedCache>(cache, cacheType, it -> it == null ? null : stream((Object[]) it).map(cls::cast).collect(toList()), it -> it == null ? null : it.toArray()); } - @SuppressWarnings("unchecked") public static class TypedCache extends Cache { private final Function read; diff --git a/source/net/filebot/hash/VerificationFormat.java b/source/net/filebot/hash/VerificationFormat.java index 8914183b..f18c43b5 100644 --- a/source/net/filebot/hash/VerificationFormat.java +++ b/source/net/filebot/hash/VerificationFormat.java @@ -1,7 +1,6 @@ package net.filebot.hash; - import java.io.File; import java.text.FieldPosition; import java.text.Format; @@ -12,25 +11,20 @@ import java.util.Map.Entry; import java.util.regex.Matcher; import java.util.regex.Pattern; - public class VerificationFormat extends Format { private final String hashTypeHint; - public VerificationFormat() { this.hashTypeHint = ""; } - public VerificationFormat(String hashTypeHint) { this.hashTypeHint = hashTypeHint.isEmpty() ? "" : '?' + hashTypeHint.toUpperCase(); } - @Override public StringBuffer format(Object obj, StringBuffer sb, FieldPosition pos) { - @SuppressWarnings("unchecked") Entry entry = (Entry) obj; String path = entry.getKey().getPath(); @@ -39,13 +33,11 @@ public class VerificationFormat extends Format { return sb.append(format(path, hash)); } - public String format(String path, String hash) { // e.g. 1a02a7c1e9ac91346d08829d5037b240f42ded07 ?SHA1*folder/file.txt return String.format("%s %s*%s", hash, hashTypeHint, path); } - /** * Pattern used to parse the lines of a md5 or sha1 file. * @@ -61,7 +53,6 @@ public class VerificationFormat extends Format { */ private final Pattern pattern = Pattern.compile("^(\\p{XDigit}+)\\s+(?:\\?\\w+)?\\*?(.+)$"); - @Override public Entry parseObject(String line) throws ParseException { Matcher matcher = pattern.matcher(line); @@ -73,13 +64,11 @@ public class VerificationFormat extends Format { return entry(matcher.group(2), matcher.group(1)); } - @Override public Entry parseObject(String line, ParsePosition pos) { throw new UnsupportedOperationException(); } - protected Entry entry(String path, String hash) { return new SimpleImmutableEntry(new File(path), hash); } diff --git a/source/net/filebot/similarity/SeriesNameMatcher.java b/source/net/filebot/similarity/SeriesNameMatcher.java index 53e633da..945f2801 100644 --- a/source/net/filebot/similarity/SeriesNameMatcher.java +++ b/source/net/filebot/similarity/SeriesNameMatcher.java @@ -119,7 +119,6 @@ public class SeriesNameMatcher { * @return series names that have been matched one or multiple times depending on the threshold */ private Collection flatMatchAll(String[] names, Pattern prefixPattern, int threshold, boolean strict) { - @SuppressWarnings("unchecked") Comparator wordComparator = (Comparator) commonSequenceMatcher.getCollator(); ThresholdCollection thresholdCollection = new ThresholdCollection(threshold, wordComparator); diff --git a/source/net/filebot/ui/rename/BindingDialog.java b/source/net/filebot/ui/rename/BindingDialog.java index b6e702ad..bf27ca8c 100644 --- a/source/net/filebot/ui/rename/BindingDialog.java +++ b/source/net/filebot/ui/rename/BindingDialog.java @@ -130,7 +130,6 @@ class BindingDialog extends JDialog { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, null, isSelected, hasFocus, row, column); - @SuppressWarnings("unchecked") Future future = (Future) value; // reset state diff --git a/source/net/filebot/web/OpenSubtitlesXmlRpc.java b/source/net/filebot/web/OpenSubtitlesXmlRpc.java index 6a81d34d..576dc2d6 100644 --- a/source/net/filebot/web/OpenSubtitlesXmlRpc.java +++ b/source/net/filebot/web/OpenSubtitlesXmlRpc.java @@ -33,7 +33,6 @@ import redstone.xmlrpc.XmlRpcException; import redstone.xmlrpc.XmlRpcFault; import redstone.xmlrpc.util.Base64; -@SuppressWarnings("unchecked") public class OpenSubtitlesXmlRpc { private final String useragent; diff --git a/test/net/filebot/util/ByteBufferOutputStreamTest.java b/test/net/filebot/util/ByteBufferOutputStreamTest.java index c3a6ac8b..c6602b55 100644 --- a/test/net/filebot/util/ByteBufferOutputStreamTest.java +++ b/test/net/filebot/util/ByteBufferOutputStreamTest.java @@ -9,7 +9,6 @@ import java.nio.channels.Channels; import org.junit.Test; -@SuppressWarnings("resource") public class ByteBufferOutputStreamTest { @Test diff --git a/test/net/filebot/util/TreeIteratorTest.java b/test/net/filebot/util/TreeIteratorTest.java index ae9e214c..66660b76 100644 --- a/test/net/filebot/util/TreeIteratorTest.java +++ b/test/net/filebot/util/TreeIteratorTest.java @@ -1,7 +1,6 @@ package net.filebot.util; - import static org.junit.Assert.*; import java.util.ArrayList; @@ -11,12 +10,10 @@ import java.util.List; import org.junit.Before; import org.junit.Test; - public class TreeIteratorTest { private List tree; - @Before public void setUp() throws Exception { tree = new ArrayList(); @@ -42,12 +39,10 @@ public class TreeIteratorTest { tree.add(trunk); } - @Test public void iterate() { TreeIterator treeIterator = new TreeIterator(tree) { - @SuppressWarnings("unchecked") @Override protected Iterator children(Object node) { if (node instanceof Iterable) @@ -55,7 +50,6 @@ public class TreeIteratorTest { return null; } - }; // check leafs (String) and nodes (Iterable)