From 4c8a5b3e17116fa565b33d8bcd73d19dd38b0dba Mon Sep 17 00:00:00 2001 From: Robert Stoll Date: Tue, 2 Mar 2021 22:07:59 +0100 Subject: [PATCH] cleanup --- .../creating/impl/ComponentFactoryContainerImpl.kt | 14 ++++---------- .../atrium/reporting/impl/OnlyFailureReporter.kt | 5 +---- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt index df3bc7d67..87985694b 100644 --- a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt +++ b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/creating/impl/ComponentFactoryContainerImpl.kt @@ -112,18 +112,12 @@ private infix fun KClass.createChainVia(factories: Sequence<(Compon this to factories.map { ComponentFactory(it, producesSingleton = false) } -// TODO 0.17.0 I guess it would make sense to cache instance here and only re-create them if this component was merged -// with another because most Atrium users won't change the components and it would most likely just be a waste of -// resources to re-create all over and over again. On the other hand they would be very short-lived an most likely -// just be swept away when GC kicks in (not survive the young generation) @ExperimentalComponentFactoryContainer //TODO 0.17.0 or 0.18.0 make internal object DefaultComponentFactoryContainer : ComponentFactoryContainer by ComponentFactoryContainerImpl( mapOf( - Reporter::class createSingletonVia { c -> - OnlyFailureReporter(c.build(), c.build()) - }, + Reporter::class createSingletonVia { c -> OnlyFailureReporter(c.build(), c.build()) }, AssertionFormatterController::class createVia { _ -> DefaultAssertionFormatterController() }, ObjectFormatter::class createVia { c -> c.build() }, @@ -161,8 +155,8 @@ object DefaultComponentFactoryContainer : ComponentFactoryContainer by Component BulletPointProvider::class createVia { _ -> UsingDefaultBulletPoints } ), - mapOf(TextAssertionFormatterFactory::class createChainVia ( - sequenceOf( + mapOf( + TextAssertionFormatterFactory::class createChainVia sequenceOf( { c -> val bulletPoints = c.build().getBulletPoints() val textAssertionPairFormatter = c.build() @@ -204,5 +198,5 @@ object DefaultComponentFactoryContainer : ComponentFactoryContainer by Component } } ) - )) + ) ) diff --git a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/impl/OnlyFailureReporter.kt b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/impl/OnlyFailureReporter.kt index e25fee3f0..80b0c0312 100644 --- a/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/impl/OnlyFailureReporter.kt +++ b/core/api/atrium-core-api-common/src/main/kotlin/ch/tutteli/atrium/reporting/impl/OnlyFailureReporter.kt @@ -1,6 +1,3 @@ -//TODO remove file with 0.17.0 -@file:Suppress("OverridingDeprecatedMember") - package ch.tutteli.atrium.reporting.impl import ch.tutteli.atrium.assertions.Assertion @@ -20,7 +17,7 @@ import ch.tutteli.atrium.reporting.Reporter */ class OnlyFailureReporter( private val assertionFormatterFacade: AssertionFormatterFacade, - override val atriumErrorAdjuster: AtriumErrorAdjuster + @Suppress("OverridingDeprecatedMember") override val atriumErrorAdjuster: AtriumErrorAdjuster ) : Reporter { /**