<commit_before>package fr.liglab.mining.io;

import java.util.Arrays;

/**
 * a PatternsCollector decorator : it will sort items in transactions before
 * transmitting them to the enclosed PatternsCollector
 */
public class PatternSortCollector implements PatternsCollector {

	protected final PatternsCollector decorated;

	public PatternSortCollector(PatternsCollector wrapped) {
		this.decorated = wrapped;
	}

	public void collect(final int support, final int[] pattern) {
		Arrays.sort(pattern);
		this.decorated.collect(support, pattern);
	}

	public long close() {
		return this.decorated.close();
	}

	public int getAveragePatternLength() {
		return this.decorated.getAveragePatternLength();
	}

}<commit_msg>reverting change on patternSortCollector - it does have to instantiate a new array<commit_after>package fr.liglab.mining.io;

import java.util.Arrays;

/**
 * a PatternsCollector decorator : it will sort items in transactions before
 * transmitting them to the enclosed PatternsCollector
 */
public class PatternSortCollector implements PatternsCollector {

	protected final PatternsCollector decorated;

	public PatternSortCollector(PatternsCollector wrapped) {
		this.decorated = wrapped;
	}

	public void collect(final int support, final int[] pattern) {
		int[] sorted = Arrays.copyOf(pattern, pattern.length);
		Arrays.sort(sorted);
		this.decorated.collect(support, sorted);
	}

	public long close() {
		return this.decorated.close();
	}

	public int getAveragePatternLength() {
		return this.decorated.getAveragePatternLength();
	}

}
{'fraction_non_alphanumeric': 0.08729139922978177, 'fraction_numerical': 0.0, 'mean_word_length': 5.16205533596838, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3017547', 'n_tokens_mistral': 468, 'n_tokens_neox': 437, 'n_words': 125}