Author: bleny Date: 2011-12-13 10:53:59 +0100 (Tue, 13 Dec 2011) New Revision: 160 Url: http://nuiton.org/repositories/revision/nuiton-web/160 Log: proper use of exception in RequestStatistics with javadoc Modified: trunk/nuiton-web/src/main/java/org/nuiton/web/jmx/RequestStatistics.java Modified: trunk/nuiton-web/src/main/java/org/nuiton/web/jmx/RequestStatistics.java =================================================================== --- trunk/nuiton-web/src/main/java/org/nuiton/web/jmx/RequestStatistics.java 2011-12-12 16:48:26 UTC (rev 159) +++ trunk/nuiton-web/src/main/java/org/nuiton/web/jmx/RequestStatistics.java 2011-12-13 09:53:59 UTC (rev 160) @@ -80,11 +80,13 @@ * * @param start the time (in ms), when the request was queried by the user * @param stop the time (in ms), the request processing ended + * @throws IllegalArgumentException if given times implies that stop time is + * not after start */ public void count(long start, long stop) { long elapsed = stop - start; if (elapsed < 0) { - throw new IllegalStateException("a request can't be processed in less than 0 ms"); + throw new IllegalArgumentException("a request can't be processed in less than 0 ms"); } count += 1; elapsedSum += elapsed;