From ca12a2116332340fc4c268f5ec1f87808e4e07d7 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Sun, 28 Dec 2014 09:06:12 +0000 Subject: Fix Eclipse warnings, unnecessary casts, use generics, static access... git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1648156 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/hssf/usermodel/TestDataValidation.java | 7 +++++-- src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src/testcases/org/apache/poi/hssf/usermodel') diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java b/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java index 1d71ca5c6f..b3bfc534ed 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestDataValidation.java @@ -45,6 +45,9 @@ import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.usermodel.DataValidation.ErrorStyle; +import org.apache.poi.ss.usermodel.DataValidationConstraint.OperatorType; import org.apache.poi.ss.util.CellRangeAddressList; /** @@ -149,11 +152,11 @@ public final class TestDataValidation extends BaseTestDataValidation { int dvRow = 0; Sheet sheet = wb.getSheetAt(0); DataValidationHelper dataValidationHelper = sheet.getDataValidationHelper(); - DataValidationConstraint dc = dataValidationHelper.createIntegerConstraint(OP.EQUAL, "42", null); + DataValidationConstraint dc = dataValidationHelper.createIntegerConstraint(OperatorType.EQUAL, "42", null); DataValidation dv = dataValidationHelper.createValidation(dc,new CellRangeAddressList(dvRow, dvRow, 0, 0)); dv.setEmptyCellAllowed(false); - dv.setErrorStyle(ES.STOP); + dv.setErrorStyle(ErrorStyle.STOP); dv.setShowPromptBox(true); dv.createErrorBox("Xxx", "Yyy"); dv.setSuppressDropDownArrow(true); diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java index c9ce13fca3..7fdb4bd752 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestWorkbook.java @@ -31,6 +31,7 @@ import org.apache.poi.hssf.record.LabelSSTRecord; import org.apache.poi.hssf.record.Record; import org.apache.poi.hssf.record.aggregates.RecordAggregate.RecordVisitor; import org.apache.poi.poifs.filesystem.POIFSFileSystem; +import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.ss.util.Region; import org.apache.poi.util.TempFile; @@ -395,7 +396,7 @@ public final class TestWorkbook extends TestCase { HSSFCell c = s.getRow(0).getCell(0); int a = c.getCellType(); - assertEquals(a, c.CELL_TYPE_NUMERIC); + assertEquals(a, Cell.CELL_TYPE_NUMERIC); } /** -- cgit v1.2.3