diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-07-24 07:09:04 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-07-24 07:09:04 +0000 |
commit | 50a4a3102fa0c55e75bfc923eef34e78180d7238 (patch) | |
tree | b2ad5e08d5fa950e40a489fde0301039df197f53 /poi-ooxml | |
parent | b08696f7010977b4978c107d0cdc2cf1fbc04262 (diff) | |
download | poi-50a4a3102fa0c55e75bfc923eef34e78180d7238.tar.gz poi-50a4a3102fa0c55e75bfc923eef34e78180d7238.zip |
remove unchecked cast from setHyperlink
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1891762 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r-- | poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java index 1900d7705c..5929a4cad3 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFCell.java @@ -1064,7 +1064,12 @@ public final class XSSFCell extends CellBase { return; } - XSSFHyperlink link = (XSSFHyperlink)hyperlink; + XSSFHyperlink link; + if (hyperlink instanceof XSSFHyperlink) { + link = (XSSFHyperlink)hyperlink; + } else { + link = new XSSFHyperlink(hyperlink); + } // Assign to us link.setCellReference( new CellReference(_row.getRowNum(), _cellNum).formatAsString() ); |