Skip to content
Permalink
Browse files
[JENKINS-4769] Memory consumption is huge
- Previous commit added a regression, thousands in numbers are no longer separated by commas in report summary.
- Displaying of all numbers wrapped to StringUtil.grouping() to fix the regression.
  • Loading branch information
mixalturek committed Jan 4, 2014
1 parent 7157fd7 commit b7c0907a8c738ec0cc1ed03d2bc3acdb15828f04
Showing 1 changed file with 10 additions and 6 deletions.
@@ -30,21 +30,21 @@ public static String createReportSummary(List<SloccountLanguageStatistics> curre
String strLanguages = Messages.Sloccount_ReportSummary_Languages();

builder.append("<a href=\"" + SloccountBuildAction.URL_NAME + "\">");
builder.append(getLineCount(current));
builder.append(StringUtil.grouping(getLineCount(current)));

if(previous != null) {
printDifference(getLineCount(current), getLineCount(previous), builder);
}

builder.append(" " + strLines + "</a> " + strIn + " ");
builder.append(getFileCount(current));
builder.append(StringUtil.grouping(getFileCount(current)));

if(previous != null) {
printDifference(getFileCount(current), getFileCount(previous), builder);
}

builder.append(" " + strFiles + " " + strAnd + " ");
builder.append(getLanguageCount(current));
builder.append(StringUtil.grouping(getLanguageCount(current)));

if(previous != null) {
printDifference(getLanguageCount(current), getLanguageCount(previous), builder);
@@ -93,15 +93,19 @@ private static void appendLanguageDetails(SloccountLanguageStatistics current,
builder.append("\">");
builder.append(current.getName());
builder.append("</a> : ");
builder.append(current.getLineCount());
builder.append(StringUtil.grouping(current.getLineCount()));

if(previous != null){
printDifference(current.getLineCount(), previous.getLineCount(), builder);
}

builder.append(" " + strLines + " " + strIn + " ");
builder.append(current.getFileCount());
builder.append(StringUtil.grouping(current.getFileCount()));

if(previous != null){
printDifference(current.getFileCount(), previous.getFileCount(), builder);
}

builder.append(" " + strFiles + ".</li>");
}

@@ -125,7 +129,7 @@ else if(difference == 0)
builder.append(")");
}
}

private static int getLineCount(List<SloccountLanguageStatistics> statistics)
{
int lineCount = 0;

0 comments on commit b7c0907

Please sign in to comment.