statistics: Fix NPE in Html tree creation

It has been noted that the statistics module fails to produce the top level html and to run the collection cron correctly.  In the first case, one sees an error such as the first reported below.  In the second, a different error occurs.  These two errors, however, appear to be related.

As the code currently stands, the "count" array used in several methods remains uninitialized until inside the subsequent loop.  However, initialization is not loop-invariant, as those loops may fail to run under certain conditions, in particular when the list of statistics files is empty.

This patch provides the appropriate pre-loop initialization of the array.

Note that this class has a number of dead variables and methods.  I did not eliminate them, however, as it occurs to me that one might wish to do a bit more cleanup and "modernize" this code.  I leave this to another patch.

Target: master
Request: 2.6
Request: 2.2
Require-notes: yes
Require-book: no
Ticket: http://rt.dcache.org/Ticket/Display.html?id=785
Bug: http://rt.dcache.org/Ticket/Display.html?id=785
Acked-by: Gerd

Testing done:

Before this patch, one observes the following.

1.  Using the admin command create html, one sees:

Exception in creating html tree for : /var/lib/dcache/billing/2013/06/05/2013-06-05-13.raw
java.lang.NullPointerException: null
at diskCacheV111.services.PoolStatisticsV0.printTotal(PoolStatisticsV0.java:1204) ~[dcache-core-2.6.1.jar:2.6.1]
at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtml(PoolStatisticsV0.java:1136) ~[dcache-core-2.6.1.jar:2.6.1]
at diskCacheV111.services.PoolStatisticsV0.prepareDailyHtmlFiles(PoolStatisticsV0.java:1041) ~[dcache-core-2.6.1.jar:2.6.1]
at diskCacheV111.services.PoolStatisticsV0.access$1100(PoolStatisticsV0.java:116) ~[dcache-core-2.6.1.jar:2.6.1]
at diskCacheV111.services.PoolStatisticsV0$HourlyRunner.run(PoolStatisticsV0.java:432) ~[dcache-core-2.6.1.jar:2.6.1]
at dmg.cells.nucleus.CellNucleus$1.run(CellNucleus.java:657) [cells-2.6.1.jar:2.6.1]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_09]

2.  Using the admin command create stat, one sees:

at diskCacheV111.services.PoolStatisticsV0.getPoolRepositoryStatistics(PoolStatisticsV0.java:1361) ~[dcache-core-2.6.6-SNAPSHOT.jar:2.6.6-SNAPSHOT]
at diskCacheV111.services.PoolStatisticsV0.createStatisticsMap(PoolStatisticsV0.java:838) ~[dcache-core-2.6.6-SNAPSHOT.jar:2.6.6-SNAPSHOT]
at diskCacheV111.services.PoolStatisticsV0.createHourlyRawFile(PoolStatisticsV0.java:973) ~[dcache-core-2.6.6-SNAPSHOT.jar:2.6.6-SNAPSHOT]
at diskCacheV111.services.PoolStatisticsV0.access$500(PoolStatisticsV0.java:116) ~[dcache-core-2.6.6-SNAPSHOT.jar:2.6.6-SNAPSHOT]
at diskCacheV111.services.PoolStatisticsV0 $HourlyRunner.run(PoolStatisticsV0.java:400) ~[dcache-core-2.6.6-SNAPSHOT.jar:2.6.6-SNAPSHOT]
at dmg.cells.nucleus.CellNucleus$1.run(CellNucleus.java:657) [cells-2.6.6-SNAPSHOT.jar:2.6.6-SNAPSHOT]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0]
15 Jul 2013 15:57:08 (PoolStatistics) [] prepareDailyHtmlFiles : File not found : /var/lib/dcache/statistics/2013/07/15/2013-07-15-day.drw

After the patch is applied, both of these commands work again, and the top index.html is produced.

RELEASE NOTES:

Fixes NullPointer bug which prevents under certain conditions top-level index.html from being created (and the statistics page being found in the browser).
chimera: Implement set-gid bit on directories

Target: trunk
Require-book: yes
Require-notes: yes
Ticket: http://rt.dcache.org/Ticket/Display.html?id=7840
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5769/
pool: Manage periodic health check through Spring

Minor refactoring prior to adding new features to the periodic
health check.

Note that the output of the 'info' command of a pool has changed
as it no longer shows the 'Check Repository  : true' line.

Target: trunk
Require-notes: no
Require-book: yes
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: http://rb.dcache.org/r/5772/
hsqldb: (billing) comply with new configuration policy

Updates hsqldb.properties to match billing.properties

Testing done:

Tested dcache database ls with billingToDb on and off.
Ran dcache and checked logs.
Inspected var/plots for plots.

Target: master
Patch: http://rb.dcache.org/r/5780/
Require-book: no
Require-notes: no
Acked-by: Paul
system-test: Do not use deprecated billing property

Acked-by: Karsten Schwank <karsten.schwank@desy.de>
Patch: http://rb.dcache.org/r/5787/
Target: trunk
Require-notes: no
Require-book: no
Squashed commit of the following:

commit b6faa1aa898dc62854696d6719ca61a8cea8d6f9
Author: Dmitry Litvintsev <litvinse@fnal.gov>
Date:   Tue Jul 23 13:26:40 2013 -0500

    srm: fixed a left over from srm in transfermanagers.batch

    what happened

    Ticket: #number
    Acked-by:
    Target: trunk
    Require-book: no
    Require-notes: no

commit 9b6bfd5898543adde2503eb85f83e38d4c3eec38
Author: Dmitry Litvintsev <litvinse@fnal.gov>
Date:   Tue Jul 23 13:11:54 2013 -0500

    srm: adapt to new naming convention

    what happened

    Ticket: #number
    Acked-by:
    Target: trunk
    Require-book: no
    Require-notes: no

commit 9b82f2e5eb26dc2051a6ab9312cd13a2e5ecf140
Author: Dmitry Litvintsev <litvinse@fnal.gov>
Date:   Fri Jul 19 19:46:47 2013 -0500

    srm: new property policy

    what happened

    Ticket: #number
    Acked-by:
    Target: trunk
    Require-book: no
    Require-notes: no

commit 65d6daf918500a0504c46799456ef1fbef7a3333
Author: Dmitry Litvintsev <litvinse@fnal.gov>
Date:   Thu Jul 18 22:31:39 2013 -0500

    srm: new propery policy

    what happened

    Ticket: #number
    Acked-by:
    Target: trunk
    Require-book: no
    Require-notes: no