From: SourceForge.net <no...@so...> - 2008-07-10 23:43:57
|
Bugs item #2015513, was opened at 2008-07-10 23:43 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720015&aid=2015513&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: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Inline appends to StringBuffer throw off coverage Initial Comment: I have some code that builds a string in a buffer: StringBuilder b = new StringBuilder(); b.append(a).append(b).append(c); My cobertura report was showing 0 coverage in seemingly random places in the file, including in blank lines between methods and in comments. By trial and error I discovered that unchaining the appends makes the report accurate: StringBuilder b = new StringBuilder(); b.append(a); b.append(b); b.append(c); This is with Cobertura 1.9 executed via Maven2 plugin ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720015&aid=2015513&group_id=130558 |