Skip to content

Commit 4abbd12

Browse files
Bump com.google.guava:guava from 33.3.1-jre to 33.4.8-jre (#509)
* Bump com.google.guava:guava from 33.3.1-jre to 33.4.8-jre Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.3.1-jre to 33.4.8-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-version: 33.4.8-jre dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * update Charsets to StandardCharsets --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brandon Arp <[email protected]>
1 parent 7176fcf commit 4abbd12

File tree

19 files changed

+210
-208
lines changed

19 files changed

+210
-208
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<bouncy.castle.version>1.80</bouncy.castle.version>
8080
<client.protocol.version>0.12.0</client.protocol.version>
8181
<fastutil.version>8.5.15</fastutil.version>
82-
<guava.version>33.3.1-jre</guava.version>
82+
<guava.version>33.4.8-jre</guava.version>
8383
<guice.version>7.0.0</guice.version>
8484
<jackson.version>2.18.3</jackson.version>
8585
<javassist.version>3.30.2-GA</javassist.version>

src/main/java/com/arpnetworking/http/Routes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import com.arpnetworking.steno.LogBuilder;
3131
import com.arpnetworking.steno.Logger;
3232
import com.arpnetworking.steno.LoggerFactory;
33-
import com.google.common.base.Charsets;
3433
import com.google.common.base.Stopwatch;
3534
import com.google.common.collect.ImmutableList;
3635
import com.google.common.io.Resources;
@@ -62,6 +61,7 @@
6261
import org.apache.pekko.util.Timeout;
6362

6463
import java.io.Serial;
64+
import java.nio.charset.StandardCharsets;
6565
import java.time.Duration;
6666
import java.util.Objects;
6767
import java.util.Optional;
@@ -388,7 +388,7 @@ private String createMetricName(final HttpRequest request, final int responseSta
388388
static {
389389
String statusJson = "{}";
390390
try {
391-
statusJson = Resources.toString(Resources.getResource("status.json"), Charsets.UTF_8);
391+
statusJson = Resources.toString(Resources.getResource("status.json"), StandardCharsets.UTF_8);
392392
// CHECKSTYLE.OFF: IllegalCatch - Prevent program shutdown
393393
} catch (final Exception e) {
394394
// CHECKSTYLE.ON: IllegalCatch

src/main/java/com/arpnetworking/metrics/mad/Main.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import com.arpnetworking.utility.Launchable;
4444
import com.fasterxml.jackson.databind.JsonNode;
4545
import com.fasterxml.jackson.databind.ObjectMapper;
46-
import com.google.common.base.Charsets;
4746
import com.google.common.collect.ImmutableList;
4847
import com.google.common.collect.Maps;
4948
import com.google.common.collect.Sets;
@@ -81,6 +80,7 @@
8180
import java.io.IOException;
8281
import java.io.InputStreamReader;
8382
import java.net.URI;
83+
import java.nio.charset.StandardCharsets;
8484
import java.security.KeyManagementException;
8585
import java.security.KeyStore;
8686
import java.security.KeyStoreException;
@@ -290,7 +290,7 @@ private HttpsConnectionContext createHttpsContext() {
290290
final PrivateKey privateKey;
291291
try (PEMParser keyReader = new PEMParser(
292292
new InputStreamReader(
293-
new FileInputStream(_configuration.getHttpsKeyPath()), Charsets.UTF_8))) {
293+
new FileInputStream(_configuration.getHttpsKeyPath()), StandardCharsets.UTF_8))) {
294294
final Object keyObject = keyReader.readObject();
295295

296296
if (keyObject instanceof PrivateKeyInfo) {
@@ -309,7 +309,7 @@ private HttpsConnectionContext createHttpsContext() {
309309
final X509Certificate cert;
310310
try (PEMParser certReader = new PEMParser(
311311
new InputStreamReader(
312-
new FileInputStream(_configuration.getHttpsCertificatePath()), Charsets.UTF_8))) {
312+
new FileInputStream(_configuration.getHttpsCertificatePath()), StandardCharsets.UTF_8))) {
313313
final PemObject certObject = certReader.readPemObject();
314314
final CertificateFactory cf = CertificateFactory.getInstance("X.509");
315315
cert = (X509Certificate) cf.generateCertificate(new ByteArrayInputStream(certObject.getContent()));

src/main/java/com/arpnetworking/metrics/mad/parsers/GraphitePlaintextToRecordParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.arpnetworking.metrics.mad.model.DefaultRecord;
2525
import com.arpnetworking.metrics.mad.model.MetricType;
2626
import com.arpnetworking.metrics.mad.model.Record;
27-
import com.google.common.base.Charsets;
2827
import com.google.common.base.Strings;
2928
import com.google.common.collect.ImmutableList;
3029
import com.google.common.collect.ImmutableMap;
@@ -33,6 +32,7 @@
3332
import net.sf.oval.constraint.NotNull;
3433

3534
import java.nio.ByteBuffer;
35+
import java.nio.charset.StandardCharsets;
3636
import java.text.NumberFormat;
3737
import java.text.ParseException;
3838
import java.time.Instant;
@@ -95,14 +95,14 @@ public final class GraphitePlaintextToRecordParser implements Parser<List<Record
9595
*/
9696
public List<Record> parse(final ByteBuffer record) throws ParsingException {
9797
// CHECKSTYLE.OFF: IllegalInstantiation - This is the recommended way
98-
final String line = new String(record.array(), Charsets.UTF_8);
98+
final String line = new String(record.array(), StandardCharsets.UTF_8);
9999
// CHECKSTYLE.ON: IllegalInstantiation
100100

101101
final ImmutableList.Builder<Record> recordListBuilder = ImmutableList.builder();
102102
final ZonedDateTime now = ZonedDateTime.now();
103103
final Matcher matcher = GRAPHITE_PATTERN.matcher(line);
104104
if (!matcher.matches()) {
105-
throw new ParsingException("Invalid graphite line", line.getBytes(Charsets.UTF_8));
105+
throw new ParsingException("Invalid graphite line", line.getBytes(StandardCharsets.UTF_8));
106106
}
107107

108108
// Annotations

src/main/java/com/arpnetworking/metrics/mad/parsers/StatsdToRecordParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.arpnetworking.metrics.mad.model.MetricType;
2525
import com.arpnetworking.metrics.mad.model.Record;
2626
import com.arpnetworking.metrics.mad.model.Unit;
27-
import com.google.common.base.Charsets;
2827
import com.google.common.base.Splitter;
2928
import com.google.common.base.Strings;
3029
import com.google.common.collect.ImmutableList;
@@ -34,6 +33,7 @@
3433
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
3534

3635
import java.nio.ByteBuffer;
36+
import java.nio.charset.StandardCharsets;
3737
import java.text.NumberFormat;
3838
import java.text.ParseException;
3939
import java.time.Clock;
@@ -76,14 +76,14 @@ public final class StatsdToRecordParser implements Parser<List<Record>, ByteBuff
7676
@Override
7777
public List<Record> parse(final ByteBuffer datagram) throws ParsingException {
7878
// CHECKSTYLE.OFF: IllegalInstantiation - This is the recommended way
79-
final String datagramAsString = new String(datagram.array(), Charsets.UTF_8);
79+
final String datagramAsString = new String(datagram.array(), StandardCharsets.UTF_8);
8080
final ImmutableList.Builder<Record> recordListBuilder = ImmutableList.builder();
8181
try {
8282
for (final String line : LINE_SPLITTER.split(datagramAsString)) {
8383
// CHECKSTYLE.ON: IllegalInstantiation
8484
final Matcher matcher = STATSD_PATTERN.matcher(line);
8585
if (!matcher.matches()) {
86-
throw new ParsingException("Invalid statsd line", line.getBytes(Charsets.UTF_8));
86+
throw new ParsingException("Invalid statsd line", line.getBytes(StandardCharsets.UTF_8));
8787
}
8888

8989
// Parse the name

src/main/java/com/arpnetworking/metrics/proxy/models/messages/LogLine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
import com.arpnetworking.logback.annotations.Loggable;
2020
import com.fasterxml.jackson.annotation.JsonIgnore;
21-
import com.google.common.base.Charsets;
2221
import com.google.common.base.MoreObjects;
2322
import com.google.common.primitives.Bytes;
2423
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
2524

2625
import java.nio.charset.Charset;
26+
import java.nio.charset.StandardCharsets;
2727
import java.nio.file.Path;
2828
import java.util.Collections;
2929
import java.util.List;
@@ -68,7 +68,7 @@ public List<Byte> getLine() {
6868
* @return The line data as a {@link String} interpreted as UTF-8.
6969
*/
7070
public String convertLineToString() {
71-
return convertLineToString(Charsets.UTF_8);
71+
return convertLineToString(StandardCharsets.UTF_8);
7272
}
7373

7474
/**

src/main/java/com/arpnetworking/tsdcore/sinks/HttpPostSinkActor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.arpnetworking.steno.LoggerFactory;
2424
import com.arpnetworking.tsdcore.model.PeriodicData;
2525
import com.arpnetworking.tsdcore.model.RequestEntry;
26-
import com.google.common.base.Charsets;
2726
import com.google.common.collect.EvictingQueue;
2827
import com.google.common.collect.ImmutableList;
2928
import com.google.common.collect.ImmutableSet;
@@ -37,6 +36,7 @@
3736
import org.asynchttpclient.Response;
3837
import scala.concurrent.duration.FiniteDuration;
3938

39+
import java.nio.charset.StandardCharsets;
4040
import java.time.Duration;
4141
import java.time.Instant;
4242
import java.util.Collection;
@@ -233,7 +233,7 @@ private void processRejectedRequest(final PostRejected rejected) {
233233
final Optional<String> responseBody = Optional.ofNullable(response.getResponseBody());
234234
final byte[] requestBodyBytes = rejected.getRequest().getByteData();
235235
// CHECKSTYLE.OFF: IllegalInstantiation - This is ok for String from byte[]
236-
final String requestBody = requestBodyBytes == null ? null : new String(requestBodyBytes, Charsets.UTF_8);
236+
final String requestBody = requestBodyBytes == null ? null : new String(requestBodyBytes, StandardCharsets.UTF_8);
237237
// CHECKSTYLE.ON: IllegalInstantiation
238238
LOGGER.warn()
239239
.setMessage("Post rejected")

src/test/java/com/arpnetworking/configuration/DirectoryTriggerTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
package com.arpnetworking.configuration;
1717

1818
import com.arpnetworking.configuration.triggers.DirectoryTrigger;
19-
import com.google.common.base.Charsets;
2019
import org.junit.Assert;
2120
import org.junit.BeforeClass;
2221
import org.junit.Test;
2322

2423
import java.io.File;
2524
import java.io.IOException;
25+
import java.nio.charset.StandardCharsets;
2626
import java.nio.file.Files;
2727
import java.util.Optional;
2828
import java.util.regex.Pattern;
@@ -112,7 +112,7 @@ public void testDirectoryChangedFileCreated() throws IOException {
112112
Assert.assertTrue(trigger.evaluateAndReset());
113113
Assert.assertFalse(trigger.evaluateAndReset());
114114

115-
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(Charsets.UTF_8));
115+
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(StandardCharsets.UTF_8));
116116

117117
Assert.assertTrue(trigger.evaluateAndReset());
118118
}
@@ -134,7 +134,7 @@ public void testDirectoryChangedFileModified() throws IOException, InterruptedEx
134134

135135
// Ensure file system modified time reflects the change
136136
Thread.sleep(1000);
137-
Files.write(file.toPath(), "bar".getBytes(Charsets.UTF_8));
137+
Files.write(file.toPath(), "bar".getBytes(StandardCharsets.UTF_8));
138138

139139
Assert.assertTrue(trigger.evaluateAndReset());
140140
}
@@ -145,7 +145,7 @@ public void testDirectoryChangedFileDeleted() throws IOException {
145145
deleteDirectory(directory);
146146
Files.createDirectory(directory.toPath());
147147
final File file = directory.toPath().resolve("foo.txt").toFile();
148-
Files.write(file.toPath(), "bar".getBytes(Charsets.UTF_8));
148+
Files.write(file.toPath(), "bar".getBytes(StandardCharsets.UTF_8));
149149

150150
final Trigger trigger = new DirectoryTrigger.Builder()
151151
.setDirectory(directory)
@@ -173,10 +173,10 @@ public void testOnlyMatchedName() throws IOException {
173173
Assert.assertTrue(trigger.evaluateAndReset());
174174
Assert.assertFalse(trigger.evaluateAndReset());
175175

176-
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(Charsets.UTF_8));
176+
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(StandardCharsets.UTF_8));
177177
Assert.assertFalse(trigger.evaluateAndReset());
178178

179-
Files.write(directory.toPath().resolve("bar.txt"), "bar".getBytes(Charsets.UTF_8));
179+
Files.write(directory.toPath().resolve("bar.txt"), "bar".getBytes(StandardCharsets.UTF_8));
180180
Assert.assertTrue(trigger.evaluateAndReset());
181181
}
182182

@@ -194,10 +194,10 @@ public void testOnlyMatchedNamePattern() throws IOException {
194194
Assert.assertTrue(trigger.evaluateAndReset());
195195
Assert.assertFalse(trigger.evaluateAndReset());
196196

197-
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(Charsets.UTF_8));
197+
Files.write(directory.toPath().resolve("foo.txt"), "bar".getBytes(StandardCharsets.UTF_8));
198198
Assert.assertFalse(trigger.evaluateAndReset());
199199

200-
Files.write(directory.toPath().resolve("foo.json"), "bar".getBytes(Charsets.UTF_8));
200+
Files.write(directory.toPath().resolve("foo.json"), "bar".getBytes(StandardCharsets.UTF_8));
201201
Assert.assertTrue(trigger.evaluateAndReset());
202202
}
203203

src/test/java/com/arpnetworking/configuration/FileTriggerTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
package com.arpnetworking.configuration;
1717

1818
import com.arpnetworking.configuration.triggers.FileTrigger;
19-
import com.google.common.base.Charsets;
2019
import org.junit.Assert;
2120
import org.junit.BeforeClass;
2221
import org.junit.Test;
2322

2423
import java.io.File;
2524
import java.io.IOException;
25+
import java.nio.charset.StandardCharsets;
2626
import java.nio.file.Files;
2727
import java.nio.file.attribute.FileTime;
2828

@@ -116,7 +116,7 @@ public void testFileCreated() throws IOException {
116116
public void testFileChanged() throws IOException, InterruptedException {
117117
final File file = new File("./target/tmp/filter/FileTriggerTest/testFileChanged");
118118
Files.deleteIfExists(file.toPath());
119-
Files.write(file.toPath(), "foo".getBytes(Charsets.UTF_8));
119+
Files.write(file.toPath(), "foo".getBytes(StandardCharsets.UTF_8));
120120

121121
final Trigger trigger = new FileTrigger.Builder()
122122
.setFile(file)
@@ -127,7 +127,7 @@ public void testFileChanged() throws IOException, InterruptedException {
127127

128128
// Ensure file system modified time reflects the change
129129
Thread.sleep(1000);
130-
Files.write(file.toPath(), "bar".getBytes(Charsets.UTF_8));
130+
Files.write(file.toPath(), "bar".getBytes(StandardCharsets.UTF_8));
131131

132132
Assert.assertTrue(trigger.evaluateAndReset());
133133
}
@@ -136,7 +136,7 @@ public void testFileChanged() throws IOException, InterruptedException {
136136
public void testFileChangedLastModifiedOnly() throws IOException {
137137
final File file = new File("./target/tmp/filter/FileTriggerTest/testFileChangedLastModifiedOnly");
138138
Files.deleteIfExists(file.toPath());
139-
Files.write(file.toPath(), "foo".getBytes(Charsets.UTF_8));
139+
Files.write(file.toPath(), "foo".getBytes(StandardCharsets.UTF_8));
140140
Files.setLastModifiedTime(file.toPath(), FileTime.fromMillis(1418112007000L));
141141

142142
final Trigger trigger = new FileTrigger.Builder()

src/test/java/com/arpnetworking/configuration/jackson/HoconFileSourceTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package com.arpnetworking.configuration.jackson;
1717

18-
import com.google.common.base.Charsets;
1918
import com.google.common.collect.ImmutableSet;
2019
import com.typesafe.config.impl.ConfigImpl;
2120
import org.junit.Assert;
@@ -24,6 +23,7 @@
2423

2524
import java.io.File;
2625
import java.io.IOException;
26+
import java.nio.charset.StandardCharsets;
2727
import java.nio.file.Files;
2828
import java.nio.file.attribute.PosixFilePermission;
2929

@@ -54,7 +54,7 @@ public void testFileDoesNotExist() throws IOException {
5454
@Test
5555
public void testFileUnreadable() throws IOException {
5656
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testFileUnreadable.json");
57-
Files.write(file.toPath(), "foo=\"bar\"".getBytes(Charsets.UTF_8));
57+
Files.write(file.toPath(), "foo=\"bar\"".getBytes(StandardCharsets.UTF_8));
5858
Files.setPosixFilePermissions(file.toPath(), ImmutableSet.of(PosixFilePermission.OWNER_WRITE));
5959
final HoconFileSource source = new HoconFileSource.Builder()
6060
.setFile(file)
@@ -65,7 +65,7 @@ public void testFileUnreadable() throws IOException {
6565
@Test
6666
public void testValidHocon() throws IOException {
6767
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testValidHocon.conf");
68-
Files.write(file.toPath(), "foo:\"bar\"".getBytes(Charsets.UTF_8));
68+
Files.write(file.toPath(), "foo:\"bar\"".getBytes(StandardCharsets.UTF_8));
6969
final HoconFileSource source = new HoconFileSource.Builder()
7070
.setFile(file)
7171
.build();
@@ -77,7 +77,7 @@ public void testValidHocon() throws IOException {
7777
@Test
7878
public void testSystemPropertyDirect() throws IOException {
7979
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testSystemPropertyDirect.hocon");
80-
Files.write(file.toPath(), "".getBytes(Charsets.UTF_8));
80+
Files.write(file.toPath(), "".getBytes(StandardCharsets.UTF_8));
8181
final HoconFileSource source = new HoconFileSource.Builder()
8282
.setFile(file)
8383
.build();
@@ -88,7 +88,7 @@ public void testSystemPropertyDirect() throws IOException {
8888
@Test
8989
public void testSystemPropertyReference() throws IOException {
9090
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testSystemPropertyReference.hocon");
91-
Files.write(file.toPath(), "foo:${HoconFileSourceTest_testSystemPropertyReference_foo}".getBytes(Charsets.UTF_8));
91+
Files.write(file.toPath(), "foo:${HoconFileSourceTest_testSystemPropertyReference_foo}".getBytes(StandardCharsets.UTF_8));
9292
final HoconFileSource source = new HoconFileSource.Builder()
9393
.setFile(file)
9494
.build();
@@ -99,7 +99,7 @@ public void testSystemPropertyReference() throws IOException {
9999
@Test(expected = RuntimeException.class)
100100
public void testInvalidHocon() throws IOException {
101101
final File file = new File("./target/tmp/filter/HoconFileSourceTest/testInvalidHocon.json");
102-
Files.write(file.toPath(), "This=\"not-hocon".getBytes(Charsets.UTF_8));
102+
Files.write(file.toPath(), "This=\"not-hocon".getBytes(StandardCharsets.UTF_8));
103103
new HoconFileSource.Builder()
104104
.setFile(file)
105105
.build();

0 commit comments

Comments
 (0)