diff --git a/source/net/sourceforge/filebot/FileBotUtil.java b/source/net/sourceforge/filebot/FileBotUtil.java
index 55ac8bce..a8e3aa92 100644
--- a/source/net/sourceforge/filebot/FileBotUtil.java
+++ b/source/net/sourceforge/filebot/FileBotUtil.java
@@ -11,7 +11,7 @@ import java.util.regex.Pattern;
import net.sourceforge.tuned.FileUtil;
-public class FileBotUtil {
+public final class FileBotUtil {
/**
* Invalid characters in filenames: \, /, :, *, ?, ", <, >, |, \r and \n
@@ -104,8 +104,11 @@ public class FileBotUtil {
};
+ /**
+ * Dummy constructor to prevent instantiation.
+ */
private FileBotUtil() {
- // hide constructor
+ throw new UnsupportedOperationException();
}
}
diff --git a/source/net/sourceforge/filebot/ResourceManager.java b/source/net/sourceforge/filebot/ResourceManager.java
index 3e02f44d..146e0c11 100644
--- a/source/net/sourceforge/filebot/ResourceManager.java
+++ b/source/net/sourceforge/filebot/ResourceManager.java
@@ -10,7 +10,7 @@ import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
-public class ResourceManager {
+public final class ResourceManager {
public static ImageIcon getIcon(String name) {
return getIcon(name, null);
@@ -48,7 +48,7 @@ public class ResourceManager {
/**
* Get the URL of an image resource in this jar. Image must be located in
- * /resources
and the file type is assumed to be png.
+ * resources/
and the file type is assumed to be png.
*
* @param name simple name of the resource (without extension)
* @return URL of the resource or null if resource does not exist
@@ -68,6 +68,9 @@ public class ResourceManager {
}
+ /**
+ * Dummy constructor to prevent instantiation.
+ */
private ResourceManager() {
throw new UnsupportedOperationException();
}
diff --git a/source/net/sourceforge/tuned/ExceptionUtil.java b/source/net/sourceforge/tuned/ExceptionUtil.java
index c227c9e3..c38d9ed8 100644
--- a/source/net/sourceforge/tuned/ExceptionUtil.java
+++ b/source/net/sourceforge/tuned/ExceptionUtil.java
@@ -2,7 +2,7 @@
package net.sourceforge.tuned;
-public class ExceptionUtil {
+public final class ExceptionUtil {
public static Throwable getRootCause(Throwable t) {
while (t.getCause() != null) {
@@ -21,4 +21,12 @@ public class ExceptionUtil {
return new RuntimeException(t);
}
+
+ /**
+ * Dummy constructor to prevent instantiation.
+ */
+ private ExceptionUtil() {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/source/net/sourceforge/tuned/FileUtil.java b/source/net/sourceforge/tuned/FileUtil.java
index 852e983e..d2a0e1fa 100644
--- a/source/net/sourceforge/tuned/FileUtil.java
+++ b/source/net/sourceforge/tuned/FileUtil.java
@@ -5,7 +5,7 @@ package net.sourceforge.tuned;
import java.io.File;
-public class FileUtil {
+public final class FileUtil {
public final static long KILO = 1024;
@@ -115,4 +115,12 @@ public class FileUtil {
return "File";
}
+
+ /**
+ * Dummy constructor to prevent instantiation.
+ */
+ private FileUtil() {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/source/net/sourceforge/tuned/MessageBus.java b/source/net/sourceforge/tuned/MessageBus.java
index 00f7dd90..6e02de8f 100644
--- a/source/net/sourceforge/tuned/MessageBus.java
+++ b/source/net/sourceforge/tuned/MessageBus.java
@@ -22,11 +22,6 @@ public class MessageBus {
private final Map> handlers = new HashMap>();
- private MessageBus() {
-
- }
-
-
public synchronized void addMessageHandler(String topic, MessageHandler handler) {
List list = handlers.get(topic.toLowerCase());
@@ -70,4 +65,5 @@ public class MessageBus {
}
});
}
+
}
diff --git a/source/net/sourceforge/tuned/TemporaryFolder.java b/source/net/sourceforge/tuned/TemporaryFolder.java
index 1cf45df0..ec8097d1 100644
--- a/source/net/sourceforge/tuned/TemporaryFolder.java
+++ b/source/net/sourceforge/tuned/TemporaryFolder.java
@@ -10,7 +10,7 @@ import java.util.List;
import java.util.Map;
-public class TemporaryFolder {
+public final class TemporaryFolder {
private static final String tmpdir = System.getProperty("java.io.tmpdir");
diff --git a/source/net/sourceforge/tuned/XPathUtil.java b/source/net/sourceforge/tuned/XPathUtil.java
index 42fcd233..d397d865 100644
--- a/source/net/sourceforge/tuned/XPathUtil.java
+++ b/source/net/sourceforge/tuned/XPathUtil.java
@@ -14,7 +14,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-public class XPathUtil {
+public final class XPathUtil {
public static Node selectNode(String xpath, Object node) {
try {
@@ -79,4 +79,12 @@ public class XPathUtil {
return XPathFactory.newInstance().newXPath().compile(xpath);
}
+
+ /**
+ * Dummy constructor to prevent instantiation.
+ */
+ private XPathUtil() {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/source/net/sourceforge/tuned/ui/TunedUtil.java b/source/net/sourceforge/tuned/ui/TunedUtil.java
index 275c44a3..01582cd0 100644
--- a/source/net/sourceforge/tuned/ui/TunedUtil.java
+++ b/source/net/sourceforge/tuned/ui/TunedUtil.java
@@ -21,7 +21,7 @@ import javax.swing.SwingUtilities;
import javax.swing.Timer;
-public class TunedUtil {
+public final class TunedUtil {
public static void checkEventDispatchThread() {
if (!SwingUtilities.isEventDispatchThread()) {
@@ -82,8 +82,11 @@ public class TunedUtil {
}
+ /**
+ * Dummy constructor to prevent instantiation.
+ */
private TunedUtil() {
- // hide constructor
+ throw new UnsupportedOperationException();
}
}