--- old/src/share/classes/java/util/EnumSet.java 2012-01-29 19:33:34.000000000 -0800 +++ new/src/share/classes/java/util/EnumSet.java 2012-01-29 19:33:34.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -358,9 +358,12 @@ * * @return a copy of this set */ + @Override public EnumSet clone() { try { - return (EnumSet) super.clone(); + @SuppressWarnings("unchecked") + EnumSet clone = (EnumSet) super.clone(); + return clone; } catch(CloneNotSupportedException e) { throw new AssertionError(e); } @@ -375,7 +378,7 @@ * Throws an exception if e is not of the correct type for this enum set. */ final void typeCheck(E e) { - Class eClass = e.getClass(); + Class eClass = e.getClass(); if (eClass != elementType && eClass.getSuperclass() != elementType) throw new ClassCastException(eClass + " != " + elementType); }