diff options
author | David Schweinsberg <[email protected]> | 2016-02-02 15:19:08 +1100 |
---|---|---|
committer | David Schweinsberg <[email protected]> | 2016-02-02 15:19:08 +1100 |
commit | 27cf086d6d9255374494b3d662df1eed38a38f57 (patch) | |
tree | 00539aa27e8b53c56f791f1097b5091c6c808764 | |
parent | 5dddead5344c5827654aeca3b2a32752c8d7d0e7 (diff) |
Small generics cleanup
-rw-r--r-- | src/net/java/dev/typecast/app/editor/EditorMenu.java | 4 | ||||
-rw-r--r-- | 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<? extends JMenuItem> 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 <a href="mailto:[email protected]">David Schweinsberg</a> */ -public class CmapIndexEntry implements Comparable { +public class CmapIndexEntry implements Comparable<CmapIndexEntry> { 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()) { |