diff --git a/detekt-baseline.xml b/detekt-baseline.xml index c5b6ea23cf..48cb8312f7 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -102,7 +102,12 @@ ComplexMethod:AMQPTypeIdentifiers.kt$AMQPTypeIdentifiers$fun nameForType(typeIdentifier: TypeIdentifier): String ComplexMethod:ANSIProgressRenderer.kt$ANSIProgressRenderer$// Returns number of lines rendered. private fun renderLevel(ansi: Ansi, error: Boolean): Int ComplexMethod:ANSIProgressRenderer.kt$ANSIProgressRenderer$@Synchronized protected fun draw(moveUp: Boolean, error: Throwable? = null) + ComplexMethod:AbstractConcatenatedList.kt$AbstractConcatenatedList$// This is where we create a listener for a *nested* list. Note that 'indexMap' doesn't need to be adjusted on any // of these changes as the indices of nested lists don't change, just their contents. private fun createListener(wrapped: WrappedObservableList<A>): ListChangeListener<A> + ComplexMethod:AbstractConcatenatedList.kt$AbstractConcatenatedList$// This is where we handle changes to the *source* list. override fun sourceChanged(change: ListChangeListener.Change<out ObservableList<A>>) + ComplexMethod:AbstractFlattenedList.kt$AbstractFlattenedList$override fun sourceChanged(c: ListChangeListener.Change<out ObservableValue<out A>>) + ComplexMethod:AbstractMappedList.kt$AbstractMappedList$override fun sourceChanged(change: ListChangeListener.Change<out A>) ComplexMethod:AbstractNode.kt$AbstractNode$private fun installCordaServices() + ComplexMethod:AbstractReplayedList.kt$AbstractReplayedList$override fun sourceChanged(c: ListChangeListener.Change<out A>) ComplexMethod:ActionExecutorImpl.kt$ActionExecutorImpl$@Suspendable override fun executeAction(fiber: FlowFiber, action: Action) ComplexMethod:AggregatedListTest.kt$AggregatedListTest$@Test fun removeWorks() ComplexMethod:Amount.kt$AmountTransfer$ fun apply(balances: List<SourceAndAmount<T, P>>, newRef: Any? = null): List<SourceAndAmount<T, P>> @@ -124,8 +129,6 @@ ComplexMethod:ClassCarpenter.kt$ClassCarpenterImpl$ private fun validateSchema(schema: Schema) ComplexMethod:CollectSignaturesFlow.kt$CollectSignaturesFlow$@Suspendable override fun call(): SignedTransaction ComplexMethod:CompatibleTransactionTests.kt$CompatibleTransactionTests$@Test fun `Command visibility tests`() - ComplexMethod:ConcatenatedList.kt$ConcatenatedList$// This is where we create a listener for a *nested* list. Note that 'indexMap' doesn't need to be adjusted on any // of these changes as the indices of nested lists don't change, just their contents. private fun createListener(wrapped: WrappedObservableList<A>): ListChangeListener<A> - ComplexMethod:ConcatenatedList.kt$ConcatenatedList$// This is where we handle changes to the *source* list. override fun sourceChanged(change: ListChangeListener.Change<out ObservableList<A>>) ComplexMethod:ConfigUtilities.kt$// For Iterables figure out the type parameter and apply the same logic as above on the individual elements. private fun Iterable<*>.toConfigIterable(field: Field): Iterable<Any?> ComplexMethod:ConfigUtilities.kt$// TODO Move this to KeyStoreConfigHelpers. fun MutualSslConfiguration.configureDevKeyAndTrustStores(myLegalName: CordaX500Name, signingCertificateStore: FileBasedCertificateStoreSupplier, certificatesDirectory: Path, cryptoService: CryptoService? = null) ComplexMethod:ConfigUtilities.kt$@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") // Reflect over the fields of the receiver and generate a value Map that can use to create Config object. private fun Any.toConfigMap(): Map<String, Any> @@ -146,7 +149,6 @@ ComplexMethod:DriverDSLImpl.kt$DriverDSLImpl$private fun startRegisteredNode(name: CordaX500Name, localNetworkMap: LocalNetworkMap?, parameters: NodeParameters, p2pAddress: NetworkHostAndPort = portAllocation.nextHostAndPort()): CordaFuture<NodeHandle> ComplexMethod:Expect.kt$ fun <S, E : Any> S.genericExpectEvents( isStrict: Boolean = true, stream: S.((E) -> Unit) -> Unit, expectCompose: () -> ExpectCompose<E> ) ComplexMethod:FinalityFlow.kt$FinalityFlow$@Suspendable @Throws(NotaryException::class) override fun call(): SignedTransaction - ComplexMethod:FlattenedList.kt$FlattenedList$override fun sourceChanged(c: ListChangeListener.Change<out ObservableValue<out A>>) ComplexMethod:FlowMonitor.kt$FlowMonitor$private fun warningMessageForFlowWaitingOnIo(request: FlowIORequest<*>, flow: FlowStateMachineImpl<*>, now: Instant): String ComplexMethod:FlowStateMachineImpl.kt$FlowStateMachineImpl$ @Suspendable private fun processEventsUntilFlowIsResumed(isDbTransactionOpenOnEntry: Boolean, isDbTransactionOpenOnExit: Boolean): Any? ComplexMethod:GenerateRpcSslCertsCli.kt$GenerateRpcSslCerts$private fun generateRpcSslCertificates(conf: NodeConfiguration) @@ -162,7 +164,7 @@ ComplexMethod:InteractiveShell.kt$InteractiveShell$ @JvmStatic fun runFlowByNameFragment(nameFragment: String, inputData: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, ansiProgressRenderer: ANSIProgressRenderer, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) ComplexMethod:InteractiveShell.kt$InteractiveShell$ private fun maybeAbbreviateGenericType(type: Type, extraRecognisedPackage: String): String ComplexMethod:InteractiveShell.kt$InteractiveShell$@JvmStatic fun gracefulShutdown(userSessionOut: RenderPrintWriter, cordaRPCOps: CordaRPCOps) - ComplexMethod:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: InternalCordaRPCOps, inputObjectMapper: ObjectMapper): Any? + ComplexMethod:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: CordaRPCOps, inputObjectMapper: ObjectMapper): Any? ComplexMethod:Kryo.kt$ImmutableClassSerializer$override fun read(kryo: Kryo, input: Input, type: Class<T>): T ComplexMethod:Kryo.kt$ImmutableClassSerializer$override fun write(kryo: Kryo, output: Output, obj: T) ComplexMethod:LoadTest.kt$LoadTest$fun run(nodes: Nodes, parameters: RunParameters, random: SplittableRandom) @@ -170,7 +172,6 @@ ComplexMethod:LocalTypeInformationBuilder.kt$LocalTypeInformationBuilder$private fun buildForClass(type: Class<*>, typeIdentifier: TypeIdentifier, isOpaque: Boolean): LocalTypeInformation ComplexMethod:LoginView.kt$LoginView$tailrec fun login(): NodeMonitorModel? ComplexMethod:Main.kt$Node$fun dumpDag(f: File) - ComplexMethod:MappedList.kt$MappedList$override fun sourceChanged(change: ListChangeListener.Change<out A>) ComplexMethod:MerkleTransaction.kt$FilteredTransaction.Companion$ private fun filterWithFun(wtx: WireTransaction, filtering: Predicate<Any>): List<FilteredComponentGroup> ComplexMethod:MigrationNamedCacheFactory.kt$MigrationNamedCacheFactory$private fun <K, V> configuredForNamed(caffeine: Caffeine<K, V>, name: String): Caffeine<K, V> ComplexMethod:NetworkBootstrapper.kt$NetworkBootstrapper$private fun bootstrap( directory: Path, cordappJars: List<Path>, copyCordapps: CopyCordapps, fromCordform: Boolean, networkParametersOverrides: NetworkParametersOverrides = NetworkParametersOverrides() ) @@ -196,9 +197,7 @@ ComplexMethod:RPCClientProxyHandler.kt$RPCClientProxyHandler$// This is the general function that transforms a client side RPC to internal Artemis messages. override fun invoke(proxy: Any, method: Method, arguments: Array<out Any?>?): Any? ComplexMethod:RPCClientProxyHandler.kt$RPCClientProxyHandler$private fun attemptReconnect() ComplexMethod:RPCServer.kt$RPCServer$private fun clientArtemisMessageHandler(artemisMessage: ClientMessage) - ComplexMethod:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ErrorInterceptingHandler$override fun invoke(proxy: Any, method: Method, args: Array<out Any>?): Any? ComplexMethod:RemoteTypeCarpenter.kt$SchemaBuildingRemoteTypeCarpenter$override fun carpent(typeInformation: RemoteTypeInformation): Type - ComplexMethod:ReplayedList.kt$ReplayedList$override fun sourceChanged(c: ListChangeListener.Change<out A>) ComplexMethod:RpcReconnectTests.kt$RpcReconnectTests$ @Test fun `test that the RPC client is able to reconnect and proceed after node failure, restart, or connection reset`() ComplexMethod:SchemaMigration.kt$SchemaMigration$ private fun migrateOlderDatabaseToUseLiquibase(existingCheckpoints: Boolean): Boolean ComplexMethod:SchemaMigration.kt$SchemaMigration$private fun doRunMigration(run: Boolean, check: Boolean, existingCheckpoints: Boolean? = null) @@ -302,6 +301,7 @@ EmptyFunctionBlock:VaultSoftLockManagerTest.kt$VaultSoftLockManagerTest.ContractImpl${} EmptyFunctionBlock:VaultUpdateTests.kt$VaultUpdateTests.DummyContract${ } EmptyFunctionBlock:WebServerPluginRegistry.kt$WebServerPluginRegistry${} + EmptyIfBlock:InMemoryIdentityService.kt$InMemoryIdentityService${ } EmptyKtFile:KryoHook.kt$.KryoHook.kt EmptyKtFile:ValidatingNotaryService.kt$.ValidatingNotaryService.kt EnumNaming:LoginView.kt$LoginView.LoginStatus$exception @@ -467,6 +467,7 @@ ForbiddenComment:InternalUtils.kt$// TODO: Add inline back when a new Kotlin version is released and check if the java.lang.VerifyError ForbiddenComment:InternalUtils.kt$// TODO: Currently the certificate revocation status is not handled here. Nowhere in the code the second parameter is used. Consider adding the support in the future. ForbiddenComment:IrsDemoClientApi.kt$IRSDemoClientApi$// TODO: Add uploading of files to the HTTP API + ForbiddenComment:JarSignatureCollectorTest.kt$JarSignatureCollectorTest$// TODO: use programmatic API support to implement signing (see https://docs.oracle.com/javase/9/docs/api/jdk/security/jarsigner/JarSigner.html) ForbiddenComment:KeyStoreConfigHelpers.kt$// TODO: X509Utilities.validateCertificateChain() ForbiddenComment:Kryo.kt$PublicKeySerializer$// TODO: Instead of encoding to the default X509 format, we could have a custom per key type (space-efficient) serialiser. ForbiddenComment:LegalNameValidator.kt$LegalNameValidator.Rule.Companion$// TODO: Implement confusable character detection if we add more scripts. @@ -543,7 +544,6 @@ ForbiddenComment:ServiceHubCoreInternal.kt$ServiceHubCoreInternal$// TODO: This should really be called ServiceHubInternal but that name is already taken by net.corda.node.services.api.ServiceHubInternal. ForbiddenComment:ServiceHubInternal.kt$WritableTransactionStorage$// TODO: Throw an exception if trying to add a transaction with fewer signatures than an existing entry. ForbiddenComment:ServicesForResolutionImpl.kt$ServicesForResolutionImpl$// TODO: check only one (or until one is resolved successfully), max recursive invocations check? - ForbiddenComment:SharedMemoryIncremental.kt$SharedMemoryIncremental$// TODO: Do we really need 16 bytes? Given that we care about Int it should be enough to have 4 ForbiddenComment:SignedTransaction.kt$SignedTransaction$// TODO: Verify contract constraints here as well as in LedgerTransaction to ensure that anything being deserialised ForbiddenComment:SignedTransaction.kt$SignedTransaction$// TODO: We could probably optimise the below by ForbiddenComment:SignedTransaction.kt$SignedTransaction$// TODO: We need a much better way of structuring this data. @@ -722,10 +722,12 @@ FunctionNaming:VersionedParsingExampleTest.kt$VersionedParsingExampleTest$@Test fun default_value_is_used_for_absent_version() LargeClass:AMQPBridgeTest.kt$AMQPBridgeTest LargeClass:ANSIProgressRenderer.kt$ANSIProgressRenderer + LargeClass:AbstractConcatenatedList.kt$AbstractConcatenatedList<A> : TransformationList LargeClass:AbstractNode.kt$AbstractNode<S> : SingletonSerializeAsToken LargeClass:ActionExecutorImpl.kt$ActionExecutorImpl : ActionExecutor LargeClass:AppendOnlyPersistentMap.kt$AppendOnlyPersistentMapBase<K, V, E, out EK> LargeClass:ArtemisMessagingTest.kt$ArtemisMessagingTest + LargeClass:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest LargeClass:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests LargeClass:AuthDBTests.kt$AuthDBTests : NodeBasedTest LargeClass:BootstrapperView.kt$BootstrapperView : View @@ -740,7 +742,6 @@ LargeClass:CommercialPaperTests.kt$CommercialPaperTestsGeneric LargeClass:CompatibleTransactionTests.kt$CompatibleTransactionTests LargeClass:CompositeKeyTests.kt$CompositeKeyTests - LargeClass:ConcatenatedList.kt$ConcatenatedList<A> : TransformationList LargeClass:ConfigParsingTest.kt$ConfigParsingTest LargeClass:ConnectionStateMachine.kt$ConnectionStateMachine : BaseHandler LargeClass:ConstraintsPropagationTests.kt$ConstraintsPropagationTests @@ -780,6 +781,7 @@ LargeClass:KryoTests.kt$KryoTests LargeClass:LedgerTransaction.kt$LedgerTransaction : FullTransaction LargeClass:LedgerTransactionQueryTests.kt$LedgerTransactionQueryTests + LargeClass:LocalSerializerFactory.kt$DefaultLocalSerializerFactory : LocalSerializerFactory LargeClass:LocalTypeInformationBuilder.kt$LocalTypeInformationBuilder LargeClass:MockNodeMessagingService.kt$MockNodeMessagingService : SingletonSerializeAsTokenMessagingService LargeClass:Network.kt$Network : CordaView @@ -812,6 +814,7 @@ LargeClass:ObservablesTests.kt$ObservablesTests LargeClass:P2PMessagingClient.kt$P2PMessagingClient : SingletonSerializeAsTokenMessagingServiceAddressToArtemisQueueResolver LargeClass:PartialMerkleTreeTest.kt$PartialMerkleTreeTest + LargeClass:PersistentIdentityService.kt$PersistentIdentityService : SingletonSerializeAsTokenIdentityService LargeClass:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests LargeClass:PersistentNetworkMapCache.kt$PersistentNetworkMapCache : NetworkMapCacheInternalSingletonSerializeAsToken LargeClass:PersistentUniquenessProvider.kt$PersistentUniquenessProvider : UniquenessProviderSingletonSerializeAsToken @@ -874,26 +877,30 @@ LongMethod:ANSIProgressRenderer.kt$ANSIProgressRenderer$private fun renderInternal(flowProgressHandle: FlowProgressHandle<*>?) LongMethod:ANSIProgressRenderer.kt$StdoutANSIProgressRenderer$override fun setup() LongMethod:AbstractAMQPSerializationSchemeTest.kt$AbstractAMQPSerializationSchemeTest$@Test fun `number of cached factories must be bounded by maxFactories`() + LongMethod:AbstractAggregatedList.kt$AbstractAggregatedList$override fun sourceChanged(c: ListChangeListener.Change<out E>) + LongMethod:AbstractAggregatedList.kt$AbstractAggregatedList$private fun addItem(addedItem: E): Int? + LongMethod:AbstractAggregatedList.kt$AbstractAggregatedList$private fun removeItem(removedItem: E): Pair<Int, AggregationGroup<E, A>>? LongMethod:AbstractCashSelection.kt$AbstractCashSelection$ @Suspendable fun unconsumedCashStatesForSpending(services: ServiceHub, amount: Amount<Currency>, onlyFromIssuerParties: Set<AbstractParty> = emptySet(), notary: Party? = null, lockId: UUID, withIssuerRefs: Set<OpaqueBytes> = emptySet()): List<StateAndRef<Cash.State>> LongMethod:AbstractCashSelection.kt$AbstractCashSelection$private fun attemptSpend(services: ServiceHub, amount: Amount<Currency>, lockId: UUID, notary: Party?, onlyFromIssuerParties: Set<AbstractParty>, withIssuerRefs: Set<OpaqueBytes>, stateAndRefs: MutableList<StateAndRef<Cash.State>>): Boolean + LongMethod:AbstractConcatenatedList.kt$AbstractConcatenatedList$// This is where we create a listener for a *nested* list. Note that 'indexMap' doesn't need to be adjusted on any // of these changes as the indices of nested lists don't change, just their contents. private fun createListener(wrapped: WrappedObservableList<A>): ListChangeListener<A> + LongMethod:AbstractConcatenatedList.kt$AbstractConcatenatedList$// This is where we handle changes to the *source* list. override fun sourceChanged(change: ListChangeListener.Change<out ObservableList<A>>) + LongMethod:AbstractFlattenedList.kt$AbstractFlattenedList$override fun sourceChanged(c: ListChangeListener.Change<out ObservableValue<out A>>) + LongMethod:AbstractMappedList.kt$AbstractMappedList$override fun sourceChanged(change: ListChangeListener.Change<out A>) LongMethod:AbstractNode.kt$AbstractNode$ private fun loadNotaryClusterIdentity(serviceLegalName: CordaX500Name): Pair<PartyAndCertificate, KeyPair> LongMethod:AbstractNode.kt$AbstractNode$ private fun obtainIdentity(): Pair<PartyAndCertificate, KeyPair> LongMethod:AbstractNode.kt$AbstractNode$fun <T : SerializeAsToken> installCordaService(serviceClass: Class<T>): T LongMethod:AbstractNode.kt$AbstractNode$open fun start(): S LongMethod:AbstractNode.kt$AbstractNode$private fun createAndStoreLegalIdentity(alias: String): PartyAndCertificate LongMethod:AbstractNode.kt$AbstractNode$private fun installCordaServices() - LongMethod:AbstractNode.kt$AbstractNode$private fun makeCordappLoader(configuration: NodeConfiguration, versionInfo: VersionInfo): CordappLoader LongMethod:AbstractNode.kt$AbstractNode$private fun updateNodeInfo(identity: PartyAndCertificate, identityKeyPair: KeyPair, publish: Boolean): Triple<MutableSet<KeyPair>, NodeInfoAndSigned, PartyAndCertificate?> LongMethod:AbstractNode.kt$AbstractNode$private fun validateKeyStores(): X509Certificate LongMethod:AbstractRPCTest.kt$AbstractRPCTest$inline fun <reified I : RPCOps> RPCDriverDSL.testProxy( ops: I, rpcUser: User = rpcTestUser, clientConfiguration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT, serverConfiguration: RPCServerConfiguration = RPCServerConfiguration.DEFAULT, queueDrainTimeout: Duration = 5.seconds ): TestProxy<I> + LongMethod:AbstractReplayedList.kt$AbstractReplayedList$override fun sourceChanged(c: ListChangeListener.Change<out A>) LongMethod:ActionExecutorImpl.kt$ActionExecutorImpl$@Suspendable override fun executeAction(fiber: FlowFiber, action: Action) LongMethod:AdditionP2PAddressModeTest.kt$AdditionP2PAddressModeTest$@Test fun `runs nodes with one configured to use additionalP2PAddresses`() LongMethod:AdvancedExceptionDialog.kt$//Attach a stacktrace for the exception that was used in the initialization of the dialog. fun AdvancedExceptionDialog.withStacktrace() : AdvancedExceptionDialog LongMethod:AffinityExecutorTests.kt$AffinityExecutorTests$@Test fun `pooled executor`() LongMethod:AffinityExecutorTests.kt$AffinityExecutorTests$@Test fun `single threaded affinity executor runs on correct thread`() - LongMethod:AggregatedList.kt$AggregatedList$override fun sourceChanged(c: ListChangeListener.Change<out E>) - LongMethod:AggregatedList.kt$AggregatedList$private fun addItem(addedItem: E): Int? - LongMethod:AggregatedList.kt$AggregatedList$private fun removeItem(removedItem: E): Pair<Int, AggregationGroup<E, A>>? LongMethod:AggregatedListTest.kt$AggregatedListTest$@Test fun removeWorks() LongMethod:Amount.kt$Amount.Companion$ @JvmStatic fun parseCurrency(input: String): Amount<Currency> LongMethod:Amount.kt$AmountTransfer$ fun apply(balances: List<SourceAndAmount<T, P>>, newRef: Any? = null): List<SourceAndAmount<T, P>> @@ -914,16 +921,32 @@ LongMethod:AttachmentDemo.kt$fun main(args: Array<String>) LongMethod:AttachmentDemoTest.kt$AttachmentDemoTest$// run with a 10,000,000 bytes in-memory zip file. In practice, a slightly bigger file will be used (~10,002,000 bytes). @Test fun `attachment demo using a 10MB zip file`() LongMethod:AttachmentDownloadServlet.kt$AttachmentDownloadServlet$@Throws(IOException::class) override fun doGet(req: HttpServletRequest, resp: HttpServletResponse) + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `calculateAllTrustInfo attachments signed by blacklisted keys output without trust root fields filled in`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `calculateAllTrustInfo only returns signed attachments or attachments manually installed on the node`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `calculateAllTrustInfo returns all attachment trust roots`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar not trusted if different key but same contract`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar not trusted if signed by a blacklisted key and not uploaded by trusted uploader`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar trusted if same key but different contract`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar trusted if signed by same key and has same contract as existing jar uploaded by a trusted uploader`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar trusted if the signing keys are a subset of an existing trusted jar's signers`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar trusted if the signing keys are a superset of an existing trusted jar's signers`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar trusted if the signing keys are an intersection of an existing trusted jar's signers`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `jar with inherited trust does not grant trust to other jars (no chain of trust)`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `neither jar trusted if same contract and signer but not uploaded by a trusted uploader`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `non-contract jar trusted if trusted jar with same key present`() + LongMethod:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$@Test fun `non-contract jars not trusted if uploaded by non trusted uploaders`() + LongMethod:AttachmentTrustTable.kt$AttachmentTrustTable$private fun createRows() LongMethod:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$override fun execute(database: Database?) LongMethod:AttachmentsClassLoader.kt$AttachmentsClassLoader$private fun checkAttachments(attachments: List<Attachment>) LongMethod:AttachmentsClassLoader.kt$AttachmentsClassLoader.Companion$ private fun setOrDecorateURLStreamHandlerFactory() LongMethod:AttachmentsClassLoader.kt$AttachmentsClassLoaderBuilder$ fun <T> withAttachmentsClassloaderContext(attachments: List<Attachment>, params: NetworkParameters, txId: SecureHash, isAttachmentTrusted: (Attachment) -> Boolean, parent: ClassLoader = ClassLoader.getSystemClassLoader(), block: (ClassLoader) -> T): T LongMethod:AttachmentsClassLoaderSerializationTests.kt$AttachmentsClassLoaderSerializationTests$@Test fun `Can serialize and deserialize with an attachment classloader`() + LongMethod:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Allow loading a trusted attachment that is signed by a blacklisted key`() LongMethod:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Allow loading an untrusted contract jar if another attachment exists that was signed by a trusted uploader - intersection of keys match existing attachment`() LongMethod:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Allow loading an untrusted contract jar if another attachment exists that was signed with the same keys and uploaded by a trusted uploader`() LongMethod:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Attachments with inherited trust do not grant trust to attachments being loaded (no chain of trust)`() + LongMethod:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Cannot load an untrusted contract jar if it is signed by a blacklisted key even if there is another attachment signed by the same keys that is trusted`() LongMethod:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys and uploaded by a trusted uploader`() - LongMethod:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys`() LongMethod:AuthDBTests.kt$AuthDBTests$@Before override fun setUp() LongMethod:AzureBackend.kt$AzureBackend.Companion$fun fromContext(context: Context): AzureBackend LongMethod:AzureInstantiator.kt$AzureInstantiator$override fun instantiateContainer(imageId: String, portsToOpen: List<Int>, instanceName: String, env: Map<String, String>?): CompletableFuture<Pair<String, Map<Int, Int>>> @@ -935,13 +958,14 @@ LongMethod:BFTNotaryServiceTests.kt$BFTNotaryServiceTests.Companion$fun startBftClusterAndNode(clusterSize: Int, mockNet: InternalMockNetwork, exposeRaces: Boolean = false): Pair<Party, TestStartedNode> LongMethod:BFTSmart.kt$BFTSmart.Replica$protected fun commitInputStates( states: List<StateRef>, txId: SecureHash, callerName: CordaX500Name, requestSignature: NotarisationRequestSignature, timeWindow: TimeWindow?, references: List<StateRef> = emptyList() ) LongMethod:BFTSmartNotaryService.kt$BFTSmartNotaryService$private fun createMap(): AppendOnlyPersistentMap<StateRef, SecureHash, CommittedState, PersistentStateRef> + LongMethod:BFTSmartNotaryService.kt$BFTSmartNotaryService.Replica$private fun verifyAndCommitTx(transaction: CoreTransaction, callerIdentity: Party, requestSignature: NotarisationRequestSignature): BFTSmart.ReplicaResponse LongMethod:BankOfCordaWebApi.kt$BankOfCordaWebApi$ @POST @Path("issue-asset-request") @Consumes(MediaType.APPLICATION_JSON) fun issueAssetRequest(params: IssueRequestParams): Response LongMethod:Base58Test.kt$Base58Test$@Test fun testDecode() LongMethod:BlobInspector.kt$BlobInspector$fun run(out: PrintStream): Int LongMethod:BootstrapperView.kt$BootstrapperView$private fun processSelectedDirectory(dir: File) LongMethod:BridgeControlListener.kt$BridgeControlListener$fun start() LongMethod:BridgeControlListener.kt$BridgeControlListener$private fun processControlMessage(msg: ClientMessage) - LongMethod:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$// The Main authentication logic, responsible for running all the configured checks for each user type // and return the actual User and principals private fun authenticateAndAuthorise(username: String, certificates: Array<X509Certificate>?, password: String): Pair<String, List<RolePrincipal>> + LongMethod:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$// The Main authentication logic, responsible for running all the configured checks for each user type // and return the actual User and principals @Suppress("DEPRECATION") // should use java.security.cert.X509Certificate private fun authenticateAndAuthorise(username: String, certificates: Array<javax.security.cert.X509Certificate>?, password: String): Pair<String, List<RolePrincipal>> LongMethod:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$override fun login(): Boolean LongMethod:BusinessCalendar.kt$BusinessCalendar.Companion$ @JvmStatic fun createGenericSchedule(startDate: LocalDate, period: Frequency, calendar: BusinessCalendar = EMPTY, dateRollConvention: DateRollConvention = DateRollConvention.Following, noOfAdditionalPeriods: Int = Integer.MAX_VALUE, endDate: LocalDate? = null, periodOffset: Int? = null): List<LocalDate> LongMethod:Cap.kt$Cap$@Test fun `first fixing`() @@ -1034,8 +1058,6 @@ LongMethod:CompositeKeyTests.kt$CompositeKeyTests$@Test fun `Test save to keystore`() LongMethod:CompositeKeyTests.kt$CompositeKeyTests$@Test() fun `composite key constraints`() LongMethod:CompositeKeyTests.kt$CompositeKeyTests$@Test() fun `composite key validation with graph cycle detection`() - LongMethod:ConcatenatedList.kt$ConcatenatedList$// This is where we create a listener for a *nested* list. Note that 'indexMap' doesn't need to be adjusted on any // of these changes as the indices of nested lists don't change, just their contents. private fun createListener(wrapped: WrappedObservableList<A>): ListChangeListener<A> - LongMethod:ConcatenatedList.kt$ConcatenatedList$// This is where we handle changes to the *source* list. override fun sourceChanged(change: ListChangeListener.Change<out ObservableList<A>>) LongMethod:ConcatenatedListTest.kt$ConcatenatedListTest$@Test fun addWorks() LongMethod:ConcatenatedListTest.kt$ConcatenatedListTest$@Test fun permutationWorks() LongMethod:ConcatenatedListTest.kt$ConcatenatedListTest$@Test fun removeWorks() @@ -1091,6 +1113,7 @@ LongMethod:CordappConstraintsTests.kt$CordappConstraintsTests$@Test fun `issue and consume cash using signature constraints`() LongMethod:CordappConstraintsTests.kt$CordappConstraintsTests$@Test fun `issue cash using hash and signature constraints`() LongMethod:CordappConstraintsTests.kt$CordappConstraintsTests$@Test fun `issue cash using signature constraints`() + LongMethod:CordappProviderImpl.kt$CordappProviderImpl$private fun loadContractsIntoAttachmentStore(): Map<SecureHash, URL> LongMethod:CordappSmokeTest.kt$CordappSmokeTest$@Test fun `FlowContent appName returns the filename of the CorDapp jar`() LongMethod:CordappSmokeTest.kt$CordappSmokeTest$private fun createNodeInfoWithSingleIdentity(name: CordaX500Name, nodeKeyPair: KeyPair, identityCertPublicKey: PublicKey): NodeInfo LongMethod:CrossCashTest.kt$CrossCashState$override fun toString(): String @@ -1133,6 +1156,7 @@ LongMethod:DeserializeNeedingCarpentryTests.kt$DeserializeNeedingCarpentryTests$@Test fun listOfType() LongMethod:DeserializeNeedingCarpentryTests.kt$DeserializeNeedingCarpentryTests$@Test fun repeatedTypesAreRecognised() LongMethod:DeserializeNeedingCarpentryTests.kt$DeserializeNeedingCarpentryTests$@Test fun verySimpleType() + LongMethod:DeserializeSimpleTypesTests.kt$DeserializeSimpleTypesTests$// See CORDA-2782 @Test @Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN") fun comparableNotWhitelistedOk() LongMethod:DeserializeSimpleTypesTests.kt$DeserializeSimpleTypesTests$@Test fun arrayOfArrayOfIntArray() LongMethod:DeserializeSimpleTypesTests.kt$DeserializeSimpleTypesTests$@Test fun testByteArray() LongMethod:DeserializeSimpleTypesTests.kt$DeserializeSimpleTypesTests$@Test fun testCharArray() @@ -1156,7 +1180,7 @@ LongMethod:DriverDSLImpl.kt$DriverDSLImpl.Companion$private fun startInProcessNode( executorService: ScheduledExecutorService, config: NodeConfig ): CordaFuture<Pair<NodeWithInfo, Thread>> LongMethod:DriverDSLImpl.kt$DriverDSLImpl.Companion$private fun startOutOfProcessNode( config: NodeConfig, quasarJarPath: String, debugPort: Int?, overriddenSystemProperties: Map<String, String>, maximumHeapSize: String, logLevelOverride: String?, vararg extraCmdLineFlag: String ): Process LongMethod:DriverDSLImpl.kt$NetworkVisibilityController.VisibilityHandle$fun listen(rpc: CordaRPCOps): CordaFuture<Unit> - LongMethod:DriverDSLImpl.kt$fun <A> internalDriver( isDebug: Boolean = DriverParameters().isDebug, driverDirectory: Path = DriverParameters().driverDirectory, portAllocation: PortAllocation = DriverParameters().portAllocation, debugPortAllocation: PortAllocation = DriverParameters().debugPortAllocation, systemProperties: Map<String, String> = DriverParameters().systemProperties, useTestClock: Boolean = DriverParameters().useTestClock, startNodesInProcess: Boolean = DriverParameters().startNodesInProcess, extraCordappPackagesToScan: List<String> = DriverParameters().extraCordappPackagesToScan, waitForAllNodesToFinish: Boolean = DriverParameters().waitForAllNodesToFinish, notarySpecs: List<NotarySpec> = DriverParameters().notarySpecs, jmxPolicy: JmxPolicy = DriverParameters().jmxPolicy, networkParameters: NetworkParameters = DriverParameters().networkParameters, compatibilityZone: CompatibilityZoneParams? = null, notaryCustomOverrides: Map<String, Any?> = DriverParameters().notaryCustomOverrides, inMemoryDB: Boolean = DriverParameters().inMemoryDB, cordappsForAllNodes: Collection<TestCordappInternal>? = null, dsl: DriverDSLImpl.() -> A ): A + LongMethod:DriverDSLImpl.kt$fun <A> internalDriver( isDebug: Boolean = DriverParameters().isDebug, driverDirectory: Path = DriverParameters().driverDirectory, portAllocation: PortAllocation = DriverParameters().portAllocation, debugPortAllocation: PortAllocation = DriverParameters().debugPortAllocation, systemProperties: Map<String, String> = DriverParameters().systemProperties, useTestClock: Boolean = DriverParameters().useTestClock, startNodesInProcess: Boolean = DriverParameters().startNodesInProcess, extraCordappPackagesToScan: List<String> = @Suppress("DEPRECATION") DriverParameters().extraCordappPackagesToScan, waitForAllNodesToFinish: Boolean = DriverParameters().waitForAllNodesToFinish, notarySpecs: List<NotarySpec> = DriverParameters().notarySpecs, jmxPolicy: JmxPolicy = DriverParameters().jmxPolicy, networkParameters: NetworkParameters = DriverParameters().networkParameters, compatibilityZone: CompatibilityZoneParams? = null, notaryCustomOverrides: Map<String, Any?> = DriverParameters().notaryCustomOverrides, inMemoryDB: Boolean = DriverParameters().inMemoryDB, cordappsForAllNodes: Collection<TestCordappInternal>? = null, dsl: DriverDSLImpl.() -> A ): A LongMethod:DummyFungibleContract.kt$DummyFungibleContract$override fun verify(tx: LedgerTransaction) LongMethod:DummyFungibleContract.kt$DummyFungibleContract.State$ override fun generateMappedObject(schema: MappedSchema): PersistentState LongMethod:DummyLinearContract.kt$DummyLinearContract.State$override fun generateMappedObject(schema: MappedSchema): PersistentState @@ -1170,7 +1194,6 @@ LongMethod:EnumEvolveTests.kt$EnumEvolveTests$@Test fun multiOperations() LongMethod:EnumTests.kt$EnumTests$@Test fun deserialiseSimpleTest() LongMethod:EnumTransforms.kt$EnumTransforms$ private fun validateNoCycles(constants: Map<String, Int>) - LongMethod:ErrorCodeLoggingTests.kt$ErrorCodeLoggingTests$// This is used to detect broken logging which can be caused by loggers being initialized // before the initLogging() call is made @Test fun `When logging is set to error level, there are no other levels logged after node startup`() LongMethod:ErrorFlowTransition.kt$ErrorFlowTransition$// Buffer error messages in Initiating sessions, return the initialised ones. private fun bufferErrorMessagesInInitiatingSessions( sessions: Map<SessionId, SessionState>, errorMessages: List<ErrorSessionMessage> ): Pair<List<SessionState.Initiated>, Map<SessionId, SessionState>> LongMethod:ErrorFlowTransition.kt$ErrorFlowTransition$override fun transition(): TransitionResult LongMethod:Eventually.kt$ inline fun <R> eventually( duration: Duration = Duration.ofSeconds(5), waitBetween: Duration = Duration.ofMillis(100), waitBefore: Duration = waitBetween, test: () -> R): R @@ -1183,14 +1206,13 @@ LongMethod:Expect.kt$ fun <S, E : Any> S.genericExpectEvents( isStrict: Boolean = true, stream: S.((E) -> Unit) -> Unit, expectCompose: () -> ExpectCompose<E> ) LongMethod:Expect.kt$ExpectComposeState.Companion$fun <E : Any> fromExpectCompose(expectCompose: ExpectCompose<E>): ExpectComposeState<E> LongMethod:Explorer.kt$Explorer$@Throws(IOException::class) fun open(config: NodeConfigWrapper, onExit: (NodeConfigWrapper) -> Unit) - LongMethod:ExternalIdMappingTest.kt$ExternalIdMappingTest$@Test fun `Two states can be mapped to a single externalId`() LongMethod:ExternalIdMappingTest.kt$ExternalIdMappingTest$@Test fun `externalIds query criteria test`() + LongMethod:ExternalIdMappingTest.kt$ExternalIdMappingTest$@Test fun `roger uber keys test`() LongMethod:FXFwdTimeOption.kt$FXFwdTimeOption$@Test fun `maturity, bank exercise`() LongMethod:FXFwdTimeOption.kt$FXFwdTimeOption$@Test fun `maturity, corp exercise`() LongMethod:FetchDataFlow.kt$FetchDataFlow$@Suspendable @Throws(HashNotFound::class, MissingNetworkParameters::class) override fun call(): Result<T> LongMethod:FiberDeserializationCheckingInterceptor.kt$FiberDeserializationChecker$fun start(checkpointSerializationContext: CheckpointSerializationContext) LongMethod:FinalityFlow.kt$FinalityFlow$@Suspendable @Throws(NotaryException::class) override fun call(): SignedTransaction - LongMethod:FlattenedList.kt$FlattenedList$override fun sourceChanged(c: ListChangeListener.Change<out ObservableValue<out A>>) LongMethod:FlattenedListTest.kt$FlattenedListTest$@Test fun addWorks() LongMethod:FlowCheckpointVersionNodeStartupCheckTest.kt$FlowCheckpointVersionNodeStartupCheckTest$@Test fun `restart node with mismatch between suspended flow and installed CorDapps`() LongMethod:FlowCookbook.kt$InitiatorFlow$@Suppress("RemoveExplicitTypeArguments") @Suspendable override fun call() @@ -1267,8 +1289,8 @@ LongMethod:IRSTests.kt$fun createDummyIRS(irsSelect: Int): InterestRateSwap.State LongMethod:IdenticonRenderer.kt$IdenticonRenderer$ private fun render(code: Int, patchSize: Double, backgroundColor: Color = Color.WHITE): Image LongMethod:IdenticonRenderer.kt$IdenticonRenderer$private fun drawPatch(g: GraphicsContext, x: Double, y: Double, patchIndex: Int, turn: Int, patchSize: Double, _invert: Boolean, color: PatchColor) - LongMethod:IdentityServiceInternal.kt$IdentityServiceInternal$ @Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) fun verifyAndRegisterIdentity(trustAnchor: TrustAnchor, identity: PartyAndCertificate, isNewRandomIdentity: Boolean = false): PartyAndCertificate? LongMethod:IdentityServiceToStringShortMigrationTest.kt$IdentityServiceToStringShortMigrationTest$@Test fun `it should be possible to migrate all existing identities to new hash function`() + LongMethod:IdentitySyncFlow.kt$IdentitySyncFlow.Send$private fun extractOurConfidentialIdentities(): Map<AbstractParty, PartyAndCertificate?> LongMethod:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$@Test fun `don't offer other's identities confidential identities`() LongMethod:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$@Test fun `sync confidential identities`() LongMethod:InMemoryIdentityService.kt$InMemoryIdentityService$@Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) private fun verifyAndRegisterIdentity(trustAnchor: TrustAnchor, identity: PartyAndCertificate): PartyAndCertificate? @@ -1285,7 +1307,7 @@ LongMethod:InteractiveShell.kt$InteractiveShell$// TODO Filtering on error/success when we will have some sort of flow auditing, for now it doesn't make much sense. @JvmStatic fun runStateMachinesView(out: RenderPrintWriter, rpcOps: CordaRPCOps): Any? LongMethod:InteractiveShell.kt$InteractiveShell$@JvmStatic fun gracefulShutdown(userSessionOut: RenderPrintWriter, cordaRPCOps: CordaRPCOps) LongMethod:InteractiveShell.kt$InteractiveShell$@JvmStatic fun killFlowById(id: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) - LongMethod:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: InternalCordaRPCOps, inputObjectMapper: ObjectMapper): Any? + LongMethod:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: CordaRPCOps, inputObjectMapper: ObjectMapper): Any? LongMethod:InteractiveShell.kt$InteractiveShell$fun runLocalShell(onExit: () -> Unit = {}) LongMethod:InteractiveShell.kt$InteractiveShell$fun startShell(configuration: ShellConfiguration, classLoader: ClassLoader? = null, standalone: Boolean = false) LongMethod:InteractiveShell.kt$InteractiveShell$private fun <T> getMatchingConstructorParamsAndTypes(parser: StringToMethodCallParser<FlowLogic<T>>, inputData: String, clazz: Class<out FlowLogic<T>>) : List<Pair<String, Type>> @@ -1308,7 +1330,7 @@ LongMethod:JarScanningCordappLoader.kt$JarScanningCordappLoader$private fun RestrictedScanResult.toCordapp(url: RestrictedURL): CordappImpl LongMethod:JarScanningCordappLoader.kt$JarScanningCordappLoader$private fun loadCordapps(): List<CordappImpl> LongMethod:JarScanningCordappLoader.kt$JarScanningCordappLoader$private fun parseCordappInfo(manifest: Manifest?, defaultName: String): Cordapp.Info - LongMethod:JarSignatureTestUtils.kt$JarSignatureTestUtils$fun Path.addManifest(fileName: String, vararg entry: Pair<Attributes.Name, String>) + LongMethod:JarSignatureTestUtils.kt$JarSignatureTestUtils$fun Path.addManifest(fileName: String, vararg entries: Pair<Attributes.Name, String>) LongMethod:KMSUtils.kt$ fun freshCertificate(identityService: IdentityService, subjectPublicKey: PublicKey, issuer: PartyAndCertificate, issuerSigner: ContentSigner): PartyAndCertificate LongMethod:KeyStoreGenerator.kt$KeyStoreGenerator$fun writeKeyStore(output: OutputStream, alias: String, password: CharArray) LongMethod:KotlinIntegrationTestingTutorial.kt$KotlinIntegrationTestingTutorial$@Test fun `alice bob cash exchange example`() @@ -1342,10 +1364,10 @@ LongMethod:Main.kt$fun main(args: Array<String>) LongMethod:Main.kt$private fun runLoadTest(loadTestConfiguration: LoadTestConfiguration) LongMethod:Main.kt$private fun runStabilityTest(loadTestConfiguration: LoadTestConfiguration) - LongMethod:MappedList.kt$MappedList$override fun sourceChanged(change: ListChangeListener.Change<out A>) LongMethod:MatcherTests.kt$MatcherTests$@Test fun `nested items indent`() LongMethod:MaxTransactionSizeTests.kt$MaxTransactionSizeTests$@Test fun `check transaction will fail when exceed max transaction size limit`() LongMethod:MerkleTransaction.kt$FilteredTransaction.Companion$fun <T : Any> filter(t: T, componentGroupIndex: Int, internalIndex: Int) + LongMethod:MigrationNamedCacheFactory.kt$MigrationNamedCacheFactory$private fun <K, V> configuredForNamed(caffeine: Caffeine<K, V>, name: String): Caffeine<K, V> LongMethod:MockAttachmentStorage.kt$MockAttachmentStorage$private fun importAttachmentInternal(jar: InputStream, uploader: String, contractClassNames: List<ContractClassName>? = null, attachmentId: AttachmentId? = null, signers: List<PublicKey> = emptyList()): AttachmentId LongMethod:MockCordappProvider.kt$MockCordappProvider$fun addMockCordapp( contractClassName: ContractClassName, attachments: MockAttachmentStorage, contractHash: AttachmentId? = null, signers: List<PublicKey> = emptyList(), jarManifestAttributes: Map<String,String> = emptyMap() ): AttachmentId LongMethod:MockNodeMessagingService.kt$MockNodeMessagingService$ fun start(network: InMemoryMessagingNetwork, manuallyPumped: Boolean, id: Int, notaryService: PartyAndCertificate?) @@ -1402,20 +1424,20 @@ LongMethod:Node.kt$Node$ private fun tryDetectIfNotPublicHost(host: String): String? LongMethod:Node.kt$Node$override fun startMessagingService(rpcOps: RPCOps, nodeInfo: NodeInfo, myNotaryIdentity: PartyAndCertificate?, networkParameters: NetworkParameters) LongMethod:NodeAttachmentService.kt$NodeAttachmentService$// TODO: PLT-147: The attachment should be randomised to prevent brute force guessing and thus privacy leaks. private fun import(jar: InputStream, uploader: String?, filename: String?): AttachmentId + LongMethod:NodeAttachmentService.kt$NodeAttachmentService$private fun createAttachmentFromDatabase(attachment: DBAttachment): Attachment + LongMethod:NodeAttachmentService.kt$NodeAttachmentService$private fun getContractAttachmentVersions(contractClassName: String): NavigableMap<Version, AttachmentIds> LongMethod:NodeAttachmentService.kt$NodeAttachmentService.Companion$// Just iterate over the entries with verification enabled: should be good enough to catch mistakes. // Note that JarInputStream won't throw any kind of error at all if the file stream is in fact not // a ZIP! It'll just pretend it's an empty archive, which is kind of stupid but that's how it works. // So we have to check to ensure we found at least one item. // // For signed Jars add additional checks to close security holes left by the default jarSigner verifier: // - All entries listed in the Manifest are in the JAR file. // - No extra files in the JAR that were not listed in the Manifest. // Together with the check that all entries need to be signed by the same signers that is performed when the signers are read, // it should close any possibility of foul play. internal fun checkIsAValidJAR(stream: InputStream) LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `The strict JAR verification function fails signed JARs with removed or extra files that are valid according to the usual jarsigner`() - LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `all non contract jars not trusted if all are uploaded by non trusted uploaders`() LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `attachments can be queried by providing a intersection of signers using an EQUAL statement - EQUAL containing a single public key`() LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `attachments can be queried by providing a intersection of signers using an EQUAL statement - EQUAL containing multiple public keys`() LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `contract class, versioning and signing metadata can be used to search`() LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `corrupt entry throws exception`() LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `development mode - retrieve latest versions of signed contracts - multiple versions of same version id exist in store`() - LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `jar not trusted if different key but same contract`() - LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `jar trusted if the signing keys are an intersection of an existing trusted jar's signers`() - LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `jar with inherited trust does not grant trust to other jars (no chain of trust)`() + LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `getAllAttachmentsByCriteria returns all stored attachments when no filtering is applied`() + LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `getAllAttachmentsByCriteria returns attachments filtered by criteria`() LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `missing is not cached`() - LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `non contract jar trusted if trusted jar with same key present`() LongMethod:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `sorting and compound conditions work`() + LongMethod:NodeAttachmentTrustCalculator.kt$NodeAttachmentTrustCalculator$override fun calculateAllTrustInfo(): List<AttachmentTrustInfo> LongMethod:NodeBasedTest.kt$NodeBasedTest$@JvmOverloads fun startNode(legalName: CordaX500Name, platformVersion: Int = PLATFORM_VERSION, rpcUsers: List<User> = emptyList(), configOverrides: Map<String, Any> = emptyMap(), flowManager: FlowManager = NodeFlowManager(FlowOverrideConfig())): NodeWithInfo LongMethod:NodeConfigTest.kt$NodeConfigTest$@Test fun `reading node configuration allows systemProperties and custom`() LongMethod:NodeConfigTest.kt$NodeConfigTest$@Test fun `reading node configuration`() @@ -1467,8 +1489,8 @@ LongMethod:NodeVaultService.kt$NodeVaultService$fun makeUpdate(tx: WireTransaction): Vault.Update<ContractState>? LongMethod:NodeVaultService.kt$NodeVaultService$fun resolveAndMakeUpdate(tx: CoreTransaction): Vault.Update<ContractState>? LongMethod:NodeVaultService.kt$NodeVaultService$override fun softLockRelease(lockId: UUID, stateRefs: NonEmptySet<StateRef>?) - LongMethod:NodeVaultService.kt$NodeVaultService$private fun processAndNotify(updates: List<Vault.Update<ContractState>>, previouslySeen: Boolean) - LongMethod:NodeVaultService.kt$NodeVaultService$private fun recordUpdate(update: Vault.Update<ContractState>, previouslySeen: Boolean): Vault.Update<ContractState> + LongMethod:NodeVaultService.kt$NodeVaultService$private fun processAndNotify(updates: List<Vault.Update<ContractState>>) + LongMethod:NodeVaultService.kt$NodeVaultService$private fun recordUpdate(update: Vault.Update<ContractState>): Vault.Update<ContractState> LongMethod:NodeVaultService.kt$NodeVaultService$private fun saveStates(session: Session, states: Map<StateRef, StateAndRef<ContractState>>) LongMethod:NodeVaultServiceTest.kt$NodeVaultServiceTest$// TODO: Unit test linear state relevancy checks @Test fun `correct updates are generated for general transactions`() LongMethod:NodeVaultServiceTest.kt$NodeVaultServiceTest$@Test @Ignore fun `trackByCriteria filters updates and snapshots`() @@ -1634,7 +1656,7 @@ LongMethod:RaftUniquenessProvider.kt$RaftUniquenessProvider.Companion$fun createMap(cacheFactory: NamedCacheFactory): AppendOnlyPersistentMap<StateRef, Pair<Long, SecureHash>, CommittedState, String> LongMethod:ReceiveFinalityFlowTest.kt$ReceiveFinalityFlowTest$@Test fun `sent to flow hospital on error and retry on node restart`() LongMethod:ReceiveTransactionFlow.kt$ReceiveTransactionFlow$@Suppress("KDocMissingDocumentation") @Suspendable @Throws(SignatureException::class, AttachmentResolutionException::class, TransactionResolutionException::class, TransactionVerificationException::class) override fun call(): SignedTransaction - LongMethod:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ErrorInterceptingHandler$override fun invoke(proxy: Any, method: Method, args: Array<out Any>?): Any? + LongMethod:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ErrorInterceptingHandler$private fun doInvoke(method: Method, args: Array<out Any>?): Any? LongMethod:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ReconnectingRPCConnection$private tailrec fun establishConnectionWithRetry(retryInterval: Duration = 1.seconds, roundRobinIndex: Int = 0): CordaRPCConnection LongMethod:ReferenceInputStateTests.kt$ReferenceStateTests$@Test fun `Can't use old reference states`() LongMethod:ReferenceInputStateTests.kt$ReferenceStateTests$@Test fun `create a reference state then refer to it multiple times`() @@ -1642,7 +1664,6 @@ LongMethod:ReferencedStatesFlowTests.kt$ReferencedStatesFlowTests$@Test fun `check old ref state is consumed when update used in tx with relevant states`() LongMethod:ReferencedStatesFlowTests.kt$ReferencedStatesFlowTests$@Test fun `check ref state is persisted when used in tx with relevant states`() LongMethod:RemoteSerializerFactory.kt$DefaultRemoteSerializerFactory$private fun getUncached( remoteTypeInformation: RemoteTypeInformation, localTypeInformation: LocalTypeInformation ): AMQPSerializer<Any> - LongMethod:ReplayedList.kt$ReplayedList$override fun sourceChanged(c: ListChangeListener.Change<out A>) LongMethod:ReplayedListTest.kt$ReplayedListTest$@Test fun addWorks() LongMethod:ResolveTransactionsFlowTest.kt$ResolveTransactionsFlowTest$// DOCSTART 2 private fun makeTransactions(signFirstTX: Boolean = true, withAttachment: SecureHash? = null): Pair<SignedTransaction, SignedTransaction> LongMethod:ResolveTransactionsFlowTest.kt$ResolveTransactionsFlowTest$@Test fun `triangle of transactions resolves fine`() @@ -1653,7 +1674,7 @@ LongMethod:RoundTripObservableSerializerTests.kt$RoundTripObservableSerializerTests$@Test fun roundTripTest1() LongMethod:RoundTripTests.kt$RoundTripTests$@Test fun canSerializeClassesWithUntypedProperties() LongMethod:RpcClientObservableDeSerializer.kt$RpcClientObservableDeSerializer$ override fun readObject(obj: Any, schemas: SerializationSchemas, input: DeserializationInput, context: SerializationContext ): Observable<*> - LongMethod:RpcExceptionHandlingTest.kt$RpcExceptionHandlingTest$@Test fun `FlowException is received by the RPC client only if in devMode`() + LongMethod:RpcExceptionHandlingTest.kt$RpcExceptionHandlingTest$@Test fun `FlowException is received by the RPC client`() LongMethod:RpcReconnectTests.kt$RpcReconnectTests$ @Test fun `test that the RPC client is able to reconnect and proceed after node failure, restart, or connection reset`() LongMethod:RpcServerObservableSerializer.kt$RpcServerObservableSerializer$override fun writeDescribedObject( obj: Observable<*>, data: Data, type: Type, output: SerializationOutput, context: SerializationContext ) LongMethod:RpcSslTest.kt$RpcSslTest$@Test fun `RPC client using ssl is able to run a command`() @@ -1691,7 +1712,6 @@ LongMethod:ServiceHubInternal.kt$ServiceHubInternal.Companion$fun recordTransactions(statesToRecord: StatesToRecord, txs: Collection<SignedTransaction>, validatedTransactions: WritableTransactionStorage, stateMachineRecordedTransactionMapping: StateMachineRecordedTransactionMappingStorage, vaultService: VaultServiceInternal, database: CordaPersistence) LongMethod:ServicesForResolutionImpl.kt$ServicesForResolutionImpl$// We may need to recursively chase transactions if there are notary changes. fun inner(stateRef: StateRef, forContractClassName: String?): Attachment LongMethod:SettingsModelTest.kt$SettingsModelTest$@Test fun `test save config and rollback`() - LongMethod:SharedMemoryIncremental.kt$SharedMemoryIncremental$override fun nextPort(): Int LongMethod:ShutdownManager.kt$ShutdownManager$fun shutdown() LongMethod:SignatureConstraintMigrationFromHashConstraintsTests.kt$SignatureConstraintMigrationFromHashConstraintsTests$@Test fun `HashConstraint cannot be migrated to SignatureConstraint if a HashConstraint is specified for one state and another uses an AutomaticPlaceholderConstraint`() LongMethod:SignatureConstraintMigrationFromHashConstraintsTests.kt$SignatureConstraintMigrationFromHashConstraintsTests$@Test fun `can evolve from lower contract class version to higher one`() @@ -1715,7 +1735,7 @@ LongMethod:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$override fun start(tokenizableServices: List<Any>) LongMethod:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun <A> startFlowInternal( invocationContext: InvocationContext, flowLogic: FlowLogic<A>, flowStart: FlowStart, ourIdentity: Party, deduplicationHandler: DeduplicationHandler?, isStartIdempotent: Boolean ): CordaFuture<FlowStateMachine<A>> LongMethod:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun addAndStartFlow(id: StateMachineRunId, flow: Flow) - LongMethod:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun createFlowFromCheckpoint( id: StateMachineRunId, checkpoint: Checkpoint, isAnyCheckpointPersisted: Boolean, isStartIdempotent: Boolean, initialDeduplicationHandler: DeduplicationHandler? ): Flow + LongMethod:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun createFlowFromCheckpoint( id: StateMachineRunId, serializedCheckpoint: SerializedBytes<Checkpoint>, isAnyCheckpointPersisted: Boolean, isStartIdempotent: Boolean, initialDeduplicationHandler: DeduplicationHandler? ): Flow? LongMethod:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun onExistingSessionMessage(sessionMessage: ExistingSessionMessage, deduplicationHandler: DeduplicationHandler, sender: Party) LongMethod:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun onSessionInit(sessionMessage: InitialSessionMessage, sender: Party, event: ExternalEvent.ExternalMessageEvent) LongMethod:StabilityTest.kt$StabilityTest$fun crossCashTest(replication: Int) @@ -1749,6 +1769,7 @@ LongMethod:TLSAuthenticationTests.kt$TLSAuthenticationTests$private fun buildTLSSockets( serverSocketFactory: SSLServerSocketFactory, clientSocketFactory: SSLSocketFactory, serverPort: Int = 0, // Use 0 to get first free socket. clientPort: Int = 0, // Use 0 to get first free socket. cipherSuitesServer: Array<String> = CORDA_TLS_CIPHER_SUITES, cipherSuitesClient: Array<String> = CORDA_TLS_CIPHER_SUITES ): Pair<SSLServerSocket, SSLSocket> LongMethod:TLSAuthenticationTests.kt$TLSAuthenticationTests$private fun testConnect(serverSocket: ServerSocket, clientSocket: SSLSocket, expectedCipherSuite: String) LongMethod:TestCommsFlow.kt$TestCommsFlowInitiator$@Suspendable override fun call(): List<String> + LongMethod:TestCordappImpl.kt$TestCordappImpl.Companion$private fun buildCordappJar(projectRoot: Path): Path LongMethod:TestDSL.kt$TestLedgerDSLInterpreter$override fun verifies(): EnforceVerifyOrFail LongMethod:TestDSL.kt$TestLedgerDSLInterpreter$private fun <R> recordTransactionWithTransactionMap( transactionLabel: String?, transactionBuilder: TransactionBuilder, dsl: TestTransactionDSLInterpreter.() -> R, transactionMap: HashMap<SecureHash, WireTransactionWithLocation> = HashMap(), /** If set to true, will add dummy components to [transactionBuilder] to make it valid. */ fillTransaction: Boolean ): WireTransaction LongMethod:TestNotaryFlow.kt$TestNotaryFlow$@Suspendable override fun call(): String @@ -1771,7 +1792,7 @@ LongMethod:TransactionBuilder.kt$TransactionBuilder$ private fun handleContract( contractClassName: ContractClassName, inputStates: List<TransactionState<ContractState>>?, outputStates: List<TransactionState<ContractState>>?, explicitContractAttachment: AttachmentId?, services: ServicesForResolution ): Pair<AttachmentId, List<TransactionState<ContractState>>?> LongMethod:TransactionBuilder.kt$TransactionBuilder$ private fun resolveStatePointers(transactionState: TransactionState<*>) LongMethod:TransactionBuilder.kt$TransactionBuilder$ private fun selectAttachmentConstraint( contractClassName: ContractClassName, inputStates: List<TransactionState<ContractState>>?, attachmentToUse: ContractAttachment, services: ServicesForResolution): AttachmentConstraint - LongMethod:TransactionBuilder.kt$TransactionBuilder$ private fun selectContractAttachmentsAndOutputStateConstraints( services: ServicesForResolution, serializationContext: SerializationContext?): Pair<Collection<SecureHash>, List<TransactionState<ContractState>>> + LongMethod:TransactionBuilder.kt$TransactionBuilder$ private fun selectContractAttachmentsAndOutputStateConstraints( services: ServicesForResolution, @Suppress("UNUSED_PARAMETER") serializationContext: SerializationContext? ): Pair<Collection<SecureHash>, List<TransactionState<ContractState>>> LongMethod:TransactionBuilder.kt$TransactionBuilder$@CordaInternal internal fun toWireTransactionWithContext(services: ServicesForResolution, serializationContext: SerializationContext? = null): WireTransaction LongMethod:TransactionBuilder.kt$TransactionBuilder$private fun addMissingAttachment(missingClass: String, services: ServicesForResolution, originalException: Throwable): Boolean LongMethod:TransactionBuilderTest.kt$TransactionBuilderTest$@Before fun setup() @@ -1791,8 +1812,7 @@ LongMethod:TransactionTests.kt$TransactionTests$@Test fun `transactions with no inputs can have any notary`() LongMethod:TransactionUtils.kt$ fun <T : Any> deserialiseComponentGroup(componentGroups: List<ComponentGroup>, clazz: KClass<T>, groupEnum: ComponentGroupEnum, forceDeserialize: Boolean = false, factory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = factory.defaultContext): List<T> LongMethod:TransactionUtils.kt$ fun createComponentGroups(inputs: List<StateRef>, outputs: List<TransactionState<ContractState>>, commands: List<Command<*>>, attachments: List<SecureHash>, notary: Party?, timeWindow: TimeWindow?, references: List<StateRef>, networkParametersHash: SecureHash?): List<ComponentGroup> - LongMethod:TransactionUtils.kt$ fun deserialiseCommands(componentGroups: List<ComponentGroup>, forceDeserialize: Boolean = false, factory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = factory.defaultContext): List<Command<*>> - LongMethod:TransactionUtils.kt$ fun isAttachmentTrusted(attachment: Attachment, service: AttachmentStorage?): Boolean + LongMethod:TransactionUtils.kt$ fun deserialiseCommands( componentGroups: List<ComponentGroup>, forceDeserialize: Boolean = false, factory: SerializationFactory = SerializationFactory.defaultFactory, @Suppress("UNUSED_PARAMETER") context: SerializationContext = factory.defaultContext ): List<Command<*>> LongMethod:TransactionVerifierServiceInternal.kt$Verifier$ private fun verifyConstraintsValidity(contractAttachmentsByContract: Map<ContractClassName, ContractAttachment>) LongMethod:TransactionVerifierServiceInternal.kt$Verifier$ private fun verifyContracts() LongMethod:TransactionVerifierServiceInternal.kt$Verifier$// Using basic graph theory, a full cycle of encumbered (co-dependent) states should exist to achieve bi-directional // encumbrances. This property is important to ensure that no states involved in an encumbrance-relationship // can be spent on their own. Briefly, if any of the states is having more than one encumbrance references by // other states, a full cycle detection will fail. As a result, all of the encumbered states must be present // as "from" and "to" only once (or zero times if no encumbrance takes place). For instance, // a -> b // c -> b and a -> b // b -> a b -> c // do not satisfy the bi-directionality (full cycle) property. // // In the first example "b" appears twice in encumbrance ("to") list and "c" exists in the encumbered ("from") list only. // Due the above, one could consume "a" and "b" in the same transaction and then, because "b" is already consumed, "c" cannot be spent. // // Similarly, the second example does not form a full cycle because "a" and "c" exist in one of the lists only. // As a result, one can consume "b" and "c" in the same transactions, which will make "a" impossible to be spent. // // On other hand the following are valid constructions: // a -> b a -> c // b -> c and c -> b // c -> a b -> a // and form a full cycle, meaning that the bi-directionality property is satisfied. private fun checkBidirectionalOutputEncumbrances(statesAndEncumbrance: List<Pair<Int, Int>>) @@ -1879,7 +1899,7 @@ LongMethod:WebServer.kt$fun main(args: Array<String>) LongMethod:WhitelistGenerator.kt$fun generateWhitelist(networkParameters: NetworkParameters?, excludeContracts: List<ContractClassName>, cordappJars: List<ContractsJar>, includeContracts: List<ContractClassName>, optionalCordappJars: List<ContractsJar>): Map<ContractClassName, List<AttachmentId>> LongMethod:WireTransaction.kt$WireTransaction$@DeleteForDJVM override fun toString(): String - LongMethod:WireTransaction.kt$WireTransaction$private fun toLedgerTransactionInternal( resolveIdentity: (PublicKey) -> Party?, resolveAttachment: (SecureHash) -> Attachment?, resolveStateRefAsSerialized: (StateRef) -> SerializedBytes<TransactionState<ContractState>>?, resolveParameters: (SecureHash?) -> NetworkParameters?, resolveContractAttachment: (StateRef) -> Attachment, isAttachmentTrusted: (Attachment) -> Boolean ): LedgerTransaction + LongMethod:WireTransaction.kt$WireTransaction$private fun toLedgerTransactionInternal( resolveIdentity: (PublicKey) -> Party?, resolveAttachment: (SecureHash) -> Attachment?, resolveStateRefAsSerialized: (StateRef) -> SerializedBytes<TransactionState<ContractState>>?, resolveParameters: (SecureHash?) -> NetworkParameters?, isAttachmentTrusted: (Attachment) -> Boolean ): LedgerTransaction LongMethod:WireTransaction.kt$WireTransaction.Companion$ @CordaInternal fun resolveStateRefBinaryComponent(stateRef: StateRef, services: ServicesForResolution): SerializedBytes<TransactionState<ContractState>>? LongMethod:WithReferencedStatesFlow.kt$WithReferencedStatesFlow$@Suspendable override fun call(): T LongMethod:WorkflowTransactionBuildTutorial.kt$RecordCompletionFlow$@Suspendable override fun call() @@ -1915,7 +1935,7 @@ LongParameterList:CertificateRevocationListNodeTests.kt$CertificateRevocationListNodeTests$(port: Int, name: CordaX500Name = ALICE_NAME, crlCheckSoftFail: Boolean, nodeCrlDistPoint: String = "http://${server.hostAndPort}/crl/node.crl", tlsCrlDistPoint: String? = "http://${server.hostAndPort}/crl/empty.crl", maxMessageSize: Int = MAX_MESSAGE_SIZE) LongParameterList:CertificateRevocationListNodeTests.kt$CertificateRevocationListNodeTests.Companion$(clrServer: CrlServer, signatureAlgorithm: String, caCertificate: X509Certificate, caPrivateKey: PrivateKey, endpoint: String, indirect: Boolean, vararg serialNumbers: BigInteger) LongParameterList:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$(baseDirectory: Path, certificatesDirectoryName: String = DEFAULT_CERTIFICATES_DIRECTORY_NAME, keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME, keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD, keyPassword: String = keyStorePassword, trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD) - LongParameterList:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$(certificatesDirectory: Path, keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME, keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD, keyPassword: String = keyStorePassword, trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD, trustStoreKeyPassword: String = TrustStore.DEFAULT_KEY_PASSWORD, useOpenSsl: Boolean = false) + LongParameterList:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$(certificatesDirectory: Path, keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME, keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD, keyPassword: String = keyStorePassword, trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD, trustStoreKeyPassword: String = TrustStore.DEFAULT_KEY_PASSWORD, @Suppress("UNUSED_PARAMETER") useOpenSsl: Boolean = false) LongParameterList:ContractAttachment.kt$ContractAttachment.Companion$(attachment: Attachment, contract: ContractClassName, additionalContracts: Set<ContractClassName> = emptySet(), uploader: String? = null, signerKeys: List<PublicKey> = emptyList(), version: Int = DEFAULT_CORDAPP_VERSION) LongParameterList:ContractFunctions.kt$(expiry: String, notional: BigDecimal, strike: BigDecimal, foreignCurrency: Currency, domesticCurrency: Currency, partyA: Party, partyB: Party) LongParameterList:ContractFunctions.kt$(expiry: String, notional: Long, strike: Double, foreignCurrency: Currency, domesticCurrency: Currency, partyA: Party, partyB: Party) @@ -1923,7 +1943,7 @@ LongParameterList:ContractJarTestUtils.kt$ContractJarTestUtils$(workingDir: Path, contractNames: List<String>, signed: Boolean = false, version: Int = 1, generateManifest: Boolean = true, jarFileName : String? = null) LongParameterList:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$( inputs: List<StateAndRef<ContractState>> = this.inputs, notary: Party = this.notary, legacyContractAttachment: Attachment = this.legacyContractAttachment, upgradedContractClassName: ContractClassName = this.upgradedContract::class.java.name, upgradedContractAttachment: Attachment = this.upgradedContractAttachment, id: SecureHash = this.id, privacySalt: PrivacySalt = this.privacySalt, sigs: List<TransactionSignature> = this.sigs, networkParameters: NetworkParameters = this.networkParameters ) LongParameterList:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction.Companion$( inputs: List<StateAndRef<ContractState>>, notary: Party, legacyContractAttachment: Attachment, upgradedContractAttachment: Attachment, id: SecureHash, privacySalt: PrivacySalt, sigs: List<TransactionSignature>, networkParameters: NetworkParameters, upgradedContract: UpgradedContract<ContractState, *> ) - LongParameterList:CordaRPCClient.kt$CordaRPCClient$(username: String, password: String, externalTrace: Trace?, impersonatedActor: Actor?, targetLegalIdentity: CordaX500Name?, gracefulReconnect: Boolean = false) + LongParameterList:CordaRPCClient.kt$CordaRPCClient$(username: String, password: String, externalTrace: Trace?, impersonatedActor: Actor?, targetLegalIdentity: CordaX500Name?, gracefulReconnect: GracefulReconnect? = null) LongParameterList:CordaRPCClient.kt$CordaRPCClientConfiguration$( connectionMaxRetryInterval: Duration = this.connectionMaxRetryInterval, minimumServerProtocolVersion: Int = this.minimumServerProtocolVersion, trackRpcCallSites: Boolean = this.trackRpcCallSites, reapInterval: Duration = this.reapInterval, observationExecutorPoolSize: Int = this.observationExecutorPoolSize, cacheConcurrencyLevel: Int = this.cacheConcurrencyLevel, connectionRetryInterval: Duration = this.connectionRetryInterval, connectionRetryIntervalMultiplier: Double = this.connectionRetryIntervalMultiplier, maxReconnectAttempts: Int = this.maxReconnectAttempts, maxFileSize: Int = this.maxFileSize, deduplicationCacheExpiry: Duration = this.deduplicationCacheExpiry ) LongParameterList:CordaRPCOps.kt$( @Suppress("UNUSED_PARAMETER") flowConstructor: (A, B, C, D, E) -> R, arg0: A, arg1: B, arg2: C, arg3: D, arg4: E ) LongParameterList:CordaRPCOps.kt$( @Suppress("UNUSED_PARAMETER") flowConstructor: (A, B, C, D, E, F) -> R, arg0: A, arg1: B, arg2: C, arg3: D, arg4: E, arg5: F ) @@ -1933,7 +1953,7 @@ LongParameterList:Driver.kt$DriverParameters$( isDebug: Boolean, driverDirectory: Path, portAllocation: PortAllocation, debugPortAllocation: PortAllocation, systemProperties: Map<String, String>, useTestClock: Boolean, startNodesInProcess: Boolean, waitForAllNodesToFinish: Boolean, notarySpecs: List<NotarySpec>, extraCordappPackagesToScan: List<String>, jmxPolicy: JmxPolicy, networkParameters: NetworkParameters, cordappsForAllNodes: Set<TestCordapp>? ) LongParameterList:DriverDSL.kt$DriverDSL$( defaultParameters: NodeParameters = NodeParameters(), providedName: CordaX500Name? = defaultParameters.providedName, rpcUsers: List<User> = defaultParameters.rpcUsers, verifierType: VerifierType = defaultParameters.verifierType, customOverrides: Map<String, Any?> = defaultParameters.customOverrides, startInSameProcess: Boolean? = defaultParameters.startInSameProcess, maximumHeapSize: String = defaultParameters.maximumHeapSize ) LongParameterList:DriverDSL.kt$DriverDSL$( defaultParameters: NodeParameters = NodeParameters(), providedName: CordaX500Name? = defaultParameters.providedName, rpcUsers: List<User> = defaultParameters.rpcUsers, verifierType: VerifierType = defaultParameters.verifierType, customOverrides: Map<String, Any?> = defaultParameters.customOverrides, startInSameProcess: Boolean? = defaultParameters.startInSameProcess, maximumHeapSize: String = defaultParameters.maximumHeapSize, logLevelOverride: String? = defaultParameters.logLevelOverride ) - LongParameterList:DriverDSLImpl.kt$( isDebug: Boolean = DriverParameters().isDebug, driverDirectory: Path = DriverParameters().driverDirectory, portAllocation: PortAllocation = DriverParameters().portAllocation, debugPortAllocation: PortAllocation = DriverParameters().debugPortAllocation, systemProperties: Map<String, String> = DriverParameters().systemProperties, useTestClock: Boolean = DriverParameters().useTestClock, startNodesInProcess: Boolean = DriverParameters().startNodesInProcess, extraCordappPackagesToScan: List<String> = DriverParameters().extraCordappPackagesToScan, waitForAllNodesToFinish: Boolean = DriverParameters().waitForAllNodesToFinish, notarySpecs: List<NotarySpec> = DriverParameters().notarySpecs, jmxPolicy: JmxPolicy = DriverParameters().jmxPolicy, networkParameters: NetworkParameters = DriverParameters().networkParameters, compatibilityZone: CompatibilityZoneParams? = null, notaryCustomOverrides: Map<String, Any?> = DriverParameters().notaryCustomOverrides, inMemoryDB: Boolean = DriverParameters().inMemoryDB, cordappsForAllNodes: Collection<TestCordappInternal>? = null, dsl: DriverDSLImpl.() -> A ) + LongParameterList:DriverDSLImpl.kt$( isDebug: Boolean = DriverParameters().isDebug, driverDirectory: Path = DriverParameters().driverDirectory, portAllocation: PortAllocation = DriverParameters().portAllocation, debugPortAllocation: PortAllocation = DriverParameters().debugPortAllocation, systemProperties: Map<String, String> = DriverParameters().systemProperties, useTestClock: Boolean = DriverParameters().useTestClock, startNodesInProcess: Boolean = DriverParameters().startNodesInProcess, extraCordappPackagesToScan: List<String> = @Suppress("DEPRECATION") DriverParameters().extraCordappPackagesToScan, waitForAllNodesToFinish: Boolean = DriverParameters().waitForAllNodesToFinish, notarySpecs: List<NotarySpec> = DriverParameters().notarySpecs, jmxPolicy: JmxPolicy = DriverParameters().jmxPolicy, networkParameters: NetworkParameters = DriverParameters().networkParameters, compatibilityZone: CompatibilityZoneParams? = null, notaryCustomOverrides: Map<String, Any?> = DriverParameters().notaryCustomOverrides, inMemoryDB: Boolean = DriverParameters().inMemoryDB, cordappsForAllNodes: Collection<TestCordappInternal>? = null, dsl: DriverDSLImpl.() -> A ) LongParameterList:DriverDSLImpl.kt$DriverDSLImpl.Companion$( config: NodeConfig, quasarJarPath: String, debugPort: Int?, overriddenSystemProperties: Map<String, String>, maximumHeapSize: String, logLevelOverride: String?, vararg extraCmdLineFlag: String ) LongParameterList:DummyFungibleContract.kt$DummyFungibleContract$(inputs: List<State>, outputs: List<State>, tx: LedgerTransaction, issueCommand: CommandWithParties<Commands.Issue>, currency: Currency, issuer: PartyAndReference) LongParameterList:IRS.kt$FloatingRatePaymentEvent$(date: LocalDate = this.date, accrualStartDate: LocalDate = this.accrualStartDate, accrualEndDate: LocalDate = this.accrualEndDate, dayCountBasisDay: DayCountBasisDay = this.dayCountBasisDay, dayCountBasisYear: DayCountBasisYear = this.dayCountBasisYear, fixingDate: LocalDate = this.fixingDate, notional: Amount<Currency> = this.notional, rate: Rate = this.rate) @@ -1959,7 +1979,7 @@ LongParameterList:NodeParameters.kt$NodeParameters$( providedName: CordaX500Name?, rpcUsers: List<User>, verifierType: VerifierType, customOverrides: Map<String, Any?>, startInSameProcess: Boolean?, maximumHeapSize: String ) LongParameterList:NodeParameters.kt$NodeParameters$( providedName: CordaX500Name?, rpcUsers: List<User>, verifierType: VerifierType, customOverrides: Map<String, Any?>, startInSameProcess: Boolean?, maximumHeapSize: String, additionalCordapps: Collection<TestCordapp> = emptySet(), flowOverrides: Map<out Class<out FlowLogic<*>>, Class<out FlowLogic<*>>> ) LongParameterList:NotaryChangeTransactions.kt$NotaryChangeLedgerTransaction.Companion$(inputs: List<StateAndRef<ContractState>>, notary: Party, newNotary: Party, id: SecureHash, sigs: List<TransactionSignature>, networkParameters: NetworkParameters) - LongParameterList:ObjectSerializer.kt$ComposableObjectWriter$(obj: Any, data: Data, type: Type, output: SerializationOutput, context: SerializationContext, debugIndent: Int) + LongParameterList:ObjectSerializer.kt$ComposableObjectWriter$( obj: Any, data: Data, @Suppress("UNUSED_PARAMETER") type: Type, output: SerializationOutput, context: SerializationContext, debugIndent: Int ) LongParameterList:ObjectSerializer.kt$EvolutionObjectSerializer.Companion$(localTypeInformation: LocalTypeInformation.Composable, remoteTypeInformation: RemoteTypeInformation.Composable, constructor: LocalConstructorInformation, properties: Map<String, LocalPropertyInformation>, classLoader: ClassLoader, mustPreserveData: Boolean) LongParameterList:ObligationUtils.kt$ObligationUtils$(tx: TransactionBuilder, obligor: AbstractParty, acceptableContract: SecureHash, amount: Amount<Issued<Currency>>, dueBefore: Instant, beneficiary: AbstractParty, notary: Party) LongParameterList:ObligationUtils.kt$ObligationUtils$(tx: TransactionBuilder, obligor: AbstractParty, issuanceDef: Obligation.Terms<P>, pennies: Long, beneficiary: AbstractParty, notary: Party) @@ -2005,7 +2025,6 @@ LongParameterList:VaultFiller.kt$VaultFiller$(numberToCreate: Int, externalId: String? = null, participants: List<AbstractParty> = emptyList(), uniqueIdentifier: UniqueIdentifier? = null, linearString: String = "", linearNumber: Long = 0L, linearBoolean: Boolean = false, linearTimestamp: Instant = now(), constraint: AttachmentConstraint = AutomaticPlaceholderConstraint, includeMe: Boolean = true) LongParameterList:VaultService.kt$Vault.StateMetadata$( ref: StateRef = this.ref, contractStateClassName: String = this.contractStateClassName, recordedTime: Instant = this.recordedTime, consumedTime: Instant? = this.consumedTime, status: Vault.StateStatus = this.status, notary: AbstractParty? = this.notary, lockId: String? = this.lockId, lockUpdateTime: Instant? = this.lockUpdateTime ) LongParameterList:VaultService.kt$Vault.StateMetadata$( ref: StateRef = this.ref, contractStateClassName: String = this.contractStateClassName, recordedTime: Instant = this.recordedTime, consumedTime: Instant? = this.consumedTime, status: Vault.StateStatus = this.status, notary: AbstractParty? = this.notary, lockId: String? = this.lockId, lockUpdateTime: Instant? = this.lockUpdateTime, relevancyStatus: Vault.RelevancyStatus? ) - LongParameterList:WireTransaction.kt$WireTransaction$( resolveIdentity: (PublicKey) -> Party?, resolveAttachment: (SecureHash) -> Attachment?, resolveStateRefAsSerialized: (StateRef) -> SerializedBytes<TransactionState<ContractState>>?, resolveParameters: (SecureHash?) -> NetworkParameters?, resolveContractAttachment: (StateRef) -> Attachment, isAttachmentTrusted: (Attachment) -> Boolean ) LongParameterList:WireTransaction.kt$WireTransaction.Companion$(inputs: List<StateRef>, outputs: List<TransactionState<ContractState>>, commands: List<Command<*>>, attachments: List<SecureHash>, notary: Party?, timeWindow: TimeWindow?) LongParameterList:X509Utilities.kt$X509Utilities$(certificateType: CertificateType, issuer: X500Principal, issuerKeyPair: KeyPair, subject: X500Principal, subjectPublicKey: PublicKey, validityWindow: Pair<Date, Date>, nameConstraints: NameConstraints? = null, crlDistPoint: String? = null, crlIssuer: X500Name? = null) LongParameterList:X509Utilities.kt$X509Utilities$(certificateType: CertificateType, issuer: X500Principal, issuerPublicKey: PublicKey, issuerSigner: ContentSigner, subject: X500Principal, subjectPublicKey: PublicKey, validityWindow: Pair<Date, Date>, nameConstraints: NameConstraints? = null, crlDistPoint: String? = null, crlIssuer: X500Name? = null) @@ -2094,6 +2113,7 @@ MagicNumber:AttachmentDemo.kt$10010 MagicNumber:AttachmentDemoTest.kt$AttachmentDemoTest$10_000_000 MagicNumber:AttachmentLoadingTests.kt$AttachmentLoadingTests$1234 + MagicNumber:AttachmentTrustTable.kt$AttachmentTrustTable$3 MagicNumber:AttachmentsClassLoader.kt$AttachmentsClassLoader$4 MagicNumber:AttachmentsClassLoaderSerializationTests.kt$AttachmentsClassLoaderSerializationTests$20 MagicNumber:AttachmentsClassLoaderSerializationTests.kt$AttachmentsClassLoaderSerializationTests$3 @@ -2214,7 +2234,6 @@ MagicNumber:CertificateRevocationListNodeTests.kt$CertificateRevocationListNodeTests$3 MagicNumber:CertificateRevocationListNodeTests.kt$CertificateRevocationListNodeTests$5 MagicNumber:CertificateRevocationListNodeTests.kt$CertificateRevocationListNodeTests.Companion$10 - MagicNumber:CheatingSecurityProvider.kt$CheatingSecurityProvider$1.8 MagicNumber:CityDatabaseTest.kt$CityDatabaseTest$0.12 MagicNumber:CityDatabaseTest.kt$CityDatabaseTest$51.5 MagicNumber:ClassCarpenter.kt$ClassCarpenterImpl$3 @@ -2326,6 +2345,7 @@ MagicNumber:CordaRPCClient.kt$CordaRPCClientConfiguration$31 MagicNumber:CordaRPCClient.kt$CordaRPCClientConfiguration$5 MagicNumber:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$10 + MagicNumber:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$20 MagicNumber:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$4 MagicNumber:CordaRPCClientTest.kt$CordaRPCClientTest$10 MagicNumber:CordaRPCClientTest.kt$CordaRPCClientTest$100 @@ -2820,6 +2840,7 @@ MagicNumber:KryoTests.kt$KryoTests$19 MagicNumber:KryoTests.kt$KryoTests$20 MagicNumber:KryoTests.kt$KryoTests$20000 + MagicNumber:KryoTests.kt$KryoTests$20172 MagicNumber:KryoTests.kt$KryoTests$20222 MagicNumber:KryoTests.kt$KryoTests$21 MagicNumber:KryoTests.kt$KryoTests$22 @@ -3060,6 +3081,7 @@ MagicNumber:NodeVaultServiceTest.kt$NodeVaultServiceTest$200 MagicNumber:NodeVaultServiceTest.kt$NodeVaultServiceTest$3 MagicNumber:NodeVaultServiceTest.kt$NodeVaultServiceTest$30 + MagicNumber:NodeVaultServiceTest.kt$NodeVaultServiceTest$32 MagicNumber:NodeVaultServiceTest.kt$NodeVaultServiceTest$4 MagicNumber:NodeVaultServiceTest.kt$NodeVaultServiceTest$5 MagicNumber:NodeVaultServiceTest.kt$NodeVaultServiceTest$6 @@ -3171,7 +3193,6 @@ MagicNumber:PartyTest.kt$PartyTest$20170207L MagicNumber:PartyTest.kt$PartyTest$7201702L MagicNumber:Password.kt$Password$5 - MagicNumber:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable$70 MagicNumber:PersistentNetworkMapCacheTest.kt$PersistentNetworkMapCacheTest$1000 MagicNumber:PersistentScheduledFlowRepositoryTest.kt$PersistentScheduledFlowRepositoryTest$5 MagicNumber:PersistentTypes.kt$MappedSchema$31 @@ -3422,7 +3443,6 @@ MagicNumber:SerializationPropertyOrdering.kt$SerializationPropertyOrdering$500 MagicNumber:SerializationTokenTest.kt$SerializationTokenTest.LargeTokenizable$1024 MagicNumber:ServiceHubConcurrentUsageTest.kt$ServiceHubConcurrentUsageTest.TestFlow$10 - MagicNumber:SharedMemoryIncremental.kt$SharedMemoryIncremental$16 MagicNumber:ShutdownManager.kt$ShutdownManager$5 MagicNumber:ShutdownManager.kt$ShutdownManager$60 MagicNumber:SignedNodeInfoTest.kt$SignedNodeInfoTest$1234 @@ -3520,7 +3540,6 @@ MagicNumber:TransactionSignatureTest.kt$TransactionSignatureTest$3 MagicNumber:TransactionSignatureTest.kt$TransactionSignatureTest$4 MagicNumber:TransactionTests.kt$TransactionTests.<no name provided>$1234 - MagicNumber:TransactionUtils.kt$100 MagicNumber:TransactionUtils.kt$4 MagicNumber:TransactionVerificationExceptionSerialisationTests.kt$TransactionVerificationExceptionSerialisationTests$12 MagicNumber:TransactionVerificationExceptionSerialisationTests.kt$TransactionVerificationExceptionSerialisationTests$20 @@ -3680,7 +3699,6 @@ MagicNumber:WireTransaction.kt$WireTransaction$4 MagicNumber:WorkflowTransactionBuildTutorial.kt$SubmitCompletionFlow$60 MagicNumber:WorkflowTransactionBuildTutorial.kt$SubmitTradeApprovalFlow$60 - MagicNumber:X509EdDSAEngineTest.kt$X509EdDSAEngineTest.Companion$8 MagicNumber:X509Utilities.kt$X509Utilities$3650 MagicNumber:X509UtilitiesTest.kt$X509UtilitiesTest$10 MagicNumber:X509UtilitiesTest.kt$X509UtilitiesTest$1000 @@ -3708,6 +3726,7 @@ MatchingDeclarationName:FlowsExecutionModeRpcTest.kt$net.corda.client.rpc.FlowsExecutionModeRpcTest.kt MatchingDeclarationName:IRSDemo.kt$net.corda.irs.web.demo.IRSDemo.kt MatchingDeclarationName:InterestSwapRestAPI.kt$net.corda.irs.web.api.InterestSwapRestAPI.kt + MatchingDeclarationName:InternalAccessTestHelpers.kt$net.corda.serialization.internal.InternalAccessTestHelpers.kt MatchingDeclarationName:InternalTestUtils.kt$net.corda.testing.node.internal.InternalTestUtils.kt MatchingDeclarationName:IrsDemoClientApi.kt$net.corda.irs.web.demo.IrsDemoClientApi.kt MatchingDeclarationName:KeyStoreConfigHelpers.kt$net.corda.nodeapi.internal.KeyStoreConfigHelpers.kt @@ -3800,7 +3819,7 @@ MaxLineLength:AMQPServerSerializationScheme.kt$AMQPServerSerializationScheme$constructor(cordapps: List<Cordapp>) : this(cordapps.customSerializers, cordapps.serializationWhitelists, AccessOrderLinkedHashMap<SerializationFactoryCacheKey, SerializerFactory>(128).toSynchronised()) MaxLineLength:AMQPServerSerializationScheme.kt$AMQPServerSerializationScheme$constructor(cordapps: List<Cordapp>, serializerFactoriesForContexts: MutableMap<SerializationFactoryCacheKey, SerializerFactory>) : this(cordapps.customSerializers, cordapps.serializationWhitelists, serializerFactoriesForContexts) MaxLineLength:AMQPServerSerializationScheme.kt$AMQPServerSerializationScheme$return SerializerFactoryBuilder.build(context.whitelist, context.deserializationClassLoader, context.lenientCarpenterEnabled).apply { register(RpcServerObservableSerializer()) register(RpcServerCordaFutureSerializer(this)) register(RxNotificationSerializer(this)) } - MaxLineLength:AMQPTestUtils.kt$val dir = ProjectStructure.projectRootDir / "serialization" / "src" / "test" / "resources" / javaClass.packageName.replace('.', separatorChar) + MaxLineLength:AMQPTestUtils.kt$val dir = ProjectStructure.projectRootDir / "serialization" / "src" / "test" / "resources" / javaClass.packageName_.replace('.', separatorChar) MaxLineLength:AMQPTypeIdentifierParser.kt$AMQPTypeIdentifierParser$else -> throw IllegalTypeNameParserStateException("Type name '$typeString' contains illegal character '$c'") MaxLineLength:AMQPTypeIdentifierParser.kt$AMQPTypeIdentifierParser$throw IllegalTypeNameParserStateException("Nested depth of type parameters exceeds maximum of $MAX_TYPE_PARAM_DEPTH") MaxLineLength:AMQPTypeIdentifierParser.kt$AMQPTypeIdentifierParser.ParseState.ParsingArray$data @@ -3839,6 +3858,7 @@ MaxLineLength:AbstractAMQPSerializationSchemeTest.kt$AbstractAMQPSerializationSchemeTest$val factory = SerializerFactoryBuilder.build(TESTING_CONTEXT.whitelist, TESTING_CONTEXT.deserializationClassLoader) MaxLineLength:AbstractAMQPSerializationSchemeTest.kt$AbstractAMQPSerializationSchemeTest$val scheme = object : AbstractAMQPSerializationScheme(emptySet(), emptySet(), backingMap, createSerializerFactoryFactory()) { override fun rpcClientSerializerFactory(context: SerializationContext): SerializerFactory { return factory } override fun rpcServerSerializerFactory(context: SerializationContext): SerializerFactory { return factory } override fun canDeserializeVersion(magic: CordaSerializationMagic, target: SerializationContext.UseCase): Boolean { return true } } MaxLineLength:AbstractAMQPSerializationSchemeTest.kt$AbstractAMQPSerializationSchemeTest.<no name provided>$override + MaxLineLength:AbstractAggregatedList.kt$AbstractAggregatedList<A, E : Any, K : Any> : TransformationList MaxLineLength:AbstractAttachment.kt$// We whitelist sources of transaction JARs for now as a temporary state until the DJVM and other security sandboxes // have been integrated, at which point we'll be able to run untrusted code downloaded over the network and this mechanism // can be removed. Because we ARE downloading attachments over the P2P network in anticipation of this upgrade, we // track the source of each attachment in our store. TestDSL is used by LedgerDSLInterpreter when custom attachments // are added in unit test code. val TRUSTED_UPLOADERS = listOf(DEPLOYED_CORDAPP_UPLOADER, RPC_UPLOADER, TESTDSL_UPLOADER) MaxLineLength:AbstractAttachment.kt$AbstractAttachment.Companion$ @DeleteForDJVM fun SerializeAsTokenContext.attachmentDataLoader(id: SecureHash): () -> ByteArray MaxLineLength:AbstractCashFlow.kt$AbstractCashFlow$@Suspendable protected @@ -3854,6 +3874,15 @@ MaxLineLength:AbstractCashSelection.kt$AbstractCashSelection.Companion$"\nPlease specify an implementation in META-INF/services/${AbstractCashSelection::class.qualifiedName}." MaxLineLength:AbstractCashSelection.kt$AbstractCashSelection.Companion$val cashSelectionAlgos = ServiceLoader.load(AbstractCashSelection::class.java, this::class.java.classLoader).toList() MaxLineLength:AbstractCashSelection.kt$AbstractCashSelection.Companion${ instance.set(cashSelectionAlgo) cashSelectionAlgo } + MaxLineLength:AbstractConcatenatedList.kt$AbstractConcatenatedList$abstract + MaxLineLength:AbstractConcatenatedList.kt$AbstractConcatenatedList$val permutedOffset = (if (permutedListIndex == 0) 0 else newSubNestedIndexOffsets[permutedListIndex - 1]) + MaxLineLength:AbstractConcatenatedList.kt$AbstractConcatenatedList${ // If a nested element is updated we simply propagate the update by offsetting the nested element index // by the startingOffsetOf the nested list. val listIndex = indexMap[wrapped]!!.first val startingOffset = startingOffsetOf(listIndex) for (i in change.from until change.to) { nextUpdate(startingOffset + i) } } + MaxLineLength:AbstractConcatenatedList.kt$AbstractConcatenatedList<A> : TransformationList + MaxLineLength:AbstractFlattenedList.kt$AbstractFlattenedList$abstract + MaxLineLength:AbstractFlattenedList.kt$AbstractFlattenedList${ // TODO this assumes that if wasAdded() == true then we are adding elements to the getFrom() position val removeStart = c.from val removeRange = c.removed.size val removeEnd = c.from + removeRange val iterator = indexMap.iterator() for (entry in iterator) { val (wrapped, pair) = entry val (index, listener) = pair if (index >= removeStart) { if (index < removeEnd) { wrapped.observableValue.removeListener(listener) iterator.remove() } else { // Shift indices entry.setValue(Pair(index - removeRange, listener)) } } } nextRemove(removeStart, removed.map { it.value }) } + MaxLineLength:AbstractFlattenedList.kt$AbstractFlattenedList<A> : TransformationList + MaxLineLength:AbstractMappedList.kt$AbstractMappedList$abstract + MaxLineLength:AbstractMappedList.kt$AbstractMappedList<A, B> : TransformationList MaxLineLength:AbstractNode.kt$AbstractNode$" for it exists in the database. This suggests the identity for this node has been lost. Shutting down to prevent network map issues." MaxLineLength:AbstractNode.kt$AbstractNode$"Private key for the node legal identity not found (alias $legalIdentityPrivateKeyAlias) but the corresponding public key" MaxLineLength:AbstractNode.kt$AbstractNode$"match what's in the key store: $subject. You might need to adjust the configuration of `notary.serviceLegalName`." @@ -3861,6 +3890,7 @@ MaxLineLength:AbstractNode.kt$AbstractNode$( CertificateType.LEGAL_IDENTITY, nodeCaCert.subjectX500Principal, nodeCaCert.publicKey, cryptoService.getSigner(X509Utilities.CORDA_CLIENT_CA), nodeCaCert.subjectX500Principal, legalIdentityPublicKey, // TODO this might be smaller than DEFAULT_VALIDITY_WINDOW, shall we strictly apply DEFAULT_VALIDITY_WINDOW? X509Utilities.getCertificateValidityWindow( DEFAULT_VALIDITY_WINDOW.first, DEFAULT_VALIDITY_WINDOW.second, nodeCaCert) ) MaxLineLength:AbstractNode.kt$AbstractNode$/** * Should be [rx.schedulers.Schedulers.io] for production, * or [rx.internal.schedulers.CachedThreadScheduler] (with shutdown registered with [runOnStop]) for shared-JVM testing. */ protected abstract val rxIoScheduler: Scheduler MaxLineLength:AbstractNode.kt$AbstractNode$// Ideally we should be disabling the FinalityHandler if it's not needed, to prevent any party from submitting transactions to us without // us checking. Previously this was gated on app target version and if there were no apps with target version <= 3 then the handler would // be disabled. However this prevents seemless rolling-upgrades and so it was removed until a better solution comes along. private fun installFinalityHandler() + MaxLineLength:AbstractNode.kt$AbstractNode$// JDK 11: switch to directly instantiating jolokia server (rather than indirectly via dynamically self attaching Java Agents, // which is no longer supported from JDK 9 onwards (https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8180425). // No longer need to use https://github.com/electronicarts/ea-agent-loader either (which is also deprecated) private fun initialiseJolokia() MaxLineLength:AbstractNode.kt$AbstractNode$// TODO Cancelling parameters updates - if we do that, how we ensure that no one uses cancelled parameters in the transactions? val networkMapUpdater = NetworkMapUpdater( networkMapCache, NodeInfoWatcher( configuration.baseDirectory, @Suppress("LeakingThis") rxIoScheduler, Duration.ofMillis(configuration.additionalNodeInfoPollingFrequencyMsec) ), networkMapClient, configuration.baseDirectory, configuration.extraNetworkMapKeys, networkParametersStorage ).closeOnStop() MaxLineLength:AbstractNode.kt$AbstractNode$// There is already a party in the identity store for this node, but the key has been lost. If this node starts up, it will // publish it's new key to the network map, which Corda cannot currently handle. To prevent this, stop the node from starting. "Private key for the node legal identity not found (alias $legalIdentityPrivateKeyAlias) but the corresponding public key" + " for it exists in the database. This suggests the identity for this node has been lost. Shutting down to prevent network map issues." MaxLineLength:AbstractNode.kt$AbstractNode$AllCertificateStores @@ -3871,12 +3901,14 @@ MaxLineLength:AbstractNode.kt$AbstractNode$flowManager.registerInitiatedCoreFlowFactory(ContractUpgradeFlow.Initiate::class, NotaryChangeHandler::class, ::ContractUpgradeHandler) MaxLineLength:AbstractNode.kt$AbstractNode$flowManager.registerInitiatedCoreFlowFactory(NotaryChangeFlow::class, NotaryChangeHandler::class, ::NotaryChangeHandler) MaxLineLength:AbstractNode.kt$AbstractNode$flowManager.registerInitiatedCoreFlowFactory(SwapIdentitiesFlow::class, SwapIdentitiesHandler::class, ::SwapIdentitiesHandler) + MaxLineLength:AbstractNode.kt$AbstractNode$identityService.start(trustRoot, listOf(identity.certificate, nodeCa), netParams.notaries.map { it.identity }, pkToIdCache) MaxLineLength:AbstractNode.kt$AbstractNode$if (!cryptoService.containsKey(legalIdentityPrivateKeyAlias) && !signingCertificateStore.contains(legalIdentityPrivateKeyAlias)) { // Directly use the X500 name to public key map, as the identity service requires the node identity to start correctly. database.transaction { val x500Map = PersistentIdentityService.createX500ToKeyMap(cacheFactory) require(configuration.myLegalName !in x500Map) { // There is already a party in the identity store for this node, but the key has been lost. If this node starts up, it will // publish it's new key to the network map, which Corda cannot currently handle. To prevent this, stop the node from starting. "Private key for the node legal identity not found (alias $legalIdentityPrivateKeyAlias) but the corresponding public key" + " for it exists in the database. This suggests the identity for this node has been lost. Shutting down to prevent network map issues." } } log.info("$legalIdentityPrivateKeyAlias not found in key store, generating fresh key!") createAndStoreLegalIdentity(legalIdentityPrivateKeyAlias) signingCertificateStore = configuration.signingCertificateStore.get() // We need to resync after [createAndStoreLegalIdentity]. } else { checkAliasMismatch(legalIdentityPrivateKeyAlias, signingCertificateStore) } MaxLineLength:AbstractNode.kt$AbstractNode$log MaxLineLength:AbstractNode.kt$AbstractNode$log.error("Corda service ${it.name} failed to instantiate. Reason was: ${e.cause?.rootMessage}", e.cause) - MaxLineLength:AbstractNode.kt$AbstractNode$log.error("Error while adding key fingerprint $it to cordappSignerKeyFingerprintBlacklist due to ${e.message}", e) MaxLineLength:AbstractNode.kt$AbstractNode$log.warn("Found more than one node registration with our legal name, this is only expected if our keypair has been regenerated") MaxLineLength:AbstractNode.kt$AbstractNode$networkParametersStorage.setCurrentParameters(signedNetParams, trustRoot) identityService.loadIdentities(nodeInfo.legalIdentitiesAndCerts) attachments.start() cordappProvider.start() nodeProperties.start() // Place the long term identity key in the KMS. Eventually, this is likely going to be separated again because // the KMS is meant for derived temporary keys used in transactions, and we're not supposed to sign things with // the identity key. But the infrastructure to make that easy isn't here yet. keyManagementService.start(keyPairs) val notaryService = maybeStartNotaryService(myNotaryIdentity) installCordaServices() contractUpgradeService.start() vaultService.start() ScheduledActivityObserver.install(vaultService, schedulerService, flowLogicRefFactory) val frozenTokenizableServices = tokenizableServices!! tokenizableServices = null verifyCheckpointsCompatible(frozenTokenizableServices) checkpointDumper.start(frozenTokenizableServices) smm.start(frozenTokenizableServices) // Shut down the SMM so no Fibers are scheduled. runOnStop += { smm.stop(acceptableLiveFiberCountOnStop()) } (smm as? StateMachineManagerInternal)?.let { val flowMonitor = FlowMonitor({ smm.snapshot().filter { flow -> flow !in smm.flowHospital }.toSet() }, configuration.flowMonitorPeriodMillis, configuration.flowMonitorSuspensionLoggingThresholdMillis) runOnStop += flowMonitor::stop flowMonitor.start() } schedulerService.start() createStartedNode(nodeInfo, rpcOps, notaryService).also { _started = it } + MaxLineLength:AbstractNode.kt$AbstractNode$parseSecureHashConfiguration(configuration.blacklistedAttachmentSigningKeys) { "Error while adding signing key $it to blacklistedAttachmentSigningKeys" } + MaxLineLength:AbstractNode.kt$AbstractNode$parseSecureHashConfiguration(configuration.cordappSignerKeyFingerprintBlacklist) { "Error while adding key fingerprint $it to blacklistedAttachmentSigningKeys" } MaxLineLength:AbstractNode.kt$AbstractNode$private MaxLineLength:AbstractNode.kt$AbstractNode$protected open MaxLineLength:AbstractNode.kt$AbstractNode$protected open fun generateKeyPair(alias: String) @@ -3904,14 +3936,15 @@ MaxLineLength:AbstractNode.kt$AbstractNode.AppServiceHubImpl$private MaxLineLength:AbstractNode.kt$AbstractNode.AppServiceHubImpl$require(logicType.isAnnotationPresent(StartableByService::class.java)) { "${logicType.name} was not designed for starting by a CordaService" } MaxLineLength:AbstractNode.kt$AbstractNode.ServiceHubInternalImpl$inner + MaxLineLength:AbstractNode.kt$AbstractNode.ServiceHubInternalImpl$override val attachmentTrustCalculator: AttachmentTrustCalculator get() = this@AbstractNode.attachmentTrustCalculator MaxLineLength:AbstractNode.kt$AbstractNode.ServiceHubInternalImpl$override val networkParametersService: NetworkParametersStorage get() = this@AbstractNode.networkParametersStorage MaxLineLength:AbstractNode.kt$AbstractNode.ServiceHubInternalImpl$override val transactionVerifierService: TransactionVerifierService get() = this@AbstractNode.transactionVerifierService MaxLineLength:AbstractNode.kt$AbstractNode<S> : SingletonSerializeAsToken MaxLineLength:AbstractNode.kt$FlowStarterImpl : FlowStarter - MaxLineLength:AbstractNode.kt$JavaTypeDescriptorRegistry.INSTANCE.addDescriptor(AbstractPartyDescriptor(wellKnownPartyFromX500Name, wellKnownPartyFromAnonymous)) MaxLineLength:AbstractNode.kt$ex is HikariPool.PoolInitializationException -> throw CouldNotCreateDataSourceException("Could not connect to the database. Please check your JDBC connection URL, or the connectivity to the database.", ex) MaxLineLength:AbstractNode.kt$ex.cause is ClassNotFoundException -> throw CouldNotCreateDataSourceException("Could not find the database driver class. Please add it to the 'drivers' folder. See: https://docs.corda.net/corda-configuration-file.html") MaxLineLength:AbstractNode.kt$fun CordaPersistence.startHikariPool(hikariProperties: Properties, databaseConfig: DatabaseConfig, schemas: Set<MappedSchema>, metricRegistry: MetricRegistry? = null, cordappLoader: CordappLoader? = null, currentDir: Path? = null, ourName: CordaX500Name) + MaxLineLength:AbstractNode.kt$org.hibernate.type.descriptor.java.JavaTypeDescriptorRegistry.INSTANCE.addDescriptor(AbstractPartyDescriptor(wellKnownPartyFromX500Name, wellKnownPartyFromAnonymous)) MaxLineLength:AbstractNode.kt$return ClientRpcSslOptions(trustStorePath = nodeRpcOptions.sslConfig!!.keyStorePath, trustStorePassword = nodeRpcOptions.sslConfig!!.keyStorePassword) MaxLineLength:AbstractNode.kt$return CordaPersistence(databaseConfig, schemaService.schemaOptions.keys, jdbcUrl, cacheFactory, attributeConverters, customClassLoader) MaxLineLength:AbstractNode.kt$val attributeConverters = listOf(PublicKeyToTextConverter(), AbstractPartyToX500NameAsStringConverter(wellKnownPartyFromX500Name, wellKnownPartyFromAnonymous)) @@ -3922,6 +3955,7 @@ MaxLineLength:AbstractPartyToX500NameAsStringConverter.kt$AbstractPartyToX500NameAsStringConverter$private val wellKnownPartyFromAnonymous: (AbstractParty) -> Party? MaxLineLength:AbstractRPCTest.kt$AbstractRPCTest$startInVmRpcServer(ops = ops, rpcUser = rpcUser, configuration = serverConfiguration, queueDrainTimeout = queueDrainTimeout) MaxLineLength:AbstractRPCTest.kt$AbstractRPCTest$startRpcClient<I>(broker.hostAndPort!!, rpcUser.username, rpcUser.password, clientConfiguration) + MaxLineLength:AbstractReplayedList.kt$AbstractReplayedList<A> : TransformationList MaxLineLength:AbstractStateReplacementFlow.kt$AbstractStateReplacementFlow$Acceptor<in T> : FlowLogic MaxLineLength:AbstractStateReplacementFlow.kt$AbstractStateReplacementFlow$Instigator<out S : ContractState, out T : ContractState, out M> : FlowLogic MaxLineLength:AbstractStateReplacementFlow.kt$AbstractStateReplacementFlow$Proposal<out M> @@ -3949,7 +3983,6 @@ MaxLineLength:AddressBindingFailureTests.kt$AddressBindingFailureTests$assertThatThrownBy { startNode(customOverrides = overrides(address)).getOrThrow() } MaxLineLength:AddressBindingFailureTests.kt$AddressBindingFailureTests$driver MaxLineLength:AffinityExecutor.kt$AffinityExecutor$ fun executeASAP(runnable: () -> Unit) - MaxLineLength:AggregatedList.kt$AggregatedList<A, E : Any, K : Any> : TransformationList MaxLineLength:AliasPrivateKeyTest.kt$AliasPrivateKeyTest$signingCertStore.query { setPrivateKey(alias, aliasPrivateKey, listOf(NOT_YET_REGISTERED_MARKER_KEYS_AND_CERTS.ECDSAR1_CERT), "entrypassword") } MaxLineLength:AliasPrivateKeyTest.kt$AliasPrivateKeyTest$val signingCertStore = CertificateStoreStubs.Signing.withCertificatesDirectory(certificatesDirectory, "keystorepass").get(createNew = true) MaxLineLength:AliasPrivateKeyTest.kt$AliasPrivateKeyTest${ val alias = "01234567890" val aliasPrivateKey = AliasPrivateKey(alias) val certificatesDirectory = tempFolder.root.toPath() val signingCertStore = CertificateStoreStubs.Signing.withCertificatesDirectory(certificatesDirectory, "keystorepass").get(createNew = true) signingCertStore.query { setPrivateKey(alias, aliasPrivateKey, listOf(NOT_YET_REGISTERED_MARKER_KEYS_AND_CERTS.ECDSAR1_CERT), "entrypassword") } // We can retrieve the certificate. assertTrue { signingCertStore.contains(alias) } // We can retrieve the certificate. assertEquals(NOT_YET_REGISTERED_MARKER_KEYS_AND_CERTS.ECDSAR1_CERT, signingCertStore[alias]) // Although we can store an AliasPrivateKey, we cannot retrieve it. But, it's fine as we use certStore for storing/handling certs only. assertThatIllegalArgumentException().isThrownBy { signingCertStore.query { getPrivateKey(alias, "entrypassword") } }.withMessage("Unrecognised algorithm: 1.3.6.1.4.1.50530.1.2") } @@ -4109,15 +4142,38 @@ MaxLineLength:AttachmentStorage.kt$AttachmentStorage$ @Deprecated("More attachment information is required", replaceWith = ReplaceWith("importAttachment(jar, uploader, filename)")) @Throws(FileAlreadyExistsException::class, IOException::class) fun importAttachment(jar: InputStream): AttachmentId MaxLineLength:AttachmentStorage.kt$AttachmentStorage$ fun getLatestContractAttachments(contractClassName: String, minContractVersion: Int = DEFAULT_CORDAPP_VERSION): List<AttachmentId> MaxLineLength:AttachmentStorage.kt$AttachmentStorage$@Deprecated("More attachment information is required", replaceWith = ReplaceWith("importAttachment(jar, uploader, filename)")) + MaxLineLength:AttachmentStorageInternal.kt$AttachmentStorageInternal$ fun getAllAttachmentsByCriteria(criteria: AttachmentQueryCriteria = AttachmentQueryCriteria.AttachmentsQueryCriteria()): Stream<Pair<String?, Attachment>> MaxLineLength:AttachmentStorageInternal.kt$AttachmentStorageInternal$ fun privilegedImportAttachment(jar: InputStream, uploader: String, filename: String?): AttachmentId MaxLineLength:AttachmentTests.kt$AttachmentTests$private MaxLineLength:AttachmentTests.kt$AttachmentTests$val corruptAttachment = NodeAttachmentService.DBAttachment(attId = id.toString(), content = attachment, version = DEFAULT_CORDAPP_VERSION) MaxLineLength:AttachmentTests.kt$AttachmentTests.InitiatingFetchAttachmentsFlow$@InitiatingFlow private + MaxLineLength:AttachmentTrustCalculator.kt$AttachmentTrustCalculator$ fun calculate(attachment: Attachment): Boolean + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(attachmentB)!!), "Contract $attachmentB should not be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(attachmentC)!!), "Contract $attachmentC should not be trusted (no chain of trust)") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(v1Id)!!), "Initial attachment $v1Id should not be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(v1Id)!!), "Initial contract $v1Id should not be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(v2Id)!!), "Other attachment $v2Id should not be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(v2Id)!!), "Upgraded contract $v2Id should not be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(attachment)!!), "Contract $attachment should be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(attachmentA)!!), "Contract $attachmentA should be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(attachmentB)!!), "Contract $attachmentB should inherit trust") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(attachmentId)!!), "Attachment $attachmentId should be trusted but isn't") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(signedId)!!), "Signed contract $signedId should be trusted but isn't") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(unsignedId)!!), "Unsigned contract $unsignedId should be trusted but isn't") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(v1Id)!!), "Initial attachment $v1Id should be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(v1Id)!!), "Initial attachment $v1Id should not be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(v1Id)!!), "Initial contract $v1Id should be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(v2Id)!!), "Other attachment $v2Id should be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(v2Id)!!), "Upgraded contract $v2Id should be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$val alias = "testAlias" val password = "testPassword" // Directly use the ContractJarTestUtils version of makeTestJar to ensure jars are created in the right place, in order to sign // them. var counter = 0 val jarV1 = path / "$counter.jar" ContractJarTestUtils.makeTestJar(jarV1.outputStream()) counter++ val jarV2 = path / "$counter.jar" // Ensure that the first and second jars do not have the same hash ContractJarTestUtils.makeTestJar(jarV2.outputStream(), entries = listOf(Pair("foo", "bar"))) path.generateKey(alias, password) val key1 = path.signJar(jarV1.toAbsolutePath().toString(), alias, password) val key2 = path.signJar(jarV2.toAbsolutePath().toString(), alias, password) val v1Id = jarV1.read { storage.privilegedImportAttachment(it, "app", "dummy-attachment.jar") } val v2Id = jarV2.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-attachment-2.jar") } // Sanity check. assertEquals(key1, key2, "Different public keys used to sign jars") assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(v1Id)!!), "Initial attachment $v1Id should be trusted") assertTrue(attachmentTrustCalculator.calculate(storage.openAttachment(v2Id)!!), "Other attachment $v2Id should be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$val alias = "testAlias" val password = "testPassword" // Directly use the ContractJarTestUtils version of makeTestJar to ensure jars are created in the right place, in order to sign // them. var counter = 0 val jarV1 = path / "$counter.jar" ContractJarTestUtils.makeTestJar(jarV1.outputStream()) counter++ val jarV2 = path / "$counter.jar" // Ensure that the first and second jars do not have the same hash ContractJarTestUtils.makeTestJar(jarV2.outputStream(), entries = listOf(Pair("foo", "bar"))) path.generateKey(alias, password) val key1 = path.signJar(jarV1.toAbsolutePath().toString(), alias, password) val key2 = path.signJar(jarV2.toAbsolutePath().toString(), alias, password) val v1Id = jarV1.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-attachment.jar") } val v2Id = jarV2.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-attachment-2.jar") } // Sanity check. assertEquals(key1, key2, "Different public keys used to sign jars") assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(v1Id)!!), "Initial attachment $v1Id should not be trusted") assertFalse(attachmentTrustCalculator.calculate(storage.openAttachment(v2Id)!!), "Other attachment $v2Id should not be trusted") + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$val attachmentB = jarSignedByAB.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-contract.jar") } + MaxLineLength:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest$val attachmentC = jarSignedByBC.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-contract.jar") } MaxLineLength:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$logger.error("$msg skipped, network parameters not retrieved, could not determine node base directory due to system property $NODE_BASE_DIR_KEY being not set.") MaxLineLength:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$logger.info("$msg skipped, network parameters not found in $path, but there are no available attachments to migrate.") MaxLineLength:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$logger.info("$msg using network parameters from $path, whitelistedContractImplementations: ${networkParameters.whitelistedContractImplementations}.") - MaxLineLength:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$logger.warn("Several versions based on whitelistedContractImplementations position are available: ${versions.toSet()}. $msg") - MaxLineLength:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$val versions = networkParameters?.whitelistedContractImplementations?.values.mapNotNull { it.indexOfFirst { it.toString() == attachmentId } }.filter { it >= 0 } + MaxLineLength:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$logger.warn("Several versions based on whitelistedContractImplementations position are available: ${versions.toSet()}. $updateVersionMsg") + MaxLineLength:AttachmentVersionNumberMigration.kt$AttachmentVersionNumberMigration$val versions = networkParameters.whitelistedContractImplementations.values.map { it.indexOfFirst { aid -> aid.toString() == attachmentId } }.filter { it >= 0 } MaxLineLength:AttachmentWithContext.kt$AttachmentWithContext$"This AttachmentWithContext was not initialised properly. Please ensure all Corda contracts extending existing Corda contracts also implement the Contract base class." MaxLineLength:AttachmentsClassLoader.kt$AttachmentsClassLoader : URLClassLoader MaxLineLength:AttachmentsClassLoader.kt$AttachmentsClassLoader$"Please follow the operational steps outlined in https://docs.corda.net/cordapp-build-systems.html#cordapp-contract-attachments to learn more and continue." @@ -4146,8 +4202,8 @@ MaxLineLength:AttachmentsClassLoaderStaticContractTests.kt$import net.corda.nodeapi.internal.AttachmentsClassLoaderStaticContractTests.AttachmentDummyContract.Companion.ATTACHMENT_PROGRAM_ID MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Allow loading an untrusted contract jar if another attachment exists that was signed by a trusted uploader - intersection of keys match existing attachment`() MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Allow loading an untrusted contract jar if another attachment exists that was signed with the same keys and uploaded by a trusted uploader`() + MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Cannot load an untrusted contract jar if it is signed by a blacklisted key even if there is another attachment signed by the same keys that is trusted`() MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$@Test fun `Cannot load an untrusted contract jar if no other attachment exists that was signed with the same keys and uploaded by a trusted uploader`() - MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$make(arrayOf(trustedResourceJar, untrustedResourceJar, trustedClassJar, untrustedClassJar).map { storage.openAttachment(it)!! }) MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$val att1 = importAttachment(fakeAttachment("/folder1/foldera/file1.txt", "some data").inputStream(), "app", "file1.jar") MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$val att1 = importAttachment(fakeAttachment("file1.txt", "same data", "file2.txt", "same other data").inputStream(), "app", "file1.jar") MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$val att1 = importAttachment(fakeAttachment("meta-inf/services/com.example.something", "some data").inputStream(), "app", "file1.jar") @@ -4163,6 +4219,7 @@ MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$val trustedResourceJar = importAttachment(fakeAttachment("file1.txt", "some data").inputStream(), "app", "file0.jar") MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$val untrustedClassJar = importAttachment(fakeAttachment("/com/example/something/MaliciousClass.class", "some malicious data").inputStream(), "untrusted", "file2.jar") MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests$val untrustedResourceJar = importAttachment(fakeAttachment("file2.txt", "some malicious data").inputStream(), "untrusted", "file1.jar") + MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests${ val keyPairA = Crypto.generateKeyPair() val keyPairB = Crypto.generateKeyPair() val keyPairC = Crypto.generateKeyPair() val classJar = fakeAttachment( "/com/example/something/TrustedClass.class", "Signed by someone untrusted with the same keys" ).inputStream() storage.importContractAttachment( listOf("TrustedClass.class"), "app", classJar, signers = listOf(keyPairA.public) ) val inheritedTrustClassJar = fakeAttachment( "/com/example/something/UntrustedClass.class", "Signed by someone who inherits trust" ).inputStream() val inheritedTrustAttachment = storage.importContractAttachment( listOf("UntrustedClass.class"), "untrusted", inheritedTrustClassJar, signers = listOf(keyPairB.public, keyPairA.public) ) val untrustedClassJar = fakeAttachment( "/com/example/something/UntrustedClass.class", "Signed by someone untrusted" ).inputStream() val untrustedAttachment = storage.importContractAttachment( listOf("UntrustedClass.class"), "untrusted", untrustedClassJar, signers = listOf(keyPairB.public, keyPairC.public) ) // pass the inherited trust attachment through the classloader first to ensure it does not affect the next loaded attachment createClassloader(inheritedTrustAttachment) assertFailsWith(TransactionVerificationException.UntrustedAttachmentsException::class) { createClassloader(untrustedAttachment) } } MaxLineLength:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests.Companion$val ISOLATED_CONTRACTS_JAR_PATH_V4: URL = AttachmentsClassLoaderTests::class.java.getResource("isolated-4.0.jar") MaxLineLength:AuditService.kt$AuditEvent MaxLineLength:AuditService.kt$FlowPermissionAuditEvent : AuditEventFlowAuditInfo @@ -4241,6 +4298,7 @@ MaxLineLength:BackpressureAwareTimedFlow.kt$BackpressureAwareTimedFlow<ResultType> : FlowLogicTimedFlow MaxLineLength:BankOfCordaClientApi.kt$BankOfCordaClientApi$ fun requestRPCIssue(rpcAddress: NetworkHostAndPort, params: IssueRequestParams): SignedTransaction MaxLineLength:BankOfCordaClientApi.kt$BankOfCordaClientApi$ fun requestRPCIssueHA(availableRpcServers: List<NetworkHostAndPort>, params: IssueRequestParams): SignedTransaction + MaxLineLength:BankOfCordaClientApi.kt$BankOfCordaClientApi$ReconnectingCordaRPCOps(availableRpcServers, BOC_RPC_USER, BOC_RPC_PWD, CordaRPCClientConfiguration.DEFAULT) MaxLineLength:BankOfCordaClientApi.kt$BankOfCordaClientApi$return rpc.startFlow(::CashIssueAndPaymentFlow, params.amount, issuerBankPartyRef, issueToParty, anonymous, notaryLegalIdentity) .returnValue.getOrThrow().stx MaxLineLength:BankOfCordaWebApi.kt$BankOfCordaWebApi$?: MaxLineLength:BankOfCordaWebApi.kt$BankOfCordaWebApi$rpc.startFlow(::CashIssueAndPaymentFlow, params.amount, issuerBankPartyRef, issueToParty, anonymous, notaryParty).returnValue.getOrThrow() @@ -4257,7 +4315,6 @@ MaxLineLength:BaseTransactions.kt$FullTransaction$check(notaries.single() == notary) { "The specified notary must be the one specified by all inputs and input references" } MaxLineLength:BasicHSMKeyManagementService.kt$BasicHSMKeyManagementService$"Metadata schemeCodeName: ${sigMetaData.schemeCodeName} is not aligned with the key type: ${sigKey.schemeCodeName}." MaxLineLength:BasicHSMKeyManagementService.kt$BasicHSMKeyManagementService$// Get [KeyPair] for the input [publicKey]. This is used for fresh keys, in which we have access to the private key material. private fun getSigningKeyPair(publicKey: PublicKey): KeyPair - MaxLineLength:BasicHSMKeyManagementService.kt$BasicHSMKeyManagementService$private val pkToIdCache: WritablePublicKeyToOwningIdentityCache MaxLineLength:BasicHSMKeyManagementService.kt$BasicHSMKeyManagementService$require(it.private is AliasPrivateKey) { "${this.javaClass.name} supports AliasPrivateKeys only, but ${it.private.algorithm} key was found" } MaxLineLength:BasicHSMKeyManagementService.kt$BasicHSMKeyManagementService.Companion$fun createKeyMap(cacheFactory: NamedCacheFactory): AppendOnlyPersistentMap<PublicKey, PrivateKey, PersistentKey, String> MaxLineLength:BitSetSerializer.kt$BitSetSerializer : Proxy @@ -4289,13 +4346,13 @@ MaxLineLength:BridgeControlMessages.kt$BridgeEntry$@CordaSerializable data MaxLineLength:BrokerJaasLoginModule.kt$BaseBrokerJaasLoginModule$override MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule : BaseBrokerJaasLoginModule + MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$@Suppress("DEPRECATION") // should use java.security.cert.X509Certificate private MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$CertificateChainCheckPolicy.LeafMustMatch.createCheck(nodeJaasConfig.keyStore, nodeJaasConfig.trustStore).checkCertificateChain(certificates!!) MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$CertificateChainCheckPolicy.RootMustMatch.createCheck(p2pJaasConfig!!.keyStore, p2pJaasConfig!!.trustStore).checkCertificateChain(certificates!!) MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$Pair(username, listOf(RolePrincipal(RPC_ROLE), RolePrincipal("${RPCApi.RPC_CLIENT_QUEUE_NAME_PREFIX}.$username"))) - MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$fun requireTls(certificates: Array<X509Certificate>?) + MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$fun requireTls(certificates: Array<javax.security.cert.X509Certificate>?) MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$if (e is IllegalArgumentException && e.stackTrace.any { it.className == "org.apache.activemq.artemis.protocol.amqp.sasl.PlainSASL" }) { log.trace("SASL Login failed.") } else { log.warn("Login failed: ${e.message}") } MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$override - MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule$private MaxLineLength:BrokerJaasLoginModule.kt$BrokerJaasLoginModule${ // This is a known problem, so we swallow this exception. A peer will attempt to connect without presenting client certificates during SASL if (e is IllegalArgumentException && e.stackTrace.any { it.className == "org.apache.activemq.artemis.protocol.amqp.sasl.PlainSASL" }) { log.trace("SASL Login failed.") } else { log.warn("Login failed: ${e.message}") } if (e is LoginException) { throw e } else { throw FailedLoginException(e.message) } } MaxLineLength:BrokerJaasLoginModule.kt$RPCJaasConfig$val loginListener: LoginListener MaxLineLength:BuiltNode.kt$BuiltNode$return PushedNode(configFile, baseDirectory, copiedNodeConfig, copiedNodeDir, nodeConfig, localImageId, remoteImageName) @@ -4413,7 +4470,7 @@ MaxLineLength:CashViewer.kt$CashViewer$/** * We exchange the sum to the reporting currency, to be displayed in the "<currency> Equiv" column. */ val equivSumAmount = EasyBind.combine(sumAmount, reportingExchange) { sum, exchange -> exchange.second(sum) } MaxLineLength:CashViewer.kt$CashViewer$AggregatedList MaxLineLength:CashViewer.kt$CashViewer$is ViewerNode.IssuerNode -> SimpleStringProperty(node.issuer.nameOrNull()?.let { PartyNameFormatter.short.format(it) } ?: "Anonymous") - MaxLineLength:CashViewer.kt$CashViewer$itemsProperty().bind(selectedNode.map { it?.states?.map { StateRow(LocalDateTime.now(), it) } ?: ObservableListWrapper(emptyList()) }) + MaxLineLength:CashViewer.kt$CashViewer$itemsProperty().bind(selectedNode.map { it?.states?.map { StateRow(LocalDateTime.now(), it) } ?: FXCollections.emptyObservableList() }) MaxLineLength:CashViewer.kt$CashViewer$setCellValueFactory { val node = it.value.value when (node) { is ViewerNode.IssuerNode -> null.lift() is ViewerNode.CurrencyNode -> node.amount.map { it } } } cellFactory = currencyCellFactory /** * We must set this, otherwise on sort an exception will be thrown, as it will try to compare Amounts of differing currency */ isSortable = false MaxLineLength:CashViewer.kt$CashViewer.CashWidget$if(lastTimeStamp != null && currentTimeStamp - lastTimeStamp.toLong() < 1.seconds.toMillis()) { data.safelyTransition { remove(size - 1, size) } } MaxLineLength:CashViewer.kt$CashViewer.CashWidget$private @@ -4461,7 +4518,8 @@ MaxLineLength:CertificateStore.kt$CertificateStore.Companion$fun of(store: X509KeyStore, password: String, entryPassword: String): CertificateStore MaxLineLength:CertificateStore.kt$DelegatingCertificateStore : CertificateStore MaxLineLength:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$@JvmStatic fun withBaseDirectory(baseDirectory: Path, certificatesDirectoryName: String = DEFAULT_CERTIFICATES_DIRECTORY_NAME, keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME, keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD, keyPassword: String = keyStorePassword, trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD): MutualSslConfiguration - MaxLineLength:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$@JvmStatic fun withCertificatesDirectory(certificatesDirectory: Path, keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME, keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD, keyPassword: String = keyStorePassword, trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD, trustStoreKeyPassword: String = TrustStore.DEFAULT_KEY_PASSWORD, useOpenSsl: Boolean = false): MutualSslConfiguration + MaxLineLength:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$@JvmStatic fun withCertificatesDirectory(certificatesDirectory: Path, keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME, keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD, keyPassword: String = keyStorePassword, trustStoreFileName: String = TrustStore.DEFAULT_STORE_FILE_NAME, trustStorePassword: String = TrustStore.DEFAULT_STORE_PASSWORD, trustStoreKeyPassword: String = TrustStore.DEFAULT_KEY_PASSWORD, @Suppress("UNUSED_PARAMETER") useOpenSsl: Boolean = false): MutualSslConfiguration + MaxLineLength:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$@Suppress("UNUSED_PARAMETER") useOpenSsl: Boolean = false MaxLineLength:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$keyPassword: String = keyStorePassword MaxLineLength:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$keyStoreFileName: String = KeyStore.DEFAULT_STORE_FILE_NAME MaxLineLength:CertificateStoreStubs.kt$CertificateStoreStubs.P2P.Companion$keyStorePassword: String = KeyStore.DEFAULT_STORE_PASSWORD @@ -4490,8 +4548,6 @@ MaxLineLength:CertificatesUtils.kt$fun saveToKeyStore(keyStorePath: Path, rpcKeyPair: KeyPair, selfSignCert: X509Certificate, password: String = "password", alias: String = "Key"): Path MaxLineLength:CertificatesUtils.kt$fun saveToTrustStore(trustStorePath: Path, selfSignCert: X509Certificate, password: String = "password", alias: String = "Key"): Path MaxLineLength:CertificatesUtils.kt$validityWindow: Pair<Duration, Duration> = X509Utilities.DEFAULT_VALIDITY_WINDOW - MaxLineLength:CheatingSecurityProvider.kt$CheatingSecurityProvider : ProviderAutoCloseable - MaxLineLength:CheatingSecurityProvider.kt$CheatingSecurityProvider$CheatingSecureRandomService : Service MaxLineLength:CheckpointAgent.kt$CheckpointAgent.Companion$println("Running Checkpoint agent with following arguments: instrumentClassname=$instrumentClassname, instrumentType=$instrumentType, minimumSize=$minimumSize, maximumSize=$maximumSize, graphDepth=$graphDepth, printOnce=$printOnce\n") MaxLineLength:CheckpointAgent.kt$CheckpointHook : ClassFileTransformer MaxLineLength:CheckpointAgent.kt$CheckpointHook$builder.append("${statsTree.className} (hash:${statsTree.value?.hashCode()}) (count:${identityInfo.refCount})") @@ -4505,7 +4561,7 @@ MaxLineLength:CheckpointAgent.kt$fun readTrees(events: List<StatsEvent>, index: Int, idMap: IdentityHashMap<Any, IdentityInfo>): Pair<Int, List<Pair<StatsInfo, IdentityInfo>>> MaxLineLength:CheckpointAgent.kt$log.debug { "Skipping repeated StatsEvent.Enter: ${exit.value} (hashcode:${exit.value!!.hashCode()}) (count:${idMap[exit.value]?.refCount})" } MaxLineLength:CheckpointAgent.kt$log.debug { "Skipping repeated StatsEvent.Exit: ${event.value} (hashcode:${event.value!!.hashCode()}) (count:${idMap[event.value]?.refCount})" } - MaxLineLength:CheckpointAgent.kt$log.debug { "Skipping repeated StatsEvent.ObjectField: ${event.value} (hashcode:${event.value!!.hashCode()}) (count:${idMap[event.value]?.refCount})" } + MaxLineLength:CheckpointAgent.kt$log.debug { "Skipping repeated StatsEvent.ObjectField: ${event.value} (hashcode:${event.value.hashCode()}) (count:${idMap[event.value]?.refCount})" } MaxLineLength:CheckpointAgent.kt$trees += StatsInfo(event.fieldName, event.fieldType) to IdentityInfo(StatsTree.BasicType(event.fieldValue), 1) MaxLineLength:CheckpointDumper.kt$CheckpointDumper MaxLineLength:CheckpointDumper.kt$CheckpointDumper$is WaitForStateConsumption -> SuspendedOn(waitForStateConsumption = (operation as WaitForStateConsumption).stateRefs) @@ -4548,7 +4604,7 @@ MaxLineLength:ClassCarpentingTypeLoaderTests.kt$ClassCarpentingTypeLoaderTests$is TypeIdentifier.Unparameterised -> RemoteTypeInformation.Unparameterised(typeIdentifier.prettyPrint(), typeIdentifier) MaxLineLength:ClassGraphUtils.kt$ fun ClassGraph.pooledScan(): ScanResult MaxLineLength:ClassLoadingUtils.kt$ @StubOutForDJVM fun <T: Any> createInstancesOfClassesImplementing(classloader: ClassLoader, clazz: Class<T>): Set<T> - MaxLineLength:ClassLoadingUtilsTest.kt$ClassLoadingUtilsTest$val classes = createInstancesOfClassesImplementing(BaseInterface::class.java.classLoader, BaseInterface2::class.java) + MaxLineLength:ClassLoadingUtils.kt$ fun <T: Any> createInstancesOfClassesImplementing(@Suppress("UNUSED_PARAMETER") classloader: ClassLoader, @Suppress("UNUSED_PARAMETER") clazz: Class<T>): Set<T> MaxLineLength:ClassLoadingUtilsTest.kt$ClassLoadingUtilsTest$val classes = createInstancesOfClassesImplementing(BaseInterface::class.java.classLoader, BaseInterface::class.java) MaxLineLength:ClassWhitelists.kt$AbstractMutableClassWhitelist$sealed MaxLineLength:ClassWhitelists.kt$AbstractMutableClassWhitelist${ /** * There are certain delegates like [net.corda.serialization.internal.AllButBlacklisted] * which may throw when asked whether the type is listed. * In such situations - it may be a good idea to ask [delegate] first before making a check against own [whitelist]. */ return delegate.hasListed(type) || (type.name in whitelist) } @@ -4559,7 +4615,6 @@ MaxLineLength:ClientRPCInfrastructureTests.kt$ClientRPCInfrastructureTests$assertEquals("Quote by Mark Twain: I have never let my schooling interfere with my education.", clientQuotes.take()) MaxLineLength:ClientRPCInfrastructureTests.kt$ClientRPCInfrastructureTests$assertEquals("Quote by Oscar Wilde: Always forgive your enemies - nothing annoys them so much.", clientQuotes.take()) MaxLineLength:ClientRPCInfrastructureTests.kt$ClientRPCInfrastructureTests$assertThat(clientQuotes.take()).isEqualTo("Quote by Mark Twain: I have never let my schooling interfere with my education.") - MaxLineLength:ClientRelevantException.kt$ClientRelevantException : CordaRuntimeExceptionClientRelevantError MaxLineLength:ClientRpcSslOptions.kt$ClientRpcSslOptions MaxLineLength:ClientRpcSslOptions.kt$ClientRpcSslOptions$data MaxLineLength:ClientRpcTutorial.kt$PrintOrVisualise @@ -4615,6 +4670,7 @@ MaxLineLength:CommandLineCompatibilityUtils.kt$CommandLineCompatibilityChecker$private MaxLineLength:CommandLineCompatibilityUtils.kt$CommandLineCompatibilityChecker$return objectMapper.readValue<List<CommandDescription>>(inputStream, object : TypeReference<List<CommandDescription>>() {}) MaxLineLength:CommandLineCompatibilityUtils.kt$CommandLineCompatibilityChecker$val potentiallyChanged = oldAcceptableTypes.filter { newAcceptableTypes[it.key] != null && newAcceptableTypes[it.key]!!.toSet() != it.value.toSet() } + MaxLineLength:CommandLineCompatibilityUtils.kt$CommandLineCompatibilityChecker.Companion$CommandLineCompatibilityChecker().printCommandDescription(CommandLine(clazz.getDeclaredConstructor().newInstance())) MaxLineLength:CommandLineCompatibilityUtils.kt$ParameterDescription MaxLineLength:CommandLineInterface.kt$CommandLineInterface$"${instance.reachableAddress} {ssh:${instance.portMapping[Constants.NODE_SSHD_PORT]}, " MaxLineLength:CommandLineInterface.kt$CommandLineInterface$NetworkBuilder.instance() .withBasedir(baseDir) .withNetworkName(networkName) .onNodeBuild { builtNode -> println("Built node: ${builtNode.name} to image: ${builtNode.localImageId}") } @@ -4750,9 +4806,6 @@ MaxLineLength:CompositeSignature.kt$CompositeSignature$throw SignatureException("Composite signatures must be assembled independently from signatures provided by the component private keys") MaxLineLength:CompositeSignature.kt$CompositeSignature.Companion$@JvmStatic fun getService(provider: Provider) MaxLineLength:CompositeSignaturesWithKeys.kt$CompositeSignaturesWithKeys - MaxLineLength:ConcatenatedList.kt$ConcatenatedList$val permutedOffset = (if (permutedListIndex == 0) 0 else newSubNestedIndexOffsets[permutedListIndex - 1]) - MaxLineLength:ConcatenatedList.kt$ConcatenatedList${ // If a nested element is updated we simply propagate the update by offsetting the nested element index // by the startingOffsetOf the nested list. val listIndex = indexMap[wrapped]!!.first val startingOffset = startingOffsetOf(listIndex) for (i in change.from until change.to) { nextUpdate(startingOffset + i) } } - MaxLineLength:ConcatenatedList.kt$ConcatenatedList<A> : TransformationList MaxLineLength:ConcatenatedListTest.kt$ConcatenatedListTest$sourceList = FXCollections.observableArrayList<ObservableList<String>>(FXCollections.observableArrayList("hello")) MaxLineLength:ConcurrencyUtils.kt$ fun <V, W> firstOf(vararg futures: CordaFuture<out V>, handler: (CordaFuture<out V>) -> W) MaxLineLength:ConcurrencyUtils.kt$internal @@ -4902,7 +4955,7 @@ MaxLineLength:ConnectionStateMachine.kt$ConnectionStateMachine$logDebugWithMDC { "Sender delivery confirmed tag ${javax.xml.bind.DatatypeConverter.printHexBinary(delivery.tag)}" } MaxLineLength:ConnectionStateMachine.kt$ConnectionStateMachine$sender.send(messageBuf.array(), messageBuf.arrayOffset() + messageBuf.readerIndex(), messageBuf.readableBytes()) MaxLineLength:ConnectionStateMachine.kt$ConnectionStateMachine$val pending = transport.pending() // Note this drives frame generation, which the susbsequent writes push to the socket - MaxLineLength:Constants.kt$/** * constants in this file are generated by gradle * to change this file, edit src/main/template/kotlin/net/corda/common/logging/Constants.kt * the generated file does not need to be committed to source control (originally added to source control for ease of use) */ internal const val CURRENT_MAJOR_RELEASE = "4.3-SNAPSHOT" + MaxLineLength:Constants.kt$/** * constants in this file are generated by gradle * to change this file, edit src/main/template/kotlin/net/corda/common/logging/Constants.kt * the generated file does not need to be committed to source control (originally added to source control for ease of use) */ internal const val CURRENT_MAJOR_RELEASE = "4.3-RC01" MaxLineLength:Constants.kt$/** * constants in this file are generated by gradle * to change this file, edit src/main/template/kotlin/net/corda/common/logging/Constants.kt * the generated file does not need to be committed to source control (originally added to source control for ease of use) */ internal const val CURRENT_MAJOR_RELEASE = "@corda_release_version@" MaxLineLength:ConstraintsPropagationTests.kt$ConstraintsPropagationTests$@Test fun `Fail early in the TransactionBuilder when attempting to change the hash of the HashConstraint on the spending transaction`() MaxLineLength:ConstraintsPropagationTests.kt$ConstraintsPropagationTests$@Test fun `On contract annotated with NoConstraintPropagation there is no platform check for propagation, but the transaction builder can't use the AutomaticPlaceholderConstraint`() @@ -4962,12 +5015,12 @@ MaxLineLength:ConstraintsUtils.kt$ fun AttachmentConstraint.canBeTransitionedFrom(input: AttachmentConstraint, attachment: ContractAttachment): Boolean MaxLineLength:ConstraintsUtils.kt$ internal fun ContractClassName.contractHasAutomaticConstraintPropagation(classLoader: ClassLoader? = null): Boolean MaxLineLength:ConstraintsUtils.kt$HashAttachmentConstraint.disableHashConstraints && input is HashAttachmentConstraint && output is SignatureAttachmentConstraint -> true - MaxLineLength:ConstraintsUtils.kt$input is AutomaticHashConstraint || output is AutomaticHashConstraint -> throw IllegalArgumentException("Illegal constraint: AutomaticHashConstraint.") MaxLineLength:ConstraintsUtils.kt$input is AutomaticPlaceholderConstraint || output is AutomaticPlaceholderConstraint -> throw IllegalArgumentException("Illegal constraint: AutomaticPlaceholderConstraint.") + MaxLineLength:ConstraintsUtils.kt$input.isAutomaticHashConstraint() || output.isAutomaticHashConstraint() -> throw IllegalArgumentException("Illegal constraint: AutomaticHashConstraint.") MaxLineLength:ConstraintsUtils.kt$log.warnOnce("Found state ${state.contract} that is constrained by the insecure: AlwaysAcceptAttachmentConstraint.") MaxLineLength:ConstraintsUtils.kt$require(state.constraint::class in validConstraints) { "Found state ${state.contract} with an illegal constraint: ${state.constraint}" } MaxLineLength:ConstraintsUtils.kt$val Attachment.contractVersion: Version get() = if (this is ContractAttachment) version else CordappImpl.DEFAULT_CORDAPP_VERSION - MaxLineLength:ConstraintsUtils.kt$when { // These branches should not happen, as this has been already checked. input is AutomaticPlaceholderConstraint || output is AutomaticPlaceholderConstraint -> throw IllegalArgumentException("Illegal constraint: AutomaticPlaceholderConstraint.") input is AutomaticHashConstraint || output is AutomaticHashConstraint -> throw IllegalArgumentException("Illegal constraint: AutomaticHashConstraint.") // Transition to the same constraint. input == output -> true // You can't transition from the AlwaysAcceptAttachmentConstraint to anything else, as it could hide something illegal. input is AlwaysAcceptAttachmentConstraint && output !is AlwaysAcceptAttachmentConstraint -> false // Nothing can be migrated from the HashConstraint except a HashConstraint with the same Hash. (This check is redundant, but added for clarity) input is HashAttachmentConstraint && output is HashAttachmentConstraint -> input == output // Anything (except the AlwaysAcceptAttachmentConstraint) can be transformed to a HashAttachmentConstraint. input !is HashAttachmentConstraint && output is HashAttachmentConstraint -> true // The SignatureAttachmentConstraint allows migration from a Signature constraint with the same key. // TODO - we don't support currently third party signers. When we do, the output key will have to be stronger then the input key. input is SignatureAttachmentConstraint && output is SignatureAttachmentConstraint -> input.key == output.key // HashAttachmentConstraint can be transformed to a SignatureAttachmentConstraint when hash constraint verification checking disabled. HashAttachmentConstraint.disableHashConstraints && input is HashAttachmentConstraint && output is SignatureAttachmentConstraint -> true // You can transition from the WhitelistConstraint to the SignatureConstraint only if all signers of the JAR are required to sign in the future. input is WhitelistedByZoneAttachmentConstraint && output is SignatureAttachmentConstraint -> attachment.signerKeys.isNotEmpty() && output.key.keys.containsAll(attachment.signerKeys) else -> false } + MaxLineLength:ConstraintsUtils.kt$when { // These branches should not happen, as this has been already checked. input is AutomaticPlaceholderConstraint || output is AutomaticPlaceholderConstraint -> throw IllegalArgumentException("Illegal constraint: AutomaticPlaceholderConstraint.") input.isAutomaticHashConstraint() || output.isAutomaticHashConstraint() -> throw IllegalArgumentException("Illegal constraint: AutomaticHashConstraint.") // Transition to the same constraint. input == output -> true // You can't transition from the AlwaysAcceptAttachmentConstraint to anything else, as it could hide something illegal. input is AlwaysAcceptAttachmentConstraint && output !is AlwaysAcceptAttachmentConstraint -> false // Nothing can be migrated from the HashConstraint except a HashConstraint with the same Hash. (This check is redundant, but added for clarity) input is HashAttachmentConstraint && output is HashAttachmentConstraint -> input == output // Anything (except the AlwaysAcceptAttachmentConstraint) can be transformed to a HashAttachmentConstraint. input !is HashAttachmentConstraint && output is HashAttachmentConstraint -> true // The SignatureAttachmentConstraint allows migration from a Signature constraint with the same key. // TODO - we don't support currently third party signers. When we do, the output key will have to be stronger then the input key. input is SignatureAttachmentConstraint && output is SignatureAttachmentConstraint -> input.key == output.key // HashAttachmentConstraint can be transformed to a SignatureAttachmentConstraint when hash constraint verification checking disabled. HashAttachmentConstraint.disableHashConstraints && input is HashAttachmentConstraint && output is SignatureAttachmentConstraint -> true // You can transition from the WhitelistConstraint to the SignatureConstraint only if all signers of the JAR are required to sign in the future. input is WhitelistedByZoneAttachmentConstraint && output is SignatureAttachmentConstraint -> attachment.signerKeys.isNotEmpty() && output.key.keys.containsAll(attachment.signerKeys) else -> false } MaxLineLength:ContentSignerBuilder.kt$ContentSignerBuilder$fun build(signatureScheme: SignatureScheme, privateKey: PrivateKey, provider: Provider, random: SecureRandom? = null): ContentSigner MaxLineLength:Context.kt$Context MaxLineLength:ContractAttachment.kt$ContractAttachment : Attachment @@ -5008,10 +5061,10 @@ MaxLineLength:ContractUpgradeServiceImpl.kt$ContractUpgradeServiceImpl$override MaxLineLength:ContractUpgradeServiceImpl.kt$ContractUpgradeServiceImpl.Companion$fun createContractUpgradesMap(cacheFactory: NamedCacheFactory): PersistentMap<String, String, DBContractUpgrade, String> MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeFilteredTransaction : CoreTransaction - MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$( inputs: List<StateAndRef<ContractState>> = this.inputs, notary: Party = this.notary, legacyContractAttachment: Attachment = this.legacyContractAttachment, upgradedContractClassName: ContractClassName = this.upgradedContract::class.java.name, upgradedContractAttachment: Attachment = this.upgradedContractAttachment, id: SecureHash = this.id, privacySalt: PrivacySalt = this.privacySalt, sigs: List<TransactionSignature> = this.sigs, networkParameters: NetworkParameters = this.networkParameters ) MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$( inputs: List<StateAndRef<ContractState>>, notary: Party, legacyContractAttachment: Attachment, upgradedContractClassName: ContractClassName, upgradedContractAttachment: Attachment, id: SecureHash, privacySalt: PrivacySalt, sigs: List<TransactionSignature>, networkParameters: NetworkParameters ) MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$?: MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$@Deprecated("ContractUpgradeLedgerTransaction should not be created directly, use ContractUpgradeWireTransaction.resolve instead.") + MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$ContractUpgradeLedgerTransaction(inputs, notary, legacyContractAttachment, upgradedContractClassName, upgradedContractAttachment, id, privacySalt, sigs, networkParameters) MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$override MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$override fun equals(other: Any?): Boolean MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeLedgerTransaction$return "ContractUpgradeLedgerTransaction(inputs=$inputs, notary=$notary, legacyContractAttachment=$legacyContractAttachment, upgradedContractAttachment=$upgradedContractAttachment, id=$id, privacySalt=$privacySalt, sigs=$sigs, networkParameters=$networkParameters, upgradedContract=$upgradedContract, references=$references, legacyContractClassName='$legacyContractClassName', outputs=$outputs)" @@ -5022,13 +5075,14 @@ MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$ fun buildFilteredTransaction(): ContractUpgradeFilteredTransaction MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$@CordaInternal internal MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$PARAMETERS_HASH.ordinal to FilteredComponent(serializedComponents[PARAMETERS_HASH.ordinal], nonces[PARAMETERS_HASH.ordinal]) - MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$classLoader.loadClass(className).asSubclass(UpgradedContract::class.java).newInstance() as UpgradedContract<ContractState, ContractState> + MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$classLoader.loadClass(className).asSubclass(UpgradedContract::class.java).getDeclaredConstructor().newInstance() as UpgradedContract<ContractState, ContractState> MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$private MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$val binaryInput: SerializedBytes<TransactionState<ContractState>> = resolveStateRefBinaryComponent(inputs[stateRef.index], services)!! MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$val legacyContractAttachmentId: SecureHash by lazy { serializedComponents[LEGACY_ATTACHMENT.ordinal].deserialize<SecureHash>() } MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$val resolvedNetworkParameters = services.networkParametersService.lookup(hashToResolve) ?: throw TransactionResolutionException(id) MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$val upgradedContractAttachmentId: SecureHash by lazy { serializedComponents[UPGRADED_ATTACHMENT.ordinal].deserialize<SecureHash>() } MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction$val upgradedContractClassName: ContractClassName by lazy { serializedComponents[UPGRADED_CONTRACT.ordinal].deserialize<ContractClassName>() } + MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction${ (services as ServiceHubCoreInternal).attachmentTrustCalculator.calculate(it) } MaxLineLength:ContractUpgradeTransactions.kt$ContractUpgradeWireTransaction.Companion$@CordaInternal internal MaxLineLength:ContractsDSL.kt$inline MaxLineLength:ContractsDSL.kt$mapNotNull { if (klass.isInstance(it.value)) uncheckedCast<CommandWithParties<CommandData>, CommandWithParties<C>>(it) else null } @@ -5061,7 +5115,7 @@ MaxLineLength:CordaClassResolverTests.kt$CordaClassResolverTests$private fun importJar(storage: AttachmentStorage, uploader: String = DEPLOYED_CORDAPP_UPLOADER) MaxLineLength:CordaClassResolverTests.kt$CordaClassResolverTests$private val allButBlacklistedContext: CheckpointSerializationContext = CheckpointSerializationContextImpl(this.javaClass.classLoader, AllButBlacklisted, emptyMap(), true, null) MaxLineLength:CordaClassResolverTests.kt$CordaClassResolverTests$private val emptyWhitelistContext: CheckpointSerializationContext = CheckpointSerializationContextImpl(this.javaClass.classLoader, EmptyWhitelist, emptyMap(), true, null) - MaxLineLength:CordaClassResolverTests.kt$CordaClassResolverTests$val classLoader = AttachmentsClassLoader(arrayOf(attachmentHash).map { storage.openAttachment(it)!! }, testNetworkParameters(), SecureHash.zeroHash, { isAttachmentTrusted(it, storage) }) + MaxLineLength:CordaClassResolverTests.kt$CordaClassResolverTests$val classLoader = AttachmentsClassLoader(arrayOf(attachmentHash).map { storage.openAttachment(it)!! }, testNetworkParameters(), SecureHash.zeroHash, { attachmentTrustCalculator.calculate(it) }) MaxLineLength:CordaCliWrapper.kt$CliWrapperBase$// Override this function with the actual method to be run once all the arguments have been parsed. The return number // is the exit code to be returned abstract fun runProgram(): Int MaxLineLength:CordaCliWrapper.kt$CliWrapperBase$// Raw args are provided for use in logging - this is a lateinit var rather than a constructor parameter as the class // needs to be parameterless for autocomplete to work. lateinit var args: Array<String> MaxLineLength:CordaCliWrapper.kt$CliWrapperBase$// This needs to be called before loggers (See: NodeStartup.kt:51 logger called by lazy, initLogging happens before). // Node's logging is more rich. In corda configurations two properties, defaultLoggingLevel and consoleLogLevel, are usually used. open fun initLogging(): Boolean @@ -5104,11 +5158,11 @@ MaxLineLength:CordaPersistence.kt$// Add the subscriber to the wrapping subscriber, which will invoke the original subscribers together inside a database transaction. wrappingSubscriber.delegates.add(toBeWrappedInDbTx) // If we are the first subscriber, return the shared subscriber, otherwise return a subscriber that does nothing. if (wrappingSubscriber.delegates.size == 1) wrappingSubscriber else NoOpSubscriber(toBeWrappedInDbTx) // Clean up the shared list of subscribers when they unsubscribe. MaxLineLength:CordaPersistence.kt$CordaPersistence$ fun <T> transaction(isolationLevel: TransactionIsolationLevel, recoverableFailureTolerance: Int, recoverAnyNestedSQLException: Boolean, statement: DatabaseTransaction.() -> T): T MaxLineLength:CordaPersistence.kt$CordaPersistence$ fun <T> transaction(recoverableFailureTolerance: Int, statement: DatabaseTransaction.() -> T): T + MaxLineLength:CordaPersistence.kt$CordaPersistence$@Suppress("UNCHECKED_CAST") val connectionBag: ConcurrentBag<ConcurrentBag.IConcurrentBagEntry> = connectionBagField.get(pool) as ConcurrentBag<ConcurrentBag.IConcurrentBagEntry> MaxLineLength:CordaPersistence.kt$CordaPersistence$HibernateConfiguration(schemas, databaseConfig, attributeConverters, jdbcUrl, cacheFactory, customClassLoader) MaxLineLength:CordaPersistence.kt$CordaPersistence$error("Was not expecting to find existing database transaction on current strand when setting database: ${Strand.currentStrand()}, $it") MaxLineLength:CordaPersistence.kt$CordaPersistence$is SchemaManagementException -> throw HibernateSchemaChangeException("Incompatible schema change detected. Please run the node with database.initialiseSchema=true. Reason: ${e.message}", e) MaxLineLength:CordaPersistence.kt$CordaPersistence$recoverAnyNestedSQLException: Boolean - MaxLineLength:CordaPersistence.kt$CordaPersistence$val connectionBag: ConcurrentBag<ConcurrentBag.IConcurrentBagEntry> = connectionBagField.get(pool) as ConcurrentBag<ConcurrentBag.IConcurrentBagEntry> MaxLineLength:CordaPersistence.kt$CordaPersistence$val transaction = contextDatabase.currentOrNew(isolationLevel) // XXX: Does this code really support statement changing the contextDatabase? MaxLineLength:CordaPersistence.kt$CordaPersistence${ // DataSource doesn't implement AutoCloseable so we just have to hope that the implementation does so that we can close it (_dataSource as? AutoCloseable)?.close() } MaxLineLength:CordaPersistence.kt$CordaPersistence${ // We need to set the database for the current [Thread] or [Fiber] here as some tests share threads across databases. _contextDatabase.set(this) currentDBSession().flush() return contextTransaction.connection } @@ -5118,24 +5172,24 @@ MaxLineLength:CordaPersistence.kt$return _contextDatabase.get() ?: error("Was expecting to find CordaPersistence set on current thread: ${Strand.currentStrand()}") MaxLineLength:CordaPersistence.kt${ var wrappingSubscriber = DatabaseTransactionWrappingSubscriber<T>(db) // Use lift to add subscribers to a special subscriber that wraps a database transaction around observations. // Each subscriber will be passed to this lambda when they subscribe, at which point we add them to wrapping subscriber. return this.lift { toBeWrappedInDbTx: Subscriber<in T> -> // Add the subscriber to the wrapping subscriber, which will invoke the original subscribers together inside a database transaction. wrappingSubscriber.delegates.add(toBeWrappedInDbTx) // If we are the first subscriber, return the shared subscriber, otherwise return a subscriber that does nothing. if (wrappingSubscriber.delegates.size == 1) wrappingSubscriber else NoOpSubscriber(toBeWrappedInDbTx) // Clean up the shared list of subscribers when they unsubscribe. }.doOnUnsubscribe { wrappingSubscriber.cleanUp() // If cleanup removed the last subscriber reset the system, as future subscribers might need the stream again if (wrappingSubscriber.delegates.isEmpty()) { wrappingSubscriber = DatabaseTransactionWrappingSubscriber(db) } } } MaxLineLength:CordaRPCClient.kt$CordaRPCClient - MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, externalTrace: Trace?, impersonatedActor: Actor?, gracefulReconnect: Boolean = false): CordaRPCConnection - MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, externalTrace: Trace?, impersonatedActor: Actor?, targetLegalIdentity: CordaX500Name?, gracefulReconnect: Boolean = false): CordaRPCConnection - MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, gracefulReconnect: Boolean = false): CordaRPCConnection - MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, targetLegalIdentity: CordaX500Name, gracefulReconnect: Boolean = false): CordaRPCConnection + MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, externalTrace: Trace?, impersonatedActor: Actor?, gracefulReconnect: GracefulReconnect? = null): CordaRPCConnection + MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, externalTrace: Trace?, impersonatedActor: Actor?, targetLegalIdentity: CordaX500Name?, gracefulReconnect: GracefulReconnect? = null): CordaRPCConnection + MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, gracefulReconnect: GracefulReconnect? = null): CordaRPCConnection + MaxLineLength:CordaRPCClient.kt$CordaRPCClient$ @JvmOverloads fun start(username: String, password: String, targetLegalIdentity: CordaX500Name, gracefulReconnect: GracefulReconnect? = null): CordaRPCConnection MaxLineLength:CordaRPCClient.kt$CordaRPCClient$( haAddressPool: List<NetworkHostAndPort>, configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT, sslConfiguration: ClientRpcSslOptions? = null, classLoader: ClassLoader? = null ) MaxLineLength:CordaRPCClient.kt$CordaRPCClient$( hostAndPort: NetworkHostAndPort, configuration: CordaRPCClientConfiguration, sslConfiguration: ClientRpcSslOptions?, classLoader: ClassLoader? = null ) MaxLineLength:CordaRPCClient.kt$CordaRPCClient$( hostAndPort: NetworkHostAndPort, sslConfiguration: ClientRpcSslOptions? = null, classLoader: ClassLoader? = null ) MaxLineLength:CordaRPCClient.kt$CordaRPCClient$@JvmOverloads constructor(hostAndPort: NetworkHostAndPort, configuration: CordaRPCClientConfiguration = CordaRPCClientConfiguration.DEFAULT) : this( hostAndPort = hostAndPort, haAddressPool = emptyList(), configuration = configuration ) MaxLineLength:CordaRPCClient.kt$CordaRPCClient$AMQPClientSerializationScheme.initialiseSerialization(serializationClassLoader, customSerializers, serializationWhitelists, cache) MaxLineLength:CordaRPCClient.kt$CordaRPCClient$CordaRPCConnection(getRpcClient().start(InternalCordaRPCOps::class.java, username, password, externalTrace, impersonatedActor, targetLegalIdentity)) + MaxLineLength:CordaRPCClient.kt$CordaRPCClient$CordaRPCConnection.createWithGracefulReconnection(username, password, addresses, configuration, gracefulReconnect) MaxLineLength:CordaRPCClient.kt$CordaRPCClient$if (classLoader != null) AMQP_RPC_CLIENT_CONTEXT.withClassLoader(classLoader) else AMQP_RPC_CLIENT_CONTEXT MaxLineLength:CordaRPCClient.kt$CordaRPCClient$val cache = Caffeine.newBuilder().maximumSize(128).build<SerializationFactoryCacheKey, SerializerFactory>().asMap() MaxLineLength:CordaRPCClient.kt$CordaRPCClient$val customSerializers = createInstancesOfClassesImplementing(serializationClassLoader, SerializationCustomSerializer::class.java) MaxLineLength:CordaRPCClient.kt$CordaRPCClient$val serializationWhitelists = ServiceLoader.load(SerializationWhitelist::class.java, serializationClassLoader).toSet() MaxLineLength:CordaRPCClient.kt$CordaRPCClient${ val cache = Caffeine.newBuilder().maximumSize(128).build<SerializationFactoryCacheKey, SerializerFactory>().asMap() // If the client has explicitly provided a classloader use this one to scan for custom serializers, otherwise use the current one. val serializationClassLoader = this.classLoader ?: this.javaClass.classLoader val customSerializers = createInstancesOfClassesImplementing(serializationClassLoader, SerializationCustomSerializer::class.java) val serializationWhitelists = ServiceLoader.load(SerializationWhitelist::class.java, serializationClassLoader).toSet() AMQPClientSerializationScheme.initialiseSerialization(serializationClassLoader, customSerializers, serializationWhitelists, cache) } MaxLineLength:CordaRPCClient.kt$CordaRPCClientConfiguration$/** * The interval of unused observable reaping. Leaked Observables (unused ones) are detected using weak references * and are cleaned up in batches in this interval. If set too large it will waste server side resources for this * duration. If set too low it wastes client side cycles. The default is to check once per second. */ open val reapInterval: Duration = 1.seconds - MaxLineLength:CordaRPCClient.kt$CordaRPCConnection.Companion$@CordaInternal internal - MaxLineLength:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$(client.start(rpcUser.username, rpcUser.password, gracefulReconnect = true).proxy as ReconnectingCordaRPCOps) + MaxLineLength:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$(client.start(rpcUser.username, rpcUser.password, gracefulReconnect = gracefulReconnect).proxy as ReconnectingCordaRPCOps) MaxLineLength:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$driver MaxLineLength:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$rpcOps.startTrackedFlow(::CashIssueFlow, 10.DOLLARS, OpaqueBytes.of(0), defaultNotaryIdentity).returnValue.get() MaxLineLength:CordaRPCClientReconnectionTest.kt$CordaRPCClientReconnectionTest$val addresses = listOf(NetworkHostAndPort("localhost", portAllocator.nextPort()), NetworkHostAndPort("localhost", portAllocator.nextPort())) @@ -5257,6 +5311,7 @@ MaxLineLength:CordappResolver.kt$CordappResolver$ @Synchronized @VisibleForTesting fun <T> withCordapp(minimumPlatformVersion: Int = 1, targetPlatformVersion: Int = PLATFORM_VERSION, block: () -> T): T MaxLineLength:CordappResolver.kt$CordappResolver$CordappImpl.TEST_INSTANCE.copy(minimumPlatformVersion = minimumPlatformVersion, targetPlatformVersion = targetPlatformVersion) MaxLineLength:CordappResolver.kt$CordappResolver$Exception().stackTrace .mapNotNull { cordappClasses[it.className] } // in case there are multiple classes matched, we select the first one having a single CorDapp registered against it. .firstOrNull { it.size == 1 } + MaxLineLength:CordappResolver.kt$CordappResolver$logger.error("ATTENTION: More than one CorDapp installed on the node for contract $className. Please remove the previous version when upgrading to a new version.") MaxLineLength:CordappResolverTest.kt$CordappResolverTest$@Test fun `when the same cordapp is registered for the same class multiple times, the resolver deduplicates and returns it as the current one`() MaxLineLength:CordappSmokeTest.kt$CordappSmokeTest$(additionalNodeInfoDir / "nodeInfo-41408E093F95EAD51F6892C34DEB65AE1A3569A4B0E5744769A1B485AF8E04B5").write(signedNodeInfo.serialize().bytes) MaxLineLength:CordappSmokeTest.kt$CordappSmokeTest$private @@ -5392,7 +5447,7 @@ MaxLineLength:CustomVaultQuery.kt$TopupIssuerFlow.TopupIssuanceRequester$return initiateFlow(issuerBankParty).sendAndReceive<List<AbstractCashFlow.Result>>(topupRequest).unwrap { it } MaxLineLength:CustomVaultQuery.kt$TopupIssuerFlow.TopupIssuer$val txn = issueCashTo(amount, topupRequest.issueToParty, topupRequest.issuerPartyRef, topupRequest.notaryParty) MaxLineLength:CustomVaultQuery.kt$TopupIssuerFlow.TopupIssuer${ // invoke Cash subflow to issue Asset progressTracker.currentStep = ISSUING val issueCashFlow = CashIssueFlow(amount, issuerPartyRef, notaryParty) val issueTx = subFlow(issueCashFlow) // NOTE: issueCashFlow performs a Broadcast (which stores a local copy of the txn to the ledger) // short-circuit when issuing to self if (serviceHub.myInfo.isLegalIdentity(issueTo)) return issueTx // now invoke Cash subflow to Move issued assetType to issue requester progressTracker.currentStep = TRANSFERRING val moveCashFlow = CashPaymentFlow(amount, issueTo, anonymous = false) // NOTE: CashFlow PayCash calls FinalityFlow which performs a Broadcast (which stores a local copy of the txn to the ledger) return subFlow(moveCashFlow) } - MaxLineLength:CustomVaultQueryTest.kt$CustomVaultQueryTest$mockNet = MockNetwork(threadPerNode = true, cordappPackages = listOf("net.corda.finance", IOUFlow::class.packageName, javaClass.packageName, "com.template")) + MaxLineLength:CustomVaultQueryTest.kt$CustomVaultQueryTest$mockNet = MockNetwork(threadPerNode = true, cordappPackages = listOf("net.corda.finance", IOUFlow::class.packageName, javaClass.packageName_, "com.template")) MaxLineLength:DBCheckpointStorageTests.kt$DBCheckpointStorageTests$CheckpointVerifier.verifyCheckpointsCompatible(checkpointStorage, emptyList(), 1, mockServices, emptyList()) MaxLineLength:DBCheckpointStorageTests.kt$DBCheckpointStorageTests$val checkpoint = Checkpoint.create(InvocationContext.shell(), FlowStart.Explicit, logic.javaClass, frozenLogic, ALICE, SubFlowVersion.CoreFlow(version), false) .getOrThrow() MaxLineLength:DBNetworkParametersStorage.kt$DBNetworkParametersStorage$log.warn("Tried to download historical network parameters with hash $parametersHash, but network map url isn't configured") @@ -5402,7 +5457,6 @@ MaxLineLength:DBNetworkParametersStorage.kt$DBNetworkParametersStorage.PersistentNetworkParameters$( @Id @Column(name = "hash", length = MAX_HASH_HEX_SIZE, nullable = false) val hash: String = "", @Column(name = "epoch", nullable = false) val epoch: Int = 0, // Stored as serialized bytes because network parameters structure evolves over time. @Lob @Column(name = "parameters_bytes", nullable = false) val networkParametersBytes: ByteArray = ArrayUtils.EMPTY_BYTE_ARRAY, @Lob @Column(name = "signature_bytes", nullable = false) private val signature: ByteArray = ArrayUtils.EMPTY_BYTE_ARRAY, // First certificate in the certificate chain. @Lob @Column(name = "cert", nullable = false) private val certificate: ByteArray = ArrayUtils.EMPTY_BYTE_ARRAY, // Parent certificate path (the first one is stored separately), so node is agnostic to certificate hierarchy. @Lob @Column(name = "parent_cert_path", nullable = false) private val certPath: ByteArray = ArrayUtils.EMPTY_BYTE_ARRAY ) MaxLineLength:DBNetworkParametersStorage.kt$DBNetworkParametersStorage.PersistentNetworkParameters$val signWithCert = DigitalSignatureWithCert(X509CertificateFactory().generateCertificate(certificate.inputStream()), certChain, signature) MaxLineLength:DBNetworkParametersStorageTest.kt$DBNetworkParametersStorageTest$incorrectParams = createDevNetworkMapCa(DEV_INTERMEDIATE_CA).sign(testNetworkParameters(minimumPlatformVersion = 3)) - MaxLineLength:DBNetworkParametersStorageTest.kt$DBNetworkParametersStorageTest$it.contains("Caused by: java.security.cert.CertPathValidatorException: subject/issuer name chaining check failed") MaxLineLength:DBNetworkParametersStorageTest.kt$DBNetworkParametersStorageTest$networkParametersService MaxLineLength:DBRunnerExtension.kt$DBRunnerExtension : ExtensionBeforeAllCallbackAfterAllCallbackBeforeEachCallbackAfterEachCallback MaxLineLength:DBRunnerExtension.kt$DBRunnerExtension$if (annotationClass.isAssignableFrom(annotation::class.java)) sequenceOf(annotationClass.cast(annotation)) else annotation.annotationClass.java.findAnnotations(annotationClass) @@ -5420,6 +5474,7 @@ MaxLineLength:DBTransactionStorage.kt$DBTransactionStorage.Companion$transaction = value.toSignedTx().serialize(context = contextToUse().withEncoding(SNAPPY)).bytes MaxLineLength:DBTransactionStorage.kt$DBTransactionStorage.TransactionStatus$UnexpectedStatusValueException : Exception MaxLineLength:DBTransactionStorageTests.kt$DBTransactionStorageTests$listOf(TransactionSignature(ByteArray(1), ALICE_PUBKEY, SignatureMetadata(1, Crypto.findSignatureScheme(ALICE_PUBKEY).schemeNumberID))) + MaxLineLength:DataSourceFactory.kt$DataSourceFactory$(Class.forName(hikariProperties.getProperty("dataSourceClassName")).getDeclaredConstructor().newInstance() as DataSource) MaxLineLength:DataSourceFactory.kt$DataSourceFactory$fun createDataSource(hikariProperties: Properties, pool: Boolean = true, metricRegistry: MetricRegistry? = null): DataSource MaxLineLength:DatabaseTransaction.kt$get() = contextTransactionOrNull ?: error("Was expecting to find transaction set on current strand: ${Strand.currentStrand()}") MaxLineLength:DatabaseTransaction.kt$get() = if (_prohibitDatabaseAccess.get() == true) throw IllegalAccessException("Database access is disabled in this context.") else _contextTransaction.get() @@ -5443,7 +5498,7 @@ MaxLineLength:DbTransactionsResolver.kt$DbTransactionsResolver.TopologicalSort$// Note that we use a LinkedHashSet here to make the traversal deterministic (as long as the input list is). val deDupeIt = dedupe(it) forwardGraph.computeIfAbsent(deDupeIt) { LinkedHashSet() }.add(txId) MaxLineLength:DeduplicationChecker.kt$DeduplicationChecker MaxLineLength:DeduplicationId.kt$SenderDeduplicationId - MaxLineLength:DefaultKryoCustomizer.kt$DefaultKryoCustomizer$// Store a little schema of field names in the stream the first time a class is used which increases tolerance // for change to a class. setDefaultSerializer(CompatibleFieldSerializer::class.java) // Take the safest route here and allow subclasses to have fields named the same as super classes. fieldSerializerConfig.cachedFieldNameStrategy = FieldSerializer.CachedFieldNameStrategy.EXTENDED instantiatorStrategy = CustomInstantiatorStrategy() // Required for HashCheckingStream (de)serialization. // Note that return type should be specifically set to InputStream, otherwise it may not work, i.e. val aStream : InputStream = HashCheckingStream(...). addDefaultSerializer(InputStream::class.java, InputStreamSerializer) addDefaultSerializer(SerializeAsToken::class.java, SerializeAsTokenSerializer<SerializeAsToken>()) addDefaultSerializer(Logger::class.java, LoggerSerializer) addDefaultSerializer(X509Certificate::class.java, X509CertificateSerializer) // WARNING: reordering the registrations here will cause a change in the serialized form, since classes // with custom serializers get written as registration ids. This will break backwards-compatibility. // Please add any new registrations to the end. // TODO: re-organise registrations into logical groups before v1.0 register(Arrays.asList("").javaClass, ArraysAsListSerializer()) register(LazyMappedList::class.java, LazyMappedListSerializer) register(SignedTransaction::class.java, SignedTransactionSerializer) register(WireTransaction::class.java, WireTransactionSerializer) register(SerializedBytes::class.java, SerializedBytesSerializer) UnmodifiableCollectionsSerializer.registerSerializers(this) ImmutableListSerializer.registerSerializers(this) ImmutableSetSerializer.registerSerializers(this) ImmutableSortedSetSerializer.registerSerializers(this) ImmutableMapSerializer.registerSerializers(this) ImmutableMultimapSerializer.registerSerializers(this) // InputStream subclasses whitelisting, required for attachments. register(BufferedInputStream::class.java, InputStreamSerializer) register(Class.forName("sun.net.www.protocol.jar.JarURLConnection\$JarURLInputStream"), InputStreamSerializer) noReferencesWithin<WireTransaction>() register(ECPublicKeyImpl::class.java, publicKeySerializer) register(EdDSAPublicKey::class.java, publicKeySerializer) register(EdDSAPrivateKey::class.java, PrivateKeySerializer) register(CompositeKey::class.java, publicKeySerializer) // Using a custom serializer for compactness // Exceptions. We don't bother sending the stack traces as the client will fill in its own anyway. register(Array<StackTraceElement>::class, read = { _, _ -> emptyArray() }, write = { _, _, _ -> }) // This ensures a NonEmptySetSerializer is constructed with an initial value. register(NonEmptySet::class.java, NonEmptySetSerializer) register(BitSet::class.java, BitSetSerializer()) register(Class::class.java, ClassSerializer) register(FileInputStream::class.java, InputStreamSerializer) register(CertPath::class.java, CertPathSerializer) register(X509CertPath::class.java, CertPathSerializer) register(BCECPrivateKey::class.java, PrivateKeySerializer) register(BCECPublicKey::class.java, publicKeySerializer) register(BCRSAPrivateCrtKey::class.java, PrivateKeySerializer) register(BCRSAPublicKey::class.java, publicKeySerializer) register(BCSphincs256PrivateKey::class.java, PrivateKeySerializer) register(BCSphincs256PublicKey::class.java, publicKeySerializer) register(NotaryChangeWireTransaction::class.java, NotaryChangeWireTransactionSerializer) register(PartyAndCertificate::class.java, PartyAndCertificateSerializer) // Don't deserialize PrivacySalt via its default constructor. register(PrivacySalt::class.java, PrivacySaltSerializer) // Used by the remote verifier, and will possibly be removed in future. register(ContractAttachment::class.java, ContractAttachmentSerializer) register(java.lang.invoke.SerializedLambda::class.java) register(ClosureSerializer.Closure::class.java, CordaClosureBlacklistSerializer) register(ContractUpgradeWireTransaction::class.java, ContractUpgradeWireTransactionSerializer) register(ContractUpgradeFilteredTransaction::class.java, ContractUpgradeFilteredTransactionSerializer) for (whitelistProvider in serializationWhitelists) { val types = whitelistProvider.whitelist require(types.toSet().size == types.size) { val duplicates = types.toMutableList() types.toSet().forEach { duplicates -= it } "Cannot add duplicate classes to the whitelist ($duplicates)." } for (type in types) { ((kryo.classResolver as? CordaClassResolver)?.whitelist as? MutableClassWhitelist)?.add(type) } } + MaxLineLength:DefaultKryoCustomizer.kt$DefaultKryoCustomizer$// Store a little schema of field names in the stream the first time a class is used which increases tolerance // for change to a class. setDefaultSerializer(CompatibleFieldSerializer::class.java) // Take the safest route here and allow subclasses to have fields named the same as super classes. fieldSerializerConfig.cachedFieldNameStrategy = FieldSerializer.CachedFieldNameStrategy.EXTENDED instantiatorStrategy = CustomInstantiatorStrategy() // Required for HashCheckingStream (de)serialization. // Note that return type should be specifically set to InputStream, otherwise it may not work, i.e. val aStream : InputStream = HashCheckingStream(...). addDefaultSerializer(InputStream::class.java, InputStreamSerializer) addDefaultSerializer(SerializeAsToken::class.java, SerializeAsTokenSerializer<SerializeAsToken>()) addDefaultSerializer(Logger::class.java, LoggerSerializer) addDefaultSerializer(X509Certificate::class.java, X509CertificateSerializer) // WARNING: reordering the registrations here will cause a change in the serialized form, since classes // with custom serializers get written as registration ids. This will break backwards-compatibility. // Please add any new registrations to the end. // TODO: re-organise registrations into logical groups before v1.0 register(Arrays.asList("").javaClass, ArraysAsListSerializer()) register(LazyMappedList::class.java, LazyMappedListSerializer) register(SignedTransaction::class.java, SignedTransactionSerializer) register(WireTransaction::class.java, WireTransactionSerializer) register(SerializedBytes::class.java, SerializedBytesSerializer) UnmodifiableCollectionsSerializer.registerSerializers(this) ImmutableListSerializer.registerSerializers(this) ImmutableSetSerializer.registerSerializers(this) ImmutableSortedSetSerializer.registerSerializers(this) ImmutableMapSerializer.registerSerializers(this) ImmutableMultimapSerializer.registerSerializers(this) // InputStream subclasses whitelisting, required for attachments. register(BufferedInputStream::class.java, InputStreamSerializer) register(Class.forName("sun.net.www.protocol.jar.JarURLConnection\$JarURLInputStream"), InputStreamSerializer) noReferencesWithin<WireTransaction>() register(PublicKey::class.java, publicKeySerializer) register(PrivateKey::class.java, PrivateKeySerializer) register(EdDSAPublicKey::class.java, publicKeySerializer) register(EdDSAPrivateKey::class.java, PrivateKeySerializer) register(CompositeKey::class.java, publicKeySerializer) // Using a custom serializer for compactness // Exceptions. We don't bother sending the stack traces as the client will fill in its own anyway. register(Array<StackTraceElement>::class, read = { _, _ -> emptyArray() }, write = { _, _, _ -> }) // This ensures a NonEmptySetSerializer is constructed with an initial value. register(NonEmptySet::class.java, NonEmptySetSerializer) register(BitSet::class.java, BitSetSerializer()) register(Class::class.java, ClassSerializer) register(FileInputStream::class.java, InputStreamSerializer) register(CertPath::class.java, CertPathSerializer) register(BCECPrivateKey::class.java, PrivateKeySerializer) register(BCECPublicKey::class.java, publicKeySerializer) register(BCRSAPrivateCrtKey::class.java, PrivateKeySerializer) register(BCRSAPublicKey::class.java, publicKeySerializer) register(BCSphincs256PrivateKey::class.java, PrivateKeySerializer) register(BCSphincs256PublicKey::class.java, publicKeySerializer) register(NotaryChangeWireTransaction::class.java, NotaryChangeWireTransactionSerializer) register(PartyAndCertificate::class.java, PartyAndCertificateSerializer) // Don't deserialize PrivacySalt via its default constructor. register(PrivacySalt::class.java, PrivacySaltSerializer) // Used by the remote verifier, and will possibly be removed in future. register(ContractAttachment::class.java, ContractAttachmentSerializer) register(java.lang.invoke.SerializedLambda::class.java) register(ClosureSerializer.Closure::class.java, CordaClosureBlacklistSerializer) register(ContractUpgradeWireTransaction::class.java, ContractUpgradeWireTransactionSerializer) register(ContractUpgradeFilteredTransaction::class.java, ContractUpgradeFilteredTransactionSerializer) for (whitelistProvider in serializationWhitelists) { val types = whitelistProvider.whitelist require(types.toSet().size == types.size) { val duplicates = types.toMutableList() types.toSet().forEach { duplicates -= it } "Cannot add duplicate classes to the whitelist ($duplicates)." } for (type in types) { ((kryo.classResolver as? CordaClassResolver)?.whitelist as? MutableClassWhitelist)?.add(type) } } MaxLineLength:DefaultKryoCustomizer.kt$DefaultKryoCustomizer$register(Class.forName("sun.net.www.protocol.jar.JarURLConnection\$JarURLInputStream"), InputStreamSerializer) MaxLineLength:DefaultKryoCustomizer.kt$DefaultKryoCustomizer.ContractAttachmentSerializer$return ContractAttachment.create(lazyAttachment, contract, additionalContracts, uploader, signers, version) MaxLineLength:DefaultKryoCustomizer.kt$DefaultKryoCustomizer.CustomInstantiatorStrategy$val strat = if (type.name.startsWith("java.") && !isPublic(type.modifiers)) fallbackStrategy else defaultStrategy @@ -5552,6 +5607,7 @@ MaxLineLength:DriverDSLImpl.kt$DriverDSLImpl.LocalNetworkMap$// TODO: this object will copy NodeInfo files from started nodes to other nodes additional-node-infos/ // This uses the FileSystem and adds a delay (~5 seconds) given by the time we wait before polling the file system. // Investigate whether we can avoid that. val nodeInfosCopier = NodeInfoFilesCopier().also { shutdownManager.registerShutdown(it::close) } MaxLineLength:DriverDSLImpl.kt$InternalDriverDSL$ fun <A> pollUntilNonNull(pollName: String, pollInterval: Duration = DEFAULT_POLL_INTERVAL, warnCount: Int = DEFAULT_WARN_COUNT, check: () -> A?): CordaFuture<A> MaxLineLength:DriverDSLImpl.kt$InternalDriverDSL$ fun pollUntilTrue(pollName: String, pollInterval: Duration = DEFAULT_POLL_INTERVAL, warnCount: Int = DEFAULT_WARN_COUNT, check: () -> Boolean): CordaFuture<Unit> + MaxLineLength:DriverDSLImpl.kt$extraCordappPackagesToScan: List<String> = @Suppress("DEPRECATION") DriverParameters().extraCordappPackagesToScan MaxLineLength:DriverDSLImpl.kt$fun DriverDSL.startNode(providedName: CordaX500Name, devMode: Boolean, parameters: NodeParameters = NodeParameters()): CordaFuture<NodeHandle> MaxLineLength:DriverInternal.kt$NodeHandleInternal$override val jmxAddress: NetworkHostAndPort? get() = configuration.jmxMonitoringHttpPort?.let { NetworkHostAndPort("localhost", it) } MaxLineLength:DriverTests.kt$DriverTests$driver @@ -5632,16 +5688,9 @@ MaxLineLength:EvolvabilityTests.kt$EvolvabilityTests${ val resource = "EvolvabilityTests.evolutionWithCarpentry" val sf = testDefaultFactory() // Uncomment to recreate // File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(Evolved("dronf", NewEnum.BUCKLE_MY_SHOE)).bytes) val url = EvolvabilityTests::class.java.getResource(resource) val sc2 = url.readBytes() val deserialized = DeserializationInput(sf).deserialize(SerializedBytes<Evolved>(sc2)) assertEquals("dronf", deserialized.fnord) } MaxLineLength:EvolvabilityTests.kt$EvolvabilityTests${ val resource = "EvolvabilityTests.evolutionWithPrimitives" val sf = testDefaultFactory() // Uncomment to recreate // File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(ParameterizedContainer(Parameterized(10, setOf(20)))).bytes) val url = EvolvabilityTests::class.java.getResource(resource) val sc2 = url.readBytes() val deserialized = DeserializationInput(sf).deserialize(SerializedBytes<ParameterizedContainer>(sc2)) assertEquals(10, deserialized.parameterized?.a) } MaxLineLength:EvolvabilityTests.kt$EvolvabilityTests${ val sf = testDefaultFactory() val resource = "EvolvabilityTests.removeParameterWithCalculatedParameter" // Original version of the class as it was serialised // data class CC(val a: Int, val b: String, val c: String, val d: Int) { // @get:SerializableCalculatedProperty // val e: String get() = "$b $c" // } // File(URI("$localPath/$resource")).writeBytes(SerializationOutput(sf).serialize(CC(1, "hello", "world", 2)).bytes) data class CC(val b: String, val d: Int) { @get:SerializableCalculatedProperty val e: String get() = "$b sailor" } val url = EvolvabilityTests::class.java.getResource(resource) val sc2 = url.readBytes() val deserializedCC = DeserializationInput(sf).deserialize(SerializedBytes<CC>(sc2)) assertEquals("hello", deserializedCC.b) assertEquals(2, deserializedCC.d) assertEquals("hello sailor", deserializedCC.e) } + MaxLineLength:EvolvabilityTests.kt$EvolvabilityTests.Companion$private val DUMMY_NOTARY_PARTY = Party(DUMMY_NOTARY_NAME, Crypto.deriveKeyPairFromEntropy(Crypto.DEFAULT_SIGNATURE_SCHEME, BigInteger.valueOf(20)).public) MaxLineLength:ExampleConfigTest.kt$ExampleConfigTest$assertThat(ConfigHelper.loadConfig(baseDirectory = baseDirectory, configFile = it).parseAsNodeConfiguration().isValid).isTrue() MaxLineLength:Examples.kt$Examples$// maybe in the presence of negative interest rates you would want other side of contract to be able to take initiative as well val zero_coupon_bond_2 = arrange { actions { (acmeCorp or highStreetBank) may { "execute".givenThat(after("2017-09-01")) { highStreetBank.owes(acmeCorp, 1.M, USD) } } } } - MaxLineLength:ExceptionMaskingRpcOpsProxy.kt$ExceptionMaskingRpcOpsProxy$internal - MaxLineLength:ExceptionMaskingRpcOpsProxy.kt$ExceptionMaskingRpcOpsProxy.Companion$return newProxyInstance(delegate::class.java.classLoader, arrayOf(InternalCordaRPCOps::class.java), handler) as InternalCordaRPCOps - MaxLineLength:ExceptionMaskingRpcOpsProxy.kt$ExceptionMaskingRpcOpsProxy.ErrorObfuscatingInvocationHandler$private - MaxLineLength:ExceptionMaskingRpcOpsProxy.kt$ExceptionMaskingRpcOpsProxy.ErrorObfuscatingInvocationHandler$val exposed = if (error.isWhitelisted()) error else InternalNodeException((error as? IdentifiableException)?.errorId) - MaxLineLength:ExceptionSerialisingRpcOpsProxy.kt$ExceptionSerialisingRpcOpsProxy$internal - MaxLineLength:ExceptionSerialisingRpcOpsProxy.kt$ExceptionSerialisingRpcOpsProxy.Companion$return newProxyInstance(delegate::class.java.classLoader, arrayOf(InternalCordaRPCOps::class.java), handler) as InternalCordaRPCOps - MaxLineLength:ExceptionSerialisingRpcOpsProxy.kt$ExceptionSerialisingRpcOpsProxy.ErrorSerialisingInvocationHandler$private - MaxLineLength:ExceptionSerialisingRpcOpsProxy.kt$ExceptionSerialisingRpcOpsProxy.ErrorSerialisingInvocationHandler$val serialisable = (superclasses(error::class.java) + error::class.java).any { it.isAnnotationPresent(CordaSerializable::class.java) || it.interfaces.any { it.isAnnotationPresent(CordaSerializable::class.java) } } MaxLineLength:ExceptionsErrorCodeFunctions.kt$CompositeMessage$private MaxLineLength:ExceptionsErrorCodeFunctions.kt$cause != null && !visited.contains(cause) -> Objects.hash(*fields, cause.staticLocationBasedHash(hashedFields, visited + cause)) MaxLineLength:ExceptionsErrorCodeFunctions.kt$error != null && level.isInRange(Level.FATAL, Level.WARN) -> CompositeMessage("$formattedMessage [errorCode=${error.errorCode()}, moreInformationAt=${error.errorCodeLocationUrl()}]", format, parameters, throwable) @@ -5658,7 +5707,12 @@ MaxLineLength:Explorer.kt$Explorer${ // Make sure that the explorer has cordapps on its class path. This is only necessary because currently apps // require the original class files to deserialise states: Kryo serialisation doesn't let us write generic // tools that work with serialised data structures. But the AMQP serialisation revamp will fix this by // integrating the class carpenter, so, we can eventually get rid of this function. // // Note: does not copy dependencies because we should soon be making all apps fat jars and dependencies implicit. // // TODO: Remove this code when serialisation has been upgraded. val cordappsDir = config.explorerDir / NodeConfig.CORDAPP_DIR_NAME cordappsDir.createDirectories() config.cordappsDir.list { it.forEachOrdered { path -> val destPath = cordappsDir / path.fileName.toString() try { // Try making a symlink to make things faster and use less disk space. Files.createSymbolicLink(destPath, path) } catch (e: UnsupportedOperationException) { // OS doesn't support symbolic links? path.copyTo(destPath, REPLACE_EXISTING) } catch (e: java.nio.file.FileAlreadyExistsException) { // OK, don't care ... } catch (e: IOException) { // Windows 10 might not allow this user to create a symlink log.warn("Failed to create symlink '{}' for '{}': {}", destPath, path, e.message) path.copyTo(destPath, REPLACE_EXISTING) } } } } MaxLineLength:ExposeJpaToFlowsTests.kt$ExposeJpaToFlowsTests$FooSchemaV1 : MappedSchema MaxLineLength:ExposeJpaToFlowsTests.kt$ExposeJpaToFlowsTests.FooSchemaV1$PersistentFoo : Serializable + MaxLineLength:ExternalIdMappingTest.kt$ExternalIdMappingTest$val A = services.keyManagementService.freshKey(id) // Automatically calls registerKeyToParty and registerKeyToExternalId + MaxLineLength:ExternalIdMappingTest.kt$ExternalIdMappingTest$val B = services.keyManagementService.freshKey(id) // Automatically calls registerKeyToParty and registerKeyToExternalId + MaxLineLength:ExternalIdMappingTest.kt$ExternalIdMappingTest$val C = services.keyManagementService.freshKey(idTwo) // Automatically calls registerKeyToParty and registerKeyToExternalId + MaxLineLength:ExternalIdMappingTest.kt$ExternalIdMappingTest$val D = services.keyManagementService.freshKey() // Automatically calls registerKeyToParty and registerKeyToExternalId MaxLineLength:ExternalIdMappingTest.kt$ExternalIdMappingTest$vaultService.queryBy<DummyState>(QueryCriteria.VaultQueryCriteria(externalIds = listOf(UUID.randomUUID()))).states + MaxLineLength:ExternalIdMappingTest.kt$ExternalIdMappingTest$vaultService.queryBy<DummyState>(QueryCriteria.VaultQueryCriteria(externalIds = listOf(idOne, idTwo))).states MaxLineLength:FastThreadLocalTest.kt$FastThreadLocalTest$private MaxLineLength:FetchDataFlow.kt$FetchAttachmentsFlow$otherSide: FlowSession MaxLineLength:FetchDataFlow.kt$FetchAttachmentsFlow${ // This can happen when another transaction will insert the same attachment during this transaction. // The outcome is the same (the attachment is imported), so we can ignore this exception. logger.debug { "Attachment ${attachment.id} already inserted." } } @@ -5676,7 +5730,9 @@ MaxLineLength:FetchDataFlow.kt$FetchTransactionsFlow : FetchDataFlow MaxLineLength:FiberDeserializationCheckingInterceptor.kt$FiberDeserializationCheckingInterceptor$val (continuation, nextState) = delegate.executeTransition(fiber, previousState, event, transition, actionExecutor) MaxLineLength:FiberUtils.kt$// TODO: This method uses a built-in Quasar function to make a map of all ThreadLocals. This is probably inefficient, but the only API readily available. fun <V, T> Fiber<V>.swappedOutThreadLocalValue(threadLocal: ThreadLocal<T>): T? + MaxLineLength:FiberUtils.kt$private fun <T> ThreadLocal<T>.initialValue(): T? MaxLineLength:FiberUtils.kt$private val fiberThreadLocalsField: Field = Fiber::class.java.getDeclaredField("fiberLocals").apply { this.isAccessible = true } + MaxLineLength:FiberUtils.kt$return (@Suppress("UNCHECKED_CAST") (ThreadAccess.toMap(threadLocals)[threadLocal] as T?)) ?: threadLocal.initialValue() MaxLineLength:FinalityFlow.kt$FinalityFlow : FlowLogic MaxLineLength:FinalityFlow.kt$FinalityFlow$"${session.counterparty} has finished prematurely and we're trying to send them the finalised transaction. " MaxLineLength:FinalityFlow.kt$FinalityFlow$"Do not provide flow sessions for the local node. FinalityFlow will record the notarised transaction locally." @@ -5718,8 +5774,6 @@ MaxLineLength:FixingFlow.kt$FixingFlow.Fixer$val addFixing = object : RatesFixFlow(ptx, handshake.payload.oracle, fixOf, BigDecimal.ZERO, BigDecimal.ONE) { @Suspendable override fun beforeSigning(fix: Fix) { newDeal.generateFix(ptx, StateAndRef(txState, handshake.payload.ref), fix) // We set the transaction's time-window: it may be that none of the contracts need this! // But it can't hurt to have one. ptx.setTimeWindow(serviceHub.clock.instant(), 30.seconds) } @Suspendable override fun filtering(elem: Any): Boolean { return when (elem) { // Only expose Fix commands in which the oracle is on the list of requested signers // to the oracle node, to avoid leaking privacy is Command<*> -> handshake.payload.oracle.owningKey in elem.signers && elem.value is Fix else -> false } } } MaxLineLength:FixingFlow.kt$FixingFlow.FixingRoleDecider$val counterparty = serviceHub.identityService.wellKnownPartyFromAnonymous(parties[1]) ?: throw IllegalStateException("Cannot resolve floater party") MaxLineLength:FixingFlow.kt$FixingFlow.Floater$override val progressTracker: ProgressTracker = TwoPartyDealFlow.Primary.tracker() - MaxLineLength:FlattenedList.kt$FlattenedList${ // TODO this assumes that if wasAdded() == true then we are adding elements to the getFrom() position val removeStart = c.from val removeRange = c.removed.size val removeEnd = c.from + removeRange val iterator = indexMap.iterator() for (entry in iterator) { val (wrapped, pair) = entry val (index, listener) = pair if (index >= removeStart) { if (index < removeEnd) { wrapped.observableValue.removeListener(listener) iterator.remove() } else { // Shift indices entry.setValue(Pair(index - removeRange, listener)) } } } nextRemove(removeStart, removed.map { it.value }) } - MaxLineLength:FlattenedList.kt$FlattenedList<A> : TransformationList MaxLineLength:FlowAsyncOperationTests.kt$FlowAsyncOperationTests.WorkerServiceTask$private MaxLineLength:FlowCheckpointCordapp.kt$SendMessageFlow : FlowLogic MaxLineLength:FlowCheckpointCordapp.kt$SendMessageFlow$val txBuilder = TransactionBuilder(notary).withItems(StateAndContract(messageState, MESSAGE_CONTRACT_PROGRAM_ID), txCommand) @@ -5922,6 +5976,7 @@ MaxLineLength:GenericsTests.kt$GenericsTests$LTransactionState<T1, T2, T3 : BaseState<T1, T2>, out T4: BaseState<T1, T2>> MaxLineLength:GenericsTests.kt$GenericsTests$StateWrapper<T1, T2, T3 : BaseState<T1, T2>, out T4: BaseState<T1, T2>> MaxLineLength:GenericsTests.kt$GenericsTests$val bytes = SerializationOutput(factory).serializeAndReturnSchema(Wrapper(1, G1("hi"), G2("poop"))).apply { printSchema() } + MaxLineLength:GenericsTests.kt$GenericsTests.Companion$private val MINI_CORP_PARTY = Party(MINI_CORP_NAME, Crypto.deriveKeyPairFromEntropy(Crypto.DEFAULT_SIGNATURE_SCHEME, BigInteger.valueOf(20)).public) MaxLineLength:GetBalances.kt$CashSchemaV1.PersistentCashState::pennies MaxLineLength:GetBalances.kt$require(rows.otherResults[1] == currency.currencyCode){"Currency on rows returned by query does not match expected"} MaxLineLength:GetBalances.kt$val sum = builder { CashSchemaV1.PersistentCashState::pennies.sum(groupByColumns = listOf(CashSchemaV1.PersistentCashState::currency)) } @@ -5945,7 +6000,8 @@ MaxLineLength:HashLookupCommandTest.kt$HashLookupCommandTest$testCommand(session, command = "hashLookup ${SecureHash.randomSHA256()}", expected = "No matching transaction found") MaxLineLength:HashLookupCommandTest.kt$HashLookupCommandTest$testCommand(session, command = "hashLookup ${txId.sha256()}", expected = "Found a matching transaction with Id: $txId") MaxLineLength:HibernateColumnConverterTests.kt$HibernateColumnConverterTests$// AbstractPartyToX500NameAsStringConverter could cause circular flush of Hibernate session because it is invoked during flush, and a // cache miss was doing a flush. This also checks that loading during flush does actually work. @Test fun `issue some cash on a notary that exists only in the database to check cache loading works in our identity column converters during flush of vault update`() - MaxLineLength:HibernateColumnConverterTests.kt$HibernateColumnConverterTests${ val expected = 500.DOLLARS val ref = OpaqueBytes.of(0x01) // Create parallel set of key and identity services so that the values are not cached, forcing the node caches to do a lookup. val identityService = PersistentIdentityService(TestingNamedCacheFactory()) val originalIdentityService: PersistentIdentityService = services.identityService as PersistentIdentityService identityService.database = originalIdentityService.database identityService.start(originalIdentityService.trustRoot) val keyService = E2ETestKeyManagementService(identityService) keyService.start(setOf(myself.keyPair)) // New identity for a notary (doesn't matter that it's for Bank Of Corda... since not going to use it as an actual notary etc). val newKeyAndCert = keyService.freshKeyAndCert(services.myInfo.legalIdentitiesAndCerts[0], false) val randomNotary = Party(myself.name, newKeyAndCert.owningKey) val ourIdentity = services.myInfo.legalIdentities.first() val builder = TransactionBuilder(notary.party) val issuer = services.myInfo.legalIdentities.first().ref(ref) val signers = Cash().generateIssue(builder, expected.issuedBy(issuer), ourIdentity, randomNotary) val tx: SignedTransaction = services.signInitialTransaction(builder, signers) services.recordTransactions(tx) val output = tx.tx.outputsOfType<Cash.State>().single() assertEquals(expected.`issued by`(ourIdentity.ref(ref)), output.amount) } + MaxLineLength:HibernateColumnConverterTests.kt$HibernateColumnConverterTests$identityService.start(originalIdentityService.trustRoot, pkToIdCache = PublicKeyToOwningIdentityCacheImpl(database, cacheFactory)) + MaxLineLength:HibernateColumnConverterTests.kt$HibernateColumnConverterTests${ val expected = 500.DOLLARS val ref = OpaqueBytes.of(0x01) // Create parallel set of key and identity services so that the values are not cached, forcing the node caches to do a lookup. val cacheFactory = TestingNamedCacheFactory() val identityService = PersistentIdentityService(cacheFactory) val originalIdentityService: PersistentIdentityService = services.identityService as PersistentIdentityService identityService.database = originalIdentityService.database identityService.start(originalIdentityService.trustRoot, pkToIdCache = PublicKeyToOwningIdentityCacheImpl(database, cacheFactory)) val keyService = E2ETestKeyManagementService(identityService) keyService.start(setOf(myself.keyPair)) // New identity for a notary (doesn't matter that it's for Bank Of Corda... since not going to use it as an actual notary etc). val newKeyAndCert = keyService.freshKeyAndCert(services.myInfo.legalIdentitiesAndCerts[0], false) val randomNotary = Party(myself.name, newKeyAndCert.owningKey) val ourIdentity = services.myInfo.legalIdentities.first() val builder = TransactionBuilder(notary.party) val issuer = services.myInfo.legalIdentities.first().ref(ref) val signers = Cash().generateIssue(builder, expected.issuedBy(issuer), ourIdentity, randomNotary) val tx: SignedTransaction = services.signInitialTransaction(builder, signers) services.recordTransactions(tx) val output = tx.tx.outputsOfType<Cash.State>().single() assertEquals(expected.`issued by`(ourIdentity.ref(ref)), output.amount) } MaxLineLength:HibernateConfiguration.kt$HibernateConfiguration$ fun sessionFactoryForSchemas(key: Set<MappedSchema>): SessionFactory MaxLineLength:HibernateConfiguration.kt$HibernateConfiguration$// TODO: require mechanism to set schemaOptions (databaseSchema, tablePrefix) which are not global to session schema.mappedTypes.forEach { config.addAnnotatedClass(it) } MaxLineLength:HibernateConfiguration.kt$HibernateConfiguration$Configuration(metadataSources).setProperty("hibernate.connection.provider_class", NodeDatabaseConnectionProvider::class.java.name) .setProperty("hibernate.format_sql", "true") .setProperty("hibernate.hbm2ddl.auto", hbm2dll) .setProperty("javax.persistence.validation.mode", "none") .setProperty("hibernate.connection.isolation", databaseConfig.transactionIsolationLevel.jdbcValue.toString()) @@ -6147,18 +6203,11 @@ MaxLineLength:IdenticonRenderer.kt$IdenticonRenderer.Patch$return byteArray.map(Byte::toInt).map { it % PATCH_GRIDS * (patchSize / PATCH_CELLS) - patchSize / 2 }.toDoubleArray() MaxLineLength:IdenticonRenderer.kt$IdenticonRenderer.Patch$return byteArray.map(Byte::toInt).map { it / PATCH_GRIDS * (patchSize / PATCH_CELLS) - patchSize / 2 }.toDoubleArray() MaxLineLength:IdenticonRenderer.kt$IdenticonRenderer.PatchColor$private - MaxLineLength:IdentityService.kt$IdentityService$ @Throws(IllegalArgumentException::class) fun registerKeyToParty(key: PublicKey, party: Party) + MaxLineLength:IdentityService.kt$IdentityService$ @Suspendable fun externalIdForPublicKey(publicKey: PublicKey): UUID? + MaxLineLength:IdentityService.kt$IdentityService$ @Throws(IllegalArgumentException::class) fun registerKey(publicKey: PublicKey, party: Party, externalId: UUID? = null) MaxLineLength:IdentityService.kt$IdentityService$ fun wellKnownPartyFromX500Name(name: CordaX500Name): Party? - MaxLineLength:IdentityService.kt$IdentityService$@Deprecated("This method has been deprecated in favour of using a new way to generate and use confidential identities. See the new " + "confidential identities repository.") MaxLineLength:IdentityService.kt$IdentityService$@Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) MaxLineLength:IdentityService.kt$IdentityService${ // The original version of this would return the party as-is if it was a Party (rather than AnonymousParty), // however that means that we don't verify that we know who owns the key. As such as now enforce turning the key // into a party, and from there figure out the well known party. log.debug("Attempting to find wellKnownParty for: ${party.owningKey.hash}") val candidate = partyFromKey(party.owningKey) // TODO: This should be done via the network map cache, which is the authoritative source of well known identities return if (candidate != null) { require(party.nameOrNull() == null || party.nameOrNull() == candidate.name) { "Candidate party $candidate does not match expected $party" } wellKnownPartyFromX500Name(candidate.name) } else { null } } - MaxLineLength:IdentityServiceInternal.kt$IdentityServiceInternal$ @Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) fun verifyAndRegisterIdentity(identity: PartyAndCertificate, isNewRandomIdentity: Boolean): PartyAndCertificate? - MaxLineLength:IdentityServiceInternal.kt$IdentityServiceInternal$ @Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) fun verifyAndRegisterIdentity(trustAnchor: TrustAnchor, identity: PartyAndCertificate, isNewRandomIdentity: Boolean = false): PartyAndCertificate? - MaxLineLength:IdentityServiceInternal.kt$IdentityServiceInternal$ fun justVerifyAndRegisterIdentity(identity: PartyAndCertificate, isNewRandomIdentity: Boolean = false) - MaxLineLength:IdentityServiceInternal.kt$IdentityServiceInternal$@Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) - MaxLineLength:IdentityServiceInternal.kt$IdentityServiceInternal$log.warn("Certificate validation failed for ${identity.name} against trusted root ${trustAnchor.trustedCert.subjectX500Principal}.") - MaxLineLength:IdentityServiceInternal.kt$IdentityServiceInternal$val components = listOfNotNull(x500name.commonName, x500name.organisationUnit, x500name.organisation, x500name.locality, x500name.state, x500name.country) - MaxLineLength:IdentityServiceInternal.kt$IdentityServiceInternal${ private companion object { val log = contextLogger() } /** This method exists so it can be mocked with doNothing, rather than having to make up a possibly invalid return value. */ fun justVerifyAndRegisterIdentity(identity: PartyAndCertificate, isNewRandomIdentity: Boolean = false) { verifyAndRegisterIdentity(identity, isNewRandomIdentity) } /** * Verify and then store an identity. * * @param identity a party and the certificate path linking them to the network trust root. * @param isNewRandomIdentity true if the identity will not have been registered before (e.g. because it is randomly generated by ourselves). * @return the issuing entity, if known. * @throws IllegalArgumentException if the certificate path is invalid. */ @Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) fun verifyAndRegisterIdentity(identity: PartyAndCertificate, isNewRandomIdentity: Boolean): PartyAndCertificate? // We can imagine this being a query over a lucene index in future. // // Kostas says: When exactMatch = false, we can easily use the Jaro-Winkler distance metric as it is best suited for short // strings such as entity/company names, and to detect small typos. We can also apply it for city // or any keyword related search in lists of records (not raw text - for raw text we need indexing) // and we can return results in hierarchical order (based on normalised String similarity 0.0-1.0). /** Check if [x500name] matches the [query]. */ fun x500Matches(query: String, exactMatch: Boolean, x500name: CordaX500Name): Boolean { val components = listOfNotNull(x500name.commonName, x500name.organisationUnit, x500name.organisation, x500name.locality, x500name.state, x500name.country) return components.any { (exactMatch && it == query) || (!exactMatch && it.contains(query, ignoreCase = true)) } } /** * Verifies that an identity is valid. * * @param trustAnchor The trust anchor that will verify the identity's validity * @param identity The identity to verify * @param isNewRandomIdentity true if the identity will not have been registered before (e.g. because it is randomly generated by ourselves). */ @Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) fun verifyAndRegisterIdentity(trustAnchor: TrustAnchor, identity: PartyAndCertificate, isNewRandomIdentity: Boolean = false): PartyAndCertificate? { // Validate the chain first, before we do anything clever with it val identityCertChain = identity.certPath.x509Certificates try { identity.verify(trustAnchor) } catch (e: CertPathValidatorException) { log.warn("Certificate validation failed for ${identity.name} against trusted root ${trustAnchor.trustedCert.subjectX500Principal}.") log.warn("Certificate path :") identityCertChain.reversed().forEachIndexed { index, certificate -> val space = (0 until index).joinToString("") { " " } log.warn("$space${certificate.subjectX500Principal}") } throw e } // Ensure we record the first identity of the same name, first val wellKnownCert = identityCertChain.single { CertRole.extract(it)?.isWellKnown ?: false } if (wellKnownCert != identity.certificate && !isNewRandomIdentity) { val idx = identityCertChain.lastIndexOf(wellKnownCert) val firstPath = X509Utilities.buildCertPath(identityCertChain.slice(idx until identityCertChain.size)) verifyAndRegisterIdentity(trustAnchor, PartyAndCertificate(firstPath)) } return registerIdentity(identity, isNewRandomIdentity) } fun registerIdentity(identity: PartyAndCertificate, isNewRandomIdentity: Boolean = false): PartyAndCertificate? } MaxLineLength:IdentityServiceToStringShortMigrationTest.kt$IdentityServiceToStringShortMigrationTest$//the only time an identity name does not have a PK_HASH is if there are multiple identities associated with that name Assert.assertThat(groupedByNameIdentities[it]?.size, `is`(greaterThan(1))) MaxLineLength:IdentityServiceToStringShortMigrationTest.kt$IdentityServiceToStringShortMigrationTest$Assert.assertThat(nameToHashResultSet.getString(1), `is`(anyOf(groupedByNameIdentities.getValue(it.name).map<PartyAndCertificate, Matcher<String>?> { identity -> CoreMatchers.equalTo(identity.name.toString()) }))) MaxLineLength:IdentityServiceToStringShortMigrationTest.kt$IdentityServiceToStringShortMigrationTest$val hashToIdentityStatement = database.dataSource.connection.prepareStatement("SELECT ${PersistentIdentityService.PK_HASH_COLUMN_NAME} FROM ${PersistentIdentityService.HASH_TO_IDENTITY_TABLE_NAME} WHERE pk_hash=?") @@ -6169,14 +6218,14 @@ MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Receive$// Store the received confidential identities in the identity service so we have a record of which well known identity they map to. serviceHub.identityService.verifyAndRegisterIdentity(identity) MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Receive$val unknownIdentities = allIdentities.filter { serviceHub.identityService.wellKnownPartyFromAnonymous(it) == null } MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Receive${ progressTracker.currentStep = RECEIVING_IDENTITIES val allIdentities = otherSideSession.receive<List<AbstractParty>>().unwrap { it } val unknownIdentities = allIdentities.filter { serviceHub.identityService.wellKnownPartyFromAnonymous(it) == null } progressTracker.currentStep = RECEIVING_CERTIFICATES val missingIdentities = otherSideSession.sendAndReceive<List<PartyAndCertificate>>(unknownIdentities) // Batch verify the identities we've received, so we know they're all correct before we start storing them in // the identity service missingIdentities.unwrap { identities -> identities.forEach { it.verify(serviceHub.identityService.trustAnchor) } identities }.forEach { identity -> // Store the received confidential identities in the identity service so we have a record of which well known identity they map to. serviceHub.identityService.verifyAndRegisterIdentity(identity) } } - MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Send$confidentialIdentities .map { Pair(it, serviceHub.identityService.certificateFromKey(it.owningKey)) } // Filter down to confidential identities of our well known identity // TODO: Consider if this too restrictive - we perhaps should be checking the name on the signing certificate in the certificate path instead .filter { it.second?.name == ourIdentity.name } + MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Send$confidentialIdentities .map { @Suppress("DEPRECATION") Pair(it, serviceHub.identityService.certificateFromKey(it.owningKey)) } // Filter down to confidential identities of our well known identity // TODO: Consider if this too restrictive - we perhaps should be checking the name on the signing certificate in the certificate path instead .filter { it.second?.name == ourIdentity.name } MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Send$require(req.all { it in identityCertificates.keys }) { "${otherSideSession.counterparty} requested a confidential identity not part of transaction: ${tx.id}" } MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Send$throw IllegalStateException("Counterparty requested a confidential identity for which we do not have the certificate path: ${tx.id}") MaxLineLength:IdentitySyncFlow.kt$IdentitySyncFlow.Send$val requestedIdentities: List<AbstractParty> = otherSideSession.sendAndReceive<List<AbstractParty>>(identityCertificates.keys.toList()).unwrap { req -> require(req.all { it in identityCertificates.keys }) { "${otherSideSession.counterparty} requested a confidential identity not part of transaction: ${tx.id}" } req } MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$aliceNode.database.transaction { aliceNode.services.identityService.verifyAndRegisterIdentity(confidentialIdentCert) } MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$assertNotNull(aliceNode.database.transaction { aliceNode.services.identityService.wellKnownPartyFromAnonymous(confidentialIdentity) }) MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$assertNull(bobNode.database.transaction { bobNode.services.identityService.wellKnownPartyFromAnonymous(confidentialIdentity) }) - MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$val confidentialIdentCert = charlieNode.services.identityService.certificateFromKey(confidentialIdentity.owningKey)!! + MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$val confidentialIdentCert = @Suppress("DEPRECATION") charlieNode.services.identityService.certificateFromKey(confidentialIdentity.owningKey)!! MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$val issueFlow = aliceNode.services.startFlow(CashIssueAndPaymentFlow(1000.DOLLARS, ref, alice, anonymous, notary)).resultFuture MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$val issueFlow = charlieNode.services.startFlow(CashIssueAndPaymentFlow(1000.DOLLARS, ref, charlie, anonymous, notary)) MaxLineLength:IdentitySyncFlowTests.kt$IdentitySyncFlowTests$val payTx = charlieNode.services.startFlow(CashPaymentFlow(1000.DOLLARS, alice, anonymous)).resultFuture.getOrThrow().stx @@ -6193,6 +6242,7 @@ MaxLineLength:InMemoryIdentityService.kt$InMemoryIdentityService$log.warn("Certificate validation failed for ${identity.name} against trusted root ${trustAnchor.trustedCert.subjectX500Principal}.") MaxLineLength:InMemoryIdentityService.kt$InMemoryIdentityService$override MaxLineLength:InMemoryIdentityService.kt$InMemoryIdentityService$results += keyToPartyAndCerts[key]?.party ?: throw IllegalArgumentException("Could not find an entry in the database for the public key $key.") + MaxLineLength:InMemoryIdentityService.kt$InMemoryIdentityService$throw NotImplementedError("This method is not implemented in the InMemoryIdentityService at it requires access to CordaPersistence.") MaxLineLength:InMemoryIdentityServiceTests.kt$InMemoryIdentityServiceTests$ @Test fun `assert ownership`() MaxLineLength:InMemoryIdentityServiceTests.kt$InMemoryIdentityServiceTests$ @Test fun `get anonymous identity by key`() MaxLineLength:InMemoryIdentityServiceTests.kt$InMemoryIdentityServiceTests$listOf("Org A", "Org B", "Org C") .map { getTestPartyAndCertificate(CordaX500Name(organisation = it, locality = "London", country = "GB"), generateKeyPair().public) } @@ -6241,24 +6291,25 @@ MaxLineLength:Instances.kt$Instances MaxLineLength:InstantSerializer.kt$InstantSerializer : Proxy MaxLineLength:InstantSerializer.kt$InstantSerializer$override fun fromProxy(proxy: InstantProxy): Instant - MaxLineLength:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: InternalCordaRPCOps, inputObjectMapper: ObjectMapper): Any? + MaxLineLength:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: CordaRPCOps, inputObjectMapper: ObjectMapper): Any? + MaxLineLength:InteractiveShell.kt$InteractiveShell$ExternalResolver.INSTANCE.addCommand("attachments", "Commands to extract information about attachments stored within the node", AttachmentShellCommand::class.java) + MaxLineLength:InteractiveShell.kt$InteractiveShell$ExternalResolver.INSTANCE.addCommand("checkpoints", "Commands to extract information about checkpoints stored within the node", CheckpointShellCommand::class.java) MaxLineLength:InteractiveShell.kt$InteractiveShell$ExternalResolver.INSTANCE.addCommand("flow", "Commands to work with flows. Flows are how you can change the ledger.", FlowShellCommand::class.java) MaxLineLength:InteractiveShell.kt$InteractiveShell$ExternalResolver.INSTANCE.addCommand("hashLookup", "Checks if a transaction with matching Id hash exists.", HashLookupShellCommand::class.java) MaxLineLength:InteractiveShell.kt$InteractiveShell$ExternalResolver.INSTANCE.addCommand("output-format", "Commands to inspect and update the output format.", OutputFormatCommand::class.java) MaxLineLength:InteractiveShell.kt$InteractiveShell$ExternalResolver.INSTANCE.addCommand("run", "Runs a method from the CordaRPCOps interface on the node.", RunShellCommand::class.java) - MaxLineLength:InteractiveShell.kt$InteractiveShell$ReconnectingCordaRPCOps(configuration.hostAndPort, username, password, configuration.ssl, classLoader) + MaxLineLength:InteractiveShell.kt$InteractiveShell$ReconnectingCordaRPCOps(configuration.hostAndPort, username, password, CordaRPCClientConfiguration.DEFAULT, configuration.ssl, classLoader) MaxLineLength:InteractiveShell.kt$InteractiveShell$out.println("Please use the 'flow' command to interact with flows rather than the 'run' command.", Color.yellow) MaxLineLength:InteractiveShell.kt$InteractiveShell$private MaxLineLength:InteractiveShell.kt$InteractiveShell$rpcConn.close() // This will only show up in the standalone Shell, because the embedded one is killed as part of a node's shutdown. display { println("...done, quitting the shell now.") } onExit.invoke() MaxLineLength:InteractiveShell.kt$InteractiveShell$shell = ShellLifecycle(configuration.commandsDirectory).start(config, configuration.user, configuration.password) MaxLineLength:InteractiveShell.kt$InteractiveShell$val mapElement: (Any?) -> String = { element -> outputMapper.writerWithDefaultPrettyPrinter().writeValueAsString(element) } MaxLineLength:InteractiveShell.kt$InteractiveShell$val stateObservable = runFlowFromString({ clazz, args -> rpcOps.startTrackedFlowDynamic(clazz, *args) }, inputData, flowClazz, inputObjectMapper) - MaxLineLength:InteractiveShell.kt$InteractiveShell${ private val log = LoggerFactory.getLogger(javaClass) private lateinit var rpcOps: (username: String, password: String) -> InternalCordaRPCOps private lateinit var ops: InternalCordaRPCOps private lateinit var rpcConn: AutoCloseable private var shell: Shell? = null private var classLoader: ClassLoader? = null private lateinit var shellConfiguration: ShellConfiguration private var onExit: () -> Unit = {} @JvmStatic fun getCordappsClassloader() = classLoader enum class OutputFormat { JSON, YAML } fun startShell(configuration: ShellConfiguration, classLoader: ClassLoader? = null, standalone: Boolean = false) { rpcOps = { username: String, password: String -> if (standalone) { ReconnectingCordaRPCOps(configuration.hostAndPort, username, password, configuration.ssl, classLoader).also { rpcConn = it } } else { val client = CordaRPCClient(hostAndPort = configuration.hostAndPort, configuration = CordaRPCClientConfiguration.DEFAULT.copy( maxReconnectAttempts = 1 ), sslConfiguration = configuration.ssl, classLoader = classLoader) val connection = client.start(username, password) rpcConn = connection connection.proxy as InternalCordaRPCOps } } _startShell(configuration, classLoader) } private fun _startShell(configuration: ShellConfiguration, classLoader: ClassLoader? = null) { shellConfiguration = configuration InteractiveShell.classLoader = classLoader val runSshDaemon = configuration.sshdPort != null val config = Properties() if (runSshDaemon) { // Enable SSH access. Note: these have to be strings, even though raw object assignments also work. config["crash.ssh.port"] = configuration.sshdPort?.toString() config["crash.auth"] = "corda" configuration.sshHostKeyDirectory?.apply { val sshKeysDir = configuration.sshHostKeyDirectory.createDirectories() config["crash.ssh.keypath"] = (sshKeysDir / "hostkey.pem").toString() config["crash.ssh.keygen"] = "true" } } ExternalResolver.INSTANCE.addCommand("output-format", "Commands to inspect and update the output format.", OutputFormatCommand::class.java) ExternalResolver.INSTANCE.addCommand("run", "Runs a method from the CordaRPCOps interface on the node.", RunShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("flow", "Commands to work with flows. Flows are how you can change the ledger.", FlowShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("start", "An alias for 'flow start'", StartShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("hashLookup", "Checks if a transaction with matching Id hash exists.", HashLookupShellCommand::class.java) shell = ShellLifecycle(configuration.commandsDirectory).start(config, configuration.user, configuration.password) } fun runLocalShell(onExit: () -> Unit = {}) { this.onExit = onExit val terminal = TerminalFactory.create() val consoleReader = ConsoleReader("Corda", FileInputStream(FileDescriptor.`in`), System.out, terminal) val jlineProcessor = JLineProcessor(terminal.isAnsiSupported, shell, consoleReader, System.out) InterruptHandler { jlineProcessor.interrupt() }.install() thread(name = "Command line shell processor", isDaemon = true) { Emoji.renderIfSupported { try { jlineProcessor.run() } catch (e: IndexOutOfBoundsException) { log.warn("Cannot parse malformed command.") } } } thread(name = "Command line shell terminator", isDaemon = true) { // Wait for the shell to finish. jlineProcessor.closed() log.info("Command shell has exited") terminal.restore() onExit.invoke() } } class ShellLifecycle(private val shellCommands: Path) : PluginLifeCycle() { fun start(config: Properties, localUserName: String = "", localUserPassword: String = ""): Shell { val classLoader = this.javaClass.classLoader val classpathDriver = ClassPathMountFactory(classLoader) val fileDriver = FileMountFactory(Utils.getCurrentDirectory()) val extraCommandsPath = shellCommands.toAbsolutePath().createDirectories() val commandsFS = FS.Builder() .register("file", fileDriver) .mount("file:$extraCommandsPath") .register("classpath", classpathDriver) .mount("classpath:/net/corda/tools/shell/") .mount("classpath:/crash/commands/") .build() val confFS = FS.Builder() .register("classpath", classpathDriver) .mount("classpath:/crash") .build() val discovery = object : ServiceLoaderDiscovery(classLoader) { override fun getPlugins(): Iterable<CRaSHPlugin<*>> { // Don't use the Java language plugin (we may not have tools.jar available at runtime), this // will cause any commands using JIT Java compilation to be suppressed. In CRaSH upstream that // is only the 'jmx' command. return super.getPlugins().filterNot { it is JavaLanguage } + CordaAuthenticationPlugin(rpcOps) } } val attributes = emptyMap<String, Any>() val context = PluginContext(discovery, attributes, commandsFS, confFS, classLoader) context.refresh() this.config = config start(context) ops = makeRPCOps(rpcOps, localUserName, localUserPassword) return context.getPlugin(ShellFactory::class.java).create(null, CordaSSHAuthInfo(false, ops, StdoutANSIProgressRenderer)) } } fun nodeInfo() = try { ops.nodeInfo() } catch (e: UndeclaredThrowableException) { throw e.cause ?: e } @JvmStatic fun setOutputFormat(outputFormat: OutputFormat) { this.outputFormat = outputFormat } @JvmStatic fun getOutputFormat(): OutputFormat { return outputFormat } fun createYamlInputMapper(rpcOps: CordaRPCOps): ObjectMapper { // Return a standard Corda Jackson object mapper, configured to use YAML by default and with extra // serializers. return JacksonSupport.createDefaultMapper(rpcOps, YAMLFactory(), true).apply { val rpcModule = SimpleModule().apply { addDeserializer(InputStream::class.java, InputStreamDeserializer) addDeserializer(UniqueIdentifier::class.java, UniqueIdentifierDeserializer) } registerModule(rpcModule) } } private fun createOutputMapper(outputFormat: OutputFormat): ObjectMapper { val factory = when(outputFormat) { OutputFormat.JSON -> JsonFactory() OutputFormat.YAML -> YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER) } return JacksonSupport.createNonRpcMapper(factory).apply { // Register serializers for stateful objects from libraries that are special to the RPC system and don't // make sense to print out to the screen. For classes we own, annotations can be used instead. val rpcModule = SimpleModule().apply { addSerializer(Observable::class.java, ObservableSerializer) addSerializer(InputStream::class.java, InputStreamSerializer) } registerModule(rpcModule) disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) enable(SerializationFeature.INDENT_OUTPUT) } } // TODO: A default renderer could be used, instead of an object mapper. See: http://www.crashub.org/1.3/reference.html#_renderers private var outputFormat = OutputFormat.YAML @VisibleForTesting lateinit var latch: CountDownLatch private set /** * Called from the 'flow' shell command. Takes a name fragment and finds a matching flow, or prints out * the list of options if the request is ambiguous. Then parses [inputData] as constructor arguments using * the [runFlowFromString] method and starts the requested flow. Ctrl-C can be used to cancel. */ @JvmStatic fun runFlowByNameFragment(nameFragment: String, inputData: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, ansiProgressRenderer: ANSIProgressRenderer, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) { val matches = try { rpcOps.registeredFlows().filter { nameFragment in it } } catch (e: PermissionException) { output.println(e.message ?: "Access denied", Color.red) return } if (matches.isEmpty()) { output.println("No matching flow found, run 'flow list' to see your options.", Color.red) return } else if (matches.size > 1 && matches.find { it.endsWith(nameFragment)} == null) { output.println("Ambiguous name provided, please be more specific. Your options are:") matches.forEachIndexed { i, s -> output.println("${i + 1}. $s", Color.yellow) } return } val flowName = matches.find { it.endsWith(nameFragment)} ?: matches.single() val flowClazz: Class<FlowLogic<*>> = if (classLoader != null) { uncheckedCast(Class.forName(flowName, true, classLoader)) } else { uncheckedCast(Class.forName(flowName)) } try { // Show the progress tracker on the console until the flow completes or is interrupted with a // Ctrl-C keypress. val stateObservable = runFlowFromString({ clazz, args -> rpcOps.startTrackedFlowDynamic(clazz, *args) }, inputData, flowClazz, inputObjectMapper) latch = CountDownLatch(1) ansiProgressRenderer.render(stateObservable, latch::countDown) // Wait for the flow to end and the progress tracker to notice. By the time the latch is released // the tracker is done with the screen. while (!Thread.currentThread().isInterrupted) { try { latch.await() break } catch (e: InterruptedException) { try { rpcOps.killFlow(stateObservable.id) } finally { Thread.currentThread().interrupt() break } } } output.println("Flow completed with result: ${stateObservable.returnValue.get()}") } catch (e: NoApplicableConstructor) { output.println("No matching constructor found:", Color.red) e.errors.forEach { output.println("- $it", Color.red) } } catch (e: PermissionException) { output.println(e.message ?: "Access denied", Color.red) } catch (e: ExecutionException) { // ignoring it as already logged by the progress handler subscriber } finally { InputStreamDeserializer.closeAll() } } class NoApplicableConstructor(val errors: List<String>) : CordaException(this.toString()) { override fun toString() = (listOf("No applicable constructor for flow. Problems were:") + errors).joinToString(System.lineSeparator()) } /** * Tidies up a possibly generic type name by chopping off the package names of classes in a hard-coded set of * hierarchies that are known to be widely used and recognised, and also not have (m)any ambiguous names in them. * * This is used for printing error messages when something doesn't match. */ private fun maybeAbbreviateGenericType(type: Type, extraRecognisedPackage: String): String { val packagesToAbbreviate = listOf("java.", "net.corda.core.", "kotlin.", extraRecognisedPackage) fun shouldAbbreviate(typeName: String) = packagesToAbbreviate.any { typeName.startsWith(it) } fun abbreviated(typeName: String) = if (shouldAbbreviate(typeName)) typeName.split('.').last() else typeName fun innerLoop(type: Type): String = when (type) { is ParameterizedType -> { val args: List<String> = type.actualTypeArguments.map(::innerLoop) abbreviated(type.rawType.typeName) + '<' + args.joinToString(", ") + '>' } is GenericArrayType -> { innerLoop(type.genericComponentType) + "[]" } is Class<*> -> { if (type.isArray) abbreviated(type.simpleName) else abbreviated(type.name).replace('$', '.') } else -> type.toString() } return innerLoop(type) } @JvmStatic fun killFlowById(id: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) { try { val runId = try { inputObjectMapper.readValue(id, StateMachineRunId::class.java) } catch (e: JsonMappingException) { output.println("Cannot parse flow ID of '$id' - expecting a UUID.", Color.red) log.error("Failed to parse flow ID", e) return } if (rpcOps.killFlow(runId)) { output.println("Killed flow $runId", Color.yellow) } else { output.println("Failed to kill flow $runId", Color.red) } } finally { output.flush() } } // TODO: This utility is generally useful and might be better moved to the node class, or an RPC, if we can commit to making it stable API. /** * Given a [FlowLogic] class and a string in one-line Yaml form, finds an applicable constructor and starts * the flow, returning the created flow logic. Useful for lightweight invocation where text is preferable * to statically typed, compiled code. * * See the [StringToMethodCallParser] class to learn more about limitations and acceptable syntax. * * @throws NoApplicableConstructor if no constructor could be found for the given set of types. */ @Throws(NoApplicableConstructor::class) fun <T> runFlowFromString(invoke: (Class<out FlowLogic<T>>, Array<out Any?>) -> FlowProgressHandle<T>, inputData: String, clazz: Class<out FlowLogic<T>>, om: ObjectMapper): FlowProgressHandle<T> { val errors = ArrayList<String>() val parser = StringToMethodCallParser(clazz, om) val nameTypeList = getMatchingConstructorParamsAndTypes(parser, inputData, clazz) try { val args = parser.parseArguments(clazz.name, nameTypeList, inputData) return invoke(clazz, args) } catch (e: StringToMethodCallParser.UnparseableCallException.ReflectionDataMissing) { val argTypes = nameTypeList.map { (_, type) -> type } errors.add("$argTypes: <constructor missing parameter reflection data>") } catch (e: StringToMethodCallParser.UnparseableCallException) { val argTypes = nameTypeList.map { (_, type) -> type } errors.add("$argTypes: ${e.message}") } throw NoApplicableConstructor(errors) } private fun <T> getMatchingConstructorParamsAndTypes(parser: StringToMethodCallParser<FlowLogic<T>>, inputData: String, clazz: Class<out FlowLogic<T>>) : List<Pair<String, Type>> { val errors = ArrayList<String>() val classPackage = clazz.packageName lateinit var paramNamesFromConstructor: List<String> for (ctor in clazz.constructors) { // Attempt construction with the given arguments. fun getPrototype(): List<String> { val argTypes = ctor.genericParameterTypes.map { // If the type name is in the net.corda.core or java namespaces, chop off the package name // because these hierarchies don't have (m)any ambiguous names and the extra detail is just noise. maybeAbbreviateGenericType(it, classPackage) } return paramNamesFromConstructor.zip(argTypes).map { (name, type) -> "$name: $type" } } try { paramNamesFromConstructor = parser.paramNamesFromConstructor(ctor) val nameTypeList = paramNamesFromConstructor.zip(ctor.genericParameterTypes) parser.validateIsMatchingCtor(clazz.name, nameTypeList, inputData) return nameTypeList } catch (e: StringToMethodCallParser.UnparseableCallException.MissingParameter) { errors.add("${getPrototype()}: missing parameter ${e.paramName}") } catch (e: StringToMethodCallParser.UnparseableCallException.TooManyParameters) { errors.add("${getPrototype()}: too many parameters") } catch (e: StringToMethodCallParser.UnparseableCallException.ReflectionDataMissing) { val argTypes = ctor.genericParameterTypes.map { it.typeName } errors.add("$argTypes: <constructor missing parameter reflection data>") } catch (e: StringToMethodCallParser.UnparseableCallException) { val argTypes = ctor.genericParameterTypes.map { it.typeName } errors.add("$argTypes: ${e.message}") } } throw NoApplicableConstructor(errors) } // TODO Filtering on error/success when we will have some sort of flow auditing, for now it doesn't make much sense. @JvmStatic fun runStateMachinesView(out: RenderPrintWriter, rpcOps: CordaRPCOps): Any? { val proxy = rpcOps val (stateMachines, stateMachineUpdates) = proxy.stateMachinesFeed() val currentStateMachines = stateMachines.map { StateMachineUpdate.Added(it) } val subscriber = FlowWatchPrintingSubscriber(out) stateMachineUpdates.startWith(currentStateMachines).subscribe(subscriber) var result: Any? = subscriber.future if (result is Future<*>) { if (!result.isDone) { out.cls() out.println("Waiting for completion or Ctrl-C ... ") out.flush() } try { result = result.get() } catch (e: InterruptedException) { Thread.currentThread().interrupt() } catch (e: ExecutionException) { throw e.rootCause } catch (e: InvocationTargetException) { throw e.rootCause } } return result } @JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: InternalCordaRPCOps, inputObjectMapper: ObjectMapper): Any? { val cmd = input.joinToString(" ").trim { it <= ' ' } if (cmd.startsWith("startflow", ignoreCase = true)) { // The flow command provides better support and startFlow requires special handling anyway due to // the generic startFlow RPC interface which offers no type information with which to parse the // string form of the command. out.println("Please use the 'flow' command to interact with flows rather than the 'run' command.", Color.yellow) return null } else if (cmd.substringAfter(" ").trim().equals("gracefulShutdown", ignoreCase = true)) { return InteractiveShell.gracefulShutdown(out, cordaRPCOps) } var result: Any? = null try { InputStreamSerializer.invokeContext = context val parser = StringToMethodCallParser(InternalCordaRPCOps::class.java, inputObjectMapper) val call = parser.parse(cordaRPCOps, cmd) result = call.call() if (result != null && result !== kotlin.Unit && result !is Void) { result = printAndFollowRPCResponse(result, out, outputFormat) } if (result is Future<*>) { if (!result.isDone) { out.println("Waiting for completion or Ctrl-C ... ") out.flush() } try { result = result.get() } catch (e: InterruptedException) { Thread.currentThread().interrupt() } catch (e: ExecutionException) { throw e.rootCause } catch (e: InvocationTargetException) { throw e.rootCause } } } catch (e: StringToMethodCallParser.UnparseableCallException) { out.println(e.message, Color.red) if (e !is StringToMethodCallParser.UnparseableCallException.NoSuchFile) { out.println("Please try 'man run' to learn what syntax is acceptable") } } catch (e: Exception) { out.println("RPC failed: ${e.rootCause}", Color.red) } finally { InputStreamSerializer.invokeContext = null InputStreamDeserializer.closeAll() } return result } @JvmStatic fun gracefulShutdown(userSessionOut: RenderPrintWriter, cordaRPCOps: CordaRPCOps) { fun display(statements: RenderPrintWriter.() -> Unit) { statements.invoke(userSessionOut) userSessionOut.flush() } var isShuttingDown = false try { display { println("Orchestrating a clean shutdown, press CTRL+C to cancel...") } isShuttingDown = true display { println("...enabling draining mode") println("...waiting for in-flight flows to be completed") } cordaRPCOps.terminate(true) val latch = CountDownLatch(1) cordaRPCOps.pendingFlowsCount().updates.doOnError { error -> log.error(error.message) throw error }.doAfterTerminate(latch::countDown).subscribe( // For each update. { (first, second) -> display { println("...remaining: $first / $second") } }, // On error. { error -> if (!isShuttingDown) { display { println("RPC failed: ${error.rootCause}", Color.red) } } }, // When completed. { rpcConn.close() // This will only show up in the standalone Shell, because the embedded one is killed as part of a node's shutdown. display { println("...done, quitting the shell now.") } onExit.invoke() }) while (!Thread.currentThread().isInterrupted) { try { latch.await() break } catch (e: InterruptedException) { try { cordaRPCOps.setFlowsDrainingModeEnabled(false) display { println("...cancelled clean shutdown.") } } finally { Thread.currentThread().interrupt() break } } } } catch (e: StringToMethodCallParser.UnparseableCallException) { display { println(e.message, Color.red) println("Please try 'man run' to learn what syntax is acceptable") } } catch (e: Exception) { if (!isShuttingDown) { display { println("RPC failed: ${e.rootCause}", Color.red) } } } finally { InputStreamSerializer.invokeContext = null InputStreamDeserializer.closeAll() } } private fun printAndFollowRPCResponse(response: Any?, out: PrintWriter, outputFormat: OutputFormat): CordaFuture<Unit> { val outputMapper = createOutputMapper(outputFormat) val mapElement: (Any?) -> String = { element -> outputMapper.writerWithDefaultPrettyPrinter().writeValueAsString(element) } return maybeFollow(response, mapElement, out) } private class PrintingSubscriber(private val printerFun: (Any?) -> String, private val toStream: PrintWriter) : Subscriber<Any>() { private var count = 0 val future = openFuture<Unit>() init { // The future is public and can be completed by something else to indicate we don't wish to follow // anymore (e.g. the user pressing Ctrl-C). future.then { unsubscribe() } } @Synchronized override fun onCompleted() { toStream.println("Observable has completed") future.set(Unit) } @Synchronized override fun onNext(t: Any?) { count++ toStream.println("Observation $count: " + printerFun(t)) toStream.flush() } @Synchronized override fun onError(e: Throwable) { toStream.println("Observable completed with an error") e.printStackTrace(toStream) future.setException(e) } } private fun maybeFollow(response: Any?, printerFun: (Any?) -> String, out: PrintWriter): CordaFuture<Unit> { // Match on a couple of common patterns for "important" observables. It's tough to do this in a generic // way because observables can be embedded anywhere in the object graph, and can emit other arbitrary // object graphs that contain yet more observables. So we just look for top level responses that follow // the standard "track" pattern, and print them until the user presses Ctrl-C if (response == null) return doneFuture(Unit) if (response is DataFeed<*, *>) { out.println("Snapshot:") out.println(printerFun(response.snapshot)) out.flush() out.println("Updates:") return printNextElements(response.updates, printerFun, out) } if (response is Observable<*>) { return printNextElements(response, printerFun, out) } out.println(printerFun(response)) return doneFuture(Unit) } private fun printNextElements(elements: Observable<*>, printerFun: (Any?) -> String, out: PrintWriter): CordaFuture<Unit> { val subscriber = PrintingSubscriber(printerFun, out) uncheckedCast(elements).subscribe(subscriber) return subscriber.future } } + MaxLineLength:InteractiveShell.kt$InteractiveShell${ private val log = LoggerFactory.getLogger(javaClass) private lateinit var rpcOps: (username: String, password: String) -> InternalCordaRPCOps private lateinit var ops: InternalCordaRPCOps private lateinit var rpcConn: AutoCloseable private var shell: Shell? = null private var classLoader: ClassLoader? = null private lateinit var shellConfiguration: ShellConfiguration private var onExit: () -> Unit = {} @JvmStatic fun getCordappsClassloader() = classLoader enum class OutputFormat { JSON, YAML } fun startShell(configuration: ShellConfiguration, classLoader: ClassLoader? = null, standalone: Boolean = false) { rpcOps = { username: String, password: String -> if (standalone) { ReconnectingCordaRPCOps(configuration.hostAndPort, username, password, CordaRPCClientConfiguration.DEFAULT, configuration.ssl, classLoader).also { rpcConn = it } } else { val client = CordaRPCClient(hostAndPort = configuration.hostAndPort, configuration = CordaRPCClientConfiguration.DEFAULT.copy( maxReconnectAttempts = 1 ), sslConfiguration = configuration.ssl, classLoader = classLoader) val connection = client.start(username, password) rpcConn = connection connection.proxy as InternalCordaRPCOps } } _startShell(configuration, classLoader) } private fun _startShell(configuration: ShellConfiguration, classLoader: ClassLoader? = null) { shellConfiguration = configuration InteractiveShell.classLoader = classLoader val runSshDaemon = configuration.sshdPort != null val config = Properties() if (runSshDaemon) { // Enable SSH access. Note: these have to be strings, even though raw object assignments also work. config["crash.ssh.port"] = configuration.sshdPort?.toString() config["crash.auth"] = "corda" configuration.sshHostKeyDirectory?.apply { val sshKeysDir = configuration.sshHostKeyDirectory.createDirectories() config["crash.ssh.keypath"] = (sshKeysDir / "hostkey.pem").toString() config["crash.ssh.keygen"] = "true" } } ExternalResolver.INSTANCE.addCommand("output-format", "Commands to inspect and update the output format.", OutputFormatCommand::class.java) ExternalResolver.INSTANCE.addCommand("run", "Runs a method from the CordaRPCOps interface on the node.", RunShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("flow", "Commands to work with flows. Flows are how you can change the ledger.", FlowShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("start", "An alias for 'flow start'", StartShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("hashLookup", "Checks if a transaction with matching Id hash exists.", HashLookupShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("attachments", "Commands to extract information about attachments stored within the node", AttachmentShellCommand::class.java) ExternalResolver.INSTANCE.addCommand("checkpoints", "Commands to extract information about checkpoints stored within the node", CheckpointShellCommand::class.java) shell = ShellLifecycle(configuration.commandsDirectory).start(config, configuration.user, configuration.password) } fun runLocalShell(onExit: () -> Unit = {}) { this.onExit = onExit val terminal = TerminalFactory.create() val consoleReader = ConsoleReader("Corda", FileInputStream(FileDescriptor.`in`), System.out, terminal) val jlineProcessor = JLineProcessor(terminal.isAnsiSupported, shell, consoleReader, System.out) InterruptHandler { jlineProcessor.interrupt() }.install() thread(name = "Command line shell processor", isDaemon = true) { Emoji.renderIfSupported { try { jlineProcessor.run() } catch (e: IndexOutOfBoundsException) { log.warn("Cannot parse malformed command.") } } } thread(name = "Command line shell terminator", isDaemon = true) { // Wait for the shell to finish. jlineProcessor.closed() log.info("Command shell has exited") terminal.restore() onExit.invoke() } } class ShellLifecycle(private val shellCommands: Path) : PluginLifeCycle() { fun start(config: Properties, localUserName: String = "", localUserPassword: String = ""): Shell { val classLoader = this.javaClass.classLoader val classpathDriver = ClassPathMountFactory(classLoader) val fileDriver = FileMountFactory(Utils.getCurrentDirectory()) val extraCommandsPath = shellCommands.toAbsolutePath().createDirectories() val commandsFS = FS.Builder() .register("file", fileDriver) .mount("file:$extraCommandsPath") .register("classpath", classpathDriver) .mount("classpath:/net/corda/tools/shell/") .mount("classpath:/crash/commands/") .build() val confFS = FS.Builder() .register("classpath", classpathDriver) .mount("classpath:/crash") .build() val discovery = object : ServiceLoaderDiscovery(classLoader) { override fun getPlugins(): Iterable<CRaSHPlugin<*>> { // Don't use the Java language plugin (we may not have tools.jar available at runtime), this // will cause any commands using JIT Java compilation to be suppressed. In CRaSH upstream that // is only the 'jmx' command. return super.getPlugins().filterNot { it is JavaLanguage } + CordaAuthenticationPlugin(rpcOps) } } val attributes = emptyMap<String, Any>() val context = PluginContext(discovery, attributes, commandsFS, confFS, classLoader) context.refresh() this.config = config start(context) ops = makeRPCOps(rpcOps, localUserName, localUserPassword) return context.getPlugin(ShellFactory::class.java).create(null, CordaSSHAuthInfo(false, ops, StdoutANSIProgressRenderer)) } } fun nodeInfo() = try { ops.nodeInfo() } catch (e: UndeclaredThrowableException) { throw e.cause ?: e } @JvmStatic fun setOutputFormat(outputFormat: OutputFormat) { this.outputFormat = outputFormat } @JvmStatic fun getOutputFormat(): OutputFormat { return outputFormat } fun createYamlInputMapper(rpcOps: CordaRPCOps): ObjectMapper { // Return a standard Corda Jackson object mapper, configured to use YAML by default and with extra // serializers. return JacksonSupport.createDefaultMapper(rpcOps, YAMLFactory(), true).apply { val rpcModule = SimpleModule().apply { addDeserializer(InputStream::class.java, InputStreamDeserializer) addDeserializer(UniqueIdentifier::class.java, UniqueIdentifierDeserializer) } registerModule(rpcModule) } } private fun createOutputMapper(outputFormat: OutputFormat): ObjectMapper { val factory = when(outputFormat) { OutputFormat.JSON -> JsonFactory() OutputFormat.YAML -> YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER) } return JacksonSupport.createNonRpcMapper(factory).apply { // Register serializers for stateful objects from libraries that are special to the RPC system and don't // make sense to print out to the screen. For classes we own, annotations can be used instead. val rpcModule = SimpleModule().apply { addSerializer(Observable::class.java, ObservableSerializer) addSerializer(InputStream::class.java, InputStreamSerializer) } registerModule(rpcModule) disable(SerializationFeature.FAIL_ON_EMPTY_BEANS) enable(SerializationFeature.INDENT_OUTPUT) } } // TODO: A default renderer could be used, instead of an object mapper. See: http://www.crashub.org/1.3/reference.html#_renderers private var outputFormat = OutputFormat.YAML @VisibleForTesting lateinit var latch: CountDownLatch private set /** * Called from the 'flow' shell command. Takes a name fragment and finds a matching flow, or prints out * the list of options if the request is ambiguous. Then parses [inputData] as constructor arguments using * the [runFlowFromString] method and starts the requested flow. Ctrl-C can be used to cancel. */ @JvmStatic fun runFlowByNameFragment(nameFragment: String, inputData: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, ansiProgressRenderer: ANSIProgressRenderer, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) { val matches = try { rpcOps.registeredFlows().filter { nameFragment in it } } catch (e: PermissionException) { output.println(e.message ?: "Access denied", Color.red) return } if (matches.isEmpty()) { output.println("No matching flow found, run 'flow list' to see your options.", Color.red) return } else if (matches.size > 1 && matches.find { it.endsWith(nameFragment)} == null) { output.println("Ambiguous name provided, please be more specific. Your options are:") matches.forEachIndexed { i, s -> output.println("${i + 1}. $s", Color.yellow) } return } val flowName = matches.find { it.endsWith(nameFragment)} ?: matches.single() val flowClazz: Class<FlowLogic<*>> = if (classLoader != null) { uncheckedCast(Class.forName(flowName, true, classLoader)) } else { uncheckedCast(Class.forName(flowName)) } try { // Show the progress tracker on the console until the flow completes or is interrupted with a // Ctrl-C keypress. val stateObservable = runFlowFromString({ clazz, args -> rpcOps.startTrackedFlowDynamic(clazz, *args) }, inputData, flowClazz, inputObjectMapper) latch = CountDownLatch(1) ansiProgressRenderer.render(stateObservable, latch::countDown) // Wait for the flow to end and the progress tracker to notice. By the time the latch is released // the tracker is done with the screen. while (!Thread.currentThread().isInterrupted) { try { latch.await() break } catch (e: InterruptedException) { try { rpcOps.killFlow(stateObservable.id) } finally { Thread.currentThread().interrupt() break } } } output.println("Flow completed with result: ${stateObservable.returnValue.get()}") } catch (e: NoApplicableConstructor) { output.println("No matching constructor found:", Color.red) e.errors.forEach { output.println("- $it", Color.red) } } catch (e: PermissionException) { output.println(e.message ?: "Access denied", Color.red) } catch (e: ExecutionException) { // ignoring it as already logged by the progress handler subscriber } finally { InputStreamDeserializer.closeAll() } } class NoApplicableConstructor(val errors: List<String>) : CordaException(this.toString()) { override fun toString() = (listOf("No applicable constructor for flow. Problems were:") + errors).joinToString(System.lineSeparator()) } /** * Tidies up a possibly generic type name by chopping off the package names of classes in a hard-coded set of * hierarchies that are known to be widely used and recognised, and also not have (m)any ambiguous names in them. * * This is used for printing error messages when something doesn't match. */ private fun maybeAbbreviateGenericType(type: Type, extraRecognisedPackage: String): String { val packagesToAbbreviate = listOf("java.", "net.corda.core.", "kotlin.", extraRecognisedPackage) fun shouldAbbreviate(typeName: String) = packagesToAbbreviate.any { typeName.startsWith(it) } fun abbreviated(typeName: String) = if (shouldAbbreviate(typeName)) typeName.split('.').last() else typeName fun innerLoop(type: Type): String = when (type) { is ParameterizedType -> { val args: List<String> = type.actualTypeArguments.map(::innerLoop) abbreviated(type.rawType.typeName) + '<' + args.joinToString(", ") + '>' } is GenericArrayType -> { innerLoop(type.genericComponentType) + "[]" } is Class<*> -> { if (type.isArray) abbreviated(type.simpleName) else abbreviated(type.name).replace('$', '.') } else -> type.toString() } return innerLoop(type) } @JvmStatic fun killFlowById(id: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) { try { val runId = try { inputObjectMapper.readValue(id, StateMachineRunId::class.java) } catch (e: JsonMappingException) { output.println("Cannot parse flow ID of '$id' - expecting a UUID.", Color.red) log.error("Failed to parse flow ID", e) return } if (rpcOps.killFlow(runId)) { output.println("Killed flow $runId", Color.yellow) } else { output.println("Failed to kill flow $runId", Color.red) } } finally { output.flush() } } // TODO: This utility is generally useful and might be better moved to the node class, or an RPC, if we can commit to making it stable API. /** * Given a [FlowLogic] class and a string in one-line Yaml form, finds an applicable constructor and starts * the flow, returning the created flow logic. Useful for lightweight invocation where text is preferable * to statically typed, compiled code. * * See the [StringToMethodCallParser] class to learn more about limitations and acceptable syntax. * * @throws NoApplicableConstructor if no constructor could be found for the given set of types. */ @Throws(NoApplicableConstructor::class) fun <T> runFlowFromString(invoke: (Class<out FlowLogic<T>>, Array<out Any?>) -> FlowProgressHandle<T>, inputData: String, clazz: Class<out FlowLogic<T>>, om: ObjectMapper): FlowProgressHandle<T> { val errors = ArrayList<String>() val parser = StringToMethodCallParser(clazz, om) val nameTypeList = getMatchingConstructorParamsAndTypes(parser, inputData, clazz) try { val args = parser.parseArguments(clazz.name, nameTypeList, inputData) return invoke(clazz, args) } catch (e: StringToMethodCallParser.UnparseableCallException.ReflectionDataMissing) { val argTypes = nameTypeList.map { (_, type) -> type } errors.add("$argTypes: <constructor missing parameter reflection data>") } catch (e: StringToMethodCallParser.UnparseableCallException) { val argTypes = nameTypeList.map { (_, type) -> type } errors.add("$argTypes: ${e.message}") } throw NoApplicableConstructor(errors) } private fun <T> getMatchingConstructorParamsAndTypes(parser: StringToMethodCallParser<FlowLogic<T>>, inputData: String, clazz: Class<out FlowLogic<T>>) : List<Pair<String, Type>> { val errors = ArrayList<String>() val classPackage = clazz.packageName_ lateinit var paramNamesFromConstructor: List<String> for (ctor in clazz.constructors) { // Attempt construction with the given arguments. fun getPrototype(): List<String> { val argTypes = ctor.genericParameterTypes.map { // If the type name is in the net.corda.core or java namespaces, chop off the package name // because these hierarchies don't have (m)any ambiguous names and the extra detail is just noise. maybeAbbreviateGenericType(it, classPackage) } return paramNamesFromConstructor.zip(argTypes).map { (name, type) -> "$name: $type" } } try { paramNamesFromConstructor = parser.paramNamesFromConstructor(ctor) val nameTypeList = paramNamesFromConstructor.zip(ctor.genericParameterTypes) parser.validateIsMatchingCtor(clazz.name, nameTypeList, inputData) return nameTypeList } catch (e: StringToMethodCallParser.UnparseableCallException.MissingParameter) { errors.add("${getPrototype()}: missing parameter ${e.paramName}") } catch (e: StringToMethodCallParser.UnparseableCallException.TooManyParameters) { errors.add("${getPrototype()}: too many parameters") } catch (e: StringToMethodCallParser.UnparseableCallException.ReflectionDataMissing) { val argTypes = ctor.genericParameterTypes.map { it.typeName } errors.add("$argTypes: <constructor missing parameter reflection data>") } catch (e: StringToMethodCallParser.UnparseableCallException) { val argTypes = ctor.genericParameterTypes.map { it.typeName } errors.add("$argTypes: ${e.message}") } } throw NoApplicableConstructor(errors) } // TODO Filtering on error/success when we will have some sort of flow auditing, for now it doesn't make much sense. @JvmStatic fun runStateMachinesView(out: RenderPrintWriter, rpcOps: CordaRPCOps): Any? { val proxy = rpcOps val (stateMachines, stateMachineUpdates) = proxy.stateMachinesFeed() val currentStateMachines = stateMachines.map { StateMachineUpdate.Added(it) } val subscriber = FlowWatchPrintingSubscriber(out) stateMachineUpdates.startWith(currentStateMachines).subscribe(subscriber) var result: Any? = subscriber.future if (result is Future<*>) { if (!result.isDone) { out.cls() out.println("Waiting for completion or Ctrl-C ... ") out.flush() } try { result = result.get() } catch (e: InterruptedException) { subscriber.unsubscribe() Thread.currentThread().interrupt() } catch (e: ExecutionException) { throw e.rootCause } catch (e: InvocationTargetException) { throw e.rootCause } } return result } @JvmStatic fun runAttachmentTrustInfoView( out: RenderPrintWriter, rpcOps: InternalCordaRPCOps ): Any { return AttachmentTrustTable(out, rpcOps.attachmentTrustInfos) } @JvmStatic fun runDumpCheckpoints(rpcOps: InternalCordaRPCOps) { rpcOps.dumpCheckpoints() } @JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: CordaRPCOps, inputObjectMapper: ObjectMapper): Any? { val cmd = input.joinToString(" ").trim { it <= ' ' } if (cmd.startsWith("startflow", ignoreCase = true)) { // The flow command provides better support and startFlow requires special handling anyway due to // the generic startFlow RPC interface which offers no type information with which to parse the // string form of the command. out.println("Please use the 'flow' command to interact with flows rather than the 'run' command.", Color.yellow) return null } else if (cmd.substringAfter(" ").trim().equals("gracefulShutdown", ignoreCase = true)) { return InteractiveShell.gracefulShutdown(out, cordaRPCOps) } var result: Any? = null try { InputStreamSerializer.invokeContext = context val parser = StringToMethodCallParser(CordaRPCOps::class.java, inputObjectMapper) val call = parser.parse(cordaRPCOps, cmd) result = call.call() if (result != null && result !== kotlin.Unit && result !is Void) { result = printAndFollowRPCResponse(result, out, outputFormat) } if (result is Future<*>) { if (!result.isDone) { out.println("Waiting for completion or Ctrl-C ... ") out.flush() } try { result = result.get() } catch (e: InterruptedException) { Thread.currentThread().interrupt() } catch (e: ExecutionException) { throw e.rootCause } catch (e: InvocationTargetException) { throw e.rootCause } } } catch (e: StringToMethodCallParser.UnparseableCallException) { out.println(e.message, Color.red) if (e !is StringToMethodCallParser.UnparseableCallException.NoSuchFile) { out.println("Please try 'man run' to learn what syntax is acceptable") } } catch (e: Exception) { out.println("RPC failed: ${e.rootCause}", Color.red) } finally { InputStreamSerializer.invokeContext = null InputStreamDeserializer.closeAll() } return result } @JvmStatic fun gracefulShutdown(userSessionOut: RenderPrintWriter, cordaRPCOps: CordaRPCOps) { fun display(statements: RenderPrintWriter.() -> Unit) { statements.invoke(userSessionOut) userSessionOut.flush() } var isShuttingDown = false try { display { println("Orchestrating a clean shutdown, press CTRL+C to cancel...") } isShuttingDown = true display { println("...enabling draining mode") println("...waiting for in-flight flows to be completed") } cordaRPCOps.terminate(true) val latch = CountDownLatch(1) @Suppress("DEPRECATION") cordaRPCOps.pendingFlowsCount().updates.doOnError { error -> log.error(error.message) throw error }.doAfterTerminate(latch::countDown).subscribe( // For each update. { (first, second) -> display { println("...remaining: $first / $second") } }, // On error. { error -> if (!isShuttingDown) { display { println("RPC failed: ${error.rootCause}", Color.red) } } }, // When completed. { rpcConn.close() // This will only show up in the standalone Shell, because the embedded one is killed as part of a node's shutdown. display { println("...done, quitting the shell now.") } onExit.invoke() }) while (!Thread.currentThread().isInterrupted) { try { latch.await() break } catch (e: InterruptedException) { try { cordaRPCOps.setFlowsDrainingModeEnabled(false) display { println("...cancelled clean shutdown.") } } finally { Thread.currentThread().interrupt() break } } } } catch (e: StringToMethodCallParser.UnparseableCallException) { display { println(e.message, Color.red) println("Please try 'man run' to learn what syntax is acceptable") } } catch (e: Exception) { if (!isShuttingDown) { display { println("RPC failed: ${e.rootCause}", Color.red) } } } finally { InputStreamSerializer.invokeContext = null InputStreamDeserializer.closeAll() } } private fun printAndFollowRPCResponse(response: Any?, out: PrintWriter, outputFormat: OutputFormat): CordaFuture<Unit> { val outputMapper = createOutputMapper(outputFormat) val mapElement: (Any?) -> String = { element -> outputMapper.writerWithDefaultPrettyPrinter().writeValueAsString(element) } return maybeFollow(response, mapElement, out) } private class PrintingSubscriber(private val printerFun: (Any?) -> String, private val toStream: PrintWriter) : Subscriber<Any>() { private var count = 0 val future = openFuture<Unit>() init { // The future is public and can be completed by something else to indicate we don't wish to follow // anymore (e.g. the user pressing Ctrl-C). future.then { unsubscribe() } } @Synchronized override fun onCompleted() { toStream.println("Observable has completed") future.set(Unit) } @Synchronized override fun onNext(t: Any?) { count++ toStream.println("Observation $count: " + printerFun(t)) toStream.flush() } @Synchronized override fun onError(e: Throwable) { toStream.println("Observable completed with an error") e.printStackTrace(toStream) future.setException(e) } } private fun maybeFollow(response: Any?, printerFun: (Any?) -> String, out: PrintWriter): CordaFuture<Unit> { // Match on a couple of common patterns for "important" observables. It's tough to do this in a generic // way because observables can be embedded anywhere in the object graph, and can emit other arbitrary // object graphs that contain yet more observables. So we just look for top level responses that follow // the standard "track" pattern, and print them until the user presses Ctrl-C if (response == null) return doneFuture(Unit) if (response is DataFeed<*, *>) { out.println("Snapshot:") out.println(printerFun(response.snapshot)) out.flush() out.println("Updates:") return printNextElements(response.updates, printerFun, out) } if (response is Observable<*>) { return printNextElements(response, printerFun, out) } out.println(printerFun(response)) return doneFuture(Unit) } private fun printNextElements(elements: Observable<*>, printerFun: (Any?) -> String, out: PrintWriter): CordaFuture<Unit> { val subscriber = PrintingSubscriber(printerFun, out) uncheckedCast(elements).subscribe(subscriber) return subscriber.future } } MaxLineLength:InteractiveShell.kt$InteractiveShell.NoApplicableConstructor$override fun toString() MaxLineLength:InteractiveShell.kt$InteractiveShell.PrintingSubscriber$private MaxLineLength:InteractiveShell.kt$InteractiveShell.ShellLifecycle$return context.getPlugin(ShellFactory::class.java).create(null, CordaSSHAuthInfo(false, ops, StdoutANSIProgressRenderer)) MaxLineLength:InteractiveShellIntegrationTest.kt$InteractiveShellIntegrationTest$InteractiveShell.runFlowByNameFragment(NoOpFlow::class.java.name, "", output, node.rpc, mockAnsiProgressRenderer()) - MaxLineLength:InteractiveShellIntegrationTest.kt$InteractiveShellIntegrationTest$InteractiveShell.runRPCFromString(listOf("dumpCheckpoints"), output, mock(), aliceNode.rpc as InternalCordaRPCOps, inputObjectMapper) MaxLineLength:InteractiveShellIntegrationTest.kt$InteractiveShellIntegrationTest$private MaxLineLength:InteractiveShellIntegrationTest.kt$InteractiveShellIntegrationTest$startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow() MaxLineLength:InteractiveShellIntegrationTest.kt$InteractiveShellIntegrationTest$val node = startNode(rpcUsers = listOf(user), customOverrides = brokerSslOptions.useSslRpcOverrides()).getOrThrow() @@ -6269,6 +6320,9 @@ MaxLineLength:InteractiveShellTest.kt$InteractiveShellTest$val instance = clazz.getConstructor(*args.map { it!!::class.java }.toTypedArray()).newInstance(*args) as FlowA MaxLineLength:InterestSwapRestAPI.kt$InterestRateSwapAPI MaxLineLength:InterestSwapRestAPI.kt$InterestRateSwapAPI$val states = vault.filterStatesOfType<InterestRateSwap.State>().filter { it.state.data.linearId.externalId == ref } + MaxLineLength:InternalAccessTestHelpers.kt$/** * A set of functions in serialization:test that allows testing of serialization internal classes in the serialization-tests project. */ const val MAX_TYPE_PARAM_DEPTH = AMQPTypeIdentifierParser.MAX_TYPE_PARAM_DEPTH + MaxLineLength:InternalAccessTestHelpers.kt$fun <T> ifThrowsAppend(strToAppendFn: () -> String, block: () -> T): T + MaxLineLength:InternalAccessTestHelpers.kt$fun Class<out Any?>.accessPropertyDescriptors(validateProperties: Boolean = true): Map<String, PropertyDescriptor> MaxLineLength:InternalMockNetwork.kt$InternalMockNetwork$ fun createNode(parameters: InternalMockNodeParameters = InternalMockNodeParameters(), nodeFactory: (MockNodeArgs) -> MockNode): TestStartedNode MaxLineLength:InternalMockNetwork.kt$InternalMockNetwork$"You can use MockNetwork.waitQuiescent() to wait for all the nodes to process all the messages on their queues instead." MaxLineLength:InternalMockNetwork.kt$InternalMockNetwork$/** * Returns the list of nodes started by the network. Each notary specified when the network is constructed ([notarySpecs] * parameter) maps 1:1 to the notaries returned by this list. */ val notaryNodes: List<TestStartedNode> @@ -6331,12 +6385,13 @@ MaxLineLength:InternalUtils.kt$ @DeleteForDJVM fun <T> KClass<*>.staticField(name: String): DeclaredField<T> MaxLineLength:InternalUtils.kt$ fun <T, U> List<T>.lazyMapped(transform: (T, Int) -> U): List<U> MaxLineLength:InternalUtils.kt$// TODO: Currently the certificate revocation status is not handled here. Nowhere in the code the second parameter is used. Consider adding the support in the future. fun CertPath.validate(trustAnchor: TrustAnchor, checkRevocation: Boolean = false): PKIXCertPathValidatorResult + MaxLineLength:InternalUtils.kt$// re-defined to prevent clash with Java 9 Class.packageName: https://docs.oracle.com/javase/9/docs/api/java/lang/Class.html#getPackageName-- val Class<*>.packageName_: String get() = requireNotNull(this.packageNameOrNull) { "$this not defined inside a package" } MaxLineLength:InternalUtils.kt$?: MaxLineLength:InternalUtils.kt$@DeleteForDJVM fun InputStream.copyTo(target: Path, vararg options: CopyOption): Long MaxLineLength:InternalUtils.kt$DeclaredField<T> MaxLineLength:InternalUtils.kt$LazyMappedList<T, U> : AbstractList MaxLineLength:InternalUtils.kt$if (predicate(iterator.next())) throw IllegalArgumentException("Collection contains more than one matching element.") - MaxLineLength:InternalUtils.kt$val Class<*>.packageNameOrNull: String? // This intentionally does not go via `package` as that code path is slow and contended and just ends up doing this. get() { val name = this.getName() val i = name.lastIndexOf('.') if (i != -1) { return name.substring(0, i) } else { return null } } + MaxLineLength:InternalUtils.kt$val Class<*>.packageNameOrNull: String? // This intentionally does not go via `package` as that code path is slow and contended and just ends up doing this. get() { val name = this.name val i = name.lastIndexOf('.') return if (i != -1) { name.substring(0, i) } else { null } } MaxLineLength:Interpolators.kt$CubicSplineInterpolator : Interpolator MaxLineLength:Interpolators.kt$Polynomial MaxLineLength:InvocationContext.kt$Actor.Companion$@JvmStatic fun service(serviceClassName: String, owningLegalIdentity: CordaX500Name): Actor @@ -6417,15 +6472,16 @@ MaxLineLength:JarScanningCordappLoaderTest.kt$JarScanningCordappLoaderTest$val serializationWhitelistedClasses = actualCordapp.serializationWhitelists.flatMap { it.whitelist }.map { it.name } MaxLineLength:JarSignatureCollector.kt$JarSignatureCollector$ fun collectCertificates(jar: JarInputStream): List<X509Certificate> MaxLineLength:JarSignatureCollector.kt$JarSignatureCollector$/** * @see <https://docs.oracle.com/javase/8/docs/technotes/guides/jar/jar.html#Signed_JAR_File> * Additionally accepting *.EC as its valid for [java.util.jar.JarVerifier] and jarsigner @see https://docs.oracle.com/javase/8/docs/technotes/tools/windows/jarsigner.html, * temporally treating META-INF/INDEX.LIST as unsignable entry because [java.util.jar.JarVerifier] doesn't load its signers. */ private val unsignableEntryName = "META-INF/(?:(?:.*[.](?:SF|DSA|RSA|EC)|SIG-.*)|INDEX\\.LIST)".toRegex() + MaxLineLength:JarSignatureCollectorTest.kt$JarSignatureCollectorTest$// JDK11: Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value. // TODO: use programmatic API support to implement signing (see https://docs.oracle.com/javase/9/docs/api/jdk/security/jarsigner/JarSigner.html) private fun signAs(alias: String, keyPassword: String = alias) : PublicKey MaxLineLength:JarSignatureCollectorTest.kt$JarSignatureCollectorTest$// Signing with EC algorithm produces META-INF/*.EC file name not compatible with JAR File Spec however it's compatible with java.util.JarVerifier // and our JarSignatureCollector @Test fun `one signer with EC algorithm`() MaxLineLength:JarSignatureCollectorTest.kt$JarSignatureCollectorTest$assertEquals(listOf(key), dir.getJarSigners(FILENAME)) MaxLineLength:JarSignatureCollectorTest.kt$JarSignatureCollectorTest${ (dir / "volatile").writeLines(listOf("volatile")) dir.createJar(FILENAME, "volatile") val key1 = signAsAlice() assertEquals(listOf(key1), dir.getJarSigners(FILENAME)) (dir / "volatile").writeLines(listOf("garbage")) dir.updateJar(FILENAME, "volatile", "_signable1") // ALICE's signature on volatile is now bad. signAsBob() // The JDK doesn't care that BOB has correctly signed the whole thing, it won't let us process the entry with ALICE's bad signature: assertFailsWith<SecurityException> { dir.getJarSigners(FILENAME) } } + MaxLineLength:JarSignatureCollectorTest.kt$JarSignatureCollectorTest${ dir.createJar(FILENAME, "_signable1", "_signable2") // JDK11: Warning: Different store and key passwords not supported for PKCS12 KeyStores. Ignoring user-specified -keypass value. val key = signAs(CHARLIE, CHARLIE_PASS) assertEquals(listOf(key), dir.getJarSigners(FILENAME)) // We only used CHARLIE's distinguished name, so the keys will be different. } MaxLineLength:JarSignatureTestUtils.kt$JarSignatureTestUtils$executeProcess("jarsigner", "-keystore", "_teststore", "-storepass", storePassword, "-keypass", keyPassword, fileName, alias) MaxLineLength:JarSignatureTestUtils.kt$JarSignatureTestUtils$executeProcess("keytool", "-genkeypair", "-keystore", storeName, "-storepass", storePassword, "-keyalg", keyalg, "-alias", alias, "-keypass", keyPassword, "-dname", name) MaxLineLength:JarSignatureTestUtils.kt$JarSignatureTestUtils$fun Path.generateKey(alias: String = "Test", storePassword: String = "secret!", name: String = CODE_SIGNER.toString(), keyalg: String = "RSA", keyPassword: String = storePassword, storeName: String = "_teststore") : PublicKey MaxLineLength:JarSignatureTestUtils.kt$JarSignatureTestUtils$fun Path.signJar(fileName: String, alias: String, storePassword: String, keyPassword: String = storePassword): PublicKey MaxLineLength:KMSUtils.kt$require(issuerRole == CertRole.LEGAL_IDENTITY) { "Confidential identities can only be issued from well known identities, provided issuer ${issuer.name} has role $issuerRole" } - MaxLineLength:KeyManagementService.kt$KeyManagementService$ @Suspendable fun externalIdForPublicKey(publicKey: PublicKey): UUID? MaxLineLength:KeyManagementService.kt$KeyManagementService$ @Suspendable fun freshKey(externalId: UUID): PublicKey MaxLineLength:KeyManagementService.kt$KeyManagementService$ @Suspendable fun freshKeyAndCert(identity: PartyAndCertificate, revocationEnabled: Boolean): PartyAndCertificate MaxLineLength:KeyManagementService.kt$KeyManagementService$ @Suspendable fun freshKeyAndCert(identity: PartyAndCertificate, revocationEnabled: Boolean, externalId: UUID): PartyAndCertificate @@ -6564,7 +6620,6 @@ MaxLineLength:LocalSerializerFactory.kt$DefaultLocalSerializerFactory$private MaxLineLength:LocalSerializerFactory.kt$DefaultLocalSerializerFactory$private val serializersByActualAndDeclaredType: MutableMap<ActualAndDeclaredType, AMQPSerializer<Any>> = DefaultCacheProvider.createCache() MaxLineLength:LocalSerializerFactory.kt$DefaultLocalSerializerFactory$private val serializersByTypeId: MutableMap<TypeIdentifier, AMQPSerializer<Any>> = DefaultCacheProvider.createCache() - MaxLineLength:LocalSerializerFactory.kt$DefaultLocalSerializerFactory$val declaredGenericType = if (declaredType !is ParameterizedType && localTypeInformation.typeIdentifier is Parameterised) { localTypeInformation.typeIdentifier.getLocalType(classLoaderFor(declaredClass)) } else { declaredType } MaxLineLength:LocalSerializerFactory.kt$LocalSerializerFactory MaxLineLength:LocalSerializerFactory.kt$LocalSerializerFactory$ fun getTypeInformation(typeName: String): LocalTypeInformation? MaxLineLength:LocalSerializerFactory.kt$LocalSerializerFactory$/** * The [ClassWhitelist] used by this factory. Classes must be whitelisted for serialization, because they are expected * to be written in a secure manner. */ val whitelist: ClassWhitelist @@ -6622,6 +6677,7 @@ MaxLineLength:LocalTypeModelTests.kt$LocalTypeModelTests$"Either annotate a constructor for this type with @ConstructorForDeserialization, or provide a custom serializer for it" MaxLineLength:LocalTypeModelTests.kt$LocalTypeModelTests$"Either ensure that the properties [b, c, d] are serializable, or provide a custom serializer for this type" MaxLineLength:LocalTypeModelTests.kt$LocalTypeModelTests$AliasingOldStylePojoImpl : OldStylePojo + MaxLineLength:LocalTypeModelTests.kt$LocalTypeModelTests$NonComposableNested MaxLineLength:LocalTypeModelTests.kt$LocalTypeModelTests$StringCollectionHolder : StringKeyedCollectionHolder MaxLineLength:LocalTypeModelTests.kt$LocalTypeModelTests$StringKeyedCollectionHolder<T> : CollectionHolder MaxLineLength:LocalTypeModelTests.kt$LocalTypeModelTests$private val customSerializerRegistry: CustomSerializerRegistry = CachingCustomSerializerRegistry(descriptorBasedSerializerRegistry) @@ -6670,7 +6726,6 @@ MaxLineLength:MapSerializer.kt$MapSerializer.Companion$fun resolveActual(actualClass: Class<*>, declaredTypeInformation: LocalTypeInformation.AMap): LocalTypeInformation.AMap MaxLineLength:MapSerializer.kt$MapSerializer.Companion$private MaxLineLength:MapValuesList.kt$MapValuesList.Companion$val backingList = FXCollections.observableArrayList<Map.Entry<K, A>>(sourceMap.entries.sortedBy { it.key!!.hashCode() }) - MaxLineLength:MappedList.kt$MappedList<A, B> : TransformationList MaxLineLength:MappedSchemasCrossReferenceDetectionTests.kt$MappedSchemasCrossReferenceDetectionTests$BadSchema : MappedSchema MaxLineLength:MappedSchemasCrossReferenceDetectionTests.kt$MappedSchemasCrossReferenceDetectionTests$GoodSchema : MappedSchema MaxLineLength:MappedSchemasCrossReferenceDetectionTests.kt$MappedSchemasCrossReferenceDetectionTests$PoliteSchema : MappedSchema @@ -6773,7 +6828,6 @@ MaxLineLength:MockKeyManagementService.kt$MockKeyManagementService$override fun filterMyKeys(candidateKeys: Iterable<PublicKey>): Iterable<PublicKey> MaxLineLength:MockKeyManagementService.kt$MockKeyManagementService$override fun getSigner(publicKey: PublicKey): ContentSigner MaxLineLength:MockKeyManagementService.kt$MockKeyManagementService$private val keyStore: MutableMap<PublicKey, PrivateKey> = initialKeys.associateByTo(HashMap(), { it.public }, { it.private }) - MaxLineLength:MockKeyManagementService.kt$MockKeyManagementService$private val pkToIdCache: WritablePublicKeyToOwningIdentityCache MaxLineLength:MockNetwork.kt$MockNetwork MaxLineLength:MockNetwork.kt$MockNetwork$ fun createPartyNode(legalName: CordaX500Name? = null): StartedMockNode MaxLineLength:MockNetwork.kt$MockNetwork$/** In a mock network, nodes have an incrementing integer ID. Real networks do not have this. Returns the next ID that will be used. */ val nextNodeId get(): Int = internalMockNetwork.nextNodeId @@ -6848,12 +6902,12 @@ MaxLineLength:MockServices.kt$MockServices.Companion$return JarScanningCordappLoader.fromJarUrls(cordappsForPackages(packages).map { it.jarFile.toUri().toURL() }, versionInfo) MaxLineLength:MockServices.kt$MockServices.Companion$return object : MockServices(cordappLoader, identityService, networkParameters, initialIdentity, moreKeys.toTypedArray(), keyManagementService) { override var networkParametersService: NetworkParametersService = MockNetworkParametersStorage(networkParameters) override val vaultService: VaultService = makeVaultService(schemaService, persistence, cordappLoader) override fun recordTransactions(statesToRecord: StatesToRecord, txs: Iterable<SignedTransaction>) { ServiceHubInternal.recordTransactions( statesToRecord, txs as? Collection ?: txs.toList(), validatedTransactions as WritableTransactionStorage, mockStateMachineRecordedTransactionMappingStorage, vaultService as VaultServiceInternal, persistence ) } override fun jdbcSession(): Connection = persistence.createSession() override fun <T : Any?> withEntityManager(block: EntityManager.() -> T): T { return block(contextTransaction.restrictedEntityManager) } override fun withEntityManager(block: Consumer<EntityManager>) { return block.accept(contextTransaction.restrictedEntityManager) } } MaxLineLength:MockServices.kt$MockServices.Companion$val database = configureDatabase(dataSourceProps, DatabaseConfig(), identityService::wellKnownPartyFromX500Name, identityService::wellKnownPartyFromAnonymous, schemaService, schemaService.internalSchemas()) - MaxLineLength:MockServices.kt$MockServices.Companion$val persistence = configureDatabase(dataSourceProps, DatabaseConfig(), identityService::wellKnownPartyFromX500Name, identityService::wellKnownPartyFromAnonymous, schemaService, schemaService.internalSchemas()) - MaxLineLength:MockServices.kt$MockServices.Companion${ val cordappLoader = cordappLoaderForPackages(cordappPackages) val dataSourceProps = makeTestDataSourceProperties() val schemaService = NodeSchemaService(cordappLoader.cordappSchemas) val identityService = PersistentIdentityService(TestingNamedCacheFactory()) val persistence = configureDatabase(dataSourceProps, DatabaseConfig(), identityService::wellKnownPartyFromX500Name, identityService::wellKnownPartyFromAnonymous, schemaService, schemaService.internalSchemas()) // Create a persistent identity service and add all the supplied identities. identityService.apply { ourNames = setOf(initialIdentity.name) database = persistence start(DEV_ROOT_CA.certificate) persistence.transaction { identityService.loadIdentities(moreIdentities + initialIdentity.identity) } } // Create a persistent key management service and add the key pair which was created for the TestIdentity. // We only add the keypair for the initial identity and any other keys which this node may control. Note: We don't add the keys // for the other identities. val pkToIdCache = PublicKeyToOwningIdentityCacheImpl(persistence, TestingNamedCacheFactory()) val aliasKeyMap = mutableMapOf<String, KeyPair>() val aliasedMoreKeys = moreKeys.mapIndexed { index, keyPair -> val alias = "Extra key $index" aliasKeyMap[alias] = keyPair KeyPair(keyPair.public, AliasPrivateKey(alias)) }.toSet() val identityAlias = "${initialIdentity.name} private key" aliasKeyMap[identityAlias] = initialIdentity.keyPair val aliasedIdentityKey = KeyPair(initialIdentity.publicKey, AliasPrivateKey(identityAlias)) val keyManagementService = BasicHSMKeyManagementService( TestingNamedCacheFactory(), identityService, persistence, MockCryptoService(aliasKeyMap), pkToIdCache ) persistence.transaction { keyManagementService.start(aliasedMoreKeys + aliasedIdentityKey) } val mockService = persistence.transaction { makeMockMockServices(cordappLoader, identityService, networkParameters, initialIdentity, moreKeys, keyManagementService, schemaService, persistence) } return Pair(persistence, mockService) } + MaxLineLength:MockServices.kt$MockServices.Companion${ val cordappLoader = cordappLoaderForPackages(cordappPackages) val dataSourceProps = makeTestDataSourceProperties() val schemaService = NodeSchemaService(cordappLoader.cordappSchemas) val identityService = PersistentIdentityService(TestingNamedCacheFactory()) val persistence = configureDatabase( hikariProperties = dataSourceProps, databaseConfig = DatabaseConfig(), wellKnownPartyFromX500Name = identityService::wellKnownPartyFromX500Name, wellKnownPartyFromAnonymous = identityService::wellKnownPartyFromAnonymous, schemaService = schemaService, internalSchemas = schemaService.internalSchemas() ) val pkToIdCache = PublicKeyToOwningIdentityCacheImpl(persistence, TestingNamedCacheFactory()) // Create a persistent identity service and add all the supplied identities. identityService.apply { ourNames = setOf(initialIdentity.name) database = persistence start(DEV_ROOT_CA.certificate, pkToIdCache = pkToIdCache) persistence.transaction { identityService.loadIdentities(moreIdentities + initialIdentity.identity) } } // Create a persistent key management service and add the key pair which was created for the TestIdentity. // We only add the keypair for the initial identity and any other keys which this node may control. Note: We don't add the keys // for the other identities. val aliasKeyMap = mutableMapOf<String, KeyPair>() val aliasedMoreKeys = moreKeys.mapIndexed { index, keyPair -> val alias = "Extra key $index" aliasKeyMap[alias] = keyPair KeyPair(keyPair.public, AliasPrivateKey(alias)) }.toSet() val identityAlias = "${initialIdentity.name} private key" aliasKeyMap[identityAlias] = initialIdentity.keyPair val aliasedIdentityKey = KeyPair(initialIdentity.publicKey, AliasPrivateKey(identityAlias)) val keyManagementService = BasicHSMKeyManagementService( TestingNamedCacheFactory(), identityService, persistence, MockCryptoService(aliasKeyMap) ) persistence.transaction { keyManagementService.start(aliasedMoreKeys + aliasedIdentityKey) } val mockService = persistence.transaction { makeMockMockServices(cordappLoader, identityService, networkParameters, initialIdentity, moreKeys, keyManagementService, schemaService, persistence) } return Pair(persistence, mockService) } MaxLineLength:MockServices.kt$MockServices.Companion.<no name provided>$override var networkParametersService: NetworkParametersService = MockNetworkParametersStorage(networkParameters) MaxLineLength:MockTransactionStorage.kt$MockTransactionStorage$override fun getTransaction(id: SecureHash): SignedTransaction? MaxLineLength:MockTransactionStorage.kt$MockTransactionStorage$override fun getTransactionInternal(id: SecureHash): Pair<SignedTransaction, Boolean>? MaxLineLength:Models.kt$Models + MaxLineLength:Models.kt$Models$fun <M : Any> initModel(klass: KClass<M>) MaxLineLength:MyCustomNotaryService.kt$MyCustomValidatingNotaryService : SinglePartyNotaryService MaxLineLength:MyCustomNotaryService.kt$MyCustomValidatingNotaryService$override fun createServiceFlow(otherPartySession: FlowSession): FlowLogic<Void?> MaxLineLength:MyCustomNotaryService.kt$MyCustomValidatingNotaryService$override val uniquenessProvider = PersistentUniquenessProvider(services.clock, services.database, services.cacheFactory) @@ -6979,7 +7033,6 @@ MaxLineLength:NetworkMapUpdaterTest.kt$NetworkMapUpdaterTest$@Test fun `network parameters not auto-accepted when update only changes whitelist but auto accept configured to be false`() MaxLineLength:NetworkMapUpdaterTest.kt$NetworkMapUpdaterTest$@Test fun `network parameters not auto-accepted when update only changes whitelist but parameter included in exclusion`() MaxLineLength:NetworkMapUpdaterTest.kt$NetworkMapUpdaterTest$Assert.assertThat(networkMapCache.allNodeHashes, IsIterableContainingInAnyOrder.containsInAnyOrder(signedNodeInfo1.raw.hash, signedNodeInfo2.raw.hash)) - MaxLineLength:NetworkMapUpdaterTest.kt$NetworkMapUpdaterTest$MockKeyManagementService(makeTestIdentityService(), ourKeyPair, pkToIdCache = MockPublicKeyToOwningIdentityCache()) MaxLineLength:NetworkMapUpdaterTest.kt$NetworkMapUpdaterTest$assertFalse(netParams.canAutoAccept(netParamsAutoAcceptable, setOf("whitelistedContractImplementations")), "not auto-acceptable if only AutoAcceptable params have changed but one has been added to the exclusion set") MaxLineLength:NetworkMapUpdaterTest.kt$NetworkMapUpdaterTest$assertFalse(netParams.canAutoAccept(netParamsNotAutoAcceptable, emptySet()), "not auto-acceptable if non-AutoAcceptable param has changed") MaxLineLength:NetworkMapUpdaterTest.kt$NetworkMapUpdaterTest$assertThat(networkMapCache.allNodeHashes).containsExactlyInAnyOrder(fileNodeInfoAndSigned1.signed.raw.hash, fileNodeInfoAndSigned2.signed.raw.hash) @@ -7081,6 +7134,7 @@ MaxLineLength:Node.kt$Node$ObjectName("$domain:type=$category,${if (component.isNotEmpty()) "component=$component," else ""}name=$subName") MaxLineLength:Node.kt$Node$System.setProperty("h2.allowedClasses", "org.h2.mvstore.db.MVTableEngine,org.locationtech.jts.geom.Geometry,org.h2.server.TcpServer") MaxLineLength:Node.kt$Node$System.setProperty("io.netty.allocator.numHeapArenas", min(memBasedArenas, NettyRuntime.availableProcessors() * 2L).toString()) + MaxLineLength:Node.kt$Node$fun <T : FlowLogic<*>> registerInitiatedFlow(@Suppress("UNUSED_PARAMETER") smm: StateMachineManager, initiatedFlowClass: Class<T>) MaxLineLength:Node.kt$Node$if (configuration.shouldStartLocalShell()) RPCSecurityManagerWithAdditionalUser(this, User(INTERNAL_SHELL_USER, INTERNAL_SHELL_USER, setOf(Permissions.all()))) else this MaxLineLength:Node.kt$Node$internalRpcMessagingClient = InternalRPCMessagingClient(configuration.p2pSslOptions, it.admin, MAX_RPC_MESSAGE_SIZE, CordaX500Name.build(configuration.p2pSslOptions.keyStore.get()[X509Utilities.CORDA_CLIENT_TLS].subjectX500Principal), rpcServerConfiguration) MaxLineLength:Node.kt$Node$log @@ -7098,15 +7152,15 @@ MaxLineLength:Node.kt$Node$throw CouldNotCreateDataSourceException("Database password is required for H2 server listening on ${InetAddress.getByName(effectiveH2Settings.address.host)}.") MaxLineLength:Node.kt$Node${ // Netty arenas are approx 16MB each when max'd out. Set arenas based on memory, not core count, unless memory is abundant. val memBasedArenas = max(Runtime.getRuntime().maxMemory() / 256.MB, 1L) // We set the min of the above and the default. System.setProperty("io.netty.allocator.numHeapArenas", min(memBasedArenas, NettyRuntime.availableProcessors() * 2L).toString()) } MaxLineLength:Node.kt$Node${ check(!serverThread.isOnThread) synchronized(this) { if (shutdown) return shutdown = true // Unregister shutdown hook to prevent any unnecessary second calls to stop shutdownHook?.cancel() shutdownHook = null } printBasicNodeInfo("Shutting down ...") // All the Node started subsystems were registered with the runOnStop list at creation. // So now simply call the parent to stop everything in reverse order. // In particular this prevents premature shutdown of the Database by AbstractNode whilst the serverThread is active super.stop() shutdown = false log.info("Shutdown complete") } - MaxLineLength:Node.kt$Node${ override fun createStartedNode(nodeInfo: NodeInfo, rpcOps: CordaRPCOps, notaryService: NotaryService?): NodeInfo = nodeInfo companion object { private val staticLog = contextLogger() var renderBasicInfoToConsole = true /** Used for useful info that we always want to show, even when not logging to the console */ fun printBasicNodeInfo(description: String, info: String? = null) { val msg = if (info == null) description else "${description.padEnd(40)}: $info" val loggerName = if (renderBasicInfoToConsole) "BasicInfo" else "Main" LoggerFactory.getLogger(loggerName).info(msg) } fun printInRed(message: String) { println("${ShellConstants.RED}$message${ShellConstants.RESET}") } fun printWarning(message: String) { Emoji.renderIfSupported { printInRed("${Emoji.warningSign} ATTENTION: $message") } staticLog.warn(message) } internal fun failStartUp(message: String): Nothing { println(message) println("Corda will now exit...") exitProcess(1) } private fun createClock(configuration: NodeConfiguration): CordaClock { return (if (configuration.useTestClock) ::DemoClock else ::SimpleClock)(Clock.systemUTC()) } private val sameVmNodeCounter = AtomicInteger() // TODO: make this configurable. const val MAX_RPC_MESSAGE_SIZE = 10485760 fun isInvalidJavaVersion(): Boolean { if (!hasMinimumJavaVersion()) { println("You are using a version of Java that is not supported (${SystemUtils.JAVA_VERSION}). Please upgrade to the latest version of Java 8.") println("Corda will now exit...") return true } return false } private fun hasMinimumJavaVersion(): Boolean { // when the ext.java8_minUpdateVersion gradle constant changes, so must this check return try { val update = getJavaUpdateVersion(SystemUtils.JAVA_VERSION) // To filter out cases like 1.8.0_202-ea SystemUtils.IS_JAVA_1_8 && update >= 171 } catch (e: NumberFormatException) { // custom JDKs may not have the update version (e.g. 1.8.0-adoptopenjdk) false } } } override val log: Logger get() = staticLog override val transactionVerifierWorkerCount: Int get() = 4 private var internalRpcMessagingClient: InternalRPCMessagingClient? = null private var rpcBroker: ArtemisBroker? = null private var shutdownHook: ShutdownHook? = null // DISCUSSION // // We use a single server thread for now, which means all message handling is serialized. // // Writing thread safe code is hard. In this project we are writing most node services and code to be thread safe, but // the possibility of mistakes is always present. Thus we make a deliberate decision here to trade off some multi-core // scalability in order to gain developer productivity by setting the size of the serverThread pool to one, which will // reduce the number of threading bugs we will need to tackle. // // This leaves us with four possibilities in future: // // (1) We discover that processing messages is fast and that our eventual use cases do not need very high // processing rates. We have benefited from the higher productivity and not lost anything. // // (2) We discover that we need greater multi-core scalability, but that the bulk of our time goes into particular CPU // hotspots that are easily multi-threaded e.g. signature checking. We successfully multi-thread those hotspots // and find that our software now scales sufficiently well to satisfy our user's needs. // // (3) We discover that it wasn't enough, but that we only need to run some messages in parallel and that the bulk of // the work can stay single threaded. For example perhaps we find that latency sensitive UI requests must be handled // on a separate thread pool where long blocking operations are not allowed, but that the bulk of the heavy lifting // can stay single threaded. In this case we would need a separate thread pool, but we still minimise the amount of // thread safe code we need to write and test. // // (4) None of the above are sufficient and we need to run all messages in parallel to get maximum (single machine) // scalability and fully saturate all cores. In that case we can go fully free-threaded, e.g. change the number '1' // below to some multiple of the core count. Alternatively by using the ForkJoinPool and let it figure out the right // number of threads by itself. This will require some investment in stress testing to build confidence that we // haven't made any mistakes, but it will only be necessary if eventual deployment scenarios demand it. // // Note that the messaging subsystem schedules work onto this thread in a blocking manner. That means if the server // thread becomes too slow and a backlog of work starts to builds up it propagates back through into the messaging // layer, which can then react to the backpressure. Artemis MQ in particular knows how to do flow control by paging // messages to disk rather than letting us run out of RAM. // // The primary work done by the server thread is execution of flow logics, and related // serialisation/deserialisation work. override fun makeMessagingService(): MessagingService { return P2PMessagingClient( config = configuration, versionInfo = versionInfo, serverAddress = configuration.messagingServerAddress ?: NetworkHostAndPort("localhost", configuration.p2pAddress.port), nodeExecutor = serverThread, database = database, networkMap = networkMapCache, isDrainingModeOn = nodeProperties.flowsDrainingMode::isEnabled, drainingModeWasChangedEvents = nodeProperties.flowsDrainingMode.values, metricRegistry = metricRegistry, cacheFactory = cacheFactory ) } override fun startMessagingService(rpcOps: RPCOps, nodeInfo: NodeInfo, myNotaryIdentity: PartyAndCertificate?, networkParameters: NetworkParameters) { require(nodeInfo.legalIdentities.size in 1..2) { "Currently nodes must have a primary address and optionally one serviced address" } network as P2PMessagingClient if (System.getProperty("io.netty.allocator.numHeapArenas").isNullOrBlank()) { // Netty arenas are approx 16MB each when max'd out. Set arenas based on memory, not core count, unless memory is abundant. val memBasedArenas = max(Runtime.getRuntime().maxMemory() / 256.MB, 1L) // We set the min of the above and the default. System.setProperty("io.netty.allocator.numHeapArenas", min(memBasedArenas, NettyRuntime.availableProcessors() * 2L).toString()) } // Construct security manager reading users data either from the 'security' config section // if present or from rpcUsers list if the former is missing from config. val securityManagerConfig = configuration.security?.authService ?: SecurityConfiguration.AuthService.fromUsers(configuration.rpcUsers) val securityManager = with(RPCSecurityManagerImpl(securityManagerConfig, cacheFactory)) { if (configuration.shouldStartLocalShell()) RPCSecurityManagerWithAdditionalUser(this, User(INTERNAL_SHELL_USER, INTERNAL_SHELL_USER, setOf(Permissions.all()))) else this } val messageBroker = if (!configuration.messagingServerExternal) { val brokerBindAddress = configuration.messagingServerAddress ?: NetworkHostAndPort("0.0.0.0", configuration.p2pAddress.port) ArtemisMessagingServer(configuration, brokerBindAddress, networkParameters.maxMessageSize) } else { null } val rpcServerAddresses = if (configuration.rpcOptions.standAloneBroker) { BrokerAddresses(configuration.rpcOptions.address, configuration.rpcOptions.adminAddress) } else { startLocalRpcBroker(securityManager) } val bridgeControlListener = makeBridgeControlListener(network.serverAddress, networkParameters) printBasicNodeInfo("Advertised P2P messaging addresses", nodeInfo.addresses.joinToString()) val rpcServerConfiguration = RPCServerConfiguration.DEFAULT rpcServerAddresses?.let { internalRpcMessagingClient = InternalRPCMessagingClient(configuration.p2pSslOptions, it.admin, MAX_RPC_MESSAGE_SIZE, CordaX500Name.build(configuration.p2pSslOptions.keyStore.get()[X509Utilities.CORDA_CLIENT_TLS].subjectX500Principal), rpcServerConfiguration) printBasicNodeInfo("RPC connection address", it.primary.toString()) printBasicNodeInfo("RPC admin connection address", it.admin.toString()) } // Start up the embedded MQ server messageBroker?.apply { closeOnStop() start() } rpcBroker?.apply { closeOnStop() start() } // Start P2P bridge service bridgeControlListener.apply { closeOnStop() start() } // Start up the MQ clients. internalRpcMessagingClient?.run { closeOnStop() init(rpcOps, securityManager, cacheFactory) } network.closeOnStop() network.start( myIdentity = nodeInfo.legalIdentities[0].owningKey, serviceIdentity = if (nodeInfo.legalIdentities.size == 1) null else nodeInfo.legalIdentities[1].owningKey, advertisedAddress = nodeInfo.addresses[0], maxMessageSize = networkParameters.maxMessageSize ) } private fun makeBridgeControlListener(serverAddress: NetworkHostAndPort, networkParameters: NetworkParameters): BridgeControlListener { val artemisMessagingClientFactory = { ArtemisMessagingClient( configuration.p2pSslOptions, serverAddress, networkParameters.maxMessageSize, failoverCallback = { errorAndTerminate("ArtemisMessagingClient failed. Shutting down.", null) } ) } return BridgeControlListener(configuration.p2pSslOptions, networkParameters.maxMessageSize, configuration.crlCheckSoftFail, artemisMessagingClientFactory) } private fun startLocalRpcBroker(securityManager: RPCSecurityManager): BrokerAddresses? { return with(configuration) { rpcOptions.address.let { val rpcBrokerDirectory: Path = baseDirectory / "brokers" / "rpc" with(rpcOptions) { rpcBroker = if (useSsl) { ArtemisRpcBroker.withSsl(configuration.p2pSslOptions, this.address, adminAddress, sslConfig!!, securityManager, MAX_RPC_MESSAGE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory, shouldStartLocalShell()) } else { ArtemisRpcBroker.withoutSsl(configuration.p2pSslOptions, this.address, adminAddress, securityManager, MAX_RPC_MESSAGE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory, shouldStartLocalShell()) } } rpcBroker!!.addresses } } } override fun myAddresses(): List<NetworkHostAndPort> = listOf(getAdvertisedAddress()) + configuration.additionalP2PAddresses private fun getAdvertisedAddress(): NetworkHostAndPort { return with(configuration) { require(p2pAddress.host != "0.0.0.0") { "Invalid p2pAddress: $p2pAddress contains 0.0.0.0 which is not suitable as an advertised node address" } val host = if (detectPublicIp) { tryDetectIfNotPublicHost(p2pAddress.host) ?: p2pAddress.host } else { p2pAddress.host } NetworkHostAndPort(host, p2pAddress.port) } } /** * Checks whether the specified [host] is a public IP address or hostname. If not, tries to discover the current * machine's public IP address to be used instead by looking through the network interfaces. */ private fun tryDetectIfNotPublicHost(host: String): String? { return if (host.toLowerCase() == "localhost") { log.warn("p2pAddress specified as localhost. Trying to autodetect a suitable public address to advertise in network map." + "To disable autodetect set detectPublicIp = false in the node.conf, or consider using messagingServerAddress and messagingServerExternal") val foundPublicIP = AddressUtils.tryDetectPublicIP() if (foundPublicIP == null) { try { val retrievedHostName = networkMapClient?.myPublicHostname() if (retrievedHostName != null) { log.info("Retrieved public IP from Network Map Service: $this. This will be used instead of the provided \"$host\" as the advertised address.") } retrievedHostName } catch (ignore: Exception) { // Cannot reach the network map service, ignore the exception and use provided P2P address instead. log.warn("Cannot connect to the network map service for public IP detection.") null } } else { log.info("Detected public IP: ${foundPublicIP.hostAddress}. This will be used instead of the provided \"$host\" as the advertised address.") foundPublicIP.hostAddress } } else { null } } /** * If the node is persisting to an embedded H2 database, then expose this via TCP with a DB URL of the form: * jdbc:h2:tcp://<host>:<port>/node * with username and password as per the DataSource connection details. The key element to enabling this support is to * ensure that you specify a DB connection URL of the form jdbc:h2:file: in the node config and that you include * the H2 option AUTO_SERVER_PORT set to the port you desire to use (0 will give a dynamically allocated port number) * but exclude the H2 option AUTO_SERVER=TRUE. * This is not using the H2 "automatic mixed mode" directly but leans on many of the underpinnings. For more details * on H2 URLs and configuration see: http://www.h2database.com/html/features.html#database_url */ override fun startDatabase() { val databaseUrl = configuration.dataSourceProperties.getProperty("dataSource.url") val h2Prefix = "jdbc:h2:file:" if (databaseUrl != null && databaseUrl.startsWith(h2Prefix)) { val effectiveH2Settings = configuration.effectiveH2Settings //forbid execution of arbitrary code via SQL except those classes required by H2 itself System.setProperty("h2.allowedClasses", "org.h2.mvstore.db.MVTableEngine,org.locationtech.jts.geom.Geometry,org.h2.server.TcpServer") if (effectiveH2Settings?.address != null) { if (!InetAddress.getByName(effectiveH2Settings.address.host).isLoopbackAddress && configuration.dataSourceProperties.getProperty("dataSource.password").isBlank()) { throw CouldNotCreateDataSourceException("Database password is required for H2 server listening on ${InetAddress.getByName(effectiveH2Settings.address.host)}.") } val databaseName = databaseUrl.removePrefix(h2Prefix).substringBefore(';') val baseDir = Paths.get(databaseName).parent.toString() val server = org.h2.tools.Server.createTcpServer( "-tcpPort", effectiveH2Settings.address.port.toString(), "-tcpAllowOthers", "-tcpDaemon", "-baseDir", baseDir, "-key", "node", databaseName) // override interface that createTcpServer listens on (which is always 0.0.0.0) System.setProperty("h2.bindAddress", effectiveH2Settings.address.host) runOnStop += server::stop val url = try { server.start().url } catch (e: JdbcSQLNonTransientConnectionException) { if (e.cause is BindException) { throw AddressBindingException(effectiveH2Settings.address) } else { throw e } } printBasicNodeInfo("Database connection url is", "jdbc:h2:$url/node") } } super.startDatabase() database.closeOnStop() } private val _startupComplete = openFuture<Unit>() val startupComplete: CordaFuture<Unit> get() = _startupComplete override fun generateAndSaveNodeInfo(): NodeInfo { initialiseSerialization() return super.generateAndSaveNodeInfo() } override fun start(): NodeInfo { registerDefaultExceptionHandler() initialiseSerialization() val nodeInfo: NodeInfo = super.start() nodeReadyFuture.thenMatch({ serverThread.execute { registerJmxReporter(services.monitoringService.metrics) _startupComplete.set(Unit) } }, { th -> staticLog.error("Unexpected exception", th) } // XXX: Why not use log? ) shutdownHook = addShutdownHook { stop() } return nodeInfo } /** * Register a default exception handler for all threads that terminates the process if the database connection goes away and * cannot be recovered. */ private fun registerDefaultExceptionHandler() { Thread.setDefaultUncaughtExceptionHandler(DbExceptionHandler(Thread.getDefaultUncaughtExceptionHandler())) } /** * A hook to allow configuration override of the JmxReporter being used. */ fun registerJmxReporter(metrics: MetricRegistry) { log.info("Registering JMX reporter:") when (configuration.jmxReporterType) { JmxReporterType.JOLOKIA -> registerJolokiaReporter(metrics) JmxReporterType.NEW_RELIC -> registerNewRelicReporter(metrics) } } private fun registerJolokiaReporter(registry: MetricRegistry) { log.info("Registering Jolokia JMX reporter:") // Begin exporting our own metrics via JMX. These can be monitored using any agent, e.g. Jolokia: // // https://jolokia.org/agent/jvm.html JmxReporter.forRegistry(registry).inDomain("net.corda").createsObjectNamesWith { _, domain, name -> // Make the JMX hierarchy a bit better organised. val category = name.substringBefore('.').substringBeforeLast('/') val component = name.substringBefore('.').substringAfterLast('/', "") val subName = name.substringAfter('.', "") (if (subName == "") ObjectName("$domain:name=$category${if (component.isNotEmpty()) ",component=$component," else ""}") else ObjectName("$domain:type=$category,${if (component.isNotEmpty()) "component=$component," else ""}name=$subName")) }.build().start() } private fun registerNewRelicReporter(registry: MetricRegistry) { log.info("Registering New Relic JMX Reporter:") val reporter = NewRelicReporter.forRegistry(registry) .name("New Relic Reporter") .filter(MetricFilter.ALL) .attributeFilter(AllEnabledMetricAttributeFilter()) .rateUnit(TimeUnit.SECONDS) .durationUnit(TimeUnit.MILLISECONDS) .metricNamePrefix("corda/") .build() reporter.start(1, TimeUnit.MINUTES) } override val rxIoScheduler: Scheduler get() = Schedulers.io() private fun initialiseSerialization() { if (!initialiseSerialization) return val classloader = cordappLoader.appClassLoader nodeSerializationEnv = SerializationEnvironment.with( SerializationFactoryImpl().apply { registerScheme(AMQPServerSerializationScheme(cordappLoader.cordapps, Caffeine.newBuilder().maximumSize(128).build<SerializationFactoryCacheKey, SerializerFactory>().asMap())) registerScheme(AMQPClientSerializationScheme(cordappLoader.cordapps, Caffeine.newBuilder().maximumSize(128).build<SerializationFactoryCacheKey, SerializerFactory>().asMap())) }, p2pContext = AMQP_P2P_CONTEXT.withClassLoader(classloader), rpcServerContext = AMQP_RPC_SERVER_CONTEXT.withClassLoader(classloader), rpcClientContext = if (configuration.shouldInitCrashShell()) AMQP_RPC_CLIENT_CONTEXT.withClassLoader(classloader) else null, //even Shell embeded in the node connects via RPC to the node storageContext = AMQP_STORAGE_CONTEXT.withClassLoader(classloader), checkpointSerializer = KryoCheckpointSerializer, checkpointContext = KRYO_CHECKPOINT_CONTEXT.withClassLoader(classloader) ) } /** Starts a blocking event loop for message dispatch. */ fun run() { internalRpcMessagingClient?.start(rpcBroker!!.serverControl) (network as P2PMessagingClient).run() } private var shutdown = false override fun stop() { check(!serverThread.isOnThread) synchronized(this) { if (shutdown) return shutdown = true // Unregister shutdown hook to prevent any unnecessary second calls to stop shutdownHook?.cancel() shutdownHook = null } printBasicNodeInfo("Shutting down ...") // All the Node started subsystems were registered with the runOnStop list at creation. // So now simply call the parent to stop everything in reverse order. // In particular this prevents premature shutdown of the Database by AbstractNode whilst the serverThread is active super.stop() shutdown = false log.info("Shutdown complete") } fun <T : FlowLogic<*>> registerInitiatedFlow(smm: StateMachineManager, initiatedFlowClass: Class<T>) { this.flowManager.registerInitiatedFlow(initiatedFlowClass) } } + MaxLineLength:Node.kt$Node${ override fun createStartedNode(nodeInfo: NodeInfo, rpcOps: CordaRPCOps, notaryService: NotaryService?): NodeInfo = nodeInfo companion object { private val staticLog = contextLogger() var renderBasicInfoToConsole = true /** Used for useful info that we always want to show, even when not logging to the console */ fun printBasicNodeInfo(description: String, info: String? = null) { val msg = if (info == null) description else "${description.padEnd(40)}: $info" val loggerName = if (renderBasicInfoToConsole) "BasicInfo" else "Main" LoggerFactory.getLogger(loggerName).info(msg) } fun printInRed(message: String) { println("${ShellConstants.RED}$message${ShellConstants.RESET}") } fun printWarning(message: String) { Emoji.renderIfSupported { printInRed("${Emoji.warningSign} ATTENTION: $message") } staticLog.warn(message) } internal fun failStartUp(message: String): Nothing { println(message) println("Corda will now exit...") exitProcess(1) } private fun createClock(configuration: NodeConfiguration): CordaClock { return (if (configuration.useTestClock) ::DemoClock else ::SimpleClock)(Clock.systemUTC()) } private val sameVmNodeCounter = AtomicInteger() // TODO: make this configurable. const val MAX_RPC_MESSAGE_SIZE = 10485760 fun isInvalidJavaVersion(): Boolean { if (!hasMinimumJavaVersion()) { println("You are using a version of Java that is not supported (${SystemUtils.JAVA_VERSION}). Please upgrade to the latest version of Java 8.") println("Corda will now exit...") return true } return false } private fun hasMinimumJavaVersion(): Boolean { // JDK 11: review naming convention and checking of 'minUpdateVersion' and 'distributionType` (OpenJDK, Oracle, Zulu, AdoptOpenJDK, Cornetto) return try { if (SystemUtils.IS_JAVA_11) return true else { val update = getJavaUpdateVersion(SystemUtils.JAVA_VERSION) // To filter out cases like 1.8.0_202-ea (SystemUtils.IS_JAVA_1_8 && update >= 171) } } catch (e: NumberFormatException) { // custom JDKs may not have the update version (e.g. 1.8.0-adoptopenjdk) false } } } override val log: Logger get() = staticLog override val transactionVerifierWorkerCount: Int get() = 4 private var internalRpcMessagingClient: InternalRPCMessagingClient? = null private var rpcBroker: ArtemisBroker? = null private var shutdownHook: ShutdownHook? = null // DISCUSSION // // We use a single server thread for now, which means all message handling is serialized. // // Writing thread safe code is hard. In this project we are writing most node services and code to be thread safe, but // the possibility of mistakes is always present. Thus we make a deliberate decision here to trade off some multi-core // scalability in order to gain developer productivity by setting the size of the serverThread pool to one, which will // reduce the number of threading bugs we will need to tackle. // // This leaves us with four possibilities in future: // // (1) We discover that processing messages is fast and that our eventual use cases do not need very high // processing rates. We have benefited from the higher productivity and not lost anything. // // (2) We discover that we need greater multi-core scalability, but that the bulk of our time goes into particular CPU // hotspots that are easily multi-threaded e.g. signature checking. We successfully multi-thread those hotspots // and find that our software now scales sufficiently well to satisfy our user's needs. // // (3) We discover that it wasn't enough, but that we only need to run some messages in parallel and that the bulk of // the work can stay single threaded. For example perhaps we find that latency sensitive UI requests must be handled // on a separate thread pool where long blocking operations are not allowed, but that the bulk of the heavy lifting // can stay single threaded. In this case we would need a separate thread pool, but we still minimise the amount of // thread safe code we need to write and test. // // (4) None of the above are sufficient and we need to run all messages in parallel to get maximum (single machine) // scalability and fully saturate all cores. In that case we can go fully free-threaded, e.g. change the number '1' // below to some multiple of the core count. Alternatively by using the ForkJoinPool and let it figure out the right // number of threads by itself. This will require some investment in stress testing to build confidence that we // haven't made any mistakes, but it will only be necessary if eventual deployment scenarios demand it. // // Note that the messaging subsystem schedules work onto this thread in a blocking manner. That means if the server // thread becomes too slow and a backlog of work starts to builds up it propagates back through into the messaging // layer, which can then react to the backpressure. Artemis MQ in particular knows how to do flow control by paging // messages to disk rather than letting us run out of RAM. // // The primary work done by the server thread is execution of flow logics, and related // serialisation/deserialisation work. override fun makeMessagingService(): MessagingService { return P2PMessagingClient( config = configuration, versionInfo = versionInfo, serverAddress = configuration.messagingServerAddress ?: NetworkHostAndPort("localhost", configuration.p2pAddress.port), nodeExecutor = serverThread, database = database, networkMap = networkMapCache, isDrainingModeOn = nodeProperties.flowsDrainingMode::isEnabled, drainingModeWasChangedEvents = nodeProperties.flowsDrainingMode.values, metricRegistry = metricRegistry, cacheFactory = cacheFactory ) } override fun startMessagingService(rpcOps: RPCOps, nodeInfo: NodeInfo, myNotaryIdentity: PartyAndCertificate?, networkParameters: NetworkParameters) { require(nodeInfo.legalIdentities.size in 1..2) { "Currently nodes must have a primary address and optionally one serviced address" } network as P2PMessagingClient if (System.getProperty("io.netty.allocator.numHeapArenas").isNullOrBlank()) { // Netty arenas are approx 16MB each when max'd out. Set arenas based on memory, not core count, unless memory is abundant. val memBasedArenas = max(Runtime.getRuntime().maxMemory() / 256.MB, 1L) // We set the min of the above and the default. System.setProperty("io.netty.allocator.numHeapArenas", min(memBasedArenas, NettyRuntime.availableProcessors() * 2L).toString()) } // Construct security manager reading users data either from the 'security' config section // if present or from rpcUsers list if the former is missing from config. val securityManagerConfig = configuration.security?.authService ?: SecurityConfiguration.AuthService.fromUsers(configuration.rpcUsers) val securityManager = with(RPCSecurityManagerImpl(securityManagerConfig, cacheFactory)) { if (configuration.shouldStartLocalShell()) RPCSecurityManagerWithAdditionalUser(this, User(INTERNAL_SHELL_USER, INTERNAL_SHELL_USER, setOf(Permissions.all()))) else this } val messageBroker = if (!configuration.messagingServerExternal) { val brokerBindAddress = configuration.messagingServerAddress ?: NetworkHostAndPort("0.0.0.0", configuration.p2pAddress.port) ArtemisMessagingServer(configuration, brokerBindAddress, networkParameters.maxMessageSize) } else { null } val rpcServerAddresses = if (configuration.rpcOptions.standAloneBroker) { BrokerAddresses(configuration.rpcOptions.address, configuration.rpcOptions.adminAddress) } else { startLocalRpcBroker(securityManager) } val bridgeControlListener = makeBridgeControlListener(network.serverAddress, networkParameters) printBasicNodeInfo("Advertised P2P messaging addresses", nodeInfo.addresses.joinToString()) val rpcServerConfiguration = RPCServerConfiguration.DEFAULT rpcServerAddresses?.let { internalRpcMessagingClient = InternalRPCMessagingClient(configuration.p2pSslOptions, it.admin, MAX_RPC_MESSAGE_SIZE, CordaX500Name.build(configuration.p2pSslOptions.keyStore.get()[X509Utilities.CORDA_CLIENT_TLS].subjectX500Principal), rpcServerConfiguration) printBasicNodeInfo("RPC connection address", it.primary.toString()) printBasicNodeInfo("RPC admin connection address", it.admin.toString()) } // Start up the embedded MQ server messageBroker?.apply { closeOnStop() start() } rpcBroker?.apply { closeOnStop() start() } // Start P2P bridge service bridgeControlListener.apply { closeOnStop() start() } // Start up the MQ clients. internalRpcMessagingClient?.run { closeOnStop() init(rpcOps, securityManager, cacheFactory) } network.closeOnStop() network.start( myIdentity = nodeInfo.legalIdentities[0].owningKey, serviceIdentity = if (nodeInfo.legalIdentities.size == 1) null else nodeInfo.legalIdentities[1].owningKey, advertisedAddress = nodeInfo.addresses[0], maxMessageSize = networkParameters.maxMessageSize ) } private fun makeBridgeControlListener(serverAddress: NetworkHostAndPort, networkParameters: NetworkParameters): BridgeControlListener { val artemisMessagingClientFactory = { ArtemisMessagingClient( configuration.p2pSslOptions, serverAddress, networkParameters.maxMessageSize, failoverCallback = { errorAndTerminate("ArtemisMessagingClient failed. Shutting down.", null) } ) } return BridgeControlListener(configuration.p2pSslOptions, networkParameters.maxMessageSize, configuration.crlCheckSoftFail, artemisMessagingClientFactory) } private fun startLocalRpcBroker(securityManager: RPCSecurityManager): BrokerAddresses? { return with(configuration) { rpcOptions.address.let { val rpcBrokerDirectory: Path = baseDirectory / "brokers" / "rpc" with(rpcOptions) { rpcBroker = if (useSsl) { ArtemisRpcBroker.withSsl(configuration.p2pSslOptions, this.address, adminAddress, sslConfig!!, securityManager, MAX_RPC_MESSAGE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory, shouldStartLocalShell()) } else { ArtemisRpcBroker.withoutSsl(configuration.p2pSslOptions, this.address, adminAddress, securityManager, MAX_RPC_MESSAGE_SIZE, jmxMonitoringHttpPort != null, rpcBrokerDirectory, shouldStartLocalShell()) } } rpcBroker!!.addresses } } } override fun myAddresses(): List<NetworkHostAndPort> = listOf(getAdvertisedAddress()) + configuration.additionalP2PAddresses private fun getAdvertisedAddress(): NetworkHostAndPort { return with(configuration) { require(p2pAddress.host != "0.0.0.0") { "Invalid p2pAddress: $p2pAddress contains 0.0.0.0 which is not suitable as an advertised node address" } val host = if (detectPublicIp) { tryDetectIfNotPublicHost(p2pAddress.host) ?: p2pAddress.host } else { p2pAddress.host } NetworkHostAndPort(host, p2pAddress.port) } } /** * Checks whether the specified [host] is a public IP address or hostname. If not, tries to discover the current * machine's public IP address to be used instead by looking through the network interfaces. */ private fun tryDetectIfNotPublicHost(host: String): String? { return if (host.toLowerCase() == "localhost") { log.warn("p2pAddress specified as localhost. Trying to autodetect a suitable public address to advertise in network map." + "To disable autodetect set detectPublicIp = false in the node.conf, or consider using messagingServerAddress and messagingServerExternal") val foundPublicIP = AddressUtils.tryDetectPublicIP() if (foundPublicIP == null) { try { val retrievedHostName = networkMapClient?.myPublicHostname() if (retrievedHostName != null) { log.info("Retrieved public IP from Network Map Service: $this. This will be used instead of the provided \"$host\" as the advertised address.") } retrievedHostName } catch (ignore: Exception) { // Cannot reach the network map service, ignore the exception and use provided P2P address instead. log.warn("Cannot connect to the network map service for public IP detection.") null } } else { log.info("Detected public IP: ${foundPublicIP.hostAddress}. This will be used instead of the provided \"$host\" as the advertised address.") foundPublicIP.hostAddress } } else { null } } /** * If the node is persisting to an embedded H2 database, then expose this via TCP with a DB URL of the form: * jdbc:h2:tcp://<host>:<port>/node * with username and password as per the DataSource connection details. The key element to enabling this support is to * ensure that you specify a DB connection URL of the form jdbc:h2:file: in the node config and that you include * the H2 option AUTO_SERVER_PORT set to the port you desire to use (0 will give a dynamically allocated port number) * but exclude the H2 option AUTO_SERVER=TRUE. * This is not using the H2 "automatic mixed mode" directly but leans on many of the underpinnings. For more details * on H2 URLs and configuration see: http://www.h2database.com/html/features.html#database_url */ override fun startDatabase() { val databaseUrl = configuration.dataSourceProperties.getProperty("dataSource.url") val h2Prefix = "jdbc:h2:file:" if (databaseUrl != null && databaseUrl.startsWith(h2Prefix)) { val effectiveH2Settings = configuration.effectiveH2Settings //forbid execution of arbitrary code via SQL except those classes required by H2 itself System.setProperty("h2.allowedClasses", "org.h2.mvstore.db.MVTableEngine,org.locationtech.jts.geom.Geometry,org.h2.server.TcpServer") if (effectiveH2Settings?.address != null) { if (!InetAddress.getByName(effectiveH2Settings.address.host).isLoopbackAddress && configuration.dataSourceProperties.getProperty("dataSource.password").isBlank()) { throw CouldNotCreateDataSourceException("Database password is required for H2 server listening on ${InetAddress.getByName(effectiveH2Settings.address.host)}.") } val databaseName = databaseUrl.removePrefix(h2Prefix).substringBefore(';') val baseDir = Paths.get(databaseName).parent.toString() val server = org.h2.tools.Server.createTcpServer( "-tcpPort", effectiveH2Settings.address.port.toString(), "-tcpAllowOthers", "-tcpDaemon", "-baseDir", baseDir, "-key", "node", databaseName) // override interface that createTcpServer listens on (which is always 0.0.0.0) System.setProperty("h2.bindAddress", effectiveH2Settings.address.host) runOnStop += server::stop val url = try { server.start().url } catch (e: JdbcSQLNonTransientConnectionException) { if (e.cause is BindException) { throw AddressBindingException(effectiveH2Settings.address) } else { throw e } } printBasicNodeInfo("Database connection url is", "jdbc:h2:$url/node") } } super.startDatabase() database.closeOnStop() } private val _startupComplete = openFuture<Unit>() val startupComplete: CordaFuture<Unit> get() = _startupComplete override fun generateAndSaveNodeInfo(): NodeInfo { initialiseSerialization() return super.generateAndSaveNodeInfo() } override fun start(): NodeInfo { registerDefaultExceptionHandler() initialiseSerialization() val nodeInfo: NodeInfo = super.start() nodeReadyFuture.thenMatch({ serverThread.execute { registerJmxReporter(services.monitoringService.metrics) _startupComplete.set(Unit) } }, { th -> staticLog.error("Unexpected exception", th) } // XXX: Why not use log? ) shutdownHook = addShutdownHook { stop() } return nodeInfo } /** * Register a default exception handler for all threads that terminates the process if the database connection goes away and * cannot be recovered. */ private fun registerDefaultExceptionHandler() { Thread.setDefaultUncaughtExceptionHandler(DbExceptionHandler(Thread.getDefaultUncaughtExceptionHandler())) } /** * A hook to allow configuration override of the JmxReporter being used. */ fun registerJmxReporter(metrics: MetricRegistry) { log.info("Registering JMX reporter:") when (configuration.jmxReporterType) { JmxReporterType.JOLOKIA -> registerJolokiaReporter(metrics) JmxReporterType.NEW_RELIC -> registerNewRelicReporter(metrics) } } private fun registerJolokiaReporter(registry: MetricRegistry) { log.info("Registering Jolokia JMX reporter:") // Begin exporting our own metrics via JMX. These can be monitored using any agent, e.g. Jolokia: // // https://jolokia.org/agent/jvm.html JmxReporter.forRegistry(registry).inDomain("net.corda").createsObjectNamesWith { _, domain, name -> // Make the JMX hierarchy a bit better organised. val category = name.substringBefore('.').substringBeforeLast('/') val component = name.substringBefore('.').substringAfterLast('/', "") val subName = name.substringAfter('.', "") (if (subName == "") ObjectName("$domain:name=$category${if (component.isNotEmpty()) ",component=$component," else ""}") else ObjectName("$domain:type=$category,${if (component.isNotEmpty()) "component=$component," else ""}name=$subName")) }.build().start() } private fun registerNewRelicReporter(registry: MetricRegistry) { log.info("Registering New Relic JMX Reporter:") val reporter = NewRelicReporter.forRegistry(registry) .name("New Relic Reporter") .filter(MetricFilter.ALL) .attributeFilter(AllEnabledMetricAttributeFilter()) .rateUnit(TimeUnit.SECONDS) .durationUnit(TimeUnit.MILLISECONDS) .metricNamePrefix("corda/") .build() reporter.start(1, TimeUnit.MINUTES) } override val rxIoScheduler: Scheduler get() = Schedulers.io() private fun initialiseSerialization() { if (!initialiseSerialization) return val classloader = cordappLoader.appClassLoader nodeSerializationEnv = SerializationEnvironment.with( SerializationFactoryImpl().apply { registerScheme(AMQPServerSerializationScheme(cordappLoader.cordapps, Caffeine.newBuilder().maximumSize(128).build<SerializationFactoryCacheKey, SerializerFactory>().asMap())) registerScheme(AMQPClientSerializationScheme(cordappLoader.cordapps, Caffeine.newBuilder().maximumSize(128).build<SerializationFactoryCacheKey, SerializerFactory>().asMap())) }, p2pContext = AMQP_P2P_CONTEXT.withClassLoader(classloader), rpcServerContext = AMQP_RPC_SERVER_CONTEXT.withClassLoader(classloader), rpcClientContext = if (configuration.shouldInitCrashShell()) AMQP_RPC_CLIENT_CONTEXT.withClassLoader(classloader) else null, //even Shell embeded in the node connects via RPC to the node storageContext = AMQP_STORAGE_CONTEXT.withClassLoader(classloader), checkpointSerializer = KryoCheckpointSerializer, checkpointContext = KRYO_CHECKPOINT_CONTEXT.withClassLoader(classloader) ) } /** Starts a blocking event loop for message dispatch. */ fun run() { internalRpcMessagingClient?.start(rpcBroker!!.serverControl) (network as P2PMessagingClient).run() } private var shutdown = false override fun stop() { check(!serverThread.isOnThread) synchronized(this) { if (shutdown) return shutdown = true // Unregister shutdown hook to prevent any unnecessary second calls to stop shutdownHook?.cancel() shutdownHook = null } printBasicNodeInfo("Shutting down ...") // All the Node started subsystems were registered with the runOnStop list at creation. // So now simply call the parent to stop everything in reverse order. // In particular this prevents premature shutdown of the Database by AbstractNode whilst the serverThread is active super.stop() shutdown = false log.info("Shutdown complete") } fun <T : FlowLogic<*>> registerInitiatedFlow(@Suppress("UNUSED_PARAMETER") smm: StateMachineManager, initiatedFlowClass: Class<T>) { this.flowManager.registerInitiatedFlow(initiatedFlowClass) } } MaxLineLength:Node.kt$Node.Companion$println("You are using a version of Java that is not supported (${SystemUtils.JAVA_VERSION}). Please upgrade to the latest version of Java 8.") - MaxLineLength:Node.kt$Node.Companion${ val update = getJavaUpdateVersion(SystemUtils.JAVA_VERSION) // To filter out cases like 1.8.0_202-ea SystemUtils.IS_JAVA_1_8 && update >= 171 } + MaxLineLength:Node.kt$Node.Companion${ // JDK 11: review naming convention and checking of 'minUpdateVersion' and 'distributionType` (OpenJDK, Oracle, Zulu, AdoptOpenJDK, Cornetto) return try { if (SystemUtils.IS_JAVA_11) return true else { val update = getJavaUpdateVersion(SystemUtils.JAVA_VERSION) // To filter out cases like 1.8.0_202-ea (SystemUtils.IS_JAVA_1_8 && update >= 171) } } catch (e: NumberFormatException) { // custom JDKs may not have the update version (e.g. 1.8.0-adoptopenjdk) false } } + MaxLineLength:Node.kt$Node.Companion${ if (SystemUtils.IS_JAVA_11) return true else { val update = getJavaUpdateVersion(SystemUtils.JAVA_VERSION) // To filter out cases like 1.8.0_202-ea (SystemUtils.IS_JAVA_1_8 && update >= 171) } } MaxLineLength:Node.kt$NodeWithInfo$fun <T : FlowLogic<*>> registerInitiatedFlow(initiatedFlowClass: Class<T>) MaxLineLength:Node.kt$NodeWithInfo$val services: StartedNodeServices = object : StartedNodeServices, ServiceHubInternal by node.services, FlowStarter by node.flowStarter {} MaxLineLength:NodeAdder.kt$NodeAdder$?: MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$/** * This caches contract attachment versions by contract class name. For each version, we support one signed and one unsigned attachment, since that is allowed. * * It is correctly invalidated as new attachments are uploaded. */ private val contractsCache = InfrequentlyMutatedCache<ContractClassName, NavigableMap<Version, AttachmentIds>>("NodeAttachmentService_contractAttachmentVersions", cacheFactory) - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$AttachmentSort.AttachmentSortColumn(AttachmentSort.AttachmentSortAttribute.INSERTION_DATE, Sort.Direction.DESC) - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$ContractAttachment + MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$// TODO do not retrieve whole attachments only to return ids - https://r3-cev.atlassian.net/browse/CORDA-3191 raised to address this override fun queryAttachments(criteria: AttachmentQueryCriteria, sorting: AttachmentSort?): List<AttachmentId> MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$HashCheckingStream : FilterInputStream MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$HashMismatchException : CordaRuntimeException MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$log.warn("(Dev Mode) Multiple signed attachments ${signed.map { it.toString() }} for contract $contractClassName version '${it.key}'.") @@ -7114,17 +7168,11 @@ MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$log.warn("Several versions based on whitelistedContractImplementations position are available: ${versions.toSet()}. $msg") MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$private MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$require(inputStream !is JarInputStream) { "Input stream must not be a JarInputStream" } // Read the file into RAM and then calculate its hash. The attachment must fit into memory. // TODO: Switch to a two-phase insert so we can handle attachments larger than RAM. // To do this we must pipe stream into the database without knowing its hash, which we will learn only once // the insert/upload is complete. We can then query to see if it's a duplicate and if so, erase, and if not // set the hash field of the new attachment record. val bytes = inputStream.readFully() val id = bytes.sha256() if (!hasAttachment(id)) { checkIsAValidJAR(bytes.inputStream()) val jarSigners = getSigners(bytes) val contractVersion = increaseDefaultVersionIfWhitelistedAttachment(contractClassNames, getVersion(bytes), id) val session = currentDBSession() val attachment = NodeAttachmentService.DBAttachment( attId = id.toString(), content = bytes, uploader = uploader, filename = filename, contractClassNames = contractClassNames, signers = jarSigners, version = contractVersion ) session.save(attachment) attachmentCount.inc() log.info("Stored new attachment: id=$id uploader=$uploader filename=$filename") contractClassNames.forEach { contractsCache.invalidate(it) } return@withContractsInJar id } if (isUploaderTrusted(uploader)) { val session = currentDBSession() val attachment = session.get(NodeAttachmentService.DBAttachment::class.java, id.toString()) // update the `uploader` field (as the existing attachment may have been resolved from a peer) if (attachment.uploader != uploader) { attachment.uploader = uploader log.info("Updated attachment $id with uploader $uploader") contractClassNames.forEach { contractsCache.invalidate(it) } loadAttachmentContent(id)?.let { attachmentAndContent -> // TODO: this is racey. ENT-2870 attachmentContentCache.put(id, Optional.of(attachmentAndContent)) attachmentCache.put(id, Optional.of(attachmentAndContent.first)) } return@withContractsInJar id } // If the uploader is the same, throw the exception because the attachment cannot be overridden by the same uploader. } throw DuplicateAttachmentException(id.toString()) - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$val attachmentImpl = AttachmentImpl(id, { attachment.content }, checkAttachmentsOnLoad, attachment.uploader).let { val contracts = attachment.contractClassNames if (contracts != null && contracts.isNotEmpty()) { ContractAttachment.create(it, contracts.first(), contracts.drop(1).toSet(), attachment.uploader, attachment.signers?.toList() ?: emptyList(), attachment.version) } else { it } } - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$val attachmentQueryCriteria = AttachmentQueryCriteria.AttachmentsQueryCriteria(contractClassNamesCondition = Builder.equal(listOf(name)), versionCondition = Builder.greaterThanOrEqual(0), uploaderCondition = Builder.`in`(TRUSTED_UPLOADERS)) - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$val attachmentSort = AttachmentSort(listOf(AttachmentSort.AttachmentSortColumn(AttachmentSort.AttachmentSortAttribute.VERSION, Sort.Direction.DESC), AttachmentSort.AttachmentSortColumn(AttachmentSort.AttachmentSortAttribute.INSERTION_DATE, Sort.Direction.DESC))) MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$val contractVersion = increaseDefaultVersionIfWhitelistedAttachment(contractClassNames, getVersion(bytes), id) MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$val versions = contractClassNames.mapNotNull { servicesForResolution.networkParameters.whitelistedContractImplementations[it]?.indexOf(attachmentId) } .filter { it >= 0 }.map { it + 1 } // +1 as versions starts from 1 not 0 MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService$weigher = Weigher<SecureHash, Optional<Pair<Attachment, ByteArray>>> { key, value -> key.size + if (value.isPresent) value.get().second.size else 0 } MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService${ val session = currentDBSession() val attachment = session.get(NodeAttachmentService.DBAttachment::class.java, id.toString()) // update the `uploader` field (as the existing attachment may have been resolved from a peer) if (attachment.uploader != uploader) { attachment.uploader = uploader log.info("Updated attachment $id with uploader $uploader") contractClassNames.forEach { contractsCache.invalidate(it) } loadAttachmentContent(id)?.let { attachmentAndContent -> // TODO: this is racey. ENT-2870 attachmentContentCache.put(id, Optional.of(attachmentAndContent)) attachmentCache.put(id, Optional.of(attachmentAndContent.first)) } return@withContractsInJar id } // If the uploader is the same, throw the exception because the attachment cannot be overridden by the same uploader. } - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService.AttachmentImpl$private MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService.AttachmentImpl$return if (checkOnLoad && id is SecureHash.SHA256) HashCheckingStream(id, attachmentData.size, stream) else stream - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService.AttachmentImpl.Token$override fun fromToken(context: SerializeAsTokenContext) - MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService.AttachmentImpl.Token$private MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService.Companion$// Just iterate over the entries with verification enabled: should be good enough to catch mistakes. // Note that JarInputStream won't throw any kind of error at all if the file stream is in fact not // a ZIP! It'll just pretend it's an empty archive, which is kind of stupid but that's how it works. // So we have to check to ensure we found at least one item. // // For signed Jars add additional checks to close security holes left by the default jarSigner verifier: // - All entries listed in the Manifest are in the JAR file. // - No extra files in the JAR that were not listed in the Manifest. // Together with the check that all entries need to be signed by the same signers that is performed when the signers are read, // it should close any possibility of foul play. internal fun checkIsAValidJAR(stream: InputStream) MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService.Companion$if (manifestHasEntries && !allManifestEntries!!.remove(cursor.name)) extraFilesNotFoundInEntries.add(cursor) MaxLineLength:NodeAttachmentService.kt$NodeAttachmentService.Companion$private val PRIVILEGED_UPLOADERS = listOf(DEPLOYED_CORDAPP_UPLOADER, RPC_UPLOADER, P2P_UPLOADER, UNKNOWN_UPLOADER) @@ -7147,24 +7195,9 @@ MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$@Test fun `development mode - retrieve latest versions of signed contracts - multiple versions of same version id exist in store`() MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$AttachmentSort(listOf(AttachmentSort.AttachmentSortColumn(AttachmentSort.AttachmentSortAttribute.VERSION))) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertEquals(listOf(jarAndSigner.second.hash), storage.openAttachment(attachmentId)!!.signerKeys.map { it.hash }) - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertFalse(isAttachmentTrusted(storage.openAttachment(attachmentC)!!, storage), "Contract $attachmentC should not be trusted (no chain of trust)") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertFalse(isAttachmentTrusted(storage.openAttachment(v1Id)!!, storage), "Initial attachment $v1Id should not be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertFalse(isAttachmentTrusted(storage.openAttachment(v1Id)!!, storage), "Initial contract $v1Id should not be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertFalse(isAttachmentTrusted(storage.openAttachment(v2Id)!!, storage), "Other attachment $v2Id should not be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertFalse(isAttachmentTrusted(storage.openAttachment(v2Id)!!, storage), "Upgraded contract $v2Id should not be trusted") MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertThat((storage.openAttachment(expectedAttachmentId) as ContractAttachment).uploader).isEqualTo(initialUploader) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertThat((storage.openAttachment(expectedAttachmentId) as ContractAttachment).uploader).isEqualTo(trustedUploader) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertThatThrownBy { attachment.read { storage.privilegedImportAttachment(it, untrustedUploader, null) } }.isInstanceOf(DuplicateAttachmentException::class.java) - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(attachmentA)!!, storage), "Contract $attachmentA should be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(attachmentB)!!, storage), "Contract $attachmentB should inherit trust") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(attachmentId)!!, storage), "Attachment $attachmentId should be trusted but isn't") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(signedId)!!, storage), "Signed contract $signedId should be trusted but isn't") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(unsignedId)!!, storage), "Unsigned contract $unsignedId should be trusted but isn't") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(v1Id)!!, storage), "Initial attachment $v1Id should be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(v1Id)!!, storage), "Initial attachment $v1Id should not be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(v1Id)!!, storage), "Initial contract $v1Id should be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(v2Id)!!, storage), "Other attachment $v2Id should be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$assertTrue(isAttachmentTrusted(storage.openAttachment(v2Id)!!, storage), "Upgraded contract $v2Id should be trusted") MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$contractClassNamesCondition = Builder.equal(listOf("com.example.MyContract", "com.example.AnotherContract")) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$contractJarV2.read { attachmentIdV2Unsigned = storage.privilegedImportAttachment(it, "app", "contract-V2.jar") } MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$fun filenameSort(direction: Sort.Direction) @@ -7174,13 +7207,9 @@ MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$storage.queryAttachments(AttachmentsQueryCriteria(contractClassNamesCondition = Builder.equal(listOf("com.example.MyContract")))).size MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$storage.queryAttachments(AttachmentsQueryCriteria(signersCondition = Builder.equal(listOf(publicKey)))).size MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val (signedContractJarSameVersion, _) = makeTestSignedContractJar(file.path,"com.example.MyContract", versionSeed = Random().nextInt()) - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val alias = "testAlias" val password = "testPassword" // Directly use the ContractJarTestUtils version of makeTestJar to ensure jars are created in the right place, in order to sign // them. var counter = 0 val jarV1 = file.path / "$counter.jar" ContractJarTestUtils.makeTestJar(jarV1.outputStream()) counter++ val jarV2 = file.path / "$counter.jar" // Ensure that the first and second jars do not have the same hash ContractJarTestUtils.makeTestJar(jarV2.outputStream(), entries = listOf(Pair("foo", "bar"))) file.path.generateKey(alias, password) val key1 = file.path.signJar(jarV1.toAbsolutePath().toString(), alias, password) val key2 = file.path.signJar(jarV2.toAbsolutePath().toString(), alias, password) val v1Id = jarV1.read { storage.privilegedImportAttachment(it, "app", "dummy-attachment.jar") } val v2Id = jarV2.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-attachment-2.jar") } // Sanity check. assertEquals(key1, key2, "Different public keys used to sign jars") assertTrue(isAttachmentTrusted(storage.openAttachment(v1Id)!!, storage), "Initial attachment $v1Id should be trusted") assertTrue(isAttachmentTrusted(storage.openAttachment(v2Id)!!, storage), "Other attachment $v2Id should be trusted") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val alias = "testAlias" val password = "testPassword" // Directly use the ContractJarTestUtils version of makeTestJar to ensure jars are created in the right place, in order to sign // them. var counter = 0 val jarV1 = file.path / "$counter.jar" ContractJarTestUtils.makeTestJar(jarV1.outputStream()) counter++ val jarV2 = file.path / "$counter.jar" // Ensure that the first and second jars do not have the same hash ContractJarTestUtils.makeTestJar(jarV2.outputStream(), entries = listOf(Pair("foo", "bar"))) file.path.generateKey(alias, password) val key1 = file.path.signJar(jarV1.toAbsolutePath().toString(), alias, password) val key2 = file.path.signJar(jarV2.toAbsolutePath().toString(), alias, password) val v1Id = jarV1.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-attachment.jar") } val v2Id = jarV2.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-attachment-2.jar") } // Sanity check. assertEquals(key1, key2, "Different public keys used to sign jars") assertFalse(isAttachmentTrusted(storage.openAttachment(v1Id)!!, storage), "Initial attachment $v1Id should not be trusted") assertFalse(isAttachmentTrusted(storage.openAttachment(v2Id)!!, storage), "Other attachment $v2Id should not be trusted") MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val anotherAttachmentId = anotherContractJar.read { storage.privilegedImportAttachment(it, "app", "another-sample.jar") } MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), generateManifest = false, jarFileName = "another-sample.jar") MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val anotherContractJar = makeTestContractJar(file.path, listOf( "com.example.MyContract", "com.example.AnotherContract"), true, generateManifest = false, jarFileName = "another-sample.jar") - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val attachmentB = jarSignedByAB.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-contract.jar") } - MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val attachmentC = jarSignedByBC.read { storage.privilegedImportAttachment(it, "untrusted", "dummy-contract.jar") } MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val attachments = storage.queryAttachments(AttachmentsQueryCriteria(contractClassNamesCondition = Builder.equal(listOf("com.example.MyContract")))) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val corruptAttachment = NodeAttachmentService.DBAttachment(attId = id.toString(), content = bytes, version = DEFAULT_CORDAPP_VERSION) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val overriddenAttachmentId = attachment.read { storage.privilegedImportAttachment(it, trustedUploader, null) } @@ -7188,6 +7217,8 @@ MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val signedAttachments = storage.queryAttachments(AttachmentsQueryCriteria(isSignedCondition = Builder.equal(true))) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest$val unsignedAttachments = storage.queryAttachments(AttachmentsQueryCriteria(isSignedCondition = Builder.equal(false))) MaxLineLength:NodeAttachmentServiceTest.kt$NodeAttachmentServiceTest.FetchAttachmentsFlow$serviceHub.attachments.importAttachment(baos.toByteArray().inputStream(), "$P2P_UPLOADER:${ourIdentity.name}", null) + MaxLineLength:NodeAttachmentTrustCalculator.kt$NodeAttachmentTrustCalculator : AttachmentTrustCalculatorSingletonSerializeAsToken + MaxLineLength:NodeAttachmentTrustCalculator.kt$NodeAttachmentTrustCalculator$( // `isSignedCondition` is not included here as attachments uploaded by trusted uploaders are considered trusted AttachmentQueryCriteria.AttachmentsQueryCriteria( uploaderCondition = Builder.`in`( TRUSTED_UPLOADERS ) ) ) MaxLineLength:NodeBasedTest.kt$InProcessNode : Node MaxLineLength:NodeBasedTest.kt$InProcessNode$assertFalse(isInvalidJavaVersion(), "You are using a version of Java that is not supported (${SystemUtils.JAVA_VERSION}). Please upgrade to the latest version of Java 8.") MaxLineLength:NodeBasedTest.kt$NodeBasedTest @@ -7278,7 +7309,6 @@ MaxLineLength:NodeInfoWatcher.kt$NodeInfoWatcher$nodeInfoFilesMap[file] = NodeInfoFromFile(nodeInfoSigned.signed.raw.hash, file.lastModifiedTime()) MaxLineLength:NodeInfoWatcher.kt$NodeInfoWatcher$val newOrChangedFile = previousLastModifiedTime == null || lastModifiedTime > previousLastModifiedTime MaxLineLength:NodeInfoWatcher.kt$NodeInfoWatcher.Companion${ // By using the hash of the node's first name we ensure: // 1) node info files for the same node map to the same filename and thus avoid having duplicate files for // the same node // 2) avoid having to deal with characters in the X.500 name which are incompatible with the local filesystem val fileNameHash = nodeInfoAndSigned.nodeInfo.legalIdentities[0].name.serialize().hash nodeInfoAndSigned .signed .serialize() .open() .copyTo(path / "${NodeInfoFilesCopier.NODE_INFO_FILE_NAME_PREFIX}$fileNameHash", REPLACE_EXISTING) } - MaxLineLength:NodeInfoWatcherTest.kt$NodeInfoWatcherTest$keyManagementService = MockKeyManagementService(identityService, pkToIdCache = MockPublicKeyToOwningIdentityCache()) MaxLineLength:NodeInfoWatcherTest.kt$NodeInfoWatcherTest$val nodeInfoFiles = tempFolder.root.list().filter { it.startsWith(NodeInfoFilesCopier.NODE_INFO_FILE_NAME_PREFIX) } MaxLineLength:NodeInstanceRequest.kt$NodeInstanceRequest$localImageId MaxLineLength:NodeInstanceRequest.kt$NodeInstanceRequest$return "NodeInstanceRequest(nodeInstanceName='$nodeInstanceName', actualX500='$actualX500', expectedFqName='$expectedFqName') ${super.toString()}" @@ -7297,7 +7327,7 @@ MaxLineLength:NodeMonitorModel.kt$NodeMonitorModel$futureProgressTrackerUpdates.startWith(currentProgressTrackerUpdates).flatMap { it }.retry().subscribe(progressTrackingSubject) MaxLineLength:NodeMonitorModel.kt$NodeMonitorModel$val (statesSnapshot, vaultUpdates) = rpc.vaultTrackBy<ContractState>(QueryCriteria.VaultQueryCriteria(Vault.StateStatus.ALL), PageSpecification(DEFAULT_PAGE_NUM, MAX_PAGE_SIZE)) MaxLineLength:NodeMonitorModel.kt$NodeMonitorModel$val stateMachineTransactionMapping: Observable<StateMachineTransactionMapping> = stateMachineTransactionMappingSubject - MaxLineLength:NodeMonitorModel.kt$NodeMonitorModel${ rpc = ReconnectingCordaRPCOps(nodeHostAndPort, username, password) proxyObservable.value = rpc // Vault snapshot (force single page load with MAX_PAGE_SIZE) + updates val (statesSnapshot, vaultUpdates) = rpc.vaultTrackBy<ContractState>(QueryCriteria.VaultQueryCriteria(Vault.StateStatus.ALL), PageSpecification(DEFAULT_PAGE_NUM, MAX_PAGE_SIZE)) val unconsumedStates = statesSnapshot.states.filterIndexed { index, _ -> statesSnapshot.statesMetadata[index].status == Vault.StateStatus.UNCONSUMED }.toSet() val consumedStates = statesSnapshot.states.toSet() - unconsumedStates val initialVaultUpdate = Vault.Update(consumedStates, unconsumedStates, references = emptySet()) vaultUpdates.startWith(initialVaultUpdate).subscribe(vaultUpdatesSubject::onNext) // Transactions val (transactions, newTransactions) = rpc.internalVerifiedTransactionsFeed() newTransactions.startWith(transactions).subscribe(transactionsSubject::onNext) // SM -> TX mapping val (smTxMappings, futureSmTxMappings) = rpc.stateMachineRecordedTransactionMappingFeed() futureSmTxMappings.startWith(smTxMappings).subscribe(stateMachineTransactionMappingSubject::onNext) // Parties on network val (parties, futurePartyUpdate) = rpc.networkMapFeed() futurePartyUpdate.startWith(parties.map(MapChange::Added)).subscribe(networkMapSubject::onNext) val stateMachines = rpc.stateMachinesSnapshot() notaryIdentities = rpc.notaryIdentities() // Extract the flow tracking stream // TODO is there a nicer way of doing this? Stream of streams in general results in code like this... // TODO `progressTrackingSubject` doesn't seem to be used anymore - should it be removed? val currentProgressTrackerUpdates = stateMachines.mapNotNull { stateMachine -> ProgressTrackingEvent.createStreamFromStateMachineInfo(stateMachine) } val futureProgressTrackerUpdates = stateMachineUpdatesSubject.map { stateMachineUpdate -> if (stateMachineUpdate is StateMachineUpdate.Added) { ProgressTrackingEvent.createStreamFromStateMachineInfo(stateMachineUpdate.stateMachineInfo) ?: Observable.empty<ProgressTrackingEvent>() } else { Observable.empty<ProgressTrackingEvent>() } } // We need to retry, because when flow errors, we unsubscribe from progressTrackingSubject. So we end up with stream of state machine updates and no progress trackers. futureProgressTrackerUpdates.startWith(currentProgressTrackerUpdates).flatMap { it }.retry().subscribe(progressTrackingSubject) } + MaxLineLength:NodeMonitorModel.kt$NodeMonitorModel${ rpc = ReconnectingCordaRPCOps(nodeHostAndPort, username, password, CordaRPCClientConfiguration.DEFAULT) proxyObservable.value = rpc // Vault snapshot (force single page load with MAX_PAGE_SIZE) + updates val (statesSnapshot, vaultUpdates) = rpc.vaultTrackBy<ContractState>(QueryCriteria.VaultQueryCriteria(Vault.StateStatus.ALL), PageSpecification(DEFAULT_PAGE_NUM, MAX_PAGE_SIZE)) val unconsumedStates = statesSnapshot.states.filterIndexed { index, _ -> statesSnapshot.statesMetadata[index].status == Vault.StateStatus.UNCONSUMED }.toSet() val consumedStates = statesSnapshot.states.toSet() - unconsumedStates val initialVaultUpdate = Vault.Update(consumedStates, unconsumedStates, references = emptySet()) vaultUpdates.startWith(initialVaultUpdate).subscribe(vaultUpdatesSubject::onNext) // Transactions val (transactions, newTransactions) = @Suppress("DEPRECATION") rpc.internalVerifiedTransactionsFeed() newTransactions.startWith(transactions).subscribe(transactionsSubject::onNext) // SM -> TX mapping val (smTxMappings, futureSmTxMappings) = rpc.stateMachineRecordedTransactionMappingFeed() futureSmTxMappings.startWith(smTxMappings).subscribe(stateMachineTransactionMappingSubject::onNext) // Parties on network val (parties, futurePartyUpdate) = rpc.networkMapFeed() futurePartyUpdate.startWith(parties.map(MapChange::Added)).subscribe(networkMapSubject::onNext) val stateMachines = rpc.stateMachinesSnapshot() notaryIdentities = rpc.notaryIdentities() // Extract the flow tracking stream // TODO is there a nicer way of doing this? Stream of streams in general results in code like this... // TODO `progressTrackingSubject` doesn't seem to be used anymore - should it be removed? val currentProgressTrackerUpdates = stateMachines.mapNotNull { stateMachine -> ProgressTrackingEvent.createStreamFromStateMachineInfo(stateMachine) } val futureProgressTrackerUpdates = stateMachineUpdatesSubject.map { stateMachineUpdate -> if (stateMachineUpdate is StateMachineUpdate.Added) { ProgressTrackingEvent.createStreamFromStateMachineInfo(stateMachineUpdate.stateMachineInfo) ?: Observable.empty<ProgressTrackingEvent>() } else { Observable.empty<ProgressTrackingEvent>() } } // We need to retry, because when flow errors, we unsubscribe from progressTrackingSubject. So we end up with stream of state machine updates and no progress trackers. futureProgressTrackerUpdates.startWith(currentProgressTrackerUpdates).flatMap { it }.retry().subscribe(progressTrackingSubject) } MaxLineLength:NodeMonitorModel.kt$ProgressTrackingEvent.Companion$future.map { ProgressTrackingEvent(stateMachine.id, it) }.startWith(ProgressTrackingEvent(stateMachine.id, current)) MaxLineLength:NodeNamedCache.kt$DefaultNamedCacheFactory$name == "HibernateConfiguration_sessionFactories" -> caffeine.maximumSize(database.mappedSchemaCacheSize) MaxLineLength:NodeNamedCache.kt$DefaultNamedCacheFactory$name == "NodeAttachmentService_attachmentContent" -> caffeine.maximumWeight(attachmentContentCacheSizeBytes) @@ -7448,6 +7478,7 @@ MaxLineLength:NodeVaultServiceTest.kt$NodeVaultServiceTest$Cash().generateIssue(this, 200.POUNDS `issued by` MEGA_CORP.ref(1), AnonymousParty(freshKey), DUMMY_NOTARY) MaxLineLength:NodeVaultServiceTest.kt$NodeVaultServiceTest$CashUtils.generateSpend(services, this, Amount(amount.quantity, GBP), identity, thirdPartyIdentity.party.anonymise()) MaxLineLength:NodeVaultServiceTest.kt$NodeVaultServiceTest$FungibleFoo : FungibleState + MaxLineLength:NodeVaultServiceTest.kt$NodeVaultServiceTest$TransactionState(Cash.State(amount `issued by` issuer.ref(depositRef), identity.party), Cash.PROGRAM_ID, DUMMY_NOTARY, constraint = AlwaysAcceptAttachmentConstraint) MaxLineLength:NodeVaultServiceTest.kt$NodeVaultServiceTest$addOutputState(DummyDealContract.State(listOf(megaCorp.party), "Dummy linear id"), DUMMY_DEAL_PROGRAM_ID) MaxLineLength:NodeVaultServiceTest.kt$NodeVaultServiceTest$addOutputState(UniqueDummyFungibleContract.State(10.DOLLARS `issued by` DUMMY_CASH_ISSUER, megaCorp.party), UNIQUE_DUMMY_FUNGIBLE_CONTRACT_PROGRAM_ID) MaxLineLength:NodeVaultServiceTest.kt$NodeVaultServiceTest$addOutputState(UniqueDummyLinearContract.State(listOf(megaCorp.party), "Dummy linear id"), UNIQUE_DUMMY_LINEAR_CONTRACT_PROGRAM_ID) @@ -7512,9 +7543,8 @@ MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeLedgerTransaction$@Deprecated("NotaryChangeLedgerTransaction should not be created directly, use NotaryChangeWireTransaction.resolve instead.") MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeLedgerTransaction$override fun equals(other: Any?): Boolean MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeLedgerTransaction$val inputPositionIndex: Map<StateRef, Int> = inputs.mapIndexed { index, stateAndRef -> stateAndRef.ref to index }.toMap() - MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeWireTransaction$ @CordaInternal internal fun resolveOutputComponent(services: ServicesForResolution, stateRef: StateRef, params: NetworkParameters): SerializedBytes<TransactionState<ContractState>> + MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeWireTransaction$ @CordaInternal internal fun resolveOutputComponent( services: ServicesForResolution, stateRef: StateRef, @Suppress("UNUSED_PARAMETER") params: NetworkParameters ): SerializedBytes<TransactionState<ContractState>> MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeWireTransaction$ @DeleteForDJVM fun resolve(services: ServiceHub, sigs: List<TransactionSignature>) - MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeWireTransaction$@CordaInternal internal MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeWireTransaction$@Deprecated("Required only for backwards compatibility purposes. This type of transaction should not be constructed outside Corda code.", ReplaceWith("NotaryChangeTransactionBuilder"), DeprecationLevel.WARNING) MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeWireTransaction$@Deprecated("Required only for backwards compatibility purposes. This type of transaction should not be constructed outside Corda code.", ReplaceWith("NotaryChangeTransactionBuilder"), DeprecationLevel.WARNING) constructor(inputs: List<StateRef>, notary: Party, newNotary: Party) : this(listOf(inputs, notary, newNotary).map { it.serialize() }) MaxLineLength:NotaryChangeTransactions.kt$NotaryChangeWireTransaction$return NotaryChangeLedgerTransaction.create(resolvedInputs, notary, newNotary, id, sigs, resolvedNetworkParameters) @@ -7551,6 +7581,8 @@ MaxLineLength:NotaryServiceFlow.kt$NotaryServiceFlow$"The notary specified on the transaction: [$notary] does not match the notary service's identity: [${service.notaryIdentityKey}] " MaxLineLength:NotaryServiceFlow.kt$NotaryServiceFlow$@Suspendable private MaxLineLength:NotaryServiceFlow.kt$NotaryServiceFlow$abstract + MaxLineLength:NotaryServiceFlow.kt$NotaryServiceFlow$logger.info("Received a notarisation request for Tx [$transactionId] from [${otherSideSession.counterparty.name}]") + MaxLineLength:NotaryServiceFlow.kt$NotaryServiceFlow$logger.info("Transaction [$txId] successfully notarised, sending signature back to [${otherSideSession.counterparty.name}]") MaxLineLength:NotaryServiceTests.kt$NotaryServiceTests$assertThat(notaryError.cause).hasMessageContaining("Transaction for notarisation contains unknown parameters hash: $hash") MaxLineLength:NotaryServiceTests.kt$NotaryServiceTests$assertThat(notaryError.cause).hasMessageContaining("Transaction for notarisation doesn't contain network parameters hash.") MaxLineLength:NotaryServiceTests.kt$NotaryServiceTests.Companion$ fun notariseWithTooManyInputs(node: TestStartedNode, party: Party, notary: Party, network: InternalMockNetwork) @@ -7624,7 +7656,6 @@ MaxLineLength:ObjectSerializer.kt$ComposableObjectReader$"${propertySerializers.size} properties in described type ${typeIdentifier.prettyPrint(false)}" MaxLineLength:ObjectSerializer.kt$ComposableObjectReader$fun readObject(obj: Any, schemas: SerializationSchemas, input: DeserializationInput, context: SerializationContext): Any MaxLineLength:ObjectSerializer.kt$ComposableObjectSerializer$override - MaxLineLength:ObjectSerializer.kt$ComposableObjectWriter$fun writeObject(obj: Any, data: Data, type: Type, output: SerializationOutput, context: SerializationContext, debugIndent: Int) MaxLineLength:ObjectSerializer.kt$EvolutionObjectSerializer$override MaxLineLength:ObjectSerializer.kt$EvolutionObjectSerializer.Companion$ComposableTypePropertySerializer.makeForEvolution(name, isCalculated, property.type.typeIdentifier, type) MaxLineLength:ObjectSerializer.kt$EvolutionObjectSerializer.Companion$val type = localProperty?.type?.observedType ?: property.type.typeIdentifier.getLocalType(classLoader) @@ -7714,12 +7745,13 @@ MaxLineLength:ObligationUtils.kt$ObligationUtils${ val states = statesAndRefs.map { it.state } val obligationIssuer = states.first().data.obligor val obligationOwner = states.first().data.beneficiary requireThat { "all fungible asset states use the same notary" using (assetStatesAndRefs.all { it.state.notary == notary }) "all obligation states are in the normal state" using (statesAndRefs.all { it.state.data.lifecycle == Obligation.Lifecycle.NORMAL }) "all obligation states use the same notary" using (statesAndRefs.all { it.state.notary == notary }) "all obligation states have the same obligor" using (statesAndRefs.all { it.state.data.obligor == obligationIssuer }) "all obligation states have the same beneficiary" using (statesAndRefs.all { it.state.data.beneficiary == obligationOwner }) } // TODO: A much better (but more complex) solution would be to have two iterators, one for obligations, // one for the assets, and step through each in a semi-synced manner. For now however we just bundle all the states // on each side together val issuanceDef = getIssuanceDefinitionOrThrow(statesAndRefs.map { it.state.data }) val template: Obligation.Terms<P> = issuanceDef.product val obligationTotal: Amount<P> = Amount(states.map { it.data }.sumObligations<P>().quantity, template.product) var obligationRemaining: Amount<P> = obligationTotal val assetSigners = HashSet<AbstractParty>() statesAndRefs.forEach { tx.addInputState(it) } // Move the assets to the new beneficiary assetStatesAndRefs.forEach { ref -> if (obligationRemaining.quantity > 0L) { tx.addInputState(ref) val assetState = ref.state.data val amount = Amount(assetState.amount.quantity, assetState.amount.token.product) obligationRemaining -= if (obligationRemaining >= amount) { tx.addOutputState(assetState.withNewOwnerAndAmount(assetState.amount, obligationOwner), Obligation.PROGRAM_ID, notary) amount } else { val change = Amount(obligationRemaining.quantity, assetState.amount.token) // Split the state in two, sending the change back to the previous beneficiary tx.addOutputState(assetState.withNewOwnerAndAmount(change, obligationOwner), Obligation.PROGRAM_ID, notary) tx.addOutputState(assetState.withNewOwnerAndAmount(assetState.amount - change, assetState.owner), Obligation.PROGRAM_ID, notary) Amount(0L, obligationRemaining.token) } assetSigners.add(assetState.owner) } } // If we haven't cleared the full obligation, add the remainder as an output if (obligationRemaining.quantity > 0L) { tx.addOutputState(Obligation.State(Obligation.Lifecycle.NORMAL, obligationIssuer, template, obligationRemaining.quantity, obligationOwner), Obligation.PROGRAM_ID, notary) } else { // Destroy all of the states } // Add the asset move command and obligation settle tx.addCommand(moveCommand, assetSigners.map { it.owningKey }) tx.addCommand(Obligation.Commands.Settle(Amount((obligationTotal - obligationRemaining).quantity, issuanceDef)), obligationIssuer.owningKey) } MaxLineLength:ObservableFold.kt$ fun <A, K> Observable<A>.recordAsAssociation(toKey: (A) -> K, merge: (K, oldValue: A, newValue: A) -> A = { _, _, newValue -> newValue }): ObservableMap<K, A> MaxLineLength:ObservableFold.kt$ fun <T, R> Observable<T>.fold(accumulator: R, folderFun: (R, T) -> Unit): R - MaxLineLength:ObservableUtilities.kt$ fun <A> Collection<ObservableValue<out A>>.sequence(): ObservableList<A> - MaxLineLength:ObservableUtilities.kt$ fun <K : Any, A : Any, B> ObservableList<out A>.associateByAggregation(toKey: (A) -> K, assemble: (K, A) -> B): ObservableMap<K, ObservableList<B>> + MaxLineLength:ObservableUtilities.kt$ @Suppress("UNCHECKED_CAST") fun <A> Collection<ObservableValue<out A>>.sequence(): ObservableList<A> + MaxLineLength:ObservableUtilities.kt$ @Suppress("UNCHECKED_CAST") fun <A> ObservableList<out ObservableValue<out A>>.flatten(): ObservableList<A> + MaxLineLength:ObservableUtilities.kt$ @Suppress("UNCHECKED_CAST") fun <K : Any, A : Any, B> ObservableList<out A>.associateByAggregation(toKey: (A) -> K, assemble: (K, A) -> B): ObservableMap<K, ObservableList<B>> MaxLineLength:ObservableUtilities.kt$ fun <K : Any, A : Any> ObservableList<out A>.associateByAggregation(toKey: (A) -> K): ObservableMap<K, ObservableList<A>> + MaxLineLength:ObservableUtilities.kt$@Suppress("UNCHECKED_CAST") val sourceList = AggregatedList(this, toKey) { key, members -> Pair(key, members) } as AggregatedList<Pair<K, ObservableList<A>>, A, K> MaxLineLength:ObservableUtilities.kt$Pair(left, ChosenList(rightValue.map { it ?: FXCollections.emptyObservableList() }, "ChosenList from leftOuterJoin")) MaxLineLength:ObservableUtilities.kt$net.corda.client.jfx.utils.ObservableUtilities.kt - MaxLineLength:ObservableUtilities.kt$return AssociatedList(AggregatedList(this, toKey) { key, members -> Pair(key, members) }, { it.first }) { key, pair -> pair.second.map { assemble(key, it) } } MaxLineLength:ObservableUtilities.kt${ //TODO This is a tactical work round for an issue with SAM conversion (https://youtrack.jetbrains.com/issue/ALL-1552) so that the M10 explorer works. return uncheckedCast(uncheckedCast<Any, ObservableList<A?>>(this).filtered { t -> t != null }) } MaxLineLength:ObserverNodeTransactionTests.kt$ObserverNodeTransactionTests$StartMessageChainFlow : FlowLogic MaxLineLength:ObserverNodeTransactionTests.kt$ObserverNodeTransactionTests$alice.services.startFlow(SplitMessagesFlow(message, bob.info.singleIdentity(), notary)).resultFuture.getOrThrow() @@ -7762,6 +7794,7 @@ MaxLineLength:OptionalSerializer.kt$OptionalSerializer : Proxy MaxLineLength:OracleNodeTearOffTests.kt$OracleNodeTearOffTests$TransactionBuilder(DUMMY_NOTARY) .withItems(TransactionState(1000.DOLLARS.CASH issuedBy dummyCashIssuer.party ownedBy alice.party, Cash.PROGRAM_ID, DUMMY_NOTARY)) MaxLineLength:OracleNodeTearOffTests.kt$OracleNodeTearOffTests$TransactionState(1000.DOLLARS.CASH issuedBy dummyCashIssuer.party ownedBy alice.party, Cash.PROGRAM_ID, DUMMY_NOTARY) + MaxLineLength:OracleNodeTearOffTests.kt$OracleNodeTearOffTests$mockNet = @Suppress("DEPRECATION") MockNetwork(cordappPackages = listOf("net.corda.finance.contracts", "net.corda.irs")) MaxLineLength:OverridePKSerializerTest.kt$OverridePKSerializerTest.TestPublicKeySerializer$get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates. MaxLineLength:P2PFlowsDrainingModeTest.kt$P2PFlowsDrainingModeTest$driver MaxLineLength:P2PFlowsDrainingModeTest.kt$P2PFlowsDrainingModeTest$nodeA.rpc.hasCancelledDrainingShutdown().doOnError(Throwable::printStackTrace).doOnError { successful = false }.doOnCompleted { successful = true }.doAfterTerminate(latch::countDown).subscribe() @@ -7836,21 +7869,17 @@ MaxLineLength:Perceivable.kt$operator fun Perceivable<BigDecimal>.minus(n: Double) MaxLineLength:Perceivable.kt$operator fun Perceivable<BigDecimal>.times(n: Double) MaxLineLength:PeriodSerializer.kt$PeriodSerializer : Proxy - MaxLineLength:PersistentIdentityMigration.kt$PersistentIdentityMigration$generatedStatements.addAll(MigrationData(oldPkHash, partyAndCertificate).let { listOf(updateHashToIdentityRow(it, dataSource), updateNameToHashRow(it, dataSource)) }) MaxLineLength:PersistentIdentityMigration.kt$PersistentIdentityMigration$return UpdateStatement(dataSource.connection.catalog, dataSource.connection.schema, PUB_KEY_HASH_TO_PARTY_AND_CERT_TABLE) .setWhereClause("pk_hash=?") .addNewColumnValue("pk_hash", migrationData.newPkHash) .addWhereParameter(migrationData.oldPkHash) MaxLineLength:PersistentIdentityMigration.kt$PersistentIdentityMigration$return UpdateStatement(dataSource.connection.catalog, dataSource.connection.schema, X500_NAME_TO_PUB_KEY_HASH_TABLE) .setWhereClause("pk_hash=? AND name=?") .addNewColumnValue("pk_hash", migrationData.newPkHash) .addWhereParameters(migrationData.oldPkHash, migrationData.x500.toString()) MaxLineLength:PersistentIdentityMigration.kt$PersistentIdentityMigration$val partyAndCertificate = PartyAndCertificate(X509CertificateFactory().delegate.generateCertPath(identityBytes.inputStream())) MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentitiesMigrationSchema - MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentitiesMigrationSchemaV1 : MappedSchema MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable : CordaMigration + MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable$logger.error("Cannot migrate persistent identities: Liquibase failed to provide a suitable database connection") MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable$logger.info("Migrating persistent identities with certificates table into persistent table with no certificate data.") - MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable$throw PersistentIdentitiesMigrationException("Cannot migrate persistent states as liquibase failed to provide a suitable database connection") - MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable$val name = PartyAndCertificate(X509CertificateFactory().delegate.generateCertPath(partyBytes.inputStream())).party.name - MaxLineLength:PersistentIdentityMigrationNewTable.kt$TestIdentity + MaxLineLength:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable$throw PersistentIdentitiesMigrationException("Cannot migrate persistent identities as liquibase failed to provide a suitable database connection") MaxLineLength:PersistentIdentityMigrationNewTableTest.kt$PersistentIdentityMigrationNewTableTest$notaryServices = MockServices(listOf("net.corda.finance.contracts"), dummyNotary, identityService, dummyCashIssuer.keyPair, BOC_KEY) MaxLineLength:PersistentIdentityMigrationNewTableTest.kt$PersistentIdentityMigrationNewTableTest$session.save(PersistentIdentityService.PersistentPublicKeyHashToCertificate(it.owningKey.hash.toString(), it.certPath.encoded)) MaxLineLength:PersistentIdentityMigrationNewTableTest.kt$PersistentIdentityMigrationNewTableTest$val identityService = makeTestIdentityService(PersistentIdentityMigrationNewTableTest.dummyNotary.identity, BOB_IDENTITY, ALICE_IDENTITY) - MaxLineLength:PersistentIdentityMigrationNewTableTest.kt$PersistentIdentityMigrationNewTableTest${ /** * TODO - We have to mock every statement/ result to test this properly. * * The workaround for now is the [PersistentIdentitiesMigration.addTestMapping] and * [PersistentIdentitiesMigration.deleteTestMapping] methods that allow us to see the migration occur properly during debugging. * * Since [PersistentIdentitiesMigration] implements [CordaMigration] the migration will run when the DB is setup. */ PersistentIdentityMigrationNewTable() } MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$ @Throws(CertificateExpiredException::class, CertificateNotYetValidException::class, InvalidAlgorithmParameterException::class) private fun verifyAndRegisterIdentity(trustAnchor: TrustAnchor, identity: PartyAndCertificate): PartyAndCertificate? MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$/** Stores notary identities obtained from the network parameters, for which we don't need to perform a database lookup. */ private val notaryIdentityCache = HashSet<Party>() MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$// Allows us to eliminate keys we know belong to others by using the cache contents that might have been seen during other identity activity. // Concentrating activity on the identity cache works better than spreading checking across identity and key management, because we cache misses too. fun stripNotOurKeys(keys: Iterable<PublicKey>): Iterable<PublicKey> @@ -7859,20 +7888,26 @@ MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$@Throws(UnknownAnonymousPartyException::class) override MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$_caCertStore = CertStore.getInstance("Collection", CollectionCertStoreParameters(caCertificates.toSet() + trustRoot)) MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$fun loadIdentities(identities: Collection<PartyAndCertificate> = emptySet(), confidentialIdentities: Collection<PartyAndCertificate> = emptySet()) - MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$fun start(trustRoot: X509Certificate, caCertificates: List<X509Certificate> = emptyList(), notaryIdentities: List<Party> = emptyList()) MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$it.filter { x500Matches(query, exactMatch, it.first) }.map { keyToPartyAndCert[it.second]!!.party }.toSet() MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$log.warn("Certificate validation failed for ${identity.name} against trusted root ${trustAnchor.trustedCert.subjectX500Principal}.") - MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$throw IllegalArgumentException("The public key ${key.hash} is already assigned to a different party than the supplied .") - MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService${ // If there is no entry in the legal keyToPartyAndCert table then the party must be a confidential identity so we perform // a lookup in the keyToName table. If an entry for that public key exists, then we attempt val name = keyToName[party.owningKey.toStringShort()] if (name != null) { wellKnownPartyFromX500Name(name) } else { null } } - MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService${ // Skip database lookup if the party is a notary identity. // This also prevents an issue where the notary identity can't be resolved if it's not in the network map cache. The node obtains // a trusted list of notary identities from the network parameters automatically. return if (party is Party && party in notaryIdentityCache) { party } else { database.transaction { // Try and resolve the party from the table to public keys to party and certificates // If we cannot find it then we perform a lookup on the public key to X500 name table val legalIdentity = super.wellKnownPartyFromAnonymous(party) if (legalIdentity == null) { // If there is no entry in the legal keyToPartyAndCert table then the party must be a confidential identity so we perform // a lookup in the keyToName table. If an entry for that public key exists, then we attempt val name = keyToName[party.owningKey.toStringShort()] if (name != null) { wellKnownPartyFromX500Name(name) } else { null } } else { legalIdentity } } } } + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$throw IllegalStateException("The public publicKey $publicKeyHash is already assigned to a different party than the " + "supplied party.") + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService$val publicKeyHash = publicKey.toStringShort() // EVERY key should be mapped to a Party in the "keyToName" table. Therefore if there is already a record in that table for the // specified key then it's either our key which has been stored prior or another node's key which we have previously mapped. val existingEntryForKey = keyToName[publicKeyHash] if (existingEntryForKey == null) { // Update the three tables as necessary. We definitely store the public key and map it to a party and we optionally update // the public key to external ID mapping table. This block will only ever be reached when registering keys generated on // other because when a node generates its own keys "registerKeyToParty" is automatically called by KeyManagementService.freshKey. registerKeyToParty(publicKey, party) hashToKey[publicKeyHash] = publicKey if (externalId != null) { registerKeyToExternalId(publicKey, externalId) } } else { log.info("An existing entry for $publicKeyHash already exists.") if (party.name != existingEntryForKey) { throw IllegalStateException("The public publicKey $publicKeyHash is already assigned to a different party than the " + "supplied party.") } } + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService${ // If the externalId was created by this node then we'll find the keys in the KMS, otherwise they'll be in the IdentityService. val keys = publicKeysForExternalId(externalId, BasicHSMKeyManagementService.PersistentKey::class.java) return if (keys.isEmpty()) { publicKeysForExternalId(externalId, PersistentHashToPublicKey::class.java) } else { keys } } + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService${ // If there is no entry in the legal keyToPartyAndCert table then the party must be a confidential identity so we perform // a lookup in the keyToName table. If an entry for that public key exists, then we attempt look up the associated node's // PartyAndCertificate. val name = keyToName[party.owningKey.toStringShort()] if (name != null) { // This should never return null as this node would not be able to communicate with the node providing a confidential // identity unless its NodeInfo/PartyAndCertificate were available. wellKnownPartyFromX500Name(name) } else { null } } + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService${ // Skip database lookup if the party is a notary identity. // This also prevents an issue where the notary identity can't be resolved if it's not in the network map cache. The node obtains // a trusted list of notary identities from the network parameters automatically. return if (party is Party && party in notaryIdentityCache) { party } else { database.transaction { // Try and resolve the party from the table to public keys to party and certificates // If we cannot find it then we perform a lookup on the public key to X500 name table val legalIdentity = super.wellKnownPartyFromAnonymous(party) if (legalIdentity == null) { // If there is no entry in the legal keyToPartyAndCert table then the party must be a confidential identity so we perform // a lookup in the keyToName table. If an entry for that public key exists, then we attempt look up the associated node's // PartyAndCertificate. val name = keyToName[party.owningKey.toStringShort()] if (name != null) { // This should never return null as this node would not be able to communicate with the node providing a confidential // identity unless its NodeInfo/PartyAndCertificate were available. wellKnownPartyFromX500Name(name) } else { null } } else { legalIdentity } } } } + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService${ // This should never return null as this node would not be able to communicate with the node providing a confidential // identity unless its NodeInfo/PartyAndCertificate were available. wellKnownPartyFromX500Name(name) } + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService${ // Update the three tables as necessary. We definitely store the public key and map it to a party and we optionally update // the public key to external ID mapping table. This block will only ever be reached when registering keys generated on // other because when a node generates its own keys "registerKeyToParty" is automatically called by KeyManagementService.freshKey. registerKeyToParty(publicKey, party) hashToKey[publicKeyHash] = publicKey if (externalId != null) { registerKeyToExternalId(publicKey, externalId) } } MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService.Companion$PartyAndCertificate(X509CertificateFactory().delegate.generateCertPath(it.identity.inputStream())) + MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService.Companion$fun createHashToKeyMap(cacheFactory: NamedCacheFactory): AppendOnlyPersistentMap<String, PublicKey, PersistentHashToPublicKey, String> MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService.Companion$fun createKeyToPartyAndCertMap(cacheFactory: NamedCacheFactory): AppendOnlyPersistentMap<String, PartyAndCertificate, PersistentPublicKeyHashToCertificate, String> MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService.Companion$fun createKeyToX500Map(cacheFactory: NamedCacheFactory): AppendOnlyPersistentMap<String, CordaX500Name, PersistentPublicKeyHashToParty, String> MaxLineLength:PersistentIdentityService.kt$PersistentIdentityService.Companion$fun createX500ToKeyMap(cacheFactory: NamedCacheFactory): AppendOnlyPersistentMap<CordaX500Name, String, PersistentPartyToPublicKeyHash, String> MaxLineLength:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests$ @Test fun `assert ownership`() MaxLineLength:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests$ @Test fun `get anonymous identity by key`() + MaxLineLength:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests$identityService.start(DEV_ROOT_CA.certificate, pkToIdCache = PublicKeyToOwningIdentityCacheImpl(database, cacheFactory)) MaxLineLength:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests$listOf("Organisation A", "Organisation B", "Organisation C") .map { getTestPartyAndCertificate(CordaX500Name(organisation = it, locality = "London", country = "GB"), generateKeyPair().public) } MaxLineLength:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests$val alicente = getTestPartyAndCertificate(CordaX500Name(organisation = "Alicente Worldwide", locality = "London", country = "GB"), generateKeyPair().public) + MaxLineLength:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests$val bobReload = @Suppress("DEPRECATION") newPersistentIdentityService.certificateFromKey(anonymousBob.party.owningKey) MaxLineLength:PersistentMap.kt$PersistentMap$ExplicitRemoval<K, V, E, EK> : RemovalListener MaxLineLength:PersistentMap.kt$PersistentMap$cache.getAll(session.createQuery(criteriaQuery).resultList.map { e -> fromPersistentEntity(e as E).first }.asIterable()) MaxLineLength:PersistentMap.kt$PersistentMap${ // This happens when the key was queried before with no value associated. We invalidate the cached null // value and recursively call set again. This is to avoid race conditions where another thread queries after // the invalidate but before the set. cache.invalidate(key) return set(key, value) } @@ -8270,12 +8305,14 @@ MaxLineLength:ReceiveTransactionFlow.kt$ReceiveTransactionFlow$private val statesToRecord: StatesToRecord = StatesToRecord.NONE MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps : AutoCloseableInternalCordaRPCOps MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps$ fun runFlowWithLogicalRetry(runFlow: (CordaRPCOps) -> StateMachineRunId, hasFlowStarted: (CordaRPCOps) -> Boolean, onFlowConfirmed: () -> Unit = {}, timeout: Duration = 4.seconds) + MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps$ReconnectingRPCConnection(listOf(nodeHostAndPort), username, password, rpcConfiguration, sslConfiguration, classLoader) + MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps$ReconnectingRPCConnection(nodeHostAndPorts, username, password, rpcConfiguration, sslConfiguration, classLoader, gracefulReconnect) MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.Companion$private MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ErrorInterceptingHandler$log.error("Node is being shutdown. Operation ${method.name} rejected. Retrying when node is up...", e) MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ErrorInterceptingHandler$private - MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ReconnectingRPCConnection$CurrentState.CONNECTING, CurrentState.DIED -> throw IllegalArgumentException("Illegal state: $currentState ") MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ReconnectingRPCConnection$attemptedAddress MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ReconnectingRPCConnection$private tailrec + MaxLineLength:ReconnectingCordaRPCOps.kt$ReconnectingCordaRPCOps.ReconnectingRPCConnection${ if (previousConnection != currentRPCConnection) { // We've already done this, skip return } // First one to get here gets to do all the reconnect logic, including calling onDisconnect and onReconnect. This makes sure // that they're only called once per reconnect. currentState = DIED gracefulReconnect?.onDisconnect?.invoke() //TODO - handle error cases log.error("Reconnecting to ${this.nodeHostAndPorts} due to error: ${e.message}") log.debug("", e) connect() previousConnection?.forceClose() gracefulReconnect?.onReconnect?.invoke() } MaxLineLength:ReconnectingObservable.kt$ReconnectingObservable.ReconnectingSubscriber$backingSubscription = dataFeed.updates.subscribe(subscriber::onNext, ::scheduleResubscribe, subscriber::onCompleted) MaxLineLength:ReferenceInputStateTests.kt$ReferenceStateTests$networkParameters = testNetworkParameters(minimumPlatformVersion = 4, notaries = listOf(NotaryInfo(DUMMY_NOTARY, true))) MaxLineLength:ReferenceInputStateTests.kt$ReferenceStateTests$output(ExampleContract::class.java.typeName, "UPDATED REF DATA", "REF DATA".output<ExampleState>().copy(data = "NEW STUFF!")) @@ -8309,7 +8346,6 @@ MaxLineLength:RemoteTypeInformation.kt$RemoteTypeInformation.Parameterised$data MaxLineLength:RemoteTypeInformation.kt$RemoteTypeInformation.Unparameterised$data MaxLineLength:RemoteTypeInformation.kt$RemoteTypeInformationPrettyPrinter$private data - MaxLineLength:ReplayedList.kt$ReplayedList<A> : TransformationList MaxLineLength:Reporter.kt$ObjectName("$domain:type=$category,${if (component.isNotEmpty()) "component=$component," else ""}name=$subName") MaxLineLength:RequiresDb.kt$RequiresDb MaxLineLength:RequiresDb.kt$RequiresSql @@ -8369,10 +8405,6 @@ MaxLineLength:RpcExceptionHandlingTest.kt$RpcExceptionHandlingTest$assertThatThrownBy { devModeNode.throwExceptionFromFlow() } MaxLineLength:RpcExceptionHandlingTest.kt$RpcExceptionHandlingTest$assertThatThrownBy { node.throwExceptionFromFlow() } MaxLineLength:RpcExceptionHandlingTest.kt$RpcExceptionHandlingTest$assertThatThrownBy { scenario(ALICE_NAME, BOB_NAME,true) } - MaxLineLength:RpcExceptions.kt$DuplicateAttachmentException : FileAlreadyExistsExceptionClientRelevantError - MaxLineLength:RpcExceptions.kt$InternalNodeException : CordaRuntimeExceptionClientRelevantErrorIdentifiableException - MaxLineLength:RpcExceptions.kt$NonRpcFlowException : IllegalArgumentExceptionClientRelevantError - MaxLineLength:RpcExceptions.kt$OutdatedNetworkParameterHashException : CordaRuntimeExceptionClientRelevantError MaxLineLength:RpcExceptions.kt$OutdatedNetworkParameterHashException.Companion$private const val TEMPLATE = "Refused to accept parameters with hash %s because network map advertises update with hash %s. Please check newest version" MaxLineLength:RpcFlowsDrainingModeTest.kt$RpcFlowsDrainingModeTest$driver MaxLineLength:RpcHelpers.kt$return Observable.interval(interval, unit).map { isWaitingForShutdown() }.takeFirst { waiting -> waiting == false }.map { Unit } @@ -8386,7 +8418,9 @@ MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$fun startProxy(addressPair: AddressPair) MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$log.info("Timed out waiting for confirmation that all flows have started. Remaining flows: ${flowsCountdownLatch.count}") MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$log.info("vault update produced ${update.produced.map { it.state.data.amount }} consumed ${update.consumed.map { it.ref }}") - MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$val bankAReconnectingRpc = client.start(demoUser.username, demoUser.password, gracefulReconnect = true).proxy as ReconnectingCordaRPCOps + MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$maxStackOccurrences.set(max(maxStackOccurrences.get(), currentStackTrace().count { it.methodName == "reconnectOnError" })) + MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$numReconnects++ // We only expect to see a single reconnectOnError in the stack trace. Otherwise we're in danger of stack overflow recursion maxStackOccurrences.set(max(maxStackOccurrences.get(), currentStackTrace().count { it.methodName == "reconnectOnError" })) Unit + MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$val bankAReconnectingRpc = client.start(demoUser.username, demoUser.password, gracefulReconnect = reconnect).proxy as ReconnectingCordaRPCOps MaxLineLength:RpcReconnectTests.kt$RpcReconnectTests$val criteria = QueryCriteria.VaultCustomQueryCriteria(builder { CashSchemaV1.PersistentCashState::pennies.equal(amount.toLong() * 100) }, status = Vault.StateStatus.ALL) MaxLineLength:RpcServerObservableSerializer.kt$RpcServerObservableSerializer.<no name provided>$observableContext.clientAddressToObservables MaxLineLength:RpcServerObservableSerializerTests.kt$RpcServerObservableSerializerTests$val subMap: Cache<Trace.InvocationId, ObservableSubscription> = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES) .maximumSize(100) .build() @@ -8524,7 +8558,7 @@ MaxLineLength:SerializationHelper.kt$CommonPropertyNames MaxLineLength:SerializationOutput.kt$SerializationOutput$ @Throws(NotSerializableException::class) fun <T : Any> serialize(obj: T, context: SerializationContext): SerializedBytes<T> MaxLineLength:SerializationOutput.kt$SerializationOutput$writeObject(obj, data, if (type == TypeIdentifier.UnknownType.getLocalType()) obj.javaClass else type, context, debugIndent) - MaxLineLength:SerializationOutput.kt$SerializationOutput${ serializer.writeObject(obj, data, type, this, context, debugIndent) // Important to do it after serialization such that dependent object will have preceding reference numbers // assigned to them first as they will be first read from the stream on receiving end. // Skip for primitive types as they are too small and overhead of referencing them will be much higher than their content if (suitableForObjectReference(obj.javaClass)) { objectHistory[obj] = objectHistory.size } } + MaxLineLength:SerializationOutput.kt$SerializationOutput${ serializer.writeObject(obj, data, type, this, context, debugIndent) // Important to do it after serialization such that dependent object will have preceding reference numbers // assigned to them first as they will be first read from the stream on receiving end. // Skip for primitive types as they are too small and overhead of referencing them will be much higher than their content if (serializerFactory.isSuitableForObjectReference(obj.javaClass)) { objectHistory[obj] = objectHistory.size } } MaxLineLength:SerializationOutputTests.kt$SerializationOutputTests$assertArrayEquals(data, DeserializationInput(factory).deserialize(compressed, testSerializationContext.withEncodingWhitelist(encodingWhitelist))) MaxLineLength:SerializationOutputTests.kt$SerializationOutputTests$assertThat(des.deserialize(OpaqueBytes(copy), NonZeroByte::class.java, testSerializationContext.withEncodingWhitelist(encodingWhitelist)).value).isEqualTo(3) MaxLineLength:SerializationOutputTests.kt$SerializationOutputTests$catchThrowable { input.deserialize(compressed, testSerializationContext.withEncodingWhitelist(encodingWhitelist)) } @@ -8604,8 +8638,6 @@ MaxLineLength:SessionRejectException.kt$SessionRejectException$UnknownClass : SessionRejectException MaxLineLength:SetsSerializationTest.kt$net.corda.serialization.internal.SetsSerializationTest.kt MaxLineLength:Settings.kt$Settings$clientPane.disableProperty() .map { if (!it) FontAwesomeIconView(FontAwesomeIcon.TIMES) else FontAwesomeIconView(FontAwesomeIcon.EDIT) } - MaxLineLength:SharedMemoryIncremental.kt$SharedMemoryIncremental$file: File = File(System.getProperty("user.home"), "corda-$startPort-to-$endPort-port-allocator.bin") - MaxLineLength:SharedMemoryIncremental.kt$SharedMemoryIncremental$mb = backingFile.channel.map(FileChannel.MapMode.READ_WRITE, 0, 16) MaxLineLength:ShellCmdLineOptions.kt$ShellCmdLineOptions$description = ["The path to the directory containing CorDapp JARs, CorDapps are required when starting flows."] MaxLineLength:ShellCmdLineOptions.kt$ShellCmdLineOptions$description = ["The path to the shell configuration file, used instead of providing the rest of command line options."] MaxLineLength:ShellCmdLineOptions.kt$ShellConfigurationFile.ShellConfigFile$sshHostKeyDirectory = extensions?.sshd?.let { if (it.enabled && it.hostkeypath != null) Paths.get(it.hostkeypath) else null } @@ -8681,7 +8713,6 @@ MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$ #See https://docs.corda.net/head/testing.html#running-tests-in-intellij - 'Fiber classes not instrumented' for more details. MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$ override fun stop(allowedUnsuspendedFiberCount: Int) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$"""Missing the '-javaagent' JVM argument. Make sure you run the tests with the Quasar java agent attached to your JVM. #See https://docs.corda.net/head/testing.html#running-tests-in-intellij - 'Fiber classes not instrumented' for more details.""" - MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$CheckpointSerializeAsTokenContextImpl(tokenizableServices, CheckpointSerializationDefaults.CHECKPOINT_SERIALIZER, CheckpointSerializationDefaults.CHECKPOINT_CONTEXT, serviceHub) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$DataFeed(flows.values.map { it.fiber.logic }, changesPublisher.bufferUntilSubscribed().wrapWithDatabaseTransaction(database)) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$changesPublisher.onNext(StateMachineManager.Change.Removed(lastState.flowLogic, Try.Failure<Nothing>(exception))) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$changesPublisher.onNext(StateMachineManager.Change.Removed(lastState.flowLogic, Try.Success(removalReason.flowReturnValue))) @@ -8690,10 +8721,10 @@ MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$is ExistingSessionMessage -> onExistingSessionMessage(sessionMessage, event.deduplicationHandler, sender) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$is InitiatedFlowFactory.CorDapp -> FlowInfo(initiatedFlowFactory.flowVersion, initiatedFlowFactory.appName) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$logger.debug { "Ignoring request to set time-out on timed flow $flowId to $timeoutSeconds seconds which is shorter than default of ${serviceHub.configuration.flowTimeout.timeout.seconds} seconds." } - MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$logger.debug("Unable to kill a flow unknown to physical node. Might be processed by another physical node.") - MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$logger.error("Unable to deserialize database checkpoint for flow $flowId. Something is very wrong. The flow will not retry.") + MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$logger.error("Unable to deserialize checkpoint for flow $flowId. Something is very wrong and this flow will be ignored.", e) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$logger.error("Unable to find database checkpoint for flow $flowId. Something is very wrong. The flow will not retry.") MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private + MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private inline MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private val fiberDeserializationChecker = if (serviceHub.configuration.shouldCheckCheckpoints()) FiberDeserializationChecker() else null MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$require(lastState.pendingDeduplicationHandlers.isEmpty()) { "Flow cannot be removed until all pending deduplications have completed" } MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$return serviceHub.getFlowFactory(initiatorFlowClass) ?: throw SessionRejectException.NotRegistered(initiatorFlowClass) @@ -8704,6 +8735,8 @@ MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$val frozenFlowLogic = (flowLogic as FlowLogic<*>).checkpointSerialize(context = checkpointSerializationContext!!) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$val future = startFlow(event.flowLogic, event.context, ourIdentity = null, deduplicationHandler = event.deduplicationHandler) MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$val timeoutDelaySeconds = timeout.seconds * Math.pow(backoffBase, min(retryCount, maxRestartCount).toDouble()).toLong() + MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager${ // It may be that the id refers to a checkpoint that couldn't be deserialised into a flow, so we delete it if it exists. database.transaction { checkpointStorage.removeCheckpoint(id) } } + MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager${ // We intentionally grab the checkpoint from storage rather than relying on the one referenced by currentState. This is so that // we mirror exactly what happens when restarting the node. val serializedCheckpoint = checkpointStorage.getCheckpoint(flowId) if (serializedCheckpoint == null) { logger.error("Unable to find database checkpoint for flow $flowId. Something is very wrong. The flow will not retry.") return } // Resurrect flow createFlowFromCheckpoint( id = flowId, serializedCheckpoint = serializedCheckpoint, initialDeduplicationHandler = null, isAnyCheckpointPersisted = true, isStartIdempotent = false ) ?: return } MaxLineLength:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager${ val flowId = StateMachineRunId.createRandom() // Before we construct the state machine state by freezing the FlowLogic we need to make sure that lazy properties // have access to the fiber (and thereby the service hub) val flowStateMachineImpl = FlowStateMachineImpl(flowId, flowLogic, scheduler) val resultFuture = openFuture<Any?>() flowStateMachineImpl.transientValues = TransientReference(createTransientValues(flowId, resultFuture)) flowLogic.stateMachine = flowStateMachineImpl val frozenFlowLogic = (flowLogic as FlowLogic<*>).checkpointSerialize(context = checkpointSerializationContext!!) val flowCorDappVersion = createSubFlowVersion(serviceHub.cordappProvider.getCordappForFlow(flowLogic), serviceHub.myInfo.platformVersion) val initialCheckpoint = Checkpoint.create( invocationContext, flowStart, flowLogic.javaClass, frozenFlowLogic, ourIdentity, flowCorDappVersion, flowLogic.isEnabledTimedFlow() ).getOrThrow() val startedFuture = openFuture<Unit>() val initialState = StateMachineState( checkpoint = initialCheckpoint, pendingDeduplicationHandlers = deduplicationHandler?.let { listOf(it) } ?: emptyList(), isFlowResumed = false, isTransactionTracked = false, isAnyCheckpointPersisted = false, isStartIdempotent = isStartIdempotent, isRemoved = false, flowLogic = flowLogic, senderUUID = ourSenderUUID ) flowStateMachineImpl.transientState = TransientReference(initialState) mutex.locked { startedFutures[flowId] = startedFuture } totalStartedFlows.inc() addAndStartFlow(flowId, Flow(flowStateMachineImpl, resultFuture)) return startedFuture.map { flowStateMachineImpl as FlowStateMachine<A> } } MaxLineLength:SingletonSerializer.kt$SingletonSerializer : AMQPSerializer MaxLineLength:SingletonSerializer.kt$SingletonSerializer$internal val typeNotation: TypeNotation = RestrictedType(type.typeName, "Singleton", generateProvides(), "boolean", Descriptor(typeDescriptor), emptyList()) @@ -8817,7 +8850,8 @@ MaxLineLength:StateMachineState.kt$SubFlowVersion$CorDappFlow : SubFlowVersion MaxLineLength:StatePointer.kt$LinearPointer$// Here either one of two things has happened: // 1. The pointed-to state has not been seen by the resolver node. It is unlikely that this is the case. // The state can probably be obtained via subscribing to the data distribution group which created and // and maintains this data. // 2. Uh oh... The pointed-to state has been exited from the ledger! // It is unlikely this would ever happen as most reference data states will be created such that they cannot // be exited from the ledger. At this point there are two options; use an old consumed version of the state, // or don't use it at all. "The LinearState with ID ${pointer.id} is unknown to this node or it has been exited from the ledger." MaxLineLength:StatePointer.kt$LinearPointer<T : LinearState> : StatePointer - MaxLineLength:StatePointer.kt$StaticPointer<T : ContractState> : StatePointer + MaxLineLength:StatePointer.kt$StatePointer.Companion$ inline fun <reified T : ContractState> staticPointer( stateAndRef: StateAndRef<T>, isResolved: Boolean = false ) + MaxLineLength:StatePointer.kt$StatePointer.Companion$ inline fun <reified T : LinearState> linearPointer( state: T, isResolved: Boolean = true ) MaxLineLength:StateRevisionFlow.kt$StateRevisionFlow.Receiver$open MaxLineLength:StateRevisionFlow.kt$StateRevisionFlow.Requester$updatedData: T MaxLineLength:StateSummingUtilities.kt$ fun <P : Any> Iterable<ContractState>.sumObligations(): Amount<Issued<Obligation.Terms<P>>> @@ -8873,7 +8907,7 @@ MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesException : FlowException MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesFlow : FlowLogic MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesFlow$@Deprecated("It is unsafe to use this constructor as it requires nodes to automatically vend anonymous identities without first " + "checking if they should. Instead, use the constructor that takes in an existing FlowSession.") - MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesFlow$@Deprecated("It is unsafe to use this constructor as it requires nodes to automatically vend anonymous identities without first " + "checking if they should. Instead, use the constructor that takes in an existing FlowSession.") constructor(otherParty: Party, revocationEnabled: Boolean, progressTracker: ProgressTracker) : this(null, otherParty, progressTracker) + MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesFlow$@Deprecated("It is unsafe to use this constructor as it requires nodes to automatically vend anonymous identities without first " + "checking if they should. Instead, use the constructor that takes in an existing FlowSession.") constructor(otherParty: Party, @Suppress("UNUSED_PARAMETER") revocationEnabled: Boolean, progressTracker: ProgressTracker) : this(null, otherParty, progressTracker) MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesFlow$@JvmOverloads constructor(otherSideSession: FlowSession, progressTracker: ProgressTracker = tracker()) : this(otherSideSession, null, progressTracker) MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesFlow$logger MaxLineLength:SwapIdentitiesFlow.kt$SwapIdentitiesFlow$val theirAnonymousIdentity = session.sendAndReceive<IdentityWithSignature>(ourIdentWithSig).unwrap { theirIdentWithSig -> progressTracker.currentStep = VERIFYING_IDENTITY validateAndRegisterIdentity(serviceHub, session.counterparty, theirIdentWithSig.identity.deserialize(), theirIdentWithSig.signature) } @@ -9026,7 +9060,7 @@ MaxLineLength:TransactionBuilder.kt$TransactionBuilder$ private fun attachmentConstraintsTransition( constraints: Set<AttachmentConstraint>, attachmentToUse: ContractAttachment, services: ServicesForResolution ): AttachmentConstraint MaxLineLength:TransactionBuilder.kt$TransactionBuilder$ private fun handleContract( contractClassName: ContractClassName, inputStates: List<TransactionState<ContractState>>?, outputStates: List<TransactionState<ContractState>>?, explicitContractAttachment: AttachmentId?, services: ServicesForResolution ): Pair<AttachmentId, List<TransactionState<ContractState>>?> MaxLineLength:TransactionBuilder.kt$TransactionBuilder$ private fun selectAttachmentConstraint( contractClassName: ContractClassName, inputStates: List<TransactionState<ContractState>>?, attachmentToUse: ContractAttachment, services: ServicesForResolution): AttachmentConstraint - MaxLineLength:TransactionBuilder.kt$TransactionBuilder$ private fun selectContractAttachmentsAndOutputStateConstraints( services: ServicesForResolution, serializationContext: SerializationContext?): Pair<Collection<SecureHash>, List<TransactionState<ContractState>>> + MaxLineLength:TransactionBuilder.kt$TransactionBuilder$ private fun selectContractAttachmentsAndOutputStateConstraints( services: ServicesForResolution, @Suppress("UNUSED_PARAMETER") serializationContext: SerializationContext? ): Pair<Collection<SecureHash>, List<TransactionState<ContractState>>> MaxLineLength:TransactionBuilder.kt$TransactionBuilder$"An attachment has been explicitly set for contract $contractClassName in the transaction builder which conflicts with the HashConstraint of a state." MaxLineLength:TransactionBuilder.kt$TransactionBuilder$"Transaction was built with $contractClassName states with multiple HashConstraints. This is illegal, because it makes it impossible to validate with a single version of the contract code." MaxLineLength:TransactionBuilder.kt$TransactionBuilder$(allContractAttachments + attachments).toSortedSet().toList() @@ -9053,7 +9087,6 @@ MaxLineLength:TransactionBuilder.kt$TransactionBuilder$require(outputConstraint.isSatisfiedBy(constraintAttachment)) { "Output state constraint check fails. $outputConstraint" } MaxLineLength:TransactionBuilder.kt$TransactionBuilder$require(signatureConstraint.isSatisfiedBy(attachment)) { "Selected output constraint: $signatureConstraint not satisfying ${attachment.id}" } MaxLineLength:TransactionBuilder.kt$TransactionBuilder$rootError is ClassNotFoundException -> addMissingAttachment((rootError.message ?: throw e).replace(".", "/"), services, e) - MaxLineLength:TransactionBuilder.kt$TransactionBuilder$services: ServicesForResolution MaxLineLength:TransactionBuilder.kt$TransactionBuilder$throw IllegalArgumentException("Attempting to create an illegal transaction. Please install the latest signed version for the $attachmentToUse Cordapp.") MaxLineLength:TransactionBuilder.kt$TransactionBuilder$throw IllegalArgumentException("Can't mix the AlwaysAcceptAttachmentConstraint with a secure constraint in the same transaction. This can be used to hide insecure transitions.") MaxLineLength:TransactionBuilder.kt$TransactionBuilder$throw IllegalArgumentException("Cannot mix SignatureAttachmentConstraints signed by different parties in the same transaction.") @@ -9155,7 +9188,6 @@ MaxLineLength:TransactionTests.kt$TransactionTests$val keySigs = keys.map { it.sign(SignableData(wtx.id, SignatureMetadata(1, Crypto.findSignatureScheme(it.public).schemeNumberID))) } MaxLineLength:TransactionTests.kt$TransactionTests$val outputState = TransactionState(DummyContract.SingleOwnerState(0, ALICE), DummyContract.PROGRAM_ID, DUMMY_NOTARY) MaxLineLength:TransactionUtils.kt$ fun <T : Any> deserialiseComponentGroup(componentGroups: List<ComponentGroup>, clazz: KClass<T>, groupEnum: ComponentGroupEnum, forceDeserialize: Boolean = false, factory: SerializationFactory = SerializationFactory.defaultFactory, context: SerializationContext = factory.defaultContext): List<T> - MaxLineLength:TransactionUtils.kt$ fun isAttachmentTrusted(attachment: Attachment, service: AttachmentStorage?): Boolean MaxLineLength:TransactionUtils.kt$"Invalid Transaction. Sizes of CommandData (${commandDataList.size}) and Signers (${signersList.size}) do not match" MaxLineLength:TransactionUtils.kt$ContractUpgradeTransactionBuilder$val components = listOf(inputs, notary, legacyContractAttachmentId, upgradedContractClassName, upgradedContractAttachmentId, networkParametersHash).map { it.serialize() } MaxLineLength:TransactionUtils.kt$SerializedStateAndRef$@KeepForDJVM data @@ -9396,6 +9428,7 @@ MaxLineLength:V1NodeConfigurationSpec.kt$V1NodeConfigurationSpec$flowMonitorSuspensionLoggingThresholdMillis = configuration[flowMonitorSuspensionLoggingThresholdMillis] MaxLineLength:V1NodeConfigurationSpec.kt$V1NodeConfigurationSpec$private val additionalNodeInfoPollingFrequencyMsec by long().optional().withDefaultValue(Defaults.additionalNodeInfoPollingFrequencyMsec) MaxLineLength:V1NodeConfigurationSpec.kt$V1NodeConfigurationSpec$private val additionalP2PAddresses by string().mapValid(::toNetworkHostAndPort).list().optional().withDefaultValue(Defaults.additionalP2PAddresses) + MaxLineLength:V1NodeConfigurationSpec.kt$V1NodeConfigurationSpec$private val blacklistedAttachmentSigningKeys by string().list().optional().withDefaultValue(Defaults.blacklistedAttachmentSigningKeys) MaxLineLength:V1NodeConfigurationSpec.kt$V1NodeConfigurationSpec$private val certificateChainCheckPolicies by nested(CertChainPolicyConfigSpec).list().optional().withDefaultValue(Defaults.certificateChainCheckPolicies) MaxLineLength:V1NodeConfigurationSpec.kt$V1NodeConfigurationSpec$private val cordappSignerKeyFingerprintBlacklist by string().list().optional().withDefaultValue(Defaults.cordappSignerKeyFingerprintBlacklist) MaxLineLength:V1NodeConfigurationSpec.kt$V1NodeConfigurationSpec$private val extraNetworkMapKeys by string().mapValid(::toUUID).list().optional().withDefaultValue(Defaults.extraNetworkMapKeys) @@ -9698,7 +9731,6 @@ MaxLineLength:WhitelistGeneratorTest.kt$WhitelistGeneratorTest$val whitelist = generateWhitelist(emptyMap(), emptyList(), listOf(TestContractsJar(contractClassNames = emptyList()))) MaxLineLength:WireTransaction.kt$WireTransaction : TraversableTransaction MaxLineLength:WireTransaction.kt$WireTransaction$( inputs: List<StateRef>, attachments: List<SecureHash>, outputs: List<TransactionState<ContractState>>, commands: List<Command<*>>, notary: Party?, timeWindow: TimeWindow?, privacySalt: PrivacySalt = PrivacySalt() ) - MaxLineLength:WireTransaction.kt$WireTransaction$( resolveIdentity, resolveAttachment, { stateRef -> resolveStateRef(stateRef)?.serialize() }, { null }, // Returning a dummy `missingAttachment` Attachment allows this deprecated method to work and it disables "contract version no downgrade rule" as a dummy Attachment returns version 1 { resolveAttachment(it.txhash) ?: missingAttachment }, { isAttachmentTrusted(it, null) } ) MaxLineLength:WireTransaction.kt$WireTransaction$/** * Builds whole Merkle tree for a transaction. * Briefly, each component group has its own sub Merkle tree and all of the roots of these trees are used as leaves * in a top level Merkle tree. * Note that ordering of elements inside a [ComponentGroup] matters when computing the Merkle root. * On the other hand, insertion group ordering does not affect the top level Merkle tree construction, as it is * actually an ordered Merkle tree, where its leaves are ordered based on the group ordinal in [ComponentGroupEnum]. * If any of the groups is an empty list or a null object, then [SecureHash.allOnesHash] is used as its hash. * Also, [privacySalt] is not a Merkle tree leaf, because it is already "inherently" included via the component nonces. */ val merkleTree: MerkleTree by lazy { MerkleTree.getMerkleTree(groupHashes) } MaxLineLength:WireTransaction.kt$WireTransaction$/** * Calculate nonces for every transaction component, including new fields (due to backwards compatibility support) we cannot process. * Nonce are computed in the following way: * nonce1 = H(salt || path_for_1st_component) * nonce2 = H(salt || path_for_2nd_component) * etc. * Thus, all of the nonces are "independent" in the sense that knowing one or some of them, you can learn * nothing about the rest. */ internal val availableComponentNonces: Map<Int, List<SecureHash>> by lazy { componentGroups.map { Pair(it.groupIndex, it.components.mapIndexed { internalIndex, internalIt -> componentHash(internalIt, privacySalt, it.groupIndex, internalIndex) }) }.toMap() } MaxLineLength:WireTransaction.kt$WireTransaction$/** * The leaves (group hashes) of the top level Merkle tree. * If a group's Merkle root is allOnesHash, it is a flag that denotes this group is empty (if list) or null (if single object) * in the wire transaction. */ internal val groupHashes: List<SecureHash> by lazy { val listOfLeaves = mutableListOf<SecureHash>() // Even if empty and not used, we should at least send oneHashes for each known // or received but unknown (thus, bigger than known ordinal) component groups. for (i in 0..componentGroups.map { it.groupIndex }.max()!!) { val root = groupsMerkleRoots[i] ?: SecureHash.allOnesHash listOfLeaves.add(root) } listOfLeaves } @@ -9710,6 +9742,7 @@ MaxLineLength:WireTransaction.kt$WireTransaction$checkTransactionSize(ltx, resolvedNetworkParameters.maxTransactionSize, serializedResolvedInputs, serializedResolvedReferences) MaxLineLength:WireTransaction.kt$WireTransaction$componentGroups.map { Pair(it.groupIndex, it.components.mapIndexed { internalIndex, internalIt -> componentHash(availableComponentNonces[it.groupIndex]!![internalIndex], internalIt) }) }.toMap() MaxLineLength:WireTransaction.kt$WireTransaction$componentGroups.map { Pair(it.groupIndex, it.components.mapIndexed { internalIndex, internalIt -> componentHash(internalIt, privacySalt, it.groupIndex, internalIndex) }) }.toMap() + MaxLineLength:WireTransaction.kt$WireTransaction$isAttachmentTrusted = { (services as? ServiceHubCoreInternal)?.attachmentTrustCalculator?.calculate(it) ?: true } MaxLineLength:WireTransaction.kt$WireTransaction$require(remainingTransactionSize > size) { "Transaction exceeded network's maximum transaction size limit : $maxTransactionSize bytes." } MaxLineLength:WireTransaction.kt$WireTransaction$return this.componentGroups.firstOrNull { it.groupIndex == componentGroup.ordinal }?.let { cg -> cg.components.sumBy { it.size } + 4 } ?: 0 MaxLineLength:WireTransaction.kt$WireTransaction$val resolvedAttachments = attachments.lazyMapped { att, _ -> resolveAttachment(att) ?: throw AttachmentResolutionException(att) } @@ -9791,9 +9824,10 @@ MaxLineLength:internalAccessTestHelpers.kt$fun createContractRejection(txId: SecureHash, contract: Contract, cause: Throwable) ModifierOrder:NodeNamedCache.kt$DefaultNamedCacheFactory$open protected NestedBlockDepth:ANSIProgressRenderer.kt$ANSIProgressRenderer$// Returns number of lines rendered. private fun renderLevel(ansi: Ansi, error: Boolean): Int + NestedBlockDepth:AbstractAggregatedList.kt$AbstractAggregatedList$override fun sourceChanged(c: ListChangeListener.Change<out E>) + NestedBlockDepth:AbstractConcatenatedList.kt$AbstractConcatenatedList$// This is where we handle changes to the *source* list. override fun sourceChanged(change: ListChangeListener.Change<out ObservableList<A>>) NestedBlockDepth:AbstractNode.kt$AbstractNode$private fun installCordaServices() NestedBlockDepth:AbstractNode.kt$AbstractNode$private fun registerCordappFlows() - NestedBlockDepth:AggregatedList.kt$AggregatedList$override fun sourceChanged(c: ListChangeListener.Change<out E>) NestedBlockDepth:AllButBlacklisted.kt$AllButBlacklisted$ override fun hasListed(type: Class<*>): Boolean NestedBlockDepth:Amount.kt$Amount.Companion$ @JvmStatic fun parseCurrency(input: String): Amount<Currency> NestedBlockDepth:AttachmentDemo.kt$@Suppress("DEPRECATION") // DOCSTART 1 fun recipient(rpc: CordaRPCOps, webPort: Int) @@ -9803,7 +9837,6 @@ NestedBlockDepth:CheckpointAgent.kt$CheckpointHook$private fun instrumentClass(clazz: CtClass): CtClass? NestedBlockDepth:CheckpointVerifier.kt$CheckpointVerifier$ fun verifyCheckpointsCompatible( checkpointStorage: CheckpointStorage, currentCordapps: List<Cordapp>, platformVersion: Int, serviceHub: ServiceHub, tokenizableServices: List<Any> ) NestedBlockDepth:ClassCarpenter.kt$ClassCarpenterImpl$ private fun validateSchema(schema: Schema) - NestedBlockDepth:ConcatenatedList.kt$ConcatenatedList$// This is where we handle changes to the *source* list. override fun sourceChanged(change: ListChangeListener.Change<out ObservableList<A>>) NestedBlockDepth:ConnectionStateMachine.kt$ConnectionStateMachine$override fun onConnectionFinal(event: Event) NestedBlockDepth:ConnectionStateMachine.kt$ConnectionStateMachine$override fun onDelivery(event: Event) NestedBlockDepth:CordaPersistence.kt$CordaPersistence$private fun <T> inTopLevelTransaction(isolationLevel: TransactionIsolationLevel, recoverableFailureTolerance: Int, recoverAnyNestedSQLException: Boolean, statement: DatabaseTransaction.() -> T): T @@ -9813,14 +9846,14 @@ NestedBlockDepth:InteractiveShell.kt$InteractiveShell$ @JvmStatic fun runFlowByNameFragment(nameFragment: String, inputData: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, ansiProgressRenderer: ANSIProgressRenderer, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) NestedBlockDepth:InteractiveShell.kt$InteractiveShell$@JvmStatic fun gracefulShutdown(userSessionOut: RenderPrintWriter, cordaRPCOps: CordaRPCOps) NestedBlockDepth:InternalUtils.kt$ inline fun <T> Iterable<T>.noneOrSingle(predicate: (T) -> Boolean): T? - NestedBlockDepth:JarSignatureTestUtils.kt$JarSignatureTestUtils$fun Path.addManifest(fileName: String, vararg entry: Pair<Attributes.Name, String>) + NestedBlockDepth:JarSignatureTestUtils.kt$JarSignatureTestUtils$fun Path.addManifest(fileName: String, vararg entries: Pair<Attributes.Name, String>) NestedBlockDepth:Main.kt$Node$fun avalancheLoop() NestedBlockDepth:NetworkBootstrapper.kt$CopyCordapps$protected fun List<Path>.copy(nodeDirs: List<Path>) NestedBlockDepth:NetworkRegistrationHelper.kt$NetworkRegistrationHelper$ private fun pollServerForCertificates(requestId: String): List<X509Certificate> NestedBlockDepth:Node.kt$Node$ override fun startDatabase() NestedBlockDepth:Node.kt$Node$ private fun tryDetectIfNotPublicHost(host: String): String? NestedBlockDepth:Node.kt$Node$private fun startLocalRpcBroker(securityManager: RPCSecurityManager): BrokerAddresses? - NestedBlockDepth:NodeVaultService.kt$NodeVaultService$private fun recordUpdate(update: Vault.Update<ContractState>, previouslySeen: Boolean): Vault.Update<ContractState> + NestedBlockDepth:NodeVaultService.kt$NodeVaultService$private fun recordUpdate(update: Vault.Update<ContractState>): Vault.Update<ContractState> NestedBlockDepth:NonValidatingNotaryFlow.kt$NonValidatingNotaryFlow$override fun verifyTransaction(requestPayload: NotarisationPayload) NestedBlockDepth:ObjectDiffer.kt$ObjectDiffer$fun diff(a: Any?, b: Any?): DiffTree? NestedBlockDepth:Obligation.kt$Obligation$override fun verify(tx: LedgerTransaction) @@ -9874,7 +9907,11 @@ NewLineAtEndOfFile:ArtemisTcpTransport.kt$net.corda.nodeapi.internal.ArtemisTcpTransport.kt NewLineAtEndOfFile:AssertingTestDatabaseContext.kt$net.corda.testing.internal.db.AssertingTestDatabaseContext.kt NewLineAtEndOfFile:AsyncLoggingTest.kt$net.corda.node.utilities.logging.AsyncLoggingTest.kt + NewLineAtEndOfFile:AttachmentStorageInternal.kt$net.corda.node.services.persistence.AttachmentStorageInternal.kt NewLineAtEndOfFile:AttachmentTest.kt$net.corda.deterministic.contracts.AttachmentTest.kt + NewLineAtEndOfFile:AttachmentTrustCalculator.kt$net.corda.core.internal.AttachmentTrustCalculator.kt + NewLineAtEndOfFile:AttachmentTrustCalculatorTest.kt$net.corda.node.services.attachments.AttachmentTrustCalculatorTest.kt + NewLineAtEndOfFile:AttachmentTrustTable.kt$net.corda.tools.shell.AttachmentTrustTable.kt NewLineAtEndOfFile:AttachmentVersionNumberMigration.kt$net.corda.nodeapi.internal.persistence.AttachmentVersionNumberMigration.kt NewLineAtEndOfFile:AttachmentWithContext.kt$net.corda.core.internal.AttachmentWithContext.kt NewLineAtEndOfFile:AttachmentsClassLoader.kt$net.corda.core.serialization.internal.AttachmentsClassLoader.kt @@ -9911,7 +9948,6 @@ NewLineAtEndOfFile:CertificateStore.kt$net.corda.nodeapi.internal.config.CertificateStore.kt NewLineAtEndOfFile:CertificateStoreStubs.kt$net.corda.testing.internal.stubs.CertificateStoreStubs.kt NewLineAtEndOfFile:CertificatesUtils.kt$net.corda.node.utilities.CertificatesUtils.kt - NewLineAtEndOfFile:CheatingSecurityProvider.kt$net.corda.deterministic.CheatingSecurityProvider.kt NewLineAtEndOfFile:CheckpointDumperTest.kt$net.corda.node.services.rpc.CheckpointDumperTest.kt NewLineAtEndOfFile:CheckpointSerializationAPI.kt$net.corda.core.serialization.internal.CheckpointSerializationAPI.kt NewLineAtEndOfFile:CheckpointSerializationScheme.kt$net.corda.serialization.internal.CheckpointSerializationScheme.kt @@ -9927,7 +9963,6 @@ NewLineAtEndOfFile:CliBackwardsCompatibleTest.kt$net.corda.testing.CliBackwardsCompatibleTest.kt NewLineAtEndOfFile:ClientCacheFactory.kt$net.corda.client.rpc.internal.ClientCacheFactory.kt NewLineAtEndOfFile:ClientRelevantError.kt$net.corda.core.ClientRelevantError.kt - NewLineAtEndOfFile:ClientRelevantException.kt$net.corda.ClientRelevantException.kt NewLineAtEndOfFile:ClientRpcExample.kt$net.corda.docs.kotlin.ClientRpcExample.kt NewLineAtEndOfFile:ClientRpcSslOptions.kt$net.corda.core.messaging.ClientRpcSslOptions.kt NewLineAtEndOfFile:ClientRpcTutorial.kt$net.corda.docs.kotlin.ClientRpcTutorial.kt @@ -10029,7 +10064,6 @@ NewLineAtEndOfFile:EvolutionSerializerFactoryTests.kt$net.corda.serialization.internal.amqp.EvolutionSerializerFactoryTests.kt NewLineAtEndOfFile:ExampleConfigTest.kt$net.corda.docs.ExampleConfigTest.kt NewLineAtEndOfFile:Examples.kt$net.corda.finance.contracts.universal.Examples.kt - NewLineAtEndOfFile:ExceptionSerialisingRpcOpsProxy.kt$net.corda.node.internal.rpc.proxies.ExceptionSerialisingRpcOpsProxy.kt NewLineAtEndOfFile:ExceptionsErrorCodeFunctions.kt$net.corda.common.logging.ExceptionsErrorCodeFunctions.kt NewLineAtEndOfFile:ExceptionsSerializationTest.kt$net.corda.node.services.statemachine.ExceptionsSerializationTest.kt NewLineAtEndOfFile:ExchangeRateModelTest.kt$net.corda.client.jfx.model.ExchangeRateModelTest.kt @@ -10086,7 +10120,9 @@ NewLineAtEndOfFile:InstantSerializer.kt$net.corda.serialization.internal.amqp.custom.InstantSerializer.kt NewLineAtEndOfFile:Instantiator.kt$net.corda.networkbuilder.containers.instance.Instantiator.kt NewLineAtEndOfFile:InterestRatesSwapDemoAPI.kt$net.corda.irs.web.api.InterestRatesSwapDemoAPI.kt + NewLineAtEndOfFile:InternalAccessTestHelpers.kt$net.corda.serialization.internal.InternalAccessTestHelpers.kt NewLineAtEndOfFile:InternalCordaRPCOps.kt$net.corda.core.internal.messaging.InternalCordaRPCOps.kt + NewLineAtEndOfFile:InternalMockAttachmentStorage.kt$net.corda.testing.internal.services.InternalMockAttachmentStorage.kt NewLineAtEndOfFile:InternalMockNetworkConfigOverrides.kt$net.corda.testing.node.internal.InternalMockNetworkConfigOverrides.kt NewLineAtEndOfFile:InternalTestConstants.kt$net.corda.testing.internal.InternalTestConstants.kt NewLineAtEndOfFile:InternalTestUtils.kt$net.corda.testing.internal.InternalTestUtils.kt @@ -10094,7 +10130,7 @@ NewLineAtEndOfFile:InvocationHandlerTemplate.kt$net.corda.node.internal.InvocationHandlerTemplate.kt NewLineAtEndOfFile:IssueCash.kt$net.corda.bank.IssueCash.kt NewLineAtEndOfFile:IssueCashLoggingTests.kt$net.corda.node.logging.IssueCashLoggingTests.kt - NewLineAtEndOfFile:JVMAgentRegistry.kt$net.corda.node.utilities.JVMAgentRegistry.kt + NewLineAtEndOfFile:JVMAgentUtil.kt$net.corda.node.utilities.JVMAgentUtil.kt NewLineAtEndOfFile:JarSignatureCollector.kt$net.corda.core.internal.JarSignatureCollector.kt NewLineAtEndOfFile:KMSUtilsTests.kt$net.corda.node.services.keys.KMSUtilsTests.kt NewLineAtEndOfFile:KeepForDJVM.kt$net.corda.core.KeepForDJVM.kt @@ -10157,6 +10193,7 @@ NewLineAtEndOfFile:NoOpTestDatabaseContext.kt$net.corda.testing.internal.db.NoOpTestDatabaseContext.kt NewLineAtEndOfFile:NodeAdder.kt$net.corda.networkbuilder.nodes.NodeAdder.kt NewLineAtEndOfFile:NodeAttachmentService.kt$net.corda.node.services.persistence.NodeAttachmentService.kt + NewLineAtEndOfFile:NodeAttachmentTrustCalculator.kt$net.corda.node.services.attachments.NodeAttachmentTrustCalculator.kt NewLineAtEndOfFile:NodeBuildProperties.kt$net.corda.node.utilities.NodeBuildProperties.kt NewLineAtEndOfFile:NodeConfigurationImpl.kt$net.corda.node.services.config.NodeConfigurationImpl.kt NewLineAtEndOfFile:NodeConnection.kt$net.corda.loadtest.NodeConnection.kt @@ -10305,6 +10342,7 @@ NewLineAtEndOfFile:SendableMessageImpl.kt$net.corda.nodeapi.internal.protonwrapper.messages.impl.SendableMessageImpl.kt NewLineAtEndOfFile:SerializationAnnotations.kt$net.corda.core.serialization.SerializationAnnotations.kt NewLineAtEndOfFile:SerializationHelper.kt$net.corda.serialization.internal.amqp.SerializationHelper.kt + NewLineAtEndOfFile:SerializationOutputTests.kt$net.corda.serialization.internal.amqp.SerializationOutputTests.kt NewLineAtEndOfFile:SerializationPropertyOrdering.kt$net.corda.serialization.internal.amqp.SerializationPropertyOrdering.kt NewLineAtEndOfFile:SerializationSchemaTests.kt$net.corda.serialization.internal.amqp.SerializationSchemaTests.kt NewLineAtEndOfFile:SerializationSupport.kt$net.corda.tools.shell.SerializationSupport.kt @@ -10317,7 +10355,6 @@ NewLineAtEndOfFile:Settings.kt$net.corda.explorer.views.Settings.kt NewLineAtEndOfFile:SettingsModel.kt$net.corda.explorer.model.SettingsModel.kt NewLineAtEndOfFile:SettingsModelTest.kt$net.corda.explorer.model.SettingsModelTest.kt - NewLineAtEndOfFile:SharedMemoryIncremental.kt$net.corda.testing.driver.internal.SharedMemoryIncremental.kt NewLineAtEndOfFile:ShutdownManager.kt$net.corda.testing.node.internal.ShutdownManager.kt NewLineAtEndOfFile:SignatureConstraintMigrationFromHashConstraintsTests.kt$net.corda.contracts.SignatureConstraintMigrationFromHashConstraintsTests.kt NewLineAtEndOfFile:SignatureConstraintMigrationFromWhitelistConstraintTests.kt$net.corda.contracts.SignatureConstraintMigrationFromWhitelistConstraintTests.kt @@ -10410,7 +10447,6 @@ NewLineAtEndOfFile:WithContracts.kt$net.corda.coretests.flows.WithContracts.kt NewLineAtEndOfFile:WithMockNet.kt$net.corda.coretests.flows.WithMockNet.kt NewLineAtEndOfFile:WritablePublicKeyToOwningIdentityCache.kt$net.corda.node.services.persistence.WritablePublicKeyToOwningIdentityCache.kt - NewLineAtEndOfFile:X509EdDSAEngineTest.kt$net.corda.core.internal.X509EdDSAEngineTest.kt NewLineAtEndOfFile:YearMonthSerializer.kt$net.corda.serialization.internal.amqp.custom.YearMonthSerializer.kt NewLineAtEndOfFile:YearSerializer.kt$net.corda.serialization.internal.amqp.custom.YearSerializer.kt NewLineAtEndOfFile:ZoneIdSerializer.kt$net.corda.serialization.internal.amqp.custom.ZoneIdSerializer.kt @@ -10441,7 +10477,7 @@ ReturnCount:FlowLogicRefFactoryImpl.kt$FlowLogicRefFactoryImpl$private fun buildParams(constructor: KFunction<FlowLogic<*>>, args: Map<String, Any?>): HashMap<KParameter, Any?>? ReturnCount:FlowManager.kt$NodeFlowManager.FlowWeightComparator$override fun compare(o1: NodeFlowManager.RegisteredFlowContainer, o2: NodeFlowManager.RegisteredFlowContainer): Int ReturnCount:InteractiveShell.kt$InteractiveShell$ @JvmStatic fun runFlowByNameFragment(nameFragment: String, inputData: String, output: RenderPrintWriter, rpcOps: CordaRPCOps, ansiProgressRenderer: ANSIProgressRenderer, inputObjectMapper: ObjectMapper = createYamlInputMapper(rpcOps)) - ReturnCount:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: InternalCordaRPCOps, inputObjectMapper: ObjectMapper): Any? + ReturnCount:InteractiveShell.kt$InteractiveShell$@JvmStatic fun runRPCFromString(input: List<String>, out: RenderPrintWriter, context: InvocationContext<out Any>, cordaRPCOps: CordaRPCOps, inputObjectMapper: ObjectMapper): Any? ReturnCount:InteractiveShell.kt$InteractiveShell$private fun maybeFollow(response: Any?, printerFun: (Any?) -> String, out: PrintWriter): CordaFuture<Unit> ReturnCount:Interpolators.kt$LinearInterpolator$override fun interpolate(x: Double): Double ReturnCount:JarScanningCordappLoader.kt$JarScanningCordappLoader$private fun parseCordappInfo(manifest: Manifest?, defaultName: String): Cordapp.Info @@ -10452,6 +10488,7 @@ ReturnCount:Main.kt$Node$fun isAccepted(tx: Transaction): Boolean ReturnCount:MockNodeMessagingService.kt$MockNodeMessagingService$ private fun getNextQueue(q: LinkedBlockingQueue<InMemoryMessagingNetwork.MessageTransfer>, block: Boolean): Pair<InMemoryMessagingNetwork.MessageTransfer, List<Handler>>? ReturnCount:NetworkRegistrationHelper.kt$NodeRegistrationHelper$override fun validateAndGetTlsCrlIssuerCert(): X509Certificate? + ReturnCount:NodeAttachmentTrustCalculator.kt$NodeAttachmentTrustCalculator$override fun calculate(attachment: Attachment): Boolean ReturnCount:NodeConfigurationImpl.kt$NodeConfigurationImpl$private fun validateDevModeOptions(): List<String> ReturnCount:NodeSchemaService.kt$NodeSchemaService$// Because schema is always one supported by the state, just delegate. override fun generateMappedObject(state: ContractState, schema: MappedSchema): PersistentState ReturnCount:NodeStartup.kt$NodeStartup$fun initialiseAndRun(cmdLineOptions: SharedNodeCmdLineOptions, afterNodeInitialisation: RunAfterNodeInitialisation, requireCertificates: Boolean = false): Int @@ -10468,6 +10505,7 @@ ReturnCount:SerialFilter.kt$SerialFilter$internal fun applyPredicate(acceptClass: (Class<*>) -> Boolean, serialClass: Class<*>?): Boolean ReturnCount:ServicesForResolutionImpl.kt$ServicesForResolutionImpl$// We may need to recursively chase transactions if there are notary changes. fun inner(stateRef: StateRef, forContractClassName: String?): Attachment ReturnCount:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$override fun retryFlowFromSafePoint(currentState: StateMachineState) + ReturnCount:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$private fun createFlowFromCheckpoint( id: StateMachineRunId, serializedCheckpoint: SerializedBytes<Checkpoint>, isAnyCheckpointPersisted: Boolean, isStartIdempotent: Boolean, initialDeduplicationHandler: DeduplicationHandler? ): Flow? ReturnCount:SpecificationTest.kt$SpecificationTest$fun parseMax(elements: List<Long>): Valid<Long> ReturnCount:StandaloneShell.kt$StandaloneShell$override fun runProgram(): Int ReturnCount:TransactionBuilder.kt$TransactionBuilder$ private fun handleContract( contractClassName: ContractClassName, inputStates: List<TransactionState<ContractState>>?, outputStates: List<TransactionState<ContractState>>?, explicitContractAttachment: AttachmentId?, services: ServicesForResolution ): Pair<AttachmentId, List<TransactionState<ContractState>>?> @@ -10559,14 +10597,14 @@ SpreadOperator:LogHelper.kt$LogHelper$(*classes.map { "+" + it.packageName }.toTypedArray()) SpreadOperator:LogHelper.kt$LogHelper$(*classes.map { it.packageName }.toTypedArray()) SpreadOperator:Main.kt$(*args) - SpreadOperator:MockServices.kt$MockServices$( identityService, *arrayOf(initialIdentity.keyPair) + moreKeys, pkToIdCache = MockPublicKeyToOwningIdentityCache() ) + SpreadOperator:MockServices.kt$MockServices$( identityService, *arrayOf(initialIdentity.keyPair) + moreKeys ) SpreadOperator:MockServices.kt$MockServices$( listOf(getCallerPackage(MockServices::class)!!), firstIdentity, *moreIdentities ) SpreadOperator:MockServices.kt$MockServices$( listOf(getCallerPackage(MockServices::class)!!), firstIdentity, networkParameters, *moreIdentities ) SpreadOperator:MockServices.kt$MockServices$(*listOf(firstIdentity, *moreIdentities).map { it.identity }.toTypedArray()) SpreadOperator:MockServices.kt$MockServices$(cordappPackages, TestIdentity(initialIdentityName, key), identityService, *moreKeys) SpreadOperator:MockServices.kt$MockServices$(firstIdentity, *moreIdentities) SpreadOperator:MockServices.kt$MockServices$(listOf(getCallerPackage(MockServices::class)!!), TestIdentity(initialIdentityName, key), identityService, *moreKeys) - SpreadOperator:MockServices.kt$MockServices.Companion$( identityService, *arrayOf(initialIdentity.keyPair) + moreKeys, pkToIdCache = MockPublicKeyToOwningIdentityCache() ) + SpreadOperator:MockServices.kt$MockServices.Companion$( identityService, *arrayOf(initialIdentity.keyPair) + moreKeys ) SpreadOperator:NetworkBuilder.kt$(*this.toTypedArray()) SpreadOperator:NetworkMapTest.kt$NetworkMapTest$(*nodes) SpreadOperator:NetworkMapUpdater.kt$NetworkMapUpdater$(*networkMapDownloadFutures) @@ -10628,7 +10666,7 @@ ThrowsCount:AMQPTypeIdentifierParser.kt$AMQPTypeIdentifierParser$// Make sure our inputs aren't designed to blow things up. private fun validate(typeString: String) ThrowsCount:AbstractNode.kt$fun CordaPersistence.startHikariPool(hikariProperties: Properties, databaseConfig: DatabaseConfig, schemas: Set<MappedSchema>, metricRegistry: MetricRegistry? = null, cordappLoader: CordappLoader? = null, currentDir: Path? = null, ourName: CordaX500Name) ThrowsCount:ArtemisMessagingServer.kt$ArtemisMessagingServer$// TODO: Maybe wrap [IOException] on a key store load error so that it's clearly splitting key store loading from // Artemis IO errors @Throws(IOException::class, AddressBindingException::class, KeyStoreException::class) private fun configureAndStartServer() - ThrowsCount:BrokerJaasLoginModule.kt$BaseBrokerJaasLoginModule$protected fun getUsernamePasswordAndCerts(): Triple<String, String, Array<X509Certificate>?> + ThrowsCount:BrokerJaasLoginModule.kt$BaseBrokerJaasLoginModule$@Suppress("DEPRECATION") // should use java.security.cert.X509Certificate protected fun getUsernamePasswordAndCerts(): Triple<String, String, Array<javax.security.cert.X509Certificate>?> ThrowsCount:CheckpointVerifier.kt$CheckpointVerifier$ fun verifyCheckpointsCompatible( checkpointStorage: CheckpointStorage, currentCordapps: List<Cordapp>, platformVersion: Int, serviceHub: ServiceHub, tokenizableServices: List<Any> ) ThrowsCount:CheckpointVerifier.kt$CheckpointVerifier$// Throws exception when the flow is incompatible private fun checkFlowCompatible(subFlow: SubFlow, currentCordappsByHash: Map<SecureHash.SHA256, Cordapp>, platformVersion: Int) ThrowsCount:ClassCarpenter.kt$ClassCarpenterImpl$ private fun validateSchema(schema: Schema) @@ -10664,7 +10702,7 @@ ThrowsCount:TransactionVerifierServiceInternal.kt$Verifier$ private fun getUniqueContractAttachmentsByContract(): Map<ContractClassName, ContractAttachment> ThrowsCount:TransactionVerifierServiceInternal.kt$Verifier$ private fun verifyContracts() ThrowsCount:TransactionVerifierServiceInternal.kt$Verifier$// Using basic graph theory, a full cycle of encumbered (co-dependent) states should exist to achieve bi-directional // encumbrances. This property is important to ensure that no states involved in an encumbrance-relationship // can be spent on their own. Briefly, if any of the states is having more than one encumbrance references by // other states, a full cycle detection will fail. As a result, all of the encumbered states must be present // as "from" and "to" only once (or zero times if no encumbrance takes place). For instance, // a -> b // c -> b and a -> b // b -> a b -> c // do not satisfy the bi-directionality (full cycle) property. // // In the first example "b" appears twice in encumbrance ("to") list and "c" exists in the encumbered ("from") list only. // Due the above, one could consume "a" and "b" in the same transaction and then, because "b" is already consumed, "c" cannot be spent. // // Similarly, the second example does not form a full cycle because "a" and "c" exist in one of the lists only. // As a result, one can consume "b" and "c" in the same transactions, which will make "a" impossible to be spent. // // On other hand the following are valid constructions: // a -> b a -> c // b -> c and c -> b // c -> a b -> a // and form a full cycle, meaning that the bi-directionality property is satisfied. private fun checkBidirectionalOutputEncumbrances(statesAndEncumbrance: List<Pair<Int, Int>>) - ThrowsCount:WireTransaction.kt$WireTransaction$private fun toLedgerTransactionInternal( resolveIdentity: (PublicKey) -> Party?, resolveAttachment: (SecureHash) -> Attachment?, resolveStateRefAsSerialized: (StateRef) -> SerializedBytes<TransactionState<ContractState>>?, resolveParameters: (SecureHash?) -> NetworkParameters?, resolveContractAttachment: (StateRef) -> Attachment, isAttachmentTrusted: (Attachment) -> Boolean ): LedgerTransaction + ThrowsCount:WireTransaction.kt$WireTransaction$private fun toLedgerTransactionInternal( resolveIdentity: (PublicKey) -> Party?, resolveAttachment: (SecureHash) -> Attachment?, resolveStateRefAsSerialized: (StateRef) -> SerializedBytes<TransactionState<ContractState>>?, resolveParameters: (SecureHash?) -> NetworkParameters?, isAttachmentTrusted: (Attachment) -> Boolean ): LedgerTransaction ThrowsCount:WireTransaction.kt$WireTransaction.Companion$ @CordaInternal fun resolveStateRefBinaryComponent(stateRef: StateRef, services: ServicesForResolution): SerializedBytes<TransactionState<ContractState>>? TooGenericExceptionCaught:AMQPChannelHandler.kt$AMQPChannelHandler$ex: Exception TooGenericExceptionCaught:AMQPExceptions.kt$th: Throwable @@ -10717,8 +10755,6 @@ TooGenericExceptionCaught:ErrorCodeLoggingTests.kt$e: Exception TooGenericExceptionCaught:EventProcessor.kt$EventProcessor$ex: Exception TooGenericExceptionCaught:Eventually.kt$e: Exception - TooGenericExceptionCaught:ExceptionMaskingRpcOpsProxy.kt$ExceptionMaskingRpcOpsProxy.ErrorObfuscatingInvocationHandler$exception: Exception - TooGenericExceptionCaught:ExceptionSerialisingRpcOpsProxy.kt$ExceptionSerialisingRpcOpsProxy.ErrorSerialisingInvocationHandler$exception: Exception TooGenericExceptionCaught:Expect.kt$exception: Exception TooGenericExceptionCaught:Explorer.kt$Explorer$e: Exception TooGenericExceptionCaught:FiberDeserializationCheckingInterceptor.kt$FiberDeserializationChecker$exception: Exception @@ -10745,6 +10781,7 @@ TooGenericExceptionCaught:InternalUtils.kt$ex: Exception TooGenericExceptionCaught:InternalUtils.kt$th: Throwable TooGenericExceptionCaught:IssueCash.kt$IssueCash$e: Exception + TooGenericExceptionCaught:JVMAgentUtil.kt$JVMAgentUtil$e: Exception TooGenericExceptionCaught:JacksonSupport.kt$JacksonSupport.PartyDeserializer$e: Exception TooGenericExceptionCaught:JacksonSupport.kt$JacksonSupport.PublicKeyDeserializer$e: Exception TooGenericExceptionCaught:JacksonSupport.kt$JacksonSupport.SecureHashDeserializer$e: Exception @@ -10785,7 +10822,7 @@ TooGenericExceptionCaught:NotaryUtils.kt$e: Exception TooGenericExceptionCaught:ObjectDiffer.kt$ObjectDiffer$throwable: Exception TooGenericExceptionCaught:P2PMessagingClient.kt$P2PMessagingClient$e: Exception - TooGenericExceptionCaught:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable$e: Exception + TooGenericExceptionCaught:PersistentIdentityMigrationNewTableTest.kt$PersistentIdentityMigrationNewTableTest$e: Exception TooGenericExceptionCaught:PersistentUniquenessProvider.kt$PersistentUniquenessProvider$e: Exception TooGenericExceptionCaught:ProfileController.kt$ProfileController$e: Exception TooGenericExceptionCaught:PropertyValidationTest.kt$PropertyValidationTest$e: Exception @@ -10810,6 +10847,7 @@ TooGenericExceptionCaught:SerializationOutputTests.kt$SerializationOutputTests$t: Throwable TooGenericExceptionCaught:ShutdownManager.kt$ShutdownManager$t: Throwable TooGenericExceptionCaught:SimpleMQClient.kt$SimpleMQClient$e: Exception + TooGenericExceptionCaught:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$e: Exception TooGenericExceptionCaught:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$ex: Exception TooGenericExceptionCaught:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$exception: Exception TooGenericExceptionCaught:SingleThreadedStateMachineManager.kt$SingleThreadedStateMachineManager$t: Throwable @@ -10840,7 +10878,6 @@ TooGenericExceptionCaught:X509EdDSAEngine.kt$X509EdDSAEngine$e: Exception TooGenericExceptionCaught:X509UtilitiesTest.kt$X509UtilitiesTest$ex: Exception TooGenericExceptionThrown:AMQPExceptionsTests.kt$AMQPExceptionsTests$throw Exception("FAILED") - TooGenericExceptionThrown:AbstractNode.kt$AbstractNode$throw Error("Unable to locate agent jar file") TooGenericExceptionThrown:AzureBackend.kt$AzureBackend.Companion$throw RuntimeException(e) TooGenericExceptionThrown:ClassLoadingUtilsTest.kt$ClassLoadingUtilsTest$throw RuntimeException() TooGenericExceptionThrown:CommandParsers.kt$AzureParser.RegionConverter$throw Error("Unknown azure region: $value") @@ -10856,6 +10893,7 @@ TooGenericExceptionThrown:NodeConnection.kt$NodeConnection.ShellCommandOutput$throw Exception(diagnostic) TooGenericExceptionThrown:PhysicalLocationStructures.kt$CityDatabase$throw Exception("Could not parse line: $line") TooGenericExceptionThrown:RPCDriver.kt$RandomRpcUser.Companion$throw Exception("No generator for ${it.type}") + TooGenericExceptionThrown:RpcExceptionHandlingTest.kt$ClientRelevantErrorFlow$throw Exception(message, SQLException("Oops!")) TooGenericExceptionThrown:RpcServerObservableSerializerTests.kt$RpcServerObservableSerializerTests$throw Error("Observable serializer must be registerable with factory, unexpected exception - ${e.message}") TooGenericExceptionThrown:RpcServerObservableSerializerTests.kt$RpcServerObservableSerializerTests$throw Error("Serialization of observable should not throw - ${e.message}") TooGenericExceptionThrown:SelfIssueTest.kt$throw Exception( "Simulated state diverged from actual state" + "\nSimulated state:\n${previousState.vaultsSelfIssued}" + "\nActual state:\n$selfIssueVaults" + "\nDiff:\n$diffString" ) @@ -10875,6 +10913,7 @@ TooManyFunctions:ArtemisMessagingTest.kt$ArtemisMessagingTest TooManyFunctions:ArtemisTcpTransport.kt$ArtemisTcpTransport$Companion TooManyFunctions:AttachmentTests.kt$AttachmentTests : WithMockNet + TooManyFunctions:AttachmentTrustCalculatorTest.kt$AttachmentTrustCalculatorTest TooManyFunctions:AttachmentsClassLoaderTests.kt$AttachmentsClassLoaderTests TooManyFunctions:BCCryptoService.kt$BCCryptoService : CryptoService TooManyFunctions:BFTSmart.kt$BFTSmart$Replica : DefaultRecoverable @@ -10926,7 +10965,6 @@ TooManyFunctions:EnumTests.kt$EnumTests TooManyFunctions:EventProcessor.kt$EventProcessor : BaseHandler TooManyFunctions:EvolvabilityTests.kt$EvolvabilityTests - TooManyFunctions:ExceptionMaskingRpcOpsProxy.kt$ExceptionMaskingRpcOpsProxy$ErrorObfuscatingInvocationHandler : InvocationHandlerTemplate TooManyFunctions:Expect.kt$net.corda.testing.core.Expect.kt TooManyFunctions:FinanceTypesTest.kt$FinanceTypesTest TooManyFunctions:FlowFrameworkTests.kt$FlowFrameworkTests @@ -10943,6 +10981,7 @@ TooManyFunctions:IRSDemoTest.kt$IRSDemoTest TooManyFunctions:IRSTests.kt$IRSTests TooManyFunctions:IdentityService.kt$IdentityService + TooManyFunctions:InMemoryIdentityService.kt$InMemoryIdentityService : SingletonSerializeAsTokenIdentityService TooManyFunctions:InMemoryIdentityServiceTests.kt$InMemoryIdentityServiceTests TooManyFunctions:InMemoryMessagingNetwork.kt$InMemoryMessagingNetwork : SingletonSerializeAsToken TooManyFunctions:InfrequentlyMutatedCacheTest.kt$InfrequentlyMutatedCacheTest @@ -11006,7 +11045,6 @@ TooManyFunctions:PartialMerkleTreeTest.kt$PartialMerkleTreeTest TooManyFunctions:PathUtils.kt$net.corda.core.internal.PathUtils.kt TooManyFunctions:Perceivable.kt$net.corda.finance.contracts.universal.Perceivable.kt - TooManyFunctions:PersistentIdentityMigrationNewTable.kt$PersistentIdentityMigrationNewTable : CordaMigration TooManyFunctions:PersistentIdentityService.kt$PersistentIdentityService : SingletonSerializeAsTokenIdentityService TooManyFunctions:PersistentIdentityServiceTests.kt$PersistentIdentityServiceTests TooManyFunctions:PersistentNetworkMapCache.kt$PersistentNetworkMapCache : NetworkMapCacheInternalSingletonSerializeAsToken @@ -11029,6 +11067,7 @@ TooManyFunctions:RPCServer.kt$RPCServer TooManyFunctions:RPCStabilityTests.kt$RPCStabilityTests TooManyFunctions:ReadOnlyBackedObservableMapBase.kt$ReadOnlyBackedObservableMapBase<K, A, B> : ObservableMap + TooManyFunctions:ResolveStatePointersTest.kt$ResolveStatePointersTest TooManyFunctions:ResolveTransactionsFlowTest.kt$ResolveTransactionsFlowTest TooManyFunctions:SerializationAPI.kt$SerializationContext TooManyFunctions:SerializationHelper.kt$net.corda.serialization.internal.amqp.SerializationHelper.kt @@ -11113,6 +11152,7 @@ TopLevelPropertyNaming:InternalTestUtils.kt$/** * Reference to the finance-contracts CorDapp in this repo. The metadata is taken directly from finance/contracts/build.gradle, including the * fact that the jar is signed. If you need an unsigned jar then use `cordappWithPackages("net.corda.finance.contracts")`. * * You will probably need to use [FINANCE_CORDAPPS] instead to get access to the flows as well. */ @JvmField val FINANCE_CONTRACTS_CORDAPP: TestCordappImpl = findCordapp("net.corda.finance.contracts") TopLevelPropertyNaming:InternalTestUtils.kt$/** * Reference to the finance-workflows CorDapp in this repo. The metadata is taken directly from finance/workflows/build.gradle, including the * fact that the jar is signed. If you need an unsigned jar then use `cordappWithPackages("net.corda.finance.flows")`. * * You will probably need to use [FINANCE_CORDAPPS] instead to get access to the contract classes as well. */ @JvmField val FINANCE_WORKFLOWS_CORDAPP: TestCordappImpl = findCordapp("net.corda.finance.workflows") TopLevelPropertyNaming:InternalTestUtils.kt$@JvmField val FINANCE_CORDAPPS: Set<TestCordappImpl> = setOf(FINANCE_CONTRACTS_CORDAPP, FINANCE_WORKFLOWS_CORDAPP) + TopLevelPropertyNaming:InternalUtils.kt$// re-defined to prevent clash with Java 9 Class.packageName: https://docs.oracle.com/javase/9/docs/api/java/lang/Class.html#getPackageName-- val Class<*>.packageName_: String get() = requireNotNull(this.packageNameOrNull) { "$this not defined inside a package" } TopLevelPropertyNaming:InternalUtils.kt$val DEFAULT_HTTP_CONNECT_TIMEOUT = 30.seconds.toMillis() TopLevelPropertyNaming:InternalUtils.kt$val DEFAULT_HTTP_READ_TIMEOUT = 30.seconds.toMillis() TopLevelPropertyNaming:KeyStoreConfigHelpers.kt$val DEV_INTERMEDIATE_CA: CertificateAndKeyPair get() = DevCaHelper.loadDevCa(X509Utilities.CORDA_INTERMEDIATE_CA) @@ -11150,7 +11190,6 @@ TopLevelPropertyNaming:TestConstants.kt$/** A test node name **/ @JvmField val DUMMY_BANK_B_NAME = CordaX500Name("Bank B", "New York", "US") TopLevelPropertyNaming:TestConstants.kt$/** A test node name **/ @JvmField val DUMMY_BANK_C_NAME = CordaX500Name("Bank C", "Tokyo", "JP") TopLevelPropertyNaming:TestConstants.kt$/** A test notary name **/ @JvmField val DUMMY_NOTARY_NAME = CordaX500Name("Notary Service", "Zurich", "CH") - UnreachableCode:FlowRetryTest.kt$RetryFlow$throw ExceptionToCauseFiniteRetry() VariableNaming:AMQPBridgeTest.kt$AMQPBridgeTest$private val BOB = TestIdentity(BOB_NAME) VariableNaming:AttachmentsClassLoaderSerializationTests.kt$AttachmentsClassLoaderSerializationTests$val DUMMY_NOTARY = TestIdentity(DUMMY_NOTARY_NAME, 20).party VariableNaming:AttachmentsClassLoaderSerializationTests.kt$AttachmentsClassLoaderSerializationTests$val MEGA_CORP = TestIdentity(CordaX500Name("MegaCorp", "London", "GB")).party @@ -11206,7 +11245,6 @@ VariableNaming:EvolvabilityTests.kt$EvolvabilityTests$val C = "This is not a banana" VariableNaming:EvolvabilityTests.kt$EvolvabilityTests$val C = "three" VariableNaming:EvolvabilityTests.kt$EvolvabilityTests$val D = 4 - VariableNaming:EvolvabilityTests.kt$EvolvabilityTests$val DUMMY_NOTARY = TestIdentity(DUMMY_NOTARY_NAME, 20).party VariableNaming:EvolvabilityTests.kt$EvolvabilityTests$val E = null VariableNaming:Examples.kt$Examples$// fx swap // both parties have the right to trigger the exchange of cash flows val an_fx_swap = arrange { actions { (acmeCorp or highStreetBank) may { "execute".givenThat(after("2017-09-01")) { highStreetBank.owes(acmeCorp, 1070.K, EUR) acmeCorp.owes(highStreetBank, 1.M, USD) } } } } VariableNaming:Examples.kt$Examples$// maybe in the presence of negative interest rates you would want other side of contract to be able to take initiative as well val zero_coupon_bond_2 = arrange { actions { (acmeCorp or highStreetBank) may { "execute".givenThat(after("2017-09-01")) { highStreetBank.owes(acmeCorp, 1.M, USD) } } } } @@ -11215,6 +11253,13 @@ VariableNaming:Examples.kt$Examples$val cds_contract = arrange { actions { acmeCorp may { "claim".givenThat(acmeCorporationHasDefaulted and before("2017-09-01")) { highStreetBank.owes(acmeCorp, 1.M, USD) } } } } VariableNaming:Examples.kt$Examples$val european_fx_option = arrange { actions { acmeCorp may { "exercise".givenThat(before("2017-09-01")) { fx_swap("2017-09-01", 1.M, 1.2.bd, EUR, USD, acmeCorp, highStreetBank) } } (acmeCorp or highStreetBank) may { "expire" anytime { zero } } } } VariableNaming:Examples.kt$Examples$val one_touch = arrange { actions { highStreetBank may { "expire".givenThat(after("2017-09-01")) { zero } } acmeCorp may { "knock in".givenThat(EUR / USD gt 1.3) { highStreetBank.owes(acmeCorp, 1.M, USD) } } } } + VariableNaming:ExternalIdMappingTest.kt$ExternalIdMappingTest$val A = services.keyManagementService.freshKey(id) // Automatically calls registerKeyToParty and registerKeyToExternalId + VariableNaming:ExternalIdMappingTest.kt$ExternalIdMappingTest$val B = services.keyManagementService.freshKey(id) // Automatically calls registerKeyToParty and registerKeyToExternalId + VariableNaming:ExternalIdMappingTest.kt$ExternalIdMappingTest$val C = services.keyManagementService.freshKey(idTwo) // Automatically calls registerKeyToParty and registerKeyToExternalId + VariableNaming:ExternalIdMappingTest.kt$ExternalIdMappingTest$val D = services.keyManagementService.freshKey() // Automatically calls registerKeyToParty and registerKeyToExternalId + VariableNaming:ExternalIdMappingTest.kt$ExternalIdMappingTest$val E = Crypto.generateKeyPair().public + VariableNaming:ExternalIdMappingTest.kt$ExternalIdMappingTest$val F = Crypto.generateKeyPair().public + VariableNaming:ExternalIdMappingTest.kt$ExternalIdMappingTest$val G = Crypto.generateKeyPair().public VariableNaming:FXFwdTimeOption.kt$FXFwdTimeOption$val TEST_TX_TIME_1: Instant get() = Instant.parse("2017-09-02T12:00:00.00Z") VariableNaming:FXFwdTimeOption.kt$FXFwdTimeOption$val TEST_TX_TIME_AFTER_MATURITY: Instant get() = Instant.parse("2018-06-02T12:00:00.00Z") VariableNaming:FXFwdTimeOption.kt$FXFwdTimeOption$val TEST_TX_TIME_BEFORE_MATURITY: Instant get() = Instant.parse("2018-05-01T12:00:00.00Z") @@ -11323,11 +11368,11 @@ WildcardImport:AMQPClientSerializationScheme.kt$import net.corda.serialization.internal.* WildcardImport:AMQPClientSerializationScheme.kt$import net.corda.serialization.internal.amqp.* WildcardImport:AMQPRemoteTypeModel.kt$import net.corda.serialization.internal.model.* - WildcardImport:AMQPRemoteTypeModelTests.kt$import net.corda.serialization.internal.model.* WildcardImport:AMQPSerializationScheme.kt$import net.corda.core.internal.* WildcardImport:AMQPSerializationScheme.kt$import net.corda.core.serialization.* WildcardImport:AMQPServerSerializationScheme.kt$import net.corda.serialization.internal.amqp.* WildcardImport:AMQPTestSerialiationScheme.kt$import net.corda.serialization.internal.amqp.* + WildcardImport:AMQPTestUtils.kt$import net.corda.core.internal.* WildcardImport:AMQPTestUtils.kt$import net.corda.serialization.internal.amqp.* WildcardImport:AMQPTypeIdentifierParser.kt$import org.apache.qpid.proton.amqp.* WildcardImport:AMQPTypeIdentifiers.kt$import org.apache.qpid.proton.amqp.* @@ -11363,6 +11408,7 @@ WildcardImport:AttachmentLoadingTests.kt$import net.corda.core.internal.* WildcardImport:AttachmentTest.kt$import org.junit.Assert.* WildcardImport:AttachmentTests.kt$import com.natpryce.hamkrest.* + WildcardImport:AttachmentTrustCalculatorTest.kt$import net.corda.core.internal.* WildcardImport:AttachmentsClassLoader.kt$import java.net.* WildcardImport:AttachmentsClassLoader.kt$import net.corda.core.internal.* WildcardImport:AttachmentsClassLoader.kt$import net.corda.core.serialization.* @@ -11405,7 +11451,6 @@ WildcardImport:CertificateRevocationListNodeTests.kt$import net.corda.nodeapi.internal.crypto.* WildcardImport:CertificateRevocationListNodeTests.kt$import org.bouncycastle.asn1.x509.* WildcardImport:CertificatesUtils.kt$import net.corda.nodeapi.internal.crypto.* - WildcardImport:CheatingSecurityProvider.kt$import org.junit.Assert.* WildcardImport:CheckpointDumper.kt$import com.fasterxml.jackson.databind.* WildcardImport:CheckpointDumper.kt$import net.corda.core.internal.* WildcardImport:CheckpointDumper.kt$import net.corda.node.services.statemachine.* @@ -11479,6 +11524,7 @@ WildcardImport:CordaRPCClientTest.kt$import net.corda.core.messaging.* WildcardImport:CordaRPCClientTest.kt$import net.corda.testing.core.* WildcardImport:CordaRPCOps.kt$import net.corda.core.node.services.vault.* + WildcardImport:CordaRPCOpsImpl.kt$import net.corda.core.internal.* WildcardImport:CordaRPCOpsImpl.kt$import net.corda.core.messaging.* WildcardImport:CordaRPCOpsImpl.kt$import net.corda.core.node.services.vault.* WildcardImport:CordaRPCOpsImplTest.kt$import net.corda.core.messaging.* @@ -11549,16 +11595,12 @@ WildcardImport:E2ETestKeyManagementService.kt$import net.corda.core.crypto.* WildcardImport:EnumEvolvabilityTests.kt$import net.corda.core.serialization.* WildcardImport:EnumEvolvabilityTests.kt$import net.corda.serialization.internal.amqp.testutils.* - WildcardImport:EnumEvolveTests.kt$import net.corda.core.serialization.* WildcardImport:ErrorFlowTransition.kt$import net.corda.node.services.statemachine.* WildcardImport:EventProcessor.kt$import org.apache.qpid.proton.engine.* WildcardImport:EvolutionSerializerFactory.kt$import net.corda.serialization.internal.model.* WildcardImport:EvolutionSerializerFactoryTests.kt$import kotlin.test.* WildcardImport:EvolutionSerializerFactoryTests.kt$import net.corda.serialization.internal.amqp.testutils.* WildcardImport:EvolvabilityTests.kt$import net.corda.serialization.internal.amqp.testutils.* - WildcardImport:ExceptionMaskingRpcOpsProxy.kt$import net.corda.core.* - WildcardImport:ExceptionMaskingRpcOpsProxy.kt$import net.corda.core.messaging.* - WildcardImport:ExceptionSerialisingRpcOpsProxy.kt$import net.corda.core.messaging.* WildcardImport:Explorer.kt$import tornadofx.* WildcardImport:FiberDeserializationCheckingInterceptor.kt$import net.corda.node.services.statemachine.* WildcardImport:FinalityFlowMigration.kt$import net.corda.core.flows.* @@ -11637,6 +11679,7 @@ WildcardImport:InteractiveShellIntegrationTest.kt$import net.corda.core.flows.* WildcardImport:InterestRatesSwapDemoAPI.kt$import org.springframework.web.bind.annotation.* WildcardImport:InterestSwapRestAPI.kt$import org.springframework.web.bind.annotation.* + WildcardImport:InternalAccessTestHelpers.kt$import net.corda.serialization.internal.amqp.* WildcardImport:InternalMockNetwork.kt$import net.corda.core.internal.* WildcardImport:InternalMockNetwork.kt$import net.corda.node.services.config.* WildcardImport:InternalMockNetwork.kt$import net.corda.testing.node.* @@ -11706,11 +11749,8 @@ WildcardImport:MessageChainState.kt$import net.corda.core.contracts.* WildcardImport:MessageState.kt$import net.corda.core.contracts.* WildcardImport:MigrationServicesForResolution.kt$import net.corda.core.contracts.* - WildcardImport:MigrationServicesForResolution.kt$import net.corda.core.node.services.* WildcardImport:MockAttachmentStorage.kt$import net.corda.core.node.services.vault.* WildcardImport:MockKeyManagementService.kt$import net.corda.core.crypto.* - WildcardImport:MockNetworkTest.kt$import net.corda.testing.core.* - WildcardImport:MockNetworkTest.kt$import org.assertj.core.api.Assertions.* WildcardImport:MockNetworkTest.kt$import org.junit.Assert.* WildcardImport:MockNodeMessagingService.kt$import net.corda.node.services.messaging.* WildcardImport:MockServices.kt$import net.corda.core.node.* @@ -11758,17 +11798,13 @@ WildcardImport:NodeAttachmentServiceTest.kt$import kotlin.test.* WildcardImport:NodeAttachmentServiceTest.kt$import net.corda.core.internal.* WildcardImport:NodeAttachmentServiceTest.kt$import org.assertj.core.api.Assertions.* + WildcardImport:NodeAttachmentTrustCalculator.kt$import net.corda.core.internal.* WildcardImport:NodeBasedTest.kt$import net.corda.node.services.config.* WildcardImport:NodeConfig.kt$import com.typesafe.config.* WildcardImport:NodeController.kt$import net.corda.core.internal.* WildcardImport:NodeController.kt$import tornadofx.* WildcardImport:NodeControllerTest.kt$import kotlin.test.* WildcardImport:NodeData.kt$import tornadofx.* - WildcardImport:NodeInfo.kt$import net.corda.core.crypto.* - WildcardImport:NodeInfo.kt$import net.corda.core.internal.* - WildcardImport:NodeInfo.kt$import net.corda.serialization.internal.* - WildcardImport:NodeInfo.kt$import net.corda.serialization.internal.amqp.* - WildcardImport:NodeInfo.kt$import picocli.CommandLine.* WildcardImport:NodeInfoFilesCopier.kt$import net.corda.core.internal.* WildcardImport:NodeInfoSchema.kt$import javax.persistence.* WildcardImport:NodeInfoWatcher.kt$import net.corda.core.internal.* @@ -11838,6 +11874,7 @@ WildcardImport:ObserverNodeTransactionTests.kt$import net.corda.core.flows.* WildcardImport:ObserverNodeTransactionTests.kt$import net.corda.testing.node.internal.* WildcardImport:OnLedgerAsset.kt$import net.corda.core.contracts.* + WildcardImport:OracleNodeTearOffTests.kt$import net.corda.testing.core.* WildcardImport:P2PFlowsDrainingModeTest.kt$import net.corda.core.flows.* WildcardImport:P2PMessagingClient.kt$import net.corda.core.utilities.* WildcardImport:P2PMessagingClient.kt$import net.corda.nodeapi.internal.ArtemisMessagingComponent.* @@ -11852,7 +11889,6 @@ WildcardImport:PersistentIdentityMigrationNewTableTest.kt$import net.corda.testing.core.* WildcardImport:PersistentIdentityService.kt$import java.security.cert.* WildcardImport:PersistentIdentityService.kt$import net.corda.core.identity.* - WildcardImport:PersistentIdentityService.kt$import net.corda.core.internal.* WildcardImport:PersistentIdentityServiceTests.kt$import net.corda.testing.core.* WildcardImport:PersistentNetworkMapCacheTest.kt$import net.corda.testing.core.* WildcardImport:PersistentStateServiceTests.kt$import net.corda.core.contracts.* @@ -11891,7 +11927,7 @@ WildcardImport:ReceiveFinalityFlowTest.kt$import net.corda.testing.node.internal.* WildcardImport:ReceiveTransactionFlow.kt$import net.corda.core.contracts.* WildcardImport:ReconnectingCordaRPCOps.kt$import net.corda.client.rpc.* - WildcardImport:ReconnectingCordaRPCOps.kt$import net.corda.core.utilities.* + WildcardImport:ReconnectingCordaRPCOps.kt$import net.corda.client.rpc.internal.ReconnectingCordaRPCOps.ReconnectingRPCConnection.CurrentState.* WildcardImport:ReferenceInputStateTests.kt$import net.corda.core.contracts.* WildcardImport:ReferencedStatesFlowTests.kt$import net.corda.core.contracts.* WildcardImport:ReferencedStatesFlowTests.kt$import net.corda.core.flows.* @@ -11909,7 +11945,6 @@ WildcardImport:RpcExceptionHandlingTest.kt$import net.corda.core.flows.* WildcardImport:RpcExceptionHandlingTest.kt$import net.corda.testing.core.* WildcardImport:RpcExceptionHandlingTest.kt$import net.corda.testing.driver.* - WildcardImport:RpcReconnectTests.kt$import net.corda.core.utilities.* WildcardImport:RpcServerObservableSerializer.kt$import net.corda.serialization.internal.amqp.* WildcardImport:SSLHelper.kt$import java.security.cert.* WildcardImport:SSLHelper.kt$import javax.net.ssl.* @@ -11952,7 +11987,6 @@ WildcardImport:ServiceHub.kt$import net.corda.core.node.services.* WildcardImport:ServiceHubInternal.kt$import net.corda.core.internal.* WildcardImport:ServicesForResolutionImpl.kt$import net.corda.core.contracts.* - WildcardImport:SetsSerializationTest.kt$import org.junit.Assert.* WildcardImport:SettingsModel.kt$import net.corda.core.internal.* WildcardImport:SettingsModel.kt$import tornadofx.* WildcardImport:SharedContexts.kt$import net.corda.core.serialization.* @@ -11970,7 +12004,6 @@ WildcardImport:StatePointerSearchTests.kt$import net.corda.core.contracts.* WildcardImport:StubOutForDJVM.kt$import kotlin.annotation.AnnotationTarget.* WildcardImport:SubFlow.kt$import net.corda.core.flows.* - WildcardImport:SwapIdentitiesFlow.kt$import net.corda.core.flows.* WildcardImport:SwapIdentitiesFlowTests.kt$import net.corda.testing.core.* WildcardImport:TLSAuthenticationTests.kt$import javax.net.ssl.* WildcardImport:TLSAuthenticationTests.kt$import kotlin.test.* @@ -11981,6 +12014,7 @@ WildcardImport:TestCommsFlow.kt$import net.corda.core.flows.* WildcardImport:TestCordappImpl.kt$import net.corda.core.internal.* WildcardImport:TestDSL.kt$import net.corda.core.contracts.* + WildcardImport:TestDSL.kt$import net.corda.core.internal.* WildcardImport:TestResponseFlowInIsolation.kt$import net.corda.core.flows.* WildcardImport:TestUtils.kt$import net.corda.core.crypto.* WildcardImport:ThrowableSerializer.kt$import net.corda.serialization.internal.amqp.*