diff --git a/source/net/filebot/MetaAttributeView.java b/source/net/filebot/MetaAttributeView.java index fa72d120..60d9d58d 100644 --- a/source/net/filebot/MetaAttributeView.java +++ b/source/net/filebot/MetaAttributeView.java @@ -1,7 +1,6 @@ package net.filebot; -import static java.nio.file.Files.isSymbolicLink; -import static java.nio.file.Files.readSymbolicLink; +import static java.nio.file.Files.*; import java.io.File; import java.io.IOException; @@ -95,7 +94,7 @@ public class MetaAttributeView extends AbstractMap { } } } catch (Exception e) { - throw new IllegalStateException(e); + throw new RuntimeException(e); } return null; // since we don't know the old value @@ -124,7 +123,7 @@ public class MetaAttributeView extends AbstractMap { } return entries; } catch (Exception e) { - throw new IllegalStateException(e); + throw new RuntimeException(e); } } @@ -135,7 +134,7 @@ public class MetaAttributeView extends AbstractMap { this.put(key, null); } } catch (Exception e) { - throw new IllegalStateException(e); + throw new RuntimeException(e); } } diff --git a/source/net/filebot/media/MetaAttributes.java b/source/net/filebot/media/MetaAttributes.java index 4fe6a835..c7652533 100644 --- a/source/net/filebot/media/MetaAttributes.java +++ b/source/net/filebot/media/MetaAttributes.java @@ -47,16 +47,16 @@ public class MetaAttributes { public void setObject(Object object) { try { metaAttributeView.put(METADATA_KEY, JsonWriter.objectToJson(object)); - } catch (Exception e) { - throw new RuntimeException(e); // unlikely to ever happen JSON serialization issues + } catch (IOException e) { + throw new RuntimeException(e); } } public Object getObject() { try { return JsonReader.jsonToJava(metaAttributeView.get(METADATA_KEY)); - } catch (Exception e) { - return null; // ignore JSON serialization issues + } catch (IOException e) { + throw new RuntimeException(e); } }