poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60352] New: XSSFExcelExtractor extracts "null" as text from empty cells
Date Tue, 08 Nov 2016 09:29:27 GMT
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: dev@poi.apache.org
          Reporter: cos.marginean@gmail.com
  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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message