class DefaultSofaModuleProfileChecker implements SofaModuleProfileChecker, InitializingBean {

    private final Set<String> activeProfiles = new HashSet<>();

    private List<String>      userCustomProfiles;

    @Override
    public void afterPropertiesSet() {
        init();
    }

    public void init() {
        activeProfiles.add(DeploymentDescriptorConfiguration.DEFAULT_PROFILE_VALUE);
        if (userCustomProfiles != null) {
            activeProfiles.addAll(userCustomProfiles.stream().map(String::trim).collect(Collectors.toSet()));
        }
        for (String sofaProfile : activeProfiles) {
            validateProfile(sofaProfile);
        }
    }

    @Override
    public boolean acceptProfiles(String[] sofaModuleProfiles) {<FILL_FUNCTION_BODY>}

    @Override
    public boolean acceptModule(DeploymentDescriptor deploymentDescriptor) {
        return acceptProfiles(getModuleProfiles(deploymentDescriptor));
    }

    private boolean isProfileActive(String moduleProfile) {
        validateProfile(moduleProfile);
        return this.activeProfiles.contains(moduleProfile.trim());
    }

    private void validateProfile(String profile) {
        if (!StringUtils.hasText(profile)) {
            throw new IllegalArgumentException(ErrorCode.convert("01-13001", profile,
                DeploymentDescriptorConfiguration.DEFAULT_PROFILE_VALUE));
        }

        if (profile.charAt(0) == '!') {
            throw new IllegalArgumentException(ErrorCode.convert("01-13002", profile));
        }
    }

    private String[] getModuleProfiles(DeploymentDescriptor deploymentDescriptor) {
        String profiles = deploymentDescriptor
            .getProperty(DeploymentDescriptorConfiguration.MODULE_PROFILE);
        if (StringUtils.hasText(profiles)) {
            return StringUtils.commaDelimitedListToStringArray(profiles);
        } else {
            return new String[] { DeploymentDescriptorConfiguration.DEFAULT_PROFILE_VALUE };
        }

    }

    public List<String> getUserCustomProfiles() {
        return userCustomProfiles;
    }

    public void setUserCustomProfiles(List<String> userCustomProfiles) {
        this.userCustomProfiles = userCustomProfiles;
    }
}

        Assert.notEmpty(sofaModuleProfiles,
            ErrorCode.convert("01-13000", DeploymentDescriptorConfiguration.DEFAULT_PROFILE_VALUE));
        for (String sofaModuleProfile : sofaModuleProfiles) {
            if (StringUtils.hasText(sofaModuleProfile) && sofaModuleProfile.charAt(0) == '!') {
                if (!isProfileActive(sofaModuleProfile.substring(1))) {
                    return true;
                }
            } else if (isProfileActive(sofaModuleProfile)) {
                return true;
            }
        }
        return false;
    
<no_super_class>