From d07d8e42b9d961a86a9adc09226bfb86e5b2b211 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Tue, 14 Feb 2023 15:03:26 +0000 Subject: [PATCH] revert use of ExceptionUtil on caught exceptions (not useful) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1907654 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/examples/hpsf/ReadCustomPropertySets.java | 4 ++++ .../org/apache/poi/ss/excelant/ExcelAntTask.java | 7 ------- .../main/java/org/apache/poi/hdgf/chunks/Chunk.java | 4 ---- .../org/apache/poi/hdgf/streams/ChunkStream.java | 8 +++----- .../java/org/apache/poi/hemf/draw/HemfGraphics.java | 4 ---- .../poi/hemf/record/emfplus/HemfPlusImage.java | 6 +----- .../main/java/org/apache/poi/hslf/blip/PICT.java | 4 ---- .../apache/poi/hslf/record/MasterTextPropAtom.java | 6 +----- .../apache/poi/hslf/record/TxMasterStyleAtom.java | 6 +----- .../poi/hslf/usermodel/HSLFSlideShowEncrypted.java | 13 ------------- .../org/apache/poi/hwmf/usermodel/HwmfPicture.java | 4 ---- .../main/java/org/apache/poi/hwpf/HWPFDocument.java | 9 ++------- .../poi/hwpf/converter/AbstractWordConverter.java | 10 ---------- .../apache/poi/hwpf/extractor/Word6Extractor.java | 4 ---- .../org/apache/poi/hwpf/model/PicturesTable.java | 4 ---- .../java/org/apache/poi/hwpf/sprm/SprmBuffer.java | 4 ---- poi/src/main/java/org/apache/poi/POIDocument.java | 4 ---- poi/src/main/java/org/apache/poi/hpsf/Property.java | 7 ------- poi/src/main/java/org/apache/poi/hpsf/Section.java | 4 ---- .../hssf/record/crypto/Biff8DecryptingStream.java | 4 ---- .../org/apache/poi/hssf/usermodel/HSSFWorkbook.java | 4 ---- .../org/apache/poi/poifs/crypt/CryptoFunctions.java | 4 ---- .../org/apache/poi/poifs/crypt/EncryptionInfo.java | 7 ------- .../poifs/crypt/agile/AgileEncryptionHeader.java | 4 ---- .../poifs/crypt/cryptoapi/CryptoAPIDecryptor.java | 3 --- .../cryptoapi/CryptoAPIDocumentOutputStream.java | 7 ------- .../org/apache/poi/sl/draw/DrawPictureShape.java | 6 +----- .../apache/poi/ss/extractor/EmbeddedExtractor.java | 4 ---- .../ss/formula/EvaluationConditionalFormatRule.java | 7 ------- .../poi/ss/formula/OperationEvaluationContext.java | 7 ------- .../apache/poi/ss/formula/SheetNameFormatter.java | 10 ---------- .../apache/poi/ss/formula/WorkbookEvaluator.java | 4 ---- .../java/org/apache/poi/ss/formula/atp/Switch.java | 4 ---- .../apache/poi/ss/formula/atp/XLookupFunction.java | 7 ------- .../apache/poi/ss/formula/atp/XMatchFunction.java | 7 ------- .../org/apache/poi/ss/formula/functions/Areas.java | 4 ---- .../org/apache/poi/ss/formula/functions/Correl.java | 4 ---- .../org/apache/poi/ss/formula/functions/Covar.java | 4 ---- .../poi/ss/formula/functions/DStarRunner.java | 4 ---- .../org/apache/poi/ss/formula/functions/Days.java | 4 ---- .../apache/poi/ss/formula/functions/Forecast.java | 4 ---- .../apache/poi/ss/formula/functions/Indirect.java | 4 ---- .../ss/formula/functions/NumberValueFunction.java | 4 ---- .../apache/poi/ss/formula/functions/TimeValue.java | 7 ------- .../apache/poi/ss/formula/functions/WeekNum.java | 4 ---- .../org/apache/poi/ss/usermodel/DataFormatter.java | 7 ------- .../main/java/org/apache/poi/ss/util/SheetUtil.java | 4 ---- .../main/java/org/apache/poi/util/Configurator.java | 3 --- 48 files changed, 13 insertions(+), 245 deletions(-) diff --git a/poi-examples/src/main/java/org/apache/poi/examples/hpsf/ReadCustomPropertySets.java b/poi-examples/src/main/java/org/apache/poi/examples/hpsf/ReadCustomPropertySets.java index ca8cba1ce9..187f434b94 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/hpsf/ReadCustomPropertySets.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/hpsf/ReadCustomPropertySets.java @@ -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; /** *

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); } diff --git a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTask.java b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTask.java index a4bfba9f66..4fc0b09914 100644 --- a/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTask.java +++ b/poi-excelant/src/main/java/org/apache/poi/ss/excelant/ExcelAntTask.java @@ -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 for must include poi.jar and poi-ooxml.jar " + "if not in Ant's own classpath. Processing .xlsx spreadsheets requires " + diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hdgf/chunks/Chunk.java b/poi-scratchpad/src/main/java/org/apache/poi/hdgf/chunks/Chunk.java index b2a6b3925c..b85592f112 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hdgf/chunks/Chunk.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hdgf/chunks/Chunk.java @@ -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); } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hdgf/streams/ChunkStream.java b/poi-scratchpad/src/main/java/org/apache/poi/hdgf/streams/ChunkStream.java index 9d807d7ed0..b1c10ae3e7 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hdgf/streams/ChunkStream.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hdgf/streams/ChunkStream.java @@ -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)); } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hemf/draw/HemfGraphics.java b/poi-scratchpad/src/main/java/org/apache/poi/hemf/draw/HemfGraphics.java index ac3e5772db..113f8ede25 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hemf/draw/HemfGraphics.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hemf/draw/HemfGraphics.java @@ -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(); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusImage.java b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusImage.java index c50a3fec34..6afb53cdd3 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusImage.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hemf/record/emfplus/HemfPlusImage.java @@ -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); } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java index 172468a03f..3e5042af46 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/blip/PICT.java @@ -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--; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MasterTextPropAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MasterTextPropAtom.java index ff5305cce6..a6065e3e24 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MasterTextPropAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/MasterTextPropAtom.java @@ -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"); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxMasterStyleAtom.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxMasterStyleAtom.java index af307cc102..ca94a6acfd 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxMasterStyleAtom.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/TxMasterStyleAtom.java @@ -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"); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java index 04ea654546..8c7effc7f3 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java @@ -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); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java index bbe782cd36..da220c941e 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwmf/usermodel/HwmfPicture.java @@ -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, 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; } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java index 8dbd2e2fe9..5a4296f8e1 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/HWPFDocument.java @@ -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(); diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java index 0a25404bcf..d6f410d286 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/converter/AbstractWordConverter.java @@ -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"); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java index 19e538e511..6334855763 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/Word6Extractor.java @@ -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()]; diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java index a52def67b3..45e726e564 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/model/PicturesTable.java @@ -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())); } } diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmBuffer.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmBuffer.java index a77df8792a..38a0efaa02 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmBuffer.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/sprm/SprmBuffer.java @@ -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("; "); diff --git a/poi/src/main/java/org/apache/poi/POIDocument.java b/poi/src/main/java/org/apache/poi/POIDocument.java index de49c4fbdc..608c14be6d 100644 --- a/poi/src/main/java/org/apache/poi/POIDocument.java +++ b/poi/src/main/java/org/apache/poi/POIDocument.java @@ -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); diff --git a/poi/src/main/java/org/apache/poi/hpsf/Property.java b/poi/src/main/java/org/apache/poi/hpsf/Property.java index 242393ef31..5587042f0c 100644 --- a/poi/src/main/java/org/apache/poi/hpsf/Property.java +++ b/poi/src/main/java/org/apache/poi/hpsf/Property.java @@ -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; diff --git a/poi/src/main/java/org/apache/poi/hpsf/Section.java b/poi/src/main/java/org/apache/poi/hpsf/Section.java index 84ca0371d0..5ebaf43ad3 100644 --- a/poi/src/main/java/org/apache/poi/hpsf/Section.java +++ b/poi/src/main/java/org/apache/poi/hpsf/Section.java @@ -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); } } diff --git a/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java b/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java index 579b9585d1..63ed8e1fad 100644 --- a/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java +++ b/poi/src/main/java/org/apache/poi/hssf/record/crypto/Biff8DecryptingStream.java @@ -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); } } diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java index fd8cca72ae..12a4ff008a 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFWorkbook.java @@ -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); } } diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/CryptoFunctions.java b/poi/src/main/java/org/apache/poi/poifs/crypt/CryptoFunctions.java index d3e1007f30..28babc0c0f 100644 --- a/poi/src/main/java/org/apache/poi/poifs/crypt/CryptoFunctions.java +++ b/poi/src/main/java/org/apache/poi/poifs/crypt/CryptoFunctions.java @@ -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 clazz = (Class)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); } } diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/EncryptionInfo.java b/poi/src/main/java/org/apache/poi/poifs/crypt/EncryptionInfo.java index 701552980b..30fc9539e3 100644 --- a/poi/src/main/java/org/apache/poi/poifs/crypt/EncryptionInfo.java +++ b/poi/src/main/java/org/apache/poi/poifs/crypt/EncryptionInfo.java @@ -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); } diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java index 499f534695..78c289f5ea 100644 --- a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java +++ b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java @@ -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"); } diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java b/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java index acbff64cc0..4f229e9a18 100644 --- a/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java +++ b/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDecryptor.java @@ -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); } diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDocumentOutputStream.java b/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDocumentOutputStream.java index d0bbf44887..34c4a74675 100644 --- a/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDocumentOutputStream.java +++ b/poi/src/main/java/org/apache/poi/poifs/crypt/cryptoapi/CryptoAPIDocumentOutputStream.java @@ -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); } } diff --git a/poi/src/main/java/org/apache/poi/sl/draw/DrawPictureShape.java b/poi/src/main/java/org/apache/poi/sl/draw/DrawPictureShape.java index 96a0b1f314..764f1f576a 100644 --- a/poi/src/main/java/org/apache/poi/sl/draw/DrawPictureShape.java +++ b/poi/src/main/java/org/apache/poi/sl/draw/DrawPictureShape.java @@ -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) { } } diff --git a/poi/src/main/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java b/poi/src/main/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java index d6078e79bc..bdaccb7d6c 100644 --- a/poi/src/main/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java +++ b/poi/src/main/java/org/apache/poi/ss/extractor/EmbeddedExtractor.java @@ -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 { 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) { diff --git a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java index e2e0d65d1a..54199cbfca 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/EvaluationConditionalFormatRule.java @@ -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 @@ -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; } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java index fd06056292..eb0c0af009 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/NumberValueFunction.java @@ -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. } diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeValue.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeValue.java index 20109d1ff1..2bb56e36be 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeValue.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/TimeValue.java @@ -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); diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekNum.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekNum.java index 96a71d464b..c9101dc71a 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekNum.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/WeekNum.java @@ -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; diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java b/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java index 4afbfbfd75..fe14527066 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/DataFormatter.java @@ -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 { diff --git a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java index 9d227464dc..130169999c 100644 --- a/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java +++ b/poi/src/main/java/org/apache/poi/ss/util/SheetUtil.java @@ -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) { diff --git a/poi/src/main/java/org/apache/poi/util/Configurator.java b/poi/src/main/java/org/apache/poi/util/Configurator.java index bc876c0d37..b82ad9b8c7 100644 --- a/poi/src/main/java/org/apache/poi/util/Configurator.java +++ b/poi/src/main/java/org/apache/poi/util/Configurator.java @@ -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; }