src/share/classes/javax/swing/table/DefaultTableColumnModel.java
Print this page
@@ -267,16 +267,16 @@
public int getColumnIndex(Object identifier) {
if (identifier == null) {
throw new IllegalArgumentException("Identifier is null");
}
- Enumeration enumeration = getColumns();
+ Enumeration<TableColumn> enumeration = getColumns();
TableColumn aColumn;
int index = 0;
while (enumeration.hasMoreElements()) {
- aColumn = (TableColumn)enumeration.nextElement();
+ aColumn = enumeration.nextElement();
// Compare them this way in case the column's identifier is null.
if (identifier.equals(aColumn.getIdentifier()))
return index;
index++;
}
@@ -724,14 +724,14 @@
/**
* Recalculates the total combined width of all columns. Updates the
* <code>totalColumnWidth</code> property.
*/
protected void recalcWidthCache() {
- Enumeration enumeration = getColumns();
+ Enumeration<TableColumn> enumeration = getColumns();
totalColumnWidth = 0;
while (enumeration.hasMoreElements()) {
- totalColumnWidth += ((TableColumn)enumeration.nextElement()).getWidth();
+ totalColumnWidth += enumeration.nextElement().getWidth();
}
}
private void invalidateWidthCache() {
totalColumnWidth = -1;