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

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=60460

            Bug ID: 60460
           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: [hidden email]
          Reporter: [hidden email]
  Target Milestone: ---

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: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=60460

--- Comment #1 from Ricky <[hidden email]> ---
Created attachment 34511
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=34511&action=edit
test file

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=60460

--- Comment #2 from Ricky <[hidden email]> ---
*** Bug 60459 has been marked as a duplicate of this bug. ***

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=60460

Ricky <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|HSSF                        |SS Common

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=60460

--- Comment #3 from Ricky <[hidden email]> ---
Move this bug from HSSF to SS common component.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

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

Bugzilla from bugzilla@apache.org
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=60460

Dominik Stadler <[hidden email]> changed:

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

--- Comment #4 from Dominik Stadler <[hidden email]> ---
This is fixed via r1850008 now by adding some null-checks and returning #REF
for workbook-name and sheetname if needed.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]