leif 2002/09/25 21:15:22
Modified: instrument/src/java/org/apache/excalibur/instrument
CounterInstrument.java
Log:
Move the validation of the count passed to increment(count) to the instrument
from the proxy so that problems will be discovered even if not connected to an
instrument manager.
Revision Changes Path
1.2 +6 -1
jakarta-avalon-excalibur/instrument/src/java/org/apache/excalibur/instrument/CounterInstrument.java
Index: CounterInstrument.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/instrument/src/java/org/apache/excalibur/instrument/CounterInstrument.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CounterInstrument.java 29 Jul 2002 16:05:19 -0000 1.1
+++ CounterInstrument.java 26 Sep 2002 04:15:22 -0000 1.2
@@ -60,6 +60,11 @@
*/
public void increment( int count )
{
+ // Check the count
+ if ( count <= 0 ) {
+ throw new IllegalArgumentException( "Count must be a positive value." );
+ }
+
InstrumentProxy proxy = getInstrumentProxy();
if( proxy != null )
{
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>