[freenet-dev] [freenet-cvs] r16554 - trunk/freenet/src/freenet/node

Matthew Toseland toad at amphibian.dyndns.org
Sat Dec 15 15:03:18 UTC 2007


Why display the countReports() as a double? It's just a long, isn't it? 
There's no such thing as half a report!

On Friday 14 December 2007 23:53, robert at freenetproject.org wrote:
> Author: robert
> Date: 2007-12-14 23:53:36 +0000 (Fri, 14 Dec 2007)
> New Revision: 16554
> 
> Modified:
>    trunk/freenet/src/freenet/node/NodeStats.java
> Log:
> Divide-by-zero/NaN (or the like)
> 
> 
> Modified: trunk/freenet/src/freenet/node/NodeStats.java
> ===================================================================
> --- trunk/freenet/src/freenet/node/NodeStats.java	2007-12-14 23:39:56 UTC 
(rev 16553)
> +++ trunk/freenet/src/freenet/node/NodeStats.java	2007-12-14 23:53:36 UTC 
(rev 16554)
> @@ -1016,8 +1016,13 @@
>  		for(int i=0;i<averages.length;i++) {
>  			row = list.addChild("tr");
>  			row.addChild("td", names[i]);
> +			if (averages[i].countReports()==0) {
> +				row.addChild("td", "-");
> +				row.addChild("td", "0.0");
> +			} else {
>  			row.addChild("td", fix3p3pct.format(averages[i].currentValue()));
>  			row.addChild("td", Double.toString(averages[i].countReports()));
> +			}
>  		}
>  	}
>  	
> 
> _______________________________________________
> cvs mailing list
> cvs at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://emu.freenetproject.org/pipermail/devl/attachments/20071215/d5fb8e1a/attachment.pgp 


More information about the Devl mailing list