fix several findbugs SF_SWITCH_NO_DEFAULT warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1738765 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Javen O'Neal 2016-04-12 11:12:57 +00:00
parent aa6083ce0a
commit cb5544ad9f
7 changed files with 37 additions and 1 deletions

View File

@ -110,6 +110,8 @@ public class FormulaViewer
case Ptg.CLASS_ARRAY :
buf.append("ARRAY");
break;
default:
throwInvalidRVAToken(token);
}
buf.append(sep);
@ -125,6 +127,8 @@ public class FormulaViewer
case Ptg.CLASS_ARRAY :
buf.append("ARRAY");
break;
default:
throwInvalidRVAToken(token);
}
}else {
buf.append("VALUE");
@ -173,12 +177,18 @@ public class FormulaViewer
case Ptg.CLASS_ARRAY :
buf.append("(A)");
break;
default:
throwInvalidRVAToken(token);
}
buf.append(' ');
}
return buf.toString();
}
private static void throwInvalidRVAToken(Ptg token) {
throw new IllegalStateException("Invalid RVA type (" + token.getPtgClass() + "). This should never happen.");
}
private static String composeFormula(FormulaRecord record)
{

View File

@ -134,6 +134,8 @@ public final class MissingRecordAwareHSSFListener implements HSSFListener {
thisRow = nrec.getRow();
thisColumn = nrec.getColumn();
break;
default:
break;
}
}

View File

@ -367,6 +367,8 @@ public class ExcelExtractor extends POIOLE2TextExtractor implements org.apache.p
case HSSFCell.CELL_TYPE_ERROR:
text.append(ErrorEval.getText(cell.getErrorCellValue()));
break;
default:
throw new IllegalStateException("Unexpected cell cached formula result type: " + cell.getCachedFormulaResultType());
}
}

View File

@ -116,6 +116,8 @@ public final class CommentShape extends TextboxShape {
case EscherProperties.LINESTYLE__COLOR:
iterator.remove();
break;
default:
break;
}
}

View File

@ -334,7 +334,11 @@ public final class InternalWorkbook {
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "found NameComment at " + k);
retval.commentRecords.put(ncr.getNameText(), ncr);
default :
break;
default:
if (log.check( POILogger.DEBUG ))
log.log(DEBUG, "ignoring record (sid=" + rec.getSid() + ") at " + k);
break;
}
records.add(rec);
}
@ -352,6 +356,8 @@ public final class InternalWorkbook {
case HyperlinkRecord.sid:
retval.hyperlinks.add((HyperlinkRecord)rec);
break;
default:
break;
}
}
@ -1682,6 +1688,9 @@ public final class InternalWorkbook {
retval.setAdtlPaletteOptions(( short ) 0);
retval.setFillPaletteOptions(( short ) 0x20c0);
break;
default:
throw new IllegalStateException("Unrecognized format id: " + id);
}
return retval;
}
@ -1754,6 +1763,9 @@ public final class InternalWorkbook {
retval.setBuiltinStyle(5);
retval.setOutlineStyleLevel(( byte ) 0xffffffff);
break;
default:
throw new IllegalStateException("Unrecognized style id: " + id);
}
return retval;
}

View File

@ -186,6 +186,9 @@ public class HSSFCell implements Cell {
case CELL_TYPE_FORMULA :
_stringValue=new HSSFRichTextString(((FormulaRecordAggregate) cval).getStringValue());
break;
default :
break;
}
}
@ -422,6 +425,8 @@ public class HSSFCell implements Cell {
errRec.setRow(row);
_record = errRec;
break;
default :
throw new IllegalStateException("Invalid cell type: " + cellType);
}
if (cellType != _cellType &&
_cellType!=-1 ) // Special Value to indicate an uninitialized Cell
@ -1088,6 +1093,8 @@ public class HSSFCell implements Cell {
case HSSFHyperlink.LINK_DOCUMENT:
link.setLabel("place");
break;
default:
break;
}
List<RecordBase> records = _sheet.getSheet().getRecords();

View File

@ -409,6 +409,7 @@ public class ExcelToFoConverter extends AbstractExcelConverter
triplet.bold = true;
break;
case HSSFFont.BOLDWEIGHT_NORMAL:
default:
triplet.bold = false;
break;
}