<?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>basic use case - calls to run()</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
    public void bar() {
        Thread t = new Thread();
        t.run();                // use t.start() instead
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>basic use case - call to Thread().run()</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
    public void bar() {
        new Thread().run();
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>[java]DontCallThreadRun can't detect the case that call run() in foo.bar.run() #2538</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[

public class Foo {
    private Thread bar;
    public void bar(Foo foo) {
        foo.bar.run();
    }
}
        ]]></code>
    </test-code>
    <test-code>
        <description>[java]DontCallThreadRun can't detect the case that call run() in this.run() #2537</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
            public class MatrixThread extends Thread {

                public MatrixThread(int[][] m1, int[][] m2) {
                    this.m1 = m1;
                    this.m2 = m2;
                    this.run();
                }
            }
            ]]></code>
    </test-code>
</test-data>
