<commit_before>package org.openspaces.pu.sla.config;

import org.openspaces.pu.sla.ScaleUpPolicy;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;

/**
 * A bean definition builder for {@link org.openspaces.pu.sla.ScaleUpPolicy}.
 *
 * @author kimchy
 */
public class ScaleUpPolicyBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {

    protected Class<ScaleUpPolicy> getBeanClass(Element element) {
        return ScaleUpPolicy.class;
    }

    protected void doParse(Element element, BeanDefinitionBuilder builder) {
        String monitor = element.getAttribute("monitor");
        builder.addPropertyValue("monitor", monitor);
        String low = element.getAttribute("low");
        if (StringUtils.hasLength(low)) {
            builder.addPropertyValue("low", low);
        }
        String high = element.getAttribute("high");
        if (StringUtils.hasLength(high)) {
            builder.addPropertyValue("high", high);
        }
        String maxInstances = element.getAttribute("max-instances");
        if (StringUtils.hasLength(maxInstances)) {
            builder.addPropertyValue("scaleUpTo", maxInstances);
        }
    }
}<commit_msg>GS-1918 OpenSpaces - PU deployment error with "os-sla:scale-up-policy"<commit_after>package org.openspaces.pu.sla.config;

import org.openspaces.pu.sla.ScaleUpPolicy;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.springframework.util.StringUtils;
import org.w3c.dom.Element;

/**
 * A bean definition builder for {@link org.openspaces.pu.sla.ScaleUpPolicy}.
 *
 * @author kimchy
 */
public class ScaleUpPolicyBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {

    protected Class<ScaleUpPolicy> getBeanClass(Element element) {
        return ScaleUpPolicy.class;
    }

    protected void doParse(Element element, BeanDefinitionBuilder builder) {
        String monitor = element.getAttribute("monitor");
        builder.addPropertyValue("monitor", monitor);
        String low = element.getAttribute("low");
        if (StringUtils.hasLength(low)) {
            builder.addPropertyValue("low", low);
        }
        String high = element.getAttribute("high");
        if (StringUtils.hasLength(high)) {
            builder.addPropertyValue("high", high);
        }
        String maxInstances = element.getAttribute("max-instances");
        if (StringUtils.hasLength(maxInstances)) {
            builder.addPropertyValue("maxInstances", maxInstances);
        }
    }
}
{'fraction_non_alphanumeric': 0.10675381263616558, 'fraction_numerical': 0.002178649237472767, 'mean_word_length': 3.7418244406196215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1922134', 'n_tokens_mistral': 737, 'n_tokens_neox': 727, 'n_words': 134}