[mod_cluster-commits] mod_cluster SVN: r790 - trunk/core/src/main/java/org/jboss/modcluster/config/impl.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Apr 5 13:36:54 EDT 2012


Author: pferraro
Date: 2012-04-05 13:36:54 -0400 (Thu, 05 Apr 2012)
New Revision: 790

Modified:
   trunk/core/src/main/java/org/jboss/modcluster/config/impl/ModClusterConfig.java
Log:
Don't introduce new exceptions in deprecated methods.

Modified: trunk/core/src/main/java/org/jboss/modcluster/config/impl/ModClusterConfig.java
===================================================================
--- trunk/core/src/main/java/org/jboss/modcluster/config/impl/ModClusterConfig.java	2012-04-05 13:57:30 UTC (rev 789)
+++ trunk/core/src/main/java/org/jboss/modcluster/config/impl/ModClusterConfig.java	2012-04-05 17:36:54 UTC (rev 790)
@@ -83,8 +83,12 @@
     }
 
     @Deprecated
-    public void setAdvertiseGroupAddress(String advertiseGroupAddress) throws UnknownHostException {
-        this.setAdvertiseGroupAddress(InetAddress.getByName(advertiseGroupAddress));
+    public void setAdvertiseGroupAddress(String advertiseGroupAddress) {
+        try {
+            this.setAdvertiseGroupAddress(InetAddress.getByName(advertiseGroupAddress));
+        } catch (UnknownHostException e) {
+            throw new IllegalArgumentException(e);
+        }
     }
 
     @Deprecated
@@ -108,8 +112,12 @@
         this.advertiseInterface = advertiseInterface;
     }
 
-    public void setAdvertiseInterface(String advertiseInterface) throws UnknownHostException {
-        this.setAdvertiseInterface(InetAddress.getByName(advertiseInterface));
+    public void setAdvertiseInterface(String advertiseInterface) {
+        try {
+            this.setAdvertiseInterface(InetAddress.getByName(advertiseInterface));
+        } catch (UnknownHostException e) {
+            throw new IllegalArgumentException(e);
+        }
     }
 
     private String advertiseSecurityKey = null;
@@ -146,7 +154,7 @@
     }
 
     @Deprecated
-    public void setProxyList(String addresses) throws UnknownHostException {
+    public void setProxyList(String addresses) {
         if ((addresses == null) || (addresses.length() == 0)) {
             this.proxies = Collections.emptySet();
         } else {
@@ -154,7 +162,11 @@
             this.proxies = new ArrayList<InetSocketAddress>(tokens.length);
 
             for (String token: tokens) {
-                this.proxies.add(Utils.parseSocketAddress(token.trim(), ModClusterService.DEFAULT_PORT));
+                try {
+                    this.proxies.add(Utils.parseSocketAddress(token.trim(), ModClusterService.DEFAULT_PORT));
+                } catch (UnknownHostException e) {
+                    throw new IllegalArgumentException(e);
+                }
             }
         }
     }



More information about the mod_cluster-commits mailing list