Bug 47532

Summary: HSSFCellStyle.cloneStyleFrom ALWAYS throws an IllegalArgumentException
Product: POI Reporter: n.j.white
Component: HSSFAssignee: POI Developers List <dev>
Status: RESOLVED LATER    
Severity: normal    
Priority: P2    
Version: 3.5-dev   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description n.j.white 2009-07-15 01:32:06 UTC
Decompiled from  org.apache.poi.hssf.usermodel.HSSFCellStyle

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

The illegal argument exception is always thrown, even if the style is successfully cloned. I think you're missing an 'else'...
Comment 1 Nick Burch 2009-07-15 05:22:13 UTC
It looks like this was fixed some time ago in svn - please try a newer version