Repository: ktorio/ktor
File: ktor-client/ktor-client-core/common/src/io/ktor/client/HttpClientConfig.kt (Kotlin)

Code before:
     */
    public var expectSuccess: Boolean = false

    /**
     * Development mode is no longer required all functionality is enabled by default. The property is safe to remove.
     */
    @Deprecated(
        "Development mode is no longer required. The property will be removed in the future.",
        level = DeprecationLevel.WARNING,
        replaceWith = ReplaceWith("")
    )
    public var developmentMode: Boolean = PlatformUtils.IS_DEVELOPMENT_MODE

    /**
     * Installs the specified [plugin] and optionally configures it using the [configure] block.
     *
     * ```kotlin
     * val client = HttpClient {
     *     install(ContentNegotiation) {
     *         // configuration block
     *         json()
     *     }
     * }
     * ```
     *
     * If the plugin is already installed, the Configuration block will be applied to the existing configuration class.
     *
     * Learn more from [Plugins](https://ktor.io/docs/http-client-plugins.html).
     */
    public fun <TBuilder : Any, TPlugin : Any> install(
        plugin: HttpClientPlugin<TBuilder, TPlugin>,
        configure: TBuilder.() -> Unit = {}
    ) {
        val previousConfigBlock = pluginConfigurations[plugin.key]
        pluginConfigurations[plugin.key] = {
            previousConfigBlock?.invoke(this)

            @Suppress("UNCHECKED_CAST")
            (this as TBuilder).configure()
        }

        if (plugins.containsKey(plugin.key)) return

        plugins[plugin.key] = { scope ->
            val attributes = scope.attributes.computeIfAbsent(PLUGIN_INSTALLED_LIST) { Attributes(concurrent = true) }
            val config = scope.config.pluginConfigurations[plugin.key]!!
            val pluginData = plugin.prepare(config)

            plugin.install(pluginData, scope)
            attributes.put(plugin.key, pluginData)
        }

Review comment (suggestion):
```suggestion
     * If the plugin is already installed, the configuration block will be applied to the existing configuration class.
```

Code after:
     */
    public var expectSuccess: Boolean = false

    /**
     * Development mode is no longer required all functionality is enabled by default. The property is safe to remove.
     */
    @Deprecated(
        "Development mode is no longer required. The property will be removed in the future.",
        level = DeprecationLevel.WARNING,
        replaceWith = ReplaceWith("")
    )
    public var developmentMode: Boolean = PlatformUtils.IS_DEVELOPMENT_MODE

    /**
     * Installs the specified [plugin] and optionally configures it using the [configure] block.
     *
     * ```kotlin
     * val client = HttpClient {
     *     install(ContentNegotiation) {
     *         // configuration block
     *         json()
     *     }
     * }
     * ```
     *
     * If the plugin is already installed, the configuration block will be applied to the existing configuration class.
     *
     * Learn more from [Plugins](https://ktor.io/docs/http-client-plugins.html).
     */
    public fun <TBuilder : Any, TPlugin : Any> install(
        plugin: HttpClientPlugin<TBuilder, TPlugin>,
        configure: TBuilder.() -> Unit = {}
    ) {
        val previousConfigBlock = pluginConfigurations[plugin.key]
        pluginConfigurations[plugin.key] = {
            previousConfigBlock?.invoke(this)

            @Suppress("UNCHECKED_CAST")
            (this as TBuilder).configure()
        }

        if (plugins.containsKey(plugin.key)) return

        plugins[plugin.key] = { scope ->
            val attributes = scope.attributes.computeIfAbsent(PLUGIN_INSTALLED_LIST) { Attributes(concurrent = true) }
            val config = scope.config.pluginConfigurations[plugin.key]!!
            val pluginData = plugin.prepare(config)

            plugin.install(pluginData, scope)
            attributes.put(plugin.key, pluginData)
        }