]> source.dussan.org Git - poi.git/commitdiff
revert use of ExceptionUtil on caught exceptions (not useful)
authorPJ Fanning <fanningpj@apache.org>
Tue, 14 Feb 2023 15:03:26 +0000 (15:03 +0000)
committerPJ Fanning <fanningpj@apache.org>
Tue, 14 Feb 2023 15:03:26 +0000 (15:03 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1907654 13f79535-47bb-0310-9956-ffa450edef68

48 files changed:
poi-examples/src/main/java/org/apache/poi/examples/hpsf/ReadCustomPropertySets.java
poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTask.java
poi-scratchpad/src/main/java/org/apache/poi/hdgf/chunks/Chunk.java
poi-scratchpad/src/main/java/org/apache/poi/hdgf/streams/ChunkStream.java
poi-scratchpad/src/main/java/org/apache/poi/hemf/draw/HemfGraphics.java
poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusImage.java
poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java
poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MasterTextPropAtom.java
poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxMasterStyleAtom.java
poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java
poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java
poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java
poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java
poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java
poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java
poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmBuffer.java
poi/src/main/java/org/apache/poi/POIDocument.java
poi/src/main/java/org/apache/poi/hpsf/Property.java
poi/src/main/java/org/apache/poi/hpsf/Section.java
poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java
poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java
poi/src/main/java/org/apache/poi/poifs/crypt/CryptoFunctions.java
poi/src/main/java/org/apache/poi/poifs/crypt/EncryptionInfo.java
poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java
poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java
poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDocumentOutputStream.java
poi/src/main/java/org/apache/poi/sl/draw/DrawPictureShape.java
poi/src/main/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java
poi/src/main/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java
poi/src/main/java/org/apache/poi/ss/formula/OperationEvaluationContext.java
poi/src/main/java/org/apache/poi/ss/formula/SheetNameFormatter.java
poi/src/main/java/org/apache/poi/ss/formula/WorkbookEvaluator.java
poi/src/main/java/org/apache/poi/ss/formula/atp/Switch.java
poi/src/main/java/org/apache/poi/ss/formula/atp/XLookupFunction.java
poi/src/main/java/org/apache/poi/ss/formula/atp/XMatchFunction.java
poi/src/main/java/org/apache/poi/ss/formula/functions/Areas.java
poi/src/main/java/org/apache/poi/ss/formula/functions/Correl.java
poi/src/main/java/org/apache/poi/ss/formula/functions/Covar.java
poi/src/main/java/org/apache/poi/ss/formula/functions/DStarRunner.java
poi/src/main/java/org/apache/poi/ss/formula/functions/Days.java
poi/src/main/java/org/apache/poi/ss/formula/functions/Forecast.java
poi/src/main/java/org/apache/poi/ss/formula/functions/Indirect.java
poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java
poi/src/main/java/org/apache/poi/ss/formula/functions/TimeValue.java
poi/src/main/java/org/apache/poi/ss/formula/functions/WeekNum.java
poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java
poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java
poi/src/main/java/org/apache/poi/util/Configurator.java

index ca8cba1ce91fba04e293be883f6d7204a5dfb366..187f434b9443c52dec621140c27064ab0129bfe4 100644 (file)
@@ -29,6 +29,7 @@ import org.apache.poi.hpsf.PropertySetFactory;
 import org.apache.poi.hpsf.Section;
 import org.apache.poi.poifs.eventfilesystem.POIFSReader;
 import org.apache.poi.poifs.eventfilesystem.POIFSReaderEvent;
+import org.apache.poi.util.ExceptionUtil;
 
 /**
  * <p>Sample application showing how to read a document's custom property set.
@@ -66,6 +67,9 @@ public final class ReadCustomPropertySets {
             out("No property set stream: \"" + streamName + "\"");
             return;
         } catch (Exception ex) {
+            if (ExceptionUtil.isFatal(ex)) {
+                ExceptionUtil.rethrow(ex);
+            }
             throw new HPSFRuntimeException("Property set stream \"" + streamName + "\": " + ex);
         }
 
index a4bfba9f6672b946df629e3d6ce70153a268252d..4fc0b099148ef4442d40b595c1e45f595993b4a8 100644 (file)
@@ -24,7 +24,6 @@ import java.util.Locale;
 
 import org.apache.poi.ss.excelant.util.ExcelAntWorkbookUtil;
 import org.apache.poi.ss.excelant.util.ExcelAntWorkbookUtilFactory;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Project;
 import org.apache.tools.ant.Task;
@@ -105,9 +104,6 @@ public class ExcelAntTask extends Task {
                 try {
                     workbookUtil.addFunction(eaUdf.getFunctionAlias(), eaUdf.getClassName());
                 } catch (Exception e) {
-                    if (ExceptionUtil.isFatal(e)) {
-                        ExceptionUtil.rethrow(e);
-                    }
                     throw new BuildException(e.getMessage(), e);
                 }
             }
@@ -148,9 +144,6 @@ public class ExcelAntTask extends Task {
             Class.forName("org.apache.poi.hssf.usermodel.HSSFWorkbook");
             Class.forName("org.apache.poi.ss.usermodel.WorkbookFactory");
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new BuildException(
                     "The <classpath> for <excelant> must include poi.jar and poi-ooxml.jar " +
                     "if not in Ant's own classpath. Processing .xlsx spreadsheets requires " +
index b2a6b3925c13b24a9d1e862afa7a6ab892a18548..b85592f112161b9919343e400ba7f0ce540f21e7 100644 (file)
@@ -22,7 +22,6 @@ import java.util.ArrayList;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.poi.hdgf.chunks.ChunkFactory.CommandDefinition;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.LittleEndian;
 
 import static org.apache.logging.log4j.util.Unbox.box;
@@ -246,9 +245,6 @@ public final class Chunk {
                 }
             }
             catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 LOG.atError().withThrowable(e).log("Unexpected error processing command, ignoring and continuing. Command: {}", command);
             }
 
index 9d807d7ed0f87fbae3d2ad96c58e6abb9b89f698..b1c10ae3e7b4a196520d6d5fe6932649ab6e279a 100644 (file)
@@ -25,7 +25,6 @@ import org.apache.poi.hdgf.chunks.Chunk;
 import org.apache.poi.hdgf.chunks.ChunkFactory;
 import org.apache.poi.hdgf.chunks.ChunkHeader;
 import org.apache.poi.hdgf.pointers.Pointer;
-import org.apache.poi.util.ExceptionUtil;
 
 import static org.apache.logging.log4j.util.Unbox.box;
 
@@ -73,10 +72,9 @@ public final class ChunkStream extends Stream {
                     pos = contents.length;
                 }
             }
-        } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
+        }
+        catch (Exception e)
+        {
             LOG.atError().withThrowable(e).log("Failed to create chunk at {}, ignoring rest of data.", box(pos));
         }
 
index ac3e5772db1c96b7d5816189969fcd847cfe0d9e..113f8ede2561f0ef80314c682ef07b462b526703 100644 (file)
@@ -51,7 +51,6 @@ import org.apache.poi.hwmf.record.HwmfColorRef;
 import org.apache.poi.hwmf.record.HwmfMisc;
 import org.apache.poi.hwmf.record.HwmfObjectTableEntry;
 import org.apache.poi.hwmf.record.HwmfPenStyle;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.Internal;
 
 public class HemfGraphics extends HwmfGraphics {
@@ -146,9 +145,6 @@ public class HemfGraphics extends HwmfGraphics {
         try {
             pathConsumer.accept(path);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             // workaround if a path has been started and no MoveTo command
             // has been specified before the first lineTo/splineTo
             final Point2D loc = prop.getLocation();
index c50a3fec34a69d8eebe8e9fa13017d5947fb8afa..6afb53cdd36a5c0222a701d5d1c9b39dad359b4b 100644 (file)
@@ -45,7 +45,6 @@ import org.apache.poi.sl.draw.ImageRenderer;
 import org.apache.poi.sl.usermodel.PictureData.PictureType;
 import org.apache.poi.util.BitField;
 import org.apache.poi.util.BitFieldFactory;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.GenericRecordJsonWriter;
 import org.apache.poi.util.GenericRecordUtil;
 import org.apache.poi.util.IOUtils;
@@ -443,10 +442,7 @@ public class HemfPlusImage {
                     default:
                         break;
                 }
-            } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
+            } catch (Exception ignored) {
             }
             return new Rectangle2D.Double(1,1,1,1);
         }
index 172468a03f1e3b41a5924906f96c4743ba10daa9..3e5042af46702024ac40ed1b4919aa368cc4f5f2 100644 (file)
@@ -35,7 +35,6 @@ import org.apache.poi.ddf.EscherContainerRecord;
 import org.apache.poi.hslf.exceptions.HSLFException;
 import org.apache.poi.hslf.usermodel.HSLFSlideShow;
 import org.apache.poi.sl.image.ImageHeaderPICT;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.Removal;
@@ -105,9 +104,6 @@ public final class PICT extends Metafile {
                         Arrays.fill(chunk, (byte) 0);
                     }
                 } catch (Exception e) {
-                    if (ExceptionUtil.isFatal(e)) {
-                        ExceptionUtil.rethrow(e);
-                    }
                     int lastLen = chunk.length - 1;
                     while (lastLen >= 0 && chunk[lastLen] == 0) {
                         lastLen--;
index ff5305cce6e4447564312f657bc415fc971c2334..a6065e3e24afe61c3ae9aac5dd190583abc9e005 100644 (file)
@@ -27,7 +27,6 @@ import java.util.Map;
 import java.util.function.Supplier;
 
 import org.apache.poi.hslf.model.textproperties.IndentProp;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.GenericRecordUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.LittleEndian;
@@ -98,10 +97,7 @@ public final class MasterTextPropAtom extends RecordAtom {
 
         try {
             read();
-        } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
+        } catch (Exception e){
             LOG.atError().withThrowable(e).log("Failed to parse MasterTextPropAtom");
         }
     }
index af307cc1024b41bc5d9d6246171e9982e1fa1e1e..ca94a6acfdba50d149b0e5c77ba3344667feccc9 100644 (file)
@@ -32,7 +32,6 @@ import org.apache.poi.hslf.exceptions.HSLFException;
 import org.apache.poi.hslf.model.textproperties.TextPropCollection;
 import org.apache.poi.hslf.model.textproperties.TextPropCollection.TextPropType;
 import org.apache.poi.sl.usermodel.TextShape.TextPlaceholder;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.GenericRecordUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.LittleEndian;
@@ -77,10 +76,7 @@ public final class TxMasterStyleAtom extends RecordAtom {
         //read available styles
         try {
             init();
-        } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
+        } catch (Exception e){
             LOG.atWarn().withThrowable(e).log("Exception when reading available styles");
         }
     }
index 04ea654546cf36353fae12f8349c04a0d15cd7d8..8c7effc7f3d0f3c7b8c52a2d3e02c041e9be1626 100644 (file)
@@ -42,7 +42,6 @@ import org.apache.poi.poifs.crypt.Decryptor;
 import org.apache.poi.poifs.crypt.EncryptionInfo;
 import org.apache.poi.poifs.crypt.Encryptor;
 import org.apache.poi.util.BitField;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndian;
@@ -171,9 +170,6 @@ public class HSLFSlideShowEncrypted implements Closeable {
             }
             cyos.initCipherForBlock(persistId, false);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedPowerPointFileException(e);
         }
         return cyos;
@@ -203,9 +199,6 @@ public class HSLFSlideShowEncrypted implements Closeable {
             readFully(ccis, docstream, offset+8, rlen);
 
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedPowerPointFileException(e);
         }
     }
@@ -290,9 +283,6 @@ public class HSLFSlideShowEncrypted implements Closeable {
             int blipLen = endOffset - offset;
             decryptPicBytes(pictstream, offset, blipLen);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new CorruptPowerPointFileException(e);
         }
     }
@@ -372,9 +362,6 @@ public class HSLFSlideShowEncrypted implements Closeable {
             ccos.write(pictstream, offset, blipLen);
             ccos.flush();
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedPowerPointFileException(e);
         } finally {
             IOUtils.closeQuietly(ccos);
index bbe782cd3633fc1cce08f22583396395dd90c3c5..da220c941e18393d60ce2e41732d29eb468fcd04 100644 (file)
@@ -47,7 +47,6 @@ import org.apache.poi.hwmf.record.HwmfRecordType;
 import org.apache.poi.hwmf.record.HwmfWindowing.WmfSetWindowExt;
 import org.apache.poi.hwmf.record.HwmfWindowing.WmfSetWindowOrg;
 import org.apache.poi.util.Dimension2DDouble;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.LittleEndianInputStream;
 import org.apache.poi.util.LocaleUtil;
@@ -107,9 +106,6 @@ public class HwmfPicture implements Iterable<HwmfRecord>, GenericRecord {
                     recordSize = (int)recordSizeLong;
                     recordFunction = leis.readShort();
                 } catch (Exception e) {
-                    if (ExceptionUtil.isFatal(e)) {
-                        ExceptionUtil.rethrow(e);
-                    }
                     LOG.atError().log("unexpected eof - wmf file was truncated");
                     break;
                 }
index 8dbd2e2fe962f60fc6746a102fecaf31562687ae..5a4296f8e1cf9a8fc129dc72ed20488506248c56 100644 (file)
@@ -71,7 +71,6 @@ import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.Entry;
 import org.apache.poi.poifs.filesystem.EntryUtils;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndianByteArrayOutputStream;
@@ -299,9 +298,7 @@ public final class HWPFDocument extends HWPFDocumentCore {
         try {
             preserveBinTables = Boolean.parseBoolean(System.getProperty(PROPERTY_PRESERVE_BIN_TABLES));
         } catch (Exception exc) {
-            if (ExceptionUtil.isFatal(exc)) {
-                ExceptionUtil.rethrow(exc);
-            }
+            // ignore;
         }
 
         if (!preserveBinTables) {
@@ -317,9 +314,7 @@ public final class HWPFDocument extends HWPFDocumentCore {
         try {
             preserveTextTable = Boolean.parseBoolean(System.getProperty(PROPERTY_PRESERVE_TEXT_TABLE));
         } catch (Exception exc) {
-            if (ExceptionUtil.isFatal(exc)) {
-                ExceptionUtil.rethrow(exc);
-            }
+            // ignore;
         }
         if (!preserveTextTable) {
             _cft = new ComplexFileTable();
index 0a25404bcf5a5c49130afeffbd6f13dd1025d5a7..d6f410d286531874915c88f4cd5b7d48d6487c78 100644 (file)
@@ -51,7 +51,6 @@ import org.apache.poi.hwpf.usermodel.TableCell;
 import org.apache.poi.hwpf.usermodel.TableRow;
 import org.apache.poi.poifs.filesystem.Entry;
 import org.apache.poi.util.Beta;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LocaleUtil;
 import org.apache.poi.util.StringUtil;
@@ -628,9 +627,6 @@ public abstract class AbstractWordConverter {
                 processDocumentInformation(summaryInformation);
             }
         } catch (Exception exc) {
-            if (ExceptionUtil.isFatal(exc)) {
-                ExceptionUtil.rethrow(exc);
-            }
             LOG.atWarn().withThrowable(exc).log("Unable to process document summary information");
         }
 
@@ -896,9 +892,6 @@ public abstract class AbstractWordConverter {
         try {
             return processOle2(doc, block, entry);
         } catch (Exception exc) {
-            if (ExceptionUtil.isFatal(exc)) {
-                ExceptionUtil.rethrow(exc);
-            }
             LOG.atWarn().withThrowable(exc).log("Unable to convert internal OLE2 object '{}'", box(characterRun.getPicOffset()));
             return false;
         }
@@ -954,9 +947,6 @@ public abstract class AbstractWordConverter {
                     processParagraph(wordDocument, flow, currentTableLevel, paragraph, label);
                     processed = true;
                 } catch (Exception exc) {
-                    if (ExceptionUtil.isFatal(exc)) {
-                        ExceptionUtil.rethrow(exc);
-                    }
                     LOG.atWarn().withThrowable(exc).log("Can't process paragraph as list entry, will be processed without list information");
                 }
             }
index 19e538e511fa9e78736bddb5bd14f0782bee7f33..633485576372fe275a0d400f8bf4aede39bb8926 100644 (file)
@@ -26,7 +26,6 @@ import org.apache.poi.hwpf.converter.WordToTextConverter;
 import org.apache.poi.hwpf.usermodel.Range;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-import org.apache.poi.util.ExceptionUtil;
 
 /**
  * Class to extract the text from old (Word 6 / Word 95) Word Documents.
@@ -91,9 +90,6 @@ public final class Word6Extractor implements POIOLE2TextExtractor {
 
             ret = WordExtractor.getParagraphText(r);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             // Something's up with turning the text pieces into paragraphs
             // Fall back to ripping out the text pieces
             ret = new String[doc.getTextTable().getTextPieces().size()];
index a52def67b3cc31c0aa911c5e293063cfa563ddc8..45e726e5649fa73c85b39634447e4d9e6211ce47 100644 (file)
@@ -35,7 +35,6 @@ import org.apache.poi.hwpf.HWPFDocument;
 import org.apache.poi.hwpf.usermodel.CharacterRun;
 import org.apache.poi.hwpf.usermodel.Picture;
 import org.apache.poi.hwpf.usermodel.Range;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndian;
 
@@ -180,9 +179,6 @@ public final class PicturesTable {
                             pictures.add(new Picture(blip));
                         }
                     } catch (Exception exc) {
-                        if (ExceptionUtil.isFatal(exc)) {
-                            ExceptionUtil.rethrow(exc);
-                        }
                         LOG.atWarn().withThrowable(exc).log("Unable to load picture from BLIP record at offset #{}", box(bse.getOffset()));
                     }
                 }
index a77df8792ad277a9d27cb806278f5d42926b2443..38a0efaa029a74b84316ab733b2f86e0bd7b6aed 100644 (file)
@@ -20,7 +20,6 @@ package org.apache.poi.hwpf.sprm;
 import java.util.Arrays;
 
 import org.apache.poi.common.Duplicatable;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndian;
@@ -209,9 +208,6 @@ public final class SprmBuffer implements Duplicatable {
             try {
                 stringBuilder.append(iterator.next());
             } catch (Exception exc) {
-                if (ExceptionUtil.isFatal(exc)) {
-                    ExceptionUtil.rethrow(exc);
-                }
                 stringBuilder.append("error");
             }
             stringBuilder.append("; ");
index de49c4fbdc2b43100132bc834ab0189730ef2a87..608c14be6dd21943988b4b99ef825f9c77777e1c 100644 (file)
@@ -45,7 +45,6 @@ import org.apache.poi.poifs.crypt.cryptoapi.CryptoAPIEncryptor;
 import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.DocumentInputStream;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
 
@@ -246,9 +245,6 @@ public abstract class POIDocument implements Closeable {
         } catch (IOException e) {
             throw e;
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new IOException("Error "+step+" property set with name " + setName, e);
         } finally {
             IOUtils.closeQuietly(encPoifs);
index 242393ef316496fd0af53f1d77162e73632582b9..5587042f0ca462b16642065f4ae2a914b343e0e8 100644 (file)
@@ -35,7 +35,6 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.poi.hpsf.wellknown.PropertyIDMap;
 import org.apache.poi.util.CodePageUtil;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.HexDump;
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.LittleEndianByteArrayInputStream;
@@ -404,9 +403,6 @@ public class Property {
             try {
                 write(bos, codepage);
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 LOG.atWarn().withThrowable(e).log("can't serialize string");
             }
 
@@ -479,9 +475,6 @@ public class Property {
                     return LocaleUtil.getLocaleFromLCID(((Number)value).intValue());
             }
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             LOG.atWarn().log("Can't decode id {}", box(getID()));
         }
         return null;
index 84ca0371d056523cad75efb9f45a8cfa698ba138..5ebaf43ad336a3543c9f36859cb12da02bc0dbd6 100644 (file)
@@ -35,7 +35,6 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.poi.hpsf.wellknown.PropertyIDMap;
 import org.apache.poi.util.CodePageUtil;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.LittleEndianByteArrayInputStream;
@@ -548,9 +547,6 @@ public class Section {
         } catch (HPSFRuntimeException ex) {
             throw ex;
         } catch (Exception ex) {
-            if (ExceptionUtil.isFatal(ex)) {
-                ExceptionUtil.rethrow(ex);
-            }
             throw new HPSFRuntimeException(ex);
         }
     }
index 579b9585d1a48039f6d61b4ae603f024d3e8fbae..63ed8e1fad23435d343bf947a889c0a5830faf5c 100644 (file)
@@ -25,7 +25,6 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.poifs.crypt.ChunkedCipherInputStream;
 import org.apache.poi.poifs.crypt.Decryptor;
 import org.apache.poi.poifs.crypt.EncryptionInfo;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndian;
@@ -62,9 +61,6 @@ public final class Biff8DecryptingStream implements BiffHeaderInput, LittleEndia
                 ccis.readFully(initialBuf);
             }
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new RecordFormatException(e);
         }
     }
index fd8cca72ae5211a7ab798514fa545b4772a26e54..12a4ff008aed17ed114829e5a4a3c435fc4b3d4b 100644 (file)
@@ -105,7 +105,6 @@ import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.ss.util.WorkbookUtil;
 import org.apache.poi.util.Configurator;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.HexDump;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
@@ -1585,9 +1584,6 @@ public final class HSSFWorkbook extends POIDocument implements Workbook {
             }
             os.close();
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedDocumentException(e);
         }
     }
index d3e1007f3079d839d5ea6e7e539004dae3ca2e3c..28babc0c0f01a9c5a3bb3749fdae4eaef0475ff0 100644 (file)
@@ -34,7 +34,6 @@ import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.RC2ParameterSpec;
 
 import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LittleEndian;
@@ -347,9 +346,6 @@ public final class CryptoFunctions {
             Class<Provider> clazz = (Class<Provider>)cl.loadClass(bcProviderName);
             Security.addProvider(clazz.getDeclaredConstructor().newInstance());
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedDocumentException("Only the BouncyCastle provider supports your encryption settings - please add it to the classpath.", e);
         }
     }
index 701552980bc1f1be5862ac9ee5dfb42b03f731ca..30fc9539e3f2d4ef14cc01161f87226ce99afa83 100644 (file)
@@ -35,7 +35,6 @@ import org.apache.poi.poifs.filesystem.DirectoryNode;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.BitField;
 import org.apache.poi.util.BitFieldFactory;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.LittleEndianInput;
 
 /**
@@ -142,9 +141,6 @@ public class EncryptionInfo implements GenericRecord {
         try {
             eib = getBuilder(encryptionMode);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new IOException(e);
         }
 
@@ -191,9 +187,6 @@ public class EncryptionInfo implements GenericRecord {
         try {
             eib = getBuilder(encryptionMode);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedDocumentException(e);
         }
 
index 499f5346956edb1d35893a3d966a4853503d62b8..78c289f5eabbed1019a3d68ba89251952ecca20c 100644 (file)
@@ -24,7 +24,6 @@ import org.apache.poi.poifs.crypt.ChainingMode;
 import org.apache.poi.poifs.crypt.CipherAlgorithm;
 import org.apache.poi.poifs.crypt.EncryptionHeader;
 import org.apache.poi.poifs.crypt.HashAlgorithm;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.GenericRecordUtil;
 
 public class AgileEncryptionHeader extends EncryptionHeader {
@@ -49,9 +48,6 @@ public class AgileEncryptionHeader extends EncryptionHeader {
                 throw new NullPointerException("keyData not set");
             }
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedDocumentException("Unable to parse keyData");
         }
 
index acbff64cc0b781c80c25b6c5da1a0d016ab438b3..4f229e9a180d7ec04520607c8d34960279b3699f 100644 (file)
@@ -42,7 +42,6 @@ import org.apache.poi.poifs.filesystem.DocumentInputStream;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.BitField;
 import org.apache.poi.util.BitFieldFactory;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.LittleEndian;
 import org.apache.poi.util.LittleEndianInputStream;
@@ -213,8 +212,6 @@ public class CryptoAPIDecryptor extends Decryptor {
                 throw (GeneralSecurityException)e;
             } else if (e instanceof IOException) {
                 throw (IOException)e;
-            } else if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
             } else {
                 throw new IOException("summary entries can't be read", e);
             }
index d0bbf44887810baa10124ded8e325345b9ee098b..34c4a74675756d225d796f9bf26ba7c6c6aad01b 100644 (file)
@@ -24,7 +24,6 @@ import javax.crypto.Cipher;
 import org.apache.commons.io.input.BoundedInputStream;
 import org.apache.commons.io.output.ByteArrayOutputStream;
 import org.apache.poi.EncryptedDocumentException;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.Internal;
 
 /**
@@ -60,9 +59,6 @@ import org.apache.poi.util.Internal;
             cipher.update(oneByte, 0, 1, oneByte, 0);
             super.write(oneByte);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedDocumentException(e);
         }
     }
@@ -73,9 +69,6 @@ import org.apache.poi.util.Internal;
             cipher.update(b, off, len, b, off);
             super.write(b, off, len);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new EncryptedDocumentException(e);
         }
     }
index 96a0b1f31451a6eb47bf294be90d23e15a039410..764f1f576a99192e1317f23ae3fbe516da4a65e8 100644 (file)
@@ -35,7 +35,6 @@ import org.apache.poi.poifs.filesystem.FileMagic;
 import org.apache.poi.sl.usermodel.PictureData;
 import org.apache.poi.sl.usermodel.PictureShape;
 import org.apache.poi.sl.usermodel.RectAlign;
-import org.apache.poi.util.ExceptionUtil;
 
 
 public class DrawPictureShape extends DrawSimpleShape {
@@ -104,10 +103,7 @@ public class DrawPictureShape extends DrawSimpleShape {
                 }
             } catch (NoSuchElementException ignored) {
                 break;
-            } catch (Exception | ServiceConfigurationError e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
+            } catch (Exception | ServiceConfigurationError ignored) {
             }
         }
 
index d6078e79bc8217501226fea21199bb5d3f440ca4..bdaccb7d6c924b291cedbf1a3a23af88de644d88 100644 (file)
@@ -47,7 +47,6 @@ import org.apache.poi.ss.usermodel.ShapeContainer;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.apache.poi.util.Beta;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.IOUtils;
 import org.apache.poi.util.LocaleUtil;
 
@@ -133,9 +132,6 @@ public class EmbeddedExtractor implements Iterable<EmbeddedExtractor> {
                         data = new EmbeddedData(od.getFileName(), od.getObjectData(), od.getContentType());
                     }
                 } catch (Exception e) {
-                    if (ExceptionUtil.isFatal(e)) {
-                        ExceptionUtil.rethrow(e);
-                    }
                     LOG.atWarn().withThrowable(e).log("Entry not found / readable - ignoring OLE embedding");
                 }
             } else if (shape instanceof Picture) {
index e2e0d65d1a5a7e57b734bf8d40071fb6dd6022f0..54199cbfca0a56cec6e9e0ca44b3ff70c956850e 100644 (file)
@@ -51,7 +51,6 @@ import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.ss.util.CellReference;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.LocaleUtil;
 import org.apache.poi.util.StringUtil;
 
@@ -510,9 +509,6 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon
                 // see TextFunction.TRIM for implementation
                 return StringUtil.isBlank(v);
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 // not a valid string value, and not a blank cell (that's checked earlier)
                 return false;
             }
@@ -522,9 +518,6 @@ public class EvaluationConditionalFormatRule implements Comparable<EvaluationCon
                 // see TextFunction.TRIM for implementation
                 return StringUtil.isNotBlank(v);
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 // not a valid string value, but not blank
                 return true;
             }
index 82c8727752bc55f5034dadda88d706801c714009..37db5d6e0454ffb8cb7ea89e40a97d0fe42c5ab3 100644 (file)
@@ -42,7 +42,6 @@ import org.apache.poi.ss.formula.ptg.Ref3DPtg;
 import org.apache.poi.ss.formula.ptg.Ref3DPxg;
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.ss.util.CellReference.NameType;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.LocaleUtil;
 
 /**
@@ -258,9 +257,6 @@ public final class OperationEvaluationContext {
                             }
                             return new LazyAreaEval(0, absoluteC, ssVersion.getLastRowIndex(), absoluteC, sre);
                         } catch (Exception e) {
-                            if (ExceptionUtil.isFatal(e)) {
-                                ExceptionUtil.rethrow(e);
-                            }
                             return ErrorEval.REF_INVALID;
                         }
                     }
@@ -283,9 +279,6 @@ public final class OperationEvaluationContext {
                             }
                             return new LazyAreaEval(absoluteR, 0, absoluteR, ssVersion.getLastColumnIndex(), sre);
                         } catch (Exception e) {
-                            if (ExceptionUtil.isFatal(e)) {
-                                ExceptionUtil.rethrow(e);
-                            }
                             return ErrorEval.REF_INVALID;
                         }
                     }
index caf1e493949b035175ee2ea652c1cf1ec889a538..26eca119c149bff6431f7746f4dc3bfe56309a48 100644 (file)
@@ -23,7 +23,6 @@ import java.util.regex.Pattern;
 
 import org.apache.poi.ss.util.CellReference;
 import org.apache.poi.ss.SpreadsheetVersion;
-import org.apache.poi.util.ExceptionUtil;
 
 /**
  * Formats sheet names for use in formula expressions.
@@ -69,9 +68,6 @@ public final class SheetNameFormatter {
                 appendAndEscape(out, rawSheetName);
             }
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new IllegalStateException(e);
         }
     }
@@ -100,9 +96,6 @@ public final class SheetNameFormatter {
                 appendOrREF(out, rawSheetName);
             }
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new IllegalStateException(e);
         }
     }
@@ -132,9 +125,6 @@ public final class SheetNameFormatter {
                 sb.append(ch);
             }
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             throw new IllegalStateException(e);
         }
     }
index 9923bd0b47e7cdb27731021968ff3acb3ad0a9fc..2d2202342674f1b0d6ac9c1620ac368fc7c7be3a 100644 (file)
@@ -40,7 +40,6 @@ import org.apache.poi.ss.formula.udf.UDFFinder;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.util.CellRangeAddressBase;
 import org.apache.poi.ss.util.CellReference;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.Internal;
 
 import static org.apache.logging.log4j.util.Unbox.box;
@@ -333,9 +332,6 @@ public final class WorkbookEvaluator {
             String msg = "Error evaluating cell " + cr.formatAsString();
             return new NotImplementedException(msg, inner);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             // avoid bombing out during exception handling
             LOG.atError().withThrowable(e).log("Can't add exception info");
             return inner; // preserve original exception
index 6dac9212fd68312774e96e7ebcdc778b3a3d863b..b70eb4f7488fd9045c2c9a55375aedeeab5deed5 100644 (file)
@@ -24,7 +24,6 @@ import org.apache.poi.ss.formula.eval.EvaluationException;
 import org.apache.poi.ss.formula.eval.OperandResolver;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.formula.functions.FreeRefFunction;
-import org.apache.poi.util.ExceptionUtil;
 
 import static org.apache.poi.ss.formula.eval.RelationalOperationEval.EqualEval;
 
@@ -54,9 +53,6 @@ public final class Switch implements FreeRefFunction {
         try {
             expression = OperandResolver.getSingleValue(args[0], ec.getRowIndex(), ec.getColumnIndex());
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             return ErrorEval.NA;
         }
 
index fc474ad90ef59c341f0cd49b739cecd1dc65b884..ccef07a1d7704903a2a386ff8cb2eecf8453a1c5 100644 (file)
@@ -23,7 +23,6 @@ import org.apache.poi.ss.formula.eval.*;
 import org.apache.poi.ss.formula.functions.ArrayFunction;
 import org.apache.poi.ss.formula.functions.FreeRefFunction;
 import org.apache.poi.ss.formula.functions.LookupUtils;
-import org.apache.poi.util.ExceptionUtil;
 
 /**
  * Implementation of Excel function XLOOKUP()
@@ -82,9 +81,6 @@ final class XLookupFunction implements FreeRefFunction, ArrayFunction {
             } catch (EvaluationException e) {
                 return e.getErrorEval();
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 return ErrorEval.VALUE_INVALID;
             }
         }
@@ -97,9 +93,6 @@ final class XLookupFunction implements FreeRefFunction, ArrayFunction {
             } catch (EvaluationException e) {
                 return e.getErrorEval();
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 return ErrorEval.VALUE_INVALID;
             }
         }
index 6689facc5281ada1963b879fa96694c8a53371a1..f29a393f5f33896bec590d93df70e8a607a1793b 100644 (file)
@@ -22,7 +22,6 @@ import org.apache.poi.ss.formula.TwoDEval;
 import org.apache.poi.ss.formula.eval.*;
 import org.apache.poi.ss.formula.functions.FreeRefFunction;
 import org.apache.poi.ss.formula.functions.LookupUtils;
-import org.apache.poi.util.ExceptionUtil;
 
 /**
  * Implementation of Excel function XMATCH()
@@ -65,9 +64,6 @@ final class XMatchFunction implements FreeRefFunction {
             } catch (EvaluationException e) {
                 return e.getErrorEval();
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 return ErrorEval.VALUE_INVALID;
             }
         }
@@ -80,9 +76,6 @@ final class XMatchFunction implements FreeRefFunction {
             } catch (EvaluationException e) {
                 return e.getErrorEval();
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 return ErrorEval.VALUE_INVALID;
             }
         }
index 5d8ed35779aa77b225744485cdf7536f4bf5a71f..1a7ed187d4cc9c1813fe12fb39a304a070fd497c 100644 (file)
@@ -22,7 +22,6 @@ import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.RefListEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.formula.ptg.NumberPtg;
-import org.apache.poi.util.ExceptionUtil;
 
 /**
  * Returns the number of areas in a reference. An area is a range of contiguous cells or a single cell.
@@ -43,9 +42,6 @@ public final class Areas implements Function {
             }
             return new NumberEval(new NumberPtg(result));
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             return ErrorEval.VALUE_INVALID;
         }
 
index 0fa23c66418528e4bc2e3fe2f9160ee78bf8821a..0aef78249a556988d92638088afd08bf63f49e9c 100644 (file)
@@ -21,7 +21,6 @@ import org.apache.poi.ss.formula.eval.ErrorEval;
 import org.apache.poi.ss.formula.eval.EvaluationException;
 import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
-import org.apache.poi.util.ExceptionUtil;
 
 import java.util.List;
 
@@ -58,9 +57,6 @@ public class Correl extends Fixed2ArgFunction {
         } catch (EvaluationException e) {
             return e.getErrorEval();
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             return ErrorEval.NA;
         }
     }
index 8b6aaf4e57f17693c98a72a6b72bc1d83d857397..2aa916a2ae9d311e9bb9cf822b7948818c12aa8b 100644 (file)
@@ -22,7 +22,6 @@ import org.apache.poi.ss.formula.eval.ErrorEval;
 import org.apache.poi.ss.formula.eval.EvaluationException;
 import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
-import org.apache.poi.util.ExceptionUtil;
 
 import java.util.List;
 
@@ -58,9 +57,6 @@ public class Covar extends Fixed2ArgFunction implements FreeRefFunction {
         } catch (EvaluationException e) {
             return e.getErrorEval();
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             return ErrorEval.NA;
         }
     }
index 5d4196ce16f072814148f09349540a3d756524e4..8007ad06e0541bd1ecdb9e85149e9bce452e6692 100644 (file)
@@ -32,7 +32,6 @@ import org.apache.poi.ss.formula.eval.StringEval;
 import org.apache.poi.ss.formula.eval.StringValueEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.util.NumberComparer;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.Internal;
 import org.apache.poi.util.LocaleUtil;
 
@@ -137,9 +136,6 @@ public final class DStarRunner implements Function3Arg {
                 return e.getErrorEval();
             }
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             if (!algorithm.allowEmptyMatchField()) {
                 return ErrorEval.VALUE_INVALID;
             }
index 1fc277b6ff474db21ec9cd8241bd40bd8d90992d..1075680657481e03f0513eead282bdf70a058981 100644 (file)
@@ -28,7 +28,6 @@ import org.apache.poi.ss.formula.eval.OperandResolver;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.usermodel.DateUtil;
 import org.apache.poi.ss.util.DateParser;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.LocaleUtil;
 
 /**
@@ -83,9 +82,6 @@ public class Days implements FreeRefFunction {
             double d0 = NumericFunction.singleOperandEvaluate(ve, srcRowIndex, srcColumnIndex);
             return getDate(d0);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             String strText1 = OperandResolver.coerceValueToString(ve);
             return DateParser.parseLocalDate(strText1);
         }
index 7b79e31c536bfe9f96837803f216ee064610b157..b6b3f1c5f5eac267bf0945a839ef11318b70e7c4 100644 (file)
@@ -22,7 +22,6 @@ import org.apache.poi.ss.formula.eval.EvaluationException;
 import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.OperandResolver;
 import org.apache.poi.ss.formula.eval.ValueEval;
-import org.apache.poi.util.ExceptionUtil;
 
 import java.util.List;
 
@@ -74,9 +73,6 @@ public class Forecast extends Fixed3ArgFunction implements FreeRefFunction {
         } catch (EvaluationException e) {
             return e.getErrorEval();
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             return ErrorEval.NA;
         }
     }
index cc049557c8ef6942797f1cc5bdc822848688693c..9cf3ade0731db9a9608a813d35a6413505b13417 100644 (file)
@@ -31,7 +31,6 @@ import org.apache.poi.ss.formula.eval.OperandResolver;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.formula.ptg.Area3DPxg;
 import org.apache.poi.ss.usermodel.Table;
-import org.apache.poi.util.ExceptionUtil;
 
 /**
  * Implementation for Excel function INDIRECT<p>
@@ -143,9 +142,6 @@ public final class Indirect implements FreeRefFunction {
             try {
                 return ec.getDynamicReference(workbookName, sheetName, refStrPart1, refStrPart2, isA1style);
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 LOGGER.atWarn().log("Indirect function: failed to parse reference {}", text, e);
                 return ErrorEval.REF_INVALID;
             }
index fd06056292a44141222608f288a1200d3ec82e20..eb0c0af009783ad8af7a1150c6c7009ea9b79d34 100644 (file)
@@ -25,7 +25,6 @@ import org.apache.poi.ss.formula.eval.NumberEval;
 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.util.ExceptionUtil;
 import org.apache.poi.util.LocaleUtil;
 
 /**
@@ -112,9 +111,6 @@ public final class NumberValueFunction implements FreeRefFunction {
         } catch (EvaluationException e) {
             return e.getErrorEval();
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             return ErrorEval.VALUE_INVALID; //If any of the arguments are not valid, NUMBERVALUE returns the #VALUE! error value.
         }
 
index 20109d1ff1da780353f48cff83ab38085dafd792..2bb56e36be392f0bcd2d0dfb4470f14261b0bb38 100644 (file)
@@ -22,7 +22,6 @@ import org.apache.logging.log4j.Logger;
 import org.apache.poi.ss.formula.eval.*;
 import org.apache.poi.ss.usermodel.DateUtil;
 import org.apache.poi.ss.util.DateParser;
-import org.apache.poi.util.ExceptionUtil;
 
 import java.time.DateTimeException;
 import java.time.LocalDate;
@@ -61,17 +60,11 @@ public class TimeValue extends Fixed1ArgFunction {
             try {
                 return parseTimeFromDateTime(dateTimeText);
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 try {
                     //this could be a time (with no date part) - prepend a dummy date because
                     //parseTimeFromDateTime needs it
                     return parseTimeFromDateTime("1/01/2000 " + dateTimeText);
                 } catch (Exception e2) {
-                    if (ExceptionUtil.isFatal(e2)) {
-                        ExceptionUtil.rethrow(e2);
-                    }
                     LocalDate ld = DateParser.parseLocalDate(dateTimeText);
                     //return 0 as this is a pure date with no time element
                     return new NumberEval(0);
index 96a71d464b7e017db6ad15b54b767c2d03311d8b..c9101dc71aa01697ef20aeb8aca5510213971951 100644 (file)
@@ -33,7 +33,6 @@ import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.OperandResolver;
 import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.usermodel.DateUtil;
-import org.apache.poi.util.ExceptionUtil;
 
 /**
  * Implementation for Excel WeekNum() function.
@@ -70,9 +69,6 @@ public class WeekNum extends Fixed2ArgFunction implements FreeRefFunction {
                     .atZone(ZoneId.systemDefault())
                     .toLocalDate();
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             return ErrorEval.NUM_ERROR;
         }
         int returnType;
index 4afbfbfd757d5719a386334d21c22a6374af04e6..fe14527066d86e4da92028aa9f805b74eb84d5d6 100644 (file)
@@ -47,7 +47,6 @@ import org.apache.poi.ss.format.CellFormatResult;
 import org.apache.poi.ss.formula.ConditionalFormattingEvaluator;
 import org.apache.poi.ss.util.DateFormatConverter;
 import org.apache.poi.ss.util.NumberToTextConverter;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.LocaleUtil;
 import org.apache.poi.util.StringUtil;
 
@@ -408,9 +407,6 @@ public class DataFormatter {
                 // Wrap and return (non-cacheable - CellFormat does that)
                 return new CellFormatResultWrapper( cfmt.apply(cellValueO) );
             } catch (Exception e) {
-                if (ExceptionUtil.isFatal(e)) {
-                    ExceptionUtil.rethrow(e);
-                }
                 LOG.atWarn().withThrowable(e).log("Formatting failed for format {}, falling back", formatStr);
             }
         }
@@ -1123,9 +1119,6 @@ public class DataFormatter {
                     try {
                         cellType = cell.getCachedFormulaResultType();
                     } catch (Exception e) {
-                        if (ExceptionUtil.isFatal(e)) {
-                            ExceptionUtil.rethrow(e);
-                        }
                         return cell.getCellFormula();
                     }
                 } else {
index 9d227464dcefdded3f5f39c4c96baaa9f8007442..130169999c4bf9d5510ddfcc5d7b1a832511b242 100644 (file)
@@ -38,7 +38,6 @@ import org.apache.poi.ss.usermodel.RichTextString;
 import org.apache.poi.ss.usermodel.Row;
 import org.apache.poi.ss.usermodel.Sheet;
 import org.apache.poi.ss.usermodel.Workbook;
-import org.apache.poi.util.ExceptionUtil;
 import org.apache.poi.util.Internal;
 
 
@@ -193,9 +192,6 @@ public class SheetUtil {
                 try {
                     sval = formatter.formatCellValue(cell, dummyEvaluator);
                 } catch (Exception e) {
-                    if (ExceptionUtil.isFatal(e)) {
-                        ExceptionUtil.rethrow(e);
-                    }
                     sval = String.valueOf(cell.getNumericCellValue());
                 }
             } else if (cellType == CellType.BOOLEAN) {
index bc876c0d375a87ed11a16326f14316b34c078c30..b82ad9b8c7c8a010a4d4efcfe7d7ab2a9934218e 100644 (file)
@@ -34,9 +34,6 @@ public class Configurator {
         try {
             return Integer.parseInt(property);
         } catch (Exception e) {
-            if (ExceptionUtil.isFatal(e)) {
-                ExceptionUtil.rethrow(e);
-            }
             LOG.atError().log("System property -D{} does not contains a valid integer: {}", systemProperty, property);
             return defaultValue;
         }