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

            Bug ID: 60352
           Summary: XSSFExcelExtractor extracts "null" as text from empty
                    cells
           Product: POI
           Version: 3.16-dev
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

We use XSSFExcelExtractor as a mechanism to extract the complete text in an
Excel file, however it seems that in certain circumstances the "null" value is
extracted from an empty cell.

For example:

> Breakdown of data generated by project, technology, submitting centre null    
> > null  null    null    null    null
> null  null    null    null    null    null    null
> null  Abbreviation Definitions        null    null    null    null    null
> null  Platform        Definition      null    null    null    null
> null  LS454   454 Roche Genome Sequencer FLX System   null    null    null    


The patch is relatively simple (and I'm happy to create a PR for it on GitHub).
All we need to is to wrap the last two lines in
XSSFExcelExtractor.handleNonStringCell() with a null check

>         if (contents != null) {
>             checkMaxTextSize(text, contents);
>             text.append(contents);
>         }

This would then perform as expected and extract this text instead.

> Breakdown of data generated by project, technology, submitting centre         
>                                 
>                                               
>       Abbreviation Definitions                                        
>       Platform        Definition                              
>       LS454   454 Roche Genome Sequencer FLX System

We believe that an empty string is the preferred option here, because the text
"null" itself might be used as cell contents in certain cases. In that
situation it's difficult to discriminate between these occurrences (is it the
text "null" or is the cell empty?)

Looking forward to hearing your thoughts.

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

Reply via email to