### Eclipse Workspace Patch 1.0 #P poi Index: src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java =================================================================== --- src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java (revision 766663) +++ src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java (working copy) @@ -814,8 +814,9 @@ 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"); } - throw new IllegalArgumentException("Can only clone from one HSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle"); } public void cloneStyleFrom(HSSFCellStyle source) { // First we need to clone the extended format Index: src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java =================================================================== --- src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java (revision 765974) +++ src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFCellStyle.java (working copy) @@ -112,8 +112,9 @@ public void cloneStyleFrom(CellStyle source) { if(source instanceof XSSFCellStyle) { this.cloneStyleFrom(source); + } else { + throw new IllegalArgumentException("Can only clone from one XSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle"); } - throw new IllegalArgumentException("Can only clone from one XSSFCellStyle to another, not between HSSFCellStyle and XSSFCellStyle"); } /**