Bug 63659 - construct SXSSFSheet via SXSSFWorkbook and XSSFSheet
Summary: construct SXSSFSheet via SXSSFWorkbook and XSSFSheet
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 4.0.0-FINAL
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-13 01:06 UTC by ni个小逗比
Modified: 2019-12-09 06:16 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ni个小逗比 2019-08-13 01:06:33 UTC
Constractor of SXSSFSheet:
public SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet) throws IOException {
        _workbook = workbook;
        _sh = xSheet;
        _writer = workbook.createSheetDataWriter();
        setRandomAccessWindowSize(_workbook.getRandomAccessWindowSize());
        _autoSizeColumnTracker = new AutoSizeColumnTracker(this);
    }

Fields of SXSSFWorkbook :
private final Map<SXSSFSheet,XSSFSheet> _sxFromXHash = new HashMap<>();
private final Map<XSSFSheet,SXSSFSheet> _xFromSxHash = new HashMap<>();

When call the constractor of SXSSFSheet, has to deal with the fields of SXSSFWorkbook ,_sxFromXHash and _xFromSxHash .
Comment 1 Dominik Stadler 2019-11-17 12:18:20 UTC
Sorry, but I don't really understand the actual issue, can you describe in some more detail what you think is wrong or should be changed?
Comment 2 ni个小逗比 2019-12-09 06:16:27 UTC
(In reply to Dominik Stadler from comment #1)
> Sorry, but I don't really understand the actual issue, can you describe in
> some more detail what you think is wrong or should be changed?

if we have a XSSFSheet , and want to get a SXSSFSheet, so we would invoke the constractor of SXSSFSheet : public SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet) throws IOException . and then we do this : SXSSFWorkbook#getSheetAt(i), will return null , because of the method SXSSFWorkbook#registerSheetMapping do not invoked

so we shoud call SXSSFWorkbook#registerSheetMapping when we invoke the constractor of SXSSFSheet : public SXSSFSheet(SXSSFWorkbook workbook, XSSFSheet xSheet) throws IOException .