https://issues.apache.org/bugzilla/show_bug.cgi?id=56572

            Bug ID: 56572
           Summary: Implementation of HSSFCellStyle does not match its
                    contract
           Product: POI
           Version: 3.10
          Hardware: PC
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: [email protected]
          Reporter: [email protected]

Hi, 

As define in the interface org.apache.poi.ss.usermodel.Cell, the method
setStyle can accept a null value (from javadoc) : "If the value is null then
the style information is removed causing the cell to used the default workbook
style."

Or when I look at the implemenation in HSSFCell, I saw that: 
public void setCellStyle(CellStyle style) {
        setCellStyle( (HSSFCellStyle)style );
    }
    public void setCellStyle(HSSFCellStyle style) {
        // Verify it really does belong to our workbook
        style.verifyBelongsToWorkbook(_book);

        short styleIndex;
        if(style.getUserStyleName() != null) {
            styleIndex = applyUserCellStyle(style);
        } else {
            styleIndex = style.getIndex();
        }

        // Change our cell record to use this style
        _record.setXFIndex(styleIndex);
    }

So a null value is not checked and not taken into account.

Thanks,

Mayeul

-- 
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