Skip to content

Commit

Permalink
[JENKINS-4769] Memory consumption is huge
Browse files Browse the repository at this point in the history
- 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 b7c0907
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/java/hudson/plugins/sloccount/ReportSummary.java
Expand Up @@ -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);
Expand Down Expand Up @@ -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>");
}

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

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

0 comments on commit b7c0907

Please sign in to comment.