Skip to content

Commit

Permalink
Safe return type for enum
Browse files Browse the repository at this point in the history
  • Loading branch information
ghelmling committed Jan 19, 2010
1 parent e6b49fe commit 661df95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/java/meetup/beeno/util/IOUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static Date readDate( ObjectInput in ) throws IOException {
return (in.readBoolean() ? null : new Date(in.readLong()));
}

public static Object readEnum( ObjectInput in, Class enumType ) throws IOException {
public static <T extends Enum<T>> T readEnum( ObjectInput in, Class<T> enumType ) throws IOException {
String enumName = readString(in);
if (enumName == null)
return null;
Expand Down

0 comments on commit 661df95

Please sign in to comment.