<commit_before>package edu.hm.hafner.analysis.parser;

import java.io.IOException;
import java.util.Iterator;

import org.junit.jupiter.api.Test;

import edu.hm.hafner.analysis.AbstractParser;
import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.Issues;
import edu.hm.hafner.analysis.Priority;
import static edu.hm.hafner.analysis.assertj.IssuesAssert.*;
import static edu.hm.hafner.analysis.assertj.SoftAssertions.*;

/**
 * Basic tests for the Eclipse parser.
 *
 * @author <NAME>
 */
public abstract class AbstractEclipseParserTest extends ParserTester {
    protected static final String TYPE = new EclipseParser().getId();

    /**
     * Creates the parser under test.
     *
     * @return the created parser
     */
    protected AbstractParser createParser() {
        return new EclipseParser();
    }

    @Override
    protected String getWarningsFile() {
        return "eclipse.txt";
    }

    /**
     * Parses a file with two deprecation warnings.
     *
     * @throws IOException if the file could not be read
     */
    @Test
    public void parseDeprecation() throws IOException {
        Issues warnings = createParser().parse(openFile());

        assertThat(warnings).hasSize(8);

        Iterator<Issue> iterator = warnings.iterator();
        Issue annotation = iterator.next();
        assertSoftly(softly -> softly.assertThat(annotation)
                .hasPriority(Priority.NORMAL)
                .hasCategory(DEFAULT_CATEGORY)
                .hasLineStart(3)
                .hasLineEnd(3)
                .hasMessage("The serializable class AttributeException does not declare a static final serialVersionUID field of type long")
                .hasFileName("C:/Desenvolvimento/Java/jfg/src/jfg/AttributeException.java")
                .hasType(TYPE)
        );
    }
}<commit_msg>Replaced unnecessary iterator call.<commit_after>package edu.hm.hafner.analysis.parser;

import java.io.IOException;

import org.junit.jupiter.api.Test;

import edu.hm.hafner.analysis.AbstractParser;
import edu.hm.hafner.analysis.Issue;
import edu.hm.hafner.analysis.Issues;
import edu.hm.hafner.analysis.Priority;
import static edu.hm.hafner.analysis.assertj.IssuesAssert.*;
import static edu.hm.hafner.analysis.assertj.SoftAssertions.*;

/**
 * Basic tests for the Eclipse parser.
 *
 * @author <NAME>
 */
public abstract class AbstractEclipseParserTest extends ParserTester {
    protected static final String TYPE = new EclipseParser().getId();

    /**
     * Creates the parser under test.
     *
     * @return the created parser
     */
    protected AbstractParser createParser() {
        return new EclipseParser();
    }

    @Override
    protected String getWarningsFile() {
        return "eclipse.txt";
    }

    /**
     * Parses a file with two deprecation warnings.
     *
     * @throws IOException if the file could not be read
     */
    @Test
    public void parseDeprecation() throws IOException {
        Issues warnings = createParser().parse(openFile());

        assertThat(warnings).hasSize(8);

        Issue annotation = warnings.get(0);
        assertSoftly(softly -> softly.assertThat(annotation)
                .hasPriority(Priority.NORMAL)
                .hasCategory(DEFAULT_CATEGORY)
                .hasLineStart(3)
                .hasLineEnd(3)
                .hasMessage("The serializable class AttributeException does not declare a static final serialVersionUID field of type long")
                .hasFileName("C:/Desenvolvimento/Java/jfg/src/jfg/AttributeException.java")
                .hasType(TYPE)
        );
    }
}
{'fraction_non_alphanumeric': 0.10074937552039967, 'fraction_numerical': 0.0019428254232583958, 'mean_word_length': 2.707818930041152, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '5529775', 'n_tokens_mistral': 1038, 'n_tokens_neox': 1003, 'n_words': 236}