Skip to content

Commit 2f321df

Browse files
committed
techdebt: [FFM-12512]: Fix build for JDK 24
1 parent 7020a49 commit 2f321df

File tree

5 files changed

+24
-21
lines changed

5 files changed

+24
-21
lines changed

build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ plugins {
2020
id 'jacoco-report-aggregation'
2121
id "com.github.spotbugs" version libs.versions.spotbugs
2222
id "org.owasp.dependencycheck" version libs.versions.depcheck
23-
id 'me.champeau.jmh' version '0.6.8' // Added JMH plugin
24-
id "com.vanniktech.maven.publish" version "0.33.0"
23+
id "com.vanniktech.maven.publish" version libs.versions.maven.publish
2524
}
2625

2726

@@ -57,10 +56,6 @@ dependencies {
5756

5857
compileOnly libs.lombok
5958
annotationProcessor libs.lombok
60-
61-
// JMH dependencies
62-
implementation 'org.openjdk.jmh:jmh-core:1.37'
63-
annotationProcessor 'org.openjdk.jmh:jmh-generator-annprocess:1.37'
6459
}
6560

6661
group = 'io.harness'
@@ -113,6 +108,10 @@ testing {
113108
implementation libs.okhttp3.mockwebserver
114109
compileOnly libs.lombok
115110
annotationProcessor libs.lombok
111+
112+
// JMH dependencies
113+
implementation libs.jmh.core
114+
annotationProcessor libs.jmh.annotations
116115
}
117116

118117
targets {

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-rc-3-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

settings.gradle

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencyResolutionManagement {
1717
library('swagger-annotations', 'io.swagger:swagger-annotations:1.6.2')
1818
library('javax-annotation-api', 'javax.annotation:javax.annotation-api:1.2')
1919
library('slf4j-api', 'org.slf4j:slf4j-api:1.7.36')
20-
library('lombok', 'org.projectlombok:lombok:1.18.30')
20+
library('lombok', 'org.projectlombok:lombok:1.18.38')
2121
library('google-findbugs', 'com.google.code.findbugs:jsr305:3.0.2')
2222

2323
// test libs
@@ -26,6 +26,9 @@ dependencyResolutionManagement {
2626
library('junit-bom', 'org.junit:junit-bom:5.10.1')
2727
library('mockito-junit5', 'org.mockito:mockito-junit-jupiter:4.8.1')
2828
library('okhttp3-mockwebserver', 'com.squareup.okhttp3', 'mockwebserver').versionRef('okhttp3')
29+
version('jmh', '1.37')
30+
library('jmh-core', 'org.openjdk.jmh', 'jmh-core').versionRef('jmh')
31+
library('jmh-annotations', 'org.openjdk.jmh', 'jmh-generator-annprocess').versionRef('jmh')
2932

3033
// examples
3134
library('bc', 'org.bouncycastle:bcpkix-jdk18on:1.78.1')
@@ -35,10 +38,11 @@ dependencyResolutionManagement {
3538
// do not upgrade openapi, doing so will break compatibility with customers using SpringBoot 2.5.x
3639
// (newer 5.x.x generators use APIs not present in okhttp 3.14.9)
3740
version('openapi.generator', '4.3.1')
38-
version('spotless', '6.23.3')
41+
version('spotless', '7.1.0')
3942
version('depsize', '0.2.0')
40-
version('spotbugs', '6.0.4')
43+
version('spotbugs', '6.1.5')
4144
version('depcheck', '9.0.7')
45+
version('maven.publish', '0.33.0')
4246
}
4347
}
4448
}

src/test/java/io/harness/cf/client/api/StorageRepositoryTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ void shouldStoreCurrentConfig() throws Exception {
5050
assertNotNull(current);
5151

5252
// check if the current version is correct
53-
assertEquals(current.getVersion(), new Long(2));
53+
assertEquals(current.getVersion(), 2L);
5454
}
5555

5656
@Test
@@ -84,7 +84,7 @@ void shouldStoreCurrentConfigWithFileStore() throws Exception {
8484
assertNotNull(current);
8585

8686
// check if the current version is correct
87-
assertEquals(current.getVersion(), new Long(2));
87+
assertEquals(current.getVersion(), 2L);
8888
}
8989

9090
@Test
@@ -118,8 +118,8 @@ void shouldStorePreviousAndCurrentConfigWithFileStore() throws Exception {
118118
assertNotNull(current);
119119

120120
// check if the current version is correct
121-
assertEquals(previous.getVersion(), new Long(1));
122-
assertEquals(current.getVersion(), new Long(2));
121+
assertEquals(previous.getVersion(), 1L);
122+
assertEquals(current.getVersion(), 2L);
123123
}
124124

125125
@Test
@@ -146,8 +146,8 @@ void shouldStorePreviousAndCurrentConfig() throws Exception {
146146
assertNotNull(current);
147147

148148
// check if the current version is correct
149-
assertEquals(previous.getVersion(), new Long(1));
150-
assertEquals(current.getVersion(), new Long(2));
149+
assertEquals(previous.getVersion(), 1L);
150+
assertEquals(current.getVersion(), 2L);
151151
}
152152

153153
@Test
@@ -176,8 +176,8 @@ void shouldDeletePreviousAndCurrentConfig() throws Exception {
176176
assertNotNull(current);
177177

178178
// check if the current version is correct
179-
assertEquals(previous.getVersion(), new Long(1));
180-
assertEquals(current.getVersion(), new Long(2));
179+
assertEquals(previous.getVersion(), 1L);
180+
assertEquals(current.getVersion(), 2L);
181181

182182
// delete config
183183
repository.deleteFlag(featureIdentifier);
@@ -233,7 +233,7 @@ private List<FeatureConfig> makeFeatureList(FeatureConfig fc) {
233233

234234
private FeatureConfig GetUpdatedFeatureConfigFromFile() throws Exception {
235235
FeatureConfig fc = GetFeatureConfigFromFile();
236-
fc.setVersion(new Long(2));
236+
fc.setVersion(2L);
237237
return fc;
238238
}
239239

@@ -262,7 +262,7 @@ private List<FeatureConfig> createBenchmarkData(int flagNumber, int version) thr
262262
for (int i = 1; i <= flagNumber; i++) {
263263
FeatureConfig f = fg;
264264
f.setFeature("simpleBool" + i);
265-
f.setVersion(new Long(version));
265+
f.setVersion((long) version);
266266
list.add(f);
267267
}
268268
// System.out.println(list);

src/test/java/io/harness/cf/client/api/TestUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public List<FeatureConfig> CreateBenchmarkData(int size, int version) throws Exc
4242
for (int i = 1; i <= size; i++) {
4343
FeatureConfig f = fg;
4444
f.setFeature("simpleBool" + i);
45-
f.setVersion(new Long(version));
45+
f.setVersion((long) version);
4646
// we are copying objects
4747
FeatureConfig df = gson.fromJson(gson.toJson(f), FeatureConfig.class);
4848
list.add(df);

0 commit comments

Comments
 (0)