freenet/fred-staging — pull request #227 by bertm (2014-05-22 09:31:58+00:00)
Title: NodeStats::nodeLoc is fixed to zero, yet still used in calculations

nodeLoc, as defined in /src/freenet/node/NodeStats.java#L99, has final value 0.0, which does of course not accurately represent the Node's location. To work around this, in the NodeStats constructor on L596 a new (local) nodeLoc is defined for the subsequent calculations.

Still, the global (final) nodeLoc is used in the calculation of the StoreLocationStats (for instance, L3297), particulary in the avgDist function. Due to this the average datastore distance statistic is always equal to the average datastore location.

I am not fully aware of the implications (there may be none, except for the Statistics page), but my guess is that this is wrong (since it introduces undocumented redundancy). This should be an easy fix.