diff --git a/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle b/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle index 0106d925e..dc82489ab 100644 --- a/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle +++ b/build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle @@ -156,7 +156,7 @@ jar { } checkstyle { - toolVersion = '8.27' + toolVersion = '10.18.2' if (project in gplLicensedProjects) { configProperties.checkstyleLicenseHeader = "${project.name}-gplv3-license-header" diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index ce6b4200d..31df0a8f0 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -104,7 +104,7 @@ - + @@ -195,15 +195,15 @@ , TYPE_EXTENSION_AND "/> - - - - - + + + + + diff --git a/resources/eclipse/smack.importorder b/resources/eclipse/smack.importorder index f87892a1c..2b5f1dadf 100644 --- a/resources/eclipse/smack.importorder +++ b/resources/eclipse/smack.importorder @@ -1,6 +1,8 @@ #Organize Import Order #Wed Jun 14 16:42:40 CEST 2017 -5= +7= +6=org.igniterealtime.smackx +5=org.igniterealtime.smack 4=org.jivesoftware.smackx 3=org.jivesoftware.smack 2=javax diff --git a/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java b/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java index 145098281..b8d3cde5b 100644 --- a/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java +++ b/smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java @@ -28,6 +28,7 @@ import org.jivesoftware.smack.Manager; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPConnectionRegistry; import org.jivesoftware.smack.util.Async; + import org.jivesoftware.smackx.ping.PingManager; import android.app.AlarmManager; diff --git a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java index f1c0b9015..e011e10ab 100644 --- a/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java +++ b/smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java @@ -499,7 +499,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { * * @author Guenther Niess */ - private class BOSHConnectionListener implements BOSHClientConnListener { + private final class BOSHConnectionListener implements BOSHClientConnListener { /** * Notify the BOSHConnection about connection state changes. @@ -556,7 +556,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection { * * @author Guenther Niess */ - private class BOSHPacketReader implements BOSHClientResponseListener { + private final class BOSHPacketReader implements BOSHClientResponseListener { /** * Parse the received packets and notify the corresponding connection. diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java index 8fc59ab3a..504e38103 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackReactor.java @@ -164,7 +164,7 @@ public class SmackReactor { return scheduledActions.remove(scheduledAction); } - private class Reactor extends Thread { + private final class Reactor extends Thread { private volatile long shutdownRequestTimestamp = -1; diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/EventManger.java b/smack-core/src/main/java/org/jivesoftware/smack/util/EventManger.java index f4750423e..109869bcd 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/EventManger.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/EventManger.java @@ -87,7 +87,7 @@ public class EventManger { return true; } - private static class Reference { + private static final class Reference { volatile V eventResult; } diff --git a/smack-examples/src/main/java/org/igniterealtime/smack/examples/IoT.java b/smack-examples/src/main/java/org/igniterealtime/smack/examples/IoT.java index 12c74fb2a..34d7bc36b 100644 --- a/smack-examples/src/main/java/org/igniterealtime/smack/examples/IoT.java +++ b/smack-examples/src/main/java/org/igniterealtime/smack/examples/IoT.java @@ -49,6 +49,7 @@ import org.jivesoftware.smackx.iot.provisioning.BecameFriendListener; import org.jivesoftware.smackx.iot.provisioning.IoTProvisioningManager; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.BareJid; import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.impl.JidCreate; diff --git a/smack-examples/src/main/java/org/igniterealtime/smack/examples/WebSocketConnection.java b/smack-examples/src/main/java/org/igniterealtime/smack/examples/WebSocketConnection.java index 9e4e5856f..bed50f8b4 100644 --- a/smack-examples/src/main/java/org/igniterealtime/smack/examples/WebSocketConnection.java +++ b/smack-examples/src/main/java/org/igniterealtime/smack/examples/WebSocketConnection.java @@ -1,6 +1,6 @@ /** * - * Copyright 2021 Florian Schmaus + * Copyright 2021-2024 Florian Schmaus * * This file is part of smack-examples. * @@ -25,7 +25,6 @@ import java.net.URISyntaxException; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; - import org.jivesoftware.smack.c2s.ModularXmppClientToServerConnection; import org.jivesoftware.smack.c2s.ModularXmppClientToServerConnectionConfiguration; import org.jivesoftware.smack.util.TLSUtils; diff --git a/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppConnectionTool.java b/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppConnectionTool.java index c44adb157..18c287e11 100644 --- a/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppConnectionTool.java +++ b/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppConnectionTool.java @@ -31,6 +31,7 @@ import org.jivesoftware.smack.c2s.ModularXmppClientToServerConnection; import org.jivesoftware.smack.c2s.ModularXmppClientToServerConnectionConfiguration; import org.jivesoftware.smack.debugger.ConsoleDebugger; import org.jivesoftware.smack.debugger.SmackDebuggerFactory; + import org.jivesoftware.smackx.omemo.util.OmemoConstants; import org.jivesoftware.smackx.pep.PepManager; import org.jivesoftware.smackx.pubsub.PubSubManager; diff --git a/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppTools.java b/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppTools.java index 70bb9f1f2..49da3e518 100644 --- a/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppTools.java +++ b/smack-examples/src/main/java/org/igniterealtime/smack/examples/XmppTools.java @@ -37,6 +37,7 @@ import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.tcp.XMPPTCPConnection; import org.jivesoftware.smack.tcp.XMPPTCPConnectionConfiguration; import org.jivesoftware.smack.util.TLSUtils; + import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.iqregister.AccountManager; diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/element/FileMetadataElement.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/element/FileMetadataElement.java index e9f2976bb..dfc5f55cb 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/element/FileMetadataElement.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/element/FileMetadataElement.java @@ -32,6 +32,7 @@ import org.jivesoftware.smack.util.EqualsUtil; import org.jivesoftware.smack.util.HashCode; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.XmlStringBuilder; + import org.jivesoftware.smackx.hashes.HashManager; import org.jivesoftware.smackx.hashes.element.HashElement; import org.jivesoftware.smackx.thumbnails.element.ThumbnailElement; diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/provider/FileMetadataElementProvider.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/provider/FileMetadataElementProvider.java index e4212b0ce..cc268b4f5 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/provider/FileMetadataElementProvider.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/file_metadata/provider/FileMetadataElementProvider.java @@ -25,6 +25,7 @@ import org.jivesoftware.smack.provider.ExtensionElementProvider; import org.jivesoftware.smack.util.ParserUtils; import org.jivesoftware.smack.xml.XmlPullParser; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.file_metadata.element.FileMetadataElement; import org.jivesoftware.smackx.hashes.element.HashElement; import org.jivesoftware.smackx.hashes.provider.HashElementProvider; diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/provider/AbstractHttpOverXmppProvider.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/provider/AbstractHttpOverXmppProvider.java index 8efcb0dfe..93dde8746 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/provider/AbstractHttpOverXmppProvider.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/hoxt/provider/AbstractHttpOverXmppProvider.java @@ -160,7 +160,7 @@ public abstract class AbstractHttpOverXmppProvider { diff --git a/smack-experimental/src/test/java/org/jivesoftware/smackx/file_metadata/FileMetadataElementTest.java b/smack-experimental/src/test/java/org/jivesoftware/smackx/file_metadata/FileMetadataElementTest.java index 229581308..23b73a59c 100644 --- a/smack-experimental/src/test/java/org/jivesoftware/smackx/file_metadata/FileMetadataElementTest.java +++ b/smack-experimental/src/test/java/org/jivesoftware/smackx/file_metadata/FileMetadataElementTest.java @@ -26,6 +26,7 @@ import java.util.Date; import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.SmackTestUtil; + import org.jivesoftware.smackx.file_metadata.element.FileMetadataElement; import org.jivesoftware.smackx.file_metadata.provider.FileMetadataElementProvider; import org.jivesoftware.smackx.hashes.HashManager; diff --git a/smack-experimental/src/test/java/org/jivesoftware/smackx/thumbnails/provider/ThumbnailElementProviderTest.java b/smack-experimental/src/test/java/org/jivesoftware/smackx/thumbnails/provider/ThumbnailElementProviderTest.java index dbaec7c9a..0e0f8a078 100644 --- a/smack-experimental/src/test/java/org/jivesoftware/smackx/thumbnails/provider/ThumbnailElementProviderTest.java +++ b/smack-experimental/src/test/java/org/jivesoftware/smackx/thumbnails/provider/ThumbnailElementProviderTest.java @@ -24,6 +24,7 @@ import java.io.IOException; import org.jivesoftware.smack.parsing.SmackParsingException; import org.jivesoftware.smack.test.util.SmackTestUtil; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.thumbnails.element.ThumbnailElement; import org.junit.jupiter.params.ParameterizedTest; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSession.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSession.java index 0e74aa813..147467722 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSession.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamSession.java @@ -461,7 +461,7 @@ public class InBandBytestreamSession implements BytestreamSession { * IQIBBInputStream class implements IBBInputStream to be used with IQ stanzas encapsulating the * data packets. */ - private class IQIBBInputStream extends IBBInputStream { + private final class IQIBBInputStream extends IBBInputStream { @Override protected StanzaListener getDataPacketListener() { @@ -541,7 +541,7 @@ public class InBandBytestreamSession implements BytestreamSession { * MessageIBBInputStream class implements IBBInputStream to be used with message stanzas * encapsulating the data packets. */ - private class MessageIBBInputStream extends IBBInputStream { + private final class MessageIBBInputStream extends IBBInputStream { @Override protected StanzaListener getDataPacketListener() { @@ -590,7 +590,7 @@ public class InBandBytestreamSession implements BytestreamSession { * containing an In-Band Bytestream data stanza extension whose session ID matches this sessions * ID. */ - private class IBBDataPacketFilter implements StanzaFilter { + private final class IBBDataPacketFilter implements StanzaFilter { @Override public boolean accept(Stanza packet) { @@ -814,7 +814,7 @@ public class InBandBytestreamSession implements BytestreamSession { * IQIBBOutputStream class implements IBBOutputStream to be used with IQ stanzas encapsulating * the data packets. */ - private class IQIBBOutputStream extends IBBOutputStream { + private final class IQIBBOutputStream extends IBBOutputStream { @Override protected synchronized void writeToXML(DataPacketExtension data) throws IOException { @@ -845,7 +845,7 @@ public class InBandBytestreamSession implements BytestreamSession { * MessageIBBOutputStream class implements IBBOutputStream to be used with message stanzas * encapsulating the data packets. */ - private class MessageIBBOutputStream extends IBBOutputStream { + private final class MessageIBBOutputStream extends IBBOutputStream { @Override protected synchronized void writeToXML(DataPacketExtension data) throws NotConnectedException, InterruptedException { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java index 117333095..8656907f0 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java @@ -433,7 +433,7 @@ public class Socks5Proxy { /** * Implementation of a simplified SOCKS5 proxy server. */ - private class Socks5ServerProcess implements Runnable { + private final class Socks5ServerProcess implements Runnable { @Override public void run() { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AbstractAdHocCommand.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AbstractAdHocCommand.java index 8a12b29f3..7fb402326 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AbstractAdHocCommand.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AbstractAdHocCommand.java @@ -25,6 +25,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.StanzaError; import org.jivesoftware.smack.util.StringUtils; + import org.jivesoftware.smackx.commands.packet.AdHocCommandData; import org.jivesoftware.smackx.commands.packet.AdHocCommandData.Action; import org.jivesoftware.smackx.commands.packet.AdHocCommandData.AllowedAction; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommand.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommand.java index 0e7fabaaa..4f1a4cda9 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommand.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommand.java @@ -22,6 +22,7 @@ import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.util.Objects; + import org.jivesoftware.smackx.commands.packet.AdHocCommandData; import org.jivesoftware.smackx.xdata.form.FillableForm; import org.jivesoftware.smackx.xdata.form.SubmitForm; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandHandler.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandHandler.java index 5eb6d6dda..d1c36d943 100755 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandHandler.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandHandler.java @@ -20,6 +20,7 @@ import org.jivesoftware.smack.SmackException.NoResponseException; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.StanzaError; + import org.jivesoftware.smackx.commands.packet.AdHocCommandData; import org.jivesoftware.smackx.commands.packet.AdHocCommandDataBuilder; import org.jivesoftware.smackx.xdata.form.SubmitForm; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandResult.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandResult.java index e0927e277..8dfc51685 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandResult.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandResult.java @@ -17,6 +17,7 @@ package org.jivesoftware.smackx.commands; import org.jivesoftware.smack.packet.IQ; + import org.jivesoftware.smackx.commands.packet.AdHocCommandData; import org.jivesoftware.smackx.xdata.form.FillableForm; import org.jivesoftware.smackx.xdata.packet.DataForm; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationListener.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationListener.java index e8ef1af5e..18b6e9071 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationListener.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationListener.java @@ -17,6 +17,7 @@ package org.jivesoftware.smackx.muc; import org.jivesoftware.smack.packet.Stanza; + import org.jivesoftware.smackx.muc.packet.GroupChatInvitation; public interface DirectMucInvitationListener { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationManager.java index b05f10df0..2dcafcea8 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/DirectMucInvitationManager.java @@ -29,6 +29,7 @@ import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.filter.StanzaExtensionFilter; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.MessageBuilder; + import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.muc.packet.GroupChatInvitation; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/GroupChatInvitationProvider.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/GroupChatInvitationProvider.java index 00ddabaf9..a6e2f9384 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/GroupChatInvitationProvider.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/provider/GroupChatInvitationProvider.java @@ -29,6 +29,7 @@ import org.jivesoftware.smack.provider.ExtensionElementProvider; import org.jivesoftware.smack.util.ParserUtils; import org.jivesoftware.smack.xml.XmlPullParser; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.muc.packet.GroupChatInvitation; import org.jxmpp.jid.EntityBareJid; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/softwareinfo/form/SoftwareInfoForm.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/softwareinfo/form/SoftwareInfoForm.java index f2327face..50d6136b2 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/softwareinfo/form/SoftwareInfoForm.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/softwareinfo/form/SoftwareInfoForm.java @@ -20,6 +20,7 @@ import java.util.List; import org.jivesoftware.smack.util.EqualsUtil; import org.jivesoftware.smack.util.HashCode; + import org.jivesoftware.smackx.formtypes.FormFieldRegistry; import org.jivesoftware.smackx.mediaelement.element.MediaElement; import org.jivesoftware.smackx.xdata.FormField; diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormFieldWithOptions.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormFieldWithOptions.java index 677fb8076..3e7b4f6f6 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormFieldWithOptions.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/xdata/FormFieldWithOptions.java @@ -28,7 +28,7 @@ public interface FormFieldWithOptions { */ List getOptions(); - public interface Builder> { + interface Builder> { default B addOption(String option) { return addOption(new FormField.Option(option)); diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java index 0c59cf73c..39d0ac609 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ByteStreamManagerTest.java @@ -46,6 +46,7 @@ import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.StanzaError; import org.jivesoftware.smack.test.util.NetworkUtil; import org.jivesoftware.smack.util.ExceptionUtil; + import org.jivesoftware.smackx.bytestreams.ibb.IBBPacketUtils; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java index 3ed68d212..0cb0a58f7 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5ClientForInitiatorTest.java @@ -33,6 +33,7 @@ import org.jivesoftware.smack.packet.EmptyResultIQ; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.StanzaError; import org.jivesoftware.smack.util.CloseableUtil; + import org.jivesoftware.smackx.bytestreams.ibb.IBBPacketUtils; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream; import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream.StreamHost; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java index 6ffddb7a5..80c0f3f0c 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/MultiUserChatTest.java @@ -31,6 +31,7 @@ import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.WaitForPacketListener; + import org.jivesoftware.smackx.muc.packet.GroupChatInvitation; import org.jivesoftware.smackx.muc.packet.MUCUser; import org.jivesoftware.smackx.muc.packet.MUCUser.Invite; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitationElementTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitationElementTest.java index 1f28be5ce..590152e71 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitationElementTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/muc/packet/GroupChatInvitationElementTest.java @@ -24,6 +24,7 @@ import java.io.IOException; import org.jivesoftware.smack.parsing.SmackParsingException; import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.muc.provider.GroupChatInvitationProvider; import org.junit.jupiter.api.Test; diff --git a/smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java b/smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java index af11468a3..319f230fa 100644 --- a/smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java +++ b/smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java @@ -96,7 +96,7 @@ public class DeliveryReceiptTest extends SmackTestSuite { rrl.waitUntilInvocationOrTimeout(); } - private static class TestReceiptReceivedListener extends WaitForPacketListener implements ReceiptReceivedListener { + private static final class TestReceiptReceivedListener extends WaitForPacketListener implements ReceiptReceivedListener { @Override public void onReceiptReceived(Jid fromJid, Jid toJid, String receiptId, Stanza receipt) { assertThat("julia@capulet.com", equalsCharSequence(fromJid)); diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java index b51542015..3df9b904c 100644 --- a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java +++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java @@ -1557,6 +1557,9 @@ public final class Roster extends Manager { * Ignore ItemTypes as of RFC 6121, 2.1.2.5. * * This is used by {@link RosterPushListener} and {@link RosterResultListener}. + * + * @param item the roster item to check + * @return true if the item type should be ignored * */ private static boolean hasValidSubscriptionType(RosterPacket.Item item) { switch (item.getItemType()) { @@ -1615,7 +1618,7 @@ public final class Roster extends Manager { /** * Listens for all presence packets and processes them. */ - private class PresencePacketListener implements StanzaListener { + private final class PresencePacketListener implements StanzaListener { @Override public void processStanza(Stanza packet) throws NotConnectedException, InterruptedException { @@ -1790,7 +1793,7 @@ public final class Roster extends Manager { /** * Handles Roster results as described in RFC 6121 2.1.4. */ - private class RosterResultListener implements SuccessCallback { + private final class RosterResultListener implements SuccessCallback { @Override public void onSuccess(IQ packet) { diff --git a/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java b/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java index 62dde5f47..6bd4e74fa 100644 --- a/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java +++ b/smack-im/src/test/java/org/jivesoftware/smack/chat/ChatConnectionTest.java @@ -396,7 +396,7 @@ public class ChatConnectionTest { } } - private static class TestMessageListener implements ChatMessageListener { + private static final class TestMessageListener implements ChatMessageListener { private Chat msgChat; private int counter = 0; diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java index a0f658977..55b6ce65f 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/XmppConnectionStressTest.java @@ -44,6 +44,7 @@ import org.jivesoftware.smackx.jiveproperties.packet.JivePropertiesExtension; import org.igniterealtime.smack.XmppConnectionStressTest.StressTestFailedException.ErrorsWhileSendingOrReceivingException; import org.igniterealtime.smack.XmppConnectionStressTest.StressTestFailedException.NotAllMessagesReceivedException; + import org.jxmpp.jid.EntityFullJid; public class XmppConnectionStressTest { diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java index 6c322c2e7..11e4f6119 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFramework.java @@ -74,6 +74,7 @@ import org.igniterealtime.smack.inttest.annotations.AfterClass; import org.igniterealtime.smack.inttest.annotations.BeforeClass; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; + import org.reflections.Reflections; import org.reflections.scanners.MethodAnnotationsScanner; import org.reflections.scanners.MethodParameterScanner; diff --git a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java index 3b2f21b60..b1c6105e0 100644 --- a/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java +++ b/smack-integration-test/src/main/java/org/igniterealtime/smack/inttest/XmppConnectionManager.java @@ -47,11 +47,13 @@ import org.jivesoftware.smack.util.MultiMap; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.websocket.java11.Java11WebSocketFactory; import org.jivesoftware.smack.websocket.okhttp.OkHttpWebSocketFactory; + import org.jivesoftware.smackx.admin.ServiceAdministrationManager; import org.jivesoftware.smackx.iqregister.AccountManager; import org.igniterealtime.smack.inttest.Configuration.AccountRegistration; import org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.AccountNum; + import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Localpart; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java index fdbb755c7..015919e13 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/StreamManagementTest.java @@ -32,6 +32,7 @@ import org.igniterealtime.smack.inttest.AbstractSmackSpecificLowLevelIntegration import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; + import org.jxmpp.jid.EntityFullJid; public class StreamManagementTest extends AbstractSmackSpecificLowLevelIntegrationTest { diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/IncomingMessageListenerIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/IncomingMessageListenerIntegrationTest.java index 7d536f072..b28dd6d26 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/IncomingMessageListenerIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/IncomingMessageListenerIntegrationTest.java @@ -22,6 +22,7 @@ import org.jivesoftware.smack.util.StringUtils; import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; public class IncomingMessageListenerIntegrationTest extends AbstractChatIntegrationTest { diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/OutgoingMessageListenerIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/OutgoingMessageListenerIntegrationTest.java index 0b0109e98..062f1b84c 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/OutgoingMessageListenerIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/chat2/OutgoingMessageListenerIntegrationTest.java @@ -23,6 +23,7 @@ import org.jivesoftware.smack.util.StringUtils; import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; public class OutgoingMessageListenerIntegrationTest extends AbstractChatIntegrationTest { diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java index 9f150bd7a..f0a5182a5 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/LowLevelRosterIntegrationTest.java @@ -26,6 +26,7 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.FullJid; public class LowLevelRosterIntegrationTest extends AbstractSmackLowLevelIntegrationTest { diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java index 98db355c6..29cf23f81 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smack/roster/RosterIntegrationTest.java @@ -40,6 +40,7 @@ import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil; import org.igniterealtime.smack.inttest.util.ResultSyncPoint; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.BareJid; import org.jxmpp.jid.Jid; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java index 1ece51611..f405afb0d 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/commands/AdHocCommandIntegrationTest.java @@ -24,6 +24,7 @@ import org.jivesoftware.smack.SmackException.NoResponseException; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.StanzaError; + import org.jivesoftware.smackx.commands.packet.AdHocCommandData; import org.jivesoftware.smackx.commands.packet.AdHocCommandDataBuilder; import org.jivesoftware.smackx.commands.packet.AdHocCommandDataBuilder.NextStage; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java index 25ebb9b2a..b54603a34 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/filetransfer/FileTransferIntegrationTest.java @@ -26,6 +26,7 @@ import java.util.Arrays; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.util.StringUtils; + import org.jivesoftware.smackx.filetransfer.FileTransfer.Status; import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java index 1cd1d3b8d..ec9ff3846 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/geolocation/GeolocationIntegrationTest.java @@ -36,6 +36,7 @@ import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.util.XmppDateTime; @SpecificationReference(document = "XEP-0080", version = "1.9") diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java index 4d4844adf..507024cdc 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTControlIntegrationTest.java @@ -36,6 +36,7 @@ import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.Jid; @SpecificationReference(document = "XEP-0347", version = "0.5.1") diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java index 7c3f3dcac..63f851d96 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/iot/IoTDiscoveryIntegrationTest.java @@ -35,6 +35,7 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; + import org.jxmpp.jid.Jid; @SpecificationReference(document = "XEP-0347", version = "0.5.1") diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java index 9b9cba7a3..764fdd9e0 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/mam/MamIntegrationTest.java @@ -35,6 +35,7 @@ import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.StanzaBuilder; import org.jivesoftware.smack.packet.StanzaError; + import org.jivesoftware.smackx.mam.MamManager.MamQuery; import org.jivesoftware.smackx.mam.MamManager.MamQueryArgs; @@ -44,6 +45,7 @@ import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; @SpecificationReference(document = "XEP-0313", version = "0.6.3") diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java index 6f354f2ae..2b4742769 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/AbstractMultiUserChatIntegrationTest.java @@ -25,6 +25,7 @@ import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.StanzaError; import org.jivesoftware.smack.util.StringUtils; + import org.jivesoftware.smackx.muc.MultiUserChatException.MissingMucCreationAcknowledgeException; import org.jivesoftware.smackx.muc.MultiUserChatException.MucAlreadyJoinedException; import org.jivesoftware.smackx.muc.MultiUserChatException.NotAMucServiceException; @@ -34,6 +35,7 @@ import org.jivesoftware.smackx.xdata.form.Form; import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest; import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.TestNotPossibleException; + import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.impl.JidCreate; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java index b142c2ce7..196df3b2c 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatEntityIntegrationTest.java @@ -28,6 +28,7 @@ import java.util.Map; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.StanzaError; + import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.packet.DiscoverInfo; import org.jivesoftware.smackx.disco.packet.DiscoverItems; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java index d689a9549..3a2eaba52 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatIntegrationTest.java @@ -32,6 +32,7 @@ import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.StanzaError; + import org.jivesoftware.smackx.muc.MultiUserChatException.MissingMucCreationAcknowledgeException; import org.jivesoftware.smackx.muc.MultiUserChatException.MucAlreadyJoinedException; import org.jivesoftware.smackx.muc.MultiUserChatException.MucConfigurationNotSupportedException; @@ -42,6 +43,7 @@ import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.parts.Resourcepart; import org.jxmpp.stringprep.XmppStringprepException; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java index e13384940..286a5969b 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatLowLevelIntegrationTest.java @@ -34,6 +34,7 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; + import org.jxmpp.jid.DomainBareJid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Localpart; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java index 3fddfd2f0..108cc010b 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatOccupantIntegrationTest.java @@ -41,6 +41,7 @@ import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.packet.StanzaError; import org.jivesoftware.smack.sm.predicates.ForEveryMessage; import org.jivesoftware.smack.util.StringUtils; + import org.jivesoftware.smackx.muc.MultiUserChatException.MissingMucCreationAcknowledgeException; import org.jivesoftware.smackx.muc.MultiUserChatException.MucAlreadyJoinedException; import org.jivesoftware.smackx.muc.MultiUserChatException.MucConfigurationNotSupportedException; @@ -57,6 +58,7 @@ import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.MultiResultSyncPoint; import org.igniterealtime.smack.inttest.util.ResultSyncPoint; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.impl.JidCreate; import org.jxmpp.jid.parts.Resourcepart; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java index 1fe5b9672..10316a277 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatRolesAffiliationsPrivilegesIntegrationTest.java @@ -32,6 +32,7 @@ import java.util.stream.Collectors; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.Presence; + import org.jivesoftware.smackx.muc.MultiUserChatException.MissingMucCreationAcknowledgeException; import org.jivesoftware.smackx.muc.MultiUserChatException.MucAlreadyJoinedException; import org.jivesoftware.smackx.muc.MultiUserChatException.NotAMucServiceException; @@ -43,6 +44,7 @@ import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.ResultSyncPoint; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.Jid; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusIntegrationTest.java index d0381a5f7..76f32a616 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/ParticipantStatusIntegrationTest.java @@ -24,6 +24,7 @@ import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.impl.JidCreate; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/UserStatusIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/UserStatusIntegrationTest.java index 8a182e3ca..2b1c5aa9f 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/UserStatusIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/muc/UserStatusIntegrationTest.java @@ -19,6 +19,7 @@ package org.jivesoftware.smackx.muc; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.Presence; + import org.jivesoftware.smackx.muc.packet.MUCUser; import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; @@ -26,6 +27,7 @@ import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.jxmpp.jid.EntityBareJid; import org.jxmpp.jid.EntityFullJid; import org.jxmpp.jid.impl.JidCreate; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/AbstractOpenPgpIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/AbstractOpenPgpIntegrationTest.java index 31d613c85..2d3d68778 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/AbstractOpenPgpIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/AbstractOpenPgpIntegrationTest.java @@ -26,6 +26,7 @@ import org.jivesoftware.smackx.pep.PepManager; import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest; import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.TestNotPossibleException; + import org.jxmpp.jid.BareJid; public abstract class AbstractOpenPgpIntegrationTest extends AbstractSmackIntegrationTest { diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java index 93f936785..c5971f2fc 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox/OXSecretKeyBackupIntegrationTest.java @@ -31,6 +31,7 @@ import java.security.NoSuchProviderException; import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.util.StringUtils; + import org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider; import org.jivesoftware.smackx.ox.exception.InvalidBackupCodeException; import org.jivesoftware.smackx.ox.exception.MissingOpenPgpKeyException; @@ -41,15 +42,16 @@ import org.jivesoftware.smackx.ox.store.filebased.FileBasedOpenPgpStore; import org.jivesoftware.smackx.ox.util.OpenPgpPubSubUtil; import org.jivesoftware.smackx.pubsub.PubSubException; -import org.bouncycastle.openpgp.PGPException; -import org.bouncycastle.openpgp.PGPPublicKeyRing; -import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.AfterClass; import org.igniterealtime.smack.inttest.annotations.BeforeClass; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; + +import org.bouncycastle.openpgp.PGPException; +import org.bouncycastle.openpgp.PGPPublicKeyRing; +import org.bouncycastle.openpgp.PGPSecretKeyRing; import org.pgpainless.key.OpenPgpV4Fingerprint; import org.pgpainless.key.protection.UnprotectedKeysProtector; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java index 4467dde1f..5ec31757a 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingIntegrationTest.java @@ -42,6 +42,7 @@ import org.igniterealtime.smack.inttest.annotations.BeforeClass; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.pgpainless.decryption_verification.OpenPgpMetadata; import org.pgpainless.key.OpenPgpV4Fingerprint; import org.pgpainless.key.protection.UnprotectedKeysProtector; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java index a2cbce7ce..d05784ed9 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/ping/PingIntegrationTest.java @@ -36,6 +36,7 @@ import org.igniterealtime.smack.inttest.AbstractSmackIntegrationTest; import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; + import org.jxmpp.jid.Jid; @SpecificationReference(document = "XEP-0199", version = "2.0.1") diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java index d3f990a4a..69aad5dbd 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/pubsub/PubSubIntegrationTest.java @@ -35,6 +35,7 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestEnvironment; import org.igniterealtime.smack.inttest.TestNotPossibleException; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; + import org.jxmpp.jid.DomainBareJid; @SpecificationReference(document = "XEP-0060", version = "1.26.0") diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java index f01371f10..2e4becabb 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/softwareInfo/SoftwareInfoIntegrationTest.java @@ -25,6 +25,7 @@ import java.net.URISyntaxException; import org.jivesoftware.smack.parsing.SmackParsingException; import org.jivesoftware.smack.util.Async.ThrowingRunnable; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.mediaelement.element.MediaElement; import org.jivesoftware.smackx.softwareinfo.SoftwareInfoManager; import org.jivesoftware.smackx.softwareinfo.form.SoftwareInfoForm; diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java index e204031c4..d0c0ddc63 100644 --- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java +++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/usertune/UserTuneIntegrationTest.java @@ -34,6 +34,7 @@ import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; import org.igniterealtime.smack.inttest.annotations.SpecificationReference; import org.igniterealtime.smack.inttest.util.IntegrationTestRosterUtil; import org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint; + import org.junit.jupiter.api.Assertions; @SpecificationReference(document = "XEP-0118", version = "1.3.0") diff --git a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFrameWorkTest.java b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFrameWorkTest.java index fbdfa8cef..bb144febe 100644 --- a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFrameWorkTest.java +++ b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/SmackIntegrationTestFrameWorkTest.java @@ -30,26 +30,26 @@ import org.junit.jupiter.api.Test; public class SmackIntegrationTestFrameWorkTest { - private static class ValidLowLevelList { + private static final class ValidLowLevelList { @SuppressWarnings({"unused", "MethodCanBeStatic"}) public void test(List connections) { } } - private static class InvalidLowLevelList { + private static final class InvalidLowLevelList { @SuppressWarnings({"unused", "MethodCanBeStatic"}) public void test(List connections, boolean invalid) { } } - private static class ValidLowLevelVarargs { + private static final class ValidLowLevelVarargs { @SuppressWarnings({"unused", "MethodCanBeStatic"}) public void test(AbstractXMPPConnection connectionOne, AbstractXMPPConnection connectionTwo, AbstractXMPPConnection connectionThree) { } } - private static class InvalidLowLevelVarargs { + private static final class InvalidLowLevelVarargs { @SuppressWarnings({"unused", "MethodCanBeStatic"}) public void test(AbstractXMPPConnection connectionOne, Integer invalid, AbstractXMPPConnection connectionTwo, AbstractXMPPConnection connectionThree) { @@ -96,7 +96,7 @@ public class SmackIntegrationTestFrameWorkTest { assertNull(determinedParameterType); } - private static class ValidUnconnectedConnectionSource { + private static final class ValidUnconnectedConnectionSource { @SuppressWarnings({"unused", "MethodCanBeStatic"}) public void test(AbstractSmackLowLevelIntegrationTest.UnconnectedConnectionSource source) { } diff --git a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/unittest/SmackIntegrationTestFrameworkUnitTest.java b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/unittest/SmackIntegrationTestFrameworkUnitTest.java index e1398e73b..4e4760e02 100644 --- a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/unittest/SmackIntegrationTestFrameworkUnitTest.java +++ b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/unittest/SmackIntegrationTestFrameworkUnitTest.java @@ -44,6 +44,7 @@ import org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.TestRunRes import org.igniterealtime.smack.inttest.annotations.AfterClass; import org.igniterealtime.smack.inttest.annotations.BeforeClass; import org.igniterealtime.smack.inttest.annotations.SmackIntegrationTest; + import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPointTest.java b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPointTest.java index 5a4db37c4..e525640c2 100644 --- a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPointTest.java +++ b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/MultiResultSyncPointTest.java @@ -97,7 +97,7 @@ public class MultiResultSyncPointTest { } } - private static class TestException extends Exception { + private static final class TestException extends Exception { /** * diff --git a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/ResultSyncPointTest.java b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/ResultSyncPointTest.java index c6e22bd72..efcbb5b39 100644 --- a/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/ResultSyncPointTest.java +++ b/smack-integration-test/src/test/java/org/igniterealtime/smack/inttest/util/ResultSyncPointTest.java @@ -73,7 +73,7 @@ public class ResultSyncPointTest { } } - private static class TestException extends Exception { + private static final class TestException extends Exception { /** * diff --git a/smack-java11/src/main/java/org/jivesoftware/smack/java7/XmppHostnameVerifier.java b/smack-java11/src/main/java/org/jivesoftware/smack/java7/XmppHostnameVerifier.java index a03cd097a..bc88484bf 100644 --- a/smack-java11/src/main/java/org/jivesoftware/smack/java7/XmppHostnameVerifier.java +++ b/smack-java11/src/main/java/org/jivesoftware/smack/java7/XmppHostnameVerifier.java @@ -221,7 +221,7 @@ public class XmppHostnameVerifier implements HostnameVerifier { afterWildcard = afterWildcard.substring(wildcardIndex + 1); int beforeStartIndex = name.indexOf(beforeWildcard); - if ((beforeStartIndex == -1) || (isBeginning && beforeStartIndex != 0)) { + if (beforeStartIndex == -1 || (isBeginning && beforeStartIndex != 0)) { return false; } isBeginning = false; diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java index 768cc42c9..d33508316 100644 --- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java +++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleSessionListener.java @@ -20,6 +20,7 @@ import org.jivesoftware.smack.SmackException.NoResponseException; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; + import org.jivesoftware.smackx.jingleold.JingleSession; import org.jivesoftware.smackx.jingleold.media.PayloadType; import org.jivesoftware.smackx.jingleold.nat.TransportCandidate; diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleTransportListener.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleTransportListener.java index 55478c276..7afc6bfb1 100644 --- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleTransportListener.java +++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/listeners/JingleTransportListener.java @@ -20,6 +20,7 @@ import org.jivesoftware.smack.SmackException.NoResponseException; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; + import org.jivesoftware.smackx.jingleold.nat.TransportCandidate; /** diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedTransportManager.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedTransportManager.java index 151f6dff1..5929fc78e 100644 --- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedTransportManager.java +++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/BridgedTransportManager.java @@ -21,6 +21,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; + import org.jivesoftware.smackx.jingleold.JingleSession; import org.jivesoftware.smackx.jingleold.listeners.CreatedJingleSessionListener; import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener; diff --git a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICETransportManager.java b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICETransportManager.java index b8cb0f850..6d52161c7 100644 --- a/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICETransportManager.java +++ b/smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/nat/ICETransportManager.java @@ -25,6 +25,7 @@ import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.XMPPException.XMPPErrorException; + import org.jivesoftware.smackx.jingleold.JingleSession; import org.jivesoftware.smackx.jingleold.listeners.CreatedJingleSessionListener; import org.jivesoftware.smackx.jingleold.listeners.JingleSessionListener; diff --git a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java index c0f489e8b..988db997b 100644 --- a/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java +++ b/smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/agent/AgentRoster.java @@ -301,7 +301,7 @@ public class AgentRoster { /** * Listens for all presence packets and processes them. */ - private class PresencePacketListener implements StanzaListener { + private final class PresencePacketListener implements StanzaListener { @Override public void processStanza(Stanza packet) { Presence presence = (Presence) packet; @@ -376,7 +376,7 @@ public class AgentRoster { /** * Listens for all roster packets and processes them. */ - private class AgentStatusListener implements StanzaListener { + private final class AgentStatusListener implements StanzaListener { @Override public void processStanza(Stanza packet) { diff --git a/smack-omemo-signal-integration-test/src/main/java/org/igniterealtime/smack/inttest/smack_omemo_signal/SmackOmemoSignalIntegrationTestFramework.java b/smack-omemo-signal-integration-test/src/main/java/org/igniterealtime/smack/inttest/smack_omemo_signal/SmackOmemoSignalIntegrationTestFramework.java index d79154e4a..a75337243 100644 --- a/smack-omemo-signal-integration-test/src/main/java/org/igniterealtime/smack/inttest/smack_omemo_signal/SmackOmemoSignalIntegrationTestFramework.java +++ b/smack-omemo-signal-integration-test/src/main/java/org/igniterealtime/smack/inttest/smack_omemo_signal/SmackOmemoSignalIntegrationTestFramework.java @@ -39,9 +39,10 @@ import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smackx.omemo.exceptions.CorruptedOmemoKeyException; import org.jivesoftware.smackx.omemo.signal.SignalOmemoService; -import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.igniterealtime.smack.inttest.SmackIntegrationTestFramework; +import org.bouncycastle.jce.provider.BouncyCastleProvider; + public class SmackOmemoSignalIntegrationTestFramework { static { diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/CachingOmemoStore.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/CachingOmemoStore.java index f4c546bb3..eb1c078b0 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/CachingOmemoStore.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/CachingOmemoStore.java @@ -468,7 +468,7 @@ public class CachingOmemoStore type of the public signed preKey * @param type of the OMEMO session */ - private static class KeyCache { + private static final class KeyCache { private T_IdKeyPair identityKeyPair; private final TreeMap preKeys = new TreeMap<>(); private final TreeMap signedPreKeys = new TreeMap<>(); diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/internal/OmemoAesCipher.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/internal/OmemoAesCipher.java index 4edb10c4d..313563290 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/internal/OmemoAesCipher.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/internal/OmemoAesCipher.java @@ -30,6 +30,7 @@ import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.SecretKeySpec; import org.jivesoftware.smack.util.RandomUtil; + import org.jivesoftware.smackx.omemo.util.OmemoConstants; import org.jivesoftware.smackx.omemo.util.OmemoMessageBuilder; diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java index 5144b4f02..228157054 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/util/OmemoMessageBuilder.java @@ -24,12 +24,14 @@ import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; + import javax.crypto.BadPaddingException; import javax.crypto.IllegalBlockSizeException; import javax.crypto.KeyGenerator; import javax.crypto.NoSuchPaddingException; import org.jivesoftware.smack.util.RandomUtil; + import org.jivesoftware.smackx.omemo.OmemoRatchet; import org.jivesoftware.smackx.omemo.OmemoService; import org.jivesoftware.smackx.omemo.element.OmemoElement; diff --git a/smack-omemo/src/test/java/org/jivesoftware/smackx/omemo/WrapperObjectsTest.java b/smack-omemo/src/test/java/org/jivesoftware/smackx/omemo/WrapperObjectsTest.java index 88f632640..1777d2eb3 100644 --- a/smack-omemo/src/test/java/org/jivesoftware/smackx/omemo/WrapperObjectsTest.java +++ b/smack-omemo/src/test/java/org/jivesoftware/smackx/omemo/WrapperObjectsTest.java @@ -26,6 +26,7 @@ import static org.junit.Assert.assertFalse; import java.security.NoSuchAlgorithmException; import org.jivesoftware.smack.test.util.SmackTestSuite; + import org.jivesoftware.smackx.omemo.element.OmemoElement; import org.jivesoftware.smackx.omemo.exceptions.CryptoFailedException; import org.jivesoftware.smackx.omemo.internal.CipherAndAuthTag; diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpContact.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpContact.java index c575fc5b7..050b62ba0 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpContact.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpContact.java @@ -31,6 +31,7 @@ import org.jivesoftware.smack.SmackException; import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.util.stringencoder.Base64; + import org.jivesoftware.smackx.ox.element.PubkeyElement; import org.jivesoftware.smackx.ox.element.PublicKeysListElement; import org.jivesoftware.smackx.ox.exception.MissingUserIdOnKeyException; diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java index b4a22c7cc..56d81f122 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/OpenPgpManager.java @@ -42,6 +42,7 @@ import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.util.Async; import org.jivesoftware.smack.util.stringencoder.Base64; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.ox.callback.backup.AskForBackupCodeCallback; import org.jivesoftware.smackx.ox.callback.backup.SecretKeyBackupSelectionCallback; diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/OpenPgpProvider.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/OpenPgpProvider.java index ba0936041..08262cf68 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/OpenPgpProvider.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/OpenPgpProvider.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.util.Collection; import org.jivesoftware.smack.XMPPConnection; + import org.jivesoftware.smackx.ox.OpenPgpContact; import org.jivesoftware.smackx.ox.OpenPgpMessage; import org.jivesoftware.smackx.ox.OpenPgpSelf; diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/PainlessOpenPgpProvider.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/PainlessOpenPgpProvider.java index 304e3e006..ed698eee2 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/PainlessOpenPgpProvider.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/crypto/PainlessOpenPgpProvider.java @@ -29,6 +29,7 @@ import org.jivesoftware.smack.XMPPConnection; import org.jivesoftware.smack.XMPPException.XMPPErrorException; import org.jivesoftware.smack.util.Objects; import org.jivesoftware.smack.util.stringencoder.Base64; + import org.jivesoftware.smackx.ox.OpenPgpContact; import org.jivesoftware.smackx.ox.OpenPgpMessage; import org.jivesoftware.smackx.ox.OpenPgpSelf; diff --git a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java index 8954064f9..9c1d91ba1 100644 --- a/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java +++ b/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox/element/OpenPgpElement.java @@ -25,8 +25,8 @@ import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.util.XmlStringBuilder; - import org.jivesoftware.smack.util.stringencoder.Base64; + import org.jivesoftware.smackx.ox.util.Util; /** diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpElementTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpElementTest.java index a958d1adb..fcd9465b1 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpElementTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpElementTest.java @@ -34,6 +34,7 @@ import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.xml.XmlPullParser; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.ox.element.CryptElement; import org.jivesoftware.smackx.ox.element.OpenPgpElement; import org.jivesoftware.smackx.ox.element.SignElement; diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpStoreTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpStoreTest.java index 30e3f05af..89783d023 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpStoreTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/OpenPgpStoreTest.java @@ -37,6 +37,7 @@ import java.util.HashMap; import java.util.Map; import org.jivesoftware.smack.test.util.SmackTestSuite; + import org.jivesoftware.smackx.ox.callback.SecretKeyPassphraseCallback; import org.jivesoftware.smackx.ox.exception.MissingUserIdOnKeyException; import org.jivesoftware.smackx.ox.store.definition.OpenPgpStore; diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PainlessOpenPgpProviderTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PainlessOpenPgpProviderTest.java index 41319bd6f..4f1b87a73 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PainlessOpenPgpProviderTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PainlessOpenPgpProviderTest.java @@ -35,6 +35,7 @@ import org.jivesoftware.smack.packet.ExtensionElement; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.ox.crypto.OpenPgpElementAndMetadata; import org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider; import org.jivesoftware.smackx.ox.element.CryptElement; diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PubSubDelegateTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PubSubDelegateTest.java index 0bb120f8f..1e6b44c81 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PubSubDelegateTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PubSubDelegateTest.java @@ -19,6 +19,7 @@ package org.jivesoftware.smackx.ox; import static org.junit.jupiter.api.Assertions.assertEquals; import org.jivesoftware.smack.test.util.SmackTestSuite; + import org.jivesoftware.smackx.ox.util.OpenPgpPubSubUtil; import org.junit.jupiter.api.Test; diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PublicKeysListElementTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PublicKeysListElementTest.java index eb7f3922c..fd05dcdba 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PublicKeysListElementTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/PublicKeysListElementTest.java @@ -24,6 +24,7 @@ import java.util.Date; import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.xml.XmlPullParser; + import org.jivesoftware.smackx.ox.element.PublicKeysListElement; import org.jivesoftware.smackx.ox.provider.PublicKeysListElementProvider; diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java index 74f9471f8..4cc22b7c5 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretKeyBackupHelperTest.java @@ -26,6 +26,7 @@ import java.security.NoSuchAlgorithmException; import java.util.Collections; import org.jivesoftware.smack.test.util.SmackTestSuite; + import org.jivesoftware.smackx.ox.crypto.PainlessOpenPgpProvider; import org.jivesoftware.smackx.ox.element.SecretkeyElement; import org.jivesoftware.smackx.ox.exception.InvalidBackupCodeException; diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretkeyElementTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretkeyElementTest.java index 9e8922cf2..2afdcd8ab 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretkeyElementTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox/SecretkeyElementTest.java @@ -24,6 +24,7 @@ import java.nio.charset.Charset; import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.test.util.TestUtils; import org.jivesoftware.smack.xml.XmlPullParser; + import org.jivesoftware.smackx.ox.element.SecretkeyElement; import org.jivesoftware.smackx.ox.provider.SecretkeyElementProvider; diff --git a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManagerTest.java b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManagerTest.java index 668a14204..33e2ac905 100644 --- a/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManagerTest.java +++ b/smack-openpgp/src/test/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManagerTest.java @@ -38,6 +38,7 @@ import org.jivesoftware.smack.packet.StanzaBuilder; import org.jivesoftware.smack.test.util.SmackTestSuite; import org.jivesoftware.smack.util.StringUtils; import org.jivesoftware.smack.xml.XmlPullParserException; + import org.jivesoftware.smackx.eme.element.ExplicitMessageEncryptionElement; import org.jivesoftware.smackx.ox.OpenPgpContact; import org.jivesoftware.smackx.ox.OpenPgpManager; diff --git a/smack-resolver-minidns-dox/src/test/java/org/jivesoftware/smackx/dox/resolver/minidns/DnsOverXmppMiniDnsResolverTest.java b/smack-resolver-minidns-dox/src/test/java/org/jivesoftware/smackx/dox/resolver/minidns/DnsOverXmppMiniDnsResolverTest.java index d98b2fdeb..0912a2008 100644 --- a/smack-resolver-minidns-dox/src/test/java/org/jivesoftware/smackx/dox/resolver/minidns/DnsOverXmppMiniDnsResolverTest.java +++ b/smack-resolver-minidns-dox/src/test/java/org/jivesoftware/smackx/dox/resolver/minidns/DnsOverXmppMiniDnsResolverTest.java @@ -146,7 +146,7 @@ public final class DnsOverXmppMiniDnsResolverTest { // TODO: Workaround for NPE-if-no-cache-set bug in MiniDNS. Remove we use a MiniDNS version where this is fixed, // i.e. one that has 864fbb5 ("Fix NPE in AbstractDnsClient if cache is 'null'") - private static class NoopDnsCache extends DnsCache { + private static final class NoopDnsCache extends DnsCache { private static final NoopDnsCache INSTANCE = new NoopDnsCache(); diff --git a/smack-websocket/src/test/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModuleTest.java b/smack-websocket/src/test/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModuleTest.java index bc0ee1cd0..94a12d683 100644 --- a/smack-websocket/src/test/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModuleTest.java +++ b/smack-websocket/src/test/java/org/jivesoftware/smack/websocket/XmppWebSocketTransportModuleTest.java @@ -17,7 +17,6 @@ package org.jivesoftware.smack.websocket; import static org.junit.jupiter.api.Assertions.assertNotNull; - import static org.mockito.Mockito.mock; import java.net.URI; diff --git a/smack-websocket/src/testFixtures/java/org/jivesoftware/smack/websocket/test/WebSocketFactoryServiceTestUtil.java b/smack-websocket/src/testFixtures/java/org/jivesoftware/smack/websocket/test/WebSocketFactoryServiceTestUtil.java index cb84133da..8c580548c 100644 --- a/smack-websocket/src/testFixtures/java/org/jivesoftware/smack/websocket/test/WebSocketFactoryServiceTestUtil.java +++ b/smack-websocket/src/testFixtures/java/org/jivesoftware/smack/websocket/test/WebSocketFactoryServiceTestUtil.java @@ -17,7 +17,6 @@ package org.jivesoftware.smack.websocket.test; import static org.junit.jupiter.api.Assertions.assertEquals; - import static org.mockito.Mockito.mock; import java.net.URISyntaxException;