You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2016/12/09 04:28:28 UTC

[Bug 60459] New: Null pointer exception in ExternSheetNameResolver.prependSheetName method

https://bz.apache.org/bugzilla/show_bug.cgi?id=60459

            Bug ID: 60459
           Summary: Null pointer exception in
                    ExternSheetNameResolver.prependSheetName method
           Product: POI
           Version: 3.15-FINAL
          Hardware: Macintosh
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
          Assignee: dev@poi.apache.org
          Reporter: zhangchaowang@gmail.com
  Target Milestone: ---

Created attachment 34510
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34510&action=edit
test file

I'm parsing Excel file from EUSES data set. When get formula of name 'Database'
with range ='file:///HEPPC3/gt$/Teaching/Syn/[physyn.xls]#REF'!$AK$70:$AL$70

It throw null pointer exception:
...
for(Name rangedName : wb.getAllNames())
  if (!rangedName.isFunctionName()) {
    xlWorkbook.addNamedRange(rangedName.getNameName(),
rangedName.getRefersToFormula());
}
...


Exception in thread "main" java.lang.NullPointerException
        at
org.apache.poi.ss.formula.ptg.ExternSheetNameResolver.prependSheetName(ExternSheetNameResolver.java:40)
        at
org.apache.poi.ss.formula.ptg.Area3DPtg.toFormulaString(Area3DPtg.java:104)
        at
org.apache.poi.ss.formula.FormulaRenderer.toFormulaString(FormulaRenderer.java:91)
        at
org.apache.poi.hssf.model.HSSFFormulaParser.toFormulaString(HSSFFormulaParser.java:119)
        at
org.apache.poi.hssf.usermodel.HSSFName.getRefersToFormula(HSSFName.java:204)


Sheetname is null. I guess sheet name is #REF error in Excel. Should it return
#REF or the index of sheet?

Attached file is test file to replicate the issues.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 60459] Null pointer exception in ExternSheetNameResolver.prependSheetName method

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=60459

Ricky <zh...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Ricky <zh...@gmail.com> ---
Refresh page causing duplicate defects.

*** This bug has been marked as a duplicate of bug 60460 ***

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org