<?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>all glommed together</description>
        <expected-problems>6</expected-problems>
        <code><![CDATA[
public class Foo {
    void method (int x) {
        new Integer(x).toString();
        new Long(x).toString();
        new Float(x).toString();
        new Byte((byte)x).toString();
        new Double(x).toString();
        new Short((short)x).toString();
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>called on String</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    Long method (Foo foo) {
        return new Long(foo.get().toString());
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Preferred approach - static toString</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    public String convert(int x) {
        return Integer.toString(x);             // preferred approach
    }
}
        ]]></code>
    </test-code>
</test-data>
