Skip to content

Commit beacb5e

Browse files
committed
[build] Bump error prone from 2.9.0 to 2.32.0
1 parent 07d9d69 commit beacb5e

File tree

69 files changed

+266
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+266
-256
lines changed

build-logic/src/main/groovy/org.igniterealtime.smack.java-common-conventions.gradle

+1-2
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,7 @@ dependencies {
142142

143143
testImplementation 'com.jamesmurty.utils:java-xmlbuilder:1.2'
144144

145-
errorprone 'com.google.errorprone:error_prone_core:2.9.0'
146-
errorproneJavac('com.google.errorprone:javac:9+181-r4173-1')
145+
errorprone 'com.google.errorprone:error_prone_core:2.32.0'
147146
}
148147

149148
test {

smack-android-extensions/src/main/java/org/jivesoftware/smackx/ping/android/ServerPingWithAlarmManager.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright © 2014-2021 Florian Schmaus
3+
* Copyright © 2014-2024 Florian Schmaus
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -121,6 +121,7 @@ public boolean isEnabled() {
121121

122122
private static final BroadcastReceiver ALARM_BROADCAST_RECEIVER = new BroadcastReceiver() {
123123
@Override
124+
@SuppressWarnings("LockOnNonEnclosingClassLiteral")
124125
public void onReceive(Context context, Intent intent) {
125126
LOGGER.fine("Ping Alarm broadcast received");
126127
Set<Map.Entry<XMPPConnection, ServerPingWithAlarmManager>> managers;

smack-core/src/main/java/org/jivesoftware/smack/SmackInitialization.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2003-2007 Jive Software, 2014-2020 Florian Schmaus
3+
* Copyright 2003-2007 Jive Software, 2014-2024 Florian Schmaus
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -63,7 +63,7 @@ public final class SmackInitialization {
6363

6464
private static final Logger LOGGER = Logger.getLogger(SmackInitialization.class.getName());
6565

66-
/**
66+
/*
6767
* Loads the configuration from the smack-config.xml and system properties file.
6868
* <p>
6969
* So far this means that:

smack-core/src/main/java/org/jivesoftware/smack/c2s/ModularXmppClientToServerConnection.java

+20-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,8 @@ protected DisconnectedStateDescriptor() {
667667
}
668668

669669
private final class DisconnectedState extends State {
670-
670+
// Invoked via reflection.
671+
@SuppressWarnings("UnusedMethod")
671672
private DisconnectedState(StateDescriptor stateDescriptor,
672673
ModularXmppClientToServerConnectionInternal connectionInternal) {
673674
super(stateDescriptor, connectionInternal);
@@ -708,6 +709,8 @@ private LookupRemoteConnectionEndpointsStateDescriptor() {
708709
private final class LookupRemoteConnectionEndpointsState extends State {
709710
boolean outgoingElementsQueueWasShutdown;
710711

712+
// Invoked via reflection.
713+
@SuppressWarnings("UnusedMethod")
711714
private LookupRemoteConnectionEndpointsState(StateDescriptor stateDescriptor,
712715
ModularXmppClientToServerConnectionInternal connectionInternal) {
713716
super(stateDescriptor, connectionInternal);
@@ -818,6 +821,8 @@ private ConnectedButUnauthenticatedStateDescriptor() {
818821
}
819822

820823
private final class ConnectedButUnauthenticatedState extends State {
824+
// Invoked via reflection.
825+
@SuppressWarnings("UnusedMethod")
821826
private ConnectedButUnauthenticatedState(StateDescriptor stateDescriptor,
822827
ModularXmppClientToServerConnectionInternal connectionInternal) {
823828
super(stateDescriptor, connectionInternal);
@@ -850,6 +855,8 @@ private SaslAuthenticationStateDescriptor() {
850855
}
851856

852857
private final class SaslAuthenticationState extends State {
858+
// Invoked via reflection.
859+
@SuppressWarnings("UnusedMethod")
853860
private SaslAuthenticationState(StateDescriptor stateDescriptor,
854861
ModularXmppClientToServerConnectionInternal connectionInternal) {
855862
super(stateDescriptor, connectionInternal);
@@ -893,13 +900,17 @@ private AuthenticatedButUnboundStateDescriptor() {
893900
}
894901

895902
public static final class ResourceBindingStateDescriptor extends StateDescriptor {
903+
// Invoked via reflection.
904+
@SuppressWarnings("UnusedMethod")
896905
private ResourceBindingStateDescriptor() {
897906
super(ResourceBindingState.class, "RFC 6120 § 7");
898907
addSuccessor(AuthenticatedAndResourceBoundStateDescriptor.class);
899908
}
900909
}
901910

902911
private final class ResourceBindingState extends State {
912+
// Invoked via reflection.
913+
@SuppressWarnings("UnusedMethod")
903914
private ResourceBindingState(StateDescriptor stateDescriptor,
904915
ModularXmppClientToServerConnectionInternal connectionInternal) {
905916
super(stateDescriptor, connectionInternal);
@@ -955,6 +966,8 @@ private AuthenticatedAndResourceBoundStateDescriptor() {
955966
}
956967

957968
private final class AuthenticatedAndResourceBoundState extends State {
969+
// Invoked via reflection.
970+
@SuppressWarnings("UnusedMethod")
958971
private AuthenticatedAndResourceBoundState(StateDescriptor stateDescriptor,
959972
ModularXmppClientToServerConnectionInternal connectionInternal) {
960973
super(stateDescriptor, connectionInternal);
@@ -995,6 +1008,8 @@ private ShutdownStateDescriptor() {
9951008
}
9961009

9971010
private final class ShutdownState extends State {
1011+
// Invoked via reflection.
1012+
@SuppressWarnings("UnusedMethod")
9981013
private ShutdownState(StateDescriptor stateDescriptor,
9991014
ModularXmppClientToServerConnectionInternal connectionInternal) {
10001015
super(stateDescriptor, connectionInternal);
@@ -1057,6 +1072,8 @@ private InstantShutdownStateDescriptor() {
10571072
}
10581073

10591074
private static final class InstantShutdownState extends NoOpState {
1075+
// Invoked via reflection.
1076+
@SuppressWarnings("UnusedMethod")
10601077
private InstantShutdownState(ModularXmppClientToServerConnection connection, StateDescriptor stateDescriptor,
10611078
ModularXmppClientToServerConnectionInternal connectionInternal) {
10621079
super(connection, stateDescriptor, connectionInternal);
@@ -1078,6 +1095,8 @@ private CloseConnectionStateDescriptor() {
10781095
}
10791096

10801097
private final class CloseConnectionState extends State {
1098+
// Invoked via reflection.
1099+
@SuppressWarnings("UnusedMethod")
10811100
private CloseConnectionState(StateDescriptor stateDescriptor,
10821101
ModularXmppClientToServerConnectionInternal connectionInternal) {
10831102
super(stateDescriptor, connectionInternal);

smack-core/src/main/java/org/jivesoftware/smack/compression/CompressionModuleDescriptor.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2018-2020 Florian Schmaus
3+
* Copyright 2018-2024 Florian Schmaus
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -41,6 +41,8 @@ protected CompressionModule constructXmppConnectionModule(
4141

4242
public static final class Builder extends ModularXmppClientToServerConnectionModuleDescriptor.Builder {
4343

44+
// Invoked via reflection.
45+
@SuppressWarnings("UnusedMethod")
4446
private Builder(ModularXmppClientToServerConnectionConfiguration.Builder connectionConfigurationBuilder) {
4547
super(connectionConfigurationBuilder);
4648
}

smack-core/src/main/java/org/jivesoftware/smack/fsm/StateDescriptorGraph.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2018-2021 Florian Schmaus
3+
* Copyright 2018-2024 Florian Schmaus
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -368,7 +368,7 @@ private static <E> void dfs(Collection<GraphVertex<E>> vertexes, Consumer<GraphV
368368
}
369369
}
370370

371-
public static <E> void stateDescriptorGraphToDot(Collection<GraphVertex<StateDescriptor>> vertexes,
371+
public static void stateDescriptorGraphToDot(Collection<GraphVertex<StateDescriptor>> vertexes,
372372
PrintWriter dotOut, boolean breakStateName) {
373373
dotOut.append("digraph {\n");
374374
dfs(vertexes,

smack-core/src/main/java/org/jivesoftware/smack/isr/InstantStreamResumptionModuleDescriptor.java

+2
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ protected InstantStreamResumptionModule constructXmppConnectionModule(
4141

4242
public static final class Builder extends ModularXmppClientToServerConnectionModuleDescriptor.Builder {
4343

44+
// Unfinished implementation.
45+
@SuppressWarnings("UnusedMethod")
4446
private Builder(ModularXmppClientToServerConnectionConfiguration.Builder connectionConfigurationBuilder) {
4547
super(connectionConfigurationBuilder);
4648
}

smack-core/src/main/java/org/jivesoftware/smack/proxy/HTTPProxySocketConnection.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.net.HttpURLConnection;
2424
import java.net.InetSocketAddress;
2525
import java.net.Socket;
26+
import java.nio.charset.StandardCharsets;
2627
import java.util.regex.Matcher;
2728
import java.util.regex.Pattern;
2829

@@ -58,7 +59,7 @@ public void connect(Socket socket, String host, int port, int timeout)
5859
proxyLine = "\r\nProxy-Authorization: Basic " + Base64.encode(username + ":" + password);
5960
}
6061
socket.getOutputStream().write((hostport + " HTTP/1.1\r\nHost: "
61-
+ host + ":" + port + proxyLine + "\r\n\r\n").getBytes("UTF-8"));
62+
+ host + ":" + port + proxyLine + "\r\n\r\n").getBytes(StandardCharsets.UTF_8));
6263

6364
InputStream in = socket.getInputStream();
6465
StringBuilder got = new StringBuilder(100);

smack-core/src/main/java/org/jivesoftware/smack/util/CollectionUtil.java

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public interface Predicate<T> {
5555
boolean test(T t);
5656
}
5757

58+
@SuppressWarnings("NonApiType")
5859
public static <T> ArrayList<T> newListWith(Collection<? extends T> collection) {
5960
if (collection == null) {
6061
return null;

smack-core/src/main/java/org/jivesoftware/smack/util/Pair.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ private Pair(F first, S second) {
2626
this.second = second;
2727
}
2828

29-
public static <F extends Object, S extends Object> Pair<F, S> create(F first, S second) {
29+
public static <F, S> Pair<F, S> create(F first, S second) {
3030
return new Pair<>(first, second);
3131
}
3232

3333
@SuppressWarnings("ReturnValueIgnored")
34-
public static <F extends Object, S extends Object> Pair<F, S> createAndInitHashCode(F first, S second) {
34+
public static <F, S> Pair<F, S> createAndInitHashCode(F first, S second) {
3535
Pair<F, S> pair = new Pair<>(first, second);
3636
pair.hashCode();
3737
return pair;

smack-core/src/main/java/org/jivesoftware/smack/util/SecurityUtil.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
*
3-
* Copyright 2019 Florian Schmaus.
3+
* Copyright 2019-2024 Florian Schmaus.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ public class SecurityUtil {
2626

2727
private static final LruCache<Class<? extends Provider>, Void> INSERTED_PROVIDERS_CACHE = new LruCache<>(8);
2828

29+
@SuppressWarnings("LockOnNonEnclosingClassLiteral")
2930
public static void ensureProviderAtFirstPosition(Class<? extends Provider> providerClass) {
3031
if (INSERTED_PROVIDERS_CACHE.containsKey(providerClass)) {
3132
return;
@@ -41,7 +42,7 @@ public static void ensureProviderAtFirstPosition(Class<? extends Provider> provi
4142

4243
String providerName = provider.getName();
4344

44-
int installedPosition ;
45+
int installedPosition;
4546
synchronized (Security.class) {
4647
Security.removeProvider(providerName);
4748
installedPosition = Security.insertProviderAt(provider, 1);

smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public static void appendTo(Collection<? extends Object> collection, StringBuild
464464
appendTo(collection, ", ", sb);
465465
}
466466

467-
public static <O extends Object> void appendTo(Collection<O> collection, StringBuilder sb,
467+
public static <O> void appendTo(Collection<O> collection, StringBuilder sb,
468468
Consumer<O> appendFunction) {
469469
appendTo(collection, ", ", sb, appendFunction);
470470
}
@@ -473,7 +473,7 @@ public static void appendTo(Collection<? extends Object> collection, String deli
473473
appendTo(collection, delimiter, sb, o -> sb.append(o));
474474
}
475475

476-
public static <O extends Object> void appendTo(Collection<O> collection, String delimiter, StringBuilder sb,
476+
public static <O> void appendTo(Collection<O> collection, String delimiter, StringBuilder sb,
477477
Consumer<O> appendFunction) {
478478
for (Iterator<O> it = collection.iterator(); it.hasNext();) {
479479
O cs = it.next();

smack-examples/src/main/java/org/igniterealtime/smack/examples/OmemoClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public void handleInput(String input)
185185

186186
BareJid contact = JidCreate.bareFrom(com[1]);
187187

188-
HashMap<OmemoDevice, OmemoFingerprint> devices;
188+
Map<OmemoDevice, OmemoFingerprint> devices;
189189
try {
190190
devices = omemoManager.getActiveFingerprints(contact);
191191
} catch (CorruptedOmemoKeyException | CannotEstablishOmemoSessionException | SmackException.NoResponseException e) {

smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MUCLightRoomConfiguration.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
package org.jivesoftware.smackx.muclight;
1818

19-
import java.util.HashMap;
19+
import java.util.Map;
2020

2121
/**
2222
* MUC Light room configuration class.
@@ -28,7 +28,7 @@ public class MUCLightRoomConfiguration {
2828

2929
private final String roomName;
3030
private final String subject;
31-
private final HashMap<String, String> customConfigs;
31+
private final Map<String, String> customConfigs;
3232

3333
/**
3434
* MUC Light room configuration model constructor.
@@ -37,7 +37,7 @@ public class MUCLightRoomConfiguration {
3737
* @param subject TODO javadoc me please
3838
* @param customConfigs TODO javadoc me please
3939
*/
40-
public MUCLightRoomConfiguration(String roomName, String subject, HashMap<String, String> customConfigs) {
40+
public MUCLightRoomConfiguration(String roomName, String subject, Map<String, String> customConfigs) {
4141
this.roomName = roomName;
4242
this.subject = subject;
4343
this.customConfigs = customConfigs;
@@ -66,7 +66,7 @@ public String getSubject() {
6666
*
6767
* @return the custom configurations of the room.
6868
*/
69-
public HashMap<String, String> getCustomConfigs() {
69+
public Map<String, String> getCustomConfigs() {
7070
return customConfigs;
7171
}
7272

smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MUCLightRoomInfo.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
package org.jivesoftware.smackx.muclight;
1818

19-
import java.util.HashMap;
19+
import java.util.Map;
2020

2121
import org.jxmpp.jid.Jid;
2222

@@ -30,7 +30,7 @@ public class MUCLightRoomInfo {
3030
private final String version;
3131
private final Jid room;
3232
private final MUCLightRoomConfiguration configuration;
33-
private final HashMap<Jid, MUCLightAffiliation> occupants;
33+
private final Map<Jid, MUCLightAffiliation> occupants;
3434

3535
/**
3636
* MUC Light room info model constructor.
@@ -41,7 +41,7 @@ public class MUCLightRoomInfo {
4141
* @param occupants TODO javadoc me please
4242
*/
4343
public MUCLightRoomInfo(String version, Jid roomJid, MUCLightRoomConfiguration configuration,
44-
HashMap<Jid, MUCLightAffiliation> occupants) {
44+
Map<Jid, MUCLightAffiliation> occupants) {
4545
this.version = version;
4646
this.room = roomJid;
4747
this.configuration = configuration;
@@ -80,7 +80,7 @@ public MUCLightRoomConfiguration getConfiguration() {
8080
*
8181
* @return the occupants of the room.
8282
*/
83-
public HashMap<Jid, MUCLightAffiliation> getOccupants() {
83+
public Map<Jid, MUCLightAffiliation> getOccupants() {
8484
return occupants;
8585
}
8686

0 commit comments

Comments
 (0)