You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2006/09/14 11:05:03 UTC
DO NOT REPLY [Bug 40508] New: - ObjRecord#clone() is incorrect
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40508>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=40508
Summary: ObjRecord#clone() is incorrect
Product: POI
Version: 2.5
Platform: All
OS/Version: All
Status: NEW
Severity: critical
Priority: P1
Component: HSSF
AssignedTo: poi-dev@jakarta.apache.org
ReportedBy: jajakarta@ytp.ne.jp
I got a exception as follow when copying sheet:
Caused by: java.util.ConcurrentModificationException
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:449)
java.util.AbstractList$Itr.next(AbstractList.java:420)
org.apache.poi.hssf.record.ObjRecord.clone(ObjRecord.java:182)
org.apache.poi.hssf.model.Sheet.cloneSheet(Sheet.java:320)
org.apache.poi.hssf.usermodel.HSSFSheet.cloneSheet(HSSFSheet.java:114)
org.apache.poi.hssf.usermodel.HSSFWorkbook.cloneSheet(HSSFWorkbook.java:337)
snip
It is caused by a bug of "clone" method in the "ObjRecord" class.
public Object clone()
{
ObjRecord rec = new ObjRecord();
rec.subrecords = new ArrayList();
for ( Iterator iterator = subrecords.iterator(); iterator.hasNext(); )
subrecords.add(( (Record) iterator.next() ).clone());
return rec;
}
"subrecords.add" must be "rec.subrecords.add" in the "for" block. I got correct
result after modification.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/
DO NOT REPLY [Bug 40508] - [INFO NEEDED] ObjRecord#clone() is incorrect
Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40508>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=40508
avik@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|ObjRecord#clone() is |[INFO NEEDED]
|incorrect |ObjRecord#clone() is
| |incorrect
------- Additional Comments From avik@apache.org 2007-01-16 02:10 -------
I dont want to add this patch without a testcase... seems risky to me. Could you
please supply a short testcase that triggers this bug? Thanks.
--
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-dev-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta POI Project: http://jakarta.apache.org/poi/