Fix compiling Examples after adding new interface-method, fix compiler warnings and adjust some broken Javadoc

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1809388 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2017-09-23 10:26:27 +00:00
parent 851be073bc
commit 4b5c908180
4 changed files with 26 additions and 36 deletions

View File

@ -32,12 +32,12 @@ import org.apache.poi.hssf.usermodel.*;
*
* @author Jason Height
*/
public class SVRowHeader extends JList {
public class SVRowHeader extends JList<Object> {
/** This model simply returns an integer number up to the number of rows
* that are present in the sheet.
*
*/
private class SVRowHeaderModel extends AbstractListModel {
private class SVRowHeaderModel extends AbstractListModel<Object> {
private HSSFSheet sheet;
public SVRowHeaderModel(HSSFSheet sheet) {
@ -55,7 +55,7 @@ public class SVRowHeader extends JList {
}
/** Renderes the row number*/
private class RowHeaderRenderer extends JLabel implements ListCellRenderer {
private class RowHeaderRenderer extends JLabel implements ListCellRenderer<Object> {
private HSSFSheet sheet;
private int extraHeight;
@ -90,7 +90,7 @@ public class SVRowHeader extends JList {
}
public SVRowHeader(HSSFSheet sheet, JTable table, int extraHeight) {
ListModel lm = new SVRowHeaderModel(sheet);
ListModel<Object> lm = new SVRowHeaderModel(sheet);
this.setModel(lm);
setFixedCellWidth(50);

View File

@ -28,6 +28,8 @@ import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.Color;
import org.apache.poi.ss.usermodel.DateUtil;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
@ -109,10 +111,9 @@ public class ExcelComparator {
/**
* Utility to compare Excel File Contents cell by cell for all sheets.
*
* @param workbook1 the workbook1
* @param workbook2 the workbook2
* @param wb1 the workbook1
* @param wb2 the workbook2
* @return the Excel file difference containing a flag and a list of differences
* @throws ExcelCompareException the excel compare exception
*/
public static List<String> compare(Workbook wb1, Workbook wb2) {
Locator loc1 = new Locator();
@ -130,11 +131,6 @@ public class ExcelComparator {
/**
* Compare data in all sheets.
*
* @param workbook1 the workbook1
* @param workbook2 the workbook2
* @param listOfDifferences the list of differences
* @throws ExcelCompareException the excel compare exception
*/
private void compareDataInAllSheets(Locator loc1, Locator loc2) {
for (int i = 0; i < loc1.workbook.getNumberOfSheets(); i++) {
@ -291,15 +287,6 @@ public class ExcelComparator {
/**
* Compare sheet data.
*
* @param workbook1
* the workbook1
* @param workbook2
* the workbook2
* @param listOfDifferences
*
* @throws ExcelCompareException
* the excel compare exception
*/
private void compareSheetData(Locator loc1, Locator loc2) {
compareNumberOfRowsInSheets(loc1, loc2);
@ -343,13 +330,13 @@ public class ExcelComparator {
*/
private void isCellAlignmentMatches(Locator loc1, Locator loc2) {
// TODO: check for NPE
short align1 = loc1.cell.getCellStyle().getAlignment();
short align2 = loc2.cell.getCellStyle().getAlignment();
HorizontalAlignment align1 = loc1.cell.getCellStyle().getAlignmentEnum();
HorizontalAlignment align2 = loc2.cell.getCellStyle().getAlignmentEnum();
if (align1 != align2) {
addMessage(loc1, loc2,
"Cell Alignment does not Match ::",
Short.toString(align1),
Short.toString(align2)
align1.name(),
align2.name()
);
}
}
@ -424,7 +411,7 @@ public class ExcelComparator {
Date date1 = loc1.cell.getDateCellValue();
Date date2 = loc2.cell.getDateCellValue();
if (!date1.equals(date2)) {
addMessage(loc1, loc2, CELL_DATA_DOES_NOT_MATCH, date1.toGMTString(), date2.toGMTString());
addMessage(loc1, loc2, CELL_DATA_DOES_NOT_MATCH, date1.toString(), date2.toString());
}
}
@ -473,13 +460,13 @@ public class ExcelComparator {
*/
private void isCellFillPatternMatches(Locator loc1, Locator loc2) {
// TOOO: Check for NPE
short fill1 = loc1.cell.getCellStyle().getFillPattern();
short fill2 = loc2.cell.getCellStyle().getFillPattern();
FillPatternType fill1 = loc1.cell.getCellStyle().getFillPatternEnum();
FillPatternType fill2 = loc2.cell.getCellStyle().getFillPatternEnum();
if (fill1 != fill2) {
addMessage(loc1, loc2,
"Cell Fill pattern does not Match ::",
Short.toString(fill1),
Short.toString(fill2)
fill1.name(),
fill2.name()
);
}
}
@ -591,12 +578,6 @@ public class ExcelComparator {
/**
* Checks if cell under line matches.
*
* @param cellWorkBook1
* the cell work book1
* @param cellWorkBook2
* the cell work book2
* @return true, if cell under line matches
*/
private void isCellUnderLineMatches(Locator loc1, Locator loc2) {
// TOOO: distinguish underline type

View File

@ -140,6 +140,10 @@ public class XLSX2CSV {
public void headerFooter(String text, boolean isHeader, String tagName) {
// Skip, no headers or footers in CSV
}
@Override
public void endSheet() {
}
}

View File

@ -75,6 +75,11 @@ public class HybridStreaming {
@Override
public void cell(String cellReference, String formattedValue, XSSFComment comment) {
}
@Override
public void endSheet() {
}
};
}