<commit_before>package com.example;

import com.example.domain.Book;
import com.example.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created so that I can see data on http://localhost:8080/
 */

@Controller
public class BooksController {

    @Autowired
    private BookService bookService;

    @GetMapping("/")
    @ResponseBody
    public List<Book> getAllBooks() {
        return bookService.getAllBooks();
    }
}<commit_msg>Favor constructor injection over field injection<commit_after>package com.example;

import com.example.domain.Book;
import com.example.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created so that I can see data on http://localhost:8080/
 */

@Controller
public class BooksController {

    private BookService bookService;

    public BooksController(@Autowired final BookService bookService) {
        this.bookService = bookService;
    }

    @GetMapping("/")
    @ResponseBody
    public List<Book> getAllBooks() {
        return bookService.getAllBooks();
    }
}
{'fraction_non_alphanumeric': 0.10067567567567567, 'fraction_numerical': 0.005405405405405406, 'mean_word_length': 4.5055762081784385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7312411', 'n_tokens_mistral': 409, 'n_tokens_neox': 400, 'n_words': 91}