MER-C/wiki-java

java.lang.NumberFormatException error in getCurrentDatabaseLag()

michal-josef-spacek opened this issue · 2 comments

Hi,

There is issue in method getCurrentDatabaseLag() with bad converting lag to Integer.
Example:
/w/api.php?action=query&format=json&meta=siteinfo&siprop=dbrepllag
Response:
{ "batchcomplete": "", "query": { "dbrepllag": [ { "host": "db1112", "lag": 0.471904993057251 } ] } }

lag is 0.471904993057251 and Integer.parseInt(lag) will fail on this.

Fix is something like:
String s = "0.01";
int i = Double.valueOf(s).intValue();

MER-C commented

Fixed in 4e9d3b0.

Thank you, very much :-)