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.
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);
}
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;
try {
workbookUtil.addFunction(eaUdf.getFunctionAlias(), eaUdf.getClassName());
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new BuildException(e.getMessage(), e);
}
}
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 " +
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;
}
}
catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
LOG.atError().withThrowable(e).log("Unexpected error processing command, ignoring and continuing. Command: {}", command);
}
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;
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));
}
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 {
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();
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;
default:
break;
}
- } catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
+ } catch (Exception ignored) {
}
return new Rectangle2D.Double(1,1,1,1);
}
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;
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--;
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;
try {
read();
- } catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
+ } catch (Exception e){
LOG.atError().withThrowable(e).log("Failed to parse MasterTextPropAtom");
}
}
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;
//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");
}
}
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;
}
cyos.initCipherForBlock(persistId, false);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new EncryptedPowerPointFileException(e);
}
return cyos;
readFully(ccis, docstream, offset+8, rlen);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new EncryptedPowerPointFileException(e);
}
}
int blipLen = endOffset - offset;
decryptPicBytes(pictstream, offset, blipLen);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new CorruptPowerPointFileException(e);
}
}
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);
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;
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;
}
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;
try {
preserveBinTables = Boolean.parseBoolean(System.getProperty(PROPERTY_PRESERVE_BIN_TABLES));
} catch (Exception exc) {
- if (ExceptionUtil.isFatal(exc)) {
- ExceptionUtil.rethrow(exc);
- }
+ // ignore;
}
if (!preserveBinTables) {
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();
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;
processDocumentInformation(summaryInformation);
}
} catch (Exception exc) {
- if (ExceptionUtil.isFatal(exc)) {
- ExceptionUtil.rethrow(exc);
- }
LOG.atWarn().withThrowable(exc).log("Unable to process document summary information");
}
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;
}
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");
}
}
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.
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()];
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;
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()));
}
}
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;
try {
stringBuilder.append(iterator.next());
} catch (Exception exc) {
- if (ExceptionUtil.isFatal(exc)) {
- ExceptionUtil.rethrow(exc);
- }
stringBuilder.append("error");
}
stringBuilder.append("; ");
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;
} 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);
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;
try {
write(bos, codepage);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
LOG.atWarn().withThrowable(e).log("can't serialize string");
}
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;
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;
} catch (HPSFRuntimeException ex) {
throw ex;
} catch (Exception ex) {
- if (ExceptionUtil.isFatal(ex)) {
- ExceptionUtil.rethrow(ex);
- }
throw new HPSFRuntimeException(ex);
}
}
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;
ccis.readFully(initialBuf);
}
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new RecordFormatException(e);
}
}
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;
}
os.close();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new EncryptedDocumentException(e);
}
}
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;
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);
}
}
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;
/**
try {
eib = getBuilder(encryptionMode);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new IOException(e);
}
try {
eib = getBuilder(encryptionMode);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new EncryptedDocumentException(e);
}
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 {
throw new NullPointerException("keyData not set");
}
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new EncryptedDocumentException("Unable to parse keyData");
}
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;
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);
}
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;
/**
cipher.update(oneByte, 0, 1, oneByte, 0);
super.write(oneByte);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new EncryptedDocumentException(e);
}
}
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);
}
}
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 {
}
} catch (NoSuchElementException ignored) {
break;
- } catch (Exception | ServiceConfigurationError e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
+ } catch (Exception | ServiceConfigurationError ignored) {
}
}
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;
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) {
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;
// 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;
}
// 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;
}
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;
/**
}
return new LazyAreaEval(0, absoluteC, ssVersion.getLastRowIndex(), absoluteC, sre);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.REF_INVALID;
}
}
}
return new LazyAreaEval(absoluteR, 0, absoluteR, ssVersion.getLastColumnIndex(), sre);
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.REF_INVALID;
}
}
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.
appendAndEscape(out, rawSheetName);
}
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new IllegalStateException(e);
}
}
appendOrREF(out, rawSheetName);
}
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new IllegalStateException(e);
}
}
sb.append(ch);
}
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
throw new IllegalStateException(e);
}
}
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;
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
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;
try {
expression = OperandResolver.getSingleValue(args[0], ec.getRowIndex(), ec.getColumnIndex());
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.NA;
}
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()
} catch (EvaluationException e) {
return e.getErrorEval();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.VALUE_INVALID;
}
}
} catch (EvaluationException e) {
return e.getErrorEval();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.VALUE_INVALID;
}
}
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()
} catch (EvaluationException e) {
return e.getErrorEval();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.VALUE_INVALID;
}
}
} catch (EvaluationException e) {
return e.getErrorEval();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.VALUE_INVALID;
}
}
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.
}
return new NumberEval(new NumberPtg(result));
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.VALUE_INVALID;
}
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;
} catch (EvaluationException e) {
return e.getErrorEval();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.NA;
}
}
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;
} catch (EvaluationException e) {
return e.getErrorEval();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.NA;
}
}
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;
return e.getErrorEval();
}
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
if (!algorithm.allowEmptyMatchField()) {
return ErrorEval.VALUE_INVALID;
}
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;
/**
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);
}
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;
} catch (EvaluationException e) {
return e.getErrorEval();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.NA;
}
}
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>
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;
}
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;
/**
} 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.
}
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;
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);
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.
.atZone(ZoneId.systemDefault())
.toLocalDate();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return ErrorEval.NUM_ERROR;
}
int returnType;
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;
// 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);
}
}
try {
cellType = cell.getCachedFormulaResultType();
} catch (Exception e) {
- if (ExceptionUtil.isFatal(e)) {
- ExceptionUtil.rethrow(e);
- }
return cell.getCellFormula();
}
} else {
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;
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) {
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;
}