Skip to content

Commit fb5ab31

Browse files
authored
Jdk17 update (#260)
update to jdk 17
1 parent d8f1f43 commit fb5ab31

File tree

53 files changed

+394
-219
lines changed

Some content is hidden

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

53 files changed

+394
-219
lines changed

.jdkw

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
JDKW_RELEASE=latest
22
JDKW_DIST=zulu
3-
JDKW_BUILD=8.56.0.21
4-
JDKW_VERSION=8.0.302
3+
JDKW_BUILD=17.36.13-ca
4+
JDKW_VERSION=17.0.4

maven/maven-wrapper.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#Maven download properties
2-
#Tue Sep 17 09:50:02 PDT 2019
3-
checksumAlgorithm=SHA1
2+
#Wed Jan 19 23:16:22 PST 2022
3+
distributionUrl=https\://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
44
verifyDownload=true
5-
distributionUrl=https\://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip
5+
checksumAlgorithm=SHA1

pom.xml

Lines changed: 43 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<groupId>com.arpnetworking.build</groupId>
2020
<artifactId>arpnetworking-parent-pom</artifactId>
21-
<version>2.0.11</version>
21+
<version>3.0.10</version>
2222
<relativePath />
2323
</parent>
2424

@@ -71,64 +71,66 @@
7171

7272
<properties>
7373
<!--Dependency versions-->
74-
<akka.version>2.6.9</akka.version>
75-
<akka.http.version>10.2.6</akka.http.version>
76-
<apache.httpclient.version>4.5.6</apache.httpclient.version>
77-
<apache.httpcore.version>4.4.10</apache.httpcore.version>
78-
<arpnetworking.commons.version>1.19.0</arpnetworking.commons.version>
79-
<aspectjrt.version>1.9.2</aspectjrt.version>
80-
<asynchttpclient.version>2.6.0</asynchttpclient.version>
81-
<bouncy.castle.version>1.69</bouncy.castle.version>
82-
<cglib.version>3.3.0</cglib.version>
74+
<akka.version>2.6.19</akka.version>
75+
<akka.http.version>10.2.9</akka.http.version>
76+
<apache.httpclient.version>4.5.13</apache.httpclient.version>
77+
<apache.httpcore.version>4.4.15</apache.httpcore.version>
78+
<arpnetworking.commons.version>2.0.5</arpnetworking.commons.version>
79+
<aspectjrt.version>1.9.9.1</aspectjrt.version>
80+
<asynchttpclient.version>2.12.3</asynchttpclient.version>
81+
<bouncy.castle.version>1.70</bouncy.castle.version>
8382
<client.protocol.version>0.12.0</client.protocol.version>
84-
<fastutil.version>8.2.2</fastutil.version>
85-
<guava.version>25.1-jre</guava.version>
86-
<guice.version>4.2.2</guice.version>
87-
<jackson.version>2.9.8</jackson.version>
88-
<javassist.version>3.24.1-GA</javassist.version>
89-
<javassist.maven.core.version>0.2.2</javassist.maven.core.version>
83+
<fastutil.version>8.5.8</fastutil.version>
84+
<guava.version>31.1-jre</guava.version>
85+
<guice.version>5.1.0</guice.version>
86+
<jackson.version>2.13.3</jackson.version>
87+
<javassist.version>3.29.1-GA</javassist.version>
88+
<javassist.maven.core.version>0.2.6</javassist.maven.core.version>
9089
<jsr305.version>3.0.2</jsr305.version>
91-
<kafka.client.version>2.2.1</kafka.client.version>
92-
<logback.version>1.2.3</logback.version>
93-
<logback.steno.version>1.18.2</logback.steno.version>
94-
<log4j.over.slf4j.version>1.7.25</log4j.over.slf4j.version>
90+
<kafka.client.version>3.2.1</kafka.client.version>
91+
<logback.version>1.2.11</logback.version>
92+
<logback.steno.version>1.19.0</logback.steno.version>
93+
<log4j.over.slf4j.version>1.7.36</log4j.over.slf4j.version>
9594
<metrics.aggregator.protocol.prometheus.version>1.0.1</metrics.aggregator.protocol.prometheus.version>
9695
<metrics.aggregator.protocol.version>1.0.10</metrics.aggregator.protocol.version>
97-
<metrics.client.version>0.11.3</metrics.client.version>
98-
<metrics.client.http.version>0.11.2</metrics.client.http.version>
99-
<metrics.client.incubator.version>0.11.2</metrics.client.incubator.version>
100-
<metrics.jvm.extra.version>0.11.2</metrics.jvm.extra.version>
101-
<oval.version>1.90</oval.version>
102-
<protobuf.version>3.10.0</protobuf.version>
96+
<metrics.client.version>0.12.1</metrics.client.version>
97+
<metrics.client.http.version>0.12.1</metrics.client.http.version>
98+
<metrics.client.incubator.version>0.12.1</metrics.client.incubator.version>
99+
<metrics.jvm.extra.version>0.12.1</metrics.jvm.extra.version>
100+
<oval.version>3.2.1</oval.version>
101+
<protobuf.version>3.21.5</protobuf.version>
103102
<scala.version>2.13</scala.version>
104-
<scala.library.version>2.13.6</scala.library.version>
105-
<slf4j.version>1.7.25</slf4j.version>
106-
<snappy.version>1.1.7.2</snappy.version>
107-
<spotbugs.annotations.version>3.1.12</spotbugs.annotations.version>
108-
<typesafe.config.version>1.3.3</typesafe.config.version>
103+
<scala.library.version>2.13.8</scala.library.version>
104+
<slf4j.version>1.7.36</slf4j.version>
105+
<snappy.version>1.1.8.4</snappy.version>
106+
<spotbugs.annotations.version>4.7.1</spotbugs.annotations.version>
107+
<typesafe.config.version>1.4.2</typesafe.config.version>
109108
<vertx.core.version>2.1.6</vertx.core.version>
110109

111110
<!--Test dependency versions-->
112111
<commons.math3.version>3.6.1</commons.math3.version>
113-
<hamcrest.version>2.1</hamcrest.version>
112+
<hamcrest.version>2.2</hamcrest.version>
114113
<junit.benchmarks.version>0.7.2</junit.benchmarks.version>
115-
<junit.version>4.12</junit.version>
116-
<metrics.generator.version>1.3.0</metrics.generator.version>
117-
<mockito.version>2.23.4</mockito.version>
114+
<junit.version>4.13.2</junit.version>
115+
<metrics.generator.version>1.4.0</metrics.generator.version>
116+
<mockito.version>4.7.0</mockito.version>
118117
<performance.test.version>1.2.1</performance.test.version>
119118
<statsd.client.timgroup>3.1.0</statsd.client.timgroup>
120-
<wiremock.version>2.20.0</wiremock.version>
119+
<wiremock.version>2.27.2</wiremock.version>
121120

122121
<!-- Additional Plugins -->
123-
<aspectjtools.maven.plugin>1.9.2</aspectjtools.maven.plugin>
124-
<aspectj.maven.plugin.version>1.8</aspectj.maven.plugin.version>
122+
<aspectjtools.maven.plugin>1.9.9.1</aspectjtools.maven.plugin>
123+
<aspectj.maven.plugin.version>1.14.0</aspectj.maven.plugin.version>
125124
<build.helper.plugin.version>3.0.0</build.helper.plugin.version>
126125
<docker.maven.plugin.version>0.27.2</docker.maven.plugin.version>
127126
<javassist.maven.plugin.version>0.2.2</javassist.maven.plugin.version>
128127
<maven.assembly.plugin.version>2.6</maven.assembly.plugin.version>
129128
<maven.properties.plugin.version>1.0.0</maven.properties.plugin.version>
130129
<rpm.maven.plugin.version>2.1.5</rpm.maven.plugin.version>
131130

131+
<!-- Spotbugs -->
132+
<spotbugs.exclude>${project.basedir}/spotbugs.exclude.xml</spotbugs.exclude>
133+
132134
<!-- Code Coverage -->
133135
<jacoco.check.line.coverage>0.50</jacoco.check.line.coverage>
134136
<jacoco.check.branch.coverage>0.49</jacoco.check.branch.coverage>
@@ -329,9 +331,9 @@
329331
</execution>
330332
</executions>
331333
<configuration>
332-
<source>1.8</source>
333-
<target>1.8</target>
334-
<complianceLevel>1.8</complianceLevel>
334+
<source>17</source>
335+
<target>17</target>
336+
<complianceLevel>17</complianceLevel>
335337
<aspectLibraries>
336338
<aspectLibrary>
337339
<groupId>com.arpnetworking.logback</groupId>
@@ -808,12 +810,6 @@
808810
<version>${aspectjrt.version}</version>
809811
<scope>runtime</scope>
810812
</dependency>
811-
<dependency>
812-
<groupId>cglib</groupId>
813-
<artifactId>cglib</artifactId>
814-
<version>${cglib.version}</version>
815-
<scope>runtime</scope>
816-
</dependency>
817813
<dependency>
818814
<groupId>org.xerial.snappy</groupId>
819815
<artifactId>snappy-java</artifactId>

spotbugs.exclude.xml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!--
2+
~ Copyright 2015 Groupon.com
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
<FindBugsFilter>
17+
18+
<!-- Match all DLS_DEAD_LOCAL_STORE violations. As per FindBugs
19+
documentation these generate numerous false positives under Sun/Oracle
20+
compilers.
21+
22+
http://findbugs.sourceforge.net/bugDescriptions.html#DLS_DEAD_LOCAL_STORE
23+
-->
24+
<Match>
25+
<Or>
26+
<Bug pattern="DLS_DEAD_LOCAL_STORE" />
27+
<Bug pattern="EI_EXPOSE_REP"/>
28+
<Bug pattern="EI_EXPOSE_REP2"/>
29+
</Or>
30+
</Match>
31+
32+
<!-- Match all RV_RETURN_VALUE_IGNORED_BAD_PRACTICE violations on all unit
33+
test files since Mockito usage can cause this violation when stating
34+
expectations.
35+
-->
36+
<Match>
37+
<Or>
38+
<Bug pattern="RV_RETURN_VALUE_IGNORED_BAD_PRACTICE" />
39+
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT" />
40+
<Bug pattern="RR_NOT_CHECKED" />
41+
<Bug pattern="SR_NOT_CHECKED" />
42+
<Bug pattern="MC_OVERRIDABLE_METHOD_CALL_IN_CONSTRUCTOR" />
43+
<Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
44+
</Or>
45+
<Or>
46+
<Class name="~.*\.[^\.]+Test" />
47+
<Class name="~.*\.[^\.]+Test\$.*" />
48+
</Or>
49+
</Match>
50+
</FindBugsFilter>

src/main/docker/mad/Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM openjdk:8u302-jre
15+
FROM openjdk:17-slim-bullseye
1616

1717
MAINTAINER arpnetworking
1818

@@ -60,12 +60,7 @@ CMD [ \
6060
"${LOGBACK_CONFIG}", \
6161
"-XX:+HeapDumpOnOutOfMemoryError", \
6262
"-XX:HeapDumpPath=/opt/mad/logs/mad.oom.hprof", \
63-
"-XX:+PrintGCDetails", \
64-
"-XX:+PrintGCDateStamps", \
65-
"-Xloggc:/opt/mad/logs/mad.gc.log", \
66-
"-XX:NumberOfGCLogFiles=2", \
67-
"-XX:GCLogFileSize=50M", \
68-
"-XX:+UseGCLogFileRotation", \
63+
"-Xlog:gc*:file=/opt/mad/logs/mad.gc.log:time,level,tags:filecount=2,filesize=50M", \
6964
"-Xms${JVM_XMS}", \
7065
"-Xmx${JVM_XMX}", \
7166
"-XX:+UseStringDeduplication", \

src/main/java/com/arpnetworking/metrics/common/kafka/ConsumerDeserializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public Consumer<K, V> deserialize(final JsonParser parser, final Deserialization
6666
}
6767

6868
final ObjectMapper mapper = ObjectMapperFactory.getInstance();
69-
final TypeReference<Map<String, String>> configsType = new TypeReference<Map<String, String>>() {};
69+
final TypeReference<Map<String, Object>> configsType = new TypeReference<Map<String, Object>>() {};
7070
final TypeReference<List<String>> topicsType = new TypeReference<List<String>>() {};
7171
final Map<String, Object> configs;
7272
final List<String> topics;

src/main/java/com/arpnetworking/metrics/common/kafka/RunnableConsumerImpl.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818
import com.arpnetworking.commons.builder.OvalBuilder;
1919
import com.arpnetworking.steno.Logger;
2020
import com.arpnetworking.steno.LoggerFactory;
21+
import net.sf.oval.Validator;
2122
import net.sf.oval.constraint.CheckWith;
2223
import net.sf.oval.constraint.CheckWithCheck;
2324
import net.sf.oval.constraint.NotNull;
25+
import net.sf.oval.context.OValContext;
2426
import org.apache.kafka.clients.consumer.Consumer;
2527
import org.apache.kafka.clients.consumer.ConsumerRecord;
2628
import org.apache.kafka.clients.consumer.ConsumerRecords;
2729

30+
import java.io.Serial;
2831
import java.time.Duration;
2932

3033
/**
@@ -150,10 +153,15 @@ public RunnableConsumerImpl.Builder<V> setPollTime(final Duration pollTime) {
150153

151154
private static class PositiveDuration implements CheckWithCheck.SimpleCheck {
152155
@Override
153-
public boolean isSatisfied(final Object validatedObject, final Object value) {
154-
return (value instanceof Duration) && !((Duration) value).isNegative();
156+
public boolean isSatisfied(
157+
final Object validatedObject,
158+
final Object value,
159+
final OValContext context,
160+
final Validator validator) {
161+
return value instanceof Duration && !((Duration) value).isNegative();
155162
}
156163

164+
@Serial
157165
private static final long serialVersionUID = 1L;
158166
}
159167
}

src/main/java/com/arpnetworking/metrics/common/sources/KafkaSource.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,17 @@
2828
import com.arpnetworking.steno.LoggerFactory;
2929
import com.fasterxml.jackson.annotation.JacksonInject;
3030
import com.google.common.base.Stopwatch;
31+
import net.sf.oval.Validator;
3132
import net.sf.oval.constraint.CheckWith;
3233
import net.sf.oval.constraint.CheckWithCheck;
3334
import net.sf.oval.constraint.Min;
3435
import net.sf.oval.constraint.NotNull;
36+
import net.sf.oval.context.OValContext;
3537
import org.apache.kafka.clients.consumer.Consumer;
3638
import org.apache.kafka.clients.consumer.ConsumerRecord;
3739
import org.apache.kafka.common.KafkaException;
3840

41+
import java.io.Serial;
3942
import java.time.Duration;
4043
import java.util.List;
4144
import java.util.Optional;
@@ -425,10 +428,15 @@ protected Builder<V> self() {
425428

426429
private static class PositiveDuration implements CheckWithCheck.SimpleCheck {
427430
@Override
428-
public boolean isSatisfied(final Object validatedObject, final Object value) {
429-
return (value instanceof Duration) && !((Duration) value).isNegative();
431+
public boolean isSatisfied(
432+
final Object validatedObject,
433+
final Object value,
434+
final OValContext context,
435+
final Validator validator) {
436+
return value instanceof Duration && !((Duration) value).isNegative();
430437
}
431438

439+
@Serial
432440
private static final long serialVersionUID = 1L;
433441
}
434442
}

src/main/java/com/arpnetworking/metrics/common/tailer/StatefulTailer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.arpnetworking.utility.Trigger;
2525
import com.google.common.base.MoreObjects;
2626
import net.sf.oval.constraint.NotNull;
27+
import org.bouncycastle.util.encoders.Hex;
2728

2829
import java.io.ByteArrayOutputStream;
2930
import java.io.IOException;
@@ -39,7 +40,6 @@
3940
import java.time.Duration;
4041
import java.util.Objects;
4142
import java.util.Optional;
42-
import javax.xml.bind.DatatypeConverter;
4343

4444
/**
4545
* A reimplementation of the Apache Commons IO tailer based on the 2.5 snapshot
@@ -477,7 +477,7 @@ private Optional<String> computeHash(final SeekableByteChannel reader, final int
477477
// Compute the hash
478478
_md5.reset();
479479
final byte[] digest = _md5.digest(buffer.array());
480-
final String hash = DatatypeConverter.printHexBinary(digest);
480+
final String hash = Hex.toHexString(digest);
481481
LOGGER.trace()
482482
.setMessage("Computed hash")
483483
.addData("hash", hash)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ private void addMetric(
314314
for (final Quantity quantity : metric.getValues()) {
315315
accumulator.accumulate(quantity);
316316
}
317-
for (final CalculatedValue<?> value : metric.getStatistics().getOrDefault(statistic, ImmutableList.of())) {
317+
final ImmutableList<CalculatedValue<?>> statisticValue = metric.getStatistics()
318+
.getOrDefault(statistic, ImmutableList.of());
319+
assert statisticValue != null;
320+
for (final CalculatedValue<?> value : statisticValue) {
318321
accumulator.accumulateAny(value);
319322
}
320323
}

0 commit comments

Comments
 (0)