1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-18 17:01:08 +01:00

Fix minor codestyle issues

This commit is contained in:
Paul Schaub 2017-12-13 23:10:11 +01:00 committed by Florian Schmaus
parent 200f90ffdc
commit cb18056613
422 changed files with 1404 additions and 1444 deletions

View file

@ -112,7 +112,7 @@ public class MultipleRecipientManager {
connection.sendStanza(packet);
return;
}
DomainBareJid serviceAddress = getMultipleRecipienServiceAddress(connection);
DomainBareJid serviceAddress = getMultipleRecipientServiceAddress(connection);
if (serviceAddress != null) {
// Send packet to target users using multiple recipient service provided by the server
sendThroughService(connection, packet, to, cc, bcc, replyTo, replyRoom, noReply,
@ -133,8 +133,8 @@ public class MultipleRecipientManager {
/**
* Sends a reply to a previously received stanza(/packet) that was sent to multiple recipients. Before
* attempting to send the reply message some checkings are performed. If any of those checkings
* fail then an XMPPException is going to be thrown with the specific error detail.
* attempting to send the reply message some checks are performed. If any of those checks
* fails, then an XMPPException is going to be thrown with the specific error detail.
*
* @param connection the connection to use to send the reply.
* @param original the previously received stanza(/packet) that was sent to multiple recipients.
@ -201,8 +201,7 @@ public class MultipleRecipientManager {
* if none was found.
*/
public static MultipleRecipientInfo getMultipleRecipientInfo(Stanza packet) {
MultipleAddresses extension = (MultipleAddresses) packet
.getExtension(MultipleAddresses.ELEMENT, MultipleAddresses.NAMESPACE);
MultipleAddresses extension = packet.getExtension(MultipleAddresses.ELEMENT, MultipleAddresses.NAMESPACE);
return extension == null ? null : new MultipleRecipientInfo(extension);
}
@ -283,7 +282,7 @@ public class MultipleRecipientManager {
* @throws NotConnectedException
* @throws InterruptedException
*/
private static DomainBareJid getMultipleRecipienServiceAddress(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
private static DomainBareJid getMultipleRecipientServiceAddress(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
return sdm.findService(MultipleAddresses.NAMESPACE, true);
}
@ -296,7 +295,7 @@ public class MultipleRecipientManager {
*/
private static class PacketCopy extends Stanza {
private CharSequence text;
private final CharSequence text;
/**
* Create a copy of a stanza(/packet) with the text to send. The passed text must be a valid text to

View file

@ -53,7 +53,7 @@ public class MultipleAddresses implements ExtensionElement {
ofrom,
}
private List<Address> addresses = new ArrayList<Address>();
private final List<Address> addresses = new ArrayList<>();
/**
* Adds a new address to which the stanza(/packet) is going to be sent or was sent.
@ -68,7 +68,7 @@ public class MultipleAddresses implements ExtensionElement {
*/
public void addAddress(Type type, Jid jid, String node, String desc, boolean delivered,
String uri) {
// Create a new address with the specificed configuration
// Create a new address with the specified configuration
Address address = new Address(type);
address.setJid(jid);
address.setNode(node);
@ -83,7 +83,7 @@ public class MultipleAddresses implements ExtensionElement {
* Indicate that the stanza(/packet) being sent should not be replied.
*/
public void setNoReply() {
// Create a new address with the specificed configuration
// Create a new address with the specified configuration
Address address = new Address(Type.noreply);
// Add the new address to the list of multiple recipients
addresses.add(address);
@ -97,7 +97,7 @@ public class MultipleAddresses implements ExtensionElement {
* @return the list of addresses that matches the specified type.
*/
public List<Address> getAddressesOfType(Type type) {
List<Address> answer = new ArrayList<Address>(addresses.size());
List<Address> answer = new ArrayList<>(addresses.size());
for (Address address : addresses) {
if (address.getType().equals(type)) {
answer.add(address);