<commit_before>package org.xtest.validation;

import java.util.Map;
import java.util.Set;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.xtext.common.types.JvmField;
import org.eclipse.xtext.common.types.JvmIdentifiableElement;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.common.types.util.TypeConformanceComputer;
import org.eclipse.xtext.common.types.util.TypeReferences;
import org.eclipse.xtext.diagnostics.Severity;
import org.eclipse.xtext.util.CancelIndicator;
import org.eclipse.xtext.validation.CancelableDiagnostician;
import org.eclipse.xtext.validation.Check;
import org.eclipse.xtext.validation.CheckType;
import org.eclipse.xtext.xbase.XAssignment;
import org.eclipse.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.typing.ITypeProvider;
import org.xtest.XTestAssertException;
import org.xtest.XTestEvaluationException;
import org.xtest.XTestRunner;
import org.xtest.XTestRunner.DontRunCheck;
import org.xtest.preferences.PerFilePreferenceProvider;
import org.xtest.preferences.RuntimePref;
import org.xtest.results.XTestResult;
import org.xtest.xTest.Body;
import org.xtest.xTest.XAssertExpression;
import org.xtest.xTest.XTestPackage;
import org.xtest.xTest.impl.BodyImplCustom;

import com.google.common.collect.HashMultimap;
import com.google.inject.Inject;
import com.google.inject.Singleton;

/**
 * Validator for xtest expression models. Validates that:
 * <ul>
 * <li>assert expressions have boolean return type
 * <li>assert/throws types are subclasses are throwable
 * <li><b>All unit tests pass</b> </ol>
 * 
 * @author <NAME>
 */
@Singleton
@SuppressWarnings("restriction")
public class XTestJavaValidator extends AbstractXTestJavaValidator {
    private static final int TEST_RUN_FAILURE_INDEX = Integer.MIN_VALUE;
    private final ThreadLocal<CancelIndicator> cancelIndicators = new ThreadLocal<CancelIndicator>();
    private final ThreadLocal<HashMultimap<Severity, EObject>> issues = new ThreadLocal<HashMultimap<Severity, EObject>>();
    @Inject
    private PerFilePreferenceProvider preferenceProvider;
    @Inject
    private XTestRunner runner;
    @Inject
    private TypeConformanceComputer typeConformanceComputer;
    @Inject
    private ITypeProvider typeProvider;
    @Inject<commit_msg>Changing xtest result issue index to max into to sort after all other issues.<commit_after>package org.xtest.validation;

import java.util.Map;
import java.util.Set;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.xtext.common.types.JvmField;
import org.eclipse.xtext.common.types.JvmIdentifiableElement;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.common.types.util.TypeConformanceComputer;
import org.eclipse.xtext.common.types.util.TypeReferences;
import org.eclipse.xtext.diagnostics.Severity;
import org.eclipse.xtext.util.CancelIndicator;
import org.eclipse.xtext.validation.CancelableDiagnostician;
import org.eclipse.xtext.validation.Check;
import org.eclipse.xtext.validation.CheckType;
import org.eclipse.xtext.xbase.XAssignment;
import org.eclipse.xtext.xbase.XExpression;
import org.eclipse.xtext.xbase.typing.ITypeProvider;
import org.xtest.XTestAssertException;
import org.xtest.XTestEvaluationException;
import org.xtest.XTestRunner;
import org.xtest.XTestRunner.DontRunCheck;
import org.xtest.preferences.PerFilePreferenceProvider;
import org.xtest.preferences.RuntimePref;
import org.xtest.results.XTestResult;
import org.xtest.xTest.Body;
import org.xtest.xTest.XAssertExpression;
import org.xtest.xTest.XTestPackage;
import org.xtest.xTest.impl.BodyImplCustom;

import com.google.common.collect.HashMultimap;
import com.google.inject.Inject;
import com.google.inject.Singleton;

/**
 * Validator for xtest expression models. Validates that:
 * <ul>
 * <li>assert expressions have boolean return type
 * <li>assert/throws types are subclasses are throwable
 * <li><b>All unit tests pass</b> </ol>
 * 
 * @author <NAME>
 */
@Singleton
@SuppressWarnings("restriction")
public class XTestJavaValidator extends AbstractXTestJavaValidator {
    private static final int TEST_RUN_FAILURE_INDEX = Integer.MAX_VALUE;
    private final ThreadLocal<CancelIndicator> cancelIndicators = new ThreadLocal<CancelIndicator>();
    private final ThreadLocal<HashMultimap<Severity, EObject>> issues = new ThreadLocal<HashMultimap<Severity, EObject>>();
    @Inject
    private PerFilePreferenceProvider preferenceProvider;
    @Inject
    private XTestRunner runner;
    @Inject
    private TypeConformanceComputer typeConformanceComputer;
    @Inject
    private ITypeProvider typeProvider;
    @Inject
{'fraction_non_alphanumeric': 0.09589892294946148, 'fraction_numerical': 0.0, 'mean_word_length': 6.0087082728592165, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, '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': '825454', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1494, 'n_words': 286}