Skip to content
Permalink
Browse files

[JENKINS-49302] - integer escaping - YAGNI

  • Loading branch information...
oleg-nenashev committed Feb 2, 2018
1 parent 05dc439 commit 47efb7273cebff2786c1446afb368a05dda3764f
Showing with 4 additions and 10 deletions.
  1. +4 −10 src/main/java/hudson/plugins/testlink/util/TestLinkHelper.java
@@ -338,7 +338,7 @@ public static EnvVars buildTestCaseEnvVars(int numberOfTests, TestProject testPr
*/
public static String createReportSummary(Report testLinkReport, Report previous) {
StringBuilder builder = new StringBuilder();
builder.append("<p><b>"+Messages.ReportSummary_Summary_BuildID(escape(testLinkReport.getBuildId()))+"</b></p>");
builder.append("<p><b>"+Messages.ReportSummary_Summary_BuildID(testLinkReport.getBuildId())+"</b></p>");
builder.append("<p><b>"+Messages.ReportSummary_Summary_BuildName(Util.escape(testLinkReport.getBuildName()))+"</b></p>");
builder.append("<p><a href=\"" + TestLinkBuildAction.URL_NAME + "\">");

@@ -396,11 +396,11 @@ public static String createReportSummaryDetails(Report report, Report previous)
{
builder.append("<tr>\n");

builder.append("<td>"+escape(tc.getId())+"</td>");
builder.append("<td>"+tc.getId()+"</td>");
builder.append("<td>"+Util.escape(tc.getFullExternalId())+"</td>");
builder.append("<td>"+escape(tc.getVersion())+"</td>");
builder.append("<td>"+tc.getVersion()+"</td>");
builder.append("<td>"+Util.escape(tc.getName())+"</td>");
builder.append("<td>"+escape(tc.getTestProjectId())+"</td>");
builder.append("<td>"+tc.getTestProjectId()+"</td>");
builder.append("<td>"+TestLinkHelper.getExecutionStatusTextColored( tc.getExecutionStatus() )+"</td>\n");

builder.append("</tr>\n");
@@ -410,12 +410,6 @@ public static String createReportSummaryDetails(Report report, Report previous)
return builder.toString();
}

private static String escape(Integer integer) {
return integer != null ? Util.escape(integer.toString()) : "null" ;
}



/**
* Prints the difference between two int values, showing a plus sign if the
* current number is greater than the previous.

0 comments on commit 47efb72

Please sign in to comment.
You can’t perform that action at this time.