diff --git a/.bazelrc b/.bazelrc index 9176a895d067..7af932a9c601 100644 --- a/.bazelrc +++ b/.bazelrc @@ -58,16 +58,16 @@ build --copt -DGRPC_BAZEL_BUILD # avoid dreaded "Unrecognized VM option 'CompactStrings'" error build:linux --javabase=@nixpkgs_java_runtime//:runtime build:linux --host_javabase=@nixpkgs_java_runtime//:runtime -build:linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 -build:linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 +build:linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 build:darwin --javabase=@nixpkgs_java_runtime//:runtime build:darwin --host_javabase=@nixpkgs_java_runtime//:runtime -build:darwin --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 -build:darwin --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:darwin --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 +build:darwin --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 build:windows --javabase=@dadew_java_runtime//:runtime build:windows --host_javabase=@dadew_java_runtime//:runtime -build:windows --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 -build:windows --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:windows --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 +build:windows --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 # Do not use a distinct configuration for "host", that is, binaries used # at build time should be the same as release binaries. diff --git a/.dadew b/.dadew index eae04a73d81a..2470625ea454 100644 --- a/.dadew +++ b/.dadew @@ -6,7 +6,7 @@ "bazel", "cacert", "curl", - "java-openjdk-8u302", + "ojdkbuild11", "maven-3.6.1", "msys2", "nodejs-12.17.0", diff --git a/WORKSPACE b/WORKSPACE index 9fa0f613b519..96d7f3e073be 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -515,26 +515,6 @@ nixpkgs_package( repositories = dev_env_nix_repos, ) -#Javadoc -nixpkgs_package( - name = "jdk_nix", - attribute_path = "jdk8", - fail_not_supported = False, - nix_file = "//nix:bazel.nix", - nix_file_deps = common_nix_file_deps, - repositories = dev_env_nix_repos, -) - -# To run canton -nixpkgs_package( - name = "jdk11_nix", - attribute_path = "jdk11", - fail_not_supported = False, - nix_file = "//nix:bazel.nix", - nix_file_deps = common_nix_file_deps, - repositories = dev_env_nix_repos, -) - # This only makes sense on Windows so we just put dummy values in the nix fields. dev_env_tool( name = "makensis_dev_env", @@ -592,11 +572,11 @@ load("//bazel_tools:java.bzl", "dadew_java_configure", "nixpkgs_java_configure") dadew_java_configure( name = "dadew_java_runtime", - dadew_path = "java-openjdk-8u302", + dadew_path = "ojdkbuild11", ) if is_windows else None nixpkgs_java_configure( - attribute_path = "jdk8.home", + attribute_path = "jdk11.home", nix_file = "//nix:bazel.nix", nix_file_deps = common_nix_file_deps, repositories = dev_env_nix_repos, diff --git a/compatibility/.bazelrc b/compatibility/.bazelrc index 9176a895d067..7af932a9c601 100644 --- a/compatibility/.bazelrc +++ b/compatibility/.bazelrc @@ -58,16 +58,16 @@ build --copt -DGRPC_BAZEL_BUILD # avoid dreaded "Unrecognized VM option 'CompactStrings'" error build:linux --javabase=@nixpkgs_java_runtime//:runtime build:linux --host_javabase=@nixpkgs_java_runtime//:runtime -build:linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 -build:linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 +build:linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 build:darwin --javabase=@nixpkgs_java_runtime//:runtime build:darwin --host_javabase=@nixpkgs_java_runtime//:runtime -build:darwin --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 -build:darwin --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:darwin --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 +build:darwin --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 build:windows --javabase=@dadew_java_runtime//:runtime build:windows --host_javabase=@dadew_java_runtime//:runtime -build:windows --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 -build:windows --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:windows --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 +build:windows --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11 # Do not use a distinct configuration for "host", that is, binaries used # at build time should be the same as release binaries. diff --git a/compatibility/BUILD b/compatibility/BUILD index 64ef69eca447..c062d58efc46 100644 --- a/compatibility/BUILD +++ b/compatibility/BUILD @@ -135,7 +135,14 @@ migration_test( ] + # These tests are fairly slow so on PRs we only run them on Linux (["head-quick"] if is_linux else []), - versions = stable_versions, + versions = [ + version + for version in stable_versions + # We skip versions before 1.6.0. These versions had a bug where ledger + # effective time was stored at higher precision than it should have + # been. See https://github.com/digital-asset/daml/pull/11512#discussion_r751041534 + if versions.is_at_least("1.6.0", version) + ], ) if not is_windows else None migration_test( @@ -155,7 +162,14 @@ migration_test( timeout = "eternal", # Exclusive due to hardcoded postgres ports. tags = ["exclusive"], - versions = platform_versions, + versions = [ + version + for version in platform_versions + # We skip versions before 1.6.0. These versions had a bug where ledger + # effective time was stored at higher precision than it should have + # been. See https://github.com/digital-asset/daml/pull/11512#discussion_r751041534 + if versions.is_at_least("1.6.0", version) + ], ) if not is_windows else None [ diff --git a/compatibility/WORKSPACE b/compatibility/WORKSPACE index a8b225a9fb8f..078fe63e02ff 100644 --- a/compatibility/WORKSPACE +++ b/compatibility/WORKSPACE @@ -298,11 +298,11 @@ load("@daml//bazel_tools:java.bzl", "dadew_java_configure", "nixpkgs_java_config dadew_java_configure( name = "dadew_java_runtime", - dadew_path = "java-openjdk-8u302", + dadew_path = "ojdkbuild11", ) if is_windows else None nixpkgs_java_configure( - attribute_path = "jdk8.home", + attribute_path = "jdk11.home", nix_file = "@daml//nix:bazel.nix", nix_file_deps = common_nix_file_deps, repositories = dev_env_nix_repos, diff --git a/compiler/repl-service/protos/BUILD.bazel b/compiler/repl-service/protos/BUILD.bazel index 74cf4fb2d3f9..81a06652c4e9 100644 --- a/compiler/repl-service/protos/BUILD.bazel +++ b/compiler/repl-service/protos/BUILD.bazel @@ -44,6 +44,7 @@ java_library( "@maven//:io_grpc_grpc_core", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", + "@maven//:javax_annotation_javax_annotation_api", ], ) diff --git a/compiler/scenario-service/protos/BUILD.bazel b/compiler/scenario-service/protos/BUILD.bazel index ecf943ebddaa..ef2918e86b70 100644 --- a/compiler/scenario-service/protos/BUILD.bazel +++ b/compiler/scenario-service/protos/BUILD.bazel @@ -44,6 +44,7 @@ java_library( "@maven//:io_grpc_grpc_core", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", + "@maven//:javax_annotation_javax_annotation_api", ], ) diff --git a/daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/NumericModule.scala b/daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/NumericModule.scala index 3be6f4b8bc0c..bd5027dbf5f9 100644 --- a/daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/NumericModule.scala +++ b/daml-lf/data/src/main/scala/com/digitalasset/daml/lf/data/NumericModule.scala @@ -4,11 +4,9 @@ package com.daml.lf.data import scalaz.Order - -import java.math.{BigDecimal, BigInteger} +import java.math.{BigDecimal, BigInteger, RoundingMode} import scala.math.{BigDecimal => BigDec} -import BigDecimal.{ROUND_DOWN, ROUND_HALF_EVEN, ROUND_UNNECESSARY} import scala.util.Try @@ -109,7 +107,7 @@ abstract class NumericModule { * In case of overflow, returns an error message instead. */ final def multiply(scale: Scale, x: Numeric, y: Numeric): Either[String, Numeric] = - checkForOverflow((x multiply y).setScale(scale, ROUND_HALF_EVEN)) + checkForOverflow((x multiply y).setScale(scale, RoundingMode.HALF_EVEN)) /** Divides `x` by `y`. The output has the scale `scale`. If rounding must be * performed, the [[https://en.wikipedia.org/wiki/Rounding#Round_half_to_even> banker's rounding convention]] @@ -117,7 +115,7 @@ abstract class NumericModule { * In case of overflow, returns an error message instead. */ final def divide(scale: Scale, x: Numeric, y: Numeric): Either[String, Numeric] = - checkForOverflow(x.divide(y, scale, ROUND_HALF_EVEN)) + checkForOverflow(x.divide(y, scale, RoundingMode.HALF_EVEN)) /** Returns the integral part of the given decimal, in other words, rounds towards 0. * In case the result does not fit into a long, returns an error message instead. @@ -125,7 +123,7 @@ abstract class NumericModule { * ```Requires the scale of `x` and `y` are the same.``` */ final def toLong(x: Numeric): Either[String, Long] = - Try(x.setScale(0, ROUND_DOWN).longValueExact()).toEither.left.map(_ => + Try(x.setScale(0, RoundingMode.DOWN).longValueExact()).toEither.left.map(_ => s"(Numeric ${x.scale}) ${toString(x)} does not fit into an Int64" ) @@ -136,7 +134,7 @@ abstract class NumericModule { */ final def round(targetScale: Long, x: Numeric): Either[String, Numeric] = if (targetScale <= x.scale && x.scale - maxPrecision < targetScale) - checkForOverflow(x.setScale(targetScale.toInt, ROUND_HALF_EVEN).setScale(x.scale)) + checkForOverflow(x.setScale(targetScale.toInt, RoundingMode.HALF_EVEN).setScale(x.scale)) else Left(s"Bad scale $targetScale, must be between ${x.scale - maxPrecision - 1} and ${x.scale}") @@ -157,7 +155,7 @@ abstract class NumericModule { if (!(x.stripTrailingZeros.scale <= scale)) Left(s"Cannot represent ${toString(x)} as (Numeric $scale) without lost of precision") else - checkForOverflow(x.setScale(scale, ROUND_UNNECESSARY)) + checkForOverflow(x.setScale(scale, RoundingMode.UNNECESSARY)) /** Like `fromBigDecimal(Int, BigDecimal)` but with a scala BigDecimal. */ @@ -269,7 +267,7 @@ abstract class NumericModule { def checkWithinBoundsAndRound(scale: Scale, x: BigDecimal): Either[String, Numeric] = Either.cond( x.precision - x.scale <= maxPrecision - scale, - cast(x.setScale(scale, ROUND_HALF_EVEN)), + cast(x.setScale(scale, RoundingMode.HALF_EVEN)), s"out-of-bounds (Numeric $scale) $x", ) diff --git a/dev-env/windows/manifests/java-openjdk-8u302.json b/dev-env/windows/manifests/java-openjdk-8u302.json deleted file mode 100644 index 26c9d0645291..000000000000 --- a/dev-env/windows/manifests/java-openjdk-8u302.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "description": "OpenJDK 8 binaries built using source code from the CentOS project", - "homepage": "https://github.com/ojdkbuild/ojdkbuild", - "version": "1.8.0.302-1.b08", - "license": "GPL-2.0-with-classpath-exception", - "url": "https://github.com/ojdkbuild/ojdkbuild/releases/download/java-1.8.0-openjdk-1.8.0.302-1.b08/java-1.8.0-openjdk-1.8.0.302-1.b08.ojdkbuild.windows.x86_64.zip", - "hash": "9f0953218662a3dbe32ce63d6944c95a90393aa4682aa0b1ca8c5da8f5c92eb7", - "extract_dir": "java-1.8.0-openjdk-1.8.0.302-1.b08.ojdkbuild.windows.x86_64", - "env_set": { - "JAVA_HOME": "$dir" - }, - "bin": [ - "bin\\java.exe", - "bin\\javac.exe", - "bin\\jps.exe", - "bin\\jhat.exe", - "bin\\jstack.exe", - "bin\\jstat.exe", - "bin\\keytool.exe" - ] -} diff --git a/dev-env/windows/manifests/ojdkbuild11.json b/dev-env/windows/manifests/ojdkbuild11.json new file mode 100644 index 000000000000..94b823972411 --- /dev/null +++ b/dev-env/windows/manifests/ojdkbuild11.json @@ -0,0 +1,32 @@ +{ + "description": "OpenJDK 11 binaries built using source code from the CentOS project", + "homepage": "https://github.com/ojdkbuild/ojdkbuild", + "version": "11.0.12.7-1", + "license": "GPL-2.0-only WITH Classpath-exception-2.0", + "architecture": { + "64bit": { + "url": "https://github.com/ojdkbuild/ojdkbuild/releases/download/java-11-openjdk-11.0.12.7-1/java-11-openjdk-11.0.12.7-1.windows.ojdkbuild.x86_64.zip", + "hash": "656e551e23c1302312e6a497fac3a65fc3ce186bc0a428646ab811294b01a439", + "extract_dir": "java-11-openjdk-11.0.12.7-1.windows.ojdkbuild.x86_64" + } + }, + "env_add_path": "bin", + "env_set": { + "JAVA_HOME": "$dir" + }, + "checkver": { + "url": "https://github.com/ojdkbuild/ojdkbuild/raw/master/README.md", + "re": "download/(?(?:java-11-openjdk-)?(?11[\\db.-]+))/(?java-(?[\\d.]+)-openjdk-([\\db.-]+)(.ojdkbuild|.windows){2}).x86_64.zip" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://github.com/ojdkbuild/ojdkbuild/releases/download/$matchFolder/$matchUrl.x86_64.zip", + "extract_dir": "$matchUrl.x86_64" + } + }, + "hash": { + "url": "$url.sha256" + } + } +} diff --git a/language-support/java/bindings/BUILD.bazel b/language-support/java/bindings/BUILD.bazel index 53c04590fa63..80203634444d 100644 --- a/language-support/java/bindings/BUILD.bazel +++ b/language-support/java/bindings/BUILD.bazel @@ -38,6 +38,7 @@ java_library( "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", + "@maven//:javax_annotation_javax_annotation_api", ], ) @@ -74,6 +75,7 @@ da_java_library( "@maven//:io_grpc_grpc_netty", "@maven//:io_grpc_grpc_protobuf", "@maven//:io_grpc_grpc_stub", + "@maven//:javax_annotation_javax_annotation_api", "@maven//:org_checkerframework_checker", ], ) diff --git a/language-support/java/bindings/src/main/java/com/daml/ledger/javaapi/data/Record.java b/language-support/java/bindings/src/main/java/com/daml/ledger/javaapi/data/Record.java index c6e5c64c8c19..73471fc2637f 100644 --- a/language-support/java/bindings/src/main/java/com/daml/ledger/javaapi/data/Record.java +++ b/language-support/java/bindings/src/main/java/com/daml/ledger/javaapi/data/Record.java @@ -66,6 +66,7 @@ public static Record fromProto(ValueOuterClass.Record record) { // FIXME When removing this after the deprecation period is over, make DamlTextMap.Field final /** @deprecated Use {@link DamlRecord.Field} instead. */ + @Deprecated public static final class Field extends DamlRecord.Field { public Field(@NonNull String label, @NonNull Value value) { diff --git a/language-support/scala/bindings/src/main/scala/com/digitalasset/api/util/util/TimestampConversion.scala b/language-support/scala/bindings/src/main/scala/com/digitalasset/api/util/util/TimestampConversion.scala index 3ed3e8c70e0b..729d39b30227 100644 --- a/language-support/scala/bindings/src/main/scala/com/digitalasset/api/util/util/TimestampConversion.scala +++ b/language-support/scala/bindings/src/main/scala/com/digitalasset/api/util/util/TimestampConversion.scala @@ -33,6 +33,10 @@ object TimestampConversion { } + def roundInstantToMicros(t: Instant): Value.Sum.Timestamp = { + instantToMicros(roundToMicros(t, ConversionMode.HalfUp)) + } + def toInstant(protoTimestamp: ProtoTimestamp): Instant = { Instant.ofEpochSecond(protoTimestamp.seconds, protoTimestamp.nanos.toLong) } diff --git a/ledger-service/http-json-testing/src/main/scala/com/daml/http/HttpServiceTestFixture.scala b/ledger-service/http-json-testing/src/main/scala/com/daml/http/HttpServiceTestFixture.scala index ce0b7d160f66..9ee9f02b162f 100644 --- a/ledger-service/http-json-testing/src/main/scala/com/daml/http/HttpServiceTestFixture.scala +++ b/ledger-service/http-json-testing/src/main/scala/com/daml/http/HttpServiceTestFixture.scala @@ -446,7 +446,7 @@ object HttpServiceTestFixture extends LazyLogging with Assertions with Inside { def accountCreateCommand( owner: domain.Party, number: String, - time: v.Value.Sum.Timestamp = TimestampConversion.instantToMicros(Instant.now), + time: v.Value.Sum.Timestamp = TimestampConversion.roundInstantToMicros(Instant.now), ): domain.CreateCommand[v.Record, domain.TemplateId.OptionalPkg] = { val templateId = domain.TemplateId(None, "Account", "Account") val timeValue = v.Value(time) @@ -466,7 +466,7 @@ object HttpServiceTestFixture extends LazyLogging with Assertions with Inside { def sharedAccountCreateCommand( owners: Seq[String], number: String, - time: v.Value.Sum.Timestamp = TimestampConversion.instantToMicros(Instant.now), + time: v.Value.Sum.Timestamp = TimestampConversion.roundInstantToMicros(Instant.now), ): domain.CreateCommand[v.Record, domain.TemplateId.OptionalPkg] = { val templateId = domain.TemplateId(None, "Account", "SharedAccount") val timeValue = v.Value(time) diff --git a/ledger-service/http-json/BUILD.bazel b/ledger-service/http-json/BUILD.bazel index 4e98990d7f37..54c8f01a4070 100644 --- a/ledger-service/http-json/BUILD.bazel +++ b/ledger-service/http-json/BUILD.bazel @@ -327,6 +327,7 @@ alias( "//runtime-components/non-repudiation", "//runtime-components/non-repudiation-postgresql", "//runtime-components/non-repudiation-testing", + "@maven//:com_google_guava_guava", "@maven//:io_dropwizard_metrics_metrics_core", "@maven//:org_scalatest_scalatest_compatible", ], diff --git a/ledger-service/http-json/src/itlib/scala/http/AbstractHttpServiceIntegrationTest.scala b/ledger-service/http-json/src/itlib/scala/http/AbstractHttpServiceIntegrationTest.scala index bc1b97e9408c..53c0afde9118 100644 --- a/ledger-service/http-json/src/itlib/scala/http/AbstractHttpServiceIntegrationTest.scala +++ b/ledger-service/http-json/src/itlib/scala/http/AbstractHttpServiceIntegrationTest.scala @@ -68,7 +68,7 @@ object AbstractHttpServiceIntegrationTestFuns { def sha256(source: Source[ByteString, Any])(implicit mat: Materializer): Try[String] = Try { import java.security.MessageDigest - import javax.xml.bind.DatatypeConverter + import com.google.common.io.BaseEncoding val md = MessageDigest.getInstance("SHA-256") val is = source.runWith(StreamConverters.asInputStream()) @@ -79,7 +79,7 @@ object AbstractHttpServiceIntegrationTestFuns { dis.on(false) - DatatypeConverter.printHexBinary(md.digest()).toLowerCase + BaseEncoding.base16().lowerCase().encode(md.digest()) } } @@ -1673,7 +1673,7 @@ abstract class AbstractHttpServiceIntegrationTest "query by a variant field" in withHttpService { (uri, encoder, _, _) => val (alice, headers) = getUniquePartyAndAuthHeaders("Alice") val accountNumber = "abc123" - val now = TimestampConversion.instantToMicros(Instant.now) + val now = TimestampConversion.roundInstantToMicros(Instant.now) val nowStr = TimestampConversion.microsToInstant(now).toString val command: domain.CreateCommand[v.Record, OptionalPkg] = accountCreateCommand(alice, accountNumber, now) diff --git a/ledger/ledger-api-test-tool-on-canton/BUILD.bazel b/ledger/ledger-api-test-tool-on-canton/BUILD.bazel index 530ce4cb1861..a78caeb570ec 100644 --- a/ledger/ledger-api-test-tool-on-canton/BUILD.bazel +++ b/ledger/ledger-api-test-tool-on-canton/BUILD.bazel @@ -58,7 +58,7 @@ conformance_test( "@curl_nix//:bin/curl", "@grpcurl_nix//:bin/grpcurl", "@jq_dev_env//:jq", - "@jdk11_nix//:bin/java", + "@bazel_tools//tools/jdk", ], lf_versions = [ "default", @@ -118,7 +118,7 @@ conformance_test( "@curl_nix//:bin/curl", "@grpcurl_nix//:bin/grpcurl", "@jq_dev_env//:jq", - "@jdk11_nix//:bin/java", + "@bazel_tools//tools/jdk", ], lf_versions = [ "default", @@ -153,7 +153,7 @@ conformance_test( "@curl_nix//:bin/curl", "@grpcurl_nix//:bin/grpcurl", "@jq_dev_env//:jq", - "@jdk11_nix//:bin/java", + "@bazel_tools//tools/jdk", ], ports = [ 5011, @@ -187,7 +187,7 @@ conformance_test( "@curl_nix//:bin/curl", "@grpcurl_nix//:bin/grpcurl", "@jq_dev_env//:jq", - "@jdk11_nix//:bin/java", + "@bazel_tools//tools/jdk", ], lf_versions = [ "default", diff --git a/ledger/ledger-api-test-tool-on-canton/canton-test-runner.sh b/ledger/ledger-api-test-tool-on-canton/canton-test-runner.sh index a60a0b9924c2..e741a56b720e 100755 --- a/ledger/ledger-api-test-tool-on-canton/canton-test-runner.sh +++ b/ledger/ledger-api-test-tool-on-canton/canton-test-runner.sh @@ -6,8 +6,7 @@ set -e set -u set -o pipefail -# Canton requires JDK11 in production to avoid ForkJoinPool deadlocks on older JDKs so we run it with JDK11. -JAVA="$(rlocation jdk11_nix/bin/java)" +JAVA="$(rlocation local_jdk/bin/java)" CANTON_COMMAND=( "$(rlocation com_github_digital_asset_daml/ledger/ledger-api-test-tool-on-canton/canton_deploy.jar)" diff --git a/ledger/participant-integration-api/src/main/scala/platform/store/Conversions.scala b/ledger/participant-integration-api/src/main/scala/platform/store/Conversions.scala index c58f0f42094e..6f203a591867 100644 --- a/ledger/participant-integration-api/src/main/scala/platform/store/Conversions.scala +++ b/ledger/participant-integration-api/src/main/scala/platform/store/Conversions.scala @@ -85,7 +85,7 @@ private[platform] object JdbcArrayConversions { implicit object IntOptionArrayArrayToStatement extends ToStatement[Array[Option[Int]]] { override def set(s: PreparedStatement, index: Int, intOpts: Array[Option[Int]]): Unit = { val conn = s.getConnection - val intOrNullsArray = intOpts.map(_.map(new Integer(_)).orNull) + val intOrNullsArray = intOpts.map(_.map(Integer.valueOf(_)).orNull) val ts = conn.createArrayOf("SMALLINT", intOrNullsArray.asInstanceOf[Array[AnyRef]]) s.setArray(index, ts) } diff --git a/nix/default.nix b/nix/default.nix index c7d89b8af5c8..45028a436a79 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -65,7 +65,7 @@ in rec { zinc = pkgs.callPackage ./tools/zinc {}; - jdk = bazel_dependencies.jdk8; + jdk = bazel_dependencies.jdk11; java = jdk; javac = jdk; jinfo = jdk; diff --git a/scala-protoc-plugins/scala-akka/BUILD.bazel b/scala-protoc-plugins/scala-akka/BUILD.bazel index 1b1d1e5a97a4..55bc95fa719a 100644 --- a/scala-protoc-plugins/scala-akka/BUILD.bazel +++ b/scala-protoc-plugins/scala-akka/BUILD.bazel @@ -54,7 +54,7 @@ go_binary( name = "protoc-gen-scala-akka", data = [ ":compiler_plugin_deploy.jar", - "@bazel_tools//tools/jdk:jre", + "@bazel_tools//tools/jdk", ], embed = [":go_default_library"], visibility = ["//visibility:public"], diff --git a/scala-protoc-plugins/scala-akka/protoc-gen-scala-akka.go b/scala-protoc-plugins/scala-akka/protoc-gen-scala-akka.go index 79d1a928eb7e..a418255a9ee5 100644 --- a/scala-protoc-plugins/scala-akka/protoc-gen-scala-akka.go +++ b/scala-protoc-plugins/scala-akka/protoc-gen-scala-akka.go @@ -16,7 +16,7 @@ func main() { // ./bazel-out/host/bin/external/build_stack_rules_proto/scala/linux_amd64_stripped/protoc-gen-scala jar := mustFindInSandbox(path.Dir(os.Args[0]), "compiler_plugin_deploy.jar") - err, exitCode := run("external/local_jdk/jre/bin/java", append([]string{"-jar", jar}, os.Args...), ".", nil) + err, exitCode := run("external/local_jdk/bin/java", append([]string{"-jar", jar}, os.Args...), ".", nil) if err != nil { log.Printf("%v", err) } @@ -83,4 +83,4 @@ func run(entrypoint string, args []string, dir string, env []string) (error, int exitCode = ws.ExitStatus() } return err, exitCode -} \ No newline at end of file +} diff --git a/scala-protoc-plugins/scalapb/BUILD.bazel b/scala-protoc-plugins/scalapb/BUILD.bazel index faab76920f68..1bea49f35ec9 100644 --- a/scala-protoc-plugins/scalapb/BUILD.bazel +++ b/scala-protoc-plugins/scalapb/BUILD.bazel @@ -54,7 +54,7 @@ go_binary( name = "protoc-gen-scalapb", data = [ ":compiler_plugin_deploy.jar", - "@bazel_tools//tools/jdk:jre", + "@bazel_tools//tools/jdk", ], embed = [":go_default_library"], visibility = ["//visibility:public"], diff --git a/scala-protoc-plugins/scalapb/protoc-gen-scalapb.go b/scala-protoc-plugins/scalapb/protoc-gen-scalapb.go index 79d1a928eb7e..a418255a9ee5 100644 --- a/scala-protoc-plugins/scalapb/protoc-gen-scalapb.go +++ b/scala-protoc-plugins/scalapb/protoc-gen-scalapb.go @@ -16,7 +16,7 @@ func main() { // ./bazel-out/host/bin/external/build_stack_rules_proto/scala/linux_amd64_stripped/protoc-gen-scala jar := mustFindInSandbox(path.Dir(os.Args[0]), "compiler_plugin_deploy.jar") - err, exitCode := run("external/local_jdk/jre/bin/java", append([]string{"-jar", jar}, os.Args...), ".", nil) + err, exitCode := run("external/local_jdk/bin/java", append([]string{"-jar", jar}, os.Args...), ".", nil) if err != nil { log.Printf("%v", err) } @@ -83,4 +83,4 @@ func run(entrypoint string, args []string, dir string, env []string) (error, int exitCode = ws.ExitStatus() } return err, exitCode -} \ No newline at end of file +}