aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-02-09 22:33:24 +0000
committerDominik Stadler <centic@apache.org>2015-02-09 22:33:24 +0000
commitd05e0e199c4c9b103843f14d037cdfda4a19769a (patch)
treecf5f94d9f2cc9a6143a4aed45c3899ad863ec890
parent18a640a2a9ae35d5cc3670c54531fe9830a4a682 (diff)
downloadpoi-d05e0e199c4c9b103843f14d037cdfda4a19769a.tar.gz
poi-d05e0e199c4c9b103843f14d037cdfda4a19769a.zip
Bug 57480: Fix some unnecessary casts, generics, Eclipse warnings, ...
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1658594 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/poi/hssf/dev/RecordLister.java2
-rw-r--r--src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java5
-rw-r--r--src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java1
-rw-r--r--src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java2
-rw-r--r--src/java/org/apache/poi/hssf/model/DrawingManager.java6
-rw-r--r--src/java/org/apache/poi/hssf/model/RowBlocksReader.java2
-rw-r--r--src/java/org/apache/poi/hssf/record/DrawingGroupRecord.java11
-rw-r--r--src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java4
-rw-r--r--src/java/org/apache/poi/hssf/record/VerticalPageBreakRecord.java4
-rw-r--r--src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java8
-rw-r--r--src/java/org/apache/poi/hssf/record/chart/ChartTitleFormatRecord.java5
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java4
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java1
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/EscherGraphics2d.java4
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java1
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFFont.java2
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java2
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFRow.java2
-rw-r--r--src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java4
-rw-r--r--src/java/org/apache/poi/hssf/util/HSSFColor.java2
-rw-r--r--src/java/org/apache/poi/ss/formula/functions/Code.java2
-rw-r--r--src/java/org/apache/poi/ss/formula/functions/ImReal.java11
-rw-r--r--src/java/org/apache/poi/ss/formula/functions/PPMT.java2
-rw-r--r--src/java/org/apache/poi/ss/formula/functions/TextFunction.java2
-rw-r--r--src/java/org/apache/poi/ss/usermodel/FractionFormat.java2
-rw-r--r--src/java/org/apache/poi/ss/util/SheetReferences.java8
26 files changed, 45 insertions, 54 deletions
diff --git a/src/java/org/apache/poi/hssf/dev/RecordLister.java b/src/java/org/apache/poi/hssf/dev/RecordLister.java
index 4031167872..28896f2a11 100644
--- a/src/java/org/apache/poi/hssf/dev/RecordLister.java
+++ b/src/java/org/apache/poi/hssf/dev/RecordLister.java
@@ -154,7 +154,7 @@ public class RecordLister
return s.toString();
}
private static String byteToHex(byte b) {
- int i = (int)b;
+ int i = b;
if(i<0) {
i += 256;
}
diff --git a/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java b/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java
index 1b36ffd76e..5d6562dd53 100644
--- a/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java
+++ b/src/java/org/apache/poi/hssf/eventusermodel/HSSFRequest.java
@@ -92,11 +92,10 @@ public class HSSFRequest {
* @throws HSSFUserException User exception condition
*/
protected short processRecord(Record rec) throws HSSFUserException {
- Object obj = _records.get(Short.valueOf(rec.getSid()));
+ List<HSSFListener> listeners = _records.get(Short.valueOf(rec.getSid()));
short userCode = 0;
- if (obj != null) {
- List listeners = (List) obj;
+ if (listeners != null) {
for (int k = 0; k < listeners.size(); k++) {
Object listenObj = listeners.get(k);
diff --git a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
index 6d89a1f047..889de20b4c 100644
--- a/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
+++ b/src/java/org/apache/poi/hssf/extractor/EventBasedExcelExtractor.java
@@ -68,7 +68,6 @@ public class EventBasedExcelExtractor extends POIOLE2TextExtractor implements or
* @deprecated Use {@link #EventBasedExcelExtractor(DirectoryNode)} instead
*/
@Deprecated
- @SuppressWarnings( "unused" )
public EventBasedExcelExtractor( DirectoryNode dir, POIFSFileSystem fs )
{
this( dir );
diff --git a/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java b/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
index b620623595..57c6e01ca7 100644
--- a/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
+++ b/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
@@ -72,7 +72,6 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p
* @deprecated Use {@link #ExcelExtractor(DirectoryNode)} instead
*/
@Deprecated
- @SuppressWarnings( "unused" )
public ExcelExtractor(DirectoryNode dir, POIFSFileSystem fs) throws IOException {
this( dir );
}
@@ -241,6 +240,7 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p
extractor.setIncludeBlankCells(cmdArgs.shouldShowBlankCells());
extractor.setIncludeHeadersFooters(cmdArgs.shouldIncludeHeadersFooters());
System.out.println(extractor.getText());
+ extractor.close();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
diff --git a/src/java/org/apache/poi/hssf/model/DrawingManager.java b/src/java/org/apache/poi/hssf/model/DrawingManager.java
index 5fecaaa52b..dd3a8daf82 100644
--- a/src/java/org/apache/poi/hssf/model/DrawingManager.java
+++ b/src/java/org/apache/poi/hssf/model/DrawingManager.java
@@ -29,7 +29,7 @@ import java.util.HashMap;
public class DrawingManager
{
EscherDggRecord dgg;
- Map dgMap = new HashMap(); // key = Short(drawingId), value=EscherDgRecord
+ Map<Short, EscherDgRecord> dgMap = new HashMap<Short, EscherDgRecord>(); // key = Short(drawingId), value=EscherDgRecord
public DrawingManager( EscherDggRecord dgg )
{
@@ -46,7 +46,7 @@ public class DrawingManager
dg.setLastMSOSPID( -1 );
dgg.addCluster( dgId, 0 );
dgg.setDrawingsSaved( dgg.getDrawingsSaved() + 1 );
- dgMap.put( Short.valueOf( dgId ), dg );
+ dgMap.put( dgId, dg );
return dg;
}
@@ -58,7 +58,7 @@ public class DrawingManager
public int allocateShapeId(short drawingGroupId)
{
// Get the last shape id for this drawing group.
- EscherDgRecord dg = (EscherDgRecord) dgMap.get(Short.valueOf(drawingGroupId));
+ EscherDgRecord dg = dgMap.get(drawingGroupId);
int lastShapeId = dg.getLastMSOSPID();
diff --git a/src/java/org/apache/poi/hssf/model/RowBlocksReader.java b/src/java/org/apache/poi/hssf/model/RowBlocksReader.java
index 29a4ed22c1..f0b5d31077 100644
--- a/src/java/org/apache/poi/hssf/model/RowBlocksReader.java
+++ b/src/java/org/apache/poi/hssf/model/RowBlocksReader.java
@@ -36,7 +36,7 @@ import org.apache.poi.ss.util.CellReference;
*/
public final class RowBlocksReader {
- private final List _plainRecords;
+ private final List<Record> _plainRecords;
private final SharedValueManager _sfm;
private final MergeCellsRecord[] _mergedCellsRecords;
diff --git a/src/java/org/apache/poi/hssf/record/DrawingGroupRecord.java b/src/java/org/apache/poi/hssf/record/DrawingGroupRecord.java
index eeddf5e21a..2304c04705 100644
--- a/src/java/org/apache/poi/hssf/record/DrawingGroupRecord.java
+++ b/src/java/org/apache/poi/hssf/record/DrawingGroupRecord.java
@@ -19,7 +19,6 @@ package org.apache.poi.hssf.record;
import org.apache.poi.ddf.EscherRecord;
import org.apache.poi.ddf.NullEscherSerializationListener;
-import org.apache.poi.util.ArrayUtil;
import org.apache.poi.util.LittleEndian;
import java.util.Iterator;
@@ -60,9 +59,9 @@ public final class DrawingGroupRecord extends AbstractEscherHolderRecord {
}
byte[] buffer = new byte[getRawDataSize()];
int pos = 0;
- for ( Iterator iterator = getEscherRecords().iterator(); iterator.hasNext(); )
+ for ( Iterator<EscherRecord> iterator = getEscherRecords().iterator(); iterator.hasNext(); )
{
- EscherRecord r = (EscherRecord) iterator.next();
+ EscherRecord r = iterator.next();
pos += r.serialize(pos, buffer, new NullEscherSerializationListener() );
}
@@ -85,16 +84,16 @@ public final class DrawingGroupRecord extends AbstractEscherHolderRecord {
}
private int getRawDataSize() {
- List escherRecords = getEscherRecords();
+ List<EscherRecord> escherRecords = getEscherRecords();
byte[] rawData = getRawData();
if (escherRecords.size() == 0 && rawData != null)
{
return rawData.length;
}
int size = 0;
- for ( Iterator iterator = escherRecords.iterator(); iterator.hasNext(); )
+ for ( Iterator<EscherRecord> iterator = escherRecords.iterator(); iterator.hasNext(); )
{
- EscherRecord r = (EscherRecord) iterator.next();
+ EscherRecord r = iterator.next();
size += r.getRecordSize();
}
return size;
diff --git a/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java b/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java
index 63e757f8df..8077efe922 100644
--- a/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java
+++ b/src/java/org/apache/poi/hssf/record/HorizontalPageBreakRecord.java
@@ -50,9 +50,9 @@ public final class HorizontalPageBreakRecord extends PageBreakRecord {
public Object clone() {
PageBreakRecord result = new HorizontalPageBreakRecord();
- Iterator iterator = getBreaksIterator();
+ Iterator<Break> iterator = getBreaksIterator();
while (iterator.hasNext()) {
- Break original = (Break) iterator.next();
+ Break original = iterator.next();
result.addBreak(original.main, original.subFrom, original.subTo);
}
return result;
diff --git a/src/java/org/apache/poi/hssf/record/VerticalPageBreakRecord.java b/src/java/org/apache/poi/hssf/record/VerticalPageBreakRecord.java
index 3dc5348f97..399a96a46e 100644
--- a/src/java/org/apache/poi/hssf/record/VerticalPageBreakRecord.java
+++ b/src/java/org/apache/poi/hssf/record/VerticalPageBreakRecord.java
@@ -49,9 +49,9 @@ public final class VerticalPageBreakRecord extends PageBreakRecord {
public Object clone() {
PageBreakRecord result = new VerticalPageBreakRecord();
- Iterator iterator = getBreaksIterator();
+ Iterator<Break> iterator = getBreaksIterator();
while (iterator.hasNext()) {
- Break original = (Break) iterator.next();
+ Break original = iterator.next();
result.addBreak(original.main, original.subFrom, original.subTo);
}
return result;
diff --git a/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java b/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java
index 588276274f..cc59338a5e 100644
--- a/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java
+++ b/src/java/org/apache/poi/hssf/record/aggregates/MergedCellsTable.java
@@ -32,13 +32,13 @@ import org.apache.poi.ss.util.CellRangeAddressList;
public final class MergedCellsTable extends RecordAggregate {
private static int MAX_MERGED_REGIONS = 1027; // enforced by the 8224 byte limit
- private final List _mergedRegions;
+ private final List<CellRangeAddress> _mergedRegions;
/**
* Creates an empty aggregate
*/
public MergedCellsTable() {
- _mergedRegions = new ArrayList();
+ _mergedRegions = new ArrayList<CellRangeAddress>();
}
/**
@@ -46,7 +46,7 @@ public final class MergedCellsTable extends RecordAggregate {
* @param rs
*/
public void read(RecordStream rs) {
- List temp = _mergedRegions;
+ List<CellRangeAddress> temp = _mergedRegions;
while (rs.peekNextClass() == MergeCellsRecord.class) {
MergeCellsRecord mcr = (MergeCellsRecord) rs.getNext();
int nRegions = mcr.getNumAreas();
@@ -110,7 +110,7 @@ public final class MergedCellsTable extends RecordAggregate {
public CellRangeAddress get(int index) {
checkIndex(index);
- return (CellRangeAddress) _mergedRegions.get(index);
+ return _mergedRegions.get(index);
}
public void remove(int index) {
diff --git a/src/java/org/apache/poi/hssf/record/chart/ChartTitleFormatRecord.java b/src/java/org/apache/poi/hssf/record/chart/ChartTitleFormatRecord.java
index ac9859048a..f724aada3a 100644
--- a/src/java/org/apache/poi/hssf/record/chart/ChartTitleFormatRecord.java
+++ b/src/java/org/apache/poi/hssf/record/chart/ChartTitleFormatRecord.java
@@ -38,11 +38,6 @@ public class ChartTitleFormatRecord extends StandardRecord {
private int _offset;
private int _fontIndex;
- protected CTFormat(short offset,short fontIdx){
- _offset = offset;
- _fontIndex = fontIdx;
- }
-
public CTFormat(RecordInputStream in) {
_offset = in.readShort();
_fontIndex = in.readShort();
diff --git a/src/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java b/src/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java
index 42debc6d81..beadac4646 100644
--- a/src/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java
+++ b/src/java/org/apache/poi/hssf/usermodel/DummyGraphics2d.java
@@ -42,7 +42,7 @@ public class DummyGraphics2d
g2D = (Graphics2D)img.getGraphics();
}
- public void addRenderingHints(Map hints)
+ public void addRenderingHints(Map<?,?> hints)
{
System.out.println( "addRenderingHinds(Map):" );
System.out.println( " hints = " + hints );
@@ -275,7 +275,7 @@ public class DummyGraphics2d
g2D.setRenderingHint( hintKey, hintValue );
}
- public void setRenderingHints(Map hints)
+ public void setRenderingHints(Map<?,?> hints)
{
System.out.println( "setRenderingHints(Map):" );
System.out.println( "hints = " + hints );
diff --git a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java
index 4293587b38..1f31e80bd6 100644
--- a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java
+++ b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics.java
@@ -431,7 +431,6 @@ public class EscherGraphics
return null;
}
- @SuppressWarnings("deprecation")
public Rectangle getClipRect()
{
return getClipBounds();
diff --git a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics2d.java b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics2d.java
index 45306e89f0..949168aac1 100644
--- a/src/java/org/apache/poi/hssf/usermodel/EscherGraphics2d.java
+++ b/src/java/org/apache/poi/hssf/usermodel/EscherGraphics2d.java
@@ -89,7 +89,7 @@ public final class EscherGraphics2d extends Graphics2D {
setColor(Color.black);
}
- public void addRenderingHints(Map map)
+ public void addRenderingHints(Map<?, ?> map)
{
getG2D().addRenderingHints(map);
}
@@ -514,7 +514,7 @@ public final class EscherGraphics2d extends Graphics2D {
getG2D().setRenderingHint(key, obj);
}
- public void setRenderingHints(Map map)
+ public void setRenderingHints(Map<?, ?> map)
{
getG2D().setRenderingHints(map);
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
index dc2a217330..b1cb174a99 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFDataFormat.java
@@ -63,7 +63,6 @@ public final class HSSFDataFormat implements DataFormat {
HSSFDataFormat(InternalWorkbook workbook) {
_workbook = workbook;
- @SuppressWarnings("unchecked")
Iterator<FormatRecord> i = workbook.getFormats().iterator();
while (i.hasNext()) {
FormatRecord r = i.next();
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java b/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java
index 73b402facd..aed0c513fd 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFFont.java
@@ -309,7 +309,7 @@ public final class HSSFFont implements Font {
{
byte charset = font.getCharset();
if(charset >= 0) {
- return (int)charset;
+ return charset;
} else {
return charset + 256;
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
index 96ab009748..6ac5368402 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java
@@ -134,7 +134,7 @@ public final class HSSFPalette {
* 0 and 255, so distance calculations work as expected.
*/
private int unsignedInt(byte b) {
- return 0xFF & ((int) b);
+ return 0xFF & b;
}
/**
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
index 67315f12af..5b4a17ec85 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFRow.java
@@ -617,7 +617,7 @@ public final class HSSFRow implements Row {
* Alias for {@link #cellIterator} to allow
* foreach loops
*/
- public Iterator iterator() {
+ public Iterator<Cell> iterator() {
return cellIterator();
}
diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java b/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java
index 004b2f4606..66440005b2 100644
--- a/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java
+++ b/src/java/org/apache/poi/hssf/usermodel/HSSFShapeGroup.java
@@ -305,8 +305,8 @@ public class HSSFShapeGroup extends HSSFShape implements HSSFShapeContainer {
*/
public int countOfAllChildren() {
int count = shapes.size();
- for (Iterator iterator = shapes.iterator(); iterator.hasNext(); ) {
- HSSFShape shape = (HSSFShape) iterator.next();
+ for (Iterator<HSSFShape> iterator = shapes.iterator(); iterator.hasNext(); ) {
+ HSSFShape shape = iterator.next();
count += shape.countOfAllChildren();
}
return count;
diff --git a/src/java/org/apache/poi/hssf/util/HSSFColor.java b/src/java/org/apache/poi/hssf/util/HSSFColor.java
index 493db7f38f..f438e1b001 100644
--- a/src/java/org/apache/poi/hssf/util/HSSFColor.java
+++ b/src/java/org/apache/poi/hssf/util/HSSFColor.java
@@ -75,7 +75,7 @@ public class HSSFColor implements Color {
Integer index1 = Integer.valueOf(color.getIndex());
if (result.containsKey(index1)) {
- HSSFColor prevColor = (HSSFColor)result.get(index1);
+ HSSFColor prevColor = result.get(index1);
throw new RuntimeException("Dup color index (" + index1
+ ") for colors (" + prevColor.getClass().getName()
+ "),(" + color.getClass().getName() + ")");
diff --git a/src/java/org/apache/poi/ss/formula/functions/Code.java b/src/java/org/apache/poi/ss/formula/functions/Code.java
index c82bff7547..ee1622f584 100644
--- a/src/java/org/apache/poi/ss/formula/functions/Code.java
+++ b/src/java/org/apache/poi/ss/formula/functions/Code.java
@@ -46,7 +46,7 @@ public class Code extends Fixed1ArgFunction {
return ErrorEval.VALUE_INVALID;
}
- int code = (int)text.charAt(0);
+ int code = text.charAt(0);
return new StringEval(String.valueOf(code));
}
diff --git a/src/java/org/apache/poi/ss/formula/functions/ImReal.java b/src/java/org/apache/poi/ss/formula/functions/ImReal.java
index 394865fdd9..f7c17adef1 100644
--- a/src/java/org/apache/poi/ss/formula/functions/ImReal.java
+++ b/src/java/org/apache/poi/ss/formula/functions/ImReal.java
@@ -17,11 +17,14 @@
package org.apache.poi.ss.formula.functions;
-import org.apache.poi.ss.formula.OperationEvaluationContext;
-import org.apache.poi.ss.formula.eval.*;
-
import java.util.regex.Matcher;
-import java.util.regex.Pattern;
+
+import org.apache.poi.ss.formula.OperationEvaluationContext;
+import org.apache.poi.ss.formula.eval.ErrorEval;
+import org.apache.poi.ss.formula.eval.EvaluationException;
+import org.apache.poi.ss.formula.eval.OperandResolver;
+import org.apache.poi.ss.formula.eval.StringEval;
+import org.apache.poi.ss.formula.eval.ValueEval;
/**
* Implementation for Excel ImReal() function.<p/>
diff --git a/src/java/org/apache/poi/ss/formula/functions/PPMT.java b/src/java/org/apache/poi/ss/formula/functions/PPMT.java
index 68b8683323..2df2304db1 100644
--- a/src/java/org/apache/poi/ss/formula/functions/PPMT.java
+++ b/src/java/org/apache/poi/ss/formula/functions/PPMT.java
@@ -19,8 +19,6 @@
package org.apache.poi.ss.formula.functions;
-import org.apache.poi.ss.formula.*;
-import org.apache.poi.ss.formula.functions.*;
import org.apache.poi.ss.formula.eval.*;
/**
diff --git a/src/java/org/apache/poi/ss/formula/functions/TextFunction.java b/src/java/org/apache/poi/ss/formula/functions/TextFunction.java
index c09df12d1c..ca69b27f72 100644
--- a/src/java/org/apache/poi/ss/formula/functions/TextFunction.java
+++ b/src/java/org/apache/poi/ss/formula/functions/TextFunction.java
@@ -182,7 +182,7 @@ public abstract class TextFunction implements Function {
* @return whether the character is printable
*/
private boolean isPrintable(char c){
- int charCode = (int)c ;
+ int charCode = c;
return charCode >= 32;
}
};
diff --git a/src/java/org/apache/poi/ss/usermodel/FractionFormat.java b/src/java/org/apache/poi/ss/usermodel/FractionFormat.java
index 43564c8854..202ccdae22 100644
--- a/src/java/org/apache/poi/ss/usermodel/FractionFormat.java
+++ b/src/java/org/apache/poi/ss/usermodel/FractionFormat.java
@@ -130,7 +130,7 @@ public class FractionFormat extends Format {
if (exactDenom > 0){
fract = SimpleFraction.buildFractionExactDenominator(decPart, exactDenom);
} else {
- fract = SimpleFraction.buildFractionMaxDenominator((double)decPart, maxDenom);
+ fract = SimpleFraction.buildFractionMaxDenominator(decPart, maxDenom);
}
} catch (RuntimeException e){
e.printStackTrace();
diff --git a/src/java/org/apache/poi/ss/util/SheetReferences.java b/src/java/org/apache/poi/ss/util/SheetReferences.java
index 028538a89d..a7542763da 100644
--- a/src/java/org/apache/poi/ss/util/SheetReferences.java
+++ b/src/java/org/apache/poi/ss/util/SheetReferences.java
@@ -29,17 +29,17 @@ import java.util.Map;
*/
public class SheetReferences
{
- Map map;
+ Map<Integer, String> map;
public SheetReferences()
{
- map = new HashMap(5);
+ map = new HashMap<Integer, String>(5);
}
public void addSheetReference(String sheetName, int number) {
- map.put(Integer.valueOf(number), sheetName);
+ map.put(number, sheetName);
}
public String getSheetName(int number) {
- return (String)map.get(Integer.valueOf(number));
+ return map.get(number);
}
}