poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From one...@apache.org
Subject svn commit: r1738765 - in /poi/trunk/src: java/org/apache/poi/hssf/dev/ java/org/apache/poi/hssf/eventusermodel/ java/org/apache/poi/hssf/extractor/ java/org/apache/poi/hssf/model/ java/org/apache/poi/hssf/usermodel/ scratchpad/src/org/apache/poi/hssf/...
Date Tue, 12 Apr 2016 11:12:57 GMT
Author: onealj
Date: Tue Apr 12 11:12:57 2016
New Revision: 1738765

URL: http://svn.apache.org/viewvc?rev=1738765&view=rev
Log:
fix several findbugs SF_SWITCH_NO_DEFAULT warnings

Modified:
    poi/trunk/src/java/org/apache/poi/hssf/dev/FormulaViewer.java
    poi/trunk/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java
    poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
    poi/trunk/src/java/org/apache/poi/hssf/model/CommentShape.java
    poi/trunk/src/java/org/apache/poi/hssf/model/InternalWorkbook.java
    poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
    poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java

Modified: poi/trunk/src/java/org/apache/poi/hssf/dev/FormulaViewer.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/dev/FormulaViewer.java?rev=1738765&r1=1738764&r2=1738765&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/dev/FormulaViewer.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/dev/FormulaViewer.java Tue Apr 12 11:12:57 2016
@@ -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)
     {

Modified: poi/trunk/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java?rev=1738765&r1=1738764&r2=1738765&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java
(original)
+++ poi/trunk/src/java/org/apache/poi/hssf/eventusermodel/MissingRecordAwareHSSFListener.java
Tue Apr 12 11:12:57 2016
@@ -134,6 +134,8 @@ public final class MissingRecordAwareHSS
 					thisRow = nrec.getRow();
 					thisColumn = nrec.getColumn();
 					break;
+				default:
+					break;
 			}
 		}
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java?rev=1738765&r1=1738764&r2=1738765&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/extractor/ExcelExtractor.java Tue Apr 12 11:12:57
2016
@@ -367,6 +367,8 @@ public class ExcelExtractor extends POIO
 										case HSSFCell.CELL_TYPE_ERROR:
 											text.append(ErrorEval.getText(cell.getErrorCellValue()));
 											break;
+										default:
+											throw new IllegalStateException("Unexpected cell cached formula result type: "
+ cell.getCachedFormulaResultType());
 
 									}
 								}

Modified: poi/trunk/src/java/org/apache/poi/hssf/model/CommentShape.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/model/CommentShape.java?rev=1738765&r1=1738764&r2=1738765&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/model/CommentShape.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/model/CommentShape.java Tue Apr 12 11:12:57 2016
@@ -116,6 +116,8 @@ public final class CommentShape extends
                 case EscherProperties.LINESTYLE__COLOR:
                     iterator.remove();
                     break;
+                default:
+                    break;
             }
         }
 

Modified: poi/trunk/src/java/org/apache/poi/hssf/model/InternalWorkbook.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/model/InternalWorkbook.java?rev=1738765&r1=1738764&r2=1738765&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/model/InternalWorkbook.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/model/InternalWorkbook.java Tue Apr 12 11:12:57
2016
@@ -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;
     }

Modified: poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java?rev=1738765&r1=1738764&r2=1738765&view=diff
==============================================================================
--- poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java (original)
+++ poi/trunk/src/java/org/apache/poi/hssf/usermodel/HSSFCell.java Tue Apr 12 11:12:57 2016
@@ -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();

Modified: poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java?rev=1738765&r1=1738764&r2=1738765&view=diff
==============================================================================
--- poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java (original)
+++ poi/trunk/src/scratchpad/src/org/apache/poi/hssf/converter/ExcelToFoConverter.java Tue
Apr 12 11:12:57 2016
@@ -409,6 +409,7 @@ public class ExcelToFoConverter extends
             triplet.bold = true;
             break;
         case HSSFFont.BOLDWEIGHT_NORMAL:
+        default:
             triplet.bold = false;
             break;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message