Bug 47532 - HSSFCellStyle.cloneStyleFrom ALWAYS throws an IllegalArgumentException
Summary: HSSFCellStyle.cloneStyleFrom ALWAYS throws an IllegalArgumentException
Status: RESOLVED LATER
Alias: None
Product: POI
Classification: Unclassified
Component: HSSF (show other bugs)
Version: 3.5-dev
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-15 01:32 UTC by n.j.white
Modified: 2009-07-15 05:22 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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