Skip to content

Commit feacaf7

Browse files
hyperb1issandi34
authored andcommitted
Fix compilation of Enum on JDK 7
Change-Id: I2e58b6a527e4ef1fc7ed3359b8aea88d01a031fb libcore: Better Enum fix for JDK 7 * Jerome Pilliet suggests using a cast in the compareTo method instead of changing the field visibility. This is a much better fix. Change-Id: I334105e0922225512a4d0a2d4b6c9c6ec71b9c51
1 parent c78565c commit feacaf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libdvm/src/main/java/java/lang/Enum.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ protected final Object clone() throws CloneNotSupportedException {
147147
* @see java.lang.Comparable
148148
*/
149149
public final int compareTo(E o) {
150-
return ordinal - o.ordinal;
150+
return ordinal - ((Enum<?>) o).ordinal;
151151
}
152152

153153
/**

0 commit comments

Comments
 (0)