Author: sebb
Date: Sat Apr  4 21:50:18 2009
New Revision: 762020

URL: http://svn.apache.org/viewvc?rev=762020&view=rev
Log:
Catch specific exception only

Modified:
    
commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java

Modified: 
commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
URL: 
http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java?rev=762020&r1=762019&r2=762020&view=diff
==============================================================================
--- 
commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
 (original)
+++ 
commons/proper/net/branches/NET_2_0/src/test/java/org/apache/commons/net/SubnetUtilsTest.java
 Sat Apr  4 21:50:18 2009
@@ -51,7 +51,7 @@
         SubnetUtils utils = new SubnetUtils("192.168.0.1/29");
         SubnetInfo info = utils.getInfo();
         assertTrue(info.isInRange("192.168.0.1"));
-        // We dont count the broadcast address as usable
+        // We don't count the broadcast address as usable
         assertFalse(info.isInRange("192.168.0.7"));
         assertFalse(info.isInRange("192.168.0.8"));
         assertFalse(info.isInRange("10.10.2.1"));
@@ -61,11 +61,11 @@
     
     public void testZeroNetmaskBits() {
        try {
-               SubnetUtils utils = new SubnetUtils("192.168.0.1/0");
-               assertTrue("/0 should be an invalid mask", false);
+               @SuppressWarnings("unused")
+            SubnetUtils utils = new SubnetUtils("192.168.0.1/0");
+               fail("Mask /0 should have generated an 
IllegalArgumentException");
        }
-       catch (Exception e) {
-               ;
+       catch (IllegalArgumentException expected) {
        }
     }
 }


Reply via email to