From 27cf086d6d9255374494b3d662df1eed38a38f57 Mon Sep 17 00:00:00 2001 From: David Schweinsberg Date: Tue, 2 Feb 2016 15:19:08 +1100 Subject: Small generics cleanup --- src/net/java/dev/typecast/app/editor/EditorMenu.java | 4 ++-- src/net/java/dev/typecast/ot/table/CmapIndexEntry.java | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/net/java/dev/typecast/app/editor/EditorMenu.java b/src/net/java/dev/typecast/app/editor/EditorMenu.java index e3aa013..68f5a40 100644 --- a/src/net/java/dev/typecast/app/editor/EditorMenu.java +++ b/src/net/java/dev/typecast/app/editor/EditorMenu.java @@ -122,7 +122,7 @@ public class EditorMenu { } private static JMenuItem createMenuItem( - Class menuClass, + Class menuClass, String name, String mnemonic, String description, @@ -131,7 +131,7 @@ public class EditorMenu { ActionListener al) { JMenuItem menuItem = null; try { - menuItem = (JMenuItem) menuClass.newInstance(); + menuItem = menuClass.newInstance(); menuItem.setText(name); menuItem.setToolTipText(description); menuItem.setMnemonic(mnemonic.length() > 0 ? mnemonic.charAt(0) : 0); diff --git a/src/net/java/dev/typecast/ot/table/CmapIndexEntry.java b/src/net/java/dev/typecast/ot/table/CmapIndexEntry.java index 35246ed..7982568 100644 --- a/src/net/java/dev/typecast/ot/table/CmapIndexEntry.java +++ b/src/net/java/dev/typecast/ot/table/CmapIndexEntry.java @@ -56,7 +56,7 @@ import java.io.IOException; /** * @author David Schweinsberg */ -public class CmapIndexEntry implements Comparable { +public class CmapIndexEntry implements Comparable { private int _platformId; private int _encodingId; @@ -89,6 +89,7 @@ public class CmapIndexEntry implements Comparable { _format = format; } + @Override public String toString() { return new StringBuffer() .append("platform id: ") @@ -103,8 +104,8 @@ public class CmapIndexEntry implements Comparable { .append(_offset).toString(); } - public int compareTo(java.lang.Object obj) { - CmapIndexEntry entry = (CmapIndexEntry) obj; + @Override + public int compareTo(CmapIndexEntry entry) { if (getOffset() < entry.getOffset()) { return -1; } else if (getOffset() > entry.getOffset()) { -- cgit v1.2.3