<commit_before>import java.util.List;

private class NexusBeams {

    private final List<Beam> mBeams;
    private final IntList mColours;

    NexusBeams() {
        mBeams = new ArrayList<Beam>();
        mColours = new IntList();
        for (int i = 0; i < COLOURS.length; i++) {
            mColours.append(i);
        }
    }

    void update() {
        if (int(random(BEAM_CHANCE_OF_FIRING)) == 0) {
            mBeams.add(createNewBeam());
        }
        for (int i = mBeams.size() - 1; i >= 0; i--) {
            mBeams.get(i).move();
            if (mBeams.get(i).isGone()) {
                mBeams.remove(i);
            }
        }
    }

    void draw() {
        for (Beam beam : mBeams) {
            beam.draw();
        }
    }

    void createTouchBeams(int touchX, int touchY) {
        for (Beam touchBeam : createNewTouchBeams(touchX, touchY)) {
            mBeams.add(touchBeam);
        }
    }

    private Beam createNewBeam() {
        switch (Direction.getRandomDirection()) {
            case UP:
                return new UpwardsBeam(BeamType.getRandomBeamType());
            case DOWN:
                return new DownwardsBeam(BeamType.getRandomBeamType());
            case LEFT:
                return new LeftwardsBeam(BeamType.getRandomBeamType());
            case RIGHT:
                return new RightwardsBeam(BeamType.getRandomBeamType());
            default: // Should not happen
                println("Error: Returned an invalid beam direction");
                exit();
                return null;
        }
    }

    private Beam[] createNewTouchBeams(int touchX, int touchY) {
        mColours.shuffle();
        BeamType beamtype = BeamType.getRandomBeamType();
        return new Beam[] {
            new UpwardsBeam(beamtype, touchX, touchY, mColours.get(UP)),
            new DownwardsBeam(beamtype, touchX, touchY, mColours.get(DOWN)),
            new LeftwardsBeam(beamtype, touchX, touchY, mColours.get(LEFT)),
            new RightwardsBeam(beamtype, touchX, touchY, mColours.get(RIGHT))
        };
    }
}<commit_msg>Rewrite invalid beam direction error message<commit_after>import java.util.List;

private class NexusBeams {

    private final List<Beam> mBeams;
    private final IntList mColours;

    NexusBeams() {
        mBeams = new ArrayList<Beam>();
        mColours = new IntList();
        for (int i = 0; i < COLOURS.length; i++) {
            mColours.append(i);
        }
    }

    void update() {
        if (int(random(BEAM_CHANCE_OF_FIRING)) == 0) {
            mBeams.add(createNewBeam());
        }
        for (int i = mBeams.size() - 1; i >= 0; i--) {
            mBeams.get(i).move();
            if (mBeams.get(i).isGone()) {
                mBeams.remove(i);
            }
        }
    }

    void draw() {
        for (Beam beam : mBeams) {
            beam.draw();
        }
    }

    void createTouchBeams(int touchX, int touchY) {
        for (Beam touchBeam : createNewTouchBeams(touchX, touchY)) {
            mBeams.add(touchBeam);
        }
    }

    private Beam createNewBeam() {
        switch (Direction.getRandomDirection()) {
            case UP:
                return new UpwardsBeam(BeamType.getRandomBeamType());
            case DOWN:
                return new DownwardsBeam(BeamType.getRandomBeamType());
            case LEFT:
                return new LeftwardsBeam(BeamType.getRandomBeamType());
            case RIGHT:
                return new RightwardsBeam(BeamType.getRandomBeamType());
            default: // Should never happen
                println("Fatal error: Returned an invalid beam direction");
                exit();
                return null;
        }
    }

    private Beam[] createNewTouchBeams(int touchX, int touchY) {
        mColours.shuffle();
        BeamType beamtype = BeamType.getRandomBeamType();
        return new Beam[] {
            new UpwardsBeam(beamtype, touchX, touchY, mColours.get(UP)),
            new DownwardsBeam(beamtype, touchX, touchY, mColours.get(DOWN)),
            new LeftwardsBeam(beamtype, touchX, touchY, mColours.get(LEFT)),
            new RightwardsBeam(beamtype, touchX, touchY, mColours.get(RIGHT))
        };
    }
}
{'fraction_non_alphanumeric': 0.1117717003567182, 'fraction_numerical': 0.0019024970273483948, 'mean_word_length': 1.8553971486761711, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6385673', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1281, 'n_words': 276}