CORDA-3377: Upgrade to DJVM 1.0-RC06. (#5866)

This commit is contained in:
Chris Rankin 2020-01-21 09:05:23 +00:00 committed by Rick Parker
parent 49b4f66515
commit a4d00b79d4
6 changed files with 18 additions and 15 deletions

View File

@ -30,7 +30,7 @@ snakeYamlVersion=1.19
caffeineVersion=2.7.0
metricsVersion=4.1.0
metricsNewRelicVersion=1.1.1
djvmVersion=1.0-RC05
djvmVersion=1.0-RC06
deterministicRtVersion=1.0-RC02
openSourceBranch=https://github.com/corda/corda/blob/release/os/4.4
openSourceSamplesBranch=https://github.com/corda/samples/blob/release-V4

View File

@ -208,9 +208,6 @@ publish {
name jarBaseName
}
// Must be after publish {} so that the previous install task exists for overwriting.
task install(overwrite: true, dependsOn: 'publishToMavenLocal')
idea {
module {
if (project.hasProperty("deterministic_idea_sdk")) {

View File

@ -36,7 +36,16 @@ open class TransactionResolutionException @JvmOverloads constructor(val hash: Se
* @property hash Hash of the bytes of the attachment, see [Attachment.id]
*/
@KeepForDJVM
class AttachmentResolutionException(val hash: SecureHash) : FlowException("Attachment resolution failure for $hash")
class AttachmentResolutionException(val hash: AttachmentId) : FlowException("Attachment resolution failure for $hash")
/**
* A non-specific exception for the attachment identified by [attachmentId]. The context
* for this error is provided via the [message] and [cause].
* @property attachmentId
*/
@KeepForDJVM
class BrokenAttachmentException(val attachmentId: AttachmentId, message: String?, cause: Throwable?)
: FlowException("Attachment $attachmentId has error (${message ?: "no message"})", cause)
/**
* Indicates that some aspect of the transaction named by [txId] violates the platform rules. The exact type of failure

View File

@ -15,10 +15,4 @@ open class MissingSerializerException private constructor(
) : NotSerializableException(message) {
constructor(message: String, typeDescriptor: String) : this(message, typeDescriptor, emptyList())
constructor(message: String, typeNames: List<String>) : this(message, null, typeNames)
/**
* This constructor allows instances of this exception to escape the DJVM sandbox.
*/
@Suppress("unused")
private constructor(message: String) : this(message, null, emptyList())
}

View File

@ -2,6 +2,7 @@
package net.corda.node.djvm
import net.corda.core.contracts.Attachment
import net.corda.core.contracts.BrokenAttachmentException
import net.corda.core.crypto.SecureHash
import net.corda.core.identity.Party
import java.io.InputStream
@ -56,7 +57,12 @@ class SandboxAttachment(
@Suppress("OverridingDeprecatedMember")
override val signers: List<Party> = emptyList()
@Suppress("TooGenericExceptionCaught")
override fun open(): InputStream {
return streamer.apply(attachment)
return try {
streamer.apply(attachment)
} catch (e: Exception) {
throw BrokenAttachmentException(id, e.message, e)
}
}
}

View File

@ -196,9 +196,6 @@ publish {
name jarBaseName
}
// Must be after publish {} so that the previous install task exists for overwriting.
task install(overwrite: true, dependsOn: 'publishToMavenLocal')
idea {
module {
if (project.hasProperty("deterministic_idea_sdk")) {