JENKINS-20646 Summary is missing for the first build

- The build summary was displayed only if both current and previous reports were not null. Only current report should be tested at top-level, test of previous report is relevant only while processing the differences.
- Hardcoded "in" string on summary page added to localication Messages (English only).

- Create a new project.
- Process a first build.
- Show its summary.
- Verify the summary contains valid text.
- Process a second build.
- Show its summary.
- Verify the summary contains valid text.
- All tests passed.
[JENKINS-4769] Memory consumption is huge

- New data format introduced, it should be backward compatible.
- Only statistics per language are stored in the publisher.
- The legacy structures are still stored too but with no data (they are null). This is to be able to load the legacy data that were stored using old version of the plugin.
- The report data can loaded from the original files after they are needed.
- Trend graph updated to use the new language statistics.
- Report summary updated to use the new language statistics.
- The plugin now consumes much less memory and is much faster most of the time.
- Only statistics are used during results publication at build time, displaying trend graph and displaying report summary. Only small statistics are deserialized.
- Complete report is loaded only when report details page is displayed.
[JENKINS-21174] Broken link in menu on the job page before the first build

- If a job is created and no build exists yet, clicking on the link in the menu will redirect the user to an empty page.
- Fixed to redirect the user to the previously displayed job page in such case.
- A new page with an info message would be better, but this is much simpler and good enough for such corner case.
[JENKINS-4769] Memory consumption is huge

- Report is cached at report details pages.
Developer list in pom.xml updated

- Michal Turek added.
[JENKINS-17024] The SLOCCOUNT analysis Results not available in IVY builds

- SloccountDescriptor.isApplicable() doesn't consider IVY plugin. The method updated to just return true the same as other similar "publisher" plugins (e.g. Warnings).
- Dependency to Maven plugin can be removed from pom.xml, isApplicable() was the only place where it was referenced.
- Dependency to FindBugs plugin can be removed, it is nowhere referenced. There are "Remainings from the findbugs plugin have been removed" commits in Git log, this dependency was probably forgotten.
- The update was NOT fully tested since I have no IVY project. The only thing i tried is that SLOCCount publisher now appears in configuration of IVY job.
[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.
[JENKINS-21223] Broken differences in build summary for failed builds

- Publishing the SLOCCount report will be skipped if the build fails, no data are stored for it and no data are displayed in build summary.
- SloccountBuildAction.getPreviousAction() updated to search an action with valid data in a loop through previous builds. Builds that failed are skipped since they contain no data.
- Unused imports removed.
[JENKINS-14504] sloccount churn graph

- Trend graph with values computed as delta between builds N and N-1 implemented.
- SLOCCount plugin now displays two graphs: absolute and delta.
- Indentation fixed.
[JENKINS-21229] Possible resource leak in parser

- If an exception occurs before the stream is closed there will be a resource leak since close() won't be called.
- Solved using try-finally pattern.
- Indentation fixed.
[JENKINS-21230] Broken HTML code on results page

- Element <tfoot> should not be inside <tbody>, optional <thead> is missing.
- <tfoot> moved from <tbody> directly to <table>.
- <thead> element added.
- Total number of lines in the footer extended by total number of files and total number of folders.
- Total number of languages can't be added because sorting using this column would stop working. String sorting is probably incorrectly changed to numeric sorting in such case.
[JENKINS-14504] sloccount churn graph

- Plugin version 1.10 and less stored empty data set to build.xml even for builds that failed. This causes unwanted high peaks in trend with deltas.
- Builds with no data are excluded to fix the issue.
- Indentation fixed.
- Example of legacy build.xml data:

    <hudson.plugins.sloccount.SloccountBuildAction plugin="sloccount@1.10">
      <build class="build" reference="../../.."/>
      <result>
        <report>
          <files class="linked-hash-map"/>
          <lineCount>0</lineCount>
          <folders class="linked-hash-map"/>
          <languages class="linked-hash-map"/>
        </report>
        <owner class="build" reference="../../../.."/>
      </result>
    </hudson.plugins.sloccount.SloccountBuildAction>
[JENKINS-21258] Graphical artefacts in the trend graphs

- If a language newly appears/disappears in/from SLOCCount report the trend graphs will contain graphical artifacts. The issue is visible mainly in the delta trend but it is (and always was) present in the absolute one too. The code doesn't consider that currently processed build may contain different languages than the previous and next ones.
- The issue fixed by adding zero or negative lines count for all known languages that are not present in the particular build but may be present in the previous or next ones.
Code refactoring and cleanup

- SloccountReportStatistics class created to wrap List<SloccountLanguageStatistics> and related methods.
- serialVersionUID added to all serializable classes to solve compiler warnings.
- SloccountProjectAction.hasValidResults() simplified.
- Possible NPE in SloccountResult.lazyLoad() fixed.
- Indentation fixed.
Code refactoring and cleanup

- simplifyNames() was never called on lazy loaded data, regression fixed.
- addSourceFile() and simplifyNames() removed from SloccountReportInterface, it isn't needed in the interface.
Merge pull request #23 from mixalturek/master

Bug fixes, new features