<commit_before>package org.motechproject.mds.service.impl;

import org.motechproject.mds.domain.AvailableType;
import org.motechproject.mds.dto.AvailableTypeDto;
import org.motechproject.mds.repository.AllAvailableTypes;
import org.motechproject.mds.service.AvailableTypeService;
import org.motechproject.mds.service.BaseMdsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * Default implementation of {@link org.motechproject.mds.service.AvailableTypeService} interface
 */
@Service
public class AvailableTypeServiceImpl extends BaseMdsService implements AvailableTypeService {
    private AllAvailableTypes allAvailableTypes;

    @Override
    public List<AvailableTypeDto> getAll() {
        List<AvailableType> availableTypes = allAvailableTypes.retrieveAll();
        List<AvailableTypeDto> list = new ArrayList<>();

        if (null != availableTypes) {
            for (AvailableType type : availableTypes) {
                list.add(type.toDto());
            }
        }

        return list;
    }

    @Autowired
    public void setAllAvailableTypes(AllAvailableTypes allAvailableTypes) {
        this.allAvailableTypes = allAvailableTypes;
    }
}<commit_msg>MDS: added missing @Transactional<commit_after>package org.motechproject.mds.service.impl;

import org.motechproject.mds.domain.AvailableType;
import org.motechproject.mds.dto.AvailableTypeDto;
import org.motechproject.mds.repository.AllAvailableTypes;
import org.motechproject.mds.service.AvailableTypeService;
import org.motechproject.mds.service.BaseMdsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * Default implementation of {@link org.motechproject.mds.service.AvailableTypeService} interface
 */
@Service
public class AvailableTypeServiceImpl extends BaseMdsService implements AvailableTypeService {
    private AllAvailableTypes allAvailableTypes;

    @Override
    @Transactional
    public List<AvailableTypeDto> getAll() {
        List<AvailableType> availableTypes = allAvailableTypes.retrieveAll();
        List<AvailableTypeDto> list = new ArrayList<>();

        if (null != availableTypes) {
            for (AvailableType type : availableTypes) {
                list.add(type.toDto());
            }
        }

        return list;
    }

    @Autowired
    public void setAllAvailableTypes(AllAvailableTypes allAvailableTypes) {
        this.allAvailableTypes = allAvailableTypes;
    }
}
{'fraction_non_alphanumeric': 0.08801775147928995, 'fraction_numerical': 0.0, 'mean_word_length': 4.1919385796545106, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3025483', 'n_tokens_mistral': 736, 'n_tokens_neox': 726, 'n_words': 136}