<?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>Failure Case: Empty If Statement</description>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
public class Foo {
    public void foo() {
        if(true) {
        }
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>Success Case: Empty If statement</description>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
public class Foo {
    public void foo() {
        if(true) {
            system.debug(true);
        }
    }
}
        ]]></code>
    </test-code>

    <test-code>
        <description>EmptyIfStatement in trigger (#5138)</description>
        <expected-problems>1</expected-problems>
        <expected-linenumbers>9</expected-linenumbers>
        <code><![CDATA[
// https://github.com/SalesforceLabs/chatter-delete-blocker/blob/master/src/triggers/DisableFeedPostDeletes.trigger
/**
 * Author: Marcus Ericsson - mericsson@salesforce.com
 */
trigger DisableFeedPostDeletes on FeedItem (before delete)
{
    if (!DisableChatterDeleteDelegate.allowDelete()) {
        for(FeedItem f : Trigger.old){
            if (((String)f.parentId).startsWith('00Q') && f.type == 'TrackedChange') {
                // ok to ignore
            }
            else {
                f.addError('Your administrator has disabled feed post and comment deletions.');
            }
        }
    }
}
]]></code>
    </test-code>
</test-data>
