--- old/src/share/classes/javax/swing/text/html/HTMLDocument.java 2014-06-10 11:51:38.000000000 -0700 +++ new/src/share/classes/javax/swing/text/html/HTMLDocument.java 2014-06-10 11:51:37.000000000 -0700 @@ -863,11 +863,13 @@ Object maps = getProperty(MAP_PROPERTY); if (maps == null) { - maps = new Hashtable(11); + maps = new Hashtable<>(11); putProperty(MAP_PROPERTY, maps); } if (maps instanceof Hashtable) { - ((Hashtable)maps).put("#" + name, map); + @SuppressWarnings("unchecked") + Hashtable tmp = (Hashtable)maps; + tmp.put("#" + name, map); } } } @@ -910,11 +912,13 @@ * @return the enumerated list of maps, or null * if the maps are not an instance of Hashtable */ - Enumeration getMaps() { + Enumeration getMaps() { Object maps = getProperty(MAP_PROPERTY); if (maps instanceof Hashtable) { - return ((Hashtable)maps).elements(); + @SuppressWarnings("unchecked") + Hashtable tmp = (Hashtable) maps; + return tmp.elements(); } return null; } @@ -1493,7 +1497,7 @@ else if (searchLeafAttributes && attr != null) { // For some leaf elements we store the actual attributes inside // the AttributeSet of the Element (such as anchors). - Enumeration names = attr.getAttributeNames(); + Enumeration names = attr.getAttributeNames(); if (names != null) { while (names.hasMoreElements()) { Object name = names.nextElement(); @@ -2694,10 +2698,12 @@ return; } if (comments == null) { - comments = new Vector(); + comments = new Vector<>(); putProperty(AdditionalComments, comments); } - ((Vector)comments).addElement(comment); + @SuppressWarnings("unchecked") + Vector v = (Vector)comments; + v.addElement(comment); } /** @@ -3439,6 +3445,7 @@ option = new Option(attr); if (selectModel instanceof OptionListModel) { + @SuppressWarnings("unchecked") OptionListModel