Fix generics warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1391885 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Nick Burch 2012-09-29 21:25:44 +00:00
parent a475de5785
commit aa358ace11

View File

@ -17,11 +17,12 @@
package org.apache.poi.hssf.usermodel;
import java.util.HashSet;
import java.util.Iterator;
import org.apache.poi.hssf.record.ExtendedFormatRecord;
import org.apache.poi.hssf.record.FontRecord;
import org.apache.poi.hssf.record.common.UnicodeString;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
/**
* Excel can get cranky if you give it files containing too
@ -135,17 +136,13 @@ public class HSSFOptimiser {
// the new locations of the fonts
// Remember that one underlying unicode string
// may be shared by multiple RichTextStrings!
HashSet doneUnicodeStrings = new HashSet();
HashSet<UnicodeString> doneUnicodeStrings = new HashSet<UnicodeString>();
for(int sheetNum=0; sheetNum<workbook.getNumberOfSheets(); sheetNum++) {
HSSFSheet s = workbook.getSheetAt(sheetNum);
Iterator rIt = s.rowIterator();
while(rIt.hasNext()) {
HSSFRow row = (HSSFRow)rIt.next();
Iterator cIt = row.cellIterator();
while(cIt.hasNext()) {
HSSFCell cell = (HSSFCell)cIt.next();
if(cell.getCellType() == HSSFCell.CELL_TYPE_STRING) {
HSSFRichTextString rtr = cell.getRichStringCellValue();
for (Row row : s) {
for (Cell cell : row) {
if(cell.getCellType() == Cell.CELL_TYPE_STRING) {
HSSFRichTextString rtr = (HSSFRichTextString)cell.getRichStringCellValue();
UnicodeString u = rtr.getRawUnicodeString();
// Have we done this string already?
@ -244,12 +241,9 @@ public class HSSFOptimiser {
// their new extended format records
for(int sheetNum=0; sheetNum<workbook.getNumberOfSheets(); sheetNum++) {
HSSFSheet s = workbook.getSheetAt(sheetNum);
Iterator rIt = s.rowIterator();
while(rIt.hasNext()) {
HSSFRow row = (HSSFRow)rIt.next();
Iterator cIt = row.cellIterator();
while(cIt.hasNext()) {
HSSFCell cell = (HSSFCell)cIt.next();
for (Row row : s) {
for (Cell cellI : row) {
HSSFCell cell = (HSSFCell)cellI;
short oldXf = cell.getCellValueRecord().getXFIndex();
HSSFCellStyle newStyle = workbook.getCellStyleAt(
newPos[oldXf]