findbugs: fix SF_SWITCH_FALLTHROUGH warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1748088 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
609d0c1826
commit
84113f3c63
@ -269,7 +269,8 @@ public final class EmbeddedObjectRefSubRecord extends SubRecord implements Clone
|
|||||||
switch(idOffset - (pos - 6)) { // 6 for 3 shorts: sid, dataSize, idOffset
|
switch(idOffset - (pos - 6)) { // 6 for 3 shorts: sid, dataSize, idOffset
|
||||||
case 1:
|
case 1:
|
||||||
out.writeByte(field_4_unknownByte == null ? 0x00 : field_4_unknownByte.intValue());
|
out.writeByte(field_4_unknownByte == null ? 0x00 : field_4_unknownByte.intValue());
|
||||||
pos ++;
|
pos++;
|
||||||
|
break;
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -457,6 +457,7 @@ public class HSSFCell implements Cell {
|
|||||||
* precalculated value, for numerics we'll set its value. For other types we
|
* precalculated value, for numerics we'll set its value. For other types we
|
||||||
* will change the cell to a numeric cell and set its value.
|
* will change the cell to a numeric cell and set its value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public void setCellValue(double value) {
|
public void setCellValue(double value) {
|
||||||
if(Double.isInfinite(value)) {
|
if(Double.isInfinite(value)) {
|
||||||
// Excel does not support positive/negative infinities,
|
// Excel does not support positive/negative infinities,
|
||||||
@ -474,6 +475,7 @@ public class HSSFCell implements Cell {
|
|||||||
switch (_cellType) {
|
switch (_cellType) {
|
||||||
default:
|
default:
|
||||||
setCellType(CELL_TYPE_NUMERIC, false, row, col, styleIndex);
|
setCellType(CELL_TYPE_NUMERIC, false, row, col, styleIndex);
|
||||||
|
// fall through
|
||||||
case CELL_TYPE_NUMERIC:
|
case CELL_TYPE_NUMERIC:
|
||||||
(( NumberRecord ) _record).setValue(value);
|
(( NumberRecord ) _record).setValue(value);
|
||||||
break;
|
break;
|
||||||
@ -743,6 +745,7 @@ public class HSSFCell implements Cell {
|
|||||||
* precalculated value, for booleans we'll set its value. For other types we
|
* precalculated value, for booleans we'll set its value. For other types we
|
||||||
* will change the cell to a boolean cell and set its value.
|
* will change the cell to a boolean cell and set its value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public void setCellValue(boolean value) {
|
public void setCellValue(boolean value) {
|
||||||
int row=_record.getRow();
|
int row=_record.getRow();
|
||||||
short col=_record.getColumn();
|
short col=_record.getColumn();
|
||||||
@ -751,6 +754,7 @@ public class HSSFCell implements Cell {
|
|||||||
switch (_cellType) {
|
switch (_cellType) {
|
||||||
default:
|
default:
|
||||||
setCellType(CELL_TYPE_BOOLEAN, false, row, col, styleIndex);
|
setCellType(CELL_TYPE_BOOLEAN, false, row, col, styleIndex);
|
||||||
|
// fall through
|
||||||
case CELL_TYPE_BOOLEAN:
|
case CELL_TYPE_BOOLEAN:
|
||||||
(( BoolErrRecord ) _record).setValue(value);
|
(( BoolErrRecord ) _record).setValue(value);
|
||||||
break;
|
break;
|
||||||
@ -768,6 +772,7 @@ public class HSSFCell implements Cell {
|
|||||||
* its value. For other types we will change the cell to an error
|
* its value. For other types we will change the cell to an error
|
||||||
* cell and set its value.
|
* cell and set its value.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public void setCellErrorValue(byte errorCode) {
|
public void setCellErrorValue(byte errorCode) {
|
||||||
int row=_record.getRow();
|
int row=_record.getRow();
|
||||||
short col=_record.getColumn();
|
short col=_record.getColumn();
|
||||||
@ -775,6 +780,7 @@ public class HSSFCell implements Cell {
|
|||||||
switch (_cellType) {
|
switch (_cellType) {
|
||||||
default:
|
default:
|
||||||
setCellType(CELL_TYPE_ERROR, false, row, col, styleIndex);
|
setCellType(CELL_TYPE_ERROR, false, row, col, styleIndex);
|
||||||
|
// fall through
|
||||||
case CELL_TYPE_ERROR:
|
case CELL_TYPE_ERROR:
|
||||||
(( BoolErrRecord ) _record).setValue(errorCode);
|
(( BoolErrRecord ) _record).setValue(errorCode);
|
||||||
break;
|
break;
|
||||||
|
@ -1744,6 +1744,7 @@ public final class HSSFWorkbook extends POIDocument implements org.apache.poi.ss
|
|||||||
* @see #PICTURE_TYPE_JPEG
|
* @see #PICTURE_TYPE_JPEG
|
||||||
* @see #PICTURE_TYPE_DIB
|
* @see #PICTURE_TYPE_DIB
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
@Override
|
@Override
|
||||||
public int addPicture(byte[] pictureData, int format)
|
public int addPicture(byte[] pictureData, int format)
|
||||||
{
|
{
|
||||||
|
@ -65,6 +65,7 @@ final class YearFrac implements FreeRefFunction {
|
|||||||
switch(args.length) {
|
switch(args.length) {
|
||||||
case 3:
|
case 3:
|
||||||
basis = evaluateIntArg(args[2], srcCellRow, srcCellCol);
|
basis = evaluateIntArg(args[2], srcCellRow, srcCellCol);
|
||||||
|
// fall through
|
||||||
case 2:
|
case 2:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -87,6 +87,7 @@ public abstract class FinanceFunction implements Function3Arg, Function4Arg {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
protected double evaluate(double[] ds) throws EvaluationException {
|
protected double evaluate(double[] ds) throws EvaluationException {
|
||||||
// All finance functions have 3 to 5 args, first 4 are numbers, last is boolean
|
// All finance functions have 3 to 5 args, first 4 are numbers, last is boolean
|
||||||
// default for last 2 args are 0.0 and false
|
// default for last 2 args are 0.0 and false
|
||||||
@ -98,8 +99,10 @@ public abstract class FinanceFunction implements Function3Arg, Function4Arg {
|
|||||||
switch(ds.length) {
|
switch(ds.length) {
|
||||||
case 5:
|
case 5:
|
||||||
arg4 = ds[4];
|
arg4 = ds[4];
|
||||||
|
// fall through
|
||||||
case 4:
|
case 4:
|
||||||
arg3 = ds[3];
|
arg3 = ds[3];
|
||||||
|
// fall through
|
||||||
case 3:
|
case 3:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -161,6 +161,7 @@ public final class Offset implements Function {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
public ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) {
|
public ValueEval evaluate(ValueEval[] args, int srcCellRow, int srcCellCol) {
|
||||||
if(args.length < 3 || args.length > 5) {
|
if(args.length < 3 || args.length > 5) {
|
||||||
return ErrorEval.VALUE_INVALID;
|
return ErrorEval.VALUE_INVALID;
|
||||||
|
@ -101,6 +101,7 @@ public class HexRead
|
|||||||
return readData(stream, section);
|
return readData(stream, section);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("fallthrough")
|
||||||
static public byte[] readData( InputStream stream, int eofChar )
|
static public byte[] readData( InputStream stream, int eofChar )
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
@ -137,6 +138,7 @@ public class HexRead
|
|||||||
case 'E':
|
case 'E':
|
||||||
case 'F':
|
case 'F':
|
||||||
baseChar = 'A';
|
baseChar = 'A';
|
||||||
|
// fall through
|
||||||
case 'a':
|
case 'a':
|
||||||
case 'b':
|
case 'b':
|
||||||
case 'c':
|
case 'c':
|
||||||
|
@ -82,6 +82,40 @@
|
|||||||
<Field name="pitch" />
|
<Field name="pitch" />
|
||||||
</Or>
|
</Or>
|
||||||
</Match>
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Class name="org.apache.poi.hssf.usermodel.HSSFCell"/>
|
||||||
|
<Or>
|
||||||
|
<Method name="setCellValue" params="double" />
|
||||||
|
<Method name="setCellValue" params="boolean" />
|
||||||
|
<Method name="setCellErrorValue" params="byte" />
|
||||||
|
</Or>
|
||||||
|
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
|
||||||
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Class name="org.apache.poi.hssf.usermodel.HSSFWorkbook"/>
|
||||||
|
<Method name="addPicture" />
|
||||||
|
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
|
||||||
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Class name="org.apache.poi.ss.formula.atp.YearFrac"/>
|
||||||
|
<Method name="evaluate" />
|
||||||
|
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
|
||||||
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Class name="org.apache.poi.ss.formula.functions.FinanceFunction"/>
|
||||||
|
<Method name="evaluate" />
|
||||||
|
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
|
||||||
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Class name="org.apache.poi.ss.formula.functions.Offset"/>
|
||||||
|
<Method name="evaluate" />
|
||||||
|
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
|
||||||
|
</Match>
|
||||||
|
<Match>
|
||||||
|
<Class name="org.apache.poi.util.HeadRead"/>
|
||||||
|
<Method name="readData" params="java.io.InputStream,int" />
|
||||||
|
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
|
||||||
|
</Match>
|
||||||
|
|
||||||
|
|
||||||
<!-- invalid performance issues - e.g. see #57840 -->
|
<!-- invalid performance issues - e.g. see #57840 -->
|
||||||
|
Loading…
Reference in New Issue
Block a user