From 83dd9a96dabe0b349efc94d0240354437ac86f71 Mon Sep 17 00:00:00 2001 From: Chris Rankin Date: Thu, 30 Apr 2020 11:58:03 +0100 Subject: [PATCH] CORDA-3738: Upgrade to DJVM 1.1-RC02. (#6195) * CORDA-3738: Upgrade to DJVM 1.1-RC02. * Update comment for DJVM 1.1's new requirements. --- constants.properties | 2 +- .../core/internal/TransactionVerifierServiceInternal.kt | 5 ++--- .../node/services/NonDeterministicContractVerifyTest.kt | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/constants.properties b/constants.properties index ee49879ec12..3dd54c0bf06 100644 --- a/constants.properties +++ b/constants.properties @@ -30,7 +30,7 @@ snakeYamlVersion=1.19 caffeineVersion=2.7.0 metricsVersion=4.1.0 metricsNewRelicVersion=1.1.1 -djvmVersion=1.1-RC01 +djvmVersion=1.1-RC02 deterministicRtVersion=1.0-RC02 openSourceBranch=https://github.com/corda/corda/blob/release/os/4.4 openSourceSamplesBranch=https://github.com/corda/samples/blob/release-V4 diff --git a/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt b/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt index 30556d85e97..32dd39be5fe 100644 --- a/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt +++ b/core/src/main/kotlin/net/corda/core/internal/TransactionVerifierServiceInternal.kt @@ -401,8 +401,7 @@ class ContractVerifier(private val transactionClassLoader: ClassLoader) : Functi override fun apply(ltx: LedgerTransaction) { val contractClassNames = (ltx.inputs.map(StateAndRef::state) + ltx.outputs) - .map(TransactionState<*>::contract) - .toSet() + .mapTo(LinkedHashSet(), TransactionState<*>::contract) contractClassNames.associateBy( { it }, { createContractClass(ltx.id, it) } @@ -410,7 +409,7 @@ class ContractVerifier(private val transactionClassLoader: ClassLoader) : Functi try { /** * This function must execute with the DJVM's sandbox, which does not - * permit user code to access [java.lang.reflect.Constructor] objects. + * permit user code to invoke [java.lang.Class.getDeclaredConstructor]. * * [Class.newInstance] is deprecated as of Java 9. */ diff --git a/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt b/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt index c84b648f507..bf69f0f66bf 100644 --- a/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt +++ b/node/src/integration-test/kotlin/net/corda/node/services/NonDeterministicContractVerifyTest.kt @@ -75,7 +75,7 @@ class NonDeterministicContractVerifyTest { .returnValue.getOrThrow() } assertThat(ex) - .hasMessageMatching("^NoSuchMethodError: .*\\Qsandbox.java.lang.System.currentTimeMillis()\\E.*\$") + .hasMessageStartingWith("RuleViolationError: Disallowed reference to API; java.lang.System.currentTimeMillis(), ") } } @@ -88,7 +88,7 @@ class NonDeterministicContractVerifyTest { .returnValue.getOrThrow() } assertThat(ex) - .hasMessageMatching("^NoSuchMethodError: .*\\Qsandbox.java.lang.System.nanoTime()\\E.*\$") + .hasMessageStartingWith("RuleViolationError: Disallowed reference to API; java.lang.System.nanoTime(), ") } }