<?xml version="1.0" encoding="UTF-8"?>
<test-data
    xmlns="http://pmd.sourceforge.net/rule-tests"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">

    <test-code>
        <description>ok</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import org.apache.log4j.Logger;
public class Foo {
    Logger log;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>two loggers</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>2</expected-linenumbers>
        <code><![CDATA[
import org.apache.log4j.Logger;
public class Foo {
    Logger log;
    Logger log2;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>different logger for inner class</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import org.apache.log4j.Logger;
public class Foo {
    Logger log;
    class Bar {
        Logger log2;
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>ok, fixing NPE bug</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public @interface Foo {
    String FOO = "foo";
}
        ]]></code>
    </test-code>

    <test-code>
        <description>https://github.com/pmd/pmd/pull/42: Add SLF4j Logger type</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import org.slf4j.Logger;
public class Foo {
    Logger log;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>https://github.com/pmd/pmd/pull/42: Add SLF4j Logger type: Two Loggers</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>2</expected-linenumbers>
        <code><![CDATA[
import org.slf4j.Logger;
public class Foo {
    Logger log;
    Logger log2;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Add log4j2 Logger type</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import org.apache.logging.log4j.Logger;
public class Foo {
    Logger log;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Logger type log4j2: Two Loggers</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>2</expected-linenumbers>
        <code><![CDATA[
import org.apache.logging.log4j.Logger;
public class Foo {
    Logger log;
    Logger log2;
}
        ]]></code>
    </test-code>

    <test-code>
        <description>issue 3304 - rule robustness</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
import java.util.ArrayList;
import java.util.List;

public record Reproducer(List<String> smsIds) {

  public Reproducer createMe(final String smsId) {
    final List<String> newList = new ArrayList<>(smsIds);
    newList.add(smsId);
    return new Reproducer(newList);
  }
}
        ]]></code>
    </test-code>
</test-data>
