Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to target compile 17 #7413

Merged
merged 11 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import com.google.common.collect.Multimap;
import com.google.common.collect.PeekingIterator;
import com.google.common.io.BaseEncoding;
import com.google.common.primitives.Longs;
import com.google.common.primitives.UnsignedBytes;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
Expand Down Expand Up @@ -810,7 +809,7 @@ public int compareTo(Key other) {
if (comparison != 0) {
return comparison;
}
return Longs.compare(ts, other.ts);
return Long.compare(ts, other.ts);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ private static Binding setupBinding(Binding binding, boolean mutationsEnabled) {
* access (removes the need for users to create an explicit ~/.java.policy
* file).
*/
// groovysh still sets the security manager, see
// https://github.com/groovy/groovy-core/blob/4c05980922a927b32691e4c3eba5633825cc01e3/subprojects/groovy-groovysh/src/main/groovy/org/codehaus/groovy/tools/shell/Main.groovy#L184C39-L184C60
@SuppressWarnings("removal")
public static void callback(Script script, boolean mutationsEnabled)
throws CompilationFailedException, IOException {
System.setSecurityManager(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package com.palantir.atlasdb.performance;

/**
* Enum for keeping track of JMH parameters {@see @Param}. Edit this enum with caution.
* Enum for keeping track of JMH parameters. Edit this enum with caution.
* The keys must match the name of their associated instance variable.
*/
public enum BenchmarkParam {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public Set<String> getSupportedAnnotationTypes() {

@Override
public SourceVersion getSupportedSourceVersion() {
return SourceVersion.RELEASE_11;
return SourceVersion.RELEASE_17;
fsamuel-bs marked this conversation as resolved.
Show resolved Hide resolved
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ apply plugin: 'com.palantir.jdks'
apply plugin: 'com.palantir.jdks.latest'

javaVersions {
libraryTarget = 11
runtime = 17
libraryTarget = 17
runtime = 17
}

group = 'com.palantir.atlasdb'
Expand Down
5 changes: 5 additions & 0 deletions changelog/@unreleased/pr-7413.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: improvement
improvement:
description: Upgrade AtlasDB to target compile 17
links:
- https://github.com/palantir/atlasdb/pull/7413
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.palantir.util.sql;

import com.google.common.collect.Ordering;
import com.google.common.primitives.Longs;
import com.palantir.util.jmx.AbstractOperationStats;

/**
Expand Down Expand Up @@ -56,7 +55,7 @@ public double get75thPercentileCallTimeMillis() {
}

private static final Ordering<SqlCallStats> TOTAL_TIME_ORDERING = Ordering.from((o1, o2) -> {
int cmp = Longs.compare(o1.getTotalTime(), o2.getTotalTime());
int cmp = Long.compare(o1.getTotalTime(), o2.getTotalTime());
if (cmp != 0) {
return cmp;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
package com.palantir.lock;

import com.google.common.primitives.Longs;
import java.util.Comparator;
import javax.annotation.Nullable;

Expand Down Expand Up @@ -65,6 +64,5 @@ public interface ExpiringToken {
Long getVersionId();

/** A comparator which uses an {@code ExpiringToken}'s expiration date. */
Comparator<ExpiringToken> COMPARATOR =
(o1, o2) -> Longs.compare(o1.getExpirationDateMs(), o2.getExpirationDateMs());
Comparator<ExpiringToken> COMPARATOR = (o1, o2) -> Long.compare(o1.getExpirationDateMs(), o2.getExpirationDateMs());
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.primitives.Longs;
import com.palantir.logsafe.Preconditions;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
Expand Down Expand Up @@ -123,7 +122,7 @@ public void sleep() throws InterruptedException {

@Override
public int compareTo(TimeDuration other) {
return Longs.compare(toNanos(), other.toNanos());
return Long.compare(toNanos(), other.toNanos());
}

@Override
Expand Down
275 changes: 139 additions & 136 deletions versions.lock

Large diffs are not rendered by default.

66 changes: 35 additions & 31 deletions versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,73 +10,70 @@ com.google.auto.service:auto-service-annotations = 1.0
com.google.auto:auto-common = 1.2.2
com.google.code.findbugs:findbugs-annotations = 3.0.1
com.google.code.findbugs:jsr305 = 3.0.2
com.google.dagger:* = 2.51.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned below.

# Ksp version is temporary, can be removed once Maven calms down.
com.google.devtools.ksp:symbol-processing-api = 1.5.21-1.0.0-beta07
com.google.errorprone:* = 2.10.0 # upgrading to 2.11.0 is blocked by a google bug
com.google.errorprone:error_prone_annotations = 2.10.0
com.google.guava:guava = 33.2.1-jre
com.google.protobuf:* = 3.25.3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned below.

com.google.guava:guava = 33.3.1-jre
com.lmax:disruptor = 3.4.2
com.palantir.common:streams = 2.4.0
com.palantir.config.crypto:* = 6.0.0
com.palantir.conjure.java.api:* = 2.53.0
com.palantir.conjure.java.runtime:* = 8.12.0
com.palantir.conjure.java.runtime:* = 8.15.0
com.palantir.conjure.java:* = 8.28.0
com.palantir.conjure:conjure = 4.49.0
com.palantir.dialogue:* = 3.135.0
com.palantir.dialogue:* = 4.1.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Major version bump, but it's fine since most internal products are on 4.x already.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah confirmed large product is on 4.x

com.palantir.docker.proxy:* = 1.6.0
com.palantir.goethe:* = 0.12.0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unpinned from below.

com.palantir.nylon:* = 0.4.0
com.palantir.refreshable:refreshable = 2.5.0
com.palantir.safe-logging:* = 3.7.0
com.palantir.sls.versions:* = 1.5.0
com.palantir.tracing:* = 6.18.0
com.palantir.tritium:* = 0.88.0
com.palantir.tracing:* = 6.20.0
com.palantir.tritium:* = 0.93.0
com.squareup:javapoet = 1.13.0
com.zaxxer:HikariCP = 5.1.0
commons-cli:* = 1.8.0
commons-codec:* = 1.17.0
com.zaxxer:HikariCP = 6.0.0
commons-cli:* = 1.9.0
commons-codec:* = 1.17.1
commons-dbutils:* = 1.8.1
commons-io:* = 2.16.1
commons-io:* = 2.17.0
io.airlift:airline = 0.9
io.netty:* = 4.1.110.Final
io.netty:* = 4.1.114.Final
io.undertow:* = 2.2.37.Final
io.vavr:* = 0.10.4
javax.annotation:javax.annotation-api = 1.3.2
javax.inject:javax.inject = 1
javax.validation:validation-api = 2.0.1.Final
joda-time:joda-time = 2.12.7
joda-time:joda-time = 2.13.0
net.jcip:jcip-annotations = 1.0
net.jpountz.lz4:lz4 = 1.3.0
one.util:streamex = 0.8.2
org.apache.commons:commons-lang3 = 3.14.0
one.util:streamex = 0.8.3
org.apache.commons:commons-lang3 = 3.17.0
org.apache.commons:commons-pool2 = 2.12.0
org.apache.commons:commons-text = 1.12.0
org.apache.httpcomponents.client5:httpclient5 = 5.3.1
org.assertj:* = 3.26.0
org.awaitility:awaitility = 4.2.1
org.assertj:* = 3.26.3
org.awaitility:awaitility = 4.2.2
org.codehaus.groovy:* = 3.0.9
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unpinned from below.

org.derive4j:* = 1.1.1
org.eclipse.collections:* = 11.1.0
org.freemarker:freemarker = 2.3.33
org.glassfish.jersey.core:jersey-common = 2.34
org.gmock:* = 0.8.3
org.immutables:* = 2.10.1
org.jboss.marshalling:jboss-marshalling = 2.1.4.Final
org.jboss.threads:jboss-threads = 3.6.1.Final
org.jboss.marshalling:jboss-marshalling = 2.2.1.Final
org.jboss.threads:jboss-threads = 3.8.0.Final
org.jdbi:* = 3.30.0
org.jmock:jmock* = 2.13.1
org.junit.jupiter:* = 5.10.2
org.junit.platform:* = 1.10.2
org.mindrot:jbcrypt = 0.4
org.mockito:* = 5.12.0
org.openjdk.jmh:* = 1.37
org.reflections:reflections = 0.10.2
org.rocksdb:rocksdbjni = 9.2.1
org.rocksdb:rocksdbjni = 9.6.1
org.slf4j:* = 1.7.36
org.wildfly.common:wildfly-common = 2.0.0
org.wildfly.common:wildfly-common = 2.0.1
org.xerial.snappy:snappy-java = 1.1.10.4
org.xerial:sqlite-jdbc = 3.42.0.0
org.yaml:snakeyaml = 2.2
org.yaml:snakeyaml = 2.3
uk.org.lidalia:slf4j-test = 1.1.0

# Manually upgraded versions
Expand All @@ -94,6 +91,19 @@ io.dropwizard:* = 2.1.7
# Thus we cannot upgrade logback until dropwizard supports jakarta servlet 5.x.x
ch.qos.logback:* = 1.2.11

# Dropwizard 2.1.x DropwizardExtensionsSupport relies on junit 5.10.x and below
# All the below bump junit to an incompatible version. Bump this after bumping Dropwizard to 3.x
org.junit.jupiter:* = 5.10.2
org.junit.platform:* = 1.10.2
org.mockito:* = 5.12.0
Comment on lines +96 to +98
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation inline, pinned from above.


# Dagger 2.52.0+ adds a dependency on jakarta. Bump this with the javax -> jakarta migration.
com.google.dagger:* = 2.51.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explanation inline, pinned from above.


# Large internal consumer still relies on protobuf 3.x.
# We need to bump this in coordination with them.
com.google.protobuf:* = 3.25.4
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned from above to 3.x


# Database drivers can have unexpected breaking changes and should be upgraded with caution
com.datastax.cassandra:cassandra-driver-core = 3.8.0
com.oracle.database.jdbc:ojdbc11 = 23.4.0.24.05
Expand All @@ -102,9 +112,3 @@ org.postgresql:postgresql = 42.7.3

# transitive dep with API breaks in 0.14.0
org.apache.thrift:libthrift = 0.17.0

# Large internal product uses 2.x
org.codehaus.groovy:* = 2.5.14
Comment on lines -106 to -107
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed they have upgraded to 3.x


# Subsequent versions use Java 17, which we don't use right now.
com.palantir.goethe:* = 0.12.0
Comment on lines -109 to -110
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're now in java 17