From: SourceForge.net <no...@so...> - 2012-11-16 04:39:36
|
Patches item #2792112, was opened at 2009-05-15 01:48 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720017&aid=2792112&group_id=130558 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Closed Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: John Lewis (lewijw) Summary: Cobertura fails with JUnit tests that uses multiple threads Initial Comment: A JUnit test with a number of threads which makes calls to the same class (not necessaries the same object) will fail with Cobertura because of a bug in Cobertura. The problem is that the classes inside Cobertura's coveragedata package is not thread safe and when collecting data from concurrent threads this can result in an exception which look something like: java.lang.IndexOutOfBoundsException: Index: 0, Size: 1 at java.util.ArrayList.RangeCheck(ArrayList.java:547) at java.util.ArrayList.get(ArrayList.java:322) at net.sourceforge.cobertura.coveragedata.LineData.getJumpData(LineData.java:316) at net.sourceforge.cobertura.coveragedata.LineData.touchJump(LineData.java:259) at net.sourceforge.cobertura.coveragedata.ClassData.touchJump(ClassData.java:453) at code.ConcurrentAccessObject.addText(ConcurrentAccessObject.java:25) at test.ConcurrentAccessObjectTest$TestThread.run(ConcurrentAccessObjectTest.java:30) I have written a fix for the bug which makes the touch methods on the ClassData class synchronized. This does that only one thread is allowed to update the coveragedata when running tests. Please note that the bug is not easy to reproduce consistently because it is a concurrency bug. The included JUnit test case will therefore not always work. Also note that is fixes the same problem as Cobertura patch 2722288 in SourceForge. But I think that my patch may be a simpler and better solution. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2012-11-15 20:39 Message: I was curious if you ever thought of changing the structure of your blog? Its very well written; I love what youve got to say. But maybe you could a little more in the way of content so people could connect with it better. Youve got an awful lot of text for only having 1 or two images. Maybe you could space it out better? north face osito jacket http://sfwgdqdfge.blinkweb.com/ ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2012-11-10 23:36 Message: Greetings from California! I'm bored to death at work so I decided to browse your website on my iphone during lunch break. I enjoy the information you present here and can't wait to take a look when I get home. I'm amazed at how fast your blog loaded on my cell phone .. I'm not even using WIFI, just 3G .. Anyways, great blog! north face jackets clearance http://yuywfrbgzf.blogoak.com/ ---------------------------------------------------------------------- Comment By: John Lewis (lewijw) Date: 2009-06-25 03:55 Message: Thanks for the patch, but I cannot open it for some reason. Is it corrupt? This issue has recently been fixed. I hope to release 1.9.2 today. It will have the fix. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720017&aid=2792112&group_id=130558 |