src/share/classes/javax/swing/text/html/HTMLDocument.java
Print this page
*** 861,875 ****
if (name != null) {
Object maps = getProperty(MAP_PROPERTY);
if (maps == null) {
! maps = new Hashtable(11);
putProperty(MAP_PROPERTY, maps);
}
if (maps instanceof Hashtable) {
! ((Hashtable)maps).put("#" + name, map);
}
}
}
/**
--- 861,877 ----
if (name != null) {
Object maps = getProperty(MAP_PROPERTY);
if (maps == null) {
! maps = new Hashtable<>(11);
putProperty(MAP_PROPERTY, maps);
}
if (maps instanceof Hashtable) {
! @SuppressWarnings("unchecked")
! Hashtable<Object, Object> tmp = (Hashtable)maps;
! tmp.put("#" + name, map);
}
}
}
/**
*** 908,922 ****
/**
* Returns an <code>Enumeration</code> of the possible Maps.
* @return the enumerated list of maps, or <code>null</code>
* if the maps are not an instance of <code>Hashtable</code>
*/
! Enumeration getMaps() {
Object maps = getProperty(MAP_PROPERTY);
if (maps instanceof Hashtable) {
! return ((Hashtable)maps).elements();
}
return null;
}
/**
--- 910,926 ----
/**
* Returns an <code>Enumeration</code> of the possible Maps.
* @return the enumerated list of maps, or <code>null</code>
* if the maps are not an instance of <code>Hashtable</code>
*/
! Enumeration<Object> getMaps() {
Object maps = getProperty(MAP_PROPERTY);
if (maps instanceof Hashtable) {
! @SuppressWarnings("unchecked")
! Hashtable<Object, Object> tmp = (Hashtable) maps;
! return tmp.elements();
}
return null;
}
/**
*** 1491,1501 ****
}
}
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();
if (names != null) {
while (names.hasMoreElements()) {
Object name = names.nextElement();
if ((name instanceof HTML.Tag) &&
(attr.getAttribute(name) instanceof AttributeSet)) {
--- 1495,1505 ----
}
}
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();
if (names != null) {
while (names.hasMoreElements()) {
Object name = names.nextElement();
if ((name instanceof HTML.Tag) &&
(attr.getAttribute(name) instanceof AttributeSet)) {
*** 2692,2705 ****
if (comments != null && !(comments instanceof Vector)) {
// No place to put comment.
return;
}
if (comments == null) {
! comments = new Vector();
putProperty(AdditionalComments, comments);
}
! ((Vector)comments).addElement(comment);
}
/**
* Callback from the parser. Route to the appropriate
* handler for the tag.
--- 2696,2711 ----
if (comments != null && !(comments instanceof Vector)) {
// No place to put comment.
return;
}
if (comments == null) {
! comments = new Vector<>();
putProperty(AdditionalComments, comments);
}
! @SuppressWarnings("unchecked")
! Vector<Object> v = (Vector<Object>)comments;
! v.addElement(comment);
}
/**
* Callback from the parser. Route to the appropriate
* handler for the tag.
*** 3437,3453 ****
--- 3443,3461 ----
// build the element, unless this is an option.
if (t == HTML.Tag.OPTION) {
option = new Option(attr);
if (selectModel instanceof OptionListModel) {
+ @SuppressWarnings("unchecked")
OptionListModel<Option> m = (OptionListModel<Option>) selectModel;
m.addElement(option);
if (option.isSelected()) {
m.addSelectionInterval(optionCount, optionCount);
m.setInitialSelection(optionCount);
}
} else if (selectModel instanceof OptionComboBoxModel) {
+ @SuppressWarnings("unchecked")
OptionComboBoxModel<Option> m = (OptionComboBoxModel<Option>) selectModel;
m.addElement(option);
if (option.isSelected()) {
m.setSelectedItem(option);
m.setInitialSelection(option);