<commit_before>import util.Color;

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

/**
 * Created by <NAME> on 3/14/2017.
 */
public class Train implements Notifiable {
    private Statistics stat;
    private List<TrainPart> trainPartList;
    private List<Train> trainList;
    private boolean isRunning;

    public Train(Statistics st, List<Train> trainList) {
        System.out.println("Train.Train");
        stat = st;
        this.trainList = trainList;
        isRunning = false;
        trainPartList = new ArrayList<>();
    }

    public void move() {
        System.out.println("Train.move");
        for (TrainPart tp : trainPartList) {
            tp.move();
        }
    }

    public void explode() {
        System.out.println("Train.explode");
        stat.trainExploded();
    }

    public boolean isRunning() {
        System.out.println("Train.isRunning");
        return isRunning;
    }

    public void addPart(TrainPart p) {
        System.out.println("Train.addPart");
        trainPartList.add(p);
    }

    public Color getColor() {
        System.out.println("Train.getColor");
        return new Color("");
    }

    public void startTrain() {
        System.out.println("Train.startTrain");
        isRunning = true;
    }

    public void checkCollision() {
        System.out.println("Train.checkCollision");
        for (Train other : trainList) {
            List<TrainPart> othParts = other.getPartList();
            if (other != this && other.isRunning()) {
                for (TrainPart otherPart : othParts) {
                    for (TrainPart ownPart : trainPartList) {
                        boolean collided = otherPart.checkCollision(ownPart);
                        if (collided)
                            explode();<commit_msg>szkeleton: Train collision checking fix<commit_after>import util.Color;

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

/**
 * Created by <NAME> on 3/14/2017.
 */
public class Train implements Notifiable {
    private Statistics stat;
    private List<TrainPart> trainPartList;
    private List<Train> trainList;
    private boolean isRunning;

    public Train(Statistics st, List<Train> trainList) {
        System.out.println("Train.Train");
        stat = st;
        this.trainList = trainList;
        isRunning = false;
        trainPartList = new ArrayList<>();
    }

    public void move() {
        System.out.println("Train.move");
        for (TrainPart tp : trainPartList) {
            tp.move();
        }
    }

    public void explode() {
        System.out.println("Train.explode");
        stat.trainExploded();
    }

    public boolean isRunning() {
        System.out.println("Train.isRunning");
        return isRunning;
    }

    public void addPart(TrainPart p) {
        System.out.println("Train.addPart");
        trainPartList.add(p);
    }

    public Color getColor() {
        System.out.println("Train.getColor");
        return new Color("");
    }

    public void startTrain() {
        System.out.println("Train.startTrain");
        isRunning = true;
    }

    public void checkCollision() {
        System.out.println("Train.checkCollision");
        for (Train other : trainList) {
            List<TrainPart> othParts = other.getPartList();
            if (other != this && other.isRunning()) {
                for (TrainPart otherPart : othParts) {
                    for (TrainPart ownPart : trainPartList) {
                        boolean collided = otherPart.checkCollision(ownPart);
                        if (collided) {
                            explode();
                            return;
                        }
{'fraction_non_alphanumeric': 0.1134133042529989, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 1.9829268292682927, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '6316235', 'n_tokens_mistral': 1054, 'n_tokens_neox': 981, 'n_words': 226}