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

           Summary: HSSFCellStyle cloneStyleFrom always throw exception
           Product: POI
           Version: 3.5-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: HSSF
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Please see code.
Index: src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java

    public void cloneStyleFrom(CellStyle source) {
        if(source instanceof HSSFCellStyle) {
            this.cloneStyleFrom((HSSFCellStyle)source);
        }
        throw new IllegalArgumentException("Can only clone from one
HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle");
    }

it must be rewritten with

    public void cloneStyleFrom(CellStyle source) {
        if(source instanceof HSSFCellStyle) {
            this.cloneStyleFrom((HSSFCellStyle)source);
        } else {
        throw new IllegalArgumentException("Can only clone from one
HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle");
                }
    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- 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