Repository: appsmithorg/appsmith
File: app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/InstanceVariablesHelperCE.java (Java)

Code before:
package com.appsmith.server.helpers.ce;

import com.appsmith.server.constants.Appsmith;
import com.appsmith.server.services.ConfigService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;

/**
 * Helper class for accessing instance variables from the instance config
 */
@Component
@RequiredArgsConstructor
public class InstanceVariablesHelperCE {
    private final ConfigService configService;

    /**
     * Get the instance name from the instance variables
     * @return The instance name, or the default instance name if not set
     */
    public Mono<String> getInstanceName() {
        return configService.getInstanceVariables().map(instanceVariables -> {
            Object value = instanceVariables.getOrDefault("instanceName", Appsmith.DEFAULT_INSTANCE_NAME);
            return value != null ? value.toString() : Appsmith.DEFAULT_INSTANCE_NAME;
        });
    }

    /**
     * Get the email verification enabled flag from the instance variables
     * @return True if email verification is enabled, false otherwise
     */
    public Mono<Boolean> isEmailVerificationEnabled() {
        return configService.getInstanceVariables().map(instanceVariables -> {
            Object value = instanceVariables.getOrDefault("emailVerificationEnabled", false);
            if (value instanceof Boolean) {
                return (Boolean) value;
            }

Review comment (refactor):
Do we need to instantiate both `InstanceVariablesHelperCE` and `InstanceVariablesHelper` as separate beans? I think as we are already extending InstanceVariablesHelperCE in InstanceVariablesHelper we can let Spring create bean for InstanceVariablesHelper.

Code after:
package com.appsmith.server.helpers.ce;

import com.appsmith.server.constants.Appsmith;
import com.appsmith.server.services.ConfigService;
import lombok.RequiredArgsConstructor;
import reactor.core.publisher.Mono;

/**
 * Helper class for accessing instance variables from the instance config
 */
@RequiredArgsConstructor
public class InstanceVariablesHelperCE {
    private final ConfigService configService;

    /**
     * Get the instance name from the instance variables
     * @return The instance name, or the default instance name if not set
     */
    public Mono<String> getInstanceName() {
        return configService.getInstanceVariables().map(instanceVariables -> {
            Object value = instanceVariables.getOrDefault("instanceName", Appsmith.DEFAULT_INSTANCE_NAME);
            return value != null ? value.toString() : Appsmith.DEFAULT_INSTANCE_NAME;
        });
    }

    /**
     * Get the email verification enabled flag from the instance variables
     * @return True if email verification is enabled, false otherwise
     */
    public Mono<Boolean> isEmailVerificationEnabled() {
        return configService.getInstanceVariables().map(instanceVariables -> {
            Object value = instanceVariables.getOrDefault("emailVerificationEnabled", false);
            if (value instanceof Boolean) {
                return (Boolean) value;
            }
            return Boolean.FALSE;
        });