Skip to content

Commit

Permalink
[build] Bump error prone from 2.9.0 to 2.32.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Flowdalic committed Sep 25, 2024
1 parent 07d9d69 commit beacb5e
Show file tree
Hide file tree
Showing 69 changed files with 266 additions and 256 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ dependencies {

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

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

test {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright © 2014-2021 Florian Schmaus
* Copyright © 2014-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -121,6 +121,7 @@ public boolean isEnabled() {

private static final BroadcastReceiver ALARM_BROADCAST_RECEIVER = new BroadcastReceiver() {
@Override
@SuppressWarnings("LockOnNonEnclosingClassLiteral")
public void onReceive(Context context, Intent intent) {
LOGGER.fine("Ping Alarm broadcast received");
Set<Map.Entry<XMPPConnection, ServerPingWithAlarmManager>> managers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2003-2007 Jive Software, 2014-2020 Florian Schmaus
* Copyright 2003-2007 Jive Software, 2014-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -63,7 +63,7 @@ public final class SmackInitialization {

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

/**
/*
* Loads the configuration from the smack-config.xml and system properties file.
* <p>
* So far this means that:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ protected DisconnectedStateDescriptor() {
}

private final class DisconnectedState extends State {

// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private DisconnectedState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down Expand Up @@ -708,6 +709,8 @@ private LookupRemoteConnectionEndpointsStateDescriptor() {
private final class LookupRemoteConnectionEndpointsState extends State {
boolean outgoingElementsQueueWasShutdown;

// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private LookupRemoteConnectionEndpointsState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down Expand Up @@ -818,6 +821,8 @@ private ConnectedButUnauthenticatedStateDescriptor() {
}

private final class ConnectedButUnauthenticatedState extends State {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private ConnectedButUnauthenticatedState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down Expand Up @@ -850,6 +855,8 @@ private SaslAuthenticationStateDescriptor() {
}

private final class SaslAuthenticationState extends State {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private SaslAuthenticationState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down Expand Up @@ -893,13 +900,17 @@ private AuthenticatedButUnboundStateDescriptor() {
}

public static final class ResourceBindingStateDescriptor extends StateDescriptor {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private ResourceBindingStateDescriptor() {
super(ResourceBindingState.class, "RFC 6120 § 7");
addSuccessor(AuthenticatedAndResourceBoundStateDescriptor.class);
}
}

private final class ResourceBindingState extends State {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private ResourceBindingState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down Expand Up @@ -955,6 +966,8 @@ private AuthenticatedAndResourceBoundStateDescriptor() {
}

private final class AuthenticatedAndResourceBoundState extends State {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private AuthenticatedAndResourceBoundState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down Expand Up @@ -995,6 +1008,8 @@ private ShutdownStateDescriptor() {
}

private final class ShutdownState extends State {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private ShutdownState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down Expand Up @@ -1057,6 +1072,8 @@ private InstantShutdownStateDescriptor() {
}

private static final class InstantShutdownState extends NoOpState {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private InstantShutdownState(ModularXmppClientToServerConnection connection, StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(connection, stateDescriptor, connectionInternal);
Expand All @@ -1078,6 +1095,8 @@ private CloseConnectionStateDescriptor() {
}

private final class CloseConnectionState extends State {
// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private CloseConnectionState(StateDescriptor stateDescriptor,
ModularXmppClientToServerConnectionInternal connectionInternal) {
super(stateDescriptor, connectionInternal);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2018-2020 Florian Schmaus
* Copyright 2018-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -41,6 +41,8 @@ protected CompressionModule constructXmppConnectionModule(

public static final class Builder extends ModularXmppClientToServerConnectionModuleDescriptor.Builder {

// Invoked via reflection.
@SuppressWarnings("UnusedMethod")
private Builder(ModularXmppClientToServerConnectionConfiguration.Builder connectionConfigurationBuilder) {
super(connectionConfigurationBuilder);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2018-2021 Florian Schmaus
* Copyright 2018-2024 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -368,7 +368,7 @@ private static <E> void dfs(Collection<GraphVertex<E>> vertexes, Consumer<GraphV
}
}

public static <E> void stateDescriptorGraphToDot(Collection<GraphVertex<StateDescriptor>> vertexes,
public static void stateDescriptorGraphToDot(Collection<GraphVertex<StateDescriptor>> vertexes,
PrintWriter dotOut, boolean breakStateName) {
dotOut.append("digraph {\n");
dfs(vertexes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ protected InstantStreamResumptionModule constructXmppConnectionModule(

public static final class Builder extends ModularXmppClientToServerConnectionModuleDescriptor.Builder {

// Unfinished implementation.
@SuppressWarnings("UnusedMethod")
private Builder(ModularXmppClientToServerConnectionConfiguration.Builder connectionConfigurationBuilder) {
super(connectionConfigurationBuilder);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

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

InputStream in = socket.getInputStream();
StringBuilder got = new StringBuilder(100);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public interface Predicate<T> {
boolean test(T t);
}

@SuppressWarnings("NonApiType")
public static <T> ArrayList<T> newListWith(Collection<? extends T> collection) {
if (collection == null) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ private Pair(F first, S second) {
this.second = second;
}

public static <F extends Object, S extends Object> Pair<F, S> create(F first, S second) {
public static <F, S> Pair<F, S> create(F first, S second) {
return new Pair<>(first, second);
}

@SuppressWarnings("ReturnValueIgnored")
public static <F extends Object, S extends Object> Pair<F, S> createAndInitHashCode(F first, S second) {
public static <F, S> Pair<F, S> createAndInitHashCode(F first, S second) {
Pair<F, S> pair = new Pair<>(first, second);
pair.hashCode();
return pair;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2019 Florian Schmaus.
* Copyright 2019-2024 Florian Schmaus.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -26,6 +26,7 @@ public class SecurityUtil {

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

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

String providerName = provider.getName();

int installedPosition ;
int installedPosition;
synchronized (Security.class) {
Security.removeProvider(providerName);
installedPosition = Security.insertProviderAt(provider, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public static void appendTo(Collection<? extends Object> collection, StringBuild
appendTo(collection, ", ", sb);
}

public static <O extends Object> void appendTo(Collection<O> collection, StringBuilder sb,
public static <O> void appendTo(Collection<O> collection, StringBuilder sb,
Consumer<O> appendFunction) {
appendTo(collection, ", ", sb, appendFunction);
}
Expand All @@ -473,7 +473,7 @@ public static void appendTo(Collection<? extends Object> collection, String deli
appendTo(collection, delimiter, sb, o -> sb.append(o));
}

public static <O extends Object> void appendTo(Collection<O> collection, String delimiter, StringBuilder sb,
public static <O> void appendTo(Collection<O> collection, String delimiter, StringBuilder sb,
Consumer<O> appendFunction) {
for (Iterator<O> it = collection.iterator(); it.hasNext();) {
O cs = it.next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void handleInput(String input)

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

HashMap<OmemoDevice, OmemoFingerprint> devices;
Map<OmemoDevice, OmemoFingerprint> devices;
try {
devices = omemoManager.getActiveFingerprints(contact);
} catch (CorruptedOmemoKeyException | CannotEstablishOmemoSessionException | SmackException.NoResponseException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.jivesoftware.smackx.muclight;

import java.util.HashMap;
import java.util.Map;

/**
* MUC Light room configuration class.
Expand All @@ -28,7 +28,7 @@ public class MUCLightRoomConfiguration {

private final String roomName;
private final String subject;
private final HashMap<String, String> customConfigs;
private final Map<String, String> customConfigs;

/**
* MUC Light room configuration model constructor.
Expand All @@ -37,7 +37,7 @@ public class MUCLightRoomConfiguration {
* @param subject TODO javadoc me please
* @param customConfigs TODO javadoc me please
*/
public MUCLightRoomConfiguration(String roomName, String subject, HashMap<String, String> customConfigs) {
public MUCLightRoomConfiguration(String roomName, String subject, Map<String, String> customConfigs) {
this.roomName = roomName;
this.subject = subject;
this.customConfigs = customConfigs;
Expand Down Expand Up @@ -66,7 +66,7 @@ public String getSubject() {
*
* @return the custom configurations of the room.
*/
public HashMap<String, String> getCustomConfigs() {
public Map<String, String> getCustomConfigs() {
return customConfigs;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
package org.jivesoftware.smackx.muclight;

import java.util.HashMap;
import java.util.Map;

import org.jxmpp.jid.Jid;

Expand All @@ -30,7 +30,7 @@ public class MUCLightRoomInfo {
private final String version;
private final Jid room;
private final MUCLightRoomConfiguration configuration;
private final HashMap<Jid, MUCLightAffiliation> occupants;
private final Map<Jid, MUCLightAffiliation> occupants;

/**
* MUC Light room info model constructor.
Expand All @@ -41,7 +41,7 @@ public class MUCLightRoomInfo {
* @param occupants TODO javadoc me please
*/
public MUCLightRoomInfo(String version, Jid roomJid, MUCLightRoomConfiguration configuration,
HashMap<Jid, MUCLightAffiliation> occupants) {
Map<Jid, MUCLightAffiliation> occupants) {
this.version = version;
this.room = roomJid;
this.configuration = configuration;
Expand Down Expand Up @@ -80,7 +80,7 @@ public MUCLightRoomConfiguration getConfiguration() {
*
* @return the occupants of the room.
*/
public HashMap<Jid, MUCLightAffiliation> getOccupants() {
public Map<Jid, MUCLightAffiliation> getOccupants() {
return occupants;
}

Expand Down
Loading

0 comments on commit beacb5e

Please sign in to comment.