diff --git a/router/java/src/org/cybergarage/net/HostInterface.java b/router/java/src/org/cybergarage/net/HostInterface.java index c82b6b6ad..8a909016d 100644 --- a/router/java/src/org/cybergarage/net/HostInterface.java +++ b/router/java/src/org/cybergarage/net/HostInterface.java @@ -100,12 +100,12 @@ public class HostInterface int nHostAddrs = 0; try { - Enumeration nis = NetworkInterface.getNetworkInterfaces(); + Enumeration nis = NetworkInterface.getNetworkInterfaces(); while (nis.hasMoreElements()){ - NetworkInterface ni = (NetworkInterface)nis.nextElement(); - Enumeration addrs = ni.getInetAddresses(); + NetworkInterface ni = nis.nextElement(); + Enumeration addrs = ni.getInetAddresses(); while (addrs.hasMoreElements()) { - InetAddress addr = (InetAddress)addrs.nextElement(); + InetAddress addr = addrs.nextElement(); if (isUsableAddress(addr) == false) continue; nHostAddrs++; @@ -126,9 +126,9 @@ public class HostInterface * @since 1.8.0 */ public final static InetAddress[] getInetAddress(int ipfilter,String[] interfaces){ - Enumeration nis; + Enumeration nis; if(interfaces!=null){ - Vector iflist = new Vector(); + Vector iflist = new Vector(); for (int i = 0; i < interfaces.length; i++) { NetworkInterface ni; try { @@ -147,12 +147,12 @@ public class HostInterface return null; } } - ArrayList addresses = new ArrayList(); + ArrayList addresses = new ArrayList(); while (nis.hasMoreElements()){ - NetworkInterface ni = (NetworkInterface)nis.nextElement(); - Enumeration addrs = ni.getInetAddresses(); + NetworkInterface ni = nis.nextElement(); + Enumeration addrs = ni.getInetAddresses(); while (addrs.hasMoreElements()) { - InetAddress addr = (InetAddress)addrs.nextElement(); + InetAddress addr = addrs.nextElement(); if(((ipfilter & LOCAL_BITMASK)==0) && addr.isLoopbackAddress()) continue; @@ -163,7 +163,7 @@ public class HostInterface } } } - return (InetAddress[]) addresses.toArray(new InetAddress[]{}); + return addresses.toArray(new InetAddress[]{}); } @@ -174,12 +174,12 @@ public class HostInterface int hostAddrCnt = 0; try { - Enumeration nis = NetworkInterface.getNetworkInterfaces(); + Enumeration nis = NetworkInterface.getNetworkInterfaces(); while (nis.hasMoreElements()){ - NetworkInterface ni = (NetworkInterface)nis.nextElement(); - Enumeration addrs = ni.getInetAddresses(); + NetworkInterface ni = nis.nextElement(); + Enumeration addrs = ni.getInetAddresses(); while (addrs.hasMoreElements()) { - InetAddress addr = (InetAddress)addrs.nextElement(); + InetAddress addr = addrs.nextElement(); if (isUsableAddress(addr) == false) continue; if (hostAddrCnt < n) { diff --git a/router/java/src/org/cybergarage/upnp/Action.java b/router/java/src/org/cybergarage/upnp/Action.java index 1384608de..a4a4bc782 100644 --- a/router/java/src/org/cybergarage/upnp/Action.java +++ b/router/java/src/org/cybergarage/upnp/Action.java @@ -67,9 +67,9 @@ public class Action void setService(Service s){ serviceNode=s.getServiceNode(); /*To ensure integrity of the XML structure*/ - Iterator i = getArgumentList().iterator(); + Iterator i = getArgumentList().iterator(); while (i.hasNext()) { - Argument arg = (Argument) i.next(); + Argument arg = i.next(); arg.setService(s); } } @@ -170,9 +170,9 @@ public class Action }else{ argumentListNode.removeAllNodes(); } - Iterator i = al.iterator(); + Iterator i = al.iterator(); while (i.hasNext()) { - Argument a = (Argument) i.next(); + Argument a = i.next(); a.setService(getService()); argumentListNode.addNode(a.getArgumentNode()); } diff --git a/router/java/src/org/cybergarage/upnp/ActionList.java b/router/java/src/org/cybergarage/upnp/ActionList.java index f18130c46..ad273a21b 100644 --- a/router/java/src/org/cybergarage/upnp/ActionList.java +++ b/router/java/src/org/cybergarage/upnp/ActionList.java @@ -17,7 +17,7 @@ package org.cybergarage.upnp; import java.util.Vector; -public class ActionList extends Vector +public class ActionList extends Vector { //////////////////////////////////////////////// // Constants diff --git a/router/java/src/org/cybergarage/upnp/AllowedValueList.java b/router/java/src/org/cybergarage/upnp/AllowedValueList.java index a0b0b3131..851b9d5ff 100644 --- a/router/java/src/org/cybergarage/upnp/AllowedValueList.java +++ b/router/java/src/org/cybergarage/upnp/AllowedValueList.java @@ -20,7 +20,7 @@ package org.cybergarage.upnp; import java.util.Iterator; import java.util.Vector; -public class AllowedValueList extends Vector +public class AllowedValueList extends Vector { //////////////////////////////////////////////// // Constants @@ -55,8 +55,8 @@ public class AllowedValueList extends Vector } public boolean isAllowed(String v){ - for (Iterator i = this.iterator(); i.hasNext();) { - AllowedValue av = (AllowedValue) i.next(); + for (Iterator i = this.iterator(); i.hasNext();) { + AllowedValue av = i.next(); if(av.getValue().equals(v)) return true; } diff --git a/router/java/src/org/cybergarage/upnp/ArgumentList.java b/router/java/src/org/cybergarage/upnp/ArgumentList.java index 3f1a5ec44..c1251962d 100644 --- a/router/java/src/org/cybergarage/upnp/ArgumentList.java +++ b/router/java/src/org/cybergarage/upnp/ArgumentList.java @@ -17,7 +17,7 @@ package org.cybergarage.upnp; import java.util.Vector; -public class ArgumentList extends Vector +public class ArgumentList extends Vector { //////////////////////////////////////////////// // Constants diff --git a/router/java/src/org/cybergarage/upnp/DeviceList.java b/router/java/src/org/cybergarage/upnp/DeviceList.java index afa23ffc9..bce9a26eb 100644 --- a/router/java/src/org/cybergarage/upnp/DeviceList.java +++ b/router/java/src/org/cybergarage/upnp/DeviceList.java @@ -17,7 +17,7 @@ package org.cybergarage.upnp; import java.util.Vector; -public class DeviceList extends Vector +public class DeviceList extends Vector { //////////////////////////////////////////////// // Constants diff --git a/router/java/src/org/cybergarage/upnp/IconList.java b/router/java/src/org/cybergarage/upnp/IconList.java index a78f810cc..44082f07b 100644 --- a/router/java/src/org/cybergarage/upnp/IconList.java +++ b/router/java/src/org/cybergarage/upnp/IconList.java @@ -17,7 +17,7 @@ package org.cybergarage.upnp; import java.util.Vector; -public class IconList extends Vector +public class IconList extends Vector { //////////////////////////////////////////////// // Constants diff --git a/router/java/src/org/cybergarage/upnp/Service.java b/router/java/src/org/cybergarage/upnp/Service.java index e6d18882c..59c5d3848 100644 --- a/router/java/src/org/cybergarage/upnp/Service.java +++ b/router/java/src/org/cybergarage/upnp/Service.java @@ -501,9 +501,9 @@ public class Service } public void addAction(Action a){ - Iterator i = a.getArgumentList().iterator(); + Iterator i = a.getArgumentList().iterator(); while (i.hasNext()) { - Argument arg = (Argument) i.next(); + Argument arg = i.next(); arg.setService(this); } diff --git a/router/java/src/org/cybergarage/upnp/ServiceList.java b/router/java/src/org/cybergarage/upnp/ServiceList.java index 55dee276f..e0d6b63bf 100644 --- a/router/java/src/org/cybergarage/upnp/ServiceList.java +++ b/router/java/src/org/cybergarage/upnp/ServiceList.java @@ -19,7 +19,7 @@ package org.cybergarage.upnp; import java.util.Vector; -public class ServiceList extends Vector +public class ServiceList extends Vector { //////////////////////////////////////////////// // Constants diff --git a/router/java/src/org/cybergarage/upnp/ServiceStateTable.java b/router/java/src/org/cybergarage/upnp/ServiceStateTable.java index daddfbf86..b7e15ea21 100644 --- a/router/java/src/org/cybergarage/upnp/ServiceStateTable.java +++ b/router/java/src/org/cybergarage/upnp/ServiceStateTable.java @@ -17,7 +17,7 @@ package org.cybergarage.upnp; import java.util.Vector; -public class ServiceStateTable extends Vector +public class ServiceStateTable extends Vector { //////////////////////////////////////////////// // Constants diff --git a/router/java/src/org/cybergarage/upnp/StateVariable.java b/router/java/src/org/cybergarage/upnp/StateVariable.java index f58acabb3..0c54a3220 100644 --- a/router/java/src/org/cybergarage/upnp/StateVariable.java +++ b/router/java/src/org/cybergarage/upnp/StateVariable.java @@ -277,9 +277,9 @@ public class StateVariable extends NodeData getStateVariableNode().removeNode(AllowedValueList.ELEM_NAME); getStateVariableNode().removeNode(AllowedValueRange.ELEM_NAME); Node n = new Node(AllowedValueList.ELEM_NAME); - Iterator i=avl.iterator(); + Iterator i=avl.iterator(); while (i.hasNext()) { - AllowedValue av = (AllowedValue) i.next(); + AllowedValue av = i.next(); //n.addNode(new Node(AllowedValue.ELEM_NAME,av.getValue())); wrong! n.addNode(av.getAllowedValueNode()); //better (twa) } diff --git a/router/java/src/org/cybergarage/upnp/event/SubscriberList.java b/router/java/src/org/cybergarage/upnp/event/SubscriberList.java index 63bfdb786..3bb32b391 100644 --- a/router/java/src/org/cybergarage/upnp/event/SubscriberList.java +++ b/router/java/src/org/cybergarage/upnp/event/SubscriberList.java @@ -19,7 +19,7 @@ package org.cybergarage.upnp.event; import java.util.*; -public class SubscriberList extends Vector +public class SubscriberList extends Vector { //////////////////////////////////////////////// // Constructor diff --git a/router/java/src/org/cybergarage/upnp/ssdp/HTTPMUSocket.java b/router/java/src/org/cybergarage/upnp/ssdp/HTTPMUSocket.java index 57c60d009..93e802097 100644 --- a/router/java/src/org/cybergarage/upnp/ssdp/HTTPMUSocket.java +++ b/router/java/src/org/cybergarage/upnp/ssdp/HTTPMUSocket.java @@ -83,9 +83,9 @@ public class HTTPMUSocket if (ssdpMultiGroup == null || ssdpMultiIf == null) return ""; InetAddress mcastAddr = ssdpMultiGroup.getAddress(); - Enumeration addrs = ssdpMultiIf.getInetAddresses(); + Enumeration addrs = ssdpMultiIf.getInetAddresses(); while (addrs.hasMoreElements()) { - InetAddress addr = (InetAddress)addrs.nextElement(); + InetAddress addr = addrs.nextElement(); if (mcastAddr instanceof Inet6Address && addr instanceof Inet6Address) return addr.getHostAddress(); if (mcastAddr instanceof Inet4Address && addr instanceof Inet4Address) diff --git a/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocket.java b/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocket.java index 9d90ed9a5..104cbf8c6 100644 --- a/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocket.java +++ b/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocket.java @@ -33,7 +33,6 @@ import java.net.*; import java.io.IOException; import org.cybergarage.net.*; -import org.cybergarage.util.*; import org.cybergarage.http.*; import org.cybergarage.upnp.*; import org.cybergarage.util.Debug; diff --git a/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocketList.java b/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocketList.java index 64a264965..491466efe 100644 --- a/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocketList.java +++ b/router/java/src/org/cybergarage/upnp/ssdp/SSDPNotifySocketList.java @@ -22,7 +22,7 @@ import org.cybergarage.net.*; import org.cybergarage.upnp.*; -public class SSDPNotifySocketList extends Vector +public class SSDPNotifySocketList extends Vector { //////////////////////////////////////////////// // Constructor diff --git a/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchResponseSocketList.java b/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchResponseSocketList.java index 077c63c23..06c1986c7 100644 --- a/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchResponseSocketList.java +++ b/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchResponseSocketList.java @@ -24,7 +24,7 @@ import org.cybergarage.net.*; import org.cybergarage.upnp.*; -public class SSDPSearchResponseSocketList extends Vector +public class SSDPSearchResponseSocketList extends Vector { //////////////////////////////////////////////// // Constructor diff --git a/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchSocketList.java b/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchSocketList.java index 185bb15fc..f19bca3b8 100644 --- a/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchSocketList.java +++ b/router/java/src/org/cybergarage/upnp/ssdp/SSDPSearchSocketList.java @@ -24,7 +24,7 @@ import java.util.Vector; import org.cybergarage.net.HostInterface; import org.cybergarage.upnp.device.SearchListener; -public class SSDPSearchSocketList extends Vector +public class SSDPSearchSocketList extends Vector { //////////////////////////////////////////////// // Constructor diff --git a/router/java/src/org/cybergarage/util/ListenerList.java b/router/java/src/org/cybergarage/util/ListenerList.java index 19f5901a1..7bcae9f2f 100644 --- a/router/java/src/org/cybergarage/util/ListenerList.java +++ b/router/java/src/org/cybergarage/util/ListenerList.java @@ -17,7 +17,7 @@ package org.cybergarage.util; import java.util.Vector; -public class ListenerList extends Vector +public class ListenerList extends Vector { public boolean add(Object obj) { diff --git a/router/java/src/org/cybergarage/xml/AttributeList.java b/router/java/src/org/cybergarage/xml/AttributeList.java index 7a0e67091..0a52ab8d3 100644 --- a/router/java/src/org/cybergarage/xml/AttributeList.java +++ b/router/java/src/org/cybergarage/xml/AttributeList.java @@ -17,7 +17,7 @@ package org.cybergarage.xml; import java.util.Vector; -public class AttributeList extends Vector +public class AttributeList extends Vector { public AttributeList() { diff --git a/router/java/src/org/cybergarage/xml/Node.java b/router/java/src/org/cybergarage/xml/Node.java index 7e34a084f..8ed52ec61 100644 --- a/router/java/src/org/cybergarage/xml/Node.java +++ b/router/java/src/org/cybergarage/xml/Node.java @@ -275,9 +275,9 @@ public class Node public int getIndex(String name){ int index = -1; - for (Iterator i = nodeList.iterator(); i.hasNext();) { + for (Iterator i = nodeList.iterator(); i.hasNext();) { index++; - Node n = (Node) i.next(); + Node n = i.next(); if(n.getName().equals(name)) return index; } diff --git a/router/java/src/org/cybergarage/xml/NodeList.java b/router/java/src/org/cybergarage/xml/NodeList.java index 806b6f22c..1a0deb81c 100644 --- a/router/java/src/org/cybergarage/xml/NodeList.java +++ b/router/java/src/org/cybergarage/xml/NodeList.java @@ -17,7 +17,7 @@ package org.cybergarage.xml; import java.util.Vector; -public class NodeList extends Vector +public class NodeList extends Vector { public NodeList() {