1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-08 14:11:07 +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

@ -123,7 +123,7 @@ public class CarbonExtension implements ExtensionElement {
/**
* Defines the direction of a {@link CarbonExtension} message.
*/
public static enum Direction {
public enum Direction {
received,
sent
}

View file

@ -48,7 +48,7 @@ public class ExplicitMessageEncryptionElement implements ExtensionElement {
private final String namespace;
private final String name;
private ExplicitMessageEncryptionProtocol(String namespace, String name) {
ExplicitMessageEncryptionProtocol(String namespace, String name) {
this.namespace = namespace;
this.name = name;
PROTOCOL_LUT.put(namespace, this);

View file

@ -90,7 +90,7 @@ public abstract class AbstractHttpOverXmpp extends IQ {
/**
* A builder for XMPP connection configurations.
* <p>
* See ConnectionConfiguration Buidler for more details.
* See ConnectionConfiguration Builder for more details.
* </p>
*
* @param <B> the builder type parameter.

View file

@ -26,6 +26,6 @@ import org.jxmpp.jid.Jid;
public interface ThingControlRequest {
public void processRequest(Jid from, Collection<SetData> setData) throws XMPPErrorException;
void processRequest(Jid from, Collection<SetData> setData) throws XMPPErrorException;
}

View file

@ -29,7 +29,7 @@ public class IoTSetResponse extends IQ {
public IoTSetResponse(IoTSetRequest iotSetRequest) {
this();
initialzeAsResultFor(iotSetRequest);
initializeAsResultFor(iotSetRequest);
}
@Override

View file

@ -32,7 +32,7 @@ public abstract class SetData implements NamedElement {
private final String toStringCache;
private Type() {
Type() {
toStringCache = this.name().toLowerCase(Locale.US);
}

View file

@ -18,6 +18,6 @@ package org.jivesoftware.smackx.iot.data;
public interface ThingMomentaryReadOutRequest {
public void momentaryReadOutRequest(ThingMomentaryReadOutResult callback);
void momentaryReadOutRequest(ThingMomentaryReadOutResult callback);
}

View file

@ -22,6 +22,6 @@ import org.jivesoftware.smackx.iot.data.element.IoTDataField;
public interface ThingMomentaryReadOutResult {
public void momentaryReadOut(List<? extends IoTDataField> results);
void momentaryReadOut(List<? extends IoTDataField> results);
}

View file

@ -24,7 +24,7 @@ public class IoTDataRequest extends IQ {
public static final String NAMESPACE = Constants.IOT_SENSORDATA_NAMESPACE;
/**
* The sequence nummber. According to XEP-0323 an xs:int.
* The sequence number. According to XEP-0323 an xs:int.
*/
private final int seqNr;

View file

@ -20,6 +20,6 @@ import org.jxmpp.jid.BareJid;
public interface ThingStateChangeListener {
public void owned(BareJid owner);
void owned(BareJid owner);
}

View file

@ -25,7 +25,7 @@ public class Tag implements NamedElement {
public enum Type {
str,
num;
num
}
private final String name;

View file

@ -161,8 +161,8 @@ public final class IoTProvisioningManager extends Manager {
// Notify the recommended friend that we will now accept his
// friendship requests.
final XMPPConnection connection = connection();
Friend friendNotifiacation = new Friend(connection.getUser().asBareJid());
Message notificationMessage = new Message(friendJid, friendNotifiacation);
Friend friendNotification = new Friend(connection.getUser().asBareJid());
Message notificationMessage = new Message(friendJid, friendNotification);
connection.sendStanza(notificationMessage);
} else {
// Check is the message was send from a thing we previously
@ -236,7 +236,7 @@ public final class IoTProvisioningManager extends Manager {
}
catch (NoResponseException | XMPPErrorException | NotConnectedException | InterruptedException e) {
LOGGER.log(Level.WARNING,
"Could not determine privisioning server. Ignoring friend request from " + from, e);
"Could not determine provisioning server. Ignoring friend request from " + from, e);
}
if (provisioningServer == null) {
return null;
@ -420,7 +420,7 @@ public final class IoTProvisioningManager extends Manager {
if (!provisioningServer.equals(stanza.getFrom())) {
if (log) {
LOGGER.warning("Ignoring request '" + stanza
+ "' because not from provising server '" + provisioningServer
+ "' because not from provisioning server '" + provisioningServer
+ "'.");
}
return false;

View file

@ -239,11 +239,11 @@ public final class MamManager extends Manager {
/**
* Query an message archive like a MUC archive or a pubsub node archive, addressed by an archiveAddress, applying
* Query an message archive like a MUC archive or a PubSub node archive, addressed by an archiveAddress, applying
* filters: max count, start date, end date, from/to JID and with additional fields. When archiveAddress is null the
* default, the server will be requested.
*
* @param node The Pubsub node name, can be null
* @param node The PubSub node name, can be null
* @param max
* @param start
* @param end
@ -346,7 +346,7 @@ public final class MamManager extends Manager {
/**
* Returns a page of the archive.
*
* @param node The Pubsub node name, can be null
* @param node The PubSub node name, can be null
* @param dataForm
* @param rsmSet
* @return the MAM query result
@ -498,7 +498,7 @@ public final class MamManager extends Manager {
/**
* Get the form fields supported by the server.
*
* @param node The Pubsub node name, can be null
* @param node The PubSub node name, can be null
* @return the list of form fields.
* @throws NoResponseException
* @throws XMPPErrorException
@ -521,7 +521,7 @@ public final class MamManager extends Manager {
private MamQueryResult queryArchive(MamQueryIQ mamQueryIq) throws NoResponseException, XMPPErrorException,
NotConnectedException, InterruptedException, NotLoggedInException {
final XMPPConnection connection = getAuthenticatedConnectionOrThrow();
MamFinIQ mamFinIQ = null;
MamFinIQ mamFinIQ;
StanzaCollector mamFinIQCollector = connection.createStanzaCollector(new IQReplyFilter(mamQueryIq, connection));

View file

@ -82,7 +82,7 @@ public class MultiUserChatLight {
* Same as {@link #fromRoomFilter} together with
* {@link MessageTypeFilter#GROUPCHAT}.
*/
private final StanzaFilter fromRoomGroupchatFilter;
private final StanzaFilter fromRoomGroupChatFilter;
private final StanzaListener messageListener;
@ -93,7 +93,7 @@ public class MultiUserChatLight {
this.room = room;
fromRoomFilter = FromMatchesFilter.create(room);
fromRoomGroupchatFilter = new AndFilter(fromRoomFilter, MessageTypeFilter.GROUPCHAT);
fromRoomGroupChatFilter = new AndFilter(fromRoomFilter, MessageTypeFilter.GROUPCHAT);
messageListener = new StanzaListener() {
@Override
@ -105,7 +105,7 @@ public class MultiUserChatLight {
}
};
connection.addSyncStanzaListener(messageListener, fromRoomGroupchatFilter);
connection.addSyncStanzaListener(messageListener, fromRoomGroupChatFilter);
}
/**
@ -265,7 +265,7 @@ public class MultiUserChatLight {
throws Exception {
MUCLightCreateIQ createMUCLightIQ = new MUCLightCreateIQ(room, roomName, occupants);
messageCollector = connection.createStanzaCollector(fromRoomGroupchatFilter);
messageCollector = connection.createStanzaCollector(fromRoomGroupChatFilter);
try {
connection.createStanzaCollectorAndSend(createMUCLightIQ).nextResultOrThrow();

View file

@ -96,7 +96,7 @@ public final class MultiUserChatLightManager extends Manager {
private MultiUserChatLight createNewMucLightAndAddToMap(EntityBareJid jid) {
MultiUserChatLight multiUserChatLight = new MultiUserChatLight(connection(), jid);
multiUserChatLights.put(jid, new WeakReference<MultiUserChatLight>(multiUserChatLight));
multiUserChatLights.put(jid, new WeakReference<>(multiUserChatLight));
return multiUserChatLight;
}
@ -193,11 +193,11 @@ public final class MultiUserChatLightManager extends Manager {
*/
public List<Jid> getRoomsBlocked(DomainBareJid mucLightService)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
MUCLightBlockingIQ muclIghtBlockingIQResult = getBlockingList(mucLightService);
MUCLightBlockingIQ mucLightBlockingIQResult = getBlockingList(mucLightService);
List<Jid> jids = new ArrayList<>();
if (muclIghtBlockingIQResult.getRooms() != null) {
jids.addAll(muclIghtBlockingIQResult.getRooms().keySet());
if (mucLightBlockingIQResult.getRooms() != null) {
jids.addAll(mucLightBlockingIQResult.getRooms().keySet());
}
return jids;
@ -215,11 +215,11 @@ public final class MultiUserChatLightManager extends Manager {
*/
public List<Jid> getUsersBlocked(DomainBareJid mucLightService)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
MUCLightBlockingIQ muclIghtBlockingIQResult = getBlockingList(mucLightService);
MUCLightBlockingIQ mucLightBlockingIQResult = getBlockingList(mucLightService);
List<Jid> jids = new ArrayList<>();
if (muclIghtBlockingIQResult.getUsers() != null) {
jids.addAll(muclIghtBlockingIQResult.getUsers().keySet());
if (mucLightBlockingIQResult.getUsers() != null) {
jids.addAll(mucLightBlockingIQResult.getUsers().keySet());
}
return jids;
@ -234,9 +234,9 @@ public final class MultiUserChatLightManager extends Manager {
StanzaFilter responseFilter = new IQReplyFilter(mucLightBlockingIQ, connection());
IQ responseIq = connection().createStanzaCollectorAndSend(responseFilter, mucLightBlockingIQ)
.nextResultOrThrow();
MUCLightBlockingIQ muclIghtBlockingIQResult = (MUCLightBlockingIQ) responseIq;
MUCLightBlockingIQ mucLightBlockingIQResult = (MUCLightBlockingIQ) responseIq;
return muclIghtBlockingIQResult;
return mucLightBlockingIQResult;
}
/**