1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-07 13:41:08 +01:00

Cleanup Bytestream and Streamhost

remove unnecessary setPort() setter.
This commit is contained in:
Florian Schmaus 2014-08-19 19:22:08 +02:00
parent b468a29881
commit 62893376dd
6 changed files with 24 additions and 38 deletions

View file

@ -674,10 +674,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
continue outerloop;
}
}
StreamHost streamHost = new StreamHost(this.connection.getUser(),
address);
streamHost.setPort(port);
streamHosts.add(streamHost);
streamHosts.add(new StreamHost(connection.getUser(), address, port));
}
return streamHosts;
}

View file

@ -49,7 +49,6 @@ public class Bytestream extends IQ {
* The default constructor
*/
public Bytestream() {
super();
}
/**
@ -59,7 +58,6 @@ public class Bytestream extends IQ {
* @see #setSessionID(String)
*/
public Bytestream(final String SID) {
super();
setSessionID(SID);
}
@ -123,8 +121,7 @@ public class Bytestream extends IQ {
* @return The added stream host.
*/
public StreamHost addStreamHost(final String JID, final String address, final int port) {
StreamHost host = new StreamHost(JID, address);
host.setPort(port);
StreamHost host = new StreamHost(JID, address, port);
addStreamHost(host);
return host;
@ -276,7 +273,11 @@ public class Bytestream extends IQ {
private final String addy;
private int port = 0;
private final int port;
public StreamHost(String jid, String address) {
this(jid, address, 0);
}
/**
* Default constructor.
@ -284,9 +285,10 @@ public class Bytestream extends IQ {
* @param JID The JID of the stream host.
* @param address The internet address of the stream host.
*/
public StreamHost(final String JID, final String address) {
public StreamHost(final String JID, final String address, int port) {
this.JID = JID;
this.addy = address;
this.port = port;
}
/**
@ -307,15 +309,6 @@ public class Bytestream extends IQ {
return addy;
}
/**
* Sets the port of the stream host.
*
* @param port The port on which the potential stream host would accept the connection.
*/
public void setPort(final int port) {
this.port = port;
}
/**
* Returns the port on which the potential stream host would accept the connection.
*