remove unchecked cast from setHyperlink

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1891762 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-07-24 07:09:04 +00:00
parent b08696f701
commit 50a4a3102f
1 changed files with 6 additions and 1 deletions

View File

@ -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() );