Skip to content

Commit

Permalink
Bump checkstyle to 10.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowdalic committed Oct 22, 2024
1 parent c696925 commit 0561aaa
Show file tree
Hide file tree
Showing 99 changed files with 134 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ jar {
}

checkstyle {
toolVersion = '8.27'
toolVersion = '10.18.2'

if (project in gplLicensedProjects) {
configProperties.checkstyleLicenseHeader = "${project.name}-gplv3-license-header"
Expand Down
14 changes: 7 additions & 7 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
</module>
<module name="JavadocMethod">
<!-- TODO stricten those checks -->
<property name="scope" value="protected"/>
<property name="accessModifiers" value="public,protected"/>
</module>
<module name="JavadocStyle">
<property name="scope" value="public"/>
Expand Down Expand Up @@ -195,15 +195,15 @@
, TYPE_EXTENSION_AND
"/>
</module>
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="STATIC###STANDARD_JAVA_PACKAGE###SPECIAL_IMPORTS###THIRD_PARTY_PACKAGE"/>
<property name="specialImportsRegExp" value="^org\.jivesoftware\.smack"/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
<module name="ImportOrder">
<property name="groups" value="/^java\./,/^javax\./,/^org\.jivesoftware\.smack\./,/^org\.jivesoftware\.smackx\./,/^org\.igniterealtime\.smack\./,/^org\.igniterealtime\.smackx\./"/>
<property name="separated" value="true"/>
<property name="option" value="top"/>
</module>
<module name="MissingJavadocPackage"/>
<!-- this seems to cause false positives with checkstyle 10.18.2
<module name="UnnecessaryParentheses"/>
-->
<module name="UnnecessarySemicolonInEnumeration"/>
<module name="UnnecessarySemicolonInTryWithResources"/>
</module>
Expand Down
4 changes: 3 additions & 1 deletion resources/eclipse/smack.importorder
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ protected void afterSaslAuthenticationSuccess()
*
* @author Guenther Niess
*/
private class BOSHConnectionListener implements BOSHClientConnListener {
private final class BOSHConnectionListener implements BOSHClientConnListener {

/**
* Notify the BOSHConnection about connection state changes.
Expand Down Expand Up @@ -556,7 +556,7 @@ public void connectionEvent(BOSHClientConnEvent connEvent) {
*
* @author Guenther Niess
*/
private class BOSHPacketReader implements BOSHClientResponseListener {
private final class BOSHPacketReader implements BOSHClientResponseListener {

/**
* Parse the received packets and notify the corresponding connection.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ boolean cancel(ScheduledAction scheduledAction) {
return scheduledActions.remove(scheduledAction);
}

private class Reactor extends Thread {
private final class Reactor extends Thread {

private volatile long shutdownRequestTimestamp = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean signalEvent(K eventKey, R eventResult) {
return true;
}

private static class Reference<V> {
private static final class Reference<V> {
volatile V eventResult;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2021 Florian Schmaus
* Copyright 2021-2024 Florian Schmaus
*
* This file is part of smack-examples.
*
Expand All @@ -25,7 +25,6 @@

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ private static AbstractHttpOverXmpp.Xml parseXml(XmlPullParser parser)
while (!done) {
XmlPullParser.Event eventType = parser.next();

if ((eventType == XmlPullParser.Event.END_ELEMENT) && parser.getName().equals(ELEMENT_XML)) {
if (eventType == XmlPullParser.Event.END_ELEMENT && parser.getName().equals(ELEMENT_XML)) {
done = true;
} else { // just write everything else as text

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.xml.XmlPullParser;

import org.jivesoftware.smackx.forward.packet.Forwarded;
import org.jivesoftware.smackx.rsm.packet.RSMSet;
import org.jivesoftware.smackx.xdata.packet.DataForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.jivesoftware.smack.packet.XmlElement;
import org.jivesoftware.smack.util.StringUtils;
import org.jivesoftware.smack.util.XmlStringBuilder;

import org.jivesoftware.smackx.forward.packet.Forwarded;

import org.jxmpp.jid.Jid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
package org.jivesoftware.smackx.mam.element;

import java.util.List;

import javax.xml.namespace.QName;

import org.jivesoftware.smack.packet.Message;

import org.jivesoftware.smackx.forward.packet.Forwarded;
import org.jivesoftware.smackx.rsm.packet.RSMSet;
import org.jivesoftware.smackx.xdata.packet.DataForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
package org.jivesoftware.smackx.mam.element;

import java.util.List;

import javax.xml.namespace.QName;

import org.jivesoftware.smack.packet.Message;

import org.jivesoftware.smackx.forward.packet.Forwarded;
import org.jivesoftware.smackx.rsm.packet.RSMSet;
import org.jivesoftware.smackx.xdata.packet.DataForm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.jivesoftware.smack.util.ParserUtils;
import org.jivesoftware.smack.xml.XmlPullParser;
import org.jivesoftware.smack.xml.XmlPullParserException;

import org.jivesoftware.smackx.thumbnails.element.ThumbnailElement;

public class ThumbnailElementProvider extends ExtensionElementProvider<ThumbnailElement> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ private void cleanup() {
* 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() {
Expand Down Expand Up @@ -541,7 +541,7 @@ protected StanzaFilter getDataPacketFilter() {
* 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() {
Expand Down Expand Up @@ -590,7 +590,7 @@ protected StanzaFilter getDataPacketFilter() {
* 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) {
Expand Down Expand Up @@ -814,7 +814,7 @@ protected void closeInternal(boolean flush) {
* 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 {
Expand Down Expand Up @@ -845,7 +845,7 @@ protected synchronized void writeToXML(DataPacketExtension data) throws IOExcept
* 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public boolean isRunning() {
/**
* Implementation of a simplified SOCKS5 proxy server.
*/
private class Socks5ServerProcess implements Runnable {
private final class Socks5ServerProcess implements Runnable {

@Override
public void run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface FormFieldWithOptions {
*/
List<FormField.Option> getOptions();

public interface Builder<B extends FormField.Builder<?, ?>> {
interface Builder<B extends FormField.Builder<?, ?>> {

default B addOption(String option) {
return addOption(new FormField.Option(option));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void receiptManagerListenerTest() throws Exception {
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("[email protected]", equalsCharSequence(fromJid));
Expand Down
Loading

0 comments on commit 0561aaa

Please sign in to comment.