Skip to content

HSSFWorkbook creates false positive warnings, when writing a new Workbook #1051

@ToralfNiebuhr

Description

@ToralfNiebuhr

If I create a new HSSFWorkbook without a template.
Like
HSSFWorkbook wb = new HSSFWorkbook(); wb.write(new FileOutputStream("testfile"));

Then, all versions above "5.0.1" create this warning
08:38:09,198 WARN POIDocument - DocumentSummaryInformation property set came back as null 08:38:09,205 WARN POIDocument - SummaryInformation property set came back as null

The cause is, that when "getBytes()" is called; then updateEncryptionInfo calls readProperties() from an empty POIDocument. The missing Records are only added later in getBytes(), when they are read from the internal wb.

I don't know what the correct fix is here. Replace readProperties() with readProperties(false) (same behavior as in older versions)
Or, updateEncryptionInfo working agains the wb, or calling updateEncryptionInfo later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions